summaryrefslogtreecommitdiff
path: root/src/envmodule.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-12-18 17:21:52 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2019-12-18 17:21:52 -0500
commit31cd5531d030838a30d55bcd63cadfff4ecd50ca (patch)
tree2f3cb66505c85290a5fc2817be13b6f1cec1e6f8 /src/envmodule.cpp
parenta4a0e59d8ce7d3f9fbe0806a5621c27932f26314 (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.cpp13
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;
}