HW_INITIALIZE_TRACING回呼函式 (storport.h)
HwStorInitializeTracing 回呼例程可讓 Storport 虛擬迷你埠驅動程式設定追蹤和任何相關資源。
語法
HW_INITIALIZE_TRACING HwInitializeTracing;
void HwInitializeTracing(
PVOID Arg1,
PVOID Arg2
)
{...}
參數
Arg1
傳遞至 StorPortInitialize的第一個參數。
Arg2
傳遞至 storPortInitialize 的第二個參數。
傳回值
沒有
言論
HwStorInitializeTracing 的名稱是實際例程名稱的佔位元文字。 此例程的實際原型定義於 Storport.h 中,如下所示:
typedef
VOID
HW_INITIALIZE_TRACING (
_In_ PVOID Arg1,
_In_ PVOID Arg2
);
埠驅動程式會在 PASSIVE_LEVEL呼叫 Storport 虛擬迷你埠的 HwStorInitializeTracing。
例子
若要定義 HwStorInitializeTracing 回呼函式,您必須先提供函式宣告,以識別您要定義的回呼函式類型。 Windows 提供一組驅動程式的回呼函式類型。 使用回呼函式類型宣告函式有助於 驅動程式的程式代碼分析、靜態驅動程式驗證器 (SDV)和其他驗證工具尋找錯誤,而且是撰寫 Windows作系統驅動程式的需求。
例如,若要定義名為 MyHwInitializeTracingHwStorInitializeTracing 回呼例程,請使用 HW_INITIALIZE_TRACING 類型,如下列程式代碼範例所示:
HW_INITIALIZE_TRACING MyHwInitializeTracing;
然後,實作回呼例程,如下所示:
_Use_decl_annotations_
VOID
MyHwInitializeTracing (
_In_ PVOID Arg1,
_In_ PVOID Arg2
);
{
...
}
HW_INITIALIZE_TRACING 函式類型定義於 Storport.h 頭檔中。 若要在執行程式代碼分析工具時更準確地識別錯誤,請務必將 Use_decl_annotations 批註新增至函式定義。 Use_decl_annotations 批注可確保會使用套用至頭檔中 HW_INITIALIZE_TRACING 函式類型的批注。 如需函式宣告需求的詳細資訊,請參閱 使用 Storport 驅動程式的函式角色類型來宣告函式。 如需 Use_decl_annotations的相關信息,請參閱 批注函式行為。
要求
要求 | 價值 |
---|---|
目標平臺 | 普遍 |
標頭 | storport.h (包括 Storport.h) |