// wdfdevice.h
EVT_WDF_DEVICE_SURPRISE_REMOVAL EvtWdfDeviceSurpriseRemoval;
VOID EvtWdfDeviceSurpriseRemoval(
[in] WDFDEVICE Device
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
[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.
Device [in]A handle to a framework device object.
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.