[ros-diffs] [sginsberg] 37068: - KeSetTimerEx: When canceling the insertion of an expired timer, don't forget to exit the dispatcher and return. Fixes crashes exposed by kernel32 Winetest "timer", caused by KiTimerTableListHead suddenly having broken entries. - Also fix a comment -- KiExitDispatcher doesn't release the dispatcher lock, it is done in KxInsertTimer

sginsberg at svn.reactos.org sginsberg at svn.reactos.org
Wed Oct 29 17:24:37 CET 2008


Author: sginsberg
Date: Wed Oct 29 11:24:36 2008
New Revision: 37068

URL: http://svn.reactos.org/svn/reactos?rev=37068&view=rev
Log:
- KeSetTimerEx: When canceling the insertion of an expired timer, don't forget to exit the dispatcher and return. Fixes crashes exposed by kernel32 Winetest "timer", caused by KiTimerTableListHead suddenly having broken entries.
- Also fix a comment -- KiExitDispatcher doesn't release the dispatcher lock, it is done in KxInsertTimer

Modified:
    trunk/reactos/ntoskrnl/ke/timerobj.c

Modified: trunk/reactos/ntoskrnl/ke/timerobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/timerobj.c?rev=37068&r1=37067&r2=37068&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/timerobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/timerobj.c [iso-8859-1] Wed Oct 29 11:24:36 2008
@@ -398,6 +398,10 @@
 
             /* Check if we need to do an interrupt */
             if (RequestInterrupt) HalRequestSoftwareInterrupt(DISPATCH_LEVEL);
+
+            /* Exit the dispatcher and return the old state */
+            KiExitDispatcher(OldIrql);
+            return Inserted;
         }
 
         /* Set the time as Absolute */
@@ -419,7 +423,7 @@
     Timer->Header.SignalState = FALSE;
     KxInsertTimer(Timer, Hand);
 
-    /* Release Dispatcher Lock */
+    /* Exit the dispatcher */
     KiExitDispatcher(OldIrql);
 
     /* Return old state */



More information about the Ros-diffs mailing list