3

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

Kristjan84
  • 33
  • 1
  • 4

1 Answers1

2

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.

Community
  • 1
  • 1
Steve Townsend
  • 53,498
  • 9
  • 91
  • 140