diff --git a/reactos/subsystems/win32/win32k/ntuser/input.c b/reactos/subsystems/win32/win32k/ntuser/input.c index c75ecb2714f..7cd94f2c5f9 100644 --- a/reactos/subsystems/win32/win32k/ntuser/input.c +++ b/reactos/subsystems/win32/win32k/ntuser/input.c @@ -22,7 +22,7 @@ extern NTSTATUS Win32kInitWin32Thread(PETHREAD Thread); /* GLOBALS *******************************************************************/ PTHREADINFO ptiRawInput; -PKTIMER MasterTimer; +PKTIMER MasterTimer = NULL; PATTACHINFO gpai = NULL; static HANDLE MouseDeviceHandle; @@ -868,6 +868,14 @@ RawInputThreadMain(PVOID StartContext) NTSTATUS Status; LARGE_INTEGER DueTime; + MasterTimer = ExAllocatePoolWithTag(NonPagedPool, sizeof(KTIMER), TAG_INPUT); + if (!MasterTimer) + { + DPRINT1("Win32K: Failed making Raw Input thread a win32 thread.\n"); + return; + } + KeInitializeTimer(MasterTimer); + DueTime.QuadPart = (LONGLONG)(-10000000); do @@ -879,14 +887,6 @@ RawInputThreadMain(PVOID StartContext) Objects[0] = &InputThreadsStart; - - MasterTimer = ExAllocatePoolWithTag(NonPagedPool, sizeof(KTIMER), TAG_INPUT); - if (!MasterTimer) - { - DPRINT1("Win32K: Failed making Raw Input thread a win32 thread.\n"); - return; - } - KeInitializeTimer(MasterTimer); Objects[1] = MasterTimer; // This thread requires win32k! diff --git a/reactos/subsystems/win32/win32k/ntuser/timer.c b/reactos/subsystems/win32/win32k/ntuser/timer.c index fdfddc667ec..2d7b8d003d7 100644 --- a/reactos/subsystems/win32/win32k/ntuser/timer.c +++ b/reactos/subsystems/win32/win32k/ntuser/timer.c @@ -245,6 +245,7 @@ IntSetTimer( PWINDOW_OBJECT Window, pTmr->flags &= ~TMRF_DELETEPENDING; } + ASSERT(MasterTimer != NULL); // Start the timer thread! if (pTmr == FirstpTmr) KeSetTimer(MasterTimer, DueTime, NULL); @@ -419,6 +420,7 @@ ProcessTimers(VOID) } while (pTmr != FirstpTmr); // Restart the timer thread! + ASSERT(MasterTimer != NULL); KeSetTimer(MasterTimer, DueTime, NULL); TimeLast = Time;