Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Process Information

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

like image 632
Kristjan84 Avatar asked Jun 10 '26 13:06

Kristjan84


1 Answers

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.

like image 83
Steve Townsend Avatar answered Jun 12 '26 12:06

Steve Townsend



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!