Setup the correct stack location for completion routines in IofCompleteRequest.

This change correct also the called completion routine in IoSecondStageCompletion
(ntoskrnl\io\cleanup.c).

svn path=/trunk/; revision=3342
This commit is contained in:
Hartmut Birr 2002-08-17 15:20:33 +00:00
parent 74e8579c8f
commit 675afa7691

View file

@ -1,4 +1,4 @@
/* $Id: irp.c,v 1.40 2002/04/10 09:57:31 ekohl Exp $ /* $Id: irp.c,v 1.41 2002/08/17 15:20:33 hbirr Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -226,24 +226,28 @@ IofCompleteRequest(PIRP Irp,
DPRINT("IoCompleteRequest(Irp %x, PriorityBoost %d) Event %x THread %x\n", DPRINT("IoCompleteRequest(Irp %x, PriorityBoost %d) Event %x THread %x\n",
Irp,PriorityBoost, Irp->UserEvent, PsGetCurrentThread()); Irp,PriorityBoost, Irp->UserEvent, PsGetCurrentThread());
for (i=0;i<Irp->StackCount;i++) for (i=Irp->CurrentLocation;i<Irp->StackCount;i++)
{ {
if (Irp->Stack[i].CompletionRoutine != NULL) if (Irp->Stack[i].CompletionRoutine != NULL)
{ {
Status = Irp->Stack[i].CompletionRoutine( Status = Irp->Stack[i].CompletionRoutine(
Irp->Stack[i].DeviceObject, Irp->Stack[i].DeviceObject,
Irp, Irp,
Irp->Stack[i].CompletionContext); Irp->Stack[i].CompletionContext);
if (Status == STATUS_MORE_PROCESSING_REQUIRED) if (Status == STATUS_MORE_PROCESSING_REQUIRED)
{ {
return; return;
} }
} }
if (Irp->Stack[i].Control & SL_PENDING_RETURNED) if (Irp->Stack[i].Control & SL_PENDING_RETURNED)
{ {
Irp->PendingReturned = TRUE; Irp->PendingReturned = TRUE;
} }
} if (Irp->CurrentLocation < Irp->StackCount - 1)
{
IoSkipCurrentIrpStackLocation(Irp);
}
}
if (Irp->PendingReturned) if (Irp->PendingReturned)
{ {
DPRINT("Dispatching APC\n"); DPRINT("Dispatching APC\n");