共用方式為


RtlEnumerateGenericTableAvl 函式 (ntddk.h)

RtlEnumerateGenericTableAvl 例程是用來列舉泛型數據表中的元素。

語法

NTSYSAPI PVOID RtlEnumerateGenericTableAvl(
  [in] PRTL_AVL_TABLE Table,
  [in] BOOLEAN        Restart
);

參數

[in] Table

泛型數據表的指標(RTL_AVL_TABLE)。 數據表必須藉由呼叫 RtlInitializeGenericTableAvl來初始化。

[in] Restart

如果列舉是要從數據表的第一個項目開始,則設定為 TRUE。 如果從上一個呼叫繼續列舉,請將 設定為 FALSE

若要列舉數據表中的所有元素,請使用 RtlEnumerateGenericTableAvl,如下所示:

for (p = RtlEnumerateGenericTableAvl ( Table, TRUE );
     p != NULL;
     p = RtlEnumerateGenericTableAvl ( Table, FALSE )) {
        // Process the element pointed to by p
}

傳回值

RtlEnumerateGenericTableAvl 傳回下一個專案的指標,如果有的話。 如果資料表中沒有其他元素,RtlEnumerateGenericTableAvl 會傳回 NULL

言論

Rtl.的呼叫端。GenericTableAvl 例程負責獨佔同步處理泛型數據表的存取權。 獨佔快速 Mutex 是用於此用途的最有效率的同步處理機制。

根據預設,作系統會使用 splay 樹狀結構來實作泛型數據表,但 RtlEnumerateGenericTableAvl 例程只適用於 Adelson-Velsky/Landis (AVL) 樹狀結構。 若要將泛型數據表例程設定為使用AVL樹狀結構,而不是驅動程式中的splay樹狀結構,請在包含 Ntddk.h之前,在通用頭檔中插入下列 define 語句:

#define RTL_USE_AVL_TABLES 0

如果未定義RTL_USE_AVL_TABLES,您必須使用泛型數據表例程的AVL形式。 例如,使用 RtlEnumerateGenericTableAvl 例程,而不是 RtlEnumerateGenericTable。 在呼叫 RtlEnumerateGenericTableAvl中,呼叫端必須傳遞 RTL_AVL_TABLE 數據表結構,而不是 RTL_GENERIC_TABLE

RtlEnumerateGenericTableAvl 的呼叫端必須在 IRQL < DISPATCH_LEVEL 執行,如果呼叫端配置的泛型數據表記憶體可分頁。

要求

要求 價值
目標平臺 普遍
標頭 ntddk.h (包括 Ntddk.h、Ntifs.h、Fltkernel.h)
連結庫 NtosKrnl.lib
DLL NtosKrnl.exe
IRQL IRQL < DISPATCH_LEVEL (請參閱一節)

另請參閱

ExInitializeFastMutex

RtlEnumerateGenericTableWithoutSplayingAvl

RtlInitializeGenericTableAvl

RtlIsGenericTableEmptyAvl

RtlNumberGenericTableElementsAvl