WdfUsbTargetDeviceIsConnectedSynchronous function (wdfusb.h)

[Applies to KMDF only]

The WdfUsbTargetDeviceIsConnectedSynchronous method determines if the specified USB device is connected.

Syntax

NTSTATUS WdfUsbTargetDeviceIsConnectedSynchronous(
  [in] WDFUSBDEVICE UsbDevice
);

Parameters

[in] UsbDevice

A handle to a USB device object that was obtained from a previous call to WdfUsbTargetDeviceCreateWithParameters.

Return value

WdfUsbTargetDeviceIsConnectedSynchronous returns the I/O target's completion status value if the operation succeeds. Otherwise, this method can return one of the following values:

Return code Description
STATUS_INVALID_PARAMETER
An invalid parameter was detected.
STATUS_INVALID_DEVICE_REQUEST
The caller's IRQL was invalid.
STATUS_DEVICE_NOT_CONNECTED or STATUS_DEVICE_DOES_NOT_EXIST
The device was not connected.
 

This method also might return other NTSTATUS values.

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

Remarks

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

Examples

The following code example determines if a specified USB device is connected.

NTSTATUS status;

status = WdfUsbTargetDeviceIsConnectedSynchronous(UsbDevice);

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Header wdfusb.h (include Wdfusb.h)
Library Wdf01000.sys (see Framework Library Versioning.)
IRQL PASSIVE_LEVEL
DDI compliance rules DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), UsbKmdfIrql(kmdf), UsbKmdfIrql2(kmdf), UsbKmdfIrqlExplicit(kmdf)

See also

WdfUsbTargetDeviceCreateWithParameters