Remove pipe only if client fcb list and server fcb list are empty.
Modified: trunk/reactos/drivers/fs/np/create.c

Modified: trunk/reactos/drivers/fs/np/create.c
--- trunk/reactos/drivers/fs/np/create.c	2005-01-02 07:04:56 UTC (rev 12715)
+++ trunk/reactos/drivers/fs/np/create.c	2005-01-02 12:02:42 UTC (rev 12716)
@@ -435,6 +435,8 @@
    Irp->IoStatus.Status = STATUS_SUCCESS;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);
 
+   DPRINT("Success!\n");
+
    return STATUS_SUCCESS;
 }
 
@@ -460,6 +462,7 @@
 
    if (Fcb == NULL)
    {
+      DPRINT("Success!\n");
       Irp->IoStatus.Status = STATUS_SUCCESS;
       Irp->IoStatus.Information = 0;
       IoCompleteRequest(Irp, IO_NO_INCREMENT);
@@ -537,7 +540,8 @@
 
    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 @@
    Irp->IoStatus.Information = 0;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);
 
+   DPRINT("Success!\n");
+
    return STATUS_SUCCESS;
 }