mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-12-22 21:37:09 +00:00
add is_running support
This commit is contained in:
@@ -255,6 +255,27 @@ void ProcessImpl::killImpl(PIDImpl pid)
|
||||
}
|
||||
}
|
||||
|
||||
bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle)
|
||||
{
|
||||
BOOL fRC = true;
|
||||
DWORD exit_code;
|
||||
|
||||
GetExitCodeProcess(handle.process(), &exit_code);
|
||||
if (exit_code != STILL_ACTIVE) fRC = false;
|
||||
|
||||
return fRC;
|
||||
}
|
||||
bool ProcessImpl::isRunningImpl(PIDImpl pid)
|
||||
{
|
||||
HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
|
||||
BOOL fRC = true;
|
||||
DWORD exit_code;
|
||||
|
||||
GetExitCodeProcess(hProc, &exit_code);
|
||||
if (exit_code != STILL_ACTIVE) fRC = false;
|
||||
|
||||
return fRC;
|
||||
}
|
||||
|
||||
void ProcessImpl::requestTerminationImpl(PIDImpl pid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user