Do only signal the other side of the pipe if the pipe is connected.

svn path=/trunk/; revision=13767
This commit is contained in:
Hartmut Birr 2005-02-27 20:38:36 +00:00
parent 4674211527
commit 2e93c2f4d9

View file

@ -102,7 +102,10 @@ NpfsRead(PDEVICE_OBJECT DeviceObject,
if (Fcb->ReadDataAvailable == 0) if (Fcb->ReadDataAvailable == 0)
{ {
KeResetEvent(&Fcb->Event); KeResetEvent(&Fcb->Event);
KeSetEvent(&WriterFcb->Event, IO_NO_INCREMENT, FALSE); if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE)
{
KeSetEvent(&WriterFcb->Event, IO_NO_INCREMENT, FALSE);
}
KeReleaseSpinLock(&Fcb->DataListLock, OldIrql); KeReleaseSpinLock(&Fcb->DataListLock, OldIrql);
if (Information > 0) if (Information > 0)
{ {
@ -190,7 +193,10 @@ NpfsRead(PDEVICE_OBJECT DeviceObject,
if (Information > 0) if (Information > 0)
{ {
KeSetEvent(&WriterFcb->Event, IO_NO_INCREMENT, FALSE); if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE)
{
KeSetEvent(&WriterFcb->Event, IO_NO_INCREMENT, FALSE);
}
break; break;
} }
} }