Expand Minimize

WdfUsbInterfaceGetConfiguredPipe method

[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,
  [out, optional]  PWDF_USB_PIPE_INFORMATION PipeInfo
);

Parameters

UsbInterface [in]

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

PipeIndex [in]

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

PipeInfo [out, optional]

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

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, KmdfIrql, KmdfIrql2, UsbKmdfIrql, UsbKmdfIrql2

See also

WDF_USB_PIPE_INFORMATION
WdfUsbInterfaceGetNumConfiguredPipes
WdfUsbTargetDeviceGetInterface
WdfUsbTargetDeviceSelectConfig

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.