From 9ce1b28fc151f556952fbfc90f5124340cd5b166 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Sat, 31 Mar 2007 22:18:16 +0000 Subject: [PATCH] Fix the bug introduced in r26219. svn path=/trunk/; revision=26223 --- reactos/drivers/filesystems/np/fsctrl.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/reactos/drivers/filesystems/np/fsctrl.c b/reactos/drivers/filesystems/np/fsctrl.c index 48c28a0e788..f6f52312e16 100644 --- a/reactos/drivers/filesystems/np/fsctrl.c +++ b/reactos/drivers/filesystems/np/fsctrl.c @@ -81,6 +81,9 @@ static NTSTATUS NpfsConnectPipe(PIRP Irp, PNPFS_CCB Ccb) { + PIO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + ULONG Flags; PLIST_ENTRY current_entry; PNPFS_FCB Fcb; PNPFS_CCB ClientCcb; @@ -100,6 +103,9 @@ NpfsConnectPipe(PIRP Irp, DPRINT("Waiting for connection...\n"); Fcb = Ccb->Fcb; + IoStack = IoGetCurrentIrpStackLocation(Irp); + FileObject = IoStack->FileObject; + Flags = FileObject->Flags; /* search for a listening client fcb */ KeLockMutex(&Fcb->CcbListLock); @@ -157,17 +163,13 @@ NpfsConnectPipe(PIRP Irp, KeUnlockMutex(&Fcb->CcbListLock); + if (Flags & FO_SYNCHRONOUS_IO) { - PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp); - PFILE_OBJECT FileObject = IoStack->FileObject; - if (FileObject->Flags & FO_SYNCHRONOUS_IO) - { - KeWaitForSingleObject(&Ccb->ConnectEvent, - UserRequest, - KernelMode, - FALSE, - NULL); - } + KeWaitForSingleObject(&Ccb->ConnectEvent, + UserRequest, + KernelMode, + FALSE, + NULL); } DPRINT("NpfsConnectPipe() done (Status %lx)\n", Status);