IWDTFPNPActions2::EDTSurpriseRemoveDevice method (wdtfpnpaction.h)

Sends an IRP_MN_SURPRISE_REMOVAL event to the target device.

Syntax

HRESULT EDTSurpriseRemoveDevice(
  [out, retval] VARIANT_BOOL *pbSuccess
);

Parameters

[out, retval] pbSuccess

True if the operation succeeds; otherwise, false.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Note  The IWDTFEnhancedDeviceTestSupportAction2::Enable method must be called for the target device before calling this method.
 
EDTSurpriseRemoveDevice attempts to trigger a surprise removal of the target device. This operation is useful for testing how drivers and driver/device aware applications handle the IRP_MN_SURPRISE_REMOVAL event, e.g. scenarios in which the device unexpectedly fails or is removed.

Requirements

Requirement Value
Target Platform Desktop
Header wdtfpnpaction.h