From 418ee7239bdf5ad3749339bc44e0a0b9c6f5d1e1 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Thu, 9 Apr 2009 21:10:04 +0000 Subject: [PATCH] - rw.c: After the write wait has been satisfied, check that the pipe is not closed before trying to acquire the mutex. Fix bug #4351. svn path=/trunk/; revision=40432 --- reactos/drivers/filesystems/npfs/rw.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); }