[WIN32K]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Sat, 1 May 2010 09:55:16 +0000 (09:55 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Sat, 1 May 2010 09:55:16 +0000 (09:55 +0000)
commita0790104cc81365eae2435808f4efee6c8a85d1c
tree4ca1de4e06fb46d800907ef352a8540c24c85679
parente66431b123de0038bdcdc0fe02396d1d8701a284
[WIN32K]
<bug>
- The timer implementation uses a bitmap to store window-less timers. As an optimization to find the first free index, it uses the variable "HintIndex" which points to the first timer index. In order to find the next free index, the RtlFindClearBitsAndSet function is used. When a new timer is allocated, the "HintIndex" variable is increased, which increases the search offset. Now if more than NUM_WINDOW_LESS_TIMERS (1024) timers are allocated, no more timers can be allocated because RtlFindClearBitsAndSet will claim no more index are available, because the free indexes are below the search offset.
</bug>
<fix>
Everytime a timer gets freed, store the freed index in "HintIndex". As a result the timer implementation will always find a free timer index (when there is one)
</fix>

svn path=/trunk/; revision=47069
reactos/subsystems/win32/win32k/ntuser/timer.c