从命令行运行 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 制造商部分的“备注”部分。

要验证多个 INF 文件,请提供多个文件名或使用通配符:

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

Windows 10 版本 1703 的新增功能:信息选项对于验证 INF 适用性特别有用。 它报告每个受支持的硬件 ID 以及有效的体系结构和最低 OS 版本。 可以将 /info 和 /osver 一起使用来验证 INF 在 OS 版本和体系结构中的适用性。

Windows 10 版本 1809 的新增功能:如果正在开发 Windows 驱动程序,请使用infverif /w(理想情况下/v)来确定与 DCH 设计原则声明性 (D) 原则的兼容性。 该 /w 标志还检查 INF 是否符合 Windows 驱动程序入门指南驱动程序包隔离要求。

Windows Insider Preview 内部版本 26080 中的新增功能:引入了新的“/code”参数,以提供有关错误代码的扩展详细信息。 引入了新的模式“infverif /h”,以确定 INF 文件是否满足硬件开发中心 WHQL 签名驱动程序包的要求。 有关“infverif /h”的其他详细信息,请参阅 InfVerif /h

InfVerif 和 MSBuild 任务

MSBuild 将 InfVerif 作为任务自动运行,就在 Stampinf 任务之后。 它使用项目属性(配置属性->驱动程序设置)中的目标平台自动配置,如下所示:

  • 目标平台 = 桌面使用InfVerif /h
  • 目标平台 = 通用使用 InfVerif /u
  • 目标平台 = Windows 驱动程序使用 InfVerif /w

无法更改该自动调用。 如果要使用上述其他设置,则可以使用 .vcxproj 文件中的自定义目标以独立方式运行 InfVerif 或调用InfVerif.exe。