Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0bb216ff
Commit
0bb216ff
authored
Jun 30, 2015
by
Aric Stewart
Committed by
Alexandre Julliard
Jul 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hid: Implement HidP_GetValueCaps.
parent
b183dc3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
1 deletion
+61
-1
hid.spec
dlls/hid/hid.spec
+1
-1
hidp.c
dlls/hid/hidp.c
+58
-0
hidpi.h
include/ddk/hidpi.h
+2
-0
No files found.
dlls/hid/hid.spec
View file @
0bb216ff
...
...
@@ -30,7 +30,7 @@
@ stub HidP_GetUsageValueArray
@ stub HidP_GetUsages
@ stub HidP_GetUsagesEx
@ st
ub HidP_GetValueCaps
@ st
dcall HidP_GetValueCaps(long ptr ptr ptr)
@ stub HidP_InitializeReportForID
@ stub HidP_MaxDataListLength
@ stub HidP_MaxUsageListLength
...
...
dlls/hid/hidp.c
View file @
0bb216ff
...
...
@@ -109,3 +109,61 @@ NTSTATUS WINAPI HidP_GetCaps(PHIDP_PREPARSED_DATA PreparsedData,
return
HIDP_STATUS_SUCCESS
;
}
NTSTATUS
WINAPI
HidP_GetValueCaps
(
HIDP_REPORT_TYPE
ReportType
,
PHIDP_VALUE_CAPS
ValueCaps
,
PUSHORT
ValueCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
)
{
PWINE_HIDP_PREPARSED_DATA
data
=
(
PWINE_HIDP_PREPARSED_DATA
)
PreparsedData
;
WINE_HID_REPORT
*
report
=
NULL
;
USHORT
v_count
=
0
,
r_count
=
0
;
int
i
,
j
,
u
;
TRACE
(
"(%i, %p, %p, %p)
\n
"
,
ReportType
,
ValueCaps
,
ValueCapsLength
,
PreparsedData
);
if
(
data
->
magic
!=
HID_MAGIC
)
return
HIDP_STATUS_INVALID_PREPARSED_DATA
;
switch
(
ReportType
)
{
case
HidP_Input
:
v_count
=
data
->
caps
.
NumberInputValueCaps
;
r_count
=
data
->
dwInputReportCount
;
report
=
HID_INPUT_REPORTS
(
data
);
break
;
case
HidP_Output
:
v_count
=
data
->
caps
.
NumberOutputValueCaps
;
r_count
=
data
->
dwOutputReportCount
;
report
=
HID_OUTPUT_REPORTS
(
data
);
break
;
case
HidP_Feature
:
v_count
=
data
->
caps
.
NumberFeatureValueCaps
;
r_count
=
data
->
dwFeatureReportCount
;
report
=
HID_FEATURE_REPORTS
(
data
);
break
;
default:
return
HIDP_STATUS_INVALID_REPORT_TYPE
;
}
if
(
!
r_count
||
!
v_count
||
!
report
)
{
*
ValueCapsLength
=
0
;
return
HIDP_STATUS_SUCCESS
;
}
v_count
=
min
(
v_count
,
*
ValueCapsLength
);
u
=
0
;
for
(
j
=
0
;
j
<
r_count
&&
u
<
v_count
;
j
++
)
{
for
(
i
=
0
;
i
<
report
->
elementCount
&&
u
<
v_count
;
i
++
)
{
if
(
report
->
Elements
[
i
].
ElementType
==
ValueElement
)
ValueCaps
[
u
++
]
=
report
->
Elements
[
i
].
caps
.
value
;
}
report
=
HID_NEXT_REPORT
(
data
,
report
);
}
*
ValueCapsLength
=
v_count
;
return
HIDP_STATUS_SUCCESS
;
}
include/ddk/hidpi.h
View file @
0bb216ff
...
...
@@ -138,6 +138,8 @@ typedef struct _HIDP_CAPS
NTSTATUS
WINAPI
HidP_GetButtonCaps
(
HIDP_REPORT_TYPE
ReportType
,
PHIDP_BUTTON_CAPS
ButtonCaps
,
PUSHORT
ButtonCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
);
NTSTATUS
WINAPI
HidP_GetCaps
(
PHIDP_PREPARSED_DATA
PreparsedData
,
PHIDP_CAPS
Capabilities
);
NTSTATUS
WINAPI
HidP_GetValueCaps
(
HIDP_REPORT_TYPE
ReportType
,
PHIDP_VALUE_CAPS
ValueCaps
,
PUSHORT
ValueCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
);
#ifndef FACILITY_HID_ERROR_CODE
#define FACILITY_HID_ERROR_CODE 0x11
...
...
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