However, in addition to removing the devnode of the specified device, this function attempts to remove all child devnodes of the device that are present on the system at the time of the call.ĭeleting a Driver Package from the Driver Store This function is similar to calling SetupDiCallClassInstaller with the InstallFunction parameter set to DIF_REMOVE. Starting with Windows 7, a device installation application can uninstall a device by calling the DiUninstallDevice function. Note SetupDiRemoveDevice must only be called by a class installer and not by a device installation application.įor more information about DIF codes, see Handling DIF Codes.
It also deletes the device's hardware and software registry keys, together with any hardware-profile-specific registry keys (configuration-specific registry keys). If SetupDiRemoveDevice is called during the processing of the DIF_REMOVE request, the function removes the device's devnode from the system. For a list of all DIF codes, see Device Installation Functions.
When the application calls this function to uninstall a device, it must set the InstallFunction parameter to the DIF_REMOVE code. SetupAPI allows you to uninstall a device and remove the device node ( devnode) from the system by using the following methods:Ī device installation application can request that a device be uninstalled by calling the SetupDiCallClassInstaller function. This topic describes the procedures that you can follow to uninstall devices and driver packages by using the SetupAPI functions.įor more information about uninstalling driver and driver packages, see How Devices and Driver Packages are Uninstalled. SetupAPI also supports uninstalling the devices and driver packages that it installs. SetupAPI is a system component that provides various sets of functionality, including Device installation functions.ĭevice installation applications, co-installers, and class installers can use these functions to perform custom operations for device installation.