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
1c4e7a00
Commit
1c4e7a00
authored
Jun 28, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hid: Rewrite HidP_MaxDataListLength using enum_value_caps.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
28bbaf67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
hidp.c
dlls/hid/hidp.c
+16
-16
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+0
-1
No files found.
dlls/hid/hidp.c
View file @
1c4e7a00
...
...
@@ -679,24 +679,24 @@ NTSTATUS WINAPI HidP_GetUsagesEx( HIDP_REPORT_TYPE report_type, USHORT collectio
return
status
;
}
ULONG
WINAPI
HidP_MaxDataListLength
(
HIDP_REPORT_TYPE
ReportType
,
PHIDP_PREPARSED_DATA
PreparsedData
)
static
NTSTATUS
count_data
(
const
struct
hid_value_caps
*
caps
,
void
*
user
)
{
WINE_HIDP_PREPARSED_DATA
*
data
=
(
WINE_HIDP_PREPARSED_DATA
*
)
PreparsedData
;
TRACE
(
"(%i, %p)
\n
"
,
ReportType
,
PreparsedData
)
;
if
(
data
->
magic
!=
HID_MAGIC
)
return
0
;
if
(
caps
->
is_range
||
HID_VALUE_CAPS_IS_BUTTON
(
caps
))
*
(
ULONG
*
)
user
+=
caps
->
report_count
;
else
*
(
ULONG
*
)
user
+=
1
;
return
HIDP_STATUS_SUCCESS
;
}
switch
(
ReportType
)
{
case
HidP_Input
:
return
data
->
caps
.
NumberInputDataIndices
;
case
HidP_Output
:
return
data
->
caps
.
NumberOutputDataIndices
;
case
HidP_Feature
:
return
data
->
caps
.
NumberFeatureDataIndices
;
default:
return
0
;
}
ULONG
WINAPI
HidP_MaxDataListLength
(
HIDP_REPORT_TYPE
report_type
,
PHIDP_PREPARSED_DATA
preparsed_data
)
{
WINE_HIDP_PREPARSED_DATA
*
preparsed
=
(
WINE_HIDP_PREPARSED_DATA
*
)
preparsed_data
;
struct
caps_filter
filter
=
{}
;
USHORT
limit
=
-
1
;
ULONG
count
=
0
;
TRACE
(
"report_type %d, preparsed_data %p.
\n
"
,
report_type
,
preparsed_data
)
;
enum_value_caps
(
preparsed
,
report_type
,
0
,
&
filter
,
count_data
,
&
count
,
&
limit
)
;
return
count
;
}
NTSTATUS
WINAPI
HidP_GetData
(
HIDP_REPORT_TYPE
ReportType
,
HIDP_DATA
*
DataList
,
ULONG
*
DataLength
,
...
...
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
1c4e7a00
...
...
@@ -2229,7 +2229,6 @@ static void test_hidp(HANDLE file, int report_id)
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
);
todo_wine
ok
(
value
==
50
,
"HidP_MaxDataListLength(HidP_Input) returned %d, expected %d
\n
"
,
value
,
50
);
value
=
HidP_MaxDataListLength
(
HidP_Output
,
preparsed_data
);
ok
(
value
==
0
,
"HidP_MaxDataListLength(HidP_Output) returned %d, expected %d
\n
"
,
value
,
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