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
098efa1e
Commit
098efa1e
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_GetScaledUsageValue.
parent
1174fc63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
11 deletions
+57
-11
hid.spec
dlls/hid/hid.spec
+1
-1
hidp.c
dlls/hid/hidp.c
+55
-10
hidpi.h
include/ddk/hidpi.h
+1
-0
No files found.
dlls/hid/hid.spec
View file @
098efa1e
...
...
@@ -23,7 +23,7 @@
@ stub HidP_GetData
@ stub HidP_GetExtendedAttributes
@ stub HidP_GetLinkCollectionNodes
@ st
ub HidP_GetScaledUsageValue
@ st
dcall HidP_GetScaledUsageValue(long long long long ptr ptr ptr long)
@ stub HidP_GetSpecificButtonCaps
@ stub HidP_GetSpecificValueCaps
@ stdcall HidP_GetUsageValue(long long long long ptr ptr ptr long)
...
...
dlls/hid/hidp.c
View file @
098efa1e
...
...
@@ -150,22 +150,20 @@ NTSTATUS WINAPI HidP_GetCaps(PHIDP_PREPARSED_DATA PreparsedData,
return
HIDP_STATUS_SUCCESS
;
}
NTSTATUS
WINAPI
HidP_GetUsageValue
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
PULONG
UsageValue
,
PHIDP_PREPARSED_DATA
PreparsedData
,
PCHAR
Report
,
ULONG
ReportLength
)
static
NTSTATUS
find_value
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
PHIDP_PREPARSED_DATA
PreparsedData
,
PCHAR
Report
,
WINE_HID_ELEMENT
**
element
)
{
PWINE_HIDP_PREPARSED_DATA
data
=
(
PWINE_HIDP_PREPARSED_DATA
)
PreparsedData
;
WINE_HID_REPORT
*
report
=
NULL
;
USHORT
v_count
=
0
,
r_count
=
0
;
int
i
;
TRACE
(
"(%i, %x, %i, %i, %p, %p
, %p, %i)
\n
"
,
ReportType
,
UsagePage
,
LinkCollection
,
Usage
,
UsageValu
e
,
PreparsedData
,
Report
,
ReportLength
);
TRACE
(
"(%i, %x, %i, %i, %p, %p
)
\n
"
,
ReportType
,
UsagePage
,
LinkCollection
,
Usag
e
,
PreparsedData
,
Report
);
if
(
data
->
magic
!=
HID_MAGIC
)
return
HIDP_STATUS_INVALID_PREPARSED_DATA
;
switch
(
ReportType
)
{
case
HidP_Input
:
...
...
@@ -206,15 +204,62 @@ NTSTATUS WINAPI HidP_GetUsageValue(HIDP_REPORT_TYPE ReportType, USAGE UsagePage,
report
->
Elements
[
i
].
caps
.
value
.
UsagePage
==
UsagePage
&&
report
->
Elements
[
i
].
caps
.
value
.
u
.
NotRange
.
Usage
==
Usage
)
{
return
get_report_data
((
BYTE
*
)
Report
,
ReportLength
,
report
->
Elements
[
i
].
valueStartBit
,
report
->
Elements
[
i
].
bitCount
,
UsageValue
);
*
element
=
&
report
->
Elements
[
i
];
return
HIDP_STATUS_SUCCESS
;
}
}
return
HIDP_STATUS_USAGE_NOT_FOUND
;
}
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
rc
;
WINE_HID_ELEMENT
*
element
;
TRACE
(
"(%i, %x, %i, %i, %p, %p, %p, %i)
\n
"
,
ReportType
,
UsagePage
,
LinkCollection
,
Usage
,
UsageValue
,
PreparsedData
,
Report
,
ReportLength
);
rc
=
find_value
(
ReportType
,
UsagePage
,
LinkCollection
,
Usage
,
PreparsedData
,
Report
,
&
element
);
if
(
rc
==
HIDP_STATUS_SUCCESS
)
{
ULONG
rawValue
;
rc
=
get_report_data
((
BYTE
*
)
Report
,
ReportLength
,
element
->
valueStartBit
,
element
->
bitCount
,
&
rawValue
);
if
(
rc
!=
HIDP_STATUS_SUCCESS
)
return
rc
;
if
(
element
->
caps
.
value
.
BitSize
==
16
)
rawValue
=
(
short
)
rawValue
;
*
UsageValue
=
rawValue
;
}
return
rc
;
}
NTSTATUS
WINAPI
HidP_GetUsageValue
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
PULONG
UsageValue
,
PHIDP_PREPARSED_DATA
PreparsedData
,
PCHAR
Report
,
ULONG
ReportLength
)
{
WINE_HID_ELEMENT
*
element
;
NTSTATUS
rc
;
TRACE
(
"(%i, %x, %i, %i, %p, %p, %p, %i)
\n
"
,
ReportType
,
UsagePage
,
LinkCollection
,
Usage
,
UsageValue
,
PreparsedData
,
Report
,
ReportLength
);
rc
=
find_value
(
ReportType
,
UsagePage
,
LinkCollection
,
Usage
,
PreparsedData
,
Report
,
&
element
);
if
(
rc
==
HIDP_STATUS_SUCCESS
)
{
return
get_report_data
((
BYTE
*
)
Report
,
ReportLength
,
element
->
valueStartBit
,
element
->
bitCount
,
UsageValue
);
}
return
rc
;
}
NTSTATUS
WINAPI
HidP_GetUsages
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
PUSAGE
UsageList
,
PULONG
UsageLength
,
PHIDP_PREPARSED_DATA
PreparsedData
,
...
...
include/ddk/hidpi.h
View file @
098efa1e
...
...
@@ -143,6 +143,7 @@ NTSTATUS WINAPI HidP_GetUsageValue(HIDP_REPORT_TYPE ReportType, USAGE UsagePage,
NTSTATUS
WINAPI
HidP_GetValueCaps
(
HIDP_REPORT_TYPE
ReportType
,
PHIDP_VALUE_CAPS
ValueCaps
,
PUSHORT
ValueCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
);
NTSTATUS
WINAPI
HidP_InitializeReportForID
(
HIDP_REPORT_TYPE
ReportType
,
UCHAR
ReportID
,
PHIDP_PREPARSED_DATA
PreparsedData
,
PCHAR
Report
,
ULONG
ReportLength
);
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
);
#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