mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Bypass IoSecondStageCompletion for irp's with the flags
IRP_PAGING_IO or IRP_CLOSE_OPERATION in IofCompleteRequest. svn path=/trunk/; revision=7366
This commit is contained in:
parent
76706d5835
commit
237c87c4c3
1 changed files with 64 additions and 36 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: irp.c,v 1.56 2003/12/30 18:52:04 fireball Exp $
|
/* $Id: irp.c,v 1.57 2003/12/31 14:16:18 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -284,42 +284,70 @@ IofCompleteRequest(PIRP Irp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Windows NT File System Internals, page 154
|
if (Irp->Flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION))
|
||||||
OriginalFileObject = Irp->Tail.Overlay.OriginalFileObject;
|
{
|
||||||
|
if (Irp->Flags & IRP_PAGING_IO)
|
||||||
if (Irp->PendingReturned || KeGetCurrentIrql() == DISPATCH_LEVEL)
|
{
|
||||||
{
|
/* FIXME:
|
||||||
BOOLEAN bStatus;
|
* The mdl must be freed by the caller!
|
||||||
|
*/
|
||||||
DPRINT("Dispatching APC\n");
|
if (Irp->MdlAddress->MappedSystemVa != NULL)
|
||||||
KeInitializeApc( &Irp->Tail.Apc,
|
{
|
||||||
&Irp->Tail.Overlay.Thread->Tcb,
|
MmUnmapLockedPages(Irp->MdlAddress->MappedSystemVa,
|
||||||
OriginalApcEnvironment,
|
Irp->MdlAddress);
|
||||||
IoSecondStageCompletion,//kernel routine
|
}
|
||||||
NULL,
|
MmUnlockPages(Irp->MdlAddress);
|
||||||
(PKNORMAL_ROUTINE) NULL,
|
ExFreePool(Irp->MdlAddress);
|
||||||
KernelMode,
|
}
|
||||||
OriginalFileObject);
|
if (Irp->UserIosb)
|
||||||
|
{
|
||||||
bStatus = KeInsertQueueApc(&Irp->Tail.Apc,
|
*Irp->UserIosb = Irp->IoStatus;
|
||||||
(PVOID)Irp,
|
}
|
||||||
(PVOID)(ULONG)PriorityBoost,
|
if (Irp->UserEvent)
|
||||||
PriorityBoost);
|
{
|
||||||
|
KeSetEvent(Irp->UserEvent, PriorityBoost, FALSE);
|
||||||
if (bStatus == FALSE)
|
}
|
||||||
{
|
IoFreeIrp(Irp);
|
||||||
DPRINT1("Error queueing APC for thread. Thread has probably exited.\n");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
DPRINT("Finished dispatching APC\n");
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT("Calling IoSecondStageCompletion routine directly\n");
|
//Windows NT File System Internals, page 154
|
||||||
KeRaiseIrql(APC_LEVEL, &oldIrql);
|
OriginalFileObject = Irp->Tail.Overlay.OriginalFileObject;
|
||||||
IoSecondStageCompletion(NULL,NULL,(PVOID)&OriginalFileObject,(PVOID) &Irp,(PVOID) &PriorityBoost);
|
|
||||||
KeLowerIrql(oldIrql);
|
if (Irp->PendingReturned || KeGetCurrentIrql() == DISPATCH_LEVEL)
|
||||||
DPRINT("Finished completition routine\n");
|
{
|
||||||
|
BOOLEAN bStatus;
|
||||||
|
|
||||||
|
DPRINT("Dispatching APC\n");
|
||||||
|
KeInitializeApc( &Irp->Tail.Apc,
|
||||||
|
&Irp->Tail.Overlay.Thread->Tcb,
|
||||||
|
OriginalApcEnvironment,
|
||||||
|
IoSecondStageCompletion,//kernel routine
|
||||||
|
NULL,
|
||||||
|
(PKNORMAL_ROUTINE) NULL,
|
||||||
|
KernelMode,
|
||||||
|
OriginalFileObject);
|
||||||
|
|
||||||
|
bStatus = KeInsertQueueApc(&Irp->Tail.Apc,
|
||||||
|
(PVOID)Irp,
|
||||||
|
(PVOID)(ULONG)PriorityBoost,
|
||||||
|
PriorityBoost);
|
||||||
|
|
||||||
|
if (bStatus == FALSE)
|
||||||
|
{
|
||||||
|
DPRINT1("Error queueing APC for thread. Thread has probably exited.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT("Finished dispatching APC\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPRINT("Calling IoSecondStageCompletion routine directly\n");
|
||||||
|
KeRaiseIrql(APC_LEVEL, &oldIrql);
|
||||||
|
IoSecondStageCompletion(NULL,NULL,(PVOID)&OriginalFileObject,(PVOID) &Irp,(PVOID) &PriorityBoost);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
DPRINT("Finished completition routine\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue