Ctrpp task
The Windows Driver Kit (WDK) provides the Ctrpp task so that you can run the ctrpp.exe tool when you build your driver using MSBuild. For information about using ctrpp.exe, see CTRPP.
MSBuild uses the Ctrpp Item to send the parameters for the Ctrpp task to ctrpp.exe. The Ctrpp item in the project files accesses the item metadata for ctrpp.exe.
The following example shows how to edit the metadata in the .vcxproj file.
<ItemGroup>
<Ctrpp Include="a.manifest">
<GenerateHeaderFileForCounter>true</GenerateHeaderFileForCounter>
<HeaderFileNameForCounter>c:\test\abc.h</HeaderFileNameForCounter>
</Ctrpp>
</ItemGroup>
The following example shows the command-line invocation:
ctrpp.exe –ch "c:\test\abc.h" a.manifest
In the example above, MSBuild invokes ctrpp.exe on the file a.manifest, with the –ch option because the metadata GenerateHeaderFileForCounter is set to true. Also, MSBuild uses the HeaderFileNameForCounter metadata to specify the argument for the –ch option
Ctrpp Task Parameter | Item Metadata | Tool Switch | Description |
---|---|---|---|
Source | @(Ctrpp) | Required ITaskItem parameter. Specifies the counter manifest to be processed. | |
AddPrefix | %(Ctrpp.AddPrefix) | -prefix<prefix> | Optional string parameter. Specifies the prefix to be added to functions and variables generated. |
BackwardCompatibility | %(Ctrpp.BackwardCompatibility) | -backcompat | Optional Boolean parameter. Generates code that is binary compatible with operating systems prior to Windows 7. |
EnableLegacy | %(Ctrpp.EnableLegacy) | -Legacy | Optional Boolean parameter. Reverts to the previous ctrpp file. This switch causes ctrpp to generate four output files: two header files, a resource file, and a source code file. This mimics the behavior found in previous versions of ctrpp. The -o, -ch, -rc and -prefix options cannot be used in conjunction with -legacy. |
GeneratedCounterFilesPath | %(Ctrpp.GeneratedCounterFilesPath) | -sumPath<path> | Optional string parameter. Specifies the path to generate binary counter files default. |
GenerateHeaderFileForCounter | %(Ctrpp.GenerateHeaderFileForCounter) | If this is set to true, it enables the -ch switch. | |
HeaderFileNameForCounter | %(Ctrpp.HeaderFileNameForCounter) | -ch<filename> | Optional string parameter. Generates a header file that contains the counter names and ids. |
GenerateHeaderFileForProvider | %(Ctrpp.GenerateHeaderFileForProvider) | If this is set to true, it enables the -o switch. | |
HeaderFileNameForProvider | %(Ctrpp.HeaderFileNameForProvider) | -o<filename> | Optional string parameter. Generates header file for provider. |
GenerateMemoryRoutines | %(Ctrpp.GenerateMemoryRoutines) | -MemoryRoutines | Optional Boolean parameter. Generates memory allocation and free routine templates. |
GenerateNotificationCallback | %(Ctrpp.GenerateNotificationCallback) | -NotificationCallback | Optional Boolean parameter. Generates customized notification callback template. Similar to the "callback" attribute in the <provider> element. |
GenerateResourceSourceFile | %(Ctrpp.GenerateResourceSourceFile) | If this is set to true, it enables the -rc switch. | |
ResourceFileName | %(Ctrpp.ResourceFileName) | -rc<filename> | Optional string parameter. Generates resource source file. |
GenerateSummaryGlobalFile | %(Ctrpp.GeneratedSummaryGlobalFile) | -summary<path> | Optional string parameter. Generates binary counter file per provider generate summary global file GenSumResource.BIN. |