Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b5bd5297
Commit
b5bd5297
authored
May 01, 2014
by
Erich E. Hoover
Committed by
Alexandre Julliard
May 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Reduce the minimum Set[System]Timer from 15 ms to 10 ms.
parent
d5f18414
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
message.c
dlls/user32/message.c
+2
-6
msg.c
dlls/user32/tests/msg.c
+16
-10
No files found.
dlls/user32/message.c
View file @
b5bd5297
...
...
@@ -4439,9 +4439,7 @@ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
FALSE
);
/* MSDN states that the minimum timeout should be USER_TIMER_MINIMUM (10.0 ms), but testing
* indicates that the true minimum is closer to 15.6 ms. */
timeout
=
min
(
max
(
15
,
timeout
),
USER_TIMER_MAXIMUM
);
timeout
=
min
(
max
(
USER_TIMER_MINIMUM
,
timeout
),
USER_TIMER_MAXIMUM
);
SERVER_START_REQ
(
set_win_timer
)
{
...
...
@@ -4474,9 +4472,7 @@ UINT_PTR WINAPI SetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
FALSE
);
/* MSDN states that the minimum timeout should be USER_TIMER_MINIMUM (10.0 ms), but testing
* indicates that the true minimum is closer to 15.6 ms. */
timeout
=
min
(
max
(
15
,
timeout
),
USER_TIMER_MAXIMUM
);
timeout
=
min
(
max
(
USER_TIMER_MINIMUM
,
timeout
),
USER_TIMER_MAXIMUM
);
SERVER_START_REQ
(
set_win_timer
)
{
...
...
dlls/user32/tests/msg.c
View file @
b5bd5297
...
...
@@ -8390,8 +8390,8 @@ static VOID CALLBACK tfunc(HWND hwnd, UINT uMsg, UINT_PTR id, DWORD dwTime)
}
#define TIMER_ID 0x19
#define TIMER_COUNT_EXPECTED
64
#define TIMER_COUNT_TOLERANCE
9
#define TIMER_COUNT_EXPECTED
100
#define TIMER_COUNT_TOLERANCE
10
static
int
count
=
0
;
static
void
CALLBACK
callback_count
(
HWND
hwnd
,
UINT
uMsg
,
UINT_PTR
idEvent
,
DWORD
dwTime
)
...
...
@@ -8442,8 +8442,9 @@ static void test_timers(void)
ok
(
KillTimer
(
info
.
hWnd
,
TIMER_ID
),
"KillTimer failed
\n
"
);
/* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms,
* but testing indicates that the minimum timeout is actually about 15.6 ms. Since there is
* some measurement error between test runs we're allowing for ±8 counts (~2 ms).
* which occurs sometimes, but most testing on the VMs indicates a minimum timeout closer to
* 15.6 ms. Since there is some measurement error between test runs we are allowing for
* ±9 counts (~4 ms) around the expected value.
*/
count
=
0
;
id
=
SetTimer
(
info
.
hWnd
,
TIMER_ID
,
0
,
callback_count
);
...
...
@@ -8452,8 +8453,9 @@ static void test_timers(void)
start
=
GetTickCount
();
while
(
GetTickCount
()
-
start
<
1001
&&
GetMessageA
(
&
msg
,
info
.
hWnd
,
0
,
0
))
DispatchMessageA
(
&
msg
);
ok
(
abs
(
count
-
TIMER_COUNT_EXPECTED
)
<
TIMER_COUNT_TOLERANCE
||
broken
(
abs
(
count
-
43
)
<
TIMER_COUNT_TOLERANCE
)
/* w2k3 */
,
ok
(
abs
(
count
-
TIMER_COUNT_EXPECTED
)
<
TIMER_COUNT_TOLERANCE
/* xp */
||
broken
(
abs
(
count
-
64
)
<
TIMER_COUNT_TOLERANCE
)
/* most common */
||
broken
(
abs
(
count
-
43
)
<
TIMER_COUNT_TOLERANCE
)
/* w2k3, win8 */
,
"did not get expected count for minimum timeout (%d != ~%d).
\n
"
,
count
,
TIMER_COUNT_EXPECTED
);
ok
(
KillTimer
(
info
.
hWnd
,
id
),
"KillTimer failed
\n
"
);
...
...
@@ -8473,7 +8475,9 @@ static void test_timers(void)
syscount
++
;
DispatchMessageA
(
&
msg
);
}
ok
(
abs
(
syscount
-
TIMER_COUNT_EXPECTED
)
<
TIMER_COUNT_TOLERANCE
,
ok
(
abs
(
syscount
-
TIMER_COUNT_EXPECTED
)
<
TIMER_COUNT_TOLERANCE
||
broken
(
abs
(
syscount
-
64
)
<
TIMER_COUNT_TOLERANCE
)
/* most common */
||
broken
(
syscount
>
4000
&&
syscount
<
12000
)
/* win2k3sp0 */
,
"did not get expected count for minimum timeout (%d != ~%d).
\n
"
,
syscount
,
TIMER_COUNT_EXPECTED
);
todo_wine
ok
(
count
==
0
,
"did not get expected count for callback timeout (%d != 0).
\n
"
,
...
...
@@ -8507,8 +8511,9 @@ static void test_timers_no_wnd(void)
ok
(
count
==
1
,
"killing replaced timer did not work (%i).
\n
"
,
count
);
/* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms,
* but testing indicates that the minimum timeout is actually about 15.6 ms. Since there is
* some measurement error between test runs we're allowing for ±8 counts (~2 ms).
* which occurs sometimes, but most testing on the VMs indicates a minimum timeout closer to
* 15.6 ms. Since there is some measurement error between test runs we are allowing for
* ±9 counts (~4 ms) around the expected value.
*/
count
=
0
;
id
=
SetTimer
(
NULL
,
0
,
0
,
callback_count
);
...
...
@@ -8516,7 +8521,8 @@ static void test_timers_no_wnd(void)
start
=
GetTickCount
();
while
(
GetTickCount
()
-
start
<
1001
&&
GetMessageA
(
&
msg
,
NULL
,
0
,
0
))
DispatchMessageA
(
&
msg
);
ok
(
abs
(
count
-
TIMER_COUNT_EXPECTED
)
<
TIMER_COUNT_TOLERANCE
,
ok
(
abs
(
count
-
TIMER_COUNT_EXPECTED
)
<
TIMER_COUNT_TOLERANCE
/* xp */
||
broken
(
abs
(
count
-
64
)
<
TIMER_COUNT_TOLERANCE
)
/* most common */
,
"did not get expected count for minimum timeout (%d != ~%d).
\n
"
,
count
,
TIMER_COUNT_EXPECTED
);
KillTimer
(
NULL
,
id
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment