UnicodeTest/LockedTest

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Ooooooh, yes, I will write an AHK script then to automatically call the Unlocker! :mrgreen:
Ah well, AHK is not needed in this case but, who cares? ;)

Icfu
This account is for sale
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

it would be cool if Unlocker could be set not to ask but just to terminate

(so, there is a need for AHK script, but I prefer somebody send to the author of this cool progy some notes about this )
Habemus majkam!
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

It has a silent switch, check the changelog. ;)
Unlocker 1.5.1 - 05/05/2005

- Now you have the choice during install between the Explorer extension or a SendTo shortcut or both or neither. Thanks to Icfu and Marcus for the suggestion
- Added a silent mode for people who want to use unlocker as a command line. The syntax is: unlocker.exe filename /S (or -S) and it will unlock all found handles without showing the window. Thanks to Ghenadie Cotaga for the suggestion
Icfu
This account is for sale
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2SanskritFritz
One small (?) request: another field, that shows the application that locks that particular file!
Sorry, but I don't know how to get that application name. Do you know?
2majkinetor !
don't need 3th field, just put the name of the app in place where you stored "locked" string
So, you suggest to add 3rd field and to delete 2nd... what about case when plugin failed to get application name?
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Sorry, but I don't know how to get that application name. Do you know?
I will check this out. Why don't U contact author of the Unlocker for the tips ? He might help since your plug is to be used in combination with Unlocker.... Ok.. I will do that.
what about case when plugin failed to get application name?
What about "<Unknown App>" ?
Habemus majkam!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Ok, I send e-mail to Unlocker author:
---------------------------------------------------
  • Hi there

    This is the issue that arose on the Total Commander user forum. Please visit the link at the bottom for details. In short, the guy (Alextp) created content plugin for TC that will show in custom column if file is locked.

    The problem is this: Now plugin shows only if file is locked or not. We suggested that it should instead display the name of the application that locked the file. He want's to implement it, but he doesn't know what APIs to use to obtain that information. Since this plugin is going to be used in combination with your Unlocker (in order to drop locks, using silent mode) we thought it a good idea to help this man or just give him a direction. Any tip, suggestion or peace of code would be highly appreciated. Just for the note, this plugin is freeware (like most of them are).


    Send mail to AlexTp or just post on the forum bellow if you can help.


    AlexTp mail: *********
    TC forum post: http://www.ghisler.ch/board/viewtopic.php?p=78773#78773
Habemus majkam!
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2majkinetor !
What about "<Unknown App>" ?
Good.
Ok, I send e-mail to Unlocker author:
Thanks. Let's hope he will reply...
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Please let me informed about what happend... if he doesn't replay I am going to investigate myself, since I am interested in that topic myself....
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Importance of the spelling…

Post by *Clo »

2majkinetor !

:) Hello !
…peace of code…
[humour] Indeed, we don't need war-codes ! [/humour]

- What about : "…a piece of code…" ? :P

:mrgreen: R
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2Clo
Careful there... :twisted:
I switched to Linux, bye and thanks for all the fish!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

<Unknown App>
Make sure that some forbidden char is in the string like < or >... or apps named Unknown App will be missed.


2 Clo
Thx... my english sucks.
Habemus majkam!
CoolWater
Power Member
Power Member
Posts: 737
Joined: 2003-03-27, 16:33 UTC

Post by *CoolWater »

Alextp wrote:Sorry, but I don't know how to get that application name. Do you know?
May you can use the sysinternals handle commandline program (freeware) to obtain the "Locker" (EXE file name of the locking program is retrieved) of a file. The program writes the output to stdout. So you could read and parse the output.

http://www.sysinternals.com/Utilities/Handle.html

HTH,
CoolWater
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Handle is cool as an app but not for this .. I was just checking if source is available, but no.

This would be very slow but can be speed up in some measure using Memory Mapped Files.

Another approach would be enumerting all open files in each application and comparing to selected one, but this is also slow. This maybe better solution because list can be created once for first file and used again for next since lock will certanly not be droped for such a small time.

I am curretnly searching for this. Unlocking is very easy, just one API call. What do you use to find if file is locked Alex ?


You may check this for some info. Maybe there is something that can help in Native Api calls.
http://www.sysinternals.com/Information/NativeApi.html
Habemus majkam!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Another thing Alex.

You should download this tool
ApiMonitor: http://www.rohitab.com/apimonitor/apimonitor.zip

Then load handle.exe in it and watch its API calls. You will get something like this:

Code: Select all

Process		Process ID		Win32 API		Parameters		Return Value		Status		GetLastError

Handle		0x1AC		NtProtectVirtualMemory		Stack8:0x12FD08, Stack9:0x77E616B4, Stack10:0xFFFFFFFF		Un-Documented		SUCCESS		0
Handle		0x1AC		NtQueryInformationToken		token:0xDC, tokeninfoclass:0x1, tokeninfo:0x12E92C, tokeninfolength:0x800, retlen:0x12E924		0x0		SUCCESS		0
...... 
......
I was trying this: I looked at handles returned by handle.exe and then searched for those handles among API call parameters. Several lines were found all being about Virtual Memory. From this, I guess there is no specific API call to use to obtain this info, but some other procedure is involved.

--------------------------------------------------------
I don't know model for TC content plugin.
Is it possible for you to first obtain whole selection and then proccess every file ?
Habemus majkam!
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

Unlocking is very easy, just one API call.
What call?
What do you use to find if file is locked Alex ?
One CreateFile() call.
Is it possible for you to first obtain whole selection and then proccess every file ?
The whole list of selected files in panel? No, plugin gets 1 file at a time.
Post Reply