- Added stubs to timers, tooling up to change over to handled timers. This is related to just about everything. From Carets to window positions.

svn path=/trunk/; revision=38752
This commit is contained in:
James Tabor 2009-01-14 02:02:26 +00:00
parent 953cecc715
commit e3b9b100e1
3 changed files with 110 additions and 9 deletions

View file

@ -28,5 +28,7 @@ BOOL FASTCALL IntKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer);
UINT_PTR FASTCALL IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer);
PTIMER FASTCALL FindSystemTimer(PMSG);
BOOL FASTCALL ValidateTimerCallback(PW32THREADINFO,PWINDOW_OBJECT,WPARAM,LPARAM);
VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD);
UINT_PTR FASTCALL SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC);
#endif /* _WIN32K_TIMER_H */

View file

@ -70,7 +70,7 @@ __inline static PUSER_HANDLE_ENTRY alloc_user_entry(PUSER_HANDLE_TABLE ht)
{
/**/
int i, iFree = 0, iWindow = 0, iMenu = 0, iCursorIcon = 0,
iHook = 0, iCallProc = 0, iAccel = 0, iMonitor = 0;
iHook = 0, iCallProc = 0, iAccel = 0, iMonitor = 0, iTimer = 0;
/**/
DPRINT1("Out of user handles! Used -> %i, NM_Handle -> %d\n", usedHandles, ht->nb_handles);
//#if 0
@ -102,12 +102,15 @@ __inline static PUSER_HANDLE_ENTRY alloc_user_entry(PUSER_HANDLE_TABLE ht)
case otMonitor:
iMonitor++;
break;
case otTimer:
iMonitor++;
break;
default:
break;
}
}
DPRINT1("Handle Count by Type:\n Free = %d Window = %d Menu = %d CursorIcon = %d Hook = %d\n CallProc = %d Accel = %d Monitor = %d\n",
iFree, iWindow, iMenu, iCursorIcon, iHook, iCallProc, iAccel, iMonitor );
DPRINT1("Handle Count by Type:\n Free = %d Window = %d Menu = %d CursorIcon = %d Hook = %d\n CallProc = %d Accel = %d Monitor = %d Timer = %d\n",
iFree, iWindow, iMenu, iCursorIcon, iHook, iCallProc, iAccel, iMonitor, iTimer );
//#endif
return NULL;
#if 0

View file

@ -54,6 +54,72 @@ static ULONG HintIndex = 0;
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&Mutex)
/* FUNCTIONS *****************************************************************/
PTIMER
FASTCALL
CreateTimer(VOID)
{
HANDLE Handle;
PTIMER Ret = NULL;
if (!FirstpTmr)
{
FirstpTmr = UserCreateObject(gHandleTable, &Handle, otTimer, sizeof(TIMER));
if (FirstpTmr) InitializeListHead(&FirstpTmr->ptmrList);
Ret = FirstpTmr;
}
else
{
Ret = UserCreateObject(gHandleTable, &Handle, otTimer, sizeof(TIMER));
if (Ret) InsertTailList(&FirstpTmr->ptmrList, &Ret->ptmrList);
}
return Ret;
}
static
BOOL
FASTCALL
RemoveTimer(PTIMER pTmr)
{
if (pTmr)
{
RemoveEntryList(&pTmr->ptmrList);
UserDeleteObject( USER_BODY_TO_HEADER(pTmr)->hSelf, otTimer);
return TRUE;
}
return FALSE;
}
PTIMER
FASTCALL
FindTimer(PWINDOW_OBJECT Window,
UINT_PTR nID,
UINT flags,
BOOL Distroy)
{
PTIMER pTmr = FirstpTmr;
KeEnterCriticalRegion();
do
{
if (!pTmr) break;
if ( pTmr->nID == nID &&
pTmr->pWnd == Window &&
(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) == (flags & (TMRF_SYSTEM|TMRF_RIT)))
{
if (Distroy)
{
RemoveTimer(pTmr);
pTmr = (PTIMER)1; // We are here to remove the timer.
}
break;
}
pTmr = (PTIMER)pTmr->ptmrList.Flink;
} while (pTmr != FirstpTmr);
KeLeaveCriticalRegion();
return pTmr;
}
PTIMER
FASTCALL
@ -104,6 +170,41 @@ ValidateTimerCallback(PW32THREADINFO pti,
return TRUE;
}
// Rename it to IntSetTimer after move.
UINT_PTR FASTCALL
InternalSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer)
{
return 0;
}
//
// Process system timers.
//
VOID
CALLBACK
SystemTimerProc(HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime)
{
}
UINT_PTR
FASTCALL
SetSystemTimer( HWND hWnd,
UINT_PTR nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc)
{
return 0;
}
//
//
// Old Timer Queueing
//
//
UINT_PTR FASTCALL
IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer)
{
@ -268,12 +369,6 @@ InitTimerImpl(VOID)
/* yes we need this, since ExAllocatePool isn't supposed to zero out allocated memory */
RtlClearAllBits(&WindowLessTimersBitMap);
if (!FirstpTmr)
{
FirstpTmr = ExAllocatePoolWithTag(PagedPool, sizeof(TIMER), TAG_TIMERBMP);
if (FirstpTmr) InitializeListHead(&FirstpTmr->ptmrList);
}
return STATUS_SUCCESS;
}
@ -337,6 +432,7 @@ NtUserSetSystemTimer(
DPRINT("Enter NtUserSetSystemTimer\n");
UserEnterExclusive();
// This is wrong, lpTimerFunc is NULL!
RETURN(IntSetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc, TRUE));
CLEANUP: