2008-08-06 02:05:17 +00:00
|
|
|
/*
|
2003-04-02 23:12:53 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* PURPOSE: Window timers messages
|
2015-11-10 17:41:55 +00:00
|
|
|
* FILE: win32ss/user/ntuser/timer.c
|
2003-04-02 23:12:53 +00:00
|
|
|
* PROGRAMER: Gunnar
|
2003-10-15 13:39:09 +00:00
|
|
|
* Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
2010-06-29 14:37:52 +00:00
|
|
|
* Michael Martin (michael.martin@reactos.org)
|
2003-04-02 23:12:53 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-26 13:58:46 +00:00
|
|
|
#include <win32k.h>
|
2011-08-21 12:38:52 +00:00
|
|
|
DBG_DEFAULT_CHANNEL(UserTimer);
|
2003-04-02 23:12:53 +00:00
|
|
|
|
|
|
|
/* GLOBALS *******************************************************************/
|
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
static LIST_ENTRY TimersListHead;
|
2009-01-15 23:15:31 +00:00
|
|
|
static LONG TimeLast = 0;
|
|
|
|
|
2004-12-29 19:55:01 +00:00
|
|
|
/* Windows 2000 has room for 32768 window-less timers */
|
2024-10-22 15:10:34 +00:00
|
|
|
/* These values give timer IDs [256,32767], same as on Windows */
|
|
|
|
#define MAX_WINDOW_LESS_TIMER_ID (32768 - 1)
|
|
|
|
#define NUM_WINDOW_LESS_TIMERS (32768 - 256)
|
2003-04-02 23:12:53 +00:00
|
|
|
|
2024-08-27 06:14:51 +00:00
|
|
|
#define HINTINDEX_BEGIN_VALUE 0
|
|
|
|
|
2012-02-21 18:00:50 +00:00
|
|
|
static PFAST_MUTEX Mutex;
|
2004-03-04 01:30:00 +00:00
|
|
|
static RTL_BITMAP WindowLessTimersBitMap;
|
|
|
|
static PVOID WindowLessTimersBitMapBuffer;
|
2024-08-27 06:14:51 +00:00
|
|
|
static ULONG HintIndex = HINTINDEX_BEGIN_VALUE;
|
2003-04-02 23:12:53 +00:00
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
ERESOURCE TimerLock;
|
2003-04-02 23:12:53 +00:00
|
|
|
|
2004-12-29 19:55:01 +00:00
|
|
|
#define IntLockWindowlessTimerBitmap() \
|
2012-02-21 18:00:50 +00:00
|
|
|
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(Mutex)
|
2004-02-24 13:27:03 +00:00
|
|
|
|
2004-12-29 19:55:01 +00:00
|
|
|
#define IntUnlockWindowlessTimerBitmap() \
|
2012-02-21 18:00:50 +00:00
|
|
|
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(Mutex)
|
2004-02-24 13:27:03 +00:00
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
#define TimerEnterExclusive() \
|
|
|
|
{ \
|
|
|
|
KeEnterCriticalRegion(); \
|
|
|
|
ExAcquireResourceExclusiveLite(&TimerLock, TRUE); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TimerLeave() \
|
|
|
|
{ \
|
|
|
|
ExReleaseResourceLite(&TimerLock); \
|
|
|
|
KeLeaveCriticalRegion(); \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-04-02 23:12:53 +00:00
|
|
|
/* FUNCTIONS *****************************************************************/
|
2009-01-15 23:15:31 +00:00
|
|
|
static
|
2009-01-14 02:02:26 +00:00
|
|
|
PTIMER
|
|
|
|
FASTCALL
|
|
|
|
CreateTimer(VOID)
|
|
|
|
{
|
|
|
|
HANDLE Handle;
|
|
|
|
PTIMER Ret = NULL;
|
|
|
|
|
2012-12-29 19:14:30 +00:00
|
|
|
Ret = UserCreateObject(gHandleTable, NULL, NULL, &Handle, TYPE_TIMER, sizeof(TIMER));
|
2011-01-29 09:03:25 +00:00
|
|
|
if (Ret)
|
2009-01-14 02:02:26 +00:00
|
|
|
{
|
2023-12-24 16:42:15 +00:00
|
|
|
UserHMSetHandle(Ret, Handle);
|
2011-01-29 09:03:25 +00:00
|
|
|
InsertTailList(&TimersListHead, &Ret->ptmrList);
|
2010-05-15 19:40:33 +00:00
|
|
|
}
|
2011-01-29 09:03:25 +00:00
|
|
|
|
2009-01-14 02:02:26 +00:00
|
|
|
return Ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOL
|
|
|
|
FASTCALL
|
|
|
|
RemoveTimer(PTIMER pTmr)
|
|
|
|
{
|
2010-05-29 06:51:03 +00:00
|
|
|
BOOL Ret = FALSE;
|
2009-01-14 02:02:26 +00:00
|
|
|
if (pTmr)
|
|
|
|
{
|
2010-05-15 19:40:33 +00:00
|
|
|
/* Set the flag, it will be removed when ready */
|
2010-05-28 20:35:30 +00:00
|
|
|
RemoveEntryList(&pTmr->ptmrList);
|
2011-04-08 19:29:15 +00:00
|
|
|
if ((pTmr->pWnd == NULL) && (!(pTmr->flags & TMRF_SYSTEM))) // System timers are reusable.
|
2010-06-07 13:37:43 +00:00
|
|
|
{
|
2024-10-22 15:10:34 +00:00
|
|
|
ULONG ulBitmapIndex;
|
2010-08-19 10:52:36 +00:00
|
|
|
|
2024-10-22 15:10:34 +00:00
|
|
|
ASSERT(pTmr->nID <= MAX_WINDOW_LESS_TIMER_ID);
|
|
|
|
ulBitmapIndex = (ULONG)(MAX_WINDOW_LESS_TIMER_ID - pTmr->nID);
|
2010-06-07 13:37:43 +00:00
|
|
|
IntLockWindowlessTimerBitmap();
|
2024-10-22 15:10:34 +00:00
|
|
|
RtlClearBit(&WindowLessTimersBitMap, ulBitmapIndex);
|
2010-06-07 13:37:43 +00:00
|
|
|
IntUnlockWindowlessTimerBitmap();
|
|
|
|
}
|
2010-05-29 06:51:03 +00:00
|
|
|
UserDereferenceObject(pTmr);
|
2012-12-29 19:14:30 +00:00
|
|
|
Ret = UserDeleteObject( UserHMGetHandle(pTmr), TYPE_TIMER);
|
2009-01-14 02:02:26 +00:00
|
|
|
}
|
2011-08-21 12:38:52 +00:00
|
|
|
if (!Ret) ERR("Warning: Unable to delete timer\n");
|
2010-05-29 06:51:03 +00:00
|
|
|
|
|
|
|
return Ret;
|
2009-01-14 02:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PTIMER
|
|
|
|
FASTCALL
|
2010-10-11 03:41:41 +00:00
|
|
|
FindTimer(PWND Window,
|
2009-01-14 02:02:26 +00:00
|
|
|
UINT_PTR nID,
|
2010-06-29 14:37:52 +00:00
|
|
|
UINT flags)
|
2009-01-14 02:02:26 +00:00
|
|
|
{
|
2011-04-11 03:24:14 +00:00
|
|
|
PLIST_ENTRY pLE;
|
2011-01-29 09:03:25 +00:00
|
|
|
PTIMER pTmr, RetTmr = NULL;
|
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerEnterExclusive();
|
2011-04-11 03:24:14 +00:00
|
|
|
pLE = TimersListHead.Flink;
|
2011-01-29 09:03:25 +00:00
|
|
|
while (pLE != &TimersListHead)
|
2009-01-14 02:02:26 +00:00
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
2009-01-14 02:02:26 +00:00
|
|
|
|
|
|
|
if ( pTmr->nID == nID &&
|
|
|
|
pTmr->pWnd == Window &&
|
|
|
|
(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) == (flags & (TMRF_SYSTEM|TMRF_RIT)))
|
|
|
|
{
|
2010-05-15 19:40:33 +00:00
|
|
|
RetTmr = pTmr;
|
2009-01-14 02:02:26 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
pLE = pLE->Flink;
|
|
|
|
}
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerLeave();
|
2009-01-14 02:02:26 +00:00
|
|
|
|
2010-05-15 19:40:33 +00:00
|
|
|
return RetTmr;
|
2009-01-14 02:02:26 +00:00
|
|
|
}
|
2003-04-02 23:12:53 +00:00
|
|
|
|
2009-01-13 12:16:06 +00:00
|
|
|
PTIMER
|
|
|
|
FASTCALL
|
|
|
|
FindSystemTimer(PMSG pMsg)
|
|
|
|
{
|
2011-04-11 03:24:14 +00:00
|
|
|
PLIST_ENTRY pLE;
|
2011-01-29 09:03:25 +00:00
|
|
|
PTIMER pTmr = NULL;
|
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerEnterExclusive();
|
2011-04-11 03:24:14 +00:00
|
|
|
pLE = TimersListHead.Flink;
|
2011-01-29 09:03:25 +00:00
|
|
|
while (pLE != &TimersListHead)
|
2009-01-13 12:16:06 +00:00
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
2009-01-13 12:16:06 +00:00
|
|
|
|
|
|
|
if ( pMsg->lParam == (LPARAM)pTmr->pfn &&
|
|
|
|
(pTmr->flags & TMRF_SYSTEM) )
|
|
|
|
break;
|
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
pLE = pLE->Flink;
|
|
|
|
}
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerLeave();
|
2009-01-13 12:16:06 +00:00
|
|
|
|
|
|
|
return pTmr;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
FASTCALL
|
2009-01-15 23:15:31 +00:00
|
|
|
ValidateTimerCallback(PTHREADINFO pti,
|
2009-01-13 12:16:06 +00:00
|
|
|
LPARAM lParam)
|
|
|
|
{
|
2011-04-11 03:24:14 +00:00
|
|
|
PLIST_ENTRY pLE;
|
2010-10-03 19:18:19 +00:00
|
|
|
BOOL Ret = FALSE;
|
2011-01-29 09:03:25 +00:00
|
|
|
PTIMER pTmr;
|
2009-01-13 12:16:06 +00:00
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerEnterExclusive();
|
2011-04-11 03:24:14 +00:00
|
|
|
pLE = TimersListHead.Flink;
|
2011-01-29 09:03:25 +00:00
|
|
|
while (pLE != &TimersListHead)
|
2009-01-13 12:16:06 +00:00
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
2009-01-13 12:16:06 +00:00
|
|
|
if ( (lParam == (LPARAM)pTmr->pfn) &&
|
2010-10-03 19:18:19 +00:00
|
|
|
!(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) &&
|
2009-08-16 21:44:59 +00:00
|
|
|
(pTmr->pti->ppi == pti->ppi) )
|
2010-10-03 19:18:19 +00:00
|
|
|
{
|
|
|
|
Ret = TRUE;
|
2009-01-13 12:16:06 +00:00
|
|
|
break;
|
2010-10-03 19:18:19 +00:00
|
|
|
}
|
2011-01-29 09:03:25 +00:00
|
|
|
pLE = pLE->Flink;
|
|
|
|
}
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerLeave();
|
2009-01-13 12:16:06 +00:00
|
|
|
|
2010-10-03 19:18:19 +00:00
|
|
|
return Ret;
|
2009-01-13 12:16:06 +00:00
|
|
|
}
|
2003-04-02 23:12:53 +00:00
|
|
|
|
2009-01-14 02:02:26 +00:00
|
|
|
UINT_PTR FASTCALL
|
2010-10-11 03:41:41 +00:00
|
|
|
IntSetTimer( PWND Window,
|
2009-01-15 23:15:31 +00:00
|
|
|
UINT_PTR IDEvent,
|
|
|
|
UINT Elapse,
|
|
|
|
TIMERPROC TimerFunc,
|
|
|
|
INT Type)
|
2009-01-14 02:02:26 +00:00
|
|
|
{
|
2009-01-15 23:15:31 +00:00
|
|
|
PTIMER pTmr;
|
2024-08-29 07:29:38 +00:00
|
|
|
UINT_PTR Ret = IDEvent;
|
|
|
|
ULONG ulBitmapIndex;
|
2009-01-15 23:15:31 +00:00
|
|
|
LARGE_INTEGER DueTime;
|
2011-10-17 01:33:55 +00:00
|
|
|
DueTime.QuadPart = (LONGLONG)(-97656); // 1024hz .9765625 ms set to 10.0 ms
|
2009-01-15 23:15:31 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* Windows NT/2k/XP behaviour */
|
2013-12-08 22:44:02 +00:00
|
|
|
if (Elapse > USER_TIMER_MAXIMUM)
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("Adjusting uElapse\n");
|
2009-01-15 23:15:31 +00:00
|
|
|
Elapse = 1;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
/* Windows XP SP2 and Windows Server 2003 behaviour */
|
2013-12-08 22:44:02 +00:00
|
|
|
if (Elapse > USER_TIMER_MAXIMUM)
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("Adjusting uElapse\n");
|
2013-12-08 22:44:02 +00:00
|
|
|
Elapse = USER_TIMER_MAXIMUM;
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Windows 2k/XP and Windows Server 2003 SP1 behaviour */
|
2013-12-08 22:44:02 +00:00
|
|
|
if (Elapse < USER_TIMER_MINIMUM)
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("Adjusting uElapse\n");
|
2013-12-08 22:44:02 +00:00
|
|
|
Elapse = USER_TIMER_MINIMUM; // 1024hz .9765625 ms, set to 10.0 ms (+/-)1 ms
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
|
|
|
|
2010-08-19 10:52:36 +00:00
|
|
|
/* Passing an IDEvent of 0 and the SetTimer returns 1.
|
|
|
|
It will create the timer with an ID of 0 */
|
2010-06-07 13:37:43 +00:00
|
|
|
if ((Window) && (IDEvent == 0))
|
2010-08-19 10:52:36 +00:00
|
|
|
Ret = 1;
|
2010-06-07 13:37:43 +00:00
|
|
|
|
2010-06-29 14:37:52 +00:00
|
|
|
pTmr = FindTimer(Window, IDEvent, Type);
|
2010-06-07 13:37:43 +00:00
|
|
|
|
|
|
|
if ((!pTmr) && (Window == NULL) && (!(Type & TMRF_SYSTEM)))
|
2010-05-15 19:40:33 +00:00
|
|
|
{
|
|
|
|
IntLockWindowlessTimerBitmap();
|
2010-06-07 13:37:43 +00:00
|
|
|
|
2024-10-22 15:10:34 +00:00
|
|
|
ulBitmapIndex = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex);
|
|
|
|
HintIndex = (ulBitmapIndex + 1) % NUM_WINDOW_LESS_TIMERS;
|
2024-08-29 07:29:38 +00:00
|
|
|
if (ulBitmapIndex == ULONG_MAX)
|
2010-05-15 19:40:33 +00:00
|
|
|
{
|
|
|
|
IntUnlockWindowlessTimerBitmap();
|
2011-08-21 12:38:52 +00:00
|
|
|
ERR("Unable to find a free window-less timer id\n");
|
2010-12-25 11:01:14 +00:00
|
|
|
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
|
2010-05-15 19:40:33 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:29:38 +00:00
|
|
|
ASSERT(ulBitmapIndex < NUM_WINDOW_LESS_TIMERS);
|
2024-10-22 15:10:34 +00:00
|
|
|
IDEvent = MAX_WINDOW_LESS_TIMER_ID - ulBitmapIndex;
|
2010-05-15 19:40:33 +00:00
|
|
|
Ret = IDEvent;
|
2010-08-19 10:52:36 +00:00
|
|
|
|
2010-06-07 13:37:43 +00:00
|
|
|
IntUnlockWindowlessTimerBitmap();
|
2010-05-15 19:40:33 +00:00
|
|
|
}
|
|
|
|
|
2010-05-28 20:35:30 +00:00
|
|
|
if (!pTmr)
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
|
|
|
pTmr = CreateTimer();
|
|
|
|
if (!pTmr) return 0;
|
|
|
|
|
2010-05-28 20:35:30 +00:00
|
|
|
if (Window && (Type & TMRF_TIFROMWND))
|
2010-10-11 03:41:41 +00:00
|
|
|
pTmr->pti = Window->head.pti->pEThread->Tcb.Win32Thread;
|
2010-05-28 20:35:30 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (Type & TMRF_RIT)
|
|
|
|
pTmr->pti = ptiRawInput;
|
|
|
|
else
|
|
|
|
pTmr->pti = PsGetCurrentThreadWin32Thread();
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
2010-05-28 20:35:30 +00:00
|
|
|
|
2009-01-15 23:15:31 +00:00
|
|
|
pTmr->pWnd = Window;
|
|
|
|
pTmr->cmsCountdown = Elapse;
|
|
|
|
pTmr->cmsRate = Elapse;
|
|
|
|
pTmr->pfn = TimerFunc;
|
|
|
|
pTmr->nID = IDEvent;
|
2010-08-19 10:52:36 +00:00
|
|
|
pTmr->flags = Type|TMRF_INIT;
|
2010-05-15 19:40:33 +00:00
|
|
|
}
|
2010-05-28 20:35:30 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
pTmr->cmsCountdown = Elapse;
|
|
|
|
pTmr->cmsRate = Elapse;
|
|
|
|
}
|
2009-01-15 23:15:31 +00:00
|
|
|
|
2010-05-20 21:07:53 +00:00
|
|
|
ASSERT(MasterTimer != NULL);
|
2009-01-15 23:15:31 +00:00
|
|
|
// Start the timer thread!
|
2011-01-29 09:03:25 +00:00
|
|
|
if (TimersListHead.Flink == TimersListHead.Blink) // There is only one timer
|
2010-05-15 19:40:33 +00:00
|
|
|
KeSetTimer(MasterTimer, DueTime, NULL);
|
2009-01-15 23:15:31 +00:00
|
|
|
|
2010-05-15 19:40:33 +00:00
|
|
|
return Ret;
|
2009-01-14 02:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
2009-01-15 23:15:31 +00:00
|
|
|
// Process win32k system timers.
|
2009-01-14 02:02:26 +00:00
|
|
|
//
|
|
|
|
VOID
|
|
|
|
CALLBACK
|
|
|
|
SystemTimerProc(HWND hwnd,
|
|
|
|
UINT uMsg,
|
2013-09-01 23:58:37 +00:00
|
|
|
UINT_PTR idEvent,
|
|
|
|
DWORD dwTime)
|
2009-01-14 02:02:26 +00:00
|
|
|
{
|
2011-04-08 19:29:15 +00:00
|
|
|
PDESKTOP pDesk;
|
|
|
|
PWND pWnd = NULL;
|
|
|
|
|
|
|
|
if (hwnd)
|
|
|
|
{
|
|
|
|
pWnd = UserGetWindowObject(hwnd);
|
|
|
|
if (!pWnd)
|
|
|
|
{
|
2013-09-01 23:58:37 +00:00
|
|
|
ERR("System Timer Proc has invalid window handle! %p Id: %u\n", hwnd, idEvent);
|
2011-04-08 19:29:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE( "Windowless Timer Running!\n" );
|
2011-04-08 19:29:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (idEvent)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Used in NtUserTrackMouseEvent.
|
|
|
|
*/
|
|
|
|
case ID_EVENT_SYSTIMER_MOUSEHOVER:
|
|
|
|
{
|
|
|
|
POINT Point;
|
|
|
|
UINT Msg;
|
|
|
|
WPARAM wParam;
|
|
|
|
|
|
|
|
pDesk = pWnd->head.rpdesk;
|
|
|
|
if ( pDesk->dwDTFlags & DF_TME_HOVER &&
|
|
|
|
pWnd == pDesk->spwndTrack )
|
|
|
|
{
|
2014-11-21 03:15:27 +00:00
|
|
|
Point = gpsi->ptCursor;
|
2011-08-27 12:38:23 +00:00
|
|
|
if ( RECTL_bPointInRect(&pDesk->rcMouseHover, Point.x, Point.y) )
|
2011-04-08 19:29:15 +00:00
|
|
|
{
|
|
|
|
if (pDesk->htEx == HTCLIENT) // In a client area.
|
|
|
|
{
|
2014-11-24 02:50:18 +00:00
|
|
|
wParam = MsqGetDownKeyState(pWnd->head.pti->MessageQueue);
|
2011-04-08 19:29:15 +00:00
|
|
|
Msg = WM_MOUSEHOVER;
|
|
|
|
|
|
|
|
if (pWnd->ExStyle & WS_EX_LAYOUTRTL)
|
|
|
|
{
|
|
|
|
Point.x = pWnd->rcClient.right - Point.x - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
Point.x -= pWnd->rcClient.left;
|
|
|
|
Point.y -= pWnd->rcClient.top;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wParam = pDesk->htEx; // Need to support all HTXYZ hits.
|
|
|
|
Msg = WM_NCMOUSEHOVER;
|
|
|
|
}
|
2011-09-19 08:32:38 +00:00
|
|
|
TRACE("Generating WM_NCMOUSEHOVER\n");
|
2011-04-08 19:29:15 +00:00
|
|
|
UserPostMessage(hwnd, Msg, wParam, MAKELPARAM(Point.x, Point.y));
|
|
|
|
pDesk->dwDTFlags &= ~DF_TME_HOVER;
|
|
|
|
break; // Kill this timer.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return; // Not this window so just return.
|
|
|
|
|
2015-01-31 22:41:34 +00:00
|
|
|
case ID_EVENT_SYSTIMER_FLASHWIN:
|
|
|
|
{
|
2015-03-08 23:37:06 +00:00
|
|
|
FLASHWINFO fwi =
|
2015-01-31 22:41:34 +00:00
|
|
|
{sizeof(FLASHWINFO),
|
|
|
|
UserHMGetHandle(pWnd),
|
|
|
|
FLASHW_SYSTIMER,0,0};
|
|
|
|
|
|
|
|
IntFlashWindowEx(pWnd, &fwi);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
|
2011-04-08 19:29:15 +00:00
|
|
|
default:
|
2013-09-01 23:58:37 +00:00
|
|
|
ERR("System Timer Proc invalid id %u!\n", idEvent);
|
2011-04-08 19:29:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
IntKillTimer(pWnd, idEvent, TRUE);
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
StartTheTimers(VOID)
|
|
|
|
{
|
|
|
|
// Need to start gdi syncro timers then start timer with Hang App proc
|
2012-12-18 21:44:58 +00:00
|
|
|
// that calles Idle process so the screen savers will know to run......
|
2011-04-08 19:29:15 +00:00
|
|
|
IntSetTimer(NULL, 0, 1000, HungAppSysTimerProc, TMRF_RIT);
|
|
|
|
// Test Timers
|
|
|
|
// IntSetTimer(NULL, 0, 1000, SystemTimerProc, TMRF_RIT);
|
2009-01-14 02:02:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UINT_PTR
|
|
|
|
FASTCALL
|
2010-10-11 03:41:41 +00:00
|
|
|
SystemTimerSet( PWND Window,
|
2009-01-14 02:02:26 +00:00
|
|
|
UINT_PTR nIDEvent,
|
|
|
|
UINT uElapse,
|
2010-05-15 19:40:33 +00:00
|
|
|
TIMERPROC lpTimerFunc)
|
2009-01-14 02:02:26 +00:00
|
|
|
{
|
2010-10-11 03:41:41 +00:00
|
|
|
if (Window && Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2010-12-25 11:01:14 +00:00
|
|
|
EngSetLastError(ERROR_ACCESS_DENIED);
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("SysemTimerSet: Access Denied!\n");
|
2009-01-15 23:15:31 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2010-05-15 19:40:33 +00:00
|
|
|
return IntSetTimer( Window, nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM);
|
2009-01-14 02:02:26 +00:00
|
|
|
}
|
|
|
|
|
2009-01-15 23:15:31 +00:00
|
|
|
BOOL
|
|
|
|
FASTCALL
|
2010-10-11 03:41:41 +00:00
|
|
|
PostTimerMessages(PWND Window)
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2011-04-11 03:24:14 +00:00
|
|
|
PLIST_ENTRY pLE;
|
2009-01-15 23:15:31 +00:00
|
|
|
MSG Msg;
|
|
|
|
PTHREADINFO pti;
|
|
|
|
BOOL Hit = FALSE;
|
2011-01-29 09:03:25 +00:00
|
|
|
PTIMER pTmr;
|
2009-01-15 23:15:31 +00:00
|
|
|
|
|
|
|
pti = PsGetCurrentThreadWin32Thread();
|
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerEnterExclusive();
|
2011-04-11 03:24:14 +00:00
|
|
|
pLE = TimersListHead.Flink;
|
2011-01-29 09:03:25 +00:00
|
|
|
while(pLE != &TimersListHead)
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
2009-01-15 23:15:31 +00:00
|
|
|
if ( (pTmr->flags & TMRF_READY) &&
|
|
|
|
(pTmr->pti == pti) &&
|
2010-06-29 14:37:52 +00:00
|
|
|
((pTmr->pWnd == Window) || (Window == NULL)) )
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2024-01-05 00:16:44 +00:00
|
|
|
Msg.hwnd = (pTmr->pWnd ? UserHMGetHandle(pTmr->pWnd) : NULL);
|
2009-01-15 23:15:31 +00:00
|
|
|
Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
|
|
|
|
Msg.wParam = (WPARAM) pTmr->nID;
|
|
|
|
Msg.lParam = (LPARAM) pTmr->pfn;
|
2019-04-11 22:56:04 +00:00
|
|
|
Msg.time = EngGetTickCount32();
|
2016-02-24 08:41:26 +00:00
|
|
|
// Fix all wine win:test_GetMessagePos WM_TIMER tests. See CORE-10867.
|
|
|
|
Msg.pt = gpsi->ptCursor;
|
2009-01-15 23:15:31 +00:00
|
|
|
|
2014-11-24 02:50:18 +00:00
|
|
|
MsqPostMessage(pti, &Msg, FALSE, (QS_POSTMESSAGE|QS_ALLPOSTMESSAGE), 0, 0);
|
2009-01-15 23:15:31 +00:00
|
|
|
pTmr->flags &= ~TMRF_READY;
|
2013-12-08 22:44:02 +00:00
|
|
|
ClearMsgBitsMask(pti, QS_TIMER);
|
2009-01-15 23:15:31 +00:00
|
|
|
Hit = TRUE;
|
2011-04-08 19:29:15 +00:00
|
|
|
// Now move this entry to the end of the list so it will not be
|
|
|
|
// called again in the next msg loop.
|
|
|
|
if (pLE != &TimersListHead)
|
|
|
|
{
|
|
|
|
RemoveEntryList(&pTmr->ptmrList);
|
|
|
|
InsertTailList(&TimersListHead, &pTmr->ptmrList);
|
|
|
|
}
|
2010-06-29 14:37:52 +00:00
|
|
|
break;
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
pLE = pLE->Flink;
|
|
|
|
}
|
2010-05-15 19:40:33 +00:00
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerLeave();
|
2009-01-15 23:15:31 +00:00
|
|
|
|
|
|
|
return Hit;
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
ProcessTimers(VOID)
|
|
|
|
{
|
2019-04-11 22:56:04 +00:00
|
|
|
LARGE_INTEGER DueTime;
|
2009-01-15 23:15:31 +00:00
|
|
|
LONG Time;
|
2011-04-11 03:24:14 +00:00
|
|
|
PLIST_ENTRY pLE;
|
2011-01-29 09:03:25 +00:00
|
|
|
PTIMER pTmr;
|
2010-05-26 02:04:09 +00:00
|
|
|
LONG TimerCount = 0;
|
2009-01-15 23:15:31 +00:00
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerEnterExclusive();
|
2011-04-11 03:24:14 +00:00
|
|
|
pLE = TimersListHead.Flink;
|
2019-04-11 22:56:04 +00:00
|
|
|
Time = EngGetTickCount32();
|
2009-01-15 23:15:31 +00:00
|
|
|
|
2011-10-17 01:33:55 +00:00
|
|
|
DueTime.QuadPart = (LONGLONG)(-97656); // 1024hz .9765625 ms set to 10.0 ms
|
2009-01-15 23:15:31 +00:00
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
while(pLE != &TimersListHead)
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
2010-05-26 02:04:09 +00:00
|
|
|
TimerCount++;
|
2009-01-15 23:15:31 +00:00
|
|
|
if (pTmr->flags & TMRF_WAITING)
|
|
|
|
{
|
2010-01-14 13:33:04 +00:00
|
|
|
pLE = pTmr->ptmrList.Flink;
|
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
2009-01-15 23:15:31 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2010-05-15 19:40:33 +00:00
|
|
|
if (pTmr->flags & TMRF_INIT)
|
|
|
|
{
|
2009-01-15 23:15:31 +00:00
|
|
|
pTmr->flags &= ~TMRF_INIT; // Skip this run.
|
2010-05-15 19:40:33 +00:00
|
|
|
}
|
2009-01-15 23:15:31 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (pTmr->cmsCountdown < 0)
|
|
|
|
{
|
2010-05-17 00:01:26 +00:00
|
|
|
ASSERT(pTmr->pti);
|
|
|
|
if ((!(pTmr->flags & TMRF_READY)) && (!(pTmr->pti->TIF_flags & TIF_INCLEANUP)))
|
2009-01-15 23:15:31 +00:00
|
|
|
{
|
|
|
|
if (pTmr->flags & TMRF_ONESHOT)
|
|
|
|
pTmr->flags |= TMRF_WAITING;
|
|
|
|
|
|
|
|
if (pTmr->flags & TMRF_RIT)
|
|
|
|
{
|
|
|
|
// Hard coded call here, inside raw input thread.
|
|
|
|
pTmr->pfn(NULL, WM_SYSTIMER, pTmr->nID, (LPARAM)pTmr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pTmr->flags |= TMRF_READY; // Set timer ready to be ran.
|
|
|
|
// Set thread message queue for this timer.
|
2013-12-08 22:44:02 +00:00
|
|
|
if (pTmr->pti)
|
2009-01-15 23:15:31 +00:00
|
|
|
{ // Wakeup thread
|
2013-12-08 22:44:02 +00:00
|
|
|
pTmr->pti->cTimersReady++;
|
2013-05-10 22:28:18 +00:00
|
|
|
ASSERT(pTmr->pti->pEventQueueServer != NULL);
|
2013-12-08 22:44:02 +00:00
|
|
|
MsqWakeQueue(pTmr->pti, QS_TIMER, TRUE);
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-05-28 20:35:30 +00:00
|
|
|
pTmr->cmsCountdown = pTmr->cmsRate;
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
pTmr->cmsCountdown -= Time - TimeLast;
|
|
|
|
}
|
2010-05-15 19:40:33 +00:00
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
pLE = pLE->Flink;
|
|
|
|
}
|
2009-01-15 23:15:31 +00:00
|
|
|
|
|
|
|
// Restart the timer thread!
|
2010-05-20 21:07:53 +00:00
|
|
|
ASSERT(MasterTimer != NULL);
|
2009-01-15 23:15:31 +00:00
|
|
|
KeSetTimer(MasterTimer, DueTime, NULL);
|
|
|
|
|
|
|
|
TimeLast = Time;
|
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerLeave();
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("TimerCount = %d\n", TimerCount);
|
2009-01-15 23:15:31 +00:00
|
|
|
}
|
2009-01-14 02:02:26 +00:00
|
|
|
|
2010-05-26 02:04:09 +00:00
|
|
|
BOOL FASTCALL
|
2010-10-11 03:41:41 +00:00
|
|
|
DestroyTimersForWindow(PTHREADINFO pti, PWND Window)
|
2010-05-26 02:04:09 +00:00
|
|
|
{
|
2011-04-11 03:24:14 +00:00
|
|
|
PLIST_ENTRY pLE;
|
2011-01-29 09:03:25 +00:00
|
|
|
PTIMER pTmr;
|
2010-05-26 02:04:09 +00:00
|
|
|
BOOL TimersRemoved = FALSE;
|
|
|
|
|
2014-09-11 13:34:39 +00:00
|
|
|
if (Window == NULL)
|
2010-05-26 02:04:09 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerEnterExclusive();
|
2011-04-11 03:24:14 +00:00
|
|
|
pLE = TimersListHead.Flink;
|
2011-01-29 09:03:25 +00:00
|
|
|
while(pLE != &TimersListHead)
|
2010-05-26 02:04:09 +00:00
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
|
|
|
pLE = pLE->Flink; /* get next timer list entry before current timer is removed */
|
2010-05-26 02:04:09 +00:00
|
|
|
if ((pTmr) && (pTmr->pti == pti) && (pTmr->pWnd == Window))
|
|
|
|
{
|
2010-05-29 06:51:03 +00:00
|
|
|
TimersRemoved = RemoveTimer(pTmr);
|
2010-05-26 02:04:09 +00:00
|
|
|
}
|
2011-01-29 09:03:25 +00:00
|
|
|
}
|
2010-05-26 02:04:09 +00:00
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerLeave();
|
2010-05-26 02:04:09 +00:00
|
|
|
|
|
|
|
return TimersRemoved;
|
|
|
|
}
|
|
|
|
|
2010-05-15 19:40:33 +00:00
|
|
|
BOOL FASTCALL
|
|
|
|
DestroyTimersForThread(PTHREADINFO pti)
|
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
PLIST_ENTRY pLE = TimersListHead.Flink;
|
|
|
|
PTIMER pTmr;
|
2010-05-15 19:40:33 +00:00
|
|
|
BOOL TimersRemoved = FALSE;
|
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerEnterExclusive();
|
2010-05-15 19:40:33 +00:00
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
while(pLE != &TimersListHead)
|
2010-05-15 19:40:33 +00:00
|
|
|
{
|
2011-01-29 09:03:25 +00:00
|
|
|
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
|
|
|
|
pLE = pLE->Flink; /* get next timer list entry before current timer is removed */
|
2010-05-15 19:40:33 +00:00
|
|
|
if ((pTmr) && (pTmr->pti == pti))
|
|
|
|
{
|
2010-05-29 06:51:03 +00:00
|
|
|
TimersRemoved = RemoveTimer(pTmr);
|
2010-05-15 19:40:33 +00:00
|
|
|
}
|
2011-01-29 09:03:25 +00:00
|
|
|
}
|
2010-05-15 19:40:33 +00:00
|
|
|
|
2010-05-31 12:36:40 +00:00
|
|
|
TimerLeave();
|
2010-05-15 19:40:33 +00:00
|
|
|
|
|
|
|
return TimersRemoved;
|
|
|
|
}
|
|
|
|
|
2003-10-15 13:39:09 +00:00
|
|
|
BOOL FASTCALL
|
2010-10-11 03:41:41 +00:00
|
|
|
IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
|
2010-05-15 19:40:33 +00:00
|
|
|
{
|
|
|
|
PTIMER pTmr = NULL;
|
2015-03-10 00:12:41 +00:00
|
|
|
TRACE("IntKillTimer Window %p id %uI systemtimer %s\n",
|
2013-09-01 23:58:37 +00:00
|
|
|
Window, IDEvent, SystemTimer ? "TRUE" : "FALSE");
|
2010-05-15 19:40:33 +00:00
|
|
|
|
2011-04-11 03:24:14 +00:00
|
|
|
TimerEnterExclusive();
|
2010-06-29 14:37:52 +00:00
|
|
|
pTmr = FindTimer(Window, IDEvent, SystemTimer ? TMRF_SYSTEM : 0);
|
|
|
|
|
|
|
|
if (pTmr)
|
|
|
|
{
|
|
|
|
RemoveTimer(pTmr);
|
|
|
|
}
|
2011-04-11 03:24:14 +00:00
|
|
|
TimerLeave();
|
2010-06-29 14:37:52 +00:00
|
|
|
|
2010-05-15 19:40:33 +00:00
|
|
|
return pTmr ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2010-11-03 00:51:19 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2003-10-15 13:39:09 +00:00
|
|
|
InitTimerImpl(VOID)
|
|
|
|
{
|
2005-09-07 21:25:42 +00:00
|
|
|
ULONG BitmapBytes;
|
2012-12-18 21:44:58 +00:00
|
|
|
|
2012-02-21 18:00:50 +00:00
|
|
|
/* Allocate FAST_MUTEX from non paged pool */
|
|
|
|
Mutex = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX), TAG_INTERNAL_SYNC);
|
2012-12-18 21:44:58 +00:00
|
|
|
if (!Mutex)
|
|
|
|
{
|
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
}
|
|
|
|
|
2012-02-21 18:00:50 +00:00
|
|
|
ExInitializeFastMutex(Mutex);
|
2005-05-08 02:11:54 +00:00
|
|
|
|
2015-03-08 23:37:06 +00:00
|
|
|
BitmapBytes = ALIGN_UP_BY(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
|
2010-08-19 10:52:36 +00:00
|
|
|
WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(NonPagedPool, BitmapBytes, TAG_TIMERBMP);
|
2005-12-29 13:53:35 +00:00
|
|
|
if (WindowLessTimersBitMapBuffer == NULL)
|
|
|
|
{
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
2007-10-19 23:21:45 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 21:25:42 +00:00
|
|
|
RtlInitializeBitMap(&WindowLessTimersBitMap,
|
|
|
|
WindowLessTimersBitMapBuffer,
|
2024-08-29 07:29:38 +00:00
|
|
|
NUM_WINDOW_LESS_TIMERS);
|
2005-05-08 02:11:54 +00:00
|
|
|
|
2011-12-14 04:07:06 +00:00
|
|
|
/* Yes we need this, since ExAllocatePoolWithTag isn't supposed to zero out allocated memory */
|
2005-09-07 21:25:42 +00:00
|
|
|
RtlClearAllBits(&WindowLessTimersBitMap);
|
2004-12-29 19:55:01 +00:00
|
|
|
|
2011-01-29 09:03:25 +00:00
|
|
|
ExInitializeResourceLite(&TimerLock);
|
|
|
|
InitializeListHead(&TimersListHead);
|
|
|
|
|
2005-09-07 21:25:42 +00:00
|
|
|
return STATUS_SUCCESS;
|
2003-10-15 13:39:09 +00:00
|
|
|
}
|
2003-04-02 23:12:53 +00:00
|
|
|
|
2003-10-15 13:39:09 +00:00
|
|
|
UINT_PTR
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2003-10-15 13:39:09 +00:00
|
|
|
NtUserSetTimer
|
|
|
|
(
|
2005-09-07 21:25:42 +00:00
|
|
|
HWND hWnd,
|
|
|
|
UINT_PTR nIDEvent,
|
|
|
|
UINT uElapse,
|
|
|
|
TIMERPROC lpTimerFunc
|
2003-10-15 13:39:09 +00:00
|
|
|
)
|
|
|
|
{
|
2012-08-06 03:25:29 +00:00
|
|
|
PWND Window = NULL;
|
2021-07-30 13:40:33 +00:00
|
|
|
UINT_PTR ret;
|
2005-09-05 21:19:23 +00:00
|
|
|
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("Enter NtUserSetTimer\n");
|
2005-09-05 21:19:23 +00:00
|
|
|
UserEnterExclusive();
|
2012-08-06 03:25:29 +00:00
|
|
|
if (hWnd) Window = UserGetWindowObject(hWnd);
|
2005-09-07 21:25:42 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
ret = IntSetTimer(Window, nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND);
|
2005-09-07 21:25:42 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
UserLeave();
|
|
|
|
TRACE("Leave NtUserSetTimer, ret=%u\n", ret);
|
2010-05-31 12:36:40 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
return ret;
|
2003-04-02 23:12:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-15 13:39:09 +00:00
|
|
|
BOOL
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2003-10-15 13:39:09 +00:00
|
|
|
NtUserKillTimer
|
|
|
|
(
|
2005-09-07 21:25:42 +00:00
|
|
|
HWND hWnd,
|
|
|
|
UINT_PTR uIDEvent
|
2003-10-15 13:39:09 +00:00
|
|
|
)
|
2003-04-02 23:12:53 +00:00
|
|
|
{
|
2012-08-06 03:25:29 +00:00
|
|
|
PWND Window = NULL;
|
2021-07-30 13:40:33 +00:00
|
|
|
BOOL ret;
|
2005-09-05 21:19:23 +00:00
|
|
|
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("Enter NtUserKillTimer\n");
|
2005-09-05 21:19:23 +00:00
|
|
|
UserEnterExclusive();
|
2012-08-06 03:25:29 +00:00
|
|
|
if (hWnd) Window = UserGetWindowObject(hWnd);
|
2010-05-15 19:40:33 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
ret = IntKillTimer(Window, uIDEvent, FALSE);
|
2005-09-07 21:25:42 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
UserLeave();
|
|
|
|
|
|
|
|
TRACE("Leave NtUserKillTimer, ret=%i\n", ret);
|
|
|
|
return ret;
|
2003-10-15 13:39:09 +00:00
|
|
|
}
|
2003-04-02 23:12:53 +00:00
|
|
|
|
|
|
|
|
2003-10-15 13:39:09 +00:00
|
|
|
UINT_PTR
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2003-10-15 13:39:09 +00:00
|
|
|
NtUserSetSystemTimer(
|
2005-09-07 21:25:42 +00:00
|
|
|
HWND hWnd,
|
|
|
|
UINT_PTR nIDEvent,
|
|
|
|
UINT uElapse,
|
|
|
|
TIMERPROC lpTimerFunc
|
2003-10-15 13:39:09 +00:00
|
|
|
)
|
|
|
|
{
|
2021-07-30 13:40:33 +00:00
|
|
|
UINT_PTR ret;
|
|
|
|
|
|
|
|
UserEnterExclusive();
|
|
|
|
TRACE("Enter NtUserSetSystemTimer\n");
|
2005-09-05 21:19:23 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
ret = IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM);
|
2005-09-07 21:25:42 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
UserLeave();
|
2005-09-07 21:25:42 +00:00
|
|
|
|
2021-07-30 13:40:33 +00:00
|
|
|
TRACE("Leave NtUserSetSystemTimer, ret=%u\n", ret);
|
|
|
|
return ret;
|
2003-10-15 13:39:09 +00:00
|
|
|
}
|
2003-04-02 23:12:53 +00:00
|
|
|
|
2011-08-26 03:02:00 +00:00
|
|
|
BOOL
|
|
|
|
APIENTRY
|
|
|
|
NtUserValidateTimerCallback(
|
|
|
|
LPARAM lParam)
|
|
|
|
{
|
|
|
|
BOOL Ret = FALSE;
|
|
|
|
|
|
|
|
UserEnterShared();
|
|
|
|
|
|
|
|
Ret = ValidateTimerCallback(PsGetCurrentThreadWin32Thread(), lParam);
|
|
|
|
|
|
|
|
UserLeave();
|
|
|
|
return Ret;
|
|
|
|
}
|
|
|
|
|
2003-05-18 17:16:18 +00:00
|
|
|
/* EOF */
|