Remove pipe only if client fcb list and server fcb list are empty.
authorEric Kohl <eric.kohl@reactos.org>
Sun, 2 Jan 2005 12:02:42 +0000 (12:02 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 2 Jan 2005 12:02:42 +0000 (12:02 +0000)
svn path=/trunk/; revision=12716

reactos/drivers/fs/np/create.c

index c0ac915..cdbef40 100644 (file)
@@ -435,6 +435,8 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
    Irp->IoStatus.Status = STATUS_SUCCESS;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);
 
+   DPRINT("Success!\n");
+
    return STATUS_SUCCESS;
 }
 
@@ -460,6 +462,7 @@ NpfsClose(
 
    if (Fcb == NULL)
    {
+      DPRINT("Success!\n");
       Irp->IoStatus.Status = STATUS_SUCCESS;
       Irp->IoStatus.Information = 0;
       IoCompleteRequest(Irp, IO_NO_INCREMENT);
@@ -537,7 +540,8 @@ NpfsClose(
 
    KeUnlockMutex(&Pipe->FcbListLock);
 
-   if (Server && Pipe->CurrentInstances == 0)
+   if (IsListEmpty(&Pipe->ServerFcbListHead) &&
+       IsListEmpty(&Pipe->ClientFcbListHead))
    {
       RtlFreeUnicodeString(&Pipe->PipeName);
       KeLockMutex(&DeviceExt->PipeListLock);
@@ -550,6 +554,8 @@ NpfsClose(
    Irp->IoStatus.Information = 0;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);
 
+   DPRINT("Success!\n");
+
    return STATUS_SUCCESS;
 }