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
bd2b8980
Commit
bd2b8980
authored
Jan 26, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Add a helper to wait on HID input reads.
parent
a4d2e62a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
61 deletions
+119
-61
device8.c
dlls/dinput/tests/device8.c
+1
-0
dinput_test.h
dlls/dinput/tests/dinput_test.h
+5
-0
driver_bus.c
dlls/dinput/tests/driver_bus.c
+92
-61
driver_hid.c
dlls/dinput/tests/driver_hid.c
+1
-0
driver_hid.h
dlls/dinput/tests/driver_hid.h
+2
-0
hid.c
dlls/dinput/tests/hid.c
+18
-0
No files found.
dlls/dinput/tests/device8.c
View file @
bd2b8980
...
...
@@ -1738,6 +1738,7 @@ static void test_hid_mouse(void)
mouse_move_count
=
0
;
bus_send_hid_input
(
file
,
&
desc
,
single_move
,
sizeof
(
single_move
)
);
bus_wait_hid_input
(
file
,
&
desc
,
100
);
res
=
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
500
,
QS_MOUSEMOVE
);
todo_wine
...
...
dlls/dinput/tests/dinput_test.h
View file @
bd2b8980
...
...
@@ -108,6 +108,11 @@ void wait_hid_expect_( const char *file, int line, HANDLE device, struct hid_dev
void
send_hid_input_
(
const
char
*
file
,
int
line
,
HANDLE
device
,
struct
hid_device_desc
*
desc
,
struct
hid_expect
*
expect
,
DWORD
expect_size
);
#define wait_hid_input( a, b ) wait_hid_input_( __FILE__, __LINE__, a, NULL, b, FALSE )
#define bus_wait_hid_input( a, b, c ) wait_hid_input_( __FILE__, __LINE__, a, b, c, FALSE )
void
wait_hid_input_
(
const
char
*
file
,
int
line
,
HANDLE
device
,
struct
hid_device_desc
*
desc
,
DWORD
timeout
,
BOOL
todo
);
#define msg_wait_for_events( a, b, c ) msg_wait_for_events_( __FILE__, __LINE__, a, b, c )
DWORD
msg_wait_for_events_
(
const
char
*
file
,
int
line
,
DWORD
count
,
HANDLE
*
events
,
DWORD
timeout
);
...
...
dlls/dinput/tests/driver_bus.c
View file @
bd2b8980
This diff is collapsed.
Click to expand it.
dlls/dinput/tests/driver_hid.c
View file @
bd2b8980
...
...
@@ -188,6 +188,7 @@ static NTSTATUS WINAPI driver_ioctl( DEVICE_OBJECT *device, IRP *irp )
case
IOCTL_WINETEST_HID_WAIT_EXPECT
:
case
IOCTL_WINETEST_HID_SEND_INPUT
:
case
IOCTL_WINETEST_HID_SET_CONTEXT
:
case
IOCTL_WINETEST_HID_WAIT_INPUT
:
IoSkipCurrentIrpStackLocation
(
irp
);
return
IoCallDriver
(
ext
->
PhysicalDeviceObject
,
irp
);
...
...
dlls/dinput/tests/driver_hid.h
View file @
bd2b8980
...
...
@@ -49,6 +49,7 @@ DEFINE_GUID(control_class,0xdeadbeef,0x29ef,0x4538,0xa5,0xfd,0xb6,0x95,0x73,0xa3
#define IOCTL_WINETEST_HID_SET_CONTEXT CTL_CODE(FILE_DEVICE_KEYBOARD, 0x803, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
#define IOCTL_WINETEST_CREATE_DEVICE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x804, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
#define IOCTL_WINETEST_REMOVE_DEVICE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x805, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
#define IOCTL_WINETEST_HID_WAIT_INPUT CTL_CODE(FILE_DEVICE_KEYBOARD, 0x806, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
struct
hid_expect
{
...
...
@@ -173,6 +174,7 @@ static inline const char *debugstr_ioctl( ULONG code )
case
IOCTL_WINETEST_HID_SET_EXPECT
:
return
"IOCTL_WINETEST_HID_SET_EXPECT"
;
case
IOCTL_WINETEST_HID_WAIT_EXPECT
:
return
"IOCTL_WINETEST_HID_WAIT_EXPECT"
;
case
IOCTL_WINETEST_HID_SEND_INPUT
:
return
"IOCTL_WINETEST_HID_SEND_INPUT"
;
case
IOCTL_WINETEST_HID_WAIT_INPUT
:
return
"IOCTL_WINETEST_HID_WAIT_INPUT"
;
case
IOCTL_WINETEST_HID_SET_CONTEXT
:
return
"IOCTL_WINETEST_HID_SET_CONTEXT"
;
case
IOCTL_WINETEST_CREATE_DEVICE
:
return
"IOCTL_WINETEST_CREATE_DEVICE"
;
case
IOCTL_WINETEST_REMOVE_DEVICE
:
return
"IOCTL_WINETEST_REMOVE_DEVICE"
;
...
...
dlls/dinput/tests/hid.c
View file @
bd2b8980
...
...
@@ -1001,6 +1001,24 @@ void send_hid_input_( const char *file, int line, HANDLE device, struct hid_devi
ok_
(
file
,
line
)(
ret
,
"IOCTL_WINETEST_HID_SEND_INPUT failed, last error %lu
\n
"
,
GetLastError
()
);
}
void
wait_hid_input_
(
const
char
*
file
,
int
line
,
HANDLE
device
,
struct
hid_device_desc
*
desc
,
DWORD
timeout
,
BOOL
todo
)
{
char
buffer
[
sizeof
(
*
desc
)];
SIZE_T
size
;
if
(
desc
)
memcpy
(
buffer
,
desc
,
sizeof
(
*
desc
)
);
else
memset
(
buffer
,
0
,
sizeof
(
*
desc
)
);
size
=
sizeof
(
*
desc
);
todo_wine_if
(
todo
)
{
BOOL
ret
=
sync_ioctl_
(
file
,
line
,
device
,
IOCTL_WINETEST_HID_WAIT_INPUT
,
buffer
,
size
,
NULL
,
0
,
timeout
);
ok_
(
file
,
line
)(
ret
,
"IOCTL_WINETEST_HID_WAIT_INPUT failed, last error %lu
\n
"
,
GetLastError
()
);
}
set_hid_expect_
(
file
,
line
,
device
,
desc
,
NULL
,
0
);
}
static
void
test_hidp_get_input
(
HANDLE
file
,
int
report_id
,
ULONG
report_len
,
PHIDP_PREPARSED_DATA
preparsed
)
{
struct
hid_expect
expect
[]
=
...
...
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