Expand Minimize

USBD_AssignUrbToIoStackLocation routine

The USBD_AssignUrbToIoStackLocation routine is called by a client driver to associate an URB with the IRP's next stack location.

Syntax


void USBD_AssignUrbToIoStackLocation(
  _In_  USBD_HANDLE USBDHandle,
  _In_  PIO_STACK_LOCATION StackLocation,
  _In_  PURB Urb
);

Parameters

USBDHandle [in]

A USBD handle that is retrieved in a previous call to the USBD_CreateHandle routine.

StackLocation [in]

Pointer to the IRP's next stack location (IO_STACK_LOCATION). The client driver received a pointer to the stack location in a previous call to IoGetNextIrpStackLocation.

Urb [in]

Pointer to the URB structure that is allocated by USBD_UrbAllocate, USBD_IsochUrbAllocate, USBD_SelectConfigUrbAllocateAndBuild, or USBD_SelectInterfaceUrbAllocateAndBuild.

Return value

This routine does not return a value.

Remarks

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.

Requirements

Version

Requires WDK for Windows 8. Targets Windows Vista and later versions of the Windows operating system.

Header

Usbdlib.h

Library

Usbdex.lib

IRQL

<=DISPATCH_LEVEL

See also

USBD_UrbAllocate
USBD_IsochUrbAllocate
USBD_SelectConfigUrbAllocateAndBuild
USBD_SelectInterfaceUrbAllocateAndBuild
How to Submit an URB

 

 

Send comments about this topic to Microsoft

Build date: 12/5/2013

Show:
© 2014 Microsoft. All rights reserved.