Looking for some API hints on finding process' open files.

  • Thread starter Thread starter Clinton Pierce
  • Start date Start date
C

Clinton Pierce

This isn't related to C# directly, but probably more of a Win32 API
question. It's going to get wrapped in a larger .NET system, but the calls
I want probably aren't in .NET. In either case, I need to write a utility
to find out what process has a filehandle open.

Yes, there are many, many 3rd party tools for doing this. I don't want a
3rd party tool, I'm willing to re-invent this wheel. None of these tools
have source code.

What I need is a hint. Where in the Win32 API can I find out what processes
have which filehandles? I can get process handles, but I can't seem to go
that extra setp to find out what they've got open.

I'v researched this online quite a bit, and I'm just a small leap away from
the answer I think. A small hint, please.
 
Win32: No method exists to do what you want
NT Native API: use the ZwQuerySystemInformation service, with
service-class = SystemHandleInformation

An example of this function is in the "Native API Reference" by
Gary Nebbett, although there will be lots of examples on the net as well

James

www.catch22.net
Free win32 software, sourcecode and tutorials
 
Back
Top