Device Driver inf guidelines for Windows xp june 30, 2006 archive


Operating-System Versioning for Drivers under Windows XP



Download 107.39 Kb.
Page4/5
Date31.07.2017
Size107.39 Kb.
#25735
1   2   3   4   5

Operating-System Versioning for Drivers under Windows XP


The Windows XP operating system includes new capabilities that allow driver developers to specify different device INF file behavior based on the operating system version, including product type and product suite.

This article describes these capabilities and provides details about how developers can implement such support in device INF files. This article was previously published at this URL: http://www.microsoft.com/whdc/driver/install/OSVersion-XP.mspx


Background for Operating-System Versioning


For Windows 2000, there is no mechanism that can be used to ensure an INF file behaves differently on different versions of Windows NT-based operating systems, in the same way that decorations such as .NT, .NTx86 and .Ntia64 can be used to define architecture-specific behavior.

Because it was not previously possible to construct a device INF file for a newer operating system such that the INF would not be treated as valid under earlier releases, some vendors experienced problems with Windows 2000 when they needed to provide a different INF file for Windows NT 4.0. To work around these problems, vendors have created separate "NT4" directories to help stop users from inadvertently selecting the Windows 2000 INF when installing drivers on Windows NT 4.0.

In addition, when Windows 2000 ranks INF files, no preference is given to drivers that explicitly use NT-decorated DDInstall sections in the INF. So, an INF file that has no .NT platform extensions and is intended only for Windows 98 might be chosen in preference to a lower ranked INF file that includes NT-decorated sections. This problem is typically presented to the user with the following cryptic message:

The installation failed because a function driver was not specified for this device instance.

Under Windows XP, an enhancement to the device INF file format resolves problems related to differentiating operating system versions. By adding decorated [Models] sections to the INF, a vendor can create a single INF to install different drivers on Windows 2000 and Windows XP. With this enhancement, the vendor can completely differentiate among the following when designing their driver installation solutions:

Architecture Operating system major version
Operating system minor version
Product type (workstation, server, and domain controller)
Product suite (Enterprise, Datacenter, Small Business Server, and so on)

Vendors who do not need to differentiate between the two versions of Windows can provide customers with their existing, unchanged Windows 2000 INF files to install drivers on 32-bit versions of Windows XP.

Vendors who want to provide a single INF for installing drivers under both 32-bit and 64-bit versions of Windows XP must use .ntia64, the new decoration defined for 64-bit drivers. For information about this new decoration and related topics, see "Creating INF Files for Multiple Platforms and Operating Systems" in the Windows DDK. See also INF Platform Extension for 64-bit Versions of Windows XP.

Windows XP Changes to the INF [Manufacturer] Section


The [Manufacturer] section in an INF identifies the manufacturer of one or more devices that can be installed by using that INF file. To address the issues described in the previous section, the format of entries in the [Manufacturer] section of device INF files has been enhanced for Windows XP as follows:

[Manufacturer]
%strkey%=models-section-name [,TargetOSVersion] [,TargetOSVersion] ...

Where:


strkey

Specifies a token, unique within the INF, representing the name of a manufacturer. Each such %strkey% token must be defined in a Strings section of the INF file.

models-section-name

Specifies an INF-writer-defined name for the per-manufacturer INF [Models] section within the INF file. This value must be unique within the INF and must follow the general rules for defining section names defined in "General Syntax Rules for INF Files" in the Windows DDK.

TargetOSVersion

For Windows XP and later versions, this specifies one or more operating system versions with which the specified INF [Models] section can be used.

Details about using TargetOSVersionare are provided later in this article.


About the [Manufacturer] Section


Any INF that installs drivers for one or more devices must have a [Manufacturer] section. An IHV- or OEM-supplied INF typically specifies only a single entry in this section. If multiple entries are specified, each entry must be on a separate line of the INF.

The [Manufacturer] section of a system-supplied INF for a device setup class is sometimes called a Table of Contents because this section sets up the installation of every manufacturer's device models for that class. Each entry in an INF's [Manufacturer] section specifies both an easily localizable %strkey% token for the name of a manufacturer and a unique-to-the-INF per-manufacturer [Models] section name.

Using a %strkey%=models-section-name entry simplifies the localization of the INF for the international market, as described in "Creating International INF Files" in the Windows DDK. An alternate format for entries in the [Manufacturer] section can be used that simply identifies the device manufacturer, but which cannot be localized and which does not take the TargetOSVersiondecoration.

For more details, see "INF Manufacturer Section" in the Windows DDK.


About the TargetOSVersion

Decorations


For Windows XP and later versions of Windows, entries in the [Manufacturer] section can be decorated to specify operating system versions. The specified versions indicate with which operating system versions the specified INF [Models] sections will be used. If no versions are specified, Setup uses the specified [Models] section for all versions of all operating systems.

The format of TargetOSVersion,the version decoration, is as follows:



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

Where:


NT

Operating system version recognition is supported for Windows XP and later versions.

Architecture

Identifies the hardware platform. This must be x86 or ia64.

OSMajorVersion

A number representing the operating system's major version number. For Windows XP, this number is 5.

OSMinorVersion

A number representing the operating system's minor version number. For Windows XP, this number is 1.

ProductType

A number representing one of the VER_NT_xxxx flags defined in Winnt.h, such as:
0x0000001 (VER_NT_WORKSTATION)
0x0000002 (VER_NT_DOMAIN_CONTROLLER)
0x0000003 (VER_NT_SERVER)

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



SuiteMask

A number representing a combination of one or more of the VER_SUITE_xxxx flags defined in Winnt.H. These flags include:

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)

When this information is included, the INF will be used only if the operating system matches all of the specified product suites. If the INF supports multiple product suite combinations for a single operating system version, multiple TargetOSVersion entries are required.


For more information, see the discussion on the OSVERSIONINFOEX structure in the Microsoft Platform SDK.



IMPORTANT: If an INF supports multiple manufacturers, the rules described for TargetOSVersion and the [Models] sections must be followed for each manufacturer.

About the [Models] Sections


If your INF contains [Manufacturer] section entries with decorations, it must also include [Models] sections with names that match the operating system-version decorations. For example, if an INF contains the following [Manufacturer] section:

%FooCorp%=FooMfg, NT....0x80, NT

Then the INF must also contain [Models] sections with the following names:

[FooMfg.NT....0x08] ;Valid for XP and later, Datacenter only


[FooMfg.NT] ;Valid for XP and later, all product types and suites

For this example, Setup will use the [FooMfg.NT....0x08] [Models] section during installation if it is running on a version of Windows Server 2003, Datacenter Edition or later version. If it is running on a version of Windows Server 2003 or later that is not Datacenter Edition, then Setup will use the [FooMfg.NT] [Models] section.

If the INF is intended for use with Windows 2000, Windows NT 4.0, and Windows 98/Windows Millennium Edition (Windows Me) operating systems, it must also contain an undecorated [Models] section named [FooMfg].



Download 107.39 Kb.

Share with your friends:
1   2   3   4   5




The database is protected by copyright ©ininet.org 2024
send message

    Main page