The SetupDiGetActualModelsSection function retrieves the appropriate decorated INF Models section to use when installing a device from a device INF file.
WINSETUPAPI BOOL SetupDiGetActualModelsSectionA( PINFCONTEXT Context, PSP_ALTPLATFORM_INFO AlternatePlatformInfo, PSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PVOID Reserved );
A pointer to an INF file context that specifies a manufacturer-identifier entry in an INF Manufacturer section of an INF file. The manufacturer-identifier entry specifies an INF Models section name and optionally specifies TargetOSVersion decorations for the Models section name. For information about INF files and an INF file context, see the Platform SDK topics on using INF files and the INFCONTEXT structure.
A pointer to an SP_ALTPLATFORM_INFO structure that supplies information about a Windows version and processor architecture. The cbSize member of this structure must be set to sizeof(SP_ALTPLATFORM_INFO_V2). This parameter is optional and can be set to NULL.
A pointer to a buffer that receives a string that contains the decorated INF Models section name and a NULL terminator. If AlternatePlatformInfo is not supplied, the decorated INF Models section name applies to the current platform; otherwise the name applies to the specified alternative platform. This parameter is optional and can be set to NULL. If this parameter is NULL, the function returns TRUE and sets RequiredSize to the size, in characters, that is required to return the decorated Models section name and a terminating NULL character.
The size, in characters, of the DecoratedModelsSection buffer. If DecoratedModelsSection is NULL, this parameter must be set to zero.
A pointer to a DWORD-type variable that receives the size, in characters, of the DecoratedModelsSection buffer that is required to retrieve the decorated Models section name and a terminating NULL character. This parameter is optional and can be set to NULL.
Reserved for internal system use. This parameter must be set to NULL.
SetupDiGetActualModelsSection returns TRUE if the operation succeeds. Otherwise, the function returns FALSE and the logged error can be retrieved with a call to GetLastError.
SetupDiGetActualModelsSection determines which TargetOSVersion fields in the manufacturer-identifier entry (supplied by Context) apply to the current platform, if AlternatePlatformInfo is not supplied, or to an alternative platform, if alternative platform information is supplied. SetupDiGetActualModelsSection selects the most appropriate platform based on all the TargetOSVersion fields, appends the TargetOSVersion string to the INF Models section name, and returns the decorated INF Models section name to the caller. In a manufacturer-identifier entry, the operating system major version is specified by the OSMajorVersion field and the operating system minor version is specified by the OSMinorVersion field.
|Windows version||Available in Windows Server 2003 with Service Pack 1 (SP1) and later versions of Windows.|
|Header||setupapi.h (include Setupapi.h)|