mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:21:08 +00:00
hid: Implement HidP_GetSpecificValueCaps.
Signed-off-by: Aric Stewart <aric@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
86f4aa1993
commit
3c60e4bf58
|
@ -25,7 +25,7 @@
|
|||
@ stub HidP_GetLinkCollectionNodes
|
||||
@ stdcall HidP_GetScaledUsageValue(long long long long ptr ptr ptr long)
|
||||
@ stub HidP_GetSpecificButtonCaps
|
||||
@ stub HidP_GetSpecificValueCaps
|
||||
@ stdcall HidP_GetSpecificValueCaps(long long long long ptr ptr ptr)
|
||||
@ 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)
|
||||
|
|
|
@ -535,3 +535,69 @@ NTSTATUS WINAPI HidP_TranslateUsagesToI8042ScanCodes(USAGE *ChangedUsageList,
|
|||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI HidP_GetSpecificValueCaps(HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage, USHORT LinkCollection, USAGE Usage,
|
||||
HIDP_VALUE_CAPS *ValueCaps, USHORT *ValueCapsLength, PHIDP_PREPARSED_DATA PreparsedData)
|
||||
{
|
||||
WINE_HIDP_PREPARSED_DATA *data = (PWINE_HIDP_PREPARSED_DATA)PreparsedData;
|
||||
WINE_HID_REPORT *report = NULL;
|
||||
USHORT v_count = 0, r_count = 0;
|
||||
int i,j,u;
|
||||
|
||||
TRACE("(%i, 0x%x, %i, 0x%x, %p %p %p)\n", ReportType, UsagePage, LinkCollection,
|
||||
Usage, ValueCaps, ValueCapsLength, PreparsedData);
|
||||
|
||||
if (data->magic != HID_MAGIC)
|
||||
return HIDP_STATUS_INVALID_PREPARSED_DATA;
|
||||
|
||||
switch(ReportType)
|
||||
{
|
||||
case HidP_Input:
|
||||
v_count = data->caps.NumberInputValueCaps;
|
||||
r_count = data->dwInputReportCount;
|
||||
report = HID_INPUT_REPORTS(data);
|
||||
break;
|
||||
case HidP_Output:
|
||||
v_count = data->caps.NumberOutputValueCaps;
|
||||
r_count = data->dwOutputReportCount;
|
||||
report = HID_OUTPUT_REPORTS(data);
|
||||
break;
|
||||
case HidP_Feature:
|
||||
v_count = data->caps.NumberFeatureValueCaps;
|
||||
r_count = data->dwFeatureReportCount;
|
||||
report = HID_FEATURE_REPORTS(data);
|
||||
break;
|
||||
default:
|
||||
return HIDP_STATUS_INVALID_REPORT_TYPE;
|
||||
}
|
||||
|
||||
if (!r_count || !v_count || !report)
|
||||
{
|
||||
*ValueCapsLength = 0;
|
||||
return HIDP_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
v_count = min(v_count, *ValueCapsLength);
|
||||
|
||||
u = 0;
|
||||
for (j = 0; j < r_count && u < v_count; j++)
|
||||
{
|
||||
for (i = 0; i < report->elementCount && u < v_count; i++)
|
||||
{
|
||||
if (report->Elements[i].ElementType == ValueElement &&
|
||||
(UsagePage == 0 || UsagePage == report->Elements[i].caps.value.UsagePage) &&
|
||||
(LinkCollection == 0 || LinkCollection == report->Elements[i].caps.value.LinkCollection) &&
|
||||
(Usage == 0 || Usage == report->Elements[i].caps.value.u.NotRange.Usage))
|
||||
{
|
||||
ValueCaps[u++] = report->Elements[i].caps.value;
|
||||
}
|
||||
}
|
||||
report = HID_NEXT_REPORT(data, report);
|
||||
}
|
||||
TRACE("Matched %i usages\n", u);
|
||||
|
||||
*ValueCapsLength = u;
|
||||
|
||||
return HIDP_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -173,6 +173,7 @@ NTSTATUS WINAPI HidP_InitializeReportForID(HIDP_REPORT_TYPE ReportType, UCHAR Re
|
|||
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_TranslateUsagesToI8042ScanCodes(USAGE *ChangedUsageList, ULONG UsageListLength, HIDP_KEYBOARD_DIRECTION KeyAction, HIDP_KEYBOARD_MODIFIER_STATE *ModifierState, PHIDP_INSERT_SCANCODES InsertCodesProcedure, VOID *InsertCodesContext);
|
||||
NTSTATUS WINAPI HidP_GetSpecificValueCaps(HIDP_REPORT_TYPE ReportType, USAGE UsagePage, USHORT LinkCollection, USAGE Usage, HIDP_VALUE_CAPS *ValueCaps, USHORT *ValueCapsLength, PHIDP_PREPARSED_DATA PreparsedData);
|
||||
|
||||
#ifndef FACILITY_HID_ERROR_CODE
|
||||
#define FACILITY_HID_ERROR_CODE 0x11
|
||||
|
|
Loading…
Reference in a new issue