SetupDiGetActualModelsSection function

The SetupDiGetActualModelsSection function retrieves the appropriate decorated INF Models section to use when installing a device from a device INF file.

Syntax


BOOL SetupDiGetActualModelsSection(
  _In_       PINFCONTEXT          Context,
  _In_opt_   PSP_ALTPLATFORM_INFO AlternatePlatformInfo,
  _Out_opt_  PTSTR                DecoratedModelsSection,
  _In_       DWORD                DecoratedModelsSectionSize,
  _Out_opt_  PDWORD               RequiredSize,
  _Reserved_ PVOID                Reserved
);

Parameters

Context [in]

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.

AlternatePlatformInfo [in, optional]

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.

DecoratedModelsSection [out, optional]

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.

DecoratedModelsSectionSize [in]

The size, in characters, of the DecoratedModelsSection buffer. If DecoratedModelsSection is NULL, this parameter must be set to zero.

RequiredSize [out, optional]

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

Reserved for internal system use. This parameter must be set to NULL.

Return value

SetupDiGetActualModelsSection returns TRUE if the operation succeeds. Otherwise, the function returns FALSE and the logged error can be retrieved with a call to GetLastError.

Remarks

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.

For information about retrieving an INF DDInstall section for a device, see SetupDiGetActualSectionToInstall.

Requirements

Target platform

Desktop

Version

Available in Windows Server 2003 with Service Pack 1 (SP1) and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

See also

INF DDInstall Section
SetupDiGetActualSectionToInstall
SP_ALTPLATFORM_INFO

 

 

Send comments about this topic to Microsoft

Show: