mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 00:40:26 +08:00
[NTUSER] IntSetTimer: Update HintIndex on each call (#7087)
* fix CORE-9141 - adding a change to IDEvent after each pass If the first index is 0 the first returned ID will be 0x8000, which is fine. Co-authored-by: Joachim Henze <joachim.henze@reactos.org>
This commit is contained in:
@@ -19,10 +19,12 @@ static LONG TimeLast = 0;
|
|||||||
/* Windows 2000 has room for 32768 window-less timers */
|
/* Windows 2000 has room for 32768 window-less timers */
|
||||||
#define NUM_WINDOW_LESS_TIMERS 32768
|
#define NUM_WINDOW_LESS_TIMERS 32768
|
||||||
|
|
||||||
|
#define HINTINDEX_BEGIN_VALUE 0
|
||||||
|
|
||||||
static PFAST_MUTEX Mutex;
|
static PFAST_MUTEX Mutex;
|
||||||
static RTL_BITMAP WindowLessTimersBitMap;
|
static RTL_BITMAP WindowLessTimersBitMap;
|
||||||
static PVOID WindowLessTimersBitMapBuffer;
|
static PVOID WindowLessTimersBitMapBuffer;
|
||||||
static ULONG HintIndex = 1;
|
static ULONG HintIndex = HINTINDEX_BEGIN_VALUE;
|
||||||
|
|
||||||
ERESOURCE TimerLock;
|
ERESOURCE TimerLock;
|
||||||
|
|
||||||
@@ -219,8 +221,12 @@ IntSetTimer( PWND Window,
|
|||||||
{
|
{
|
||||||
IntLockWindowlessTimerBitmap();
|
IntLockWindowlessTimerBitmap();
|
||||||
|
|
||||||
IDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex);
|
IDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex++);
|
||||||
|
if (IDEvent == (UINT_PTR)-1)
|
||||||
|
{
|
||||||
|
HintIndex = HINTINDEX_BEGIN_VALUE;
|
||||||
|
IDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex++);
|
||||||
|
}
|
||||||
if (IDEvent == (UINT_PTR) -1)
|
if (IDEvent == (UINT_PTR) -1)
|
||||||
{
|
{
|
||||||
IntUnlockWindowlessTimerBitmap();
|
IntUnlockWindowlessTimerBitmap();
|
||||||
|
|||||||
Reference in New Issue
Block a user