Windows Driver Kit: Kernel-Mode Driver Framework
WdfUsbInterfaceGetConfiguredPipe
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.
WDFUSBPIPE
WdfUsbInterfaceGetConfiguredPipe(
IN WDFUSBINTERFACE UsbInterface,
IN UCHAR PipeIndex,
OUT OPTIONAL PWDF_USB_PIPE_INFORMATION PipeInfo
);
Parameters
- UsbInterface
- A handle to a USB interface object that was obtained by calling WdfUsbTargetDeviceGetInterface.
- PipeIndex
- A zero-based index into the set of framework pipe objects that are associated with the specified interface object.
- 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 a driver-supplied object handle is invalid.
Comments
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.
Example
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
Versions: The WdfUsbInterfaceGetConfiguredPipe method is available in version 1.0 and later versions of KMDF.
IRQL: <=DISPATCH_LEVEL
Headers: Declared in Wdfusb.h. Include Wdfusb.h.
Library: See Framework Library Versions.
See Also
WDF_USB_PIPE_INFORMATION,
WdfUsbInterfaceGetNumConfiguredPipes, WdfUsbTargetDeviceGetInterface, WdfUsbTargetDeviceSelectConfig