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
fc635fa8
Commit
fc635fa8
authored
Aug 30, 2007
by
Trent Waddington
Committed by
Alexandre Julliard
Aug 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Handle existing timer replacement when no window handle specified.
parent
d4337f2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
5 deletions
+48
-5
msg.c
dlls/user32/tests/msg.c
+34
-0
queue.c
server/queue.c
+14
-5
No files found.
dlls/user32/tests/msg.c
View file @
fc635fa8
...
...
@@ -6780,6 +6780,39 @@ static void test_timers(void)
ok
(
DestroyWindow
(
info
.
hWnd
),
"failed to destroy window
\n
"
);
}
static
int
count
=
0
;
static
VOID
CALLBACK
callback_count
(
HWND
hwnd
,
UINT
uMsg
,
UINT_PTR
idEvent
,
DWORD
dwTime
)
{
count
++
;
}
static
void
test_timers_no_wnd
(
void
)
{
UINT_PTR
id
,
id2
;
MSG
msg
;
count
=
0
;
id
=
SetTimer
(
NULL
,
0
,
100
,
callback_count
);
ok
(
id
!=
0
,
"did not get id from SetTimer.
\n
"
);
id2
=
SetTimer
(
NULL
,
id
,
200
,
callback_count
);
ok
(
id2
==
id
,
"did not get same id from SetTimer when replacing (%li expected %li).
\n
"
,
id2
,
id
);
Sleep
(
150
);
while
(
PeekMessage
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
ok
(
count
==
0
,
"did not get zero count as expected (%i).
\n
"
,
count
);
Sleep
(
150
);
while
(
PeekMessage
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
ok
(
count
==
1
,
"did not get one count as expected (%i).
\n
"
,
count
);
KillTimer
(
NULL
,
id
);
Sleep
(
250
);
while
(
PeekMessage
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
ok
(
count
==
1
,
"killing replaced timer did not work (%i).
\n
"
,
count
);
}
/* Various win events with arbitrary parameters */
static
const
struct
message
WmWinEventsSeq
[]
=
{
{
EVENT_SYSTEM_SOUND
,
winevent_hook
|
wparam
|
lparam
,
OBJID_WINDOW
,
0
},
...
...
@@ -9617,6 +9650,7 @@ START_TEST(msg)
test_message_conversion
();
test_accelerators
();
test_timers
();
test_timers_no_wnd
();
test_set_hook
();
test_DestroyWindow
();
test_DispatchMessage
();
...
...
server/queue.c
View file @
fc635fa8
...
...
@@ -1927,13 +1927,22 @@ DECL_HANDLER(set_win_timer)
else
{
queue
=
get_current_queue
();
/*
find a free id for it
*/
do
/*
look for a timer with this id
*/
if
(
id
&&
(
timer
=
find_timer
(
queue
,
NULL
,
req
->
msg
,
id
)))
{
id
=
queue
->
next_timer_id
;
if
(
++
queue
->
next_timer_id
>=
0x10000
)
queue
->
next_timer_id
=
1
;
/* free and reuse id */
free_timer
(
queue
,
timer
);
}
else
{
/* find a free id for it */
do
{
id
=
queue
->
next_timer_id
;
if
(
++
queue
->
next_timer_id
>=
0x10000
)
queue
->
next_timer_id
=
1
;
}
while
(
find_timer
(
queue
,
0
,
req
->
msg
,
id
));
}
while
(
find_timer
(
queue
,
0
,
req
->
msg
,
id
));
}
if
((
timer
=
set_timer
(
queue
,
req
->
rate
)))
...
...
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