Stampinf task

The Windows Driver Kit (WDK) provides the StampInf task so that you can run the stampinf.exe tool when you build your driver using MSBuild. For information about the stampinf.exe tool, see Stampinf.

The Inf Item sends the parameters for the StampInf task. The item metadata for stampinf is accessed by using the Inf item in project files.

The following example shows how the edit metadata in the .vcxproj file.

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

The following example shows the command-line invocation:

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

In the example above, MSBuild invokes stampinf.exe on both a.inf and b.inf, but with different sets of parameters. In the case of b.inf, even though the Architecture metadata is specified, the SpecifyArchitecture metadata is set to false. Therefore, the –a switch is not enabled on the command line. If you set this metadata to TRUE, then it will enable –a amd64 on the command line. In this way, you can just toggle this metadata and not have to edit the architecture metadata itself.

StampInf Task Parameter Item Metadata Tool Switch
Source

Required ITaskItem parameter. Specifies a list of source files.

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

This will enable the -a switch if set to true.

%(Inf.SpecifyArchitecture)
Architecture

Optional string parameter. Specifies the target platform architecture.

%(Inf.Architecture) -a[architecture]
CatalogFile

Optional string parameter. Specifies the catalog file directive in the INF version section.

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

This will enable the –d switch if set to true.

%(Inf.SpecifyDriverVerDirectiveDate)
DriverVerDirectiveDate

Optional string

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

Optional string parameter. Specifies the INF section in which the INF DriverVer directive should be placed.

%(Inf.DriverVersionSectionName) -s
SpecifyDriverVerDirectiveVersion

This will enable the –v switch if set to true.

%(Inf.SpecifyDriverDirectiveVersion)
DriverVerDirectiveVersion

Optional string parameter. Specifies the version number in the driver directive.

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

Optional string parameter. Specifies the version of KMDF that this driver depends on.

%(Inf.KmdfVersionNumber) -k<version>
MinimalRebuildFromTracking

Optional Boolean parameter. If true, a tracked incremental build is performed. Otherwise, a rebuild is performed.

%(Inf.MinimalRebuildFromTracking)
ToolPath

Optional string parameter. Allows you to specify the full path to the folder where the tool is located.

$(StampInfToolPath)
TrackerLogDirectory

Optional string parameter. Specifies a log directory for tracker to write tlogs.

%(Inf.StampInfTrackerLogDirectory)
TrackFileAccess

Optional Boolean parameter. If true, tracks file access patterns for this task.

$(TrackFileAccess)
UmdfVersion

Optional string parameter. Specifies the version of UMDF that this driver depends on.

%(Inf.UmdfVersionNumber) -u<version>
Verbosity

Optional Boolean parameter. Enables the verbosity of Stampinf output.

%(Inf.EnableVerbose) -n