Using INX Files to Create INF Files
An INX file is an INF file that contains string variables that represent version information. When you build your driver using Microsoft Visual Studio, the build process runs the Stampinf tool to replace the string variables in INX files with text strings that represent a specific hardware architecture or a framework version. You can also manually run the Stampinf tool, which is located in the bin subdirectory of the WDK.
If you create INX files for your drivers, you do not have to maintain multiple version-specific INF files. Instead, you can create a single INX file and use Visual Studio or Stampinf to generate version-specific INF files when you need them.
To modify Stampinf properties within Visual Studio, open the Property Pages for your driver package project. Right-click the package project in Solution Explorer and select Properties. In the Property Pages for the package, click Configuration Properties, and then StampInf.
You can also manually run the Stampinf tool, which is located in the bin subdirectory of the WDK.
The WDK includes INX files for all the KMDF and UMDF sample drivers.
INX files can contain the following string variables:
Stampinf replaces this variable with an architecture-specific string. For example, if you are using an x86 build environment, the tool replaces $ARCH$ with "x86". You can use the $ARCH$ string wherever you need to specify a specific architecture within an INF file, such as within an INF Manufacturer section, as follows:
If you use the Stampinf tool's -k option, Stampinf replaces this variable with a string that represents a specific version of the KMDF co-installer. You can use the $KMDFCOINSTALLERVERSION$ variable when you specify the framework's co-installer within an INF file, such as within an INF DDInstall.CoInstallers section, as follows:
[ECHO_Device.NT.CoInstallers] AddReg=ECHO_Device_CoInstaller_AddReg CopyFiles=ECHO_Device_CoInstaller_CopyFiles [ECHO_Device_CoInstaller_AddReg] HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller" [ECHO_Device_CoInstaller_CopyFiles] WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
If you set the KMDF Version Number property in Visual Studio (or use the Stampinf tool's -k option), Stampinf replaces this variable with a string that represents a specific version of KMDF. You can use the $KMDFVERSION$ variable when you specify the framework's version within an INF file, such as when you specify the KmdfLibraryVersion directive, as follows:
KmdfLibraryVersion = $KMDFVERSION$
[SourceDisksFiles] WudfUpdate_$UMDFCOINSTALLERVERSION$.dll=1 [CoInstallers_CopyFiles] WudfUpdate_$UMDFCOINSTALLERVERSION$.dll [CoInstallers_AddReg] HKR,,CoInstallers32,0x00010000,"WUDFUpdate_$UMDFCOINSTALLERVERSION$.dll"
Stampinf also supports a -u option to replace UMDF string variables in an INX file. If your driver package includes both UMDF-based drivers and KMDF-based drivers, you can use the -k and -u options with a single Stampinf command and a single INX file.