WdfUsbTargetPipeWdmGetPipeHandle - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfusb.h

USBD_PIPE_HANDLE WdfUsbTargetPipeWdmGetPipeHandle(
  [in] WDFUSBPIPE UsbPipe
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfusb-wdfusbtargetpipewdmgetpipehandle)

WdfUsbTargetPipeWdmGetPipeHandle function

Description

[Applies to KMDF only]

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

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);

See also

URB

WdfUsbInterfaceGetConfiguredPipe

WdfUsbTargetDeviceSelectConfig