Collapse the table of content
Expand the table of content
Expand Minimize

UsbBuildGetDescriptorRequest macro

The UsbBuildGetDescriptorRequest macro formats an URB with the parameters necessary to obtain descriptor information from the host controller driver (HCD).


void UsbBuildGetDescriptorRequest(
  [in, out]      PURB   Urb,
  [in]           USHORT Length,
  [in]           UCHAR  DescriptorType,
  [in]           UCHAR  Index,
  [in]           USHORT LanguageId,
  [in, optional] PVOID  TransferBuffer,
  [in, optional] PMDL   TransferBufferMDL,
  [in]           ULONG  TransferBufferLength,
  [in]           PURB   Link


Urb [in, out]

Pointer to an URB to be formatted for a get descriptor request to the HCD. The caller must allocate nonpaged pool for this URB.

Length [in]

Specifies the size, in bytes, of the URB.

DescriptorType [in]

Specifies one of the following values:




Index [in]

Specifies the device-defined index of the descriptor that is to be retrieved.

LanguageId [in]

Specifies the language ID of the descriptor to be retrieved when USB_STRING_DESCRIPTOR_TYPE is set in DescriptorType. This parameter must be zero for any other value in DescriptorType.

TransferBuffer [in, optional]

Pointer to a resident buffer to receive the descriptor data or is NULL if an MDL is supplied in TransferBufferMDL.

TransferBufferMDL [in, optional]

Pointer to an MDL that describes a resident buffer to receive the descriptor data or is NULL if a buffer is supplied in TransferBuffer.

TransferBufferLength [in]

Specifies the length of the buffer specified in TransferBuffer or described in TransferBufferMDL.

Link [in]

Reserved. Must be set to NULL.

Return value

This macro does not return a value.


This macro is defined in usblib.h. When USB_CONFIGURATION_DESCRIPTOR_TYPE is specified for DescriptorType, all interface, endpoint, class-specific, and vendor-specific descriptors for the configuration also are retrieved. The caller must allocate a buffer large enough to hold all of this information or the data is truncated without error.


Target platform

Desktop, introduced version 10.0.10030.0


Usbdlib.h (include Usbdlib.h)

See also

Routines for USB Client Drivers



Send comments about this topic to Microsoft

© 2015 Microsoft