mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[NPFS]
- Fix a potential CCB state inconsistency if the IRP is canceled before adding it to the pending list - Don't wait if the IRP has been canceled - Preserve the return status of NpfsAddListeningServerInstance svn path=/trunk/; revision=54328
This commit is contained in:
parent
3eff89fe04
commit
945a5972a9
1 changed files with 3 additions and 6 deletions
|
@ -60,6 +60,7 @@ NpfsAddListeningServerInstance(PIRP Irp,
|
||||||
IoAcquireCancelSpinLock(&oldIrql);
|
IoAcquireCancelSpinLock(&oldIrql);
|
||||||
if (!Irp->Cancel)
|
if (!Irp->Cancel)
|
||||||
{
|
{
|
||||||
|
Ccb->PipeState = FILE_PIPE_LISTENING_STATE;
|
||||||
IoMarkIrpPending(Irp);
|
IoMarkIrpPending(Irp);
|
||||||
InsertTailList(&Ccb->Fcb->WaiterListHead, &Entry->Entry);
|
InsertTailList(&Ccb->Fcb->WaiterListHead, &Entry->Entry);
|
||||||
(void)IoSetCancelRoutine(Irp, NpfsListeningCancelRoutine);
|
(void)IoSetCancelRoutine(Irp, NpfsListeningCancelRoutine);
|
||||||
|
@ -174,21 +175,17 @@ NpfsConnectPipe(PIRP Irp,
|
||||||
/* no listening client fcb found */
|
/* no listening client fcb found */
|
||||||
DPRINT("No listening client fcb found -- waiting for client\n");
|
DPRINT("No listening client fcb found -- waiting for client\n");
|
||||||
|
|
||||||
Ccb->PipeState = FILE_PIPE_LISTENING_STATE;
|
|
||||||
|
|
||||||
Status = NpfsAddListeningServerInstance(Irp, Ccb);
|
Status = NpfsAddListeningServerInstance(Irp, Ccb);
|
||||||
|
|
||||||
KeUnlockMutex(&Fcb->CcbListLock);
|
KeUnlockMutex(&Fcb->CcbListLock);
|
||||||
|
|
||||||
if (Flags & FO_SYNCHRONOUS_IO)
|
if ((Status == STATUS_PENDING) && (Flags & FO_SYNCHRONOUS_IO))
|
||||||
{
|
{
|
||||||
Status = KeWaitForSingleObject(&Ccb->ConnectEvent,
|
KeWaitForSingleObject(&Ccb->ConnectEvent,
|
||||||
UserRequest,
|
UserRequest,
|
||||||
Irp->RequestorMode,
|
Irp->RequestorMode,
|
||||||
(Flags & FO_ALERTABLE_IO),
|
(Flags & FO_ALERTABLE_IO),
|
||||||
NULL);
|
NULL);
|
||||||
if ((Status == STATUS_USER_APC) || (Status == STATUS_KERNEL_APC) || (Status == STATUS_ALERTED))
|
|
||||||
Status = STATUS_CANCELLED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("NpfsConnectPipe() done (Status %lx)\n", Status);
|
DPRINT("NpfsConnectPipe() done (Status %lx)\n", Status);
|
||||||
|
|
Loading…
Reference in a new issue