HidP_GetData function (hidpi.h)

The HidP_GetData routine returns, for a specified report, an array of HIDP_DATA structures that identify the data indices of all HID control buttons that are currently set to ON (1), and the data indices and data associated with all HID control values.

Syntax

NTSTATUS HidP_GetData(
  [in]      HIDP_REPORT_TYPE     ReportType,
  [out]     PHIDP_DATA           DataList,
  [in, out] PULONG               DataLength,
  [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 HID report located at Report.

[out] DataList

Specifies a caller-allocated array of HIDP_DATA structures that the routine uses to return information about all the buttons that are currently set to ON and the data associated with values.

[in, out] DataLength

Specifies, on input, the number of structures that the caller-allocated DataList array holds. Specifies, on output, the number of controls for which the routine can return data, which includes all buttons that are currently set to ON and all control values.

[in] PreparsedData

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

[in] Report

Pointer to a HID report.

[in] ReportLength

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

Return value

HidP_GetData returns one of the following status values:

Return code Description
HIDP_STATUS_SUCCESS
All the control data was successfully returned.
HIDP_STATUS_INVALID_REPORT_TYPE
The report type specified by ReportType is not valid
HIDP_STATUS_INVALID_PREPARSED_DATA
The preparsed data specified by PreparsedData is not valid
HIDP_STATUS_INVALID_REPORT_LENGTH
The size, in bytes, of the HID report is not equal to the length specified in the collection's HIDP_CAPS structure for the specified report type.
HIDP_STATUS_REPORT_DOES_NOT_EXIST
The top-level collection does not have a report of the specified type.
HIDP_STATUS_BUFFER_TOO_SMALL
The DataList array is too small to describe all the buttons, currently set to ON, and all the values in the HID report.

Remarks

User-mode applications and kernel-mode drivers call HidP_MaxDataListLength to determine the maximum possible number of HIDP_DATA structures that HidP_GetData can return.

HidP_GetData does not return data for usage value arrays.

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_DATA

HidP_MaxDataListLength

HidP_SetData

_HIDP_PREPARSED_DATA