Paul Gofman : ntoskrnl.exe: Cancel active timer before setting it.

Alexandre Julliard julliard at winehq.org
Thu May 28 17:11:11 CDT 2020


Module: wine
Branch: master
Commit: 6cb3588969a9cbad1232dfdb9c0811ffdc7ead2f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6cb3588969a9cbad1232dfdb9c0811ffdc7ead2f

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Thu May 28 12:15:18 2020 +0300

ntoskrnl.exe: Cancel active timer before setting it.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntoskrnl.exe/sync.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
index 912dc046ba..36fa12fe00 100644
--- a/dlls/ntoskrnl.exe/sync.c
+++ b/dlls/ntoskrnl.exe/sync.c
@@ -443,7 +443,9 @@ BOOLEAN WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period,
 
     EnterCriticalSection( &sync_cs );
 
-    ret = timer->Header.Inserted;
+    if ((ret = timer->Header.Inserted))
+        KeCancelTimer(timer);
+
     timer->Header.Inserted = TRUE;
 
     if (!timer->TimerListEntry.Blink)




More information about the wine-cvs mailing list