diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-26 04:57:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-26 04:57:20 -0500 |
| commit | e845126e09357f8713ca0c9f593970c7c634328e (patch) | |
| tree | b3e402809ded25a9d9d7b45e04935a85b96eb0a6 /src/usvfsconnector.cpp | |
| parent | 36c6dfd5b8c6c87410c7c18fb67fd00a72c29491 (diff) | |
| parent | 5fb785aceecf32d6012bad044027572e02d22a9a (diff) | |
Merge pull request #904 from isanae/lock-job
Use a Job to capture all child processes
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(); |
