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
28bbaf67
Commit
28bbaf67
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: Return HIDP_STATUS_INCOMPATIBLE_REPORT_ID when id mismatches.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0d915de4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
hidp.c
dlls/hid/hidp.c
+3
-2
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+0
-4
No files found.
dlls/hid/hidp.c
View file @
28bbaf67
...
...
@@ -96,13 +96,14 @@ static NTSTATUS enum_value_caps( WINE_HIDP_PREPARSED_DATA *preparsed, HIDP_REPOR
{
const
struct
hid_value_caps
*
caps
,
*
caps_end
;
NTSTATUS
status
;
BOOL
incompatible
=
FALSE
;
LONG
remaining
=
*
count
;
for
(
status
=
get_value_caps_range
(
preparsed
,
report_type
,
report_len
,
&
caps
,
&
caps_end
);
status
==
HIDP_STATUS_SUCCESS
&&
caps
!=
caps_end
;
caps
++
)
{
if
(
!
match_value_caps
(
caps
,
filter
))
continue
;
if
(
filter
->
report_id
&&
caps
->
report_id
!=
filter
->
report_id
)
continue
;
if
(
filter
->
report_id
&&
caps
->
report_id
!=
filter
->
report_id
)
incompatible
=
TRUE
;
else
if
(
filter
->
array
&&
(
caps
->
is_range
||
caps
->
report_count
<=
1
))
return
HIDP_STATUS_NOT_VALUE_ARRAY
;
else
if
(
remaining
--
>
0
)
status
=
callback
(
caps
,
user
);
}
...
...
@@ -111,7 +112,7 @@ static NTSTATUS enum_value_caps( WINE_HIDP_PREPARSED_DATA *preparsed, HIDP_REPOR
if
(
status
!=
HIDP_STATUS_SUCCESS
)
return
status
;
*
count
-=
remaining
;
if
(
*
count
==
0
)
return
HIDP_STATUS_USAGE_NOT_FOUND
;
if
(
*
count
==
0
)
return
incompatible
?
HIDP_STATUS_INCOMPATIBLE_REPORT_ID
:
HIDP_STATUS_USAGE_NOT_FOUND
;
if
(
remaining
<
0
)
return
HIDP_STATUS_BUFFER_TOO_SMALL
;
return
HIDP_STATUS_SUCCESS
;
}
...
...
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
28bbaf67
...
...
@@ -2292,14 +2292,12 @@ static void test_hidp(HANDLE file, int report_id)
status
=
HidP_SetUsageValue
(
HidP_Feature
,
HID_USAGE_PAGE_ORDINAL
,
waveform_list
,
3
,
HID_USAGE_HAPTICS_WAVEFORM_RUMBLE
,
preparsed_data
,
report
,
caps
.
FeatureReportByteLength
);
todo_wine_if
(
!
report_id
)
ok
(
status
==
(
report_id
?
HIDP_STATUS_SUCCESS
:
HIDP_STATUS_INCOMPATIBLE_REPORT_ID
),
"HidP_SetUsageValue returned %#x
\n
"
,
status
);
report
[
0
]
=
2
;
status
=
HidP_SetUsageValue
(
HidP_Feature
,
HID_USAGE_PAGE_ORDINAL
,
waveform_list
,
3
,
HID_USAGE_HAPTICS_WAVEFORM_RUMBLE
,
preparsed_data
,
report
,
caps
.
FeatureReportByteLength
);
todo_wine
ok
(
status
==
HIDP_STATUS_INCOMPATIBLE_REPORT_ID
,
"HidP_SetUsageValue returned %#x
\n
"
,
status
);
report
[
0
]
=
report_id
;
status
=
HidP_SetUsageValue
(
HidP_Feature
,
HID_USAGE_PAGE_ORDINAL
,
0xdead
,
3
,
HID_USAGE_HAPTICS_WAVEFORM_RUMBLE
,
...
...
@@ -2330,13 +2328,11 @@ static void test_hidp(HANDLE file, int report_id)
report
[
0
]
=
1
-
report_id
;
status
=
HidP_GetUsageValue
(
HidP_Feature
,
HID_USAGE_PAGE_ORDINAL
,
waveform_list
,
3
,
&
value
,
preparsed_data
,
report
,
caps
.
FeatureReportByteLength
);
todo_wine_if
(
!
report_id
)
ok
(
status
==
(
report_id
?
HIDP_STATUS_SUCCESS
:
HIDP_STATUS_INCOMPATIBLE_REPORT_ID
),
"HidP_GetUsageValue returned %#x
\n
"
,
status
);
report
[
0
]
=
2
;
status
=
HidP_GetUsageValue
(
HidP_Feature
,
HID_USAGE_PAGE_ORDINAL
,
waveform_list
,
3
,
&
value
,
preparsed_data
,
report
,
caps
.
FeatureReportByteLength
);
todo_wine
ok
(
status
==
HIDP_STATUS_INCOMPATIBLE_REPORT_ID
,
"HidP_GetUsageValue returned %#x
\n
"
,
status
);
report
[
0
]
=
report_id
;
status
=
HidP_GetUsageValue
(
HidP_Feature
,
HID_USAGE_PAGE_ORDINAL
,
0xdead
,
3
,
&
value
,
...
...
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