I am developing a C++ application on Windows server and I am trying to find ways to obtain which files are open by other processes. My current solution is inspired by code from the Chromium project. I iterate over all processes and obtain their file handles, but this performs poorly.
Is there another API function that lets me reverse this lookup by having a file path instead and obtaining the process handle that has a file handle open?