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
81bd7264
Commit
81bd7264
authored
Dec 29, 2015
by
Qian Hong
Committed by
Alexandre Julliard
Dec 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for WM_DEVICECHANGE message.
Signed-off-by:
Qian Hong
<
qhong@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
27ac4d88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
msg.c
dlls/user32/tests/msg.c
+45
-0
No files found.
dlls/user32/tests/msg.c
View file @
81bd7264
...
...
@@ -32,6 +32,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "dbt.h"
#include "wine/test.h"
...
...
@@ -4520,6 +4521,49 @@ static void test_MsgWaitForMultipleObjects(HWND hwnd)
ok
(
ret
==
WAIT_IO_COMPLETION
,
"MsgWaitForMultipleObjectsEx returned %x
\n
"
,
ret
);
}
static
void
test_WM_DEVICECHANGE
(
HWND
hwnd
)
{
DWORD
ret
;
MSG
msg
;
int
i
;
static
const
WPARAM
wparams
[]
=
{
0
,
DBT_DEVNODES_CHANGED
,
DBT_QUERYCHANGECONFIG
,
DBT_CONFIGCHANGED
,
DBT_CONFIGCHANGECANCELED
,
DBT_NO_DISK_SPACE
,
DBT_LOW_DISK_SPACE
,
DBT_CONFIGMGPRIVATE
,
/* 0x7fff */
DBT_DEVICEARRIVAL
,
/* 0x8000 */
DBT_DEVICEQUERYREMOVE
,
DBT_DEVICEQUERYREMOVEFAILED
,
DBT_DEVICEREMOVEPENDING
,
DBT_DEVICEREMOVECOMPLETE
,
DBT_DEVICETYPESPECIFIC
,
DBT_CUSTOMEVENT
};
for
(
i
=
0
;
i
<
sizeof
(
wparams
)
/
sizeof
(
wparams
[
0
]);
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
PostMessageA
(
hwnd
,
WM_DEVICECHANGE
,
wparams
[
i
],
0
);
if
(
wparams
[
i
]
&
0x8000
)
{
ok
(
ret
==
FALSE
,
"PostMessage should returned %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_MESSAGE_SYNC_ONLY
,
"PostMessage error %08x
\n
"
,
GetLastError
());
}
else
{
todo_wine
{
ret
=
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
0
,
QS_POSTMESSAGE
);
ok
(
ret
==
WAIT_OBJECT_0
,
"MsgWaitForMultipleObjects returned %x
\n
"
,
ret
);
memset
(
&
msg
,
0
,
sizeof
(
msg
));
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"PeekMessage should succeed
\n
"
);
ok
(
msg
.
message
==
WM_DEVICECHANGE
,
"got %04x instead of WM_DEVICECHANGE
\n
"
,
msg
.
message
);
}
}
}
}
static
DWORD
CALLBACK
show_window_thread
(
LPVOID
arg
)
{
HWND
hwnd
=
arg
;
...
...
@@ -4911,6 +4955,7 @@ static void test_messages(void)
flush_sequence
();
test_MsgWaitForMultipleObjects
(
hparent
);
test_WM_DEVICECHANGE
(
hparent
);
/* the following test causes an exception in user.exe under win9x */
if
(
!
PostMessageW
(
hparent
,
WM_USER
,
0
,
0
))
...
...
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