Export (0) Print
Expand All

HidP_GetData routine

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 __stdcall HidP_GetData(
  _In_     HIDP_REPORT_TYPE ReportType,
  _Out_    PHIDP_DATA DataList,
  _Inout_  PULONG DataLength,
  _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 HID report located at Report.

DataList [out]

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.

DataLength [in, out]

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.

PreparsedData [in]

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

Report [in]

Pointer to a HID report.

ReportLength [in]

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 codeDescription
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

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_DATA
HidP_MaxDataListLength
HidP_SetData

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft