Skip to content

Commit b5374ea

Browse files
committed
Use GetExitCodeProcess() because WaitForSingleObject needs more access rights on the handle.
1 parent a726780 commit b5374ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PipeServer/Messages.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ bool CloseProcessRequest::Handle(MessageClient& client)
2222
//---------------------------------------------------------------------------
2323
bool IsValidRequest::Handle(MessageClient& client)
2424
{
25-
const auto success = WaitForSingleObject(GetRemoteId(), 0) == WAIT_TIMEOUT;
25+
DWORD exitCode = 0;
26+
const auto success = GetExitCodeProcess(GetRemoteId(), &exitCode) != FALSE && exitCode == STILL_ACTIVE;
2627

2728
client.Send(StatusResponse(GetRemoteId(), success));
2829

0 commit comments

Comments
 (0)