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
a4ed76b9
Commit
a4ed76b9
authored
Nov 15, 2016
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hid: Implement HidP_GetSpecificButtonCaps.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25524801
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
1 deletion
+74
-1
hid.spec
dlls/hid/hid.spec
+1
-1
hidp.c
dlls/hid/hidp.c
+72
-0
hidpi.h
include/ddk/hidpi.h
+1
-0
No files found.
dlls/hid/hid.spec
View file @
a4ed76b9
...
...
@@ -24,7 +24,7 @@
@ stub HidP_GetExtendedAttributes
@ stub HidP_GetLinkCollectionNodes
@ stdcall HidP_GetScaledUsageValue(long long long long ptr ptr ptr long)
@ st
ub HidP_GetSpecificButtonCaps
@ st
dcall HidP_GetSpecificButtonCaps(long long long long ptr ptr ptr)
@ stdcall HidP_GetSpecificValueCaps(long long long long ptr ptr ptr)
@ stdcall HidP_GetUsageValue(long long long long ptr ptr ptr long)
@ stub HidP_GetUsageValueArray
...
...
dlls/hid/hidp.c
View file @
a4ed76b9
...
...
@@ -536,6 +536,78 @@ NTSTATUS WINAPI HidP_TranslateUsagesToI8042ScanCodes(USAGE *ChangedUsageList,
return
STATUS_NOT_IMPLEMENTED
;
}
NTSTATUS
WINAPI
HidP_GetSpecificButtonCaps
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
HIDP_BUTTON_CAPS
*
ButtonCaps
,
USHORT
*
ButtonCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
)
{
WINE_HIDP_PREPARSED_DATA
*
data
=
(
WINE_HIDP_PREPARSED_DATA
*
)
PreparsedData
;
WINE_HID_REPORT
*
report
=
NULL
;
USHORT
b_count
=
0
,
r_count
=
0
;
int
i
,
j
,
u
;
TRACE
(
"(%i, 0x%x, %i, 0x%x, %p %p %p)
\n
"
,
ReportType
,
UsagePage
,
LinkCollection
,
Usage
,
ButtonCaps
,
ButtonCapsLength
,
PreparsedData
);
if
(
data
->
magic
!=
HID_MAGIC
)
return
HIDP_STATUS_INVALID_PREPARSED_DATA
;
switch
(
ReportType
)
{
case
HidP_Input
:
b_count
=
data
->
caps
.
NumberInputButtonCaps
;
r_count
=
data
->
dwInputReportCount
;
report
=
HID_INPUT_REPORTS
(
data
);
break
;
case
HidP_Output
:
b_count
=
data
->
caps
.
NumberOutputButtonCaps
;
r_count
=
data
->
dwOutputReportCount
;
report
=
HID_OUTPUT_REPORTS
(
data
);
break
;
case
HidP_Feature
:
b_count
=
data
->
caps
.
NumberFeatureButtonCaps
;
r_count
=
data
->
dwFeatureReportCount
;
report
=
HID_FEATURE_REPORTS
(
data
);
break
;
default:
return
HIDP_STATUS_INVALID_REPORT_TYPE
;
}
if
(
!
r_count
||
!
b_count
||
!
report
)
{
*
ButtonCapsLength
=
0
;
return
HIDP_STATUS_SUCCESS
;
}
b_count
=
min
(
b_count
,
*
ButtonCapsLength
);
u
=
0
;
for
(
j
=
0
;
j
<
r_count
&&
u
<
b_count
;
j
++
)
{
for
(
i
=
0
;
i
<
report
->
elementCount
&&
u
<
b_count
;
i
++
)
{
if
(
report
->
Elements
[
i
].
ElementType
==
ButtonElement
&&
(
UsagePage
==
0
||
UsagePage
==
report
->
Elements
[
i
].
caps
.
button
.
UsagePage
)
&&
(
LinkCollection
==
0
||
LinkCollection
==
report
->
Elements
[
i
].
caps
.
button
.
LinkCollection
)
&&
(
Usage
==
0
||
(
(
!
report
->
Elements
[
i
].
caps
.
button
.
IsRange
&&
Usage
==
report
->
Elements
[
i
].
caps
.
button
.
u
.
NotRange
.
Usage
))
||
(
report
->
Elements
[
i
].
caps
.
button
.
IsRange
&&
Usage
>=
report
->
Elements
[
i
].
caps
.
button
.
u
.
Range
.
UsageMin
&&
Usage
<=
report
->
Elements
[
i
].
caps
.
button
.
u
.
Range
.
UsageMax
)))
{
ButtonCaps
[
u
++
]
=
report
->
Elements
[
i
].
caps
.
button
;
}
}
report
=
HID_NEXT_REPORT
(
data
,
report
);
}
TRACE
(
"Matched %i usages
\n
"
,
u
);
*
ButtonCapsLength
=
u
;
return
HIDP_STATUS_SUCCESS
;
}
NTSTATUS
WINAPI
HidP_GetSpecificValueCaps
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
HIDP_VALUE_CAPS
*
ValueCaps
,
USHORT
*
ValueCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
)
...
...
include/ddk/hidpi.h
View file @
a4ed76b9
...
...
@@ -173,6 +173,7 @@ NTSTATUS WINAPI HidP_InitializeReportForID(HIDP_REPORT_TYPE ReportType, UCHAR Re
ULONG
WINAPI
HidP_MaxUsageListLength
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
PHIDP_PREPARSED_DATA
PreparsedData
);
NTSTATUS
WINAPI
HidP_GetScaledUsageValue
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
PLONG
UsageValue
,
PHIDP_PREPARSED_DATA
PreparsedData
,
PCHAR
Report
,
ULONG
ReportLength
);
NTSTATUS
WINAPI
HidP_TranslateUsagesToI8042ScanCodes
(
USAGE
*
ChangedUsageList
,
ULONG
UsageListLength
,
HIDP_KEYBOARD_DIRECTION
KeyAction
,
HIDP_KEYBOARD_MODIFIER_STATE
*
ModifierState
,
PHIDP_INSERT_SCANCODES
InsertCodesProcedure
,
VOID
*
InsertCodesContext
);
NTSTATUS
WINAPI
HidP_GetSpecificButtonCaps
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
HIDP_BUTTON_CAPS
*
ButtonCaps
,
USHORT
*
ButtonCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
);
NTSTATUS
WINAPI
HidP_GetSpecificValueCaps
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
HIDP_VALUE_CAPS
*
ValueCaps
,
USHORT
*
ValueCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
);
#ifndef FACILITY_HID_ERROR_CODE
...
...
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