hid: Add HidP_SetUsages implementation.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2019-05-03 11:59:02 +02:00 committed by Alexandre Julliard
parent 52f374ad50
commit c5d704334f
2 changed files with 33 additions and 1 deletions

View File

@ -38,7 +38,7 @@
@ stub HidP_SetScaledUsageValue
@ stdcall HidP_SetUsageValue(long long long long long ptr ptr long)
@ stub HidP_SetUsageValueArray
@ stub HidP_SetUsages
@ stdcall HidP_SetUsages(long long long ptr ptr ptr ptr long)
@ stdcall HidP_TranslateUsagesToI8042ScanCodes(ptr long long ptr ptr ptr)
@ stub HidP_UnsetUsages
@ stub HidP_UsageListDifference

View File

@ -616,6 +616,38 @@ NTSTATUS WINAPI HidP_SetUsageValue(HIDP_REPORT_TYPE ReportType, USAGE UsagePage,
}
NTSTATUS WINAPI HidP_SetUsages(HIDP_REPORT_TYPE ReportType, USAGE UsagePage, USHORT LinkCollection,
PUSAGE UsageList, PULONG UsageLength, PHIDP_PREPARSED_DATA PreparsedData,
PCHAR Report, ULONG ReportLength)
{
WINE_HID_ELEMENT *element;
NTSTATUS rc;
ULONG i;
TRACE("(%i, %x, %i, %p, %p, %p, %p, %i)\n", ReportType, UsagePage, LinkCollection, UsageList,
UsageLength, PreparsedData, Report, ReportLength);
for (i = 0; i < *UsageLength; i++)
{
rc = find_value(ReportType, UsagePage, LinkCollection,
UsageList[i], PreparsedData, Report, &element);
if (rc == HIDP_STATUS_SUCCESS)
{
rc = set_report_data((BYTE*)Report, ReportLength,
element->valueStartBit, element->bitCount, -1);
if (rc != HIDP_STATUS_SUCCESS)
{
*UsageLength = i;
return rc;
}
}
}
return HIDP_STATUS_SUCCESS;
}
NTSTATUS WINAPI HidP_TranslateUsagesToI8042ScanCodes(USAGE *ChangedUsageList,
ULONG UsageListLength, HIDP_KEYBOARD_DIRECTION KeyAction,
HIDP_KEYBOARD_MODIFIER_STATE *ModifierState,