Bewerken

Delen via


EVT_WDF_DEVICE_SURPRISE_REMOVAL callback function (wdfdevice.h)

[Applies to KMDF and UMDF]

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.

Syntax

EVT_WDF_DEVICE_SURPRISE_REMOVAL EvtWdfDeviceSurpriseRemoval;

void EvtWdfDeviceSurpriseRemoval(
  [in] WDFDEVICE Device
)
{...}

Parameters

[in] Device

A handle to a framework device object.

Return value

None

Remarks

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

The framework does not synchronize the EvtDeviceSurpriseRemoval callback function with other PnP and power management callback functions. For information about how the framework synchronizes the execution of a driver's event callback functions, see Using Automatic Synchronization.

For more information about when the framework calls this callback function, and for more information about synchronization issues, see A User Unplugs a Device.

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