- Implement RtlIsGenericTableEmpty, RtlNumberGenericTableElements.

- Implement RtlLookupElementGenericTable.
- Implement RtlDeleteElementGenericTable

svn path=/trunk/; revision=24542
This commit is contained in:
Alex Ionescu 2006-10-16 03:39:49 +00:00
parent dbb8a15d7c
commit cef2ebcee2
2 changed files with 48 additions and 11 deletions

View file

@ -2533,6 +2533,15 @@ RtlIsGenericTableEmpty(
IN PRTL_GENERIC_TABLE Table 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 // Handle Table Functions
// //

View file

@ -115,7 +115,7 @@ RtlInitializeGenericTable(IN PRTL_GENERIC_TABLE Table,
} }
/* /*
* @unimplemented * @implemented
*/ */
PVOID PVOID
NTAPI NTAPI
@ -140,7 +140,7 @@ RtlInsertElementGenericTable(IN PRTL_GENERIC_TABLE Table,
} }
/* /*
* @unimplemented * @implemented
*/ */
PVOID PVOID
NTAPI NTAPI
@ -218,14 +218,14 @@ RtlInsertElementGenericTableFull(IN PRTL_GENERIC_TABLE Table,
} }
/* /*
* @unimplemented * @implemented
*/ */
BOOLEAN BOOLEAN
NTAPI NTAPI
RtlIsGenericTableEmpty(IN PRTL_GENERIC_TABLE Table) RtlIsGenericTableEmpty(IN PRTL_GENERIC_TABLE Table)
{ {
UNIMPLEMENTED; /* Check if the table root is empty */
return FALSE; return (Table->TableRoot) ? FALSE: TRUE;
} }
/* /*
@ -235,19 +235,26 @@ ULONG
NTAPI NTAPI
RtlNumberGenericTableElements(IN PRTL_GENERIC_TABLE Table) RtlNumberGenericTableElements(IN PRTL_GENERIC_TABLE Table)
{ {
/* Return the number of elements */
return Table->NumberGenericTableElements; return Table->NumberGenericTableElements;
} }
/* /*
* @unimplemented * @implemented
*/ */
PVOID PVOID
NTAPI NTAPI
RtlLookupElementGenericTable(IN PRTL_GENERIC_TABLE Table, RtlLookupElementGenericTable(IN PRTL_GENERIC_TABLE Table,
IN PVOID Buffer) IN PVOID Buffer)
{ {
UNIMPLEMENTED; PRTL_SPLAY_LINKS NodeOrParent;
return 0; 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 BOOLEAN
NTAPI NTAPI
RtlDeleteElementGenericTable(IN PRTL_GENERIC_TABLE Table, RtlDeleteElementGenericTable(IN PRTL_GENERIC_TABLE Table,
IN PVOID Buffer) IN PVOID Buffer)
{ {
UNIMPLEMENTED; PRTL_SPLAY_LINKS NodeOrParent;
return FALSE; 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;
} }
/* /*