Bewerken

Delen via


HidP_GetExtendedAttributes function (hidpi.h)

The HidP_GetExtendedAttributes routine returns the extended attributes of a HID control.

Syntax

NTSTATUS HidP_GetExtendedAttributes(
  [in]      HIDP_REPORT_TYPE          ReportType,
  [in]      USHORT                    DataIndex,
  [in]      PHIDP_PREPARSED_DATA      PreparsedData,
  [out]     PHIDP_EXTENDED_ATTRIBUTES Attributes,
  [in, out] PULONG                    LengthAttributes
);

Parameters

[in] ReportType

Specifies a HIDP_REPORT_TYPE enumerator value that indicates the type of HID report associated with the HID control specified by DataIndex.

[in] DataIndex

Specifies the data index of the HID control.

[in] PreparsedData

Specifies the preparsed data for the top-level collection that contains the specified control.

[out] Attributes

Pointer to a caller-allocated buffer that the routine uses to return the extended attributes of the control specified by DataIndex.

[in, out] LengthAttributes

Specifies the size, in bytes, of the Attributes buffer (which must be greater than or equal to sizeof(HIDP_EXTENDED_ATTRIBUTES).

Return value

HidP_GetExtendedAttributes returns one of the following status values:

Return code Description
HIDP_STATUS_SUCCESS
The routine successfully returned all the control's extended attribute information.
HIDP_STATUS_BUFFER_TOO_SMALL
The Attribute buffer was not large enough to hold all the extended attribute information.
HIDP_STATUS_DATA_INDEX_NOT_FOUND
The specified data index is not valid.

Remarks

HidP_GetExtendedAttributes returns a variable length HIDP_EXTENDED_ATTRIBUTES structure in the Attribute buffer. The extended attributes structure contains, in consecutive order, the fixed length members (NumGlobalUnknowns, Reserved, and GlobalUnknowns) followed by a variable length array of HIDP_UNKNOWN_TOKEN structures. The first member of the unknown token array is located at (PHIDP_UNKNOWN_TOKEN*)&(Attributes->Data).

The routine returns as many bytes of the extended attribute information as the Attribute buffer can hold. If the buffer is too small, the routine truncates the information it returns. To determine the number of unknown tokens in the variable length array, a caller can first use the Attributes buffer to return the value of the NumGlobalUnknowns member of the extended attributes information.

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_EXTENDED_ATTRIBUTES

HIDP_UNKNOWN_TOKEN

_HIDP_PREPARSED_DATA