Getting file descriptors for this process

I need a way to get all the file descriptors of this process.

for example, given the handle to the winword.exe process, I would like to get a list of the files for this process (doc files, etc.).

I am using Win32 api through C # / pInvoke.

Thanks!

+6
c # winapi
source share
2 answers

A simple solution is to use handle.exe and read its output. Another solution is to use P / Invoke with the NtQuerySystemInformation function. This and this forum on SysInternals has more detailed information as well as this article in CodeProject. Doing this in managed code can be very difficult since you will need to write a driver to read the kernel address space.

I would suggest you open the necessary functions in the Win32 function, which you could call from managed code.

+8
source share

In addition to Darin's answer, see also this codeguru page and this sysinternal forum post

0
source share

All Articles