WdfIoTargetGetDevice function (wdfiotarget.h)

[Applies to KMDF and UMDF]

The WdfIoTargetGetDevice method returns a handle to the framework device object that is the parent of the specified local or remote I/O target.

Syntax

WDFDEVICE WdfIoTargetGetDevice(
  [in] WDFIOTARGET IoTarget
);

Parameters

[in] IoTarget

A handle to an I/O target object. This handle is obtained from WdfDeviceGetIoTarget, WdfIoTargetCreate, or from a method that a specialized I/O target supplies (such as WdfUsbTargetDeviceGetIoTarget).

Return value

WdfIoTargetGetDevice returns a handle to a framework device object.

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

Remarks

For more information about WdfIoTargetGetDevice, see Obtaining Information About a General I/O Target.

For more information about I/O targets, see Using I/O Targets.

Examples

The following code example is shows how an EvtIoTargetQueryRemove callback function can call WdfIoTargetGetDevice.

NTSTATUS
MyEvtIoTargetQueryRemove(
    WDFIOTARGET IoTarget
)
{
WDFDEVICE device;
...
device = WdfIoTargetGetDevice(IoTarget);
...
}

Requirements

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

See also

WdfDeviceGetIoTarget

WdfIoTargetCreate

WdfUsbTargetDeviceGetIoTarget