共用方式為


Storport) (VirtualStorport 規則集

使用這些規則來確認驅動程式已正確呼叫 Storport 虛擬迷你埠 (VMiniport) 驅動程式特別感興趣的 DIS。

本節內容

主題 描述

DoubleExFreePool

此規則會確認驅動程式不會嘗試釋放相同的集區內存區塊兩次。

DoubleKeSetEvent

此規則會確認相同的事件物件上未呼叫 KeSetEvent 兩次。 如果相同的事件對象傳遞至例程,驅動程式會失敗規則。

IoFreeIrp

此規則會確認 IoAllocateIrp 所配置的 IRP 將由 IoFreeIrp 釋放,或其完成例程將由 IoSetCompletionRoutine 設定。

StorPortVirtualDevice

此規則會確認從 HwStorFindAdapter 例程結束時,PORT_CONFIGURATION_INFORMATION (Storport) 結構的 VirtualDevice 字段已設定為 FALSE。 此規則僅適用於實體 StorPort 迷你埠。

StorPortVirtualDevice2

此規則會確認從 HwStorFindAdapter 例程結束時,PORT_CONFIGURATION_INFORMATION (Storport) 結構中的 VirtualDevice 字段已設定為 TRUE。 此規則僅適用於虛擬 StorPort 迷你埠。

WithinCriticalRegion

此規則會確認驅動程式對特定同步處理函式的呼叫只有在停用一般核心 APC 傳遞時才會進行。

ZwRegistryCreate

此規則會驗證使用 ZwCreateKey 建立之登錄機碼的句柄後續會由其他 ZwXxx 例程正確使用。 ZwOpenKey 例程不得在已經開啟的句柄上呼叫。 例程 ZwEnumerateKeyZwEnumerateValueKeyZwFlushKeyZwQueryKeyZwQueryValueKeyZwSetValueKeyZwCloseZwDeleteKey 不得在未開啟的句柄上呼叫。 傳回之前,也必須關閉句柄。

ZwRegistryOpen

此規則會驗證其他 ZwXxx 例程後續會正確使用透過 ZwOpenKey 開啟之登錄機碼的句柄。 例程 ZwEnumerateKeyZwEnumerateValueKeyZwFlushKeyZwQueryKeyZwQueryValueKeyZwSetValueKeyZwCloseZwDeleteKey 不得在未開啟的句柄上呼叫。 傳回之前,也必須關閉句柄。

若要選取 VirtualStorport 規則集

  1. 在 Microsoft Visual Studio 中選取您的驅動程式專案 (.vcxProj) 。 從 [ 驅動程式] 功能表中,按兩下 [ 啟動靜態驅動程序驗證程式...]。

  2. 按兩下 [ 規則] 索引 標籤。在 [規則集] 底下,選取 [VirtualStorport]。

    若要從 Visual Studio 開發人員命令提示字元視窗中選取預設規則集,請使用 /check 選項指定 VirtualStorport.sdv。 例如:

    msbuild /t:sdv /p:Inputs="/check:VirtualStorport.sdv" mydriver.VcxProj /p:Configuration="Win8 Release" /p:Platform=Win32
    

    如需詳細資訊,請參閱 使用靜態驅動程式驗證器在驅動程式靜態驅動程式驗證器命令中尋找瑕疵, (MSBuild)