mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
fixed Process::isRunning() on Windows
This commit is contained in:
@@ -266,23 +266,19 @@ bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle)
|
||||
{
|
||||
bool result = true;
|
||||
DWORD exitCode;
|
||||
|
||||
GetExitCodeProcess(handle.process(), &exitCode);
|
||||
if (exitCode != STILL_ACTIVE) result = false;
|
||||
|
||||
BOOL rc = GetExitCodeProcess(handle.process(), &exitCode);
|
||||
if (!rc || exitCode != STILL_ACTIVE) result = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
bool ProcessImpl::isRunningImpl(PIDImpl pid)
|
||||
{
|
||||
HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
|
||||
HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
|
||||
bool result = true;
|
||||
DWORD exitCode;
|
||||
|
||||
GetExitCodeProcess(hProc, &exitCode);
|
||||
if (exitCode != STILL_ACTIVE) result = false;
|
||||
|
||||
BOOL rc = GetExitCodeProcess(hProc, &exitCode);
|
||||
if (!rc || exitCode != STILL_ACTIVE) result = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user