[ros-diffs] [tkreuzer] 45996: [NTOS] IofCompleteRequest: Skip the stack location at the beginning of the loop instead of before and at the end to avoid double skipping of the last valid stack location in certain cases. This prevents the ASSERT in IoSkipCurrentIrpStackLocation to be hit. Note: this leads to a different value of Irp->CurrentLocation and Irp->Tail.Overlay.CurrentStackLocation after the last completion routine has been called. But that should hopefully not make a difference.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Mon Mar 8 05:58:49 CET 2010


Author: tkreuzer
Date: Mon Mar  8 05:58:49 2010
New Revision: 45996

URL: http://svn.reactos.org/svn/reactos?rev=45996&view=rev
Log:
[NTOS]
IofCompleteRequest: Skip the stack location at the beginning of the loop instead of before and at the end to avoid double skipping of the last valid stack location in certain cases. This prevents the ASSERT in IoSkipCurrentIrpStackLocation to be hit. Note: this leads to a different value of Irp->CurrentLocation and Irp->Tail.Overlay.CurrentStackLocation after the last completion routine has been called. But that should hopefully not make a difference.

Modified:
    branches/header-work/ntoskrnl/io/iomgr/irp.c

Modified: branches/header-work/ntoskrnl/io/iomgr/irp.c
URL: http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/io/iomgr/irp.c?rev=45996&r1=45995&r2=45996&view=diff
==============================================================================
--- branches/header-work/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ branches/header-work/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Mon Mar  8 05:58:49 2010
@@ -1217,13 +1217,15 @@
         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 @@
             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)




More information about the Ros-diffs mailing list