- Fail attempts to connect or disconnect a directory or device.
- Fail attempts to connect or disconnect a pipe by the client.

svn path=/trunk/; revision=49948
This commit is contained in:
Eric Kohl 2010-12-04 15:25:27 +00:00
parent fe0eda52aa
commit 95aa3be8eb

View file

@ -95,6 +95,20 @@ NpfsConnectPipe(PIRP Irp,
DPRINT("NpfsConnectPipe()\n"); 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) if (Ccb->PipeState == FILE_PIPE_CONNECTED_STATE)
{ {
KeResetEvent(&Ccb->ConnectEvent); KeResetEvent(&Ccb->ConnectEvent);
@ -192,6 +206,20 @@ NpfsDisconnectPipe(PNPFS_CCB Ccb)
DPRINT("NpfsDisconnectPipe()\n"); 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; Fcb = Ccb->Fcb;
KeLockMutex(&Fcb->CcbListLock); KeLockMutex(&Fcb->CcbListLock);