worker-processes

Enumerating File Handles in C#

醉酒当歌 提交于 2019-12-01 17:26:37
I would like to know whether it is possible to enumerate file handles in c#, maybe using Win32API. This is easily done for window and process handles, but it seems that it is not possible for file handles. While some functionality is offered by NtQuerySystemInformation, this is being phased out and therefore it is not recommended to use such a method. Well, you know it is possible, SysInternals' Handle utility does it. NtQueryInformation isn't going to be phased out, it is an essential low-level interface between Win32 and the "real" operating system. What is however never going to happen is

Enumerating File Handles in C#

坚强是说给别人听的谎言 提交于 2019-12-01 15:53:09
问题 I would like to know whether it is possible to enumerate file handles in c#, maybe using Win32API. This is easily done for window and process handles, but it seems that it is not possible for file handles. While some functionality is offered by NtQuerySystemInformation, this is being phased out and therefore it is not recommended to use such a method. 回答1: Well, you know it is possible, SysInternals' Handle utility does it. NtQueryInformation isn't going to be phased out, it is an essential