EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND callback function (wdfdevice.h)

[Applies to KMDF and UMDF]

A driver's EvtDeviceSelfManagedIoSuspend event callback function suspends a device's self-managed I/O operations.

Syntax

EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND EvtWdfDeviceSelfManagedIoSuspend;

NTSTATUS EvtWdfDeviceSelfManagedIoSuspend(
  [in] WDFDEVICE Device
)
{...}

Parameters

[in] Device

A handle to a framework device object.

Return value

If the operation is successful, the EvtDeviceSelfManagedIoSuspend callback function 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 stops the device and removes its device objects.

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.

Remarks

To register an EvtDeviceSelfManagedIoSuspend callback function, a driver must call WdfDeviceInitSetPnpPowerEventCallbacks.

If the driver has registered an EvtDeviceSelfManagedIoSuspend callback function, the framework calls it for one of the following reasons:

  • The device is about to enter a low-power state.
  • The device is being removed or was surprise-removed.
  • The Plug and Play manager is about to redistribute the system's hardware resources among system's attached devices.
Because you do not know which of these events causes the framework to call your driver, you must assume that the device might return to its working (D0) state.

If the device is about to enter a low-power state, the framework calls the driver's EvtDeviceSelfManagedIoSuspend callback function before it calls the driver's EvtDeviceD0Exit callback function.

If the callback function returns a status value for which NT_SUCCESS(status) equals FALSE, and if the framework is attempting to lower the device's power, the framework stops the device and removes its device objects.

The EvtDeviceSelfManagedIoSuspend callback function must do whatever is needed to stop the device's self-managed I/O operations.

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.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfdevice.h (include Wdf.h)
IRQL PASSIVE_LEVEL

See also

EvtDeviceSelfManagedIoCleanup

EvtDeviceSelfManagedIoFlush

EvtDeviceSelfManagedIoInit

EvtDeviceSelfManagedIoRestart