共用方式為


Command-Line輸出

當您將命令提交至 SDV 時,它會在命令執行時顯示命令的相關資訊、指出命令成功或失敗的狀態訊息,以及可能已產生的任何錯誤訊息或警告。 驗證結果的摘要會出現在輸出底部。

例如,下圖顯示命令的命令列輸出,以使用 SpinLock 規則來驗證 SDV-FailDriver-WDM 範例驅動程式。 具有刻意編碼錯誤的驅動程式 SDV-FailDriver-WDM 範例驅動程式位於 Windows 驅動程式範例的 \tools\sdv\samples\Sdv-FailDriver-WDM 資料夾中。

在此驗證中,SDV 發現驅動程式違反規則。

G:\Windows-driver-samples\tools\sdv\samples\SDV-FailDriver-WDM\driver>msbuild /p:Configuration=Release /p:Platform=x64 /t:sdv /p:inputs=/check:spinlock
Microsoft (R) Build Engine version 15.6.82.30579 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 3/30/2018 10:56:50 AM.
Project "G:\Windows-driver-samples\tools\sdv\samples\SDV-FailDriver-WDM\driver\fail_driver1.vcxproj" on node 1 (sdv tar
get(s)).
sdv:
  staticdv /check:spinlock
  SDV: H:\Program Files\Windows Kits\10\TOOLS\SDV
  SMV: H:\Program Files\Windows Kits\10\TOOLS\SDV\smv
  SDVAP: H:\Program Files\Windows Kits\10\TOOLS\SDV\smv\analysisplugins\sdv
  Build environment: msbuild
  [INFO] Cleaning ...
  [INFO] Setting interceptor platform to x64
  [INFO] Setting platform to x86_amd64
  [INFO] Validating XML against schema: H:\Program Files\Windows Kits\10\TOOLS\SDV\smv\bin\Config.xsd
  [INFO] Running local scheduler with 8 threads
  [INFO] Driver type found: wdm
  [INFO] Currently reading and validating XML settings from H:\Program Files\Windows Kits\10\TOOLS\SDV\data\wdm\sdv-def
  ault.xml

  [INFO] 1 of 2 jobs remaining. Avg(s): 8.00. Std.Dev(s): 0.00
  [INFO] 1 of 3 jobs remaining. Avg(s): 9.00. Std.Dev(s): 1.00
  Scan ...Done

  [INFO] 0 of 3 jobs remaining. Avg(s): 6.00. Std.Dev(s): 4.32

  Building ...Done
  [INFO] Using plugin SdvPlugin.SmvSdv for analysis.
  [INFO] Running analysis on 11 precondition(s) & 1 rule(s) ...
  [INFO] Checking preconditions...

  [INFO] 10 of 15 jobs remaining. Avg(s): 7.20. Std.Dev(s): 3.66
  [INFO] 10 of 16 jobs remaining. Avg(s): 7.50. Std.Dev(s): 3.40
  [INFO] 11 of 17 jobs remaining. Avg(s): 7.50. Std.Dev(s): 3.40
  [INFO] 10 of 18 jobs remaining. Avg(s): 9.13. Std.Dev(s): 4.08
  [INFO] 11 of 19 jobs remaining. Avg(s): 9.13. Std.Dev(s): 4.08
  [INFO] 10 of 20 jobs remaining. Avg(s): 11.30. Std.Dev(s): 5.68
  [INFO] 11 of 21 jobs remaining. Avg(s): 11.30. Std.Dev(s): 5.68
  [INFO] 11 of 22 jobs remaining. Avg(s): 12.18. Std.Dev(s): 6.09
  [INFO] 10 of 22 jobs remaining. Avg(s): 11.92. Std.Dev(s): 5.89
  [INFO] 10 of 23 jobs remaining. Avg(s): 12.15. Std.Dev(s): 5.72
  [INFO] 10 of 24 jobs remaining. Avg(s): 12.64. Std.Dev(s): 5.79
  [INFO] 7 of 25 jobs remaining. Avg(s): 13.50. Std.Dev(s): 5.80
  [INFO] 7 of 25 jobs remaining. Avg(s): 13.50. Std.Dev(s): 5.80
  [INFO] 7 of 25 jobs remaining. Avg(s): 13.50. Std.Dev(s): 5.80
  [INFO] 7 of 25 jobs remaining. Avg(s): 13.50. Std.Dev(s): 5.80
  [INFO] 6 of 25 jobs remaining. Avg(s): 13.42. Std.Dev(s): 5.65
  [INFO] 5 of 25 jobs remaining. Avg(s): 13.75. Std.Dev(s): 5.69
  [INFO] 4 of 25 jobs remaining. Avg(s): 13.95. Std.Dev(s): 5.63
  [INFO] 3 of 25 jobs remaining. Avg(s): 14.09. Std.Dev(s): 5.53
  [INFO] 2 of 25 jobs remaining. Avg(s): 14.13. Std.Dev(s): 5.42
  [INFO] 1 of 25 jobs remaining. Avg(s): 14.17. Std.Dev(s): 5.30
  [INFO] 0 of 25 jobs remaining. Avg(s): 14.20. Std.Dev(s): 5.20
  [INFO] Precondition check(s) completed.
  [INFO] Verifying rules...

  [INFO] 1 of 27 jobs remaining. Avg(s): 13.65. Std.Dev(s): 5.78
  [INFO] 1 of 28 jobs remaining. Avg(s): 13.37. Std.Dev(s): 5.86
  [INFO] 0 of 28 jobs remaining. Avg(s): 13.21. Std.Dev(s): 5.81

  [INFO] 1 defects found.
  [INFO] Please review using '/view' argument for SDV.

  [INFO] Total time taken 96 seconds
  [INFO] Found 1 bugs!
Done Building Project "G:\Windows-driver-samples\tools\sdv\samples\SDV-FailDriver-WDM\driver\fail_driver1.vcxproj" (sdv
 target(s)).


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:37.93

檢視結果摘要以查看違反哪些規則之後,您可以在 MSBuild 命令中指定 /view 選項,以查看靜態驅動程式驗證器報告。 如需命令選項的相關資訊,請參閱 MSBuild) (靜態驅動程式驗證程式命令 。 如需輸出中的 掃描建置檢查 步驟的相關資訊,請參閱 驗證程式

下表描述結果摘要中可以顯示的結果。

結果類型 描述

規則傳遞

SDV 驗證的規則數目,但無法證明任何違反規則的規則。

缺陷

SDV 偵測到的規則違規數目。

不適用

SDV 無法驗證的規則數目,可能是因為驅動程式不支援分析所需的進入點,或因為驅動程式未呼叫規則所監視的函式。

如果此值大於 0,請確認 Sdv-map.h 檔案內容正確無誤。

逾時

SDV 停止驗證的規則數目,因為它超過驗證每個規則的時間限制。 時間限制是在 靜態驅動程式驗證器選項檔案中設定,Sdv-default.xml。

此結果是由 SDV 中的限制所造成。 它不會指出驅動程式發生錯誤。

空白字元

SDV 停止驗證的規則數目,因為它超過驗證規則的記憶體限制。 記憶體限制是在 靜態驅動程式驗證器選項檔案中設定,Sdv-default.xml。

此結果是由 SDV 中的限制所造成。 它不會指出驅動程式發生錯誤。

其他

SDV 發生內部錯誤而無法復原的次數。