Reputation: 33
Im using C++ and im trying to create a program similar to handle.exe from sysinternals.
Basically, i am getting the filename from the user, and I need to be able to display which process is locking the file.
Does anyone know where I can get this information from? I've tried using some process functions in winapi, but I cant figure out how to get this information,
Here is an example of what im trying to create:
http://www.kartmann.org/freeware/WhoSLocking/ReadMe.htm
Thanks in advance
Upvotes: 3
Views: 3608
Reputation: 54148
There is an undocumented option on NtQuerySystemInformation to get the file handles for a process. There is sample code here.
Second sample (in Delphi) is here.
Upvotes: 2