Fixed some bogus infinite expiration time.

oldstable
Eric Pouech 1999-04-25 09:12:27 +00:00 committed by Alexandre Julliard
parent a4dd6a6af1
commit 96c142b940
1 changed files with 7 additions and 2 deletions

View File

@ -207,9 +207,14 @@ LONG TIMER_GetNextExpiration(void)
while (pTimer && !pTimer->expires) /* Skip already expired timers */
pTimer = pTimer->next;
retValue = pTimer ? EXPIRE_TIME( pTimer, GetTickCount() ) : -1;
LeaveCriticalSection( &csTimer );
if (pTimer)
{
DWORD now = GetTickCount();
retValue = (pTimer->expires <= now) ? 0 : (pTimer->expires - now);
}
else retValue = -1;
LeaveCriticalSection( &csTimer );
return retValue;
}