USBD_IsochUrbAllocate function

The USBD_IsochUrbAllocate routine allocates and formats a URB structure for an isochronous transfer request.

Note for Windows Driver Framework (WDF) Drivers: If your client driver is a WDF-based driver, then you must call the WdfUsbTargetDeviceCreateIsochUrb method instead of USBD_IsochUrbAllocate to allocate memory for the URB structure.

Syntax

NTSTATUS USBD_IsochUrbAllocate(
  USBD_HANDLE USBDHandle,
  ULONG       NumberOfIsochPacket,
  PURB        *Urb
);

Parameters

USBDHandle

USBD handle that is retrieved by the client driver in a previous call to the USBD_CreateHandle routine.

NumberOfIsochPacket

Specifies the maximum number of isochronous packets required to perform the transfer. The transfer buffer is described in a variable-length array of USBD_ISO_PACKET_DESCRIPTOR structures that stores information about each packet, such as byte offset of the packet within the buffer. The array is specified in the IsoPacket member of the _URB_ISOCH_TRANSFER structure, which is used to define the format of an isochronous request URB.

Urb

Pointer to an URB structure, which receives the URB allocated by USBD_IsochUrbAllocate. All members of the URB structure are set to zero. The allocated URB is large enough to hold the maximum number of isochronous packets indicated by NumberOfIsochPacket.

The client driver must free the URB when the driver has finished using it by calling USBD_UrbFree.

Return Value

The USBD_IsochUrbAllocate routine returns STATUS_SUCCESS if the request is successful. Otherwise, USBD_UrbAllocate sets Urb to NULL and returns an NT status failure code.

Possible values include, but are not limited to, STATUS_INVALID_PARAMETER, which indicates the caller passed in NULL to USBDHandle or Urb.

Requirements

   
Windows version Requires WDK for Windows 8. Targets Windows Vista and later versions of the Windows operating system.
Target Platform Desktop
Header usbdlib.h
Library Usbdex.lib
IRQL "<=DISPATCH_LEVEL"

See Also

Allocating and Building URBs

How to Transfer Data to USB Isochronous Endpoints

USBD_ISO_PACKET_DESCRIPTOR

_URB_ISOCH_TRANSFER