Using Device Installation Functions
This section summarizes the device installation functions. By using the device installation functions, the installation software can perform the following types of operations:
Install drivers
Handle DIF codes.
Manage device information sets.
Manage driver lists.
Manage device interfaces.
Manage icons and other bitmaps.
The following tables provide summaries of the following types of functions:
Device Installation Customization Functions
Device Property Functions (Windows Vista and Later)
Driver Installation Functions
Installs a specified driver package that is preinstalled in the driver store on a PnP device that is present in the system. (Windows Vista and later versions of Windows) |
|
Uninstalls a device and removes its device node (devnode) from the system. (Windows 7 and later versions of Windows) |
|
Preinstalls a driver package in the driver store and then installs the driver package on matching PnP devices that are present in the system. (Windows Vista and later versions of Windows) |
|
Removes a driver package from the Driver Store. (Windows 10 Version 1703 and later versions of Windows) |
|
Updates the driver package that is installed for matching PnP devices that are present in the system. |
|
Rolls back the driver package that is installed on a specified device to the backup driver package set for the device. (Windows Vista and later versions of Windows) |
Device Information Functions
Note
SetupApi is not supported on all editions of Windows. When possible, you should use lower layer APIs such as those available via CfgMgr32.dll. See Porting from SetupApi to CfgMgr32 for tips.
Creates an empty device information set. This set can be associated with a class GUID. |
|
Creates an empty device information set. This set can be associated with a class GUID and can be for devices on a remote computer. |
|
Creates a new device information element and adds it as a new member to the specified device information set. |
|
Retrieves information about an existing device instance and adds it to the specified device information set. |
|
Returns a context structure for a device information element of a device information set. |
|
Retrieves the device instance ID associated with a device information element. |
|
Retrieves the class GUID associated with a device information set if it has an associated class. |
|
Retrieves information associated with a device information set including the class GUID, remote computer handle, and remote computer name. |
|
Retrieves handles to the property sheets of a specified device information element or of the device setup class of a specified device information set. |
|
Returns a device information set that contains all devices of a specified class. |
|
Returns a device information set that contains all devices of a specified class on a local or remote computer. |
|
Sets the specified device information element to be the currently-selected member of a device information set. This function is typically used by an installation wizard. |
|
Retrieves the currently-selected device for the specified device information set. |
|
Registers a newly created device instance with the Plug and Play manager. |
|
Deletes a member from the specified device information set. This function does not delete the actual device. |
|
Destroys a device information set and frees all associated memory. |
Driver Information Functions
Builds a list of drivers associated with a specified device instance or with the device information set's global class driver list. |
|
Enumerates the members of a driver information list. |
|
Retrieves detailed information for a specified driver information element. |
|
Sets the specified member of a driver list as the currently selected-driver. It can also be used to reset the driver list so that there is no currently-selected driver. |
|
Retrieves the member of a driver list that was selected as the driver to install. |
|
Cancels a driver list search that is currently underway in a different thread. |
|
Destroys a driver information list. |
Device Installation Handlers
Calls the appropriate class installer, and any registered co-installers, with the specified installation request. |
|
The default handler for the DIF_PROPERTYCHANGE request. It can be used to change the state of an installed device. |
|
Registers the device-specific co-installers listed in the INF file for the specified device. This function is the default handler for DIF_REGISTER_COINSTALLERS. |
|
The default handler for the DIF_INSTALLDEVICE request. |
|
The default handler for the DIF_INSTALLDEVICEFILES request. |
|
The default handler for the DIF_INSTALLINTERFACES request. It installs the interfaces that are listed in a DDInstall.Interfaces section of a device INF file. |
|
This function is obsolete and cannot be used in any version of Microsoft Windows. |
|
The default handler for the DIF_REMOVEDEVICE request. |
|
The default handler for the DIF_UNREMOVE request. |
|
The default handler for the DIF_REGISTERDEVICE request. |
|
The default handler for the DIF_SELECTDEVICE request. |
|
The default handler for the DIF_SELECTBESTCOMPATDRV request. |
|
Default handler for the DIF_SELECTDEVICE request. |
Device Installation Customization Functions
Retrieves class install parameters for a device information set or a particular device information element. |
|
Sets or clears class install parameters for a device information set or a particular device information element. |
|
Retrieves device install parameters for a device information set or a particular device information element. |
|
Sets device install parameters for a device information set or a particular device information element. |
|
Retrieves install parameters for the specified driver. |
|
Sets the installation parameters for the specified driver. |
Setup Class Functions
Returns a list of setup class GUIDs that includes every class installed on the system. |
|
Returns a list of setup class GUIDs that includes every class installed on the local system or a remote system. |
|
Retrieves the class description associated with the specified setup class GUID. |
|
Retrieves the description of a setup class installed on a local or remote computer. |
|
Retrieves the class of a specified device INF file. |
|
Retrieves the GUIDs associated with the specified class name. This list is built based on what classes are currently installed on the system. |
|
Retrieves the GUIDs associated with the specified class name. This resulting list contains the classes currently installed on a local or remote computer. |
|
Retrieves the class name associated with the class GUID. |
|
Retrieves the class name associated with a class GUID. The class can be installed on a local or remote computer. |
|
Installs the ClassInstall32 section of the specified INF file. |
|
Installs a class installer or an interface class. |
|
Opens the device setup class registry key, or a specific subkey of the class. |
|
Opens the device setup class registry key, the device interface class registry key, or a specific subkey of the class. This function opens the specified key on the local computer or on a remote computer. |
Bitmap and Icon Functions
Builds an image list that contains bitmaps for every installed class and returns the list in a data structure. |
|
Builds an image list of bitmaps for every class installed on a local or remote computer. |
|
Retrieves the index within the class image list of a specified class. |
|
Retrieves the index of the mini-icon supplied for the specified class. |
|
Draws the specified mini-icon at the location requested. |
|
Loads both the large and mini-icon for the specified class. |
|
Loads a device icon for a specified device. (Windows Vista and later versions of Windows) |
|
Destroys a class image list. |
Device Interface Functions
Note
SetupApi is not supported on all editions of Windows. When possible, you should use lower layer APIs such as those available via CfgMgr32.dll. See Porting from SetupApi to CfgMgr32 for tips.
Registers device functionality (a device interface) for a device. |
|
Retrieves information about an existing device interface and adds it to the specified device information set. |
|
Returns an alias of the specified device interface. |
|
Returns a device information set that contains all devices of a specified class. |
|
Returns a device information set that contains all devices of a specified class on a local or remote computer. |
|
Returns a context structure for a device interface element of a device information set. Each call returns information about one device interface. The function can be called repeatedly to obtain information about several interfaces exposed by one or more devices. |
|
Returns details about a particular device interface. |
|
Creates a registry subkey for storing information about a device interface instance and returns a handle to the key. |
|
Opens the registry subkey that is used by applications and drivers to store information that is specific to a device interface instance and returns a handle to the key. |
|
Deletes the registry subkey that was used by applications and drivers to store information that is specific to a device interface instance. |
|
Is the default handler for the DIF_INSTALLINTERFACES request. It installs the interfaces that are listed in a DDInstall.Interfaces section of a device INF file. |
|
Removes a registered device interface from the system. |
|
Deletes a device interface from a device information set. |
|
Sets a specified device interface as the default interface for a device class. |
|
Installs a class installer or an interface class. |
|
Opens the device setup class registry key, the device interface class registry key, or a specific subkey of the class. This function opens the specified key on the local computer or on a remote computer. |
Device Property Functions (Windows Vista and Later)
Note
SetupApi is not supported on all editions of Windows. When possible, you should use lower layer APIs such as those available via CfgMgr32.dll. See Porting from SetupApi to CfgMgr32 for tips.
Retrieves a device property that is set for a device setup class or a device interface class. |
|
Retrieves a class property for a device setup class or a device interface class on a local or remote computer. |
|
Retrieves an array of the device property keys that represent the device properties that are set for a device setup class or a device interface class. |
|
Retrieves an array of the device property keys that represent the device properties that are set for a device setup class or a device interface class on a local or a remote computer. |
|
Retrieves a device property that is set for a device interface. |
|
Retrieves an array of device property keys that represent the device properties that are set for a device interface. |
|
Retrieves a device instance property. |
|
Retrieves an array of the device property keys that represent the device properties that are set for a device instance. |
|
Sets a class property for a device setup class or a device interface class. |
|
Sets a device property for a device setup class or a device interface class on a local or remote computer. |
|
Sets a device property of a device interface. |
|
Sets a device instance property. |
Registry Functions
Note
SetupApi is not supported on all editions of Windows. When possible, you should use lower layer APIs such as those available via CfgMgr32.dll. See Porting from SetupApi to CfgMgr32 for tips.
Creates a registry storage key for device-specific configuration information and returns a handle to the key. |
|
Opens a registry storage key for device-specific configuration information and returns a handle to the key. |
|
Deletes the specified user-accessible registry key(s) associated with a device information element. |
|
Opens the setup class registry key, or a specific subkey of the class. |
|
Opens the device setup class registry key, the device interface class registry key, or a specific subkey of the class. This function opens the specified key on the local computer or on a remote computer. |
|
Creates a nonvolatile registry subkey for storing information about a device interface instance and returns a handle to the key. |
|
Opens the registry subkey that is used by applications and drivers to store information that is specific to a device interface instance and returns a handle to the key. |
|
Deletes the registry subkey that was used by applications and drivers to store information that is specific to a device interface instance. |
|
Sets the specified Plug and Play device property. |
|
Retrieves the specified Plug and Play device property. |
|
Retrieves a specified device class property from the registry. |
|
Sets a specified device class property in the registry. |
Other Functions
Retrieves the appropriate decorated INF Models section to use when installing a device from a device INF file. |
|
Retrieves the appropriate DDInstall section to use when installing a device from a device INF file. |
|
Retrieves the name of the INF DDInstall section that installs a device for a specified operating system and processor architecture. |
|
Retrieves the friendly name associated with a hardware profile ID. |
|
Retrieves the friendly name associated with a hardware profile ID on a local or remote computer. |
|
Retrieves a list of all currently defined hardware profile IDs. |
|
Retrieves a list of all currently defined hardware profile IDs on a local or remote computer. |
|
Restarts a specified device or, if necessary, starts all devices that are operated by the same function and filter drivers as the specified device. |