FltAllocatePoolAlignedWithTag 函式 (fltkernel.h)

FltAllocatePoolAlignedWithTag 會配置裝置對齊的緩衝區,以用於非快取 I/O 作業。

語法

PVOID FLTAPI FltAllocatePoolAlignedWithTag(
  [in] PFLT_INSTANCE Instance,
  [in] POOL_TYPE     PoolType,
  [in] SIZE_T        NumberOfBytes,
  [in] ULONG         Tag
);

參數

[in] Instance

附加至磁碟區的呼叫端擁有迷你篩選驅動程序實例的不透明實例指標。 這個參數是必要的,而且不能是 NULL

[in] PoolType

要配置的集區類型。 下列其中之一:

NonPagedPool

PagedPool

NonPagedPoolCacheAligned

PagedPoolCacheAligned

如需可用集區內存類型的描述,請參閱 POOL_TYPE

[in] NumberOfBytes

要配置的位元元組數目。 這個參數是必要的,而且可以是零。

[in] Tag

指定已配置記憶體的集區標籤。 驅動程式通常會將集區標籤指定為一到四個 7 位 ASCII 字元的字串,並以單引號分隔 (,例如 'abcd') 。 此參數為必要參數,不能為零。

傳回值

如果沒有足夠的可用集區來滿足要求, FltAllocatePoolAlignedWithTag 會傳回 NULL 指標。 否則, FltAllocatePoolAlignedWithTag 會傳回新配置的緩衝區指標。

備註

FltAllocatePoolAlignedWithTag 會根據指定磁碟區的基礎裝置配置對齊的緩衝區。 非快取 I/O 需要這類裝置對齊的緩衝區。 (它們也可用於快取的 I/O.) 因此,呼叫執行非快取 I/O 的例程時,例如 FltReadFileFltWriteFile,迷你篩選驅動程式應該呼叫 FltAllocatePoolAlignedWithTag ,而不是 ExAllocatePoolWithTag

如果呼叫端指定 NumberOfBytes 參數的零值, FltAllocatePoolAlignedWithTag 會配置符合對齊需求的最小記憶體數量。

系統會將 Tag 參數所指定的集區標籤與配置的緩衝區產生關聯。 Windows 調試程式 (WinDbg) 之類的程式設計工具,可以顯示與每個配置緩衝區相關聯的集區卷標。 集區標籤的值通常會以反轉順序顯示。 例如,如果呼叫端將 『Fred』 當做 Tag 參數的值傳遞,如果傾印集區或追蹤調試程式中的集區使用量,這個值會顯示為 『derF』。

如需記憶體管理的詳細資訊,請參閱 記憶體管理

當不再需要 FltAllocatePoolAlignedWithTag 配置的緩衝區時,呼叫端會負責呼叫 FltFreePoolAlignedWithTag 來釋放它。

只有在指定 NonPagedXxxPoolType 時,FltAllocatePoolAlignedWithTag 的呼叫端才能在 IRQL DISPATCH_LEVEL執行。 否則,呼叫端必須在 IRQL <= APC_LEVEL執行。

規格需求

需求
目標平台 Universal
標頭 fltkernel.h (包含 Fltkernel.h)
程式庫 FltMgr.lib
IRQL <= APC_LEVEL (请参阅一节)

另請參閱

ExAllocatePoolWithTag

FltFreePoolAlignedWithTag

FltReadFile

FltWriteFile