Previous Next

Using Device Installation Functions

This section summarizes the device installation functions. The types of operations that installation software can perform using these functions include:

To perform device installation operations that are not supported by the SetupDi-prefixed functions described in this section, call the appropriate general setup functions and PnP Configuration Manager Functions (CM_Xxx functions).

The following tables provide summaries of the functions:

Update Driver Function

Device Information Functions

Driver Information Functions

Driver Selection Functions

Device Installation Handlers

Device Installation Customization Functions

Setup Class Functions

Class Bitmap and Icon Functions

Device Interface Functions

Registry Functions

Other Functions

Update Driver Function

UpdateDriverForPlugAndPlayDevices Given an INF and a hardware ID, UpdateDriverForPlugAndPlayDevices installs updated drivers for devices that match the hardware ID.

SetupDi Device Information Functions

SetupDiCreateDeviceInfoList Creates an empty device information set. This set can be associated with a class GUID.
SetupDiCreateDeviceInfoListEx Creates an empty device information set. This set can be associated with a class GUID and can be for devices on a remote machine.
SetupDiCreateDeviceInfo Creates a new device information element and adds it as a new member to the specified device information set.
SetupDiOpenDeviceInfo Retrieves information about an existing device instance and adds it to the specified device information set.
SetupDiEnumDeviceInfo Returns a context structure for a device information element of a device information set.
SetupDiGetDeviceInstanceId Retrieves the device instance ID associated with a device information element.
SetupDiGetDeviceInfoListClass Retrieves the class GUID associated with a device information set if it has an associated class.
SetupDiGetDeviceInfoListDetail Retrieves information associated with a device information set including the class GUID, remote machine handle, and remote machine name.
SetupDiGetClassDevPropertySheets Retrieves handles to the property sheets of a specified device information element or of the device setup class of a specified device information set.
SetupDiGetClassDevs Returns a device information set that contains all devices of a specified class.
SetupDiGetClassDevsEx Returns a device information set that contains all devices of a specified class on a local or remote machine.
SetupDiSetSelectedDevice 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.
SetupDiGetSelectedDevice Retrieves the currently-selected device for the specified device information set.
SetupDiRegisterDeviceInfo Registers a newly created device instance with the Plug and Play Manager.
SetupDiDeleteDeviceInfo Deletes a member from the specified device information set. This function does not delete the actual device.
SetupDiDestroyDeviceInfoList Destroys a device information set and frees all associated memory.

SetupDi Driver Information Functions

SetupDiBuildDriverInfoList Builds a list of drivers associated with a specified device instance or with the device information set's global class driver list.
SetupDiEnumDriverInfo Enumerates the members of a driver information list.
SetupDiGetDriverInfoDetail Retrieves detailed information for a specified driver information element.
SetupDiSetSelectedDriver 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.
SetupDiGetSelectedDriver Retrieves the member of a driver list that has been selected as the driver to install.
SetupDiCancelDriverInfoSearch Cancels a driver list search that is currently underway in a different thread.
SetupDiDestroyDriverInfoList Destroys a driver information list.

SetupDi Driver Selection Functions

SetupDiAskForOEMDisk Displays a dialog that asks the user for the path to an OEM installation disk.
SetupDiSelectOEMDrv Selects a driver for a device using an OEM path supplied by the user.
SetupDiSelectDevice Default handler for the DIF_SELECTDEVICE request.

SetupDi Device Installation Handlers

SetupDiCallClassInstaller Calls the appropriate class installer, and any registered co-installers, with the specified installation request.
SetupDiChangeState The default handler for the DIF_PROPERTYCHANGE request. It can be used to change the state of an installed device.
SetupDiRegisterCoDeviceInstallers 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.
SetupDiInstallDevice The default handler for the DIF_INSTALLDEVICE request.
SetupDiInstallDriverFiles The default handler for the DIF_INSTALLDEVICEFILES request.
SetupDiInstallDeviceInterfaces The default handler for the DIF_INSTALLINTERFACES request. It installs the interfaces listed in a DDInstall.Interfaces section of a device INF file.
SetupDiMoveDuplicateDevice This function is obsolete and can not be used in any version of Microsoft® Windows®. The default handler for the DIF_MOVEDEVICE request.
SetupDiRemoveDevice The default handler for the DIF_REMOVEDEVICE request.
SetupDiUnremoveDevice The default handler for the DIF_UNREMOVE request.
SetupDiRegisterDeviceInfo The default handler for the DIF_REGISTERDEVICE request.
SetupDiSelectDevice The default handler for the DIF_SELECTDEVICE request.
SetupDiSelectBestCompatDrv The default handler for the DIF_SELECTBESTCOMPATDRV request.

SetupDi Device Installation Customization Functions

SetupDiGetClassInstallParams Retrieves class install parameters for a device information set or a particular device information element.
SetupDiSetClassInstallParams Sets or clears class install parameters for a device information set or a particular device information element.
SetupDiGetDeviceInstallParams Retrieves device install parameters for a device information set or a particular device information element.
SetupDiSetDeviceInstallParams Sets device install parameters for a device information set or a particular device information element.
SetupDiGetDriverInstallParams Retrieves install parameters for the specified driver.
SetupDiSetDriverInstallParams Sets the install parameters for the specified driver.

SetupDi Setup Class Functions

SetupDiBuildClassInfoList Returns a list of setup class GUIDs that includes every class installed on the system.
SetupDiBuildClassInfoListEx Returns a list of setup class GUIDs that includes every class installed on the local system or a remote system.
SetupDiGetClassDescription Retrieves the class description associated with the specified setup class GUID.
SetupDiGetClassDescriptionEx Retrieves the description of a setup class installed on a local or remote machine.
SetupDiGetINFClass Retrieves the class of a specified device INF file.
SetupDiClassGuidsFromName Retrieves the GUIDs associated with the specified class name. This list is built based on what classes are currently installed on the system.
SetupDiClassGuidsFromNameEx Retrieves the GUIDs associated with the specified class name. This resulting list contains the classes currently installed on a local or remote machine.
SetupDiClassNameFromGuid Retrieves the class name associated with the class GUID.
SetupDiClassNameFromGuidEx Retrieves the class name associated with a class GUID. The class can be installed on a local or remote machine.
SetupDiInstallClass Installs the ClassInstall32 section of the specified INF file.
SetupDiInstallClassEx Installs a class installer or an interface class.
SetupDiOpenClassRegKey Opens the device setup class registry key or a specific class's subkey.
SetupDiOpenClassRegKeyEx Opens the device setup class registry key, the device interface class registry key, or a specific class's subkey. This function opens the specified key on the local machine or on a remote machine.

SetupDi Class Bitmap and Icon Functions

SetupDiGetClassImageList Builds an image list that contains bitmaps for every installed class and returns the list in a data structure.
SetupDiGetClassImageListEx Builds an image list of bitmaps for every class installed on a local or remote machine.
SetupDiGetClassImageIndex Retrieves the index within the class image list of a specified class.
SetupDiGetClassBitmapIndex Retrieves the index of the mini-icon supplied for the specified class.
SetupDiDrawMiniIcon Draws the specified mini-icon at the location requested.
SetupDiLoadClassIcon Loads both the large and mini-icon for the specified class.
SetupDiDestroyClassImageList Destroys a class image list.

SetupDi Device Interface Functions

SetupDiCreateDeviceInterface Registers device functionality (a device interface) for a device.
SetupDiOpenDeviceInterface Retrieves information about an existing device interface and adds it to the specified device information set.
SetupDiGetDeviceInterfaceAlias Returns an alias of the specified device interface.
SetupDiGetClassDevs Returns a device information set that contains all devices of a specified class.
SetupDiGetClassDevsEx Returns a device information set that contains all devices of a specified class on a local or remote machine.
SetupDiEnumDeviceInterfaces 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 get information about several interfaces exposed by one or more devices.
SetupDiGetDeviceInterfaceDetail Returns details about a particular device interface.
SetupDiCreateDeviceInterfaceRegKey Creates a registry subkey for storing information about a device interface instance and returns a handle to the key.
SetupDiOpenDeviceInterfaceRegKey Opens the registry subkey that is used by applications and drivers to store information specific to a device interface instance and returns a handle to the key.
SetupDiDeleteDeviceInterfaceRegKey Deletes the registry subkey that was used by applications and drivers to store information specific to a device interface instance.
SetupDiInstallDeviceInterfaces Is the default handler for the DIF_INSTALLINTERFACES request. It installs the interfaces listed in a DDInstall.Interfaces section of a device INF file.
SetupDiRemoveDeviceInterface Removes a registered device interface from the system.
SetupDiDeleteDeviceInterfaceData Deletes a device interface from a device information set.
SetupDiSetDeviceInterfaceDefault Sets a specified device interface as the default interface for a device class.
SetupDiInstallClassEx Installs a class installer or an interface class.
SetupDiOpenClassRegKeyEx Opens the device setup class registry key, the device interface class registry key, or a specific class's subkey. This function opens the specified key on the local machine or on a remote machine.

SetupDi Registry Functions

SetupDiCreateDevRegKey Creates a registry storage key for device-specific configuration information and returns a handle to the key.
SetupDiOpenDevRegKey Opens a registry storage key for device-specific configuration information and returns a handle to the key.
SetupDiDeleteDevRegKey Deletes the specified user-accessible registry key(s) associated with a device information element.
SetupDiOpenClassRegKey Opens the setup class registry key or a specific class's subkey.
SetupDiOpenClassRegKeyEx Opens the device setup class registry key, the device interface class registry key, or a specific class's subkey. This function opens the specified key on the local machine or on a remote machine.
SetupDiCreateDeviceInterfaceRegKey Creates a non-volatile registry subkey for storing information about a device interface instance and returns a handle to the key.
SetupDiOpenDeviceInterfaceRegKey Opens the registry subkey that is used by applications and drivers to store information specific to a device interface instance and returns a handle to the key.
SetupDiDeleteDeviceInterfaceRegKey Deletes the registry subkey that was used by applications and drivers to store information specific to a device interface instance.
SetupDiSetDeviceRegistryProperty Sets the specified Plug and Play device property.
SetupDiGetDeviceRegistryProperty Retrieves the specified Plug and Play device property.
SetupDiGetClassRegistryProperty Retrieves a specified device class property from the registry.
SetupDiSetClassRegistryProperty Sets a specified device class property in the registry.

Other SetupDi Functions

SetupDiGetActualSectionToInstall Retrieves the appropriate DDInstall section to use when installing a device from a device INF file.
SetupDiGetActualSectiontoInstallEx Retrieves the name of the INF DDInstall section that installs a device for a specified operating system and processor architecture.
SetupDiGetHwProfileFriendlyName Retrieves the friendly name associated with a hardware profile ID.
SetupDiGetHwProfileFriendlyNameEx Retrieves the friendly name associated with a hardware profile ID on a local or remote machine.
SetupDiGetHwProfileList Retrieves a list of all currently defined hardware profile IDs.
SetupDiGetHwProfileListEx Retrieves a list of all currently defined hardware profile IDs on a local or remote machine.