Export (0) Print
Expand All

Calling SetupAPI Functions

This section provides guidelines that you should follow when you call the SetupAPI functions from a class installer, a co-installer, or a device installation application.

Rules for calling SetupAPI functions

Class installers and co-installers must not call the following SetupAPI functions:

  • SetupQueueCopy

  • SetupQueueCopyIndirect

  • SetupQueueCopySection

  • SetupQueueDefaultCopy

  • SetupQueueDelete

  • SetupQueueDeleteSection

  • SetupQueueRename

  • SetupQueueRenameSection

  • SetupScanFileQueue

    Note  Class installers and co-installers are prohibited from calling SetupScanFileQueue only when the SPQ_SCAN_PRUNE_COPY_QUEUE flag is set in the Flags parameter.

Rules for calling the default DIF code handler functions

Default device installation function (DIF) code handler functions perform system-defined default operations for certain DIF codes. As described in Handling DIF Codes, SetupDiCallClassInstaller calls the default handler for a DIF request after the class installer and co-installer have first processed the DIF request, but before SetupDiCallClassInstaller calls the co-installers that registered for post-processing of the request.

Co-installers and device installation applications must not call the default DIF code handler functions. Direct calls to these handler functions bypass all registered co-installers and class installers, and could invalidate any internal device state that these installers store.

The following table lists the DIF codes that have default DIF code handler functions.

DIF codeDefault DIF code handler function
DIF_PROPERTYCHANGE SetupDiChangeState
DIF_FINISHINSTALL_ACTION SetupDiFinishInstallAction
DIF_INSTALLDEVICE SetupDiInstallDevice
DIF_INSTALLINTERFACES SetupDiInstallDeviceInterfaces
DIF_INSTALLDEVICEFILES SetupDiInstallDriverFiles
DIF_REGISTER_COINSTALLERS SetupDiRegisterCoDeviceInstallers
DIF_REGISTERDEVICE SetupDiRegisterDeviceInfo
DIF_REMOVE SetupDiRemoveDevice
DIF_SELECTBESTCOMPATDRV SetupDiSelectBestCompatDrv
DIF_SELECTDEVICE SetupDiSelectDevice
DIF_UNREMOVE SetupDiUnremoveDevice

 

Note  Class installers can call the default DIF code handler function only when the installer is handling the corresponding DIF code. For more information, see Calling the Default DIF Code Handlers.

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft