INF ファイルの参照

次の例では、システム提供の INF ファイルから選択したフラグメントを示して、INF ファイルがセクションで構成される方法を示します。各ファイルには 0 行以上の行が含まれ、その一部は追加の INF ライター定義セクションを参照するエントリです。

[Version]
Signature   = "$Windows NT$"
Class       = Mouse
ClassGUID   = {4D36E96F-E325-11CE-BFC1-08002BE10318}
Provider    = %Provider% ; defined later in Strings section
DriverVer   = 09/28/1999,5.0.2136.1
CatalogFile = ExampleCatalog.cat
PnpLockdown = 1

[DestinationDirs]
DefaultDestDir = 13

; ... [ControlFlags] section omitted here

[Manufacturer]
%StdMfg% = StdMfg ; (Standard types)
%MSMfg%  = MSMfg  ; Microsoft
; ... other Manufacturer 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"
; ...

前の INF ファイル内のいくつかのセクションには、Version、, DestinationDirs、, Manufacturer、Strings などのシステム定義の名前があります。 Version、DestinationDirs、Stringsなどの一部の名前付きセクションには、単純なエントリしかありません。 他のユーザーは、Manufacturer セクションの前の例に示すように、追加の INF ライター定義セクションを参照します。

前の例の Manufacturer セクションから始まる、マウス デバイス ドライバーのインストールに関連するセクションの暗黙の階層に注意してください。 次の図は、INF ファイル内のいくつかのセクションの階層を示しています。

diagram illustrating a sample hierarchy of sections in an inf file.

INF ファイルの暗黙の階層については、次の点に注意してください。

  • Manufacturer% セクションの% xxMfg エントリは、INF ファイル内の別の場所にある製造元ごとの Modelsセクション (StdMfg、MSMfg) を参照します。

  • Models セクションでは、エントリの数を指定します。この例では xxx%始まります。DeviceDesc% トークン。

    このような %xxx のそれぞれ。DeviceDesc% トークンは、その製造元の製品ラインの一部のモデルごとの DDInstall セクション (Ser_InstとInp_Inst) を参照します。各エントリは、1 つのデバイス (*PNP0F0C と *PNP0F0Dを識別するため、ここに示す "DeviceDesc" またはデバイスの互換性のあるモデルのセットを識別します。

  • このような 各 DDInstallXxx_Inst セクションには、特定のシステム定義拡張機能を追加したり、追加の INF ライター定義セクションを参照するディレクティブを含めたりすることができます。 たとえば、前の例でフラグメントとして表示される完全な INF ファイルにもSer_Instがあります。Services セクションとその Ser_Inst セクションには 、この INF ファイル内の別の場所にある Ser_CopyFiles セクションを参照する CopyFiles ディレクティブがあります。