From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/ntdll/rtl.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 1828b860531..a1647241283 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -674,11 +674,30 @@ BOOLEAN WINAPI RtlDeleteElementGenericTable(RTL_GENERIC_TABLE *table, void *valu */ void * WINAPI RtlEnumerateGenericTableWithoutSplaying(RTL_GENERIC_TABLE *table, PVOID *previous) { - static int warn_once; + RTL_SPLAY_LINKS *child;
- if (!warn_once++) - FIXME("(%p, %p) stub!\n", table, previous); - return NULL; + TRACE("(%p, %p)\n", table, previous); + + if (RtlIsGenericTableEmpty(table)) + return NULL; + + if (!*previous) + { + /* Find the smallest element */ + child = table->TableRoot; + while (RtlLeftChild(child)) + child = RtlLeftChild(child); + } + else + { + /* Find the successor of the previous element */ + child = RtlRealSuccessor(*previous); + if (!child) + return NULL; + } + + *previous = child; + return get_data_from_splay_links(child); }
/******************************************************************************