kernel32: Wait on pipe handle in ConnectNamedPipe if needed.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-10-30 16:08:22 +01:00 committed by Alexandre Julliard
parent 5a675ea44a
commit b114bd07b1
1 changed files with 5 additions and 0 deletions

View File

@ -1681,6 +1681,11 @@ BOOL WINAPI ConnectNamedPipe(HANDLE hPipe, LPOVERLAPPED overlapped)
status = NtFsControlFile(hPipe, overlapped ? overlapped->hEvent : NULL, NULL, cvalue,
overlapped ? (IO_STATUS_BLOCK *)overlapped : &status_block,
FSCTL_PIPE_LISTEN, NULL, 0, NULL, 0);
if (status == STATUS_PENDING && !overlapped)
{
WaitForSingleObject(hPipe, INFINITE);
status = status_block.u.Status;
}
if (status == STATUS_SUCCESS) return TRUE;
SetLastError( RtlNtStatusToDosError(status) );