HidP_SetUsages function (hidpi.h)

The HidP_SetUsages routine sets specified HID control buttons ON (1) in a HID report.

Syntax

NTSTATUS HidP_SetUsages(
  [in]      HIDP_REPORT_TYPE     ReportType,
  [in]      USAGE                UsagePage,
  [in]      USHORT               LinkCollection,
  [in, out] PUSAGE               UsageList,
  [in, out] PULONG               UsageLength,
  [in]      PHIDP_PREPARSED_DATA PreparsedData,
  [in]      PCHAR                Report,
  [in]      ULONG                ReportLength
);

Parameters

[in] ReportType

Specifies a HIDP_REPORT_TYPE enumerator value that indicates the type of report located at Report.

[in] UsagePage

Specifies the usage page for the usages specified by UsageList.

[in] LinkCollection

Specifies the link collection that contains the usages. If LinkCollection is nonzero, the routine only sets the usages, if they exist, in this link collection. If LinkCollection is zero, the routine sets the first usage for each specified usage in the top-level collection associated with PreparsedData.

[in, out] UsageList

Pointer to the array of usages.

[in, out] UsageLength

Specifies, on input, the number of usages in UsageList. See the Remarks section for information about the output value.

[in] PreparsedData

Pointer to the preparsed data of the top-level collection associated with the report located at Report.

[in] Report

Pointer to a report.

[in] ReportLength

Specifies the size, in bytes, of the report located at Report, which must be equal to the report length for the specified report type that HidP_GetCaps returns in a collection's HIDP_CAPS structure.

Return value

HidP_SetUsages returns one of the following status values:

Return code Description
HIDP_STATUS_SUCCESS
The routine successfully set the usage value.
HIDP_STATUS_BUFFER_TOO_SMALL
A usage in a button array cannot be set because the array is already fully set.
HIDP_STATUS_INVALID_REPORT_LENGTH
The report length is not valid.
HIDP_STATUS_INVALID_REPORT_TYPE
The specified report type is not valid.
HIDP_STATUS_INCOMPATIBLE_REPORT_ID
A usage does not exist in the specified report, but it does exist in a different report of the specified type.
HIDP_STATUS_INVALID_PREPARSED_DATA
The preparsed data is not valid.
HIDP_STATUS_USAGE_NOT_FOUND
A usage does not exist in any report of the specified report type.

Remarks

If HidP_SetUsages cannot set a usage in UsageList, the routine sets UsageLength to the index of the usage that could not be set, and returns a status value that indicates the error.

For more information, see HID Collections.

Requirements

Requirement Value
Minimum supported client Available in Windows 2000 and later versions of Windows.
Target Platform Universal
Header hidpi.h (include Hidpi.h)
Library Hidparse.lib
IRQL <= DISPATCH_LEVEL

See also

HidP_GetButtons

HidP_GetUsages

HidP_SetButtons

HidP_UnsetButtons

HidP_UnsetUsages

_HIDP_PREPARSED_DATA