From c2f31954b8fd152b7c94bd1eaf12aa0e510dc9bc Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 30 Apr 2006 07:47:07 +0000 Subject: [PATCH] An attempt to read from a not-yet-connected pipe must fail. This fixes a Wine testcase. svn path=/trunk/; revision=21757 --- reactos/drivers/filesystems/np/rw.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/np/rw.c b/reactos/drivers/filesystems/np/rw.c index 8ff4d75cee2..5c288e4d1a6 100644 --- a/reactos/drivers/filesystems/np/rw.c +++ b/reactos/drivers/filesystems/np/rw.c @@ -318,6 +318,14 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject, Fcb = FileObject->FsContext; Context = (PNPFS_CONTEXT)&Irp->Tail.Overlay.DriverContext; + if (Fcb->OtherSide == NULL && Fcb->PipeState == FILE_PIPE_LISTENING_STATE) + { + DPRINT("Pipe is NOT yet connected!\n"); + Status = STATUS_PIPE_LISTENING; + Irp->IoStatus.Information = 0; + goto done; + } + if (Fcb->Data == NULL) { DPRINT1("Pipe is NOT readable!\n"); @@ -529,7 +537,7 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject, } Irp->IoStatus.Information = Information; Irp->IoStatus.Status = Status; - + ASSERT(IoGetCurrentIrpStackLocation(Irp)->FileObject != NULL); if (IoIsOperationSynchronous(Irp))