HidP_UnsetUsages routine

The HidP_UnsetUsages routine sets specified HID control button usages OFF (zero) in a HID report.

Syntax


NTSTATUS __stdcall HidP_UnsetUsages(
  _In_     HIDP_REPORT_TYPE     ReportType,
  _In_     USAGE                UsagePage,
  _In_opt_ USHORT               LinkCollection,
  _Inout_  PUSAGE               UsageList,
  _Inout_  PULONG               UsageLength,
  _In_     PHIDP_PREPARSED_DATA PreparsedData,
  _In_     PCHAR                Report,
  _In_     ULONG                ReportLength
);

Parameters

ReportType [in]

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

UsagePage [in]

Specifies the usage page of the usages specified by UsageList.

LinkCollection [in, optional]

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 usage it finds in the top-level collection associated with PreparsedData.

UsageList [in, out]

Pointer to the array of usages to set to OFF.

UsageLength [in, out]

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

PreparsedData [in]

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

Report [in]

Pointer to a report.

ReportLength [in]

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_UnsetUsages returns HIDP_STATUS_SUCCESS if it successfully sets to OFF all the usages in UsageList.

HidP_UnsetUsages returns one of the following status values if one of the input parameters is not valid:

Return codeDescription
HIDP_STATUS_INVALID_PREPARSED_DATA

The preparsed data specified by PreparsedData is not valid.

HIDP_STATUS_INVALID_REPORT_LENGTH

The report length is not valid.

HIDP_STATUS_INVALID_REPORT_TYPE

The report type is not valid.

HIDP_STATUS_REPORT_DOES_NOT_EXIST

The collection does not contain a report of the specified type.

 

HidP_UnsetUsages returns one of the following status values if it was not able to set to OFF one of the usages in UsageList:

Return codeDescription
HIDP_STATUS_BUTTON_NOT_PRESSED

A usage is already set to OFF.

HIDP_STATUS_INCOMPATIBLE_REPORT_ID

A usage is not contained in the specified report, but is contained in another report of the specified type.

HIDP_STATUS_USAGE_NOT_FOUND

The routine did not find a usage in any report of the specified type.

 

Remarks

HidP_UnsetUsages sets UsageLength as follows:

ReportType, PreparsedData, Report, or ReportLength is not valid.

The input value is unchanged.

All usages are successfully set to OFF.

The input value is unchanged.

A usage could not be set to OFF.

Set to the index of the usage in UsageList that caused the error.

For more information, see HID Collections.

Requirements

Target platform

Universal

Version

Available in Windows 2000 and later versions of Windows.

Header

Hidpi.h (include Hidpi.h)

Library

Hidparse.lib

IRQL

<=DISPATCH_LEVEL

See also

_HIDP_PREPARSED_DATA
HidP_SetButtons
HidP_SetData
HidP_SetUsages
HidP_UnsetButtons

 

 

Send comments about this topic to Microsoft

Show: