Combining Platform Extensions with Operating System Versions

In Windows XP and later versions of Windows, within the INF Manufacturer section of an INF file, you can supply INF Models sections that are specific to various versions of the Windows operating system. These version-specific Models sections are identified by using the TargetOSVersion decoration.

Within the same INF file, different INF Models sections can be specified for different versions of the operating system. The specified versions indicate target operating system versions with which the INF Models sections will be used. If no versions are specified, Windows uses a Models section without the TargetOSVersion decoration for all versions of all operating systems.

TargetOSVersion decoration format

The following example shows the correct format of the TargetOSVersion decoration:

nt[Architecture][.[OSMajorVersion][.[OSMinorVersion][.[ProductType][.SuiteMask]]]]

Each field is defined as follows:

nt

Specifies that the target operating system is NT-based. Windows 2000 and later versions of Windows are all NT-based.

Architecture

Identifies the hardware platform. If specified, this must be x86, ia64, or amd64. If not specified, the associated INF Models section can be used with any hardware platform.

OSMajorVersion

A number that represents the major version number for the operating system. The following table defines the major version for the Windows operating systems.

Windows versionMajor version

Windows Server 2008 R2

6

Windows 7

6

Windows Server 2008

6

Windows Vista

6

Windows Server 2003

5

Windows XP

5

 

OSMinorVersion

A number that represents the minor version number for the operating system. The following table defines the minor version for the Windows operating systems.

Windows versionMinor version

Windows Server 2008 R2

1

Windows 7

1

Windows Server 2008

0

Windows Vista

0

Windows Server 2003

2

Windows XP

1

 

ProductType

A number that represents one of the VER_NT_xxxx flags defined in Winnt.h, such as the following:

0x0000001 (VER_NT_WORKSTATION)
0x0000002 (VER_NT_DOMAIN_CONTROLLER)
0x0000003 (VER_NT_SERVER)

If a product type is specified, the INF file will be used only if the operating system matches the specified product type. If the INF file supports multiple product types for a single operating system version, multiple TargetOSVersion entries are required.

SuiteMask

A number that represents a combination of one or more of the VER_SUITE_xxxx flags defined in Winnt.h. These flags include the following:

0x00000001 (VER_SUITE_SMALLBUSINESS)
0x00000002 (VER_SUITE_ENTERPRISE)
0x00000004 (VER_SUITE_BACKOFFICE)
0x00000008 (VER_SUITE_COMMUNICATIONS)
0x00000010 (VER_SUITE_TERMINAL)
0x00000020 (VER_SUITE_SMALLBUSINESS_RESTRICTED)
0x00000040 (VER_SUITE_EMBEDDEDNT)
0x00000080 (VER_SUITE_DATACENTER)
0x00000100 (VER_SUITE_SINGLEUSERTS)
0x00000200 (VER_SUITE_PERSONAL)
0x00000400 (VER_SUITE_SERVERAPPLIANCE)

If one or more suite mask values are specified, the INF file will be used only if the operating system matches all the specified product suites. If the INF file supports multiple product suite combinations for a single operating system version, multiple TargetOSVersion entries are required.

How Windows processes TargetOSVersion decorations

When you install a device or driver on a host operating system, Windows follows these steps to process the INF Models sections within an INF file:

  1. If one or more INF Models sections have the TargetOS decoration, Windows selects the INF Models section that is closest to the attributes for the host operating system.

    For example, if an INF Models section has a TargetOS decoration of ntx86.5.1, Windows selects that section if the host operating system is running Windows XP or later version of Windows on an x86-based system.

    Similarly, if an INF Models section has a TargetOS decoration of nt.6.0, Windows selects that section if the host operating system is Windows Vista or later version of Windows on any supported hardware platform.

  2. If none of the INF Models sections have a TargetOS decoration that matches the host operating system, Windows selects the Models section that has either a matching platform extension or no platform extension.

    For example, if an INF Models section has a platform extension of ntx86, Windows selects that section if the host operating system is Microsoft Windows 2000 or later version of Windows on an x86-based system.

    Similarly, if an INF Models sections has no platform extension, Windows selects that section if the host operating system is Windows 2000 or later version of Windows on any supported hardware platform.

  3. If Windows cannot find a matching INF Models section, it will not use the INF file to install the device or driver.

Sample INF Models sections withTargetOSVersion decorations

The following topics provide samples of how to decorate platform extensions for target operating systems within an INF Models section:

Sample INF Models Sections for One or More Target Operating Systems

Sample INF Models Sections for Only One Target Operating System

Sample INF File for Device Installation on Multiple Versions of Windows

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft