共用方式為


從命令行執行 InfVerif

本主題列出從命令行執行InfVerif.exe時可用的選項。

注意

InfVerif 要求每個合併的路徑和檔名都必須小於 260 個字元。

USAGE: InfVerif.exe [/code <error code>] [/v] [[/h] | [/w] | [/u] | [/k]]
                    [/rulever <Major.Minor.Build> | vnext]
                    [/wbuild <Major.Minor.Build>] [/info] [/stampinf]
                    [/l <path>] [/osver <TargetOSVersion>] [/product <ias file>]
                    [/provider <ProviderName>] <files>

/code <error code>
        Display help information for an error code.

/v
        Display verbose file logging details.

/h
        Reports errors using WHQL Signature requirements. (mode)

        This mode uses requirements that always align with the requirements
        to get a WHQL signature, current as of this InfVerif version. These
        requirements may change build-to-build.

        This mode can be combined with '/rulever vnext' to preview proposed
        future requirements.

/w
        Reports errors using Windows Driver requirements. (mode)

/u
        Reports errors using Universal Driver requirements. (mode)

/k
        Reports errors using Declarative Driver requirements. (mode)

/wbuild <Major.Minor.Build>
        For Windows Drivers that have downlevel support, specifies
        the build number where /w should be enforced.
        Defaults to 10.0.17763

/rulever <Major.Minor.Build>
        To use a previous or future version of InfVerif enforcement, specifies
        the build number to use rule enforcement from.
        Defaults to the current InfVerif version

/info
        Displays INF summary information.

/stampinf
        Treat $ARCH$ as a valid architecture, to validate
        pre-stampinf files.

/l <path>
        An inline-annotated HTML version of each INF
        file will be placed in the <path>.

/osver <TargetOsVersion>
        Process the INF for only a specific target OS.
        Formatting is the same as a Models section, i.e. NTAMD64.6.0

/product <ias file>
        Validates all include/needs directives against
        the product definition in the ias file.

/provider <ProviderName>
        Reports an error for INFs not using the specified provider name.

<files>
        A space-separated list of INF files to analyze.
        All files must have .inf extension.
        Wildcards (*) may be used.

Only one mode option may be passed at a time.

如需錯誤碼的資訊,請參閱 INF 驗證錯誤和警告

詳細資訊選項會將一行新增至輸出,指定 INF 是否有效。 某些自變數會標記為模式,其中應該只傳遞一個自變數。

如需 TargetOSVersion 格式設定的範例,請參閱 INF Manufacturer 區段的一節

若要驗證多個 INF 檔案,請提供多個檔案名或使用通配符:

infverif.exe /w test1.inf test2.inf
infverif.exe /w test*.inf

Windows 10 版本 1703 的新功能: 資訊選項特別適合用來驗證 INF 適用性。 它會報告每個支援的硬體識別碼,以及有效的架構和最低 OS 版本。 您可以將 /info 和 /osver 一起使用,以驗證 INF 在 OS 版本和架構之間的適用性。

Windows 10 版本 1809 的新功能:如果您要開發 Windows 驅動程式,請使用 infverif /w (理想情況下為 /v) 來判斷與 DCH 設計原則之宣告式 (D) 原則相容性。 旗/w標也會檢查 INF 是否符合開始使用 Windows 驅動程式驅動程式套件隔離需求。

新的 Windows 11 版本 24H2: 引進了新的 '/code' 自變數,以提供錯誤碼的擴充詳細數據。 引進了新的模式 'infverif /h',以判斷 INF 檔案是否符合 WHQL 簽署驅動程式套件 硬體開發人員中心 的需求。 如需 'infverif /h' 的其他詳細數據,請參閱 InfVerif /h

InfVerif 和 MSBuild 工作

MSBuild 會在 Stampinf 工作之後自動執行 InfVerif 作為工作。 它會使用專案屬性中的目標平臺Configuration Properties-Driver> 設定) 自動設定,如下所示:

  • 目標平臺 = 桌面使用 InfVerif /h
  • 目標平臺 = 通用用途 InfVerif /u
  • 目標平臺 = Windows 驅動程式使用 InfVerif /w

無法變更該自動調用。 如果您想要使用上述的其他設定,您可以使用.vcxproj檔案中的自定義目標,以獨立方式執行 InfVerif,或呼叫InfVerif.exe。