| 300 | |
| 301 | |
| 302 | bool ProcessResolver::IsProcessAlive(DWORD pid) { |
| 303 | // Skip system idle process (PID 0) |
| 304 | if (pid == 0) { |
| 305 | return true; |
| 306 | } |
| 307 | |
| 308 | HANDLE hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid); |
| 309 | if (hProcess == NULL) { |
| 310 | return false; // Process no longer exists |
| 311 | } |
| 312 | |
| 313 | DWORD exitCode; |
| 314 | bool isAlive = true; |
| 315 | if (GetExitCodeProcess(hProcess, &exitCode)) { |
| 316 | isAlive = (exitCode == STILL_ACTIVE); |
| 317 | } |
| 318 | |
| 319 | CloseHandle(hProcess); |
| 320 | return isAlive; |
| 321 | } |
| 322 |
nothing calls this directly
no outgoing calls
no test coverage detected