Teached TIMER_GetNextExpiration that a timer that has already expired

(but not processed yet) HAS already expired...
This commit is contained in:
Ove Kaaven 1999-04-11 17:10:05 +00:00 committed by Alexandre Julliard
parent 538d4c8f5f
commit 0df0f1fd28
1 changed files with 8 additions and 1 deletions

View File

@ -195,10 +195,17 @@ static void TIMER_RestartTimer( TIMER * pTimer, DWORD curTime )
*/
LONG TIMER_GetNextExpiration(void)
{
TIMER *pTimer;
LONG retValue;
EnterCriticalSection( &csTimer );
retValue = pNextTimer ? EXPIRE_TIME( pNextTimer, GetTickCount() ) : -1;
pTimer = pNextTimer;
while (pTimer && !pTimer->expires) /* Skip already expired timers */
pTimer = pTimer->next;
retValue = pTimer ? EXPIRE_TIME( pTimer, GetTickCount() ) : -1;
LeaveCriticalSection( &csTimer );
return retValue;