Compartilhar via


UsbBuildGetDescriptorRequest macro

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

Syntax

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
);

Parameters

  • 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:

    USB_DEVICE_DESCRIPTOR_TYPE

    USB_CONFIGURATION_DESCRIPTOR_TYPE

    USB_STRING_DESCRIPTOR_TYPE

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.

Remarks

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.

Requirements

Target platform

Desktop

Header

Usbdlib.h (include Usbdlib.h)

See also

URB

USB_DEVICE_DESCRIPTOR

USB device driver programming reference

 

 

Send comments about this topic to Microsoft