UsbBuildInterruptOrBulkTransferRequest macro (usbdlib.h)

The UsbBuildInterruptOrBulkTransferRequest macro formats an URB to send or receive data on a bulk pipe, or to receive data from an interrupt pipe.

Syntax

void UsbBuildInterruptOrBulkTransferRequest(
  [in, out]       urb,
  [in]            length,
  [in]            pipeHandle,
  [in, optional]  transferBuffer,
  [in, optional]  transferBufferMDL,
  [in]            transferBufferLength,
  [in]            transferFlags,
  [in]            link
);

Parameters

[in, out] urb

Pointer to an URB to be formatted as an interrupt or bulk transfer request.

[in] length

Specifies the size, in bytes, of the URB.

[in] pipeHandle

Specifies the handle for this pipe returned by the HCD when a configuration was selected.

[in, optional] transferBuffer

Pointer to a resident buffer for the transfer or is NULL if an MDL is supplied in TransferBufferMDL. The contents of this buffer depend on the value of TransferFlags. If USBD_TRANSFER_DIRECTION_IN is specified, this buffer will contain data read from the device on return from the HCD. Otherwise, this buffer contains driver-supplied data to be transferred to the device.

[in, optional] transferBufferMDL

Pointer to an MDL that describes a resident buffer or is NULL if a buffer is supplied in TransferBuffer. The contents of the buffer depend on the value of TransferFlags. If USBD_TRANSFER_DIRECTION_IN is specified, the described buffer will contain data read from the device on return from the HCD. Otherwise, the buffer contains driver-supplied data to be transferred to the device. The MDL must be allocated from nonpaged pool.

[in] transferBufferLength

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

[in] transferFlags

Specifies zero, one, or a combination of the following flags:

USBD_TRANSFER_DIRECTION_IN

Is set to request data from a device. To transfer data to a device, this flag must be clear.

USBD_SHORT_TRANSFER_OK

Can be used if USBD_TRANSFER_DIRECTION_IN is set. If set, directs the HCD not to return an error if a packet is received from the device that is shorter than the maximum packet size for the endpoint. Otherwise, a short request returns an error condition.

[in] link

Reserved. Must be set to NULL.

Return value

None

Requirements

Requirement Value
Target Platform Desktop
Header usbdlib.h (include Usbdlib.h)

See also

URB

USB device driver programming reference

USB_DEVICE_DESCRIPTOR