The SetupDiGetActualSectionToInstall function retrieves the appropriate INF DDInstall section to use when installing a device from a device INF file on a local computer.
WINSETUPAPI BOOL SetupDiGetActualSectionToInstallA( HINF InfHandle, PCSTR InfSectionName, PSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PSTR *Extension );
The handle to the INF file that contains the DDInstall section.
A pointer to the DDInstall section name (as specified in an INF Models section). The maximum length of the section name, in characters, is 254.
A pointer to a character buffer to receive the DDInstall section name, its platform extension, and a NULL terminator. This is the decorated section name that should be used for installation. If this parameter is NULL, InfSectionWithExtSize must be zero. If this parameter is NULL, the function returns TRUE and sets RequiredSize to the size, in characters, that is required to return the DDInstall section name, its platform extension, and a terminating NULL character.
The size, in characters, of the InfSectionWithExt buffer. If InfSectionWithExt is NULL, this parameter must be zero.
A pointer to the variable that receives the size, in characters, that is required to return the DDInstall section name, the platform extension, and a terminating NULL character.
A pointer to a variable that receives a pointer to the '.' character that marks the start of the extension in the InfSectionWithExt buffer. If the InfSectionWithExt buffer is not supplied or is too small, this parameter is not set. Set this parameter to NULL if a pointer to the extension is not required.
If the function is successful, it returns TRUE. If the function fails, it returns FALSE. To get extended error information, call GetLastError.
This function supports the extensions to DDInstall section names that are used to specify OS-specific and architecture-specific installation behaviors for a device. For information about these extensions, see Creating INF Files for Multiple Platforms and Operating Systems. SetupDiGetActualSectionToInstall searches for a DDInstall section name that matches the local computer in the manner described below.
The function first searches in the specified INF file for a decorated install section name that matches the specified name and has an extension that matches the operating system and processor architecture of the local computer. If, for example, you specify a section name of InstallSec, the function searches for one of the following decorated names, depending on the processor architecture of the local computer:
- For a computer that is based on the x86 processor architecture, the function searches for the decorated name InstallSec.ntx86.
- For a computer that is based on the x64 processor architecture, the function searches for the decorated name InstallSec.ntamd64.
- For a computer that is based on the Itanium processor architecture, the function searches for the decorated name InstallSec.ntia64.
The DDInstall section name is used as the base for Hardware and Services section names. For example, if the DDInstall section name that is found is InstallSec.NTX86, the Services section name must be named InstallSec.NTX86.Services.
The original DDInstall section name that is specified in the driver node is written to the driver's registry key's InfSection value entry. The extension that was found is stored in the key as the REG_SZ value InfSectionExt. For example:
InfSection : REG_SZ : "InstallSec" InfSectionExt : REG_SZ : ".NTX86"
|Windows version||Available in Microsoft Windows 2000 and later versions of Windows.|
|Header||setupapi.h (include Setupapi.h)|