Fixed the return value and last error in ConnectNamedPipe if a overlapped structure is given.
Modified: trunk/reactos/lib/kernel32/file/npipe.c

Modified: trunk/reactos/lib/kernel32/file/npipe.c
--- trunk/reactos/lib/kernel32/file/npipe.c	2005-03-25 11:05:10 UTC (rev 14305)
+++ trunk/reactos/lib/kernel32/file/npipe.c	2005-03-25 11:25:44 UTC (rev 14306)
@@ -330,20 +330,15 @@
 			   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) ||