1

Is there another winapi call to detect which files are locked by a specific process then using duplicatehandle and ntquerysysteminformation?

I'm using restart manager api to register the files I'm looking for but, unfortunately, restart manager api only returns a list of processes but doesn't return a mapping which process holds which file(s).

Claudia
  • 11
  • 2
  • 1
    you can open file with `FILE_READ_ATTRIBUTES` access only and query `FileProcessIdsUsingFileInformation` for file - you got list of process id which use this file – RbMm Nov 24 '17 at 16:03
  • I want to mark this answer as accepted, but there is no check sign as stated in the help center. _To mark an answer as accepted, click on the check mark beside the answer to toggle it from greyed out to filled in_. And I already waited more than 48 hours. – Claudia Nov 27 '17 at 12:28
  • here - https://stackoverflow.com/questions/47507578/winapi-get-the-process-which-has-specific-handle-of-a-file almost the same question with real code – RbMm Nov 27 '17 at 12:30

0 Answers0