- Set MasterTimer initial value to NULL and Initialize MasterTimer at the beginning of RawInputThreadMain before doing anything else.
- Add ASSERTs to catch if MasterTimer is NULL.


svn path=/trunk/; revision=47284
This commit is contained in:
Michael Martin 2010-05-20 21:07:53 +00:00
parent 8576b9c8e0
commit c88634cff4
2 changed files with 11 additions and 9 deletions

View file

@ -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!

View file

@ -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;