mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-17 07:13:27 +02:00
fixed Process::isRunning() on Windows
This commit is contained in:
parent
d14be5730a
commit
5c04101a35
@ -260,23 +260,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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -191,25 +191,20 @@ 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;
|
||||
|
||||
return result;
|
||||
}
|
||||
BOOL rc = GetExitCodeProcess(hProc, &exitCode);
|
||||
if (!rc || exitCode != STILL_ACTIVE) result = false;
|
||||
return result;}
|
||||
|
||||
|
||||
void ProcessImpl::requestTerminationImpl(PIDImpl pid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user