下面概述了 INF 文件中可使用的系统定义部分。 系统定义的部分名称不区分大小写。 For example, version, VERSION, and Version are equally valid section-names within an INF file.
本部分将按照 INF 文件各部分在大多数设备 INF 文件中出现的顺序进行介绍。 但是,这些部分实际上可以按照任意顺序指定。 无论是系统定义的还是 INF 编写器定义的 INF 文件,Windows 都是按部分名称而不是按顺序来查找每个 INF 文件中的所有部分。
Version Section
这是每个 INF 文件都必须包含的部分。 For installation on Windows 2000 and later versions of Windows, this section must have a valid Signature entry.
SignatureAttributes Section
INF 的这一部分定义了作为硬件认证一部分的一组嵌入式签名文件。 有某些特殊需求的设备需要这些附加签名。 例如,受保护的环境媒体播放、早期启动反恶意软件和第三方 HAL 扩展。
SourceDisksNames Section
This section is required if the INF file has a corresponding SourceDisksFiles section.
SourceDisksFiles Section
本部分确定了要从分发介质安装到目标计算机上的目标的文件位置。 An INF file that has this section must also have a SourceDisksNames section.
DestinationDirs Section
INF files have a DestinationDirs section to specify destination directories for any files that the INF references with a CopyFiles directive. This section is required if the INF uses CopyFiles.
ControlFlags Section
Generally, most INF files for device drivers and for the system class installers have this section so they can exclude, via the ExcludeFromSelect directive, at least a subset of Models entries from the list of manually installable devices to be displayed to end-users. 只安装 PnP 设备的 INF 文件会禁止显示所有特定型号的信息。
Manufacturer Section
设备及其驱动程序的 INF 文件中必须包含这一部分。
The Manufacturer section of an INF file is sometimes called a "Table of Contents," because each of its entries references an INF-writer-defined Models section, which, in turn, references additional INF-writer-defined sections, such as a per-models-entry DDInstall section, DDInstall.Services section, and so forth.
Models Section (per Manufacturer entry)
本部分用于确定 INF 文件要安装驱动程序的设备。 It specifies a set of mappings between the generic name (string) for a device, the device ID, and the name of the DDInstall section, elsewhere in the INF file that contains the installation instructions for the device.
An INF file that installs one or more devices and drivers for a single provider would have only one Models section, but system INF files for device classes can have many INF-writer-defined Models sections.
DDInstall Section (per Models entry)
This section is required to actually install any devices that are listed in a Models section in the INF file, along with the drivers for each such device. A DDInstall section can be shared by more than one Models section.
DDInstall.Services Section
如果作为安装设备的一部分,INF 文件需要在系统上创建任何服务,则必须包含此部分。 本部分控制创建服务的启动方式和时间、对其他服务的依赖性(如有)等。 如果设备驱动程序支持事件日志记录,则本部分还将设置该设备驱动程序的事件日志记录服务。
DDInstall.HW Section
此可选部分会将特定于设备(通常与驱动程序无关)的信息添加到注册表中。
此可选部分允许 INF 注册 ETW 提供程序并创建 AutoLogger 注册。
This optional section allows for one or more AddComponent directives to be specified to create child component devices.
This optional section allows for one or more AddSoftware directives to be specified to install standalone software.
DDInstall.Interfaces Section
如果驱动程序导出了设备接口类的功能,从而创建了接口类的新实例,如内核流静态图像捕获或数据解压缩,则其 INF 文件可以包含这一部分。 此部分可用于将设备接口预先创建为禁用接口,并由 INF 文件提供一些初始状态。
InterfaceInstall32 Section
如果要安装的组件(如新的类驱动程序)为上一级组件提供了一个或多个新的设备接口类,则其 INF 文件可以包含这一部分。 这可用于在设备接口类中注册任何接口之前预先创建该接口类。 在类中注册接口并不需要预先创建类,但 INF 中的这一部分允许 INF 将某些状态与设备接口类关联起来。
DDInstall.FactDef Section
Note If you are building a universal or "Windows Driver" driver package, this section is not valid. 请参阅使用通用 INF 文件。
此部分应包含在任何手动安装的非 PnP 设备的 INF 文件中。 它指定卡的出厂默认硬件配置设置,如总线相关 I/O 端口、IRQ(如有)等。
DDInstall.LogConfigOverride Section
Note If you are building a universal or "Windows Driver" driver package, this section is not valid. 请参阅使用通用 INF 文件。
This section is used to create an override configuration, which overrides the hardware resource requirements that a Plug and Play device's bus driver reports.
DefaultInstall Section
An INF file's DefaultInstall section will be accessed if a user selects the "Install" menu item after selecting and holding (or right-clicking) on the INF file name.
DefaultInstall.Services Section
此部分与 INF DDInstall.Services 部分相同,并与 INF DefaultInstall 部分关联使用。
Strings Section
This section is required in every INF file to define each %strkey% token specified in the INF. By convention, the Strings section (or sections if the INF provides a set of locale-specific Strings sections) appears last in all system-supplied INF files for ease of maintenance and localization.
Some sections listed here, especially those with Install in their names, can contain directives that reference additional INF-writer-defined sections. 在安装过程中,每个指令都会导致对 INF-writer-defined 部分的相应类型下所列项目执行特定操作。
前面列表中任何特定部分的有效条目和指令集都特定于部分,并会显示在每一部分的引用的正式语法中。 此外,请参阅 INF 指令摘要,了解最常用指令的摘要。