[NPFS]
authorCameron Gutman <aicommander@gmail.com>
Thu, 27 May 2010 00:26:34 +0000 (00:26 +0000)
committerCameron Gutman <aicommander@gmail.com>
Thu, 27 May 2010 00:26:34 +0000 (00:26 +0000)
- Change the other side's to PIPE_STATUS_CLOSING_STATE in NpfsCleanup and NpfsClose so the reading/writing thread knows that the pipe is dead when we signal its event
- Fixes iphlpapi_winetest hang and possibly bug #4689

svn path=/trunk/; revision=47370

reactos/drivers/filesystems/npfs/create.c
reactos/drivers/filesystems/npfs/rw.c

index 5236e20..86209bd 100644 (file)
@@ -619,7 +619,7 @@ NpfsCleanup(PDEVICE_OBJECT DeviceObject,
             ExAcquireFastMutex(&OtherSide->DataListLock);
             ExAcquireFastMutex(&Ccb->DataListLock);
         }
-        //OtherSide->PipeState = FILE_PIPE_DISCONNECTED_STATE;
+        OtherSide->PipeState = FILE_PIPE_CLOSING_STATE;
         OtherSide->OtherSide = NULL;
         /*
         * Signaling the write event. If is possible that an other
@@ -743,8 +743,12 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
     }
 
     /* Disconnect the pipes */
-    if (Ccb->OtherSide) Ccb->OtherSide->OtherSide = NULL;
-    if (Ccb) Ccb->OtherSide = NULL;
+    if (Ccb->OtherSide)
+    {
+        Ccb->OtherSide->PipeState = FILE_PIPE_CLOSING_STATE;
+        Ccb->OtherSide->OtherSide = NULL;
+        Ccb->OtherSide = NULL;
+    }
 
     ASSERT(Ccb->PipeState == FILE_PIPE_CLOSING_STATE);
 
index 7b14449..4c83f5c 100644 (file)
@@ -331,7 +331,7 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject,
 
     if ((Ccb->OtherSide == NULL) && (Ccb->ReadDataAvailable == 0))
     {
-        if (Ccb->PipeState == FILE_PIPE_CONNECTED_STATE)
+        if (Ccb->PipeState == FILE_PIPE_CLOSING_STATE)
         {
             DPRINT("File pipe broken\n");
             Status = STATUS_PIPE_BROKEN;