HidP_GetUsagesEx (Windows Embedded CE 6.0)
1/6/2010
This function returns a list of the HID control button usages that are set to On in a HID report.
Syntax
NTSTATUS HidP_GetUsagesEx(
HIDP_REPORT_TYPE ReportType,
USHORT LinkCollection,
PUSAGE_AND_PAGE ButtonList,
ULONG* UsageLength,
PHIDP_PREPARSED_DATA PreparsedData,
PCHAR Report,
ULONG ReportLength
);
Parameters
- ReportType
[in] HIDP_REPORT_TYPE enumerator value that identifies the report type.
- LinkCollection
[in] Link collection of the button usages. If LinkCollection is nonzero, the function only returns information about the buttons that this link collection contains; otherwise, if LinkCollection is zero, the function returns information about all the buttons in the top-level collection associated with PreparsedData.
- ButtonList
[out] Pointer to a caller-allocated buffer that this function uses to return the usage and usage page identifiers for each button that is set to On (one).
- UsageLength
[in, out] On input, the length in array elements of the ButtonList buffer. On output, the number of usages that are currently set to On in the specified report.
- PreparsedData
[in] Pointer to a top-level collection's preparsed data.
- Report
[in] Pointer to a report that contains button data.
- ReportLength
[in] Length, in bytes, of the report located at Report.
Return Value
The following table shows the possible return values.
Value | Description |
---|---|
HIDP_STATUS_SUCCESS |
Function successfully returned all button usages that are set to On. |
HIDP_INVALID_REPORT_LENGTH |
Report length is not valid. |
HIDP_INVALID_REPORT_TYPE |
Specified report type is not valid. |
HIDP_STATUS_BUFFER_TOO_SMALL |
UsageList buffer is too small to hold all the usages currently set to On in the specified report. |
HIDP_STATUS_INCOMPATIBLE_REPORT_ID |
Report contains a collection with buttons on the specified usage page, but there are no such usages in the report. |
HIDP_STATUS_INVALID_PREPARSED_DATA |
Preparsed data is not valid. |
Remarks
The terms button and usage are used synonymously.
HID clients call HidP_MaxUsageListLength to determine the maximum number of buttons that this function can return for a specified report type. Alternatively, applications or drivers can call HidP_GetUsagesEx and set UsageList to zero to return the required length in UsageLength.
Applications or drivers determine the required report length from the XxxReportByteLength members in a top-level collection's HIDP_CAPS structure.
Requirements
Header | hidpi.h |
Library | Hidparse_lib.lib |
Windows Embedded CE | Windows CE .NET 4.2 and later |
See Also
Reference
HID Parser Functions
HIDP_CAPS
HidP_GetButtons
HidP_GetButtonsEx
HidP_GetCaps
HidP_GetScaledUsageValue
HidP_GetUsageValue
HidP_GetUsageValueArray
HidP_MaxUsageListLength
HIDP_REPORT_TYPE
USAGE_AND_PAGE