SetupDiUnremoveDevice function (setupapi.h)
The SetupDiUnremoveDevice function is the default handler for the DIF_UNREMOVE installation request.
Syntax
WINSETUPAPI BOOL SetupDiUnremoveDevice(
[in] HDEVINFO DeviceInfoSet,
[in, out] PSP_DEVINFO_DATA DeviceInfoData
);
Parameters
[in] DeviceInfoSet
A handle to a device information set for the local system that contains a device information element that represents a device to restore and to restart.
[in, out] DeviceInfoData
A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet. This is an IN-OUT parameter because DeviceInfoData.DevInst might be updated with a new handle value on return.
Return value
The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved by a call to GetLastError.
Remarks
SetupDiUnremoveDevice restores a device to a hardware profile. This function starts the device, if possible, or it sets a flag in the device install parameters that eventually causes the user to be prompted to shut down the system.
The DeviceInfoSet must only contain elements on the local computer.
The caller of SetupDiUnremoveDevice must be a member of the Administrators group.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Available in Microsoft Windows 2000 and later versions of Windows. |
Target Platform | Desktop |
Header | setupapi.h (include Setupapi.h) |
Library | Setupapi.lib |
DLL | Setupapi.dll |