diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-18 17:25:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-18 17:25:05 -0500 |
| commit | e797640a0092fd5d9a887e62138641eac1f7ba01 (patch) | |
| tree | dda7ea5822e8ba91c5cacc86469c40a94b077c98 /src/envmodule.cpp | |
| parent | c2d23bb34a69adc52da9a6052c298fed165822fc (diff) | |
| parent | 31cd5531d030838a30d55bcd63cadfff4ecd50ca (diff) | |
Merge pull request #945 from isanae/w7-wait-fix
Windows 7 wait fix
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; } |
