diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-18 17:21:52 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-18 17:21:52 -0500 |
| commit | 31cd5531d030838a30d55bcd63cadfff4ecd50ca (patch) | |
| tree | 2f3cb66505c85290a5fc2817be13b6f1cec1e6f8 /src/envmodule.cpp | |
| parent | a4a0e59d8ce7d3f9fbe0806a5621c27932f26314 (diff) | |
windows 7 doesn't play well with job objects, so just wait on individual handles
fixed getProcessTreeFromProcess() not behaving like getProcessTreeFromJob()
Diffstat (limited to 'src/envmodule.cpp')
| -rw-r--r-- | src/envmodule.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/envmodule.cpp b/src/envmodule.cpp index 8d348b5e..5be52de6 100644 --- a/src/envmodule.cpp +++ b/src/envmodule.cpp @@ -545,23 +545,20 @@ void findChildren(Process& parent, const std::vector<Process>& processes) Process getProcessTreeFromProcess(HANDLE h) { + Process root; + const auto parentPID = ::GetProcessId(h); const auto v = getRunningProcesses(); - Process root; for (auto&& p : v) { if (p.pid() == parentPID) { - root = p; + Process child = p; + findChildren(child, v); + root.addChild(child); break; } } - if (root.pid() == 0) { - return {}; - } - - findChildren(root, v); - return root; } |
