Commit c5d70433 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

hid: Add HidP_SetUsages implementation.

parent 52f374ad
......@@ -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
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment