HKEY
SetupDiGetActualSectionToInstall(
IN HINF InfHandle,
IN PCTSTR InfSectionName,
OUT PTSTR InfSectionWithExt, /* optional */
IN DWORD InfSectionWithExtSize,
OUT PDWORD RequiredSize, /* optional */
OUT PTSTR *Extension /* optional */
);
SetupDiGetActualSectionToInstall finds the appropriate Install section to use when installing a device from a Windows NT 4.0-style device INF file.
If the function is successful, it returns TRUE. If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
This function supports an OS/architecture-specific extension that can be used to specify multiple installation behaviors for a single device, dependent on the operating environment. An extension is appended to the INF file Install section name to identify that it contains OS/architecture-specific installation instructions. SetupDiGetActualSectionToInstall searches for the different Install section names in the manner described below.
Starting with the Install section name as specified in the driver node (for example, InstallSec) the function attempts to find one of the following section names (the search is carried out in the order listed):
The first Install section located is used for the installation. This section name is also used as the base for Hardware and Services section names. For example, if the Install section name found is InstallSec.NTAlpha, the Services section name must be named InstallSec.NTAlpha.Services.
The original Install section name 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 : ".NTMIPS"
If a driver is not selected for the specified device information element, a NULL driver is installed. Upon return, the Install Parameters flags in the device’s SP_DEVINSTALL_PARAMS structure indicate whether the system should be restarted or rebooted for the device to start.