Skip to content

Latest commit

 

History

History
91 lines (67 loc) · 4.07 KB

nf-setupapi-setupdiunremovedevice.md

File metadata and controls

91 lines (67 loc) · 4.07 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:setupapi.SetupDiUnremoveDevice
SetupDiUnremoveDevice function (setupapi.h)
The SetupDiUnremoveDevice function is the default handler for the DIF_UNREMOVE installation request.
SetupDiUnremoveDevice
SetupDiUnremoveDevice function [Device and Driver Installation]
devinst.setupdiunremovedevice
di-rtns_8c97341a-c852-47be-ad6e-c551f82deb6d.xml
setupapi/SetupDiUnremoveDevice
devinst\setupdiunremovedevice.htm
devinst
1bffe874-d4ba-4efa-ab71-098a3c96092f
12/05/2018
SetupDiUnremoveDevice, SetupDiUnremoveDevice function [Device and Driver Installation], devinst.setupdiunremovedevice, di-rtns_8c97341a-c852-47be-ad6e-c551f82deb6d.xml, setupapi/SetupDiUnremoveDevice
setupapi.h
Setupapi.h
Desktop
Available in Microsoft Windows 2000 and later versions of Windows.
Setupapi.lib
Setupapi.dll
Windows
19H1
SetupDiUnremoveDevice
setupapi/SetupDiUnremoveDevice
c++
APIRef
kbSyntax
DllExport
Setupapi.dll
SetupDiUnremoveDevice

SetupDiUnremoveDevice function

-description

The SetupDiUnremoveDevice function is the default handler for the DIF_UNREMOVE installation request.

-parameters

-param DeviceInfoSet [in]

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.

-param DeviceInfoData [in, out]

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.

-returns

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.

Note  Only a class installer should call SetupDiUnremoveDevice and only in those situations where the class installer must perform device unremove operations after SetupDiUnremoveDevice completes the default device unremove operation. In such situations, the class installer must directly call SetupDiUnremoveDevice when the installer processes a DIF_UNREMOVE request. For more information about calling the default handler, see Calling Default DIF Code Handlers.
 
The device being restored must have class install parameters for DIF_UNREMOVE or the function fails and GetLastError returns ERROR_NO_CLASSINSTALL_PARAMS.

The DeviceInfoSet must only contain elements on the local computer.

The caller of SetupDiUnremoveDevice must be a member of the Administrators group.

-see-also

DIF_UNREMOVE

SP_DEVINFO_DATA

SetupDiRemoveDevice