Author: ion Date: Mon Oct 16 07:51:49 2006 New Revision: 24544
URL: http://svn.reactos.org/svn/reactos?rev=24544&view=rev Log: - Create "AVL FUNCTIONS" section tag. - Implement RtlENumerateGEnericTableWithoutSplaying.
Modified: trunk/reactos/lib/rtl/generictable.c
Modified: trunk/reactos/lib/rtl/generictable.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/generictable.c?rev=... ============================================================================== --- trunk/reactos/lib/rtl/generictable.c (original) +++ trunk/reactos/lib/rtl/generictable.c Mon Oct 16 07:51:49 2006 @@ -357,6 +357,44 @@ }
/* + * @implemented + */ +PVOID +NTAPI +RtlEnumerateGenericTableWithoutSplaying(IN PRTL_GENERIC_TABLE Table, + IN OUT PVOID *RestartKey) +{ + PRTL_SPLAY_LINKS FoundNode; + + /* Check if the table is empty */ + if (RtlIsGenericTableEmpty(Table)) return NULL; + + /* Check if we have to restart */ + if (!(*RestartKey)) + { + /* Then find the leftmost element */ + FoundNode = Table->TableRoot; + do + { + /* Get the left child */ + FoundNode = RtlLeftChild(FoundNode); + } while(RtlLeftChild(FoundNode)); + + /* Splay it */ + *RestartKey = FoundNode; + } + else + { + /* Otherwise, try using the real successor */ + FoundNode = RtlRealSuccessor(Table->TableRoot); + if (FoundNode) *RestartKey = FoundNode; + } + + /* Check if we found the node and return it */ + return FoundNode ? &((PTABLE_ENTRY_HEADER)FoundNode)->UserData : NULL; +} + +/* * @unimplemented */ PVOID @@ -378,24 +416,14 @@ */ PVOID NTAPI -RtlEnumerateGenericTableWithoutSplaying(IN PRTL_GENERIC_TABLE Table, - IN OUT PVOID *RestartKey) +RtlGetElementGenericTable(IN PRTL_GENERIC_TABLE Table, + IN ULONG I) { UNIMPLEMENTED; return 0; }
-/* - * @unimplemented - */ -PVOID -NTAPI -RtlGetElementGenericTable(IN PRTL_GENERIC_TABLE Table, - IN ULONG I) -{ - UNIMPLEMENTED; - return 0; -} +/* AVL FUNCTIONS *************************************************************/
/* * @implemented