// hidport.h
// CTL_CODE(0x000b, 0x004, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_HID_GET_STRING 0x000B0013
View the official Windows Driver Kit DDI referenceNo description available.
The IOCTL_HID_GET_STRING request obtains a manufacturer ID, product ID, or serial number for a top-level collection. The retrieved string is a NULL-terminated wide character string in a human-readable format.
For general information about HIDClass devices, see HID Collections.
IOCTL_HID_GET_STRING makes use of two input buffers.
Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location of the IRP indicates the size, in bytes, of the locked-down output buffer at Irp->UserBuffer. If the output buffer is not large enough to hold the entire NULL-terminated embedded string, the request returns nothing in the output buffer. 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).
Parameters.DeviceIoControl.Type3InputBuffer in the I/O stack location of the IRP contains a composite value. The two most significant bytes contain the language ID of the string to be retrieved. The two least significant bytes contain one of the following three constant values:
The HID minidriver determines which of these three constants is present in the lower two bytes of the input buffer, then it must retrieve the corresponding string index from the device descriptor. Device descriptor information is stored in the device extension of a top-level collection associated with the device.
It is important not to confuse these three constants with the actual string indices of the IDs. These constants represent the offsets in the device descriptor where the corresponding string indices can be found.
For example, HID_STRING_ID_IMANUFACTURER indicates the location in the device descriptor where the index for the manufacturer ID is found. This index, in turn, serves as an offset into the string descriptor where the human-readable form of the manufacturer ID is located.
The size of the OutputBufferLength and the size of the Type3InputBuffer.
The HID minidriver fills the buffer at Irp->UserBuffer with the requested string (a NULL-terminated wide character string).
The size of the UserBuffer.
HID minidrivers that carry out the I/O to the device set the following fields of Irp->IoStatus:
HID minidrivers that call other drivers with this IOCTL to carry out the I/O to their device, should ensure that the Information field of the status block is correct and not change the contents of the Status field.
IOCTL_HID_GET_MANUFACTURER_STRING
IOCTL_HID_GET_SERIALNUMBER_STRING