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
9d10c55b
Commit
9d10c55b
authored
Dec 01, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Dec 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8/tests: Add a check_buffer helper to print buffer data.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa08cadc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
driver_hid.c
dlls/dinput8/tests/driver_hid.c
+22
-6
No files found.
dlls/dinput8/tests/driver_hid.c
View file @
9d10c55b
...
...
@@ -467,6 +467,25 @@ static NTSTATUS WINAPI driver_power( DEVICE_OBJECT *device, IRP *irp )
return
PoCallDriver
(
ext
->
NextDeviceObject
,
irp
);
}
#define check_buffer( a, b ) check_buffer_( __LINE__, a, b )
static
void
check_buffer_
(
int
line
,
HID_XFER_PACKET
*
packet
,
struct
hid_expect
*
expect
)
{
ULONG
match_len
,
i
;
match_len
=
RtlCompareMemory
(
packet
->
reportBuffer
,
expect
->
report_buf
,
expect
->
report_len
);
ok
(
match_len
==
expect
->
report_len
,
"unexpected data:
\n
"
);
if
(
match_len
==
expect
->
report_len
)
return
;
for
(
i
=
0
;
i
<
packet
->
reportBufferLen
;)
{
char
buffer
[
256
],
*
buf
=
buffer
;
buf
+=
sprintf
(
buf
,
"%08x "
,
i
);
do
buf
+=
sprintf
(
buf
,
" %02x"
,
packet
->
reportBuffer
[
i
]
);
while
(
++
i
%
16
&&
i
<
packet
->
reportBufferLen
);
ok
(
0
,
" %s
\n
"
,
buffer
);
}
}
static
NTSTATUS
WINAPI
driver_internal_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
...
...
@@ -574,8 +593,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
ok
(
code
==
expect
.
code
,
"got %#x, expected %#x
\n
"
,
code
,
expect
.
code
);
ok
(
packet
->
reportId
==
expect
.
report_id
,
"got id %u
\n
"
,
packet
->
reportId
);
ok
(
packet
->
reportBufferLen
==
expect
.
report_len
,
"got len %u
\n
"
,
packet
->
reportBufferLen
);
ok
(
RtlCompareMemory
(
packet
->
reportBuffer
,
expect
.
report_buf
,
expect
.
report_len
)
==
expect
.
report_len
,
"unexpected data
\n
"
);
check_buffer
(
packet
,
&
expect
);
winetest_pop_context
();
irp
->
IoStatus
.
Information
=
expect
.
ret_length
?
expect
.
ret_length
:
expect
.
report_len
;
...
...
@@ -621,8 +639,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
ok
(
code
==
expect
.
code
,
"got %#x, expected %#x
\n
"
,
code
,
expect
.
code
);
ok
(
packet
->
reportId
==
expect
.
report_id
,
"got id %u
\n
"
,
packet
->
reportId
);
ok
(
packet
->
reportBufferLen
==
expect
.
report_len
,
"got len %u
\n
"
,
packet
->
reportBufferLen
);
ok
(
RtlCompareMemory
(
packet
->
reportBuffer
,
expect
.
report_buf
,
expect
.
report_len
)
==
expect
.
report_len
,
"unexpected data
\n
"
);
check_buffer
(
packet
,
&
expect
);
winetest_pop_context
();
irp
->
IoStatus
.
Information
=
expect
.
ret_length
?
expect
.
ret_length
:
expect
.
report_len
;
...
...
@@ -668,8 +685,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
ok
(
code
==
expect
.
code
,
"got %#x, expected %#x
\n
"
,
code
,
expect
.
code
);
ok
(
packet
->
reportId
==
expect
.
report_id
,
"got id %u
\n
"
,
packet
->
reportId
);
ok
(
packet
->
reportBufferLen
==
expect
.
report_len
,
"got len %u
\n
"
,
packet
->
reportBufferLen
);
ok
(
RtlCompareMemory
(
packet
->
reportBuffer
,
expect
.
report_buf
,
expect
.
report_len
)
==
expect
.
report_len
,
"unexpected data
\n
"
);
check_buffer
(
packet
,
&
expect
);
winetest_pop_context
();
irp
->
IoStatus
.
Information
=
expect
.
ret_length
?
expect
.
ret_length
:
expect
.
report_len
;
...
...
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