mirror of
https://github.com/reactos/reactos.git
synced 2025-05-20 17:45:06 +00:00
[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) svn path=/trunk/; revision=54319
This commit is contained in:
parent
1bdbaed2a7
commit
ee06a00c1a
4 changed files with 20 additions and 12 deletions
|
@ -191,6 +191,8 @@ NpfsOpenFileSystem(PNPFS_FCB Fcb,
|
|||
return;
|
||||
}
|
||||
|
||||
Ccb->FileObject = FileObject;
|
||||
|
||||
FileObject->FsContext = Fcb;
|
||||
FileObject->FsContext2 = Ccb;
|
||||
|
||||
|
@ -217,6 +219,8 @@ NpfsOpenRootDirectory(PNPFS_FCB Fcb,
|
|||
return;
|
||||
}
|
||||
|
||||
Ccb->FileObject = FileObject;
|
||||
|
||||
FileObject->FsContext = Fcb;
|
||||
FileObject->FsContext2 = Ccb;
|
||||
|
||||
|
@ -336,6 +340,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
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 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
|
|||
Fcb->CurrentInstances++;
|
||||
|
||||
Ccb->Fcb = Fcb;
|
||||
Ccb->FileObject = FileObject;
|
||||
Ccb->PipeEnd = FILE_PIPE_SERVER_END;
|
||||
Ccb->PipeState = FILE_PIPE_LISTENING_STATE;
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ NpfsConnectPipe(PIRP Irp,
|
|||
KeWaitForSingleObject(&Ccb->ConnectEvent,
|
||||
UserRequest,
|
||||
Irp->RequestorMode,
|
||||
FALSE,
|
||||
(Flags & FO_ALERTABLE_IO),
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@ -405,8 +405,8 @@ NpfsWaitPipe(PIRP Irp,
|
|||
|
||||
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 @@ NpfsWaitPipe2(PIRP Irp,
|
|||
/* 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);
|
||||
|
|
|
@ -83,6 +83,8 @@ typedef struct _NPFS_CCB
|
|||
LIST_ENTRY CcbListEntry;
|
||||
CCB_TYPE Type;
|
||||
PNPFS_FCB Fcb;
|
||||
|
||||
PFILE_OBJECT FileObject;
|
||||
|
||||
struct _NPFS_CCB* OtherSide;
|
||||
struct ETHREAD *Thread;
|
||||
|
|
|
@ -374,11 +374,11 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject,
|
|||
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 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject,
|
|||
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 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject,
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue