Author: mjmartin
Date: Tue Jun 29 14:37:52 2010
New Revision: 47906
URL:
http://svn.reactos.org/svn/reactos?rev=47906&view=rev
Log:
[win32k]
- Change percision of win32k timers to 0.5 miliseconds.
- Remove Destroy parameter from FindTimer as it is just odd and call RemoveTimer where
needed.
- PostTimerMessages: No need to continue looping the remainder of the timers once the
target timer has been found and message posted to message queue.
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/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Tue Jun 29 14:37:52
2010
@@ -5,6 +5,7 @@
* FILE: subsystems/win32/win32k/ntuser/timer.c
* PROGRAMER: Gunnar
* Thomas Weidenmueller (w3seek(a)users.sourceforge.net)
+ * Michael Martin (michael.martin(a)reactos.org)
* REVISION HISTORY: 10/04/2003 Implemented System Timers
*
*/
@@ -104,7 +105,7 @@
UserDereferenceObject(pTmr);
Ret = UserDeleteObject( UserHMGetHandle(pTmr), otTimer);
}
- if (!Ret) DPRINT1("Warning unable to delete timer\n");
+ if (!Ret) DPRINT1("Warning: Unable to delete timer\n");
return Ret;
}
@@ -113,8 +114,7 @@
FASTCALL
FindTimer(PWINDOW_OBJECT Window,
UINT_PTR nID,
- UINT flags,
- BOOL Distroy)
+ UINT flags)
{
PLIST_ENTRY pLE;
PTIMER pTmr = FirstpTmr, RetTmr = NULL;
@@ -127,10 +127,6 @@
pTmr->pWnd == Window &&
(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) == (flags &
(TMRF_SYSTEM|TMRF_RIT)))
{
- if (Distroy)
- {
- RemoveTimer(pTmr);
- }
RetTmr = pTmr;
break;
}
@@ -206,7 +202,7 @@
PTIMER pTmr;
UINT Ret= IDEvent;
LARGE_INTEGER DueTime;
- DueTime.QuadPart = (LONGLONG)(-10000000);
+ DueTime.QuadPart = (LONGLONG)(-5000000);
#if 0
/* Windows NT/2k/XP behaviour */
@@ -234,7 +230,7 @@
if ((Window) && (IDEvent == 0))
IDEvent = 1;
- pTmr = FindTimer(Window, IDEvent, Type, FALSE);
+ pTmr = FindTimer(Window, IDEvent, Type);
if ((!pTmr) && (Window == NULL) && (!(Type & TMRF_SYSTEM)))
{
@@ -350,7 +346,7 @@
{
if ( (pTmr->flags & TMRF_READY) &&
(pTmr->pti == pti) &&
- ((pTmr->pWnd == Window) || (Window == NULL) ) )
+ ((pTmr->pWnd == Window) || (Window == NULL)) )
{
Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->hSelf : 0;
Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
@@ -361,6 +357,7 @@
pTmr->flags &= ~TMRF_READY;
ThreadQueue->WakeMask = ~QS_TIMER;
Hit = TRUE;
+ break;
}
pLE = pTmr->ptmrList.Flink;
@@ -389,7 +386,7 @@
KeQueryTickCount(&TickCount);
Time = MsqCalculateMessageTime(&TickCount);
- DueTime.QuadPart = (LONGLONG)(-1000000);
+ DueTime.QuadPart = (LONGLONG)(-500000);
do
{
@@ -611,7 +608,15 @@
if ((Window) && (IDEvent == 0))
IDEvent = 1;
- pTmr = FindTimer(Window, IDEvent, SystemTimer ? TMRF_SYSTEM : 0, TRUE);
+ pTmr = FindTimer(Window, IDEvent, SystemTimer ? TMRF_SYSTEM : 0);
+
+ if (pTmr)
+ {
+ TimerEnterExclusive();
+ RemoveTimer(pTmr);
+ TimerLeave();
+ }
+
return pTmr ? TRUE : FALSE;
}