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
cc00075a
Commit
cc00075a
authored
Jan 25, 2017
by
Aric Stewart
Committed by
Alexandre Julliard
Jan 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hid: Implement HidP_GetUsagesEx.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fbd3525e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
1 deletion
+94
-1
hid.spec
dlls/hid/hid.spec
+1
-1
hidp.c
dlls/hid/hidp.c
+87
-0
hidpi.h
include/ddk/hidpi.h
+6
-0
No files found.
dlls/hid/hid.spec
View file @
cc00075a
...
...
@@ -29,7 +29,7 @@
@ stdcall HidP_GetUsageValue(long long long long ptr ptr ptr long)
@ stub HidP_GetUsageValueArray
@ stdcall HidP_GetUsages(long long long ptr ptr ptr ptr long)
@ st
ub HidP_GetUsagesEx
@ st
dcall HidP_GetUsagesEx(long long ptr ptr ptr ptr long)
@ stdcall HidP_GetValueCaps(long ptr ptr ptr)
@ stdcall HidP_InitializeReportForID(long long ptr ptr long)
@ stub HidP_MaxDataListLength
...
...
dlls/hid/hidp.c
View file @
cc00075a
...
...
@@ -676,3 +676,90 @@ NTSTATUS WINAPI HidP_GetSpecificValueCaps(HIDP_REPORT_TYPE ReportType,
return
HIDP_STATUS_SUCCESS
;
}
NTSTATUS
WINAPI
HidP_GetUsagesEx
(
HIDP_REPORT_TYPE
ReportType
,
USHORT
LinkCollection
,
USAGE_AND_PAGE
*
ButtonList
,
ULONG
*
UsageLength
,
PHIDP_PREPARSED_DATA
PreparsedData
,
CHAR
*
Report
,
ULONG
ReportLength
)
{
WINE_HIDP_PREPARSED_DATA
*
data
=
(
WINE_HIDP_PREPARSED_DATA
*
)
PreparsedData
;
WINE_HID_REPORT
*
report
=
NULL
;
USHORT
b_count
=
0
,
r_count
=
0
;
int
i
,
uCount
=
0
;
NTSTATUS
rc
;
TRACE
(
"(%i, %i, %p, %p(%i), %p, %p, %i)
\n
"
,
ReportType
,
LinkCollection
,
ButtonList
,
UsageLength
,
*
UsageLength
,
PreparsedData
,
Report
,
ReportLength
);
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
)
return
HIDP_STATUS_USAGE_NOT_FOUND
;
for
(
i
=
0
;
i
<
r_count
;
i
++
)
{
if
(
!
report
->
reportID
||
report
->
reportID
==
Report
[
0
])
break
;
report
=
HID_NEXT_REPORT
(
data
,
report
);
}
if
(
i
==
r_count
)
return
HIDP_STATUS_REPORT_DOES_NOT_EXIST
;
for
(
i
=
0
;
i
<
report
->
elementCount
;
i
++
)
{
if
(
report
->
Elements
[
i
].
ElementType
==
ButtonElement
)
{
int
k
;
WINE_HID_ELEMENT
*
element
=
&
report
->
Elements
[
i
];
for
(
k
=
0
;
k
<
element
->
bitCount
;
k
++
)
{
UINT
v
=
0
;
NTSTATUS
rc
=
get_report_data
((
BYTE
*
)
Report
,
ReportLength
,
element
->
valueStartBit
+
k
,
1
,
&
v
);
if
(
rc
!=
HIDP_STATUS_SUCCESS
)
return
rc
;
if
(
v
)
{
if
(
uCount
<
*
UsageLength
)
{
ButtonList
[
uCount
].
Usage
=
element
->
caps
.
button
.
u
.
Range
.
UsageMin
+
k
;
ButtonList
[
uCount
].
UsagePage
=
element
->
caps
.
button
.
UsagePage
;
}
uCount
++
;
}
}
}
}
TRACE
(
"Returning %i usages
\n
"
,
uCount
);
if
(
*
UsageLength
<
uCount
)
rc
=
HIDP_STATUS_BUFFER_TOO_SMALL
;
else
rc
=
HIDP_STATUS_SUCCESS
;
*
UsageLength
=
uCount
;
return
rc
;
}
include/ddk/hidpi.h
View file @
cc00075a
...
...
@@ -161,6 +161,11 @@ typedef struct _HIDP_KEYBOARD_MODIFIER_STATE {
}
DUMMYUNIONNAME
;
}
HIDP_KEYBOARD_MODIFIER_STATE
,
*
PHIDP_KEYBOARD_MODIFIER_STATE
;
typedef
struct
_USAGE_AND_PAGE
{
USAGE
Usage
;
USAGE
UsagePage
;
}
USAGE_AND_PAGE
,
*
PUSAGE_AND_PAGE
;
typedef
BOOLEAN
(
NTAPI
*
PHIDP_INSERT_SCANCODES
)
(
VOID
*
Context
,
CHAR
*
NewScanCodes
,
ULONG
Length
);
...
...
@@ -175,6 +180,7 @@ NTSTATUS WINAPI HidP_GetScaledUsageValue(HIDP_REPORT_TYPE ReportType, USAGE Usag
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
);
NTSTATUS
WINAPI
HidP_GetUsagesEx
(
HIDP_REPORT_TYPE
ReportType
,
USHORT
LinkCollection
,
USAGE_AND_PAGE
*
ButtonList
,
ULONG
*
UsageLength
,
PHIDP_PREPARSED_DATA
PreparsedData
,
CHAR
*
Report
,
ULONG
ReportLength
);
#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