HidD_GetIndexedString - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// hidsdi.h

BOOLEAN HidD_GetIndexedString(
  [in]  HANDLE HidDeviceObject,
  [in]  ULONG  StringIndex,
  [out] PVOID  Buffer,
  [in]  ULONG  BufferLength
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-hidsdi-hidd_getindexedstring)

HidD_GetIndexedString function

Description

The HidD_GetIndexedString routine returns a specified embedded string from a top-level collection.

Parameters

HidDeviceObject [in]

Specifies an open handle to a top-level collection.

StringIndex [in]

Specifies the device-specific index of an embedded string.

Buffer [out]

Pointer to a caller-allocated buffer that the routine uses to return the embedded string specified by StringIndex. The routine returns a NULL-terminated wide character string in a human-readable format.

BufferLength [in]

Specifies the length, in bytes, of a caller-allocated buffer provided at Buffer. If the buffer is not large enough to return the entire NULL-terminated embedded string, the routine returns nothing in the buffer. The supplied buffer must be <= 4093 bytes (2^12 – 3).

Return value

HidD_GetIndexedString returns TRUE if it successfully returns the entire NULL-terminated embedded string. Otherwise, the routine returns FALSE. Use GetLastError to get extended error information.

Remarks

Only user-mode applications can call HidD_GetIndexedString. Kernel-mode drivers can use an IOCTL_HID_GET_INDEXED_STRING request.

The maximum possible number of characters in an embedded string is device specific. For USB devices, the maximum string length is 126 wide characters (not including the terminating NULL character).

The iProduct member of a USB_DEVICE_DESCRIPTOR structure for a particular interface is set by the USB common class generic parent driver based on the following rules:

If the supplied buffer is not <= 4093 bytes (2^12 – 3) the call may fail (depending on the underlying protocol, HID/Bluetooth/SPI) with error code ERROR_GEN_FAILURE (0x0000001f)

For more information see HID Collections.

See also

HidD_GetManufacturerString

HidD_GetPhysicalDescriptor

HidD_GetProductString

HidD_GetSerialNumberString

IOCTL_HID_GET_INDEXED_STRING

IOCTL_HID_GET_MANUFACTURER_STRING

IOCTL_HID_GET_PRODUCT_STRING

IOCTL_HID_GET_SERIALNUMBER_STRING