IPnpCallback::OnSurpriseRemoval method (wudfddi.h)

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

The OnSurpriseRemoval method notifies a driver after a device is removed from a computer unexpectedly so that the driver can perform necessary operations.

Syntax

void OnSurpriseRemoval(
  [in] IWDFDevice *pWdfDevice
);

Parameters

[in] pWdfDevice

A pointer to the IWDFDevice interface for the device object of the device that is removed unexpectedly.

Return value

None

Remarks

A driver registers the IPnpCallback interface when the driver calls the IWDFDriver::CreateDevice method to create a device object.

The framework does not synchronize the OnSurpriseRemoval callback function with other PnP and power management callback functions.

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 Windows
Header wudfddi.h (include Wudfddi.h)

See also

IPnpCallback

IWDFDevice

IWDFDriver::CreateDevice