I need a way for getting all of the file handles of a given process.
for example, given a the winword.exe process handle, i would like to get the list of the file handles of that process (doc files etc).
i'm using the Win32 api via C#/pInvoke.
Thanks!
An easy solution would be to use handle.exe and read its output. Another solution is to use P/Invoke with NtQuerySystemInformation function. This and this forum post on SysInternals has more details as well as this article on CodeProject. Doing it in managed code could be very difficult as you will need to write a driver to read the kernel address space.
I would suggest you to expose the needed functionality in a Win32 function that you could call from managed code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With