WdfUsbInterfaceGetConfiguredPipe function (wdfusb.h)

[Applies to KMDF and UMDF]

The WdfUsbInterfaceGetConfiguredPipe method returns a handle to the framework pipe object that is associated with a specified USB device interface and pipe index. Optionally, the method also returns information about the pipe.

Syntax

WDFUSBPIPE WdfUsbInterfaceGetConfiguredPipe(
  [in]                WDFUSBINTERFACE           UsbInterface,
  [in]                UCHAR                     PipeIndex,
  [in, out, optional] PWDF_USB_PIPE_INFORMATION PipeInfo
);

Parameters

[in] UsbInterface

A handle to a USB interface object that was obtained by calling WdfUsbTargetDeviceGetInterface.

[in] PipeIndex

A zero-based index into the set of framework pipe objects that are associated with the specified interface object.

[in, out, optional] PipeInfo

A pointer to a caller-allocated WDF_USB_PIPE_INFORMATION structure that the framework fills in. This parameter is optional and can be NULL.

Return value

If the operation succeeds, WdfUsbInterfaceGetConfiguredPipe returns a handle to the framework pipe object that is associated with the specified interface object and pipe index. The method returns NULL if the WDF_USB_PIPE_INFORMATION structure's size is incorrect or if the pipe index value is too large.

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

Remarks

Your driver can call WdfUsbInterfaceGetConfiguredPipe after it has called WdfUsbTargetDeviceSelectConfig.

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

Examples

The following code example sends a USB abort request to each configured pipe of a specified USB interface.

BYTE  count, i;
NTSTATUS  status;

count = WdfUsbInterfaceGetNumConfiguredPipes(UsbInterface);

for (i = 0; i < count; i++) {
    WDFUSBPIPE pipe;
    pipe = WdfUsbInterfaceGetConfiguredPipe(
                                            UsbInterface,
                                            i,
                                            NULL
                                            );
    status = WdfUsbTargetPipeAbortSynchronously(
                                            pipe,
                                            WDF_NO_HANDLE,
                                            NULL
                                            );

    if (!NT_SUCCESS(status)) {
        break;
    }
}

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfusb.h (include Wdfusb.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL <=DISPATCH_LEVEL
DDI compliance rules DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), UsbKmdfIrql(kmdf), UsbKmdfIrql2(kmdf), UsbKmdfIrqlExplicit(kmdf)

See also

WDF_USB_PIPE_INFORMATION

WdfUsbInterfaceGetNumConfiguredPipes

WdfUsbTargetDeviceGetInterface

WdfUsbTargetDeviceSelectConfig