Author: mjmartin Date: Wed Jun 30 11:00:21 2010 New Revision: 47915
URL: http://svn.reactos.org/svn/reactos?rev=47915&view=rev Log: [win32k] - Remove dead code as in the old SetTimer and KillTimer functions.
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Wed Jun 30 11:00:21 2010 @@ -448,102 +448,6 @@ DPRINT("TimerCount = %d\n", TimerCount); }
-// -// -// Old Timer Queueing -// -// -UINT_PTR FASTCALL -InternalSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer) -{ - PWINDOW_OBJECT Window; - UINT_PTR Ret = 0; - PTHREADINFO pti; - PUSER_MESSAGE_QUEUE MessageQueue; - - DPRINT("IntSetTimer wnd %x id %p elapse %u timerproc %p systemtimer %s\n", - Wnd, IDEvent, Elapse, TimerFunc, SystemTimer ? "TRUE" : "FALSE"); - - if ((Wnd == NULL) && ! SystemTimer) - { - DPRINT("Window-less timer\n"); - /* find a free, window-less timer id */ - IntLockWindowlessTimerBitmap(); - IDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex); - - if (IDEvent == (UINT_PTR) -1) - { - IntUnlockWindowlessTimerBitmap(); - DPRINT1("Unable to find a free window-less timer id\n"); - SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); - return 0; - } - - HintIndex = ++IDEvent; - IntUnlockWindowlessTimerBitmap(); - Ret = IDEvent; - pti = PsGetCurrentThreadWin32Thread(); - MessageQueue = pti->MessageQueue; - } - else - { - if (!(Window = UserGetWindowObject(Wnd))) - { - DPRINT1("Invalid window handle\n"); - return 0; - } - - if (Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess()) - { - DPRINT1("Trying to set timer for window in another process (shatter attack?)\n"); - SetLastWin32Error(ERROR_ACCESS_DENIED); - return 0; - } - - Ret = IDEvent; - MessageQueue = Window->pti->MessageQueue; - } - -#if 0 - - /* Windows NT/2k/XP behaviour */ - if (Elapse > 0x7fffffff) - { - DPRINT("Adjusting uElapse\n"); - Elapse = 1; - } - -#else - - /* Windows XP SP2 and Windows Server 2003 behaviour */ - if (Elapse > 0x7fffffff) - { - DPRINT("Adjusting uElapse\n"); - Elapse = 0x7fffffff; - } - -#endif - - /* Windows 2k/XP and Windows Server 2003 SP1 behaviour */ - if (Elapse < 10) - { - DPRINT("Adjusting uElapse\n"); - Elapse = 10; - } - - if (! MsqSetTimer(MessageQueue, Wnd, - IDEvent, Elapse, TimerFunc, - SystemTimer ? WM_SYSTIMER : WM_TIMER)) - { - DPRINT1("Failed to set timer in message queue\n"); - SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); - return 0; - } - -if (Ret == 0) ASSERT(FALSE); - return Ret; -} - BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window) { @@ -620,64 +524,6 @@ return pTmr ? TRUE : FALSE; }
-// -// -// Old Kill Timer -// -// -BOOL FASTCALL -InternalKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer) -{ - PTHREADINFO pti; - PWINDOW_OBJECT Window = NULL; - - DPRINT("IntKillTimer wnd %x id %p systemtimer %s\n", - Wnd, IDEvent, SystemTimer ? "TRUE" : "FALSE"); - - pti = PsGetCurrentThreadWin32Thread(); - if (Wnd) - { - Window = UserGetWindowObject(Wnd); - - if (! MsqKillTimer(pti->MessageQueue, Wnd, - IDEvent, SystemTimer ? WM_SYSTIMER : WM_TIMER)) - { - // Give it another chance to find the timer. - if (Window && !( MsqKillTimer(Window->pti->MessageQueue, Wnd, - IDEvent, SystemTimer ? WM_SYSTIMER : WM_TIMER))) - { - DPRINT1("Unable to locate timer in message queue for Window.\n"); - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - } - } - - /* window-less timer? */ - if ((Wnd == NULL) && ! SystemTimer) - { - if (! MsqKillTimer(pti->MessageQueue, Wnd, - IDEvent, SystemTimer ? WM_SYSTIMER : WM_TIMER)) - { - DPRINT1("Unable to locate timer in message queue for Window-less timer.\n"); - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - - /* Release the id */ - IntLockWindowlessTimerBitmap(); - - ASSERT(RtlAreBitsSet(&WindowLessTimersBitMap, IDEvent - 1, 1)); - RtlClearBits(&WindowLessTimersBitMap, IDEvent - 1, 1); - - HintIndex = IDEvent - 1; - - IntUnlockWindowlessTimerBitmap(); - } - - return TRUE; -} - NTSTATUS FASTCALL InitTimerImpl(VOID) {