diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-26 03:30:44 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-26 03:30:44 -0500 |
| commit | 2527d6aa87f36894c291512a14f12940a5100484 (patch) | |
| tree | e54ed0a9bd73421d191559adc122b66c28d60056 /src/usvfsconnector.cpp | |
| parent | 36c6dfd5b8c6c87410c7c18fb67fd00a72c29491 (diff) | |
switched to using a job object to monitor for processes so child processes can also be captured
Diffstat (limited to 'src/usvfsconnector.cpp')
| -rw-r--r-- | src/usvfsconnector.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 3dba3efc..3c8c355b 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -280,13 +280,17 @@ std::vector<HANDLE> getRunningUSVFSProcesses() const auto thisPid = GetCurrentProcessId(); std::vector<HANDLE> v; + const auto rights = + PROCESS_QUERY_LIMITED_INFORMATION | // exit code, image name, etc. + SYNCHRONIZE | // wait functions + PROCESS_SET_QUOTA | PROCESS_TERMINATE; // add to job + for (auto&& pid : pids) { if (pid == thisPid) { continue; // obviously don't wait for MO process } - HANDLE handle = ::OpenProcess( - PROCESS_QUERY_LIMITED_INFORMATION | SYNCHRONIZE, FALSE, pid); + HANDLE handle = ::OpenProcess(rights, FALSE, pid); if (handle == INVALID_HANDLE_VALUE) { const auto e = GetLastError(); |
