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
6b504fe7
Commit
6b504fe7
authored
Aug 25, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe/tests: Add more HID usage nary tests.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c3884531
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
11 deletions
+50
-11
driver_hid.c
dlls/ntoskrnl.exe/tests/driver_hid.c
+11
-1
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+39
-10
No files found.
dlls/ntoskrnl.exe/tests/driver_hid.c
View file @
6b504fe7
...
...
@@ -299,6 +299,16 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
REPORT_COUNT
(
1
,
8
),
REPORT_SIZE
(
1
,
1
),
INPUT
(
1
,
Data
|
Var
|
Abs
),
USAGE
(
4
,
(
HID_USAGE_PAGE_KEYBOARD
<<
16
)
|
0x8c
),
USAGE
(
4
,
(
HID_USAGE_PAGE_KEYBOARD
<<
16
)
|
0x8d
),
USAGE
(
4
,
(
HID_USAGE_PAGE_KEYBOARD
<<
16
)
|
0x8e
),
USAGE
(
4
,
(
HID_USAGE_PAGE_KEYBOARD
<<
16
)
|
0x8f
),
LOGICAL_MINIMUM
(
1
,
1
),
LOGICAL_MAXIMUM
(
1
,
16
),
REPORT_COUNT
(
1
,
2
),
REPORT_SIZE
(
1
,
8
),
INPUT
(
1
,
Data
|
Ary
|
Abs
),
END_COLLECTION
,
USAGE_PAGE
(
2
,
HID_USAGE_PAGE_HAPTICS
),
...
...
@@ -477,7 +487,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
case
IOCTL_HID_READ_REPORT
:
{
ULONG
expected_size
=
2
3
;
ULONG
expected_size
=
2
5
;
ok
(
!
in_size
,
"got input size %u
\n
"
,
in_size
);
ok
(
out_size
==
expected_size
,
"got output size %u
\n
"
,
out_size
);
...
...
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
6b504fe7
...
...
@@ -1684,13 +1684,13 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
{
.
Usage
=
HID_USAGE_GENERIC_JOYSTICK
,
.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
InputReportByteLength
=
2
4
,
.
InputReportByteLength
=
2
6
,
.
OutputReportByteLength
=
3
,
.
FeatureReportByteLength
=
18
,
.
NumberLinkCollectionNodes
=
10
,
.
NumberInputButtonCaps
=
1
3
,
.
NumberInputButtonCaps
=
1
7
,
.
NumberInputValueCaps
=
7
,
.
NumberInputDataIndices
=
4
3
,
.
NumberInputDataIndices
=
4
7
,
.
NumberFeatureButtonCaps
=
1
,
.
NumberFeatureValueCaps
=
5
,
.
NumberFeatureDataIndices
=
7
,
...
...
@@ -1699,13 +1699,13 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
{
.
Usage
=
HID_USAGE_GENERIC_JOYSTICK
,
.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
InputReportByteLength
=
2
3
,
.
InputReportByteLength
=
2
5
,
.
OutputReportByteLength
=
2
,
.
FeatureReportByteLength
=
17
,
.
NumberLinkCollectionNodes
=
10
,
.
NumberInputButtonCaps
=
1
3
,
.
NumberInputButtonCaps
=
1
7
,
.
NumberInputValueCaps
=
7
,
.
NumberInputDataIndices
=
4
3
,
.
NumberInputDataIndices
=
4
7
,
.
NumberFeatureButtonCaps
=
1
,
.
NumberFeatureValueCaps
=
5
,
.
NumberFeatureDataIndices
=
7
,
...
...
@@ -1872,12 +1872,12 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
HIDP_LINK_COLLECTION_NODE
collections
[
16
];
PHIDP_PREPARSED_DATA
preparsed_data
;
USAGE_AND_PAGE
usage_and_pages
[
16
];
HIDP_BUTTON_CAPS
button_caps
[
16
];
HIDP_BUTTON_CAPS
button_caps
[
32
];
HIDP_VALUE_CAPS
value_caps
[
16
];
char
buffer
[
200
],
report
[
200
];
DWORD
collection_count
;
DWORD
waveform_list
;
HIDP_DATA
data
[
32
];
HIDP_DATA
data
[
64
];
USAGE
usages
[
16
];
NTSTATUS
status
;
HIDP_CAPS
caps
;
...
...
@@ -2186,7 +2186,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
value
=
HidP_MaxUsageListLength
(
HidP_Feature
+
1
,
0
,
preparsed_data
);
ok
(
value
==
0
,
"HidP_MaxUsageListLength(HidP_Feature + 1, 0) returned %d, expected %d
\n
"
,
value
,
0
);
value
=
HidP_MaxUsageListLength
(
HidP_Input
,
0
,
preparsed_data
);
ok
(
value
==
42
,
"HidP_MaxUsageListLength(HidP_Input, 0) returned %d, expected %d
\n
"
,
value
,
42
);
ok
(
value
==
50
,
"HidP_MaxUsageListLength(HidP_Input, 0) returned %d, expected %d
\n
"
,
value
,
50
);
value
=
HidP_MaxUsageListLength
(
HidP_Input
,
HID_USAGE_PAGE_BUTTON
,
preparsed_data
);
ok
(
value
==
32
,
"HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_BUTTON) returned %d, expected %d
\n
"
,
value
,
32
);
value
=
HidP_MaxUsageListLength
(
HidP_Input
,
HID_USAGE_PAGE_LED
,
preparsed_data
);
...
...
@@ -2307,7 +2307,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
value
=
HidP_MaxDataListLength
(
HidP_Feature
+
1
,
preparsed_data
);
ok
(
value
==
0
,
"HidP_MaxDataListLength(HidP_Feature + 1) returned %d, expected %d
\n
"
,
value
,
0
);
value
=
HidP_MaxDataListLength
(
HidP_Input
,
preparsed_data
);
ok
(
value
==
5
0
,
"HidP_MaxDataListLength(HidP_Input) returned %d, expected %d
\n
"
,
value
,
50
);
ok
(
value
==
5
8
,
"HidP_MaxDataListLength(HidP_Input) returned %d, expected %d
\n
"
,
value
,
58
);
value
=
HidP_MaxDataListLength
(
HidP_Output
,
preparsed_data
);
ok
(
value
==
0
,
"HidP_MaxDataListLength(HidP_Output) returned %d, expected %d
\n
"
,
value
,
0
);
value
=
HidP_MaxDataListLength
(
HidP_Feature
,
preparsed_data
);
...
...
@@ -2328,6 +2328,35 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
winetest_pop_context
();
}
/* HID nary usage collections are set with 1-based usage index in their declaration order */
memset
(
report
,
0
,
caps
.
InputReportByteLength
);
status
=
HidP_InitializeReportForID
(
HidP_Input
,
report_id
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_InitializeReportForID returned %#x
\n
"
,
status
);
value
=
2
;
usages
[
0
]
=
0x8e
;
usages
[
1
]
=
0x8f
;
status
=
HidP_SetUsages
(
HidP_Input
,
HID_USAGE_PAGE_KEYBOARD
,
0
,
usages
,
&
value
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_SetUsages returned %#x
\n
"
,
status
);
todo_wine
ok
(
report
[
caps
.
InputReportByteLength
-
2
]
==
3
,
"unexpected usage index %d, expected 3
\n
"
,
report
[
caps
.
InputReportByteLength
-
2
]);
todo_wine
ok
(
report
[
caps
.
InputReportByteLength
-
1
]
==
4
,
"unexpected usage index %d, expected 4
\n
"
,
report
[
caps
.
InputReportByteLength
-
1
]);
report
[
caps
.
InputReportByteLength
-
2
]
=
0
;
report
[
caps
.
InputReportByteLength
-
1
]
=
0
;
value
=
1
;
usages
[
0
]
=
0x8c
;
status
=
HidP_SetUsages
(
HidP_Input
,
HID_USAGE_PAGE_KEYBOARD
,
0
,
usages
,
&
value
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_SetUsages returned %#x
\n
"
,
status
);
todo_wine
ok
(
report
[
caps
.
InputReportByteLength
-
2
]
==
1
,
"unexpected usage index %d, expected 1
\n
"
,
report
[
caps
.
InputReportByteLength
-
2
]);
memset
(
report
,
0xcd
,
sizeof
(
report
));
status
=
HidP_InitializeReportForID
(
HidP_Feature
,
3
,
preparsed_data
,
report
,
caps
.
FeatureReportByteLength
);
ok
(
status
==
HIDP_STATUS_REPORT_DOES_NOT_EXIST
,
"HidP_InitializeReportForID returned %#x
\n
"
,
status
);
...
...
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