Share via


HidP_GetScaledUsageValue

This function returns the signed and scaled result of a HID control value extracted from a HID report.

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

Parameters

  • ReportType
    [in] HIDP_REPORT_TYPE enumerator value that identifies the type of HID report that contains the HID usage value.
  • UsagePage
    [in] Usage page of the value to extract.
  • LinkCollection
    [in] Optional. Link collection identifier of the value to extract. A LinkCollection value of zero identifies the top-level collection.
  • Usage
    [in] Usage of the value to extract.
  • UsageValue
    [out] Pointer to the buffer in which the function 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] Length, in bytes, of the report located at Report.

Return Values

The following table shows the possible return values for this function.

Value Description
HIDP_STATUS_SUCCESS Function successfully returned the value.
HIDP_STATUS_INVALID_REPORT_TYPE Specified report type was not valid.
HIDP_STATUS_INVALID_REPORT_LENGTH Specified report length was not valid
HIDP_STATUS_BAD_LOG_PHY_VALUES Collection returned an illegal logical or physical value. To extract the value returned by the collection, call HidP_GetUsageValue.
HIDP_STATUS_NULL Current state of the scaled value from the collection was less than the logical minimum or was greater than the logical maximum, and the scaled value had a NULL state.
HIDP_STATUS_VALUE_OUT_OF_RANGE Current state of the scaled value data from the collection was less than the logical minimum or was greater than the logical maximum.
HIDP_STATUS_USAGE_NOT_FOUND Specified usage, usage page, or link collection could note be found in any report supported by the specified top-level collection.
HIDP_STATUS_INCOMPATIBLE_REPORT_ID Specified value was not contained in the specified report, but was contained in another report supported by the specified top-level collection.

Remarks

The terms button and usage are used synonymously.

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

HID clients must use HidP_GetUsageValueArray to extract data for a usage value array.

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

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Hidpi.h.
Link Library: Hidparse_lib.lib.

See Also

HID Drivers | HidP_GetUsageValue | HidP_GetUsageValueArray | HIDP_REPORT_TYPE

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.