A DIF_UNREMOVE request notifies the installer that Windows is about to reinstate a device in a given hardware profile and gives the installer an opportunity to participate in the operation. Windows only sends this request for non-PnP devices.

When Sent

When a root-enumerated, non-PnP device is reinstated to a hardware profile.

Who Handles

Class Co-installer

Can handle

Device Co-installer

Can handle

Class Installer

Can handle


Installer Input


Supplies a handle to the device information set that contains the device.


Supplies a pointer to an SP_DEVINFO_DATA structure that identifies the device in the device information set.

Device Installation Parameters

There are device installation parameters (SP_DEVINSTALL_PARAMS) associated with the DeviceInfoData.

Class Installation Parameters

An SP_UNREMOVEDEVICE_PARAMS structure is associated with the DeviceInfoData. The Scope field must be set to DI_UNREMOVEDEVICE_CONFIGSPECIFIC and a hardware profile must be specified in the HwProfile field.

Installer Output


Installer Return Value

A co-installer can return NO_ERROR, ERROR_DI_POSTPROCESSING_REQUIRED, or a Win32 error code.

If a class installer successfully handles this request and SetupDiCallClassInstaller should subsequently call the default handler, the class installer returns ERROR_DI_DO_DEFAULT.

If the class installer successfully handles this request, including directly calling the default handler, the class installer should return NO_ERROR and SetupDiCallClassInstaller will not subsequently call the default handler again.

Note   The class installer can directly call the default handler, but the class installer should never attempt to supersede the operations of the default handler.

For more information about calling the default handler, see Calling Default DIF Code Handlers.

If the class installer encounters an error, the installer should return an appropriate Win32 error code and SetupDiCallClassInstaller will not subsequently call the default handler.

Default DIF Code Handler


Installer Operation

"Unremoving" a device basically means that Windows clears a flag that previously marked a device as "not present" in a particular hardware profile.

For more information about DIF codes, see Handling DIF Codes.



Supported in Microsoft Windows 2000 and later versions of Windows.


Setupapi.h (include Setupapi.h)

See also




Send comments about this topic to Microsoft