struct NODE
{
NODE *ParentNode;
NODE *RightChild;
NODE *LeftChild;
LIST_ENTRY LLEntry;
ULONG Unknown;
};
struct TABLE
{
NODE *TopNode;
LIST_ENTRY LLHead;
LIST_ENTRY *LastElementFound;
ULONG LastElementIndex;
ULONG NumberOfElements;
TABLE_COMPARE_ELEMENTS CompareElements;
TABLE_ALLOCATE_ELEMENT AllocateElement;
TABLE_FREE_ELEMENT FreeElement;
ULONG Unknown;
};
Listing 5.11 Definitions of internal generic table data structures discovered in this chapter.
typedf int (NTAPI * TABLE_COMPARE_ELEMENTS) (
TABLE *pTable,
PVOID pElement1,
PVOID pElement2
);
typedef NODE * (NTAPI * TABLE_ALLOCATE_ELEMENT) (
TABLE *pTable,
ULONG TotalElementSize
);
typedef void (NTAPI * TABLE_FREE_ELEMENT) (
TABLE *pTable,
PVOID Element
);
Listing 5.12 Prototypes of generic table callback functions that must be implemented by
the caller.
Beyond the Documentation 195