Export (0) Print
Expand All

HidP_GetExtendedAttributes routine

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

Syntax


NTSTATUS __stdcall HidP_GetExtendedAttributes(
  _In_     HIDP_REPORT_TYPE ReportType,
  _In_     USHORT DataIndex,
  _In_     PHIDP_PREPARSED_DATA PreparsedData,
  _Out_    PHIDP_EXTENDED_ATTRIBUTES Attributes,
  _Inout_  PULONG LengthAttributes
);

Parameters

ReportType [in]

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

DataIndex [in]

Specifies the data index of the HID control.

PreparsedData [in]

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

Attributes [out]

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

LengthAttributes [in, out]

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

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_EXTENDED_ATTRIBUTES
HIDP_UNKNOWN_TOKEN

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft