共用方式為


Ctrpp task

Windows 驅動程式套件 (WDK) 提供 Ctrpp 工作,讓您在使用 MSBuild 建置驅動程式時執行 ctrpp.exe 工具。 For information about using ctrpp.exe, see CTRPP.

MSBuild 會使用 Ctrpp 專案將 Ctrpp 工作的參數傳送至 ctrpp.exe。 專案檔案中的 Ctrpp 項目會存取 ctrpp.exe的項目中繼資料。

下列範例示範如何在.vcxproj檔案中編輯元數據。

<ItemGroup>
    <Ctrpp Include="a.manifest">
      <GenerateHeaderFileForCounter>true</GenerateHeaderFileForCounter>
      <HeaderFileNameForCounter>c:\test\abc.h</HeaderFileNameForCounter>
    </Ctrpp>
</ItemGroup>

下列範例顯示命令列呼叫:

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 任務參數 Item Metadata Tool Switch Description
Source @(Ctrpp) 必要的 ITaskItem 參數。 指定要處理的計數器資訊清單。
AddPrefix %(Ctrpp.AddPrefix) -prefix<prefix> 選擇性字串參數。 指定要新增至產生的函數和變數的字首。
BackwardCompatibility %(Ctrpp.BackwardCompatibility) -backcompat 選用布林參數。 產生與 Windows 7 之前的作業系統相容的二進位程式代碼。
EnableLegacy %(Ctrpp.EnableLegacy) -Legacy 選用布林參數。 還原至先前的 ctrpp 檔案。 此參數會導致 ctrpp 產生四個輸出檔案:兩個標頭檔、一個資源檔和一個原始程式碼檔。 這模擬了以前版本的 ctrpp 中的行為。 -o、-ch、-rc 及 -prefix 選項不能與 -legacy 一起使用。
GeneratedCounterFilesPath %(Ctrpp.GeneratedCounterFilesPath) -sumPath<path> 選擇性字串參數。 指定產生二進位計數器檔案預設值的路徑。
GenerateHeaderFileForCounter %(Ctrpp.GenerateHeaderFileForCounter) 如果設定為 true,則會啟用 -ch 開關。
HeaderFileNameForCounter %(Ctrpp.HeaderFileNameForCounter) -ch<filename> 選擇性字串參數。 產生包含計數器名稱和識別碼的標頭檔。
GenerateHeaderFileForProvider %(Ctrpp.GenerateHeaderFileForProvider) 如果設定為 true,則會啟用 -o 開關。
HeaderFileNameForProvider %(Ctrpp.HeaderFileNameForProvider) -o<filename> 選擇性字串參數。 產生提供者的標頭檔。
GenerateMemoryRoutines %(Ctrpp.GenerateMemoryRoutines) -MemoryRoutines 選用布林參數。 產生記憶體配置和可用例程範本。
GenerateNotificationCallback %(Ctrpp.GenerateNotificationCallback) -NotificationCallback 選用布林參數。 產生自定義的通知回呼範本。 類似於提供者>元素中的<「回呼」屬性。
GenerateResourceSourceFile %(Ctrpp.GenerateResourceSourceFile) 如果設定為 true,則會啟用 -rc 開關。
ResourceFileName %(Ctrpp.ResourceFileName) -rc<filename> 選擇性字串參數。 產生資源來源檔案。
GenerateSummaryGlobalFile %(Ctrpp.GeneratedSummaryGlobalFile) -summary<path> 選擇性字串參數。 為每個提供者產生二進位計數器檔案,產生摘要全域檔案GenSumResource.BIN。

CTRPP