Author: ekohl
Date: Sat Dec  4 15:25:27 2010
New Revision: 49948

URL: http://svn.reactos.org/svn/reactos?rev=49948&view=rev
Log:
[NPFS]
- Fail attempts to connect or disconnect a directory or device.
- Fail attempts to connect or disconnect a pipe by the client.

Modified:
    trunk/reactos/drivers/filesystems/npfs/fsctrl.c

Modified: trunk/reactos/drivers/filesystems/npfs/fsctrl.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/fsctrl.c?rev=49948&r1=49947&r2=49948&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] Sat Dec  4 
15:25:27 2010
@@ -95,6 +95,20 @@
 
     DPRINT("NpfsConnectPipe()\n");
 
+    /* Fail, if the CCB is not a pipe CCB */
+    if (Ccb->Type != CCB_PIPE)
+    {
+        DPRINT1("Not a pipe\n");
+        return STATUS_ILLEGAL_FUNCTION;
+    }
+
+    /* Fail, if the CCB is not a server end CCB */
+    if (Ccb->PipeEnd != FILE_PIPE_SERVER_END)
+    {
+        DPRINT1("Not the server end\n");
+        return STATUS_ILLEGAL_FUNCTION;
+    }
+
     if (Ccb->PipeState == FILE_PIPE_CONNECTED_STATE)
     {
         KeResetEvent(&Ccb->ConnectEvent);
@@ -191,6 +205,20 @@
     BOOLEAN Server;
 
     DPRINT("NpfsDisconnectPipe()\n");
+
+    /* Fail, if the CCB is not a pipe CCB */
+    if (Ccb->Type != CCB_PIPE)
+    {
+        DPRINT1("Not a pipe\n");
+        return STATUS_ILLEGAL_FUNCTION;
+    }
+
+    /* Fail, if the CCB is not a server end CCB */
+    if (Ccb->PipeEnd != FILE_PIPE_SERVER_END)
+    {
+        DPRINT1("Not the server end\n");
+        return STATUS_ILLEGAL_FUNCTION;
+    }
 
     Fcb = Ccb->Fcb;
     KeLockMutex(&Fcb->CcbListLock);


Reply via email to