Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Driver Kit
Reference
 EvtDeviceSurpriseRemoval

  Switch on low bandwidth view
Windows Driver Kit: Kernel-Mode Driver Framework
EvtDeviceSurpriseRemoval

A driver's EvtDeviceSurpriseRemoval event callback function performs any operations that are needed after a device has been unexpectedly removed from the system or after a driver reports that the device has failed.

EVT_WDF_DEVICE_SURPRISE_REMOVAL  EvtDeviceSurpriseRemoval;

VOID
  EvtDeviceSurpriseRemoval (
    IN WDFDEVICE  Device
    )
  {…}

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

Parameters

Device
A handle to a framework device object.

Return Value

None

Comments

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

For more information about when the framework calls this callback, see A User Unplugs a Device.

Example

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

EVT_WDF_DEVICE_SURPRISE_REMOVAL  MyDeviceSurpriseRemoval;

Then, implement your callback function as follows:

VOID
  MyDeviceSurpriseRemoval (
    IN WDFDEVICE  Device
    )
  {…}

Requirements

Versions: The EvtDeviceSurpriseRemoval callback function is supported by version 1.0 and later versions of KMDF.

IRQL: PASSIVE_LEVEL

Headers: Defined in Wdfdevice.h, as follows:

typedef VOID
  (EVT_WDF_DEVICE_SURPRISE_REMOVAL)(
    IN WDFDEVICE Device
    );

Include Wdf.h.

See Also


Send feedback on this topic
Built on May 20, 2009
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker