mirror of
https://github.com/reactos/reactos.git
synced 2026-05-30 14:34:57 +08:00
[NTOS:KE] Fix calculation of timer expiration
Both due-times and interrupt time are unsigned, but were treated as signed in KiInsertTimerTable, which led to very long (e.g. INFINITE) waits being interpreted as having a negative due-time and being completed instantly. Mostly fixes kernel32_apitest QueueUserAPC
This commit is contained in:
@@ -63,8 +63,8 @@ FASTCALL
|
||||
KiInsertTimerTable(IN PKTIMER Timer,
|
||||
IN ULONG Hand)
|
||||
{
|
||||
LARGE_INTEGER InterruptTime;
|
||||
LONGLONG DueTime = Timer->DueTime.QuadPart;
|
||||
ULONGLONG InterruptTime;
|
||||
ULONGLONG DueTime = Timer->DueTime.QuadPart;
|
||||
BOOLEAN Expired = FALSE;
|
||||
PLIST_ENTRY ListHead, NextEntry;
|
||||
PKTIMER CurrentTimer;
|
||||
@@ -101,8 +101,8 @@ KiInsertTimerTable(IN PKTIMER Timer,
|
||||
KiTimerTableListHead[Hand].Time.QuadPart = DueTime;
|
||||
|
||||
/* Make sure it hasn't expired already */
|
||||
InterruptTime.QuadPart = KeQueryInterruptTime();
|
||||
if (DueTime <= InterruptTime.QuadPart) Expired = TRUE;
|
||||
InterruptTime = KeQueryInterruptTime();
|
||||
if (DueTime <= InterruptTime) Expired = TRUE;
|
||||
}
|
||||
|
||||
/* Return expired state */
|
||||
|
||||
Reference in New Issue
Block a user