mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:02:59 +00:00
- Implement RtlLookupElementGenericTableFull.
- Implement RtlEnumerateGenericTable. svn path=/trunk/; revision=24543
This commit is contained in:
parent
cef2ebcee2
commit
cac3dc3812
1 changed files with 46 additions and 6 deletions
|
@ -258,7 +258,7 @@ RtlLookupElementGenericTable(IN PRTL_GENERIC_TABLE Table,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
PVOID
|
PVOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -267,8 +267,22 @@ RtlLookupElementGenericTableFull(IN PRTL_GENERIC_TABLE Table,
|
||||||
OUT PVOID *NodeOrParent,
|
OUT PVOID *NodeOrParent,
|
||||||
OUT TABLE_SEARCH_RESULT *SearchResult)
|
OUT TABLE_SEARCH_RESULT *SearchResult)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
/* Do the initial lookup */
|
||||||
return 0;
|
*SearchResult = RtlpFindGenericTableNodeOrParent(Table,
|
||||||
|
Buffer,
|
||||||
|
(PRTL_SPLAY_LINKS *)
|
||||||
|
NodeOrParent);
|
||||||
|
|
||||||
|
/* Check if we found anything */
|
||||||
|
if ((*SearchResult == TableEmptyTree) || (*SearchResult != TableFoundNode))
|
||||||
|
{
|
||||||
|
/* Nothing found */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Otherwise, splay the tree and return this entry */
|
||||||
|
Table->TableRoot = RtlSplay(*NodeOrParent);
|
||||||
|
return &((PTABLE_ENTRY_HEADER)*NodeOrParent)->UserData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -305,15 +319,41 @@ RtlDeleteElementGenericTable(IN PRTL_GENERIC_TABLE Table,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
PVOID
|
PVOID
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlEnumerateGenericTable(IN PRTL_GENERIC_TABLE Table,
|
RtlEnumerateGenericTable(IN PRTL_GENERIC_TABLE Table,
|
||||||
IN BOOLEAN Restart)
|
IN BOOLEAN Restart)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
PRTL_SPLAY_LINKS FoundNode;
|
||||||
return 0;
|
|
||||||
|
/* Check if the table is empty */
|
||||||
|
if (RtlIsGenericTableEmpty(Table)) return NULL;
|
||||||
|
|
||||||
|
/* Check if we have to restart */
|
||||||
|
if (Restart)
|
||||||
|
{
|
||||||
|
/* Then find the leftmost element */
|
||||||
|
FoundNode = Table->TableRoot;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
/* Get the left child */
|
||||||
|
FoundNode = RtlLeftChild(FoundNode);
|
||||||
|
} while(RtlLeftChild(FoundNode));
|
||||||
|
|
||||||
|
/* Splay it */
|
||||||
|
Table->TableRoot = RtlSplay(FoundNode);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Otherwise, try using the real successor */
|
||||||
|
FoundNode = RtlRealSuccessor(Table->TableRoot);
|
||||||
|
if (FoundNode) Table->TableRoot = RtlSplay(FoundNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if we found the node and return it */
|
||||||
|
return FoundNode ? &((PTABLE_ENTRY_HEADER)FoundNode)->UserData : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue