设备驱动的INF文件介绍

参考一:百度百科

参考二:INF文件的节

参考三:wikipedia

参考四:MSDN: INF File



其中,MSDN的介绍比较全面,并提供PDF文档下载:

https://opbuildstorageprod.blob.core.windows.net/output-pdf-files/en-us/Win.wdkdocs/live/install.pdf

摘取部分如下:

Looking at an INF File

The following example shows selected fragments from a system-supplied class installer's INF file to show how any INF file is made up of sections, each of which contains zero or more lines, some of which are entries that reference additional INF-writer-defined sections:

[Version]
Signature="$Windows NT$"
Class=Mouse
ClassGUID={4D36E96F-E325-11CE-BFC1-08002BE10318}
Provider=%Provider% ; defined later in Strings section
DriverVer=09/28/1999,5.00.2136.1
 
[DestinationDirs]
DefaultDestDir=12 ; DIRID_DRIVERS
 
; ... [ControlFlags] section omitted here
 
[Manufacturer]
%StdMfg%    =StdMfg         ; (Standard types)
%MSMfg%     =MSMfg          ; Microsoft
; ... %otherMfg% entries omitted here
 
[StdMfg]  ; per-Manufacturer Models section 
; Std serial mouse
%*pnp0f0c.DeviceDesc%= Ser_Inst,*PNP0F0C,SERENUM\PNP0F0C,SERIAL_MOUSE
; Std InPort mouse
%*pnp0f0d.DeviceDesc%      = Inp_Inst,*PNP0F0D
     ; ... more StdMfg entries and following
     ; MSMfg and xxMfg Models sections omitted here
 
     ; per-Models DDInstall (Ser_Inst, Inp_Inst, etc.)
     ; sections also omitted here
 
[Strings] 
; where INF %strkey% tokens are defined as user-visible (and
; possibly as locale-specific) strings.
Provider = "Microsoft"
; ...
StdMfg   = "(Standard mouse types)"
MSMfg    = "Microsoft"
 
; ...
*pnp0f0c.DeviceDesc   = "Standard Serial Mouse"
*pnp0f0d.DeviceDesc   = "InPort Adapter Mouse"
; ... 
HID\Vid_045E&Pid_0009.DeviceDesc = "Microsoft USB Intellimouse"
; ... 

A few sections within the previous INF file have system-defined names, such as VersionDestinationDirsManufacturer, and Strings. Some named sections like VersionDestinationDirs, and Strings have only simple entries. Others reference additional INF-writer-defined sections, as shown in the previous example of the Manufacturer section.

Note the implied hierarchy of related sections for mouse device driver installations starting with the Manufacturer section in the previous example. The following figure shows the hierarchy of some sections in the INF file.

Diagram illustrating a sample hierarchy of sections in an INF file

Note the following about the implied hierarchy of an INF file:

  • Each %xxMfg% entry in the Manufacturer section references a per-manufacturer Models section (StdMfg, MSMfg) elsewhere in the INF file.

    The entries in the previous example use %strkey% tokens.

  • Each Models section specifies some number of entries; in the example they are %xxx.DeviceDesc% tokens.

    Each such %xxx.DeviceDesc% token references some number of per-models DDInstall sections (Ser_Inst and Inp_Inst) for that manufacturer's product line, with each entry identifying a single device (*PNP0F0C and *PNP0F0D, hence the "DeviceDesc" shown here) or a set of compatible models of a device.

  • Each such DDInstall-type Xxx_Inst section, in turn, can have certain system-defined extensions appended and/or can contain directives that reference additional INF-writer-defined sections. For example, the full INF file that is shown as fragments in the previous example also has a Ser_Inst.Services section, and its Ser_Inst section has a CopyFiles directive that references a Ser_CopyFiles section elsewhere in this INF file.



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值