diff --git a/reactos/drivers/filesystems/npfs/rw.c b/reactos/drivers/filesystems/npfs/rw.c index aa6df9a0680..7b14449b308 100644 --- a/reactos/drivers/filesystems/npfs/rw.c +++ b/reactos/drivers/filesystems/npfs/rw.c @@ -836,6 +836,17 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject, Status = STATUS_PIPE_BROKEN; goto done; } + /* Check that the pipe has not been closed */ + if (ReaderCcb->PipeState != FILE_PIPE_CONNECTED_STATE) + { + /* If the other side is valid, fire event */ + if (Ccb) + { + KeResetEvent(&Ccb->WriteEvent); + } + Status = STATUS_PIPE_BROKEN; + goto done; + } ExAcquireFastMutex(&ReaderCcb->DataListLock); }