RtlEnumerateGenericTableWithoutSplayingAvl function (ntddk.h)

The RtlEnumerateGenericTableWithoutSplayingAvl routine is used to enumerate the elements in a generic table.

Syntax

NTSYSAPI PVOID RtlEnumerateGenericTableWithoutSplayingAvl(
  [in]      PRTL_AVL_TABLE Table,
  [in, out] PVOID          *RestartKey
);

Parameters

[in] Table

A pointer to the generic table (RTL_AVL_TABLE). The table must have been initialized by calling RtlInitializeGenericTableAvl.

[in, out] RestartKey

An address of the element returned by the previous call to RtlEnumerateGenericTableWithoutSplayingAvl. Should be set to NULL if the enumeration is to start at the first element in the table.

To enumerate all elements in the table, use RtlEnumerateGenericTableWithoutSplayingAvl as follows:

RestartKey = NULL;
for (ptr = RtlEnumerateGenericTableWithoutSplayingAvl(Table, &RestartKey);
     ptr != NULL;
     ptr = RtlEnumerateGenericTableWithoutSplayingAvl(Table, &RestartKey)) {
        // Process the element pointed to by ptr
}

Return value

RtlEnumerateGenericTableWithoutSplayingAvl returns a pointer to the caller-defined structure associated with the element. It returns NULL if RestartKey is NULL and the table has no elements or if RestartKey is a returned pointer and there is no next element.

Remarks

The RtlEnumerateGenericTableWithoutSplayingAvl routine does not actually work with a splay tree but provides an analogous named routine to RtlEnumerateGenericTableWithoutSplayingAvl.

RtlEnumerateGenericTableWithoutSplayingAvl can be called repeatedly to process the caller's data in each element of a generic table.

By default, the operating system uses splay trees to implement generic tables, but the RtlLookupElementGenericTableFullAvl routine only works with Adelson-Velsky/Landis (AVL) trees. To configure the generic table routines to use AVL trees instead of splay trees in your driver, insert the following define statement in a common header file before including Ntddk.h:

#define RTL_USE_AVL_TABLES 0

If RTL_USE_AVL_TABLES is not defined, you must use the AVL form of the generic table routines. For example, use the RtlEnumerateGenericTableWithoutSplayingAvl routine instead of RtlEnumerateGenericTableWithoutSplaying. In the call to RtlEnumerateGenericTableWithoutSplayingAvl, the caller must pass a RTL_AVL_TABLE table structure rather than RTL_GENERIC_TABLE.

Callers of the* Rtl..GenericTableAvl* routines are responsible for exclusively synchronizing access to the generic table. An exclusive fast mutex is the most efficient synchronization mechanism to use for this purpose.

Callers of RtlEnumerateGenericTableWithoutSplayingAvl must be running at IRQL < DISPATCH_LEVEL if the caller-allocated memory for the generic table is pageable.

Requirements

Requirement Value
Target Platform Universal
Header ntddk.h (include Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL See Remarks section.

See also

RtlEnumerateGenericTableAvl

RtlInitializeGenericTableAvl

RtlIsGenericTableEmptyAvl

RtlNumberGenericTableElementsAvl