gets the most interesting process in the list
| 192 | // gets the most interesting process in the list |
| 193 | // |
| 194 | InterestingProcess getInterestingProcess(HANDLE job) |
| 195 | { |
| 196 | env::Process root = env::getProcessTree(job); |
| 197 | if (root.children().empty()) { |
| 198 | log::debug("nothing to wait for"); |
| 199 | return {}; |
| 200 | } |
| 201 | |
| 202 | dump(root); |
| 203 | |
| 204 | auto interest = findInterestingProcessInTrees(root); |
| 205 | if (!interest.handle) { |
| 206 | // this can happen if none of the processes can be opened |
| 207 | log::debug("no interesting process to wait for"); |
| 208 | return {}; |
| 209 | } |
| 210 | |
| 211 | return interest; |
| 212 | } |
| 213 | |
| 214 | const std::chrono::milliseconds Infinite(-1); |
| 215 |
no test coverage detected