Expand Minimize

WdfUsbTargetPipeWdmGetPipeHandle method

[Applies to KMDF only]

The WdfUsbTargetPipeWdmGetPipeHandle method returns the USBD_PIPE_HANDLE-typed handle that is associated with a specified framework pipe object.

Syntax


USBD_PIPE_HANDLE WdfUsbTargetPipeWdmGetPipeHandle(
  [in]  WDFUSBPIPE UsbPipe
);

Parameters

UsbPipe [in]

A handle to a framework pipe object that was obtained by calling WdfUsbInterfaceGetConfiguredPipe.

Return value

WdfUsbTargetPipeWdmGetPipeHandle returns a USBD_PIPE_HANDLE-typed handle.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

A framework-based driver needs to obtain a USBD_PIPE_HANDLE-typed handle only if it creates a URB that requires a pipe handle.

The driver can call the WdfUsbTargetPipeWdmGetPipeHandle method after it has called WdfUsbTargetDeviceSelectConfig. The USBD_PIPE_HANDLE-typed handle that WdfUsbTargetPipeWdmGetPipeHandle returns is valid until the driver calls WdfUsbTargetDeviceSelectConfig again, the driver calls WdfUsbInterfaceSelectSetting, or the framework pipe object is deleted. If the driver provides an EvtCleanupCallback function for the framework pipe object, and if the object is deleted before the driver calls WdfUsbTargetDeviceSelectConfig again or calls WdfUsbInterfaceSelectSetting, the handle is valid until the object's EvtCleanupCallback function returns.

For more information about the WdfUsbTargetPipeWdmGetPipeHandle method and USB I/O targets, see USB I/O Targets.

Examples

The following code example obtains the USBD_PIPE_HANDLE-typed handle for a specified pipe.


USBD_PIPE_HANDLE  usbdPipeHandle;

usbdPipeHandle = WdfUsbTargetPipeWdmGetPipeHandle(UsbPipe);

Requirements

Minimum KMDF version

1.0

Header

Wdfusb.h (include Wdfusb.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2, UsbKmdfIrql, UsbKmdfIrql2

See also

URB
WdfUsbInterfaceGetConfiguredPipe
WdfUsbTargetDeviceSelectConfig

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.