diff --git a/reactos/lib/kernel32/file/npipe.c b/reactos/lib/kernel32/file/npipe.c index 687888b1baa..3d41ff7efca 100644 --- a/reactos/lib/kernel32/file/npipe.c +++ b/reactos/lib/kernel32/file/npipe.c @@ -330,20 +330,15 @@ ConnectNamedPipe(HANDLE hNamedPipe, 0, NULL, 0); - if ((lpOverlapped != NULL) && (Status == STATUS_PENDING)) - return TRUE; - if ((lpOverlapped == NULL) && (Status == STATUS_PENDING)) { Status = NtWaitForSingleObject(hNamedPipe, FALSE, NULL); - if (!NT_SUCCESS(Status)) + if (NT_SUCCESS(Status)) { - SetLastErrorByStatus(Status); - return FALSE; + Status = Iosb.Status; } - Status = Iosb.Status; } if ((!NT_SUCCESS(Status) && Status != STATUS_PIPE_CONNECTED) ||