The USBD_AssignUrbToIoStackLocation routine is called by a client driver to associate an URB with the IRP's next stack location.
void USBD_AssignUrbToIoStackLocation( _In_ USBD_HANDLE USBDHandle, _In_ PIO_STACK_LOCATION StackLocation, _In_ PURB Urb );
- USBDHandle [in]
A USBD handle that is retrieved in a previous call to the USBD_CreateHandle routine.
- StackLocation [in]
- Urb [in]
This routine does not return a value.
If the client driver allocated an URB by calling USBD_UrbAllocate, USBD_IsochUrbAllocate, USBD_SelectConfigUrbAllocateAndBuild, or USBD_SelectInterfaceUrbAllocateAndBuild, then the driver must call USBD_AssignUrbToIoStackLocation to associate the URB with IO_STACK_LOCATION associated with the IRP. For URBs that are allocated by those routines, USBD_AssignUrbToIoStackLocation replaces setting Parameters.Others.Argument1 of IO_STACK_LOCATION to the URB. (see IOCTL_INTERNAL_USB_SUBMIT_URB).
The client driver must not call USBD_AssignUrbToIoStackLocation for an URB that is allocated by using other mechanisms, such as allocating the URB on the stack. Otherwise, the USB driver stack generates a bugcheck.
The client driver must call USBD_AssignUrbToIoStackLocation before calling IoCallDriver to send the request. USBD_AssignUrbToIoStackLocation populates the IRP's next stack location with the URB. The routine also updates the FileObject member of IO_STACK_LOCATION.
For a code example, see How to Submit an URB.
|Requires WDK for Windows 8. Targets Windows Vista and later versions of the Windows operating system.|
- How to Submit an URB
Build date: 11/16/2013