MCPcopy Create free account
hub / github.com/dobin/RedEdr / IsProcessAlive

Method IsProcessAlive

RedEdrShared/process_resolver.cpp:302–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300
301
302bool 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected