Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Driver Kit
Reference
 EvtDeviceSelfManagedIoSuspend
Windows Driver Kit: Kernel-Mode Driver Framework
EvtDeviceSelfManagedIoSuspend

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

EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND  EvtDeviceSelfManagedIoSuspend;

NTSTATUS
  EvtDeviceSelfManagedIoSuspend (
    IN WDFDEVICE  Device
    )
  {…}

You must declare the function by using the EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND type. For more information, see the following Example section.

Parameters

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.

Comments

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 EvtDeviceSelfManagedIoSuspend 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.

Example

To define an EvtDeviceSelfManagedIoSuspend callback function that is named MyDeviceSelfManagedIoSuspend, you must first provide a function declaration that SDV and other verification tools require, as follows:

EVT_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND  MyDeviceSelfManagedIoSuspend;

Then, implement your callback function as follows:

NTSTATUS
  MyDeviceSelfManagedIoSuspend (
    IN WDFDEVICE  Device
    )
  {…}

Requirements

Versions: The EvtDeviceSelfManagedIoSuspend 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_SUSPEND)(
    IN WDFDEVICE  Device
    );

Include Wdf.h.

See Also

EvtDeviceSelfManagedIoCleanup, EvtDeviceSelfManagedIoFlush, EvtDeviceSelfManagedIoInit, EvtDeviceSelfManagedIoRestart


Send feedback on this topic
Built on November 19, 2009
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker