diff --git a/dlls/user/user_main.c b/dlls/user/user_main.c index 19761a0bd21..b883b671bc6 100644 --- a/dlls/user/user_main.c +++ b/dlls/user/user_main.c @@ -293,7 +293,7 @@ static void thread_detach(void) if (hQueue) { - TIMER_RemoveQueueTimers( hQueue ); + TIMER_RemoveThreadTimers(); HOOK_FreeQueueHooks(); WIN_DestroyThreadWindows( GetDesktopWindow() ); QUEUE_DeleteMsgQueue(); diff --git a/include/message.h b/include/message.h index b01eea15908..c1b3111ee26 100644 --- a/include/message.h +++ b/include/message.h @@ -36,7 +36,7 @@ extern BOOL MSG_peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, int fl /* timer.c */ extern void TIMER_RemoveWindowTimers( HWND hwnd ); -extern void TIMER_RemoveQueueTimers( HQUEUE16 hqueue ); +extern void TIMER_RemoveThreadTimers(void); extern BOOL TIMER_IsTimerValid( HWND hwnd, UINT id, HWINDOWPROC hProc ); #endif /* __WINE_MESSAGE_H */ diff --git a/windows/timer.c b/windows/timer.c index 4ba0c3c032e..b312e90ff7b 100644 --- a/windows/timer.c +++ b/windows/timer.c @@ -36,8 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(timer); typedef struct tagTIMER { HWND hwnd; - HQUEUE16 hq; - UINT16 msg; /* WM_TIMER or WM_SYSTIMER */ + DWORD thread; + UINT msg; /* WM_TIMER or WM_SYSTIMER */ UINT id; UINT timeout; HWINDOWPROC proc; @@ -89,11 +89,11 @@ void TIMER_RemoveWindowTimers( HWND hwnd ) /*********************************************************************** - * TIMER_RemoveQueueTimers + * TIMER_RemoveThreadTimers * - * Remove all timers for a given queue. + * Remove all timers for the current thread. */ -void TIMER_RemoveQueueTimers( HQUEUE16 hqueue ) +void TIMER_RemoveThreadTimers(void) { int i; TIMER *pTimer; @@ -101,7 +101,7 @@ void TIMER_RemoveQueueTimers( HQUEUE16 hqueue ) EnterCriticalSection( &csTimer ); for (i = NB_TIMERS, pTimer = TimersArray; i > 0; i--, pTimer++) - if ((pTimer->hq == hqueue) && pTimer->timeout) + if ((pTimer->thread == GetCurrentThreadId()) && pTimer->timeout) TIMER_ClearTimer( pTimer ); LeaveCriticalSection( &csTimer ); @@ -175,7 +175,7 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout, /* Add the timer */ pTimer->hwnd = hwnd; - pTimer->hq = InitThreadInput16( 0, 0 ); + pTimer->thread = GetCurrentThreadId(); pTimer->msg = sys ? WM_SYSTIMER : WM_TIMER; pTimer->id = id; pTimer->timeout = timeout;