mirror of
https://github.com/reactos/reactos.git
synced 2025-01-10 16:18:16 +00:00
- Implement RtlIsGenericTableEmpty, RtlNumberGenericTableElements.
- Implement RtlLookupElementGenericTable. - Implement RtlDeleteElementGenericTable svn path=/trunk/; revision=24542
This commit is contained in:
parent
dbb8a15d7c
commit
cef2ebcee2
2 changed files with 48 additions and 11 deletions
|
@ -2533,6 +2533,15 @@ RtlIsGenericTableEmpty(
|
|||
IN PRTL_GENERIC_TABLE Table
|
||||
);
|
||||
|
||||
PVOID
|
||||
NTAPI
|
||||
RtlLookupElementGenericTableFull(
|
||||
IN PRTL_GENERIC_TABLE Table,
|
||||
IN PVOID Buffer,
|
||||
OUT PVOID *NodeOrParent,
|
||||
OUT TABLE_SEARCH_RESULT *SearchResult
|
||||
);
|
||||
|
||||
//
|
||||
// Handle Table Functions
|
||||
//
|
||||
|
|
|
@ -115,7 +115,7 @@ RtlInitializeGenericTable(IN PRTL_GENERIC_TABLE Table,
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
|
@ -140,7 +140,7 @@ RtlInsertElementGenericTable(IN PRTL_GENERIC_TABLE Table,
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
|
@ -218,14 +218,14 @@ RtlInsertElementGenericTableFull(IN PRTL_GENERIC_TABLE Table,
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
RtlIsGenericTableEmpty(IN PRTL_GENERIC_TABLE Table)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
/* Check if the table root is empty */
|
||||
return (Table->TableRoot) ? FALSE: TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -235,19 +235,26 @@ ULONG
|
|||
NTAPI
|
||||
RtlNumberGenericTableElements(IN PRTL_GENERIC_TABLE Table)
|
||||
{
|
||||
/* Return the number of elements */
|
||||
return Table->NumberGenericTableElements;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
RtlLookupElementGenericTable(IN PRTL_GENERIC_TABLE Table,
|
||||
IN PVOID Buffer)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
PRTL_SPLAY_LINKS NodeOrParent;
|
||||
TABLE_SEARCH_RESULT Result;
|
||||
|
||||
/* Call the full version */
|
||||
return RtlLookupElementGenericTableFull(Table,
|
||||
Buffer,
|
||||
&NodeOrParent,
|
||||
&Result);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -265,15 +272,36 @@ RtlLookupElementGenericTableFull(IN PRTL_GENERIC_TABLE Table,
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
RtlDeleteElementGenericTable(IN PRTL_GENERIC_TABLE Table,
|
||||
IN PVOID Buffer)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
PRTL_SPLAY_LINKS NodeOrParent;
|
||||
TABLE_SEARCH_RESULT Result;
|
||||
|
||||
/* Get the splay links and table search result immediately */
|
||||
Result = RtlpFindGenericTableNodeOrParent(Table, Buffer, &NodeOrParent);
|
||||
if ((Result == TableEmptyTree) || (Result != TableFoundNode))
|
||||
{
|
||||
/* Nothing to delete */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Delete the entry */
|
||||
Table->TableRoot = RtlDelete(NodeOrParent);
|
||||
RemoveEntryList(&((PTABLE_ENTRY_HEADER)NodeOrParent)->ListEntry);
|
||||
|
||||
/* Update accounting data */
|
||||
Table->NumberGenericTableElements--;
|
||||
Table->WhichOrderedElement = 0;
|
||||
Table->OrderedPointer = &Table->InsertOrderList;
|
||||
|
||||
/* Free the entry */
|
||||
Table->FreeRoutine(Table, NodeOrParent);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue