Fixed the return value and last error in ConnectNamedPipe if a overlapped structure is given.

svn path=/trunk/; revision=14306
This commit is contained in:
Hartmut Birr 2005-03-25 11:25:44 +00:00
parent 79d1ef572c
commit bb8e4bcd9e

View file

@ -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) ||