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
a2ab5538
Commit
a2ab5538
authored
Nov 23, 2018
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hid: Implement HidP_SetUsageValue.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e6f00d69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
1 deletion
+67
-1
hid.spec
dlls/hid/hid.spec
+1
-1
hidp.c
dlls/hid/hidp.c
+65
-0
hidpi.h
include/ddk/hidpi.h
+1
-0
No files found.
dlls/hid/hid.spec
View file @
a2ab5538
...
...
@@ -36,7 +36,7 @@
@ stdcall HidP_MaxUsageListLength(long long ptr)
@ stub HidP_SetData
@ stub HidP_SetScaledUsageValue
@ st
ub HidP_SetUsageValue
@ st
dcall HidP_SetUsageValue(long long long long long ptr ptr long)
@ stub HidP_SetUsageValueArray
@ stub HidP_SetUsages
@ stdcall HidP_TranslateUsagesToI8042ScanCodes(ptr long long ptr ptr ptr)
...
...
dlls/hid/hidp.c
View file @
a2ab5538
...
...
@@ -81,6 +81,49 @@ static NTSTATUS get_report_data(BYTE *report, INT reportLength, INT startBit, IN
return
HIDP_STATUS_SUCCESS
;
}
static
NTSTATUS
set_report_data
(
BYTE
*
report
,
INT
reportLength
,
INT
startBit
,
INT
valueSize
,
ULONG
value
)
{
if
((
startBit
+
valueSize
)
/
8
>
reportLength
)
return
HIDP_STATUS_INVALID_REPORT_LENGTH
;
if
(
valueSize
==
1
)
{
ULONG
byte_index
=
startBit
/
8
;
ULONG
bit_index
=
startBit
-
(
byte_index
*
8
);
if
(
value
)
report
[
byte_index
]
|=
(
1
<<
bit_index
);
else
report
[
byte_index
]
&=
~
(
1
<<
bit_index
);
}
else
{
ULONG
byte_index
=
(
startBit
+
valueSize
-
1
)
/
8
;
ULONG
data
=
value
;
ULONG
remainingBits
=
valueSize
;
while
(
remainingBits
)
{
BYTE
subvalue
=
data
&
0xff
;
data
>>=
8
;
if
(
remainingBits
>=
8
)
{
report
[
byte_index
]
=
subvalue
;
byte_index
--
;
remainingBits
-=
8
;
}
else
if
(
remainingBits
>
0
)
{
BYTE
mask
=
(
0xff
<<
(
8
-
remainingBits
))
&
subvalue
;
report
[
byte_index
]
|=
mask
;
remainingBits
=
0
;
}
}
}
return
HIDP_STATUS_SUCCESS
;
}
NTSTATUS
WINAPI
HidP_GetButtonCaps
(
HIDP_REPORT_TYPE
ReportType
,
PHIDP_BUTTON_CAPS
ButtonCaps
,
PUSHORT
ButtonCapsLength
,
PHIDP_PREPARSED_DATA
PreparsedData
)
{
...
...
@@ -528,6 +571,28 @@ ULONG WINAPI HidP_MaxUsageListLength(HIDP_REPORT_TYPE ReportType, USAGE UsagePag
return
count
;
}
NTSTATUS
WINAPI
HidP_SetUsageValue
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
ULONG
UsageValue
,
PHIDP_PREPARSED_DATA
PreparsedData
,
CHAR
*
Report
,
ULONG
ReportLength
)
{
WINE_HID_ELEMENT
*
element
;
NTSTATUS
rc
;
TRACE
(
"(%i, %x, %i, %i, %i, %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
set_report_data
((
BYTE
*
)
Report
,
ReportLength
,
element
->
valueStartBit
,
element
->
bitCount
,
UsageValue
);
}
return
rc
;
}
NTSTATUS
WINAPI
HidP_TranslateUsagesToI8042ScanCodes
(
USAGE
*
ChangedUsageList
,
ULONG
UsageListLength
,
HIDP_KEYBOARD_DIRECTION
KeyAction
,
HIDP_KEYBOARD_MODIFIER_STATE
*
ModifierState
,
...
...
include/ddk/hidpi.h
View file @
a2ab5538
...
...
@@ -186,6 +186,7 @@ NTSTATUS WINAPI HidP_GetValueCaps(HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS
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
);
NTSTATUS
WINAPI
HidP_SetUsageValue
(
HIDP_REPORT_TYPE
ReportType
,
USAGE
UsagePage
,
USHORT
LinkCollection
,
USAGE
Usage
,
ULONG
UsageValue
,
PHIDP_PREPARSED_DATA
PreparsedData
,
CHAR
*
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
);
...
...
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