Revert part of #17156 and #17157 changes.
Modified: trunk/reactos/drivers/fs/np/rw.c

Modified: trunk/reactos/drivers/fs/np/rw.c
--- trunk/reactos/drivers/fs/np/rw.c	2005-08-08 04:26:23 UTC (rev 17194)
+++ trunk/reactos/drivers/fs/np/rw.c	2005-08-08 09:24:20 UTC (rev 17195)
@@ -398,25 +398,23 @@
      {
         if (Fcb->ReadDataAvailable == 0)
         {
+	   if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE)
+	   {
+	      ASSERT(Fcb->OtherSide != NULL);
+	      KeSetEvent(&Fcb->OtherSide->WriteEvent, IO_NO_INCREMENT, FALSE);
+	   }
+	   if (Information > 0 &&
+	       (Fcb->Pipe->ReadMode != FILE_PIPE_BYTE_STREAM_MODE ||
+	        Fcb->PipeState != FILE_PIPE_CONNECTED_STATE))
+	   {
+	      break;
+	   }
       	   if (Fcb->PipeState != FILE_PIPE_CONNECTED_STATE)
 	   {
 	      DPRINT("PipeState: %x\n", Fcb->PipeState);
-	      if (Fcb->PipeState == FILE_PIPE_LISTENING_STATE)
-	         Status = STATUS_PIPE_LISTENING;
-	      else
-	         Status = STATUS_PIPE_DISCONNECTED;
+	      Status = STATUS_PIPE_BROKEN;
 	      break;
            }
-
-	   ASSERT(Fcb->OtherSide != NULL);
-	   KeSetEvent(&Fcb->OtherSide->WriteEvent, IO_NO_INCREMENT, FALSE);
-
-	   if (Information > 0 &&
-	       Fcb->Pipe->ReadMode != FILE_PIPE_BYTE_STREAM_MODE)
-	   {
-              break;
-	   }
-
 	   ExReleaseFastMutex(&Fcb->DataListLock);
 	   if (IoIsOperationSynchronous(Irp))
 	   {