- Return correct ID for windowless timers in IntSetTimer.

svn path=/trunk/; revision=9940
This commit is contained in:
Filip Navara 2004-06-29 23:45:31 +00:00
parent a4a1cb1b98
commit 52b944e9fb

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: timer.c,v 1.32 2004/05/10 17:07:18 weiden Exp $ /* $Id: timer.c,v 1.33 2004/06/29 23:45:31 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -175,7 +175,6 @@ RemoveTimersWindow(HWND Wnd)
UINT_PTR FASTCALL UINT_PTR FASTCALL
IntSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc, BOOL SystemTimer) IntSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc, BOOL SystemTimer)
{ {
ULONG Index;
PMSG_TIMER_ENTRY MsgTimer = NULL; PMSG_TIMER_ENTRY MsgTimer = NULL;
PMSG_TIMER_ENTRY NewTimer; PMSG_TIMER_ENTRY NewTimer;
LARGE_INTEGER CurrentTime; LARGE_INTEGER CurrentTime;
@ -190,15 +189,15 @@ IntSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc, B
if((hWnd == NULL) && !SystemTimer) if((hWnd == NULL) && !SystemTimer)
{ {
/* find a free, window-less timer id */ /* find a free, window-less timer id */
Index = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex); nIDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex);
if(Index == (ULONG) -1) if(nIDEvent == (UINT_PTR) -1)
{ {
IntUnLockTimerList(); IntUnLockTimerList();
return 0; return 0;
} }
HintIndex = ++Index; HintIndex = ++nIDEvent;
} }
else else
{ {
@ -302,7 +301,6 @@ IntKillTimer(HWND hWnd, UINT_PTR uIDEvent, BOOL SystemTimer)
/* FIXME: set the last error */ /* FIXME: set the last error */
return FALSE; return FALSE;
} }
RtlClearBits(&WindowLessTimersBitMap, uIDEvent - 1, 1); RtlClearBits(&WindowLessTimersBitMap, uIDEvent - 1, 1);
} }
else else