List open handles by a process

  • Thread starter Thread starter Christian2002
  • Start date Start date
C

Christian2002

Guest
Hello everyone, for a long time I've been looking for a way to get a list of handles given a specific process. More in detail, I would like to write a function in C# that given as parameter a process, returns me a list of strings with all the names of the handles opened by that process: file names, registry key names, names of other processes to which the process passed as parameter is accessing, so I can see also (cycling all processes), if some other process is accessing mine. Doing some research, I saw that this is feasible by importing ntdll.dll and using the following methods (which I think are the same used in handle.exe of Sysinternals): NtQuerySystemInformation, NtDuplicateObject and NtQueryObject. The only problem is that I really have no idea where to start to do this. If anyone can help me, I'd really appreciate it.

Continue reading...
 
Back
Top