WdfDeviceGetIoTarget function (wdfdevice.h)
[Applies to KMDF and UMDF]
The WdfDeviceGetIoTarget method returns a handle to a function or filter driver's local I/O target, for a specified device.
WDFIOTARGET WdfDeviceGetIoTarget( WDFDEVICE Device );
[in] A handle to a framework device object.
If the operation succeeds, WdfDeviceGetIoTarget returns a handle to a framework I/O target object. If the specified framework device object represents a PDO, the method returns NULL.
A bug check occurs if the driver supplies an invalid object handle.
When a UMDF driver sends a driver-created request to a local I/O target, the request has no associated file object. Some lower targets, such as a HIDClass-enumerated raw PDO, fail requests that have no associated file object. In this situation, a UMDF driver can specify WdfIoTargetOpenLocalTargetByFile to create an I/O target that represents the lower stack (just like a local target) using a file handle. As a result, any driver-created requests sent to this I/O target are associated with the file object corresponding to the handle opened.
For more information about I/O targets, see Using I/O Targets.
The following code example obtains a handle to a specified device's local I/O target.
WDFIOTARGET ioTargetHandle; ioTargetHandle = WdfDeviceGetIoTarget(device);
|Minimum KMDF version||1.0|
|Minimum UMDF version||2.0|
|Header||wdfdevice.h (include Wdf.h)|
|Library||Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)|
|DDI compliance rules||DriverCreate, KmdfIrql, KmdfIrql2|