how to find which process has a handle on a file from the file name

后端 未结 2 549
春和景丽
春和景丽 2021-02-08 21:38

Is there anything in the Windows c++ API to give me a list of processes that have a handle to a given file?

2条回答
  •  -上瘾入骨i
    2021-02-08 22:20

    http://www.codeproject.com/KB/shell/OpenedFileFinder.aspx?fid=422864&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26&select=2277170

    This article explains it pretty good. It uses NtQuerySystemInformation to get the handles.

    http://msdn.microsoft.com/en-us/library/ms724509(VS.85).aspx

提交回复
热议问题