Windows Driver Kit: Kernel-Mode Driver Framework
EvtDeviceSelfManagedIoInit
A driver's EvtDeviceSelfManagedIoInit event callback function initializes and starts the device's self-managed I/O operations.
EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT EvtDeviceSelfManagedIoInit;
NTSTATUS
EvtDeviceSelfManagedIoInit (
IN WDFDEVICE Device
)
{…}
You must declare the function by using the EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT type. For more information, see the following Example section.
Parameters
- Device
- A handle to a framework device object.
Return Value
If the EvtDeviceSelfManagedIoInit callback function encounters no errors, it must return STATUS_SUCCESS, or another status value for which NT_SUCCESS(status) equals TRUE. Otherwise, it must return a status value for which NT_SUCCESS(status) equals FALSE. If NT_SUCCESS(status) equals FALSE, the framework does not start the device.
If NT_SUCCESS(status) equals FALSE, the framework calls the driver's EvtDeviceSelfManagedIoFlush and EvtDeviceSelfManagedIoCleanup callback functions.
For more information about this callback function's return values, see Reporting Device Failures.
Comments
To register an EvtDeviceSelfManagedIoInit callback function, a driver must call WdfDeviceInitSetPnpPowerEventCallbacks.
If the driver has registered an EvtDeviceSelfManagedIoInit callback function, the framework calls it once for each device, after the framework has called the driver's EvtDeviceD0Entry callback function for the first time. The framework does not call the EvtDeviceSelfManagedIoInit callback function again for that device, unless the device is removed and reconnected, or the drivers are reloaded.
The EvtDeviceSelfManagedIoInit callback function must initialize and start the self-managed I/O operations that the driver will handle for the device.
For more information about when the framework calls this callback function, see PnP and Power Management Scenarios.
For more information about drivers that provide this callback function, see Using Self-Managed I/O.
Example
To define an EvtDeviceSelfManagedIoInit callback function that is named MyDeviceSelfManagedIoInit, you must first provide a function declaration that SDV and other verification tools require, as follows:
EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT MyDeviceSelfManagedIoInit;
Then, implement your callback function as follows:
NTSTATUS
MyDeviceSelfManagedIoInit (
IN WDFDEVICE Device
)
{…}
Requirements
Versions: The EvtDeviceSelfManagedIoInit callback function is supported by version 1.0 and later versions of KMDF.
IRQL: PASSIVE_LEVEL
Headers: Defined in Wdfdevice.h, as follows:
typedef NTSTATUS
(EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT)(
IN WDFDEVICE Device
);
Include Wdf.h.
See Also
EvtDeviceSelfManagedIoCleanup, EvtDeviceSelfManagedIoFlush, EvtDeviceSelfManagedIoRestart, EvtDeviceSelfManagedIoSuspend