Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
HidP_GetScaledUsageValue

HidP_GetScaledUsageValue routine

The HidP_GetScaledUsageValue routine returns the signed and scaled result of a HID control value extracted from a HID report.

Syntax


NTSTATUS __stdcall HidP_GetScaledUsageValue(
  _In_  HIDP_REPORT_TYPE     ReportType,
  _In_  USAGE                UsagePage,
  _In_  USHORT               LinkCollection,
  _In_  USAGE                Usage,
  _Out_ PLONG                UsageValue,
  _In_  PHIDP_PREPARSED_DATA PreparsedData,
  _In_  PCHAR                Report,
  _In_  ULONG                ReportLength
);

Parameters

ReportType [in]

Specifies a HIDP_REPORT_TYPE enumerator value that identifies the type of HID report that contains the HID usage value.

UsagePage [in]

Specifies the usage page of the value to extract.

LinkCollection [in]

Specifies the link collection identifier of the value to extract. A LinkCollection value of zero identifies the top-level collection.

Usage [in]

Specifies the usage of the value to extract.

UsageValue [out]

Pointer to the buffer in which the routine returns the signed and scaled value.

PreparsedData [in]

Pointer to the preparsed data of the top-level collection that generated the report located at Report.

Report [in]

Pointer to the report that contains the usage.

ReportLength [in]

Specifies the length, in bytes, of the report located at Report.

Return value

HidP_GetScaledUsageValue returns one of the following status values:

Return codeDescription
HIDP_STATUS_SUCCESS

The routine successfully returned the value.

HIDP_STATUS_INVALID_REPORT_TYPE

The specified report type is not valid.

HIDP_STATUS_INVALID_REPORT_LENGTH

The specified report length is not valid

HIDP_STATUS_BAD_LOG_PHY_VALUES

The collection returned an illegal logical or physical value. To extract the value returned by the collection, call HidP_GetUsageValue.

HIDP_STATUS_NULL

The current state of the scaled value from the collection is less than the logical minimum or is greater than the logical maximum, and the scaled value has a NULL state.

HIDP_STATUS_VALUE_OUT_OF_RANGE

The current state of the scaled value data from the collection is less than the logical minimum or is greater than the logical maximum.

HIDP_STATUS_USAGE_NOT_FOUND

The specified usage, usage page, or link collection cannot be found in any report supported by the specified top-level collection.

HIDP_STATUS_INCOMPATIBLE_REPORT_ID

The specified value is not contained in the specified report, but is contained in another report supported by the specified top-level collection.

 

Remarks

The caller-allocated buffers supplied at PreparsedData, UsageValue, and Report must be allocated from nonpaged pool.

User-mode applications and kernel-mode drivers must use HidP_GetUsageValueArray to extract data for a usage value array.

If the routine returns status HIDP_STATUS_BAD_LOG_PHY_VALUES, an application or driver can call HidP_GetUsageValue to extract the raw usage data.

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_GetUsageValue
HidP_GetUsageValueArray

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft