Stampinf 任务

Windows 驱动程序工具包(WDK)提供 StampInf 任务,以便在使用 MSBuild 生成驱动程序时运行 stampinf.exe 工具。 有关 stampinf.exe 工具的信息,请参阅 Stampinf

Inf Item 发送 StampInf 任务的参数。 可以通过项目文件中的 Inf 项目项访问 stampinf 的项元数据。

以下示例演示如何编辑.vcxproj文件中的元数据。

<ItemGroup>
    <Inf Include="a.inf">
      <SpecifyArchitecture>true</SpecifyArchitecture>
      <Architecture>x86</Architecture>
    </Inf>
    <Inf Include="b.inf">
      <SpecifyArchitecture>false</SpecifyArchitecture>
      <Architecture>amd64</Architecture>
    </Inf>
</ItemGroup>

以下示例演示命令行调用:

stampinf.exe –a "x86" a.inf
stampinf.exe b.inf

在上面的示例中,MSBuild 在 a.inf 和 b.inf 上调用 stampinf.exe,但具有不同的参数集。 对于 b.inf,即使指定 了体系结构 元数据, SpecifyArchitecture 元数据也设置为 false。 因此,命令行上未启用 –a 开关。 如果将此元数据设置为 TRUE,则会在命令行上启用 –a amd64 。 通过这种方式,只需切换此元数据,不必编辑体系结构元数据本身。

StampInf 任务参数 项目元数据 工具开关
来源

必需的 ITaskItem 参数。 指定源文件的列表。

%(Inf.OutputPath)%(Inf.FileName).inf -f[source]
SpecifyArchitecture

如果设置为 true,这将启用 -a 开关。

%(Inf.SpecifyArchitecture)
建筑

可选字符串参数。 指定目标平台体系结构。

%(信息架构) -a[体系结构]
CatalogFile

可选字符串参数。 指定 INF 版本部分中的目录文件指令。

%(Inf.CatalogFileName) -c<catalogFile>
SpecifyDriverVerDirectiveDate

如果设置为 true,这将启用 –d 开关。

%(Inf.SpecifyDriverVerDirectiveDate)
DriverVerDirectiveDate

可选字符串

%(Inf.DateStamp) -d[date|]
DriverVerDirectiveSection

可选字符串参数。 指定 INF 节,在该节中应放置 INF DriverVer 指令。

%(Inf.DriverVersionSectionName) -s
SpecifyDriverVerDirectiveVersion

如果设置为 true,这将启用 –v 开关。

%(Inf.指定驱动程序指令版本)
驱动程序版本指令版本

可选字符串参数。 指定驱动程序指令中的版本号。

%(Inf.TimeStamp) -v[time|]
KmdfVersion

可选字符串参数。 指定此驱动程序所依赖的 KMDF 版本。

%(Inf.KmdfVersionNumber) -k<版本>
MinimalRebuildFromTracking

可选的布尔参数。 如果为 true,则执行跟踪的增量生成。 否则,将执行重新生成。

%(Inf.MinimalRebuildFromTracking)
ToolPath

可选字符串参数。 允许指定工具所在的文件夹的完整路径。

$(StampInfToolPath)
TrackerLogDirectory

可选字符串参数。 为跟踪器指定用于写入 tlog 的日志目录。

%(Inf.StampInfTrackerLogDirectory)
TrackFileAccess

可选的布尔参数。 如果为 true,则跟踪此任务的文件访问模式。

$(TrackFileAccess)
UmdfVersion

可选字符串参数。 指定此驱动程序所依赖的 UMDF 版本。

%(Inf.UmdfVersionNumber) -u<版本>
冗长

可选的布尔参数。 启用 Stampinf 输出的详细程度。

%(Inf.EnableVerbose) -n