X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fntoskrnl%2Fio%2Fiomgr%2Firp.c;h=0863f58907ba51f2ce7fe99618d87ef92e47e058;hp=9ef5f0cb74d5224c402228bf3340eb0a1290a9c8;hb=cbdf28bb6ace5e3faec494c5743371d7288f191c;hpb=347f68539b0884f6adfc5d986b2cb8c07c8df4bb diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c index 9ef5f0cb74d..0863f58907b 100644 --- a/reactos/ntoskrnl/io/iomgr/irp.c +++ b/reactos/ntoskrnl/io/iomgr/irp.c @@ -1217,13 +1217,15 @@ IofCompleteRequest(IN PIRP Irp, ErrorCode = PtrToUlong(LastStackPtr->Parameters.Others.Argument4); } - /* Get the Current Stack and skip it */ + /* Get the Current Stack */ StackPtr = IoGetCurrentIrpStackLocation(Irp); - IoSkipCurrentIrpStackLocation(Irp); /* Loop the Stacks and complete the IRPs */ do { + /* Skip current stack location */ + IoSkipCurrentIrpStackLocation(Irp); + /* Set Pending Returned */ Irp->PendingReturned = StackPtr->Control & SL_PENDING_RETURNED; @@ -1286,10 +1288,9 @@ IofCompleteRequest(IN PIRP Irp, IopClearStackLocation(StackPtr); } - /* Move to next stack location and pointer */ - IoSkipCurrentIrpStackLocation(Irp); + /* Move pointer to next stack location */ StackPtr++; - } while (Irp->CurrentLocation <= (Irp->StackCount + 1)); + } while (Irp->CurrentLocation <= Irp->StackCount); /* Check if the IRP is an associated IRP */ if (Irp->Flags & IRP_ASSOCIATED_IRP)