Author: cgutman
Date: Sun Nov 6 18:47:51 2011
New Revision: 54319
URL:
http://svn.reactos.org/svn/reactos?rev=54319&view=rev
Log:
[NPFS]
- Fix wait parameters so we can break out of a wait if a user APC is delivered and the
file object is opened with FILE_SYNCHRONOUS_IO_ALERT
- Fixes hanging ntdll:pipe winetest (only 1 failure out of 53 tests now)
Modified:
trunk/reactos/drivers/filesystems/npfs/create.c
trunk/reactos/drivers/filesystems/npfs/fsctrl.c
trunk/reactos/drivers/filesystems/npfs/npfs.h
trunk/reactos/drivers/filesystems/npfs/rw.c
Modified: trunk/reactos/drivers/filesystems/npfs/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] Sun Nov 6 18:47:51 2011
@@ -191,6 +191,8 @@
return;
}
+ Ccb->FileObject = FileObject;
+
FileObject->FsContext = Fcb;
FileObject->FsContext2 = Ccb;
@@ -216,6 +218,8 @@
IoStatus->Status = STATUS_NO_MEMORY;
return;
}
+
+ Ccb->FileObject = FileObject;
FileObject->FsContext = Fcb;
FileObject->FsContext2 = Ccb;
@@ -336,6 +340,7 @@
return STATUS_NO_MEMORY;
}
+ ClientCcb->FileObject = FileObject;
ClientCcb->Thread = (struct ETHREAD *)Irp->Tail.Overlay.Thread;
ClientCcb->PipeEnd = FILE_PIPE_CLIENT_END;
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
@@ -718,6 +723,7 @@
Fcb->CurrentInstances++;
Ccb->Fcb = Fcb;
+ Ccb->FileObject = FileObject;
Ccb->PipeEnd = FILE_PIPE_SERVER_END;
Ccb->PipeState = FILE_PIPE_LISTENING_STATE;
Modified: trunk/reactos/drivers/filesystems/npfs/fsctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] Sun Nov 6 18:47:51 2011
@@ -186,7 +186,7 @@
KeWaitForSingleObject(&Ccb->ConnectEvent,
UserRequest,
Irp->RequestorMode,
- FALSE,
+ (Flags & FO_ALERTABLE_IO),
NULL);
}
@@ -405,8 +405,8 @@
Status = KeWaitForSingleObject(&Ccb->ConnectEvent,
UserRequest,
- KernelMode,
- TRUE,
+ Irp->RequestorMode,
+ (Ccb->FileObject->Flags &
FO_ALERTABLE_IO),
TimeOut);
DPRINT("KeWaitForSingleObject() returned (Status %lx)\n", Status);
@@ -523,8 +523,8 @@
/* Wait for one */
Status = KeWaitForSingleObject(&Ccb->ConnectEvent,
UserRequest,
- KernelMode,
- FALSE,
+ Irp->RequestorMode,
+ (Ccb->FileObject->Flags & FO_ALERTABLE_IO),
&TimeOut);
DPRINT("KeWaitForSingleObject() returned (Status %lx)\n", Status);
Modified: trunk/reactos/drivers/filesystems/npfs/npfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/npfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/npfs.h [iso-8859-1] Sun Nov 6 18:47:51 2011
@@ -83,6 +83,8 @@
LIST_ENTRY CcbListEntry;
CCB_TYPE Type;
PNPFS_FCB Fcb;
+
+ PFILE_OBJECT FileObject;
struct _NPFS_CCB* OtherSide;
struct ETHREAD *Thread;
Modified: trunk/reactos/drivers/filesystems/npfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] Sun Nov 6 18:47:51 2011
@@ -374,11 +374,11 @@
Context->WaitEvent = &Event;
ExReleaseFastMutex(&Ccb->DataListLock);
Status = KeWaitForSingleObject(&Event,
- Executive,
+ UserRequest,
Irp->RequestorMode,
- FALSE,
+ (FileObject->Flags & FO_ALERTABLE_IO),
NULL);
- if ((Status == STATUS_USER_APC) || (Status == STATUS_KERNEL_APC))
+ if ((Status == STATUS_USER_APC) || (Status == STATUS_KERNEL_APC) || (Status
== STATUS_ALERTED))
{
Status = STATUS_CANCELLED;
goto done;
@@ -468,11 +468,11 @@
Status = KeWaitForSingleObject(&Ccb->ReadEvent,
UserRequest,
Irp->RequestorMode,
- FALSE,
+ (FileObject->Flags & FO_ALERTABLE_IO),
NULL);
DPRINT("Finished waiting (%wZ)! Status: %x\n",
&Ccb->Fcb->PipeName, Status);
- if ((Status == STATUS_USER_APC) || (Status == STATUS_KERNEL_APC))
+ if ((Status == STATUS_USER_APC) || (Status == STATUS_KERNEL_APC) ||
(Status == STATUS_ALERTED))
{
Status = STATUS_CANCELLED;
break;
@@ -841,11 +841,11 @@
Status = KeWaitForSingleObject(&Ccb->WriteEvent,
UserRequest,
Irp->RequestorMode,
- FALSE,
+ (FileObject->Flags & FO_ALERTABLE_IO),
NULL);
DPRINT("Write Finished waiting (%S)! Status: %x\n",
Fcb->PipeName.Buffer, Status);
- if ((Status == STATUS_USER_APC) || (Status == STATUS_KERNEL_APC))
+ if ((Status == STATUS_USER_APC) || (Status == STATUS_KERNEL_APC) || (Status
== STATUS_ALERTED))
{
Status = STATUS_CANCELLED;
goto done;