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 例程负责专门同步对泛型表的访问。 独占快速互斥体是用于此目的的最高效的同步机制。
默认情况下,作系统使用 splay 树来实现泛型表,但 RtlEnumerateGenericTableAvl 例程仅适用于 Adelson-Velsky/Landis (AVL) 树。 若要将泛型表例程配置为使用 AVL 树而不是驱动程序中的 splay 树,请在公共头文件中插入以下 define 语句,然后再包括 Ntddk.h:
#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(请参阅“备注”部分) |