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

User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2KevinMo
Would you mind to add another column which uses only one letter or several letters to indicate the information?
What for you need such column? What about 2nd column ("Locked test")?
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

That is, there is no INIT event or PRE/POST events or usual things all good models have ....

GHSILER should change this.

for instance:
You should post this idea in new topic, Ghisler don't read here.
Anyway this is the procedure for now:
In your procedure T is remembered only once, so after C refresh will be made on each call. I think we should remember T after every system shot.

The questions:
1. How to list all processes and their locked files? (what handle.exe does) Can you write Delphi example?
2. Can I include Handle.exe into plugin archive?
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

In your procedure T is remembered only once, so after C refresh will be made on each call. I think we should remember T after every system shot.
Of course.... I droped that because it was obvious...
  • if (C-T>val) do begin T=Time(); systemshot() end;
1. How to list all processes and their locked files? (what handle.exe does) Can you write Delphi example?
It can be done via PSAPI. The function is EnumProcessModules. To iterate through all process use EnumProcesses. Searh for PSAPI functions in MSDN for more details. This is very easy... you don't need examples.
If I find time to write some code anyway, I will post it here.
2. Can I include Handle.exe into plugin archive?
Of course.... your plug is freeware this up is freeware, it is the same as U copy it to your friends.



This is replay I got from some guy that have bunch of useful APIs on its site:
  • Not possible -- there is no API for that. You'd have to write a file
    system filter to keep track of file names for currently open files, at a
    minimum, and of current lock status.
    Sorry,
    Felix.
The guy acctually said that our solution is the only one.


EDIT: It seems that EnumProcessModules is used to iterate through dlls, not open files... I will check for correct function.
Habemus majkam!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

AND WHAT DO YOU SAY FOR THIS NICE REPLAY:

I do know, but since I work for Microsoft, and that information is not public, I cannot tell you. On the other hand, I _can_ point you to Gary Nebbett's book "The Windows NT/2000 Native API Reference" which
discusses, among others, the API that returns the handle table for a process.

But that is not sufficient -- you still won't know which file the handle refers to; that requires a kernel driver (like sysinternals.com's Process Explorer uses).

Sorry,
Felix.
-------------------

Thx God for Emule.... :) :) :lol:
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 »

AND WHAT DO YOU SAY FOR THIS NICE REPLAY:
Nice reply. (Not replay! :))

Can you try to reserch this question: to find book, to write example? Final point: to write a DLL, that I can use.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

2 Alextp
:) :) :)
Can you try to reserch this question:
What do you think Iam doing this 2 days ?

to find book, to write example? Final point: to write a DLL, that I can use.
I guess I can find the book.. maybe I have it already, it has familiar name...

About other things you mentioned, if I do it I will write plugin myself.

I am aware now of things I should do for this to work.... and why do I need the driver... writing a driver isn't in my definition of fun with TC plugins... maybe hook can do the job, that is easier....


Just use handle.exe and all is cool.

cu.
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 »

Just use handle.exe and all is cool.

cu.
Mark Russinovich didn't allow me to include Handle.exe into plugin archive. CU.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Users can download handle.exe themselves, no problem.

Just FYI, there are other nice examples of utilities that make use of Sysinternals utilities:
Power Defragmenter GUI uses contig.exe to create a full featured defragger, NTFS Streams Eraser uses streams.exe:
http://www.excessive-software.eu.tt/

Icfu
This account is for sale
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

Alextp wrote:2KevinMo
Would you mind to add another column which uses only one letter or several letters to indicate the information?
What for you need such column? What about 2nd column ("Locked test")?
I just think since there are only several possible values, I don't need such <-wide-> column to display "Partial Unicode". And if I drag it smaller, two dots come up and it doesn't look nice.

And this - "A=ANSI, U=Unicode, P=Partial Unicode, X=Invalid" - is just an example. For lock, emmm, maybe L or K for Lock, F(ree) for Unlock. But I see you're talking about put the locking-app's name for the "lock" column. So it would be totally different then.
PS: Actually, it would be great if people could define these string in an ini file. But I think that will make you too much trouble :oops:
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Mark Russinovich didn't allow me to include Handle.exe into plugin archive
so ?


Anyway, I have a keyword phrase... it is "handle table". It will solve our problems...

The books with info:
- Microsoft® Windows® Internals, Fourth Edition: Microsoft Windows Server™ 2003, Windows XP, and Windows 2000

- Windows NT Native API
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 »

2KevinMo
I just think since there are only several possible values, I don't need such <-wide-> column to display "Partial Unicode". And if I drag it smaller, two dots come up and it doesn't look nice.
I may suggest to edit these strings in .lng file, but this only works if you use language<>English. Otherwise, you should edit .wdx file by hex editor. Search string "ANSI|Partial Unicode|Pure Unicode|Invalid" and replace it by "A|P|U|X" (other chars fill by 0).

2Majkinetor
so ?

Anyway, I have a keyword phrase... it is "handle table". It will solve our problems...
It's not good to make people goto Winternals site and download Handle.exe.

Good luck.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

It's not good to make people goto Winternals site and download Handle.exe.
When I said "so ?" I didn't mean what you understood.

I know.... it was stupid repl(a)y. People who don't support freeware and/or opne source are not to be respected.... even when M.R is in question, aka "most significant MS individual" ( Ohh Your God....)

You are from Moscow, you know better than that....
Also,
Just FYI, there are other nice examples of utilities that make use of Sysinternals utilities:
I will further continue investigation of those topics we rised here. If I do some code, it will be open.

Those books are really cool. You should check them if you want detailed information about internal Windows arhitecture.
Habemus majkam!
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

It's not good to make people goto Winternals site and download Handle.exe.
People have also go to WhereIsIt website to download plugins for use with FileDesc, where's the difference?

Icfu
This account is for sale
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

[quote="Alextp"]2KevinMo
I may suggest to edit these strings in .lng file, but this only works if you use language<>English. Otherwise, you should edit .wdx file by hex editor. Search string "ANSI|Partial Unicode|Pure Unicode|Invalid" and replace it by "A|P|U|X" (other chars fill by 0).

Oh! Yes, yes! thank you very much. It works well. I can put any string I want. Great plugin ^_^
Regards,
Kevin
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2KevinMo
Oh! Yes, yes! thank you very much. It works well.
I forgot about other strings: "ANSI", "Partial Unicode" etc (separate from "ANSI|Partial Unicode|etc").
2Icfu
People have also go to WhereIsIt website to download plugins for use with FileDesc, where's the difference?
You are right, no difference. Ok, when I'll have time, I'll try to make it.
Post Reply