mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
add is_running support
This commit is contained in:
@@ -261,6 +261,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