Process Hacker
collect.c File Reference
#include <phbase.h>

Go to the source code of this file.

Functions

VOID PhInitializeAvlTree (_Out_ PPH_AVL_TREE Tree, _In_ PPH_AVL_TREE_COMPARE_FUNCTION CompareFunction)
 Initializes an AVL tree.
 
FORCEINLINE PPH_AVL_LINKS PhpFindElementAvlTree (_In_ PPH_AVL_TREE Tree, _In_ PPH_AVL_LINKS Element, _Out_ PLONG Result)
 Finds an element in an AVL tree.
 
FORCEINLINE VOID PhpRotateLeftAvlLinks (_Inout_ PPH_AVL_LINKS *Root)
 
FORCEINLINE VOID PhpRotateLeftTwiceAvlLinks (_Inout_ PPH_AVL_LINKS *Root)
 
FORCEINLINE VOID PhpRotateRightAvlLinks (_Inout_ PPH_AVL_LINKS *Root)
 
FORCEINLINE VOID PhpRotateRightTwiceAvlLinks (_Inout_ PPH_AVL_LINKS *Root)
 
ULONG PhpRebalanceAvlLinks (_Inout_ PPH_AVL_LINKS *Root)
 
PPH_AVL_LINKS PhAddElementAvlTree (_Inout_ PPH_AVL_TREE Tree, _Out_ PPH_AVL_LINKS Element)
 Adds an element to an AVL tree.
 
VOID PhRemoveElementAvlTree (_Inout_ PPH_AVL_TREE Tree, _Inout_ PPH_AVL_LINKS Element)
 Removes an element from an AVL tree.
 
PPH_AVL_LINKS PhFindElementAvlTree (_In_ PPH_AVL_TREE Tree, _In_ PPH_AVL_LINKS Element)
 Finds an element in an AVL tree.
 
PPH_AVL_LINKS PhFindElementAvlTree2 (_In_ PPH_AVL_TREE Tree, _In_ PPH_AVL_LINKS Element, _Out_ PLONG Result)
 Finds an element in an AVL tree.
 
PPH_AVL_LINKS PhMinimumElementAvlTree (_In_ PPH_AVL_TREE Tree)
 Finds the smallest element in an AVL tree.
 
PPH_AVL_LINKS PhMaximumElementAvlTree (_In_ PPH_AVL_TREE Tree)
 Finds the biggest element in an AVL tree.
 
PPH_AVL_LINKS PhSuccessorElementAvlTree (_In_ PPH_AVL_LINKS Element)
 Finds the next element in an AVL tree.
 
PPH_AVL_LINKS PhPredecessorElementAvlTree (_In_ PPH_AVL_LINKS Element)
 Finds the previous element in an AVL tree.
 
VOID PhEnumAvlTree (_In_ PPH_AVL_TREE Tree, _In_ PH_TREE_ENUMERATION_ORDER Order, _In_ PPH_ENUM_AVL_TREE_CALLBACK Callback, _In_opt_ PVOID Context)
 Enumerates the elements in an AVL tree.
 

Function Documentation

PPH_AVL_LINKS PhAddElementAvlTree ( _Inout_ PPH_AVL_TREE  Tree,
_Out_ PPH_AVL_LINKS  Element 
)

Adds an element to an AVL tree.

Parameters
TreeThe tree.
ElementThe element to add.
Returns
NULL if the element was added, or an existing element.

Definition at line 492 of file collect.c.

VOID PhEnumAvlTree ( _In_ PPH_AVL_TREE  Tree,
_In_ PH_TREE_ENUMERATION_ORDER  Order,
_In_ PPH_ENUM_AVL_TREE_CALLBACK  Callback,
_In_opt_ PVOID  Context 
)

Enumerates the elements in an AVL tree.

Parameters
TreeThe tree.
OrderThe enumeration order.
CallbackThe callback function.
ContextA user-defined value to pass to the callback function.

Definition at line 894 of file collect.c.

PPH_AVL_LINKS PhFindElementAvlTree ( _In_ PPH_AVL_TREE  Tree,
_In_ PPH_AVL_LINKS  Element 
)

Finds an element in an AVL tree.

Parameters
TreeThe tree.
ElementAn element to find.
Returns
The element, or NULL if it could not be found.

Definition at line 706 of file collect.c.

PPH_AVL_LINKS PhFindElementAvlTree2 ( _In_ PPH_AVL_TREE  Tree,
_In_ PPH_AVL_LINKS  Element,
_Out_ PLONG  Result 
)

Finds an element in an AVL tree.

Parameters
TreeThe tree.
ElementThe element to find.
ResultThe result of the search.
Returns
The closest element, or NULL if the tree is empty.

Definition at line 731 of file collect.c.

VOID PhInitializeAvlTree ( _Out_ PPH_AVL_TREE  Tree,
_In_ PPH_AVL_TREE_COMPARE_FUNCTION  CompareFunction 
)

Initializes an AVL tree.

Parameters
TreeThe tree.
CompareFunctionA function used to compare tree elements.

Definition at line 31 of file collect.c.

PPH_AVL_LINKS PhMaximumElementAvlTree ( _In_ PPH_AVL_TREE  Tree)

Finds the biggest element in an AVL tree.

Parameters
TreeThe tree.
Returns
An element, or NULL if the tree is empty.

Definition at line 781 of file collect.c.

PPH_AVL_LINKS PhMinimumElementAvlTree ( _In_ PPH_AVL_TREE  Tree)

Finds the smallest element in an AVL tree.

Parameters
TreeThe tree.
Returns
An element, or NULL if the tree is empty.

Definition at line 757 of file collect.c.

FORCEINLINE PPH_AVL_LINKS PhpFindElementAvlTree ( _In_ PPH_AVL_TREE  Tree,
_In_ PPH_AVL_LINKS  Element,
_Out_ PLONG  Result 
)

Finds an element in an AVL tree.

Parameters
TreeThe tree.
ElementThe element to find.
ResultThe result of the search.

Definition at line 52 of file collect.c.

ULONG PhpRebalanceAvlLinks ( _Inout_ PPH_AVL_LINKS Root)

Definition at line 339 of file collect.c.

PPH_AVL_LINKS PhPredecessorElementAvlTree ( _In_ PPH_AVL_LINKS  Element)

Finds the previous element in an AVL tree.

Parameters
ElementThe element.
Returns
The previous element, or NULL if there are no more elements.

Definition at line 848 of file collect.c.

FORCEINLINE VOID PhpRotateLeftAvlLinks ( _Inout_ PPH_AVL_LINKS Root)

Definition at line 109 of file collect.c.

FORCEINLINE VOID PhpRotateLeftTwiceAvlLinks ( _Inout_ PPH_AVL_LINKS Root)

Definition at line 155 of file collect.c.

FORCEINLINE VOID PhpRotateRightAvlLinks ( _Inout_ PPH_AVL_LINKS Root)

Definition at line 224 of file collect.c.

FORCEINLINE VOID PhpRotateRightTwiceAvlLinks ( _Inout_ PPH_AVL_LINKS Root)

Definition at line 270 of file collect.c.

VOID PhRemoveElementAvlTree ( _Inout_ PPH_AVL_TREE  Tree,
_Inout_ PPH_AVL_LINKS  Element 
)

Removes an element from an AVL tree.

Parameters
TreeThe tree.
ElementAn element already present in the tree.

Definition at line 577 of file collect.c.

PPH_AVL_LINKS PhSuccessorElementAvlTree ( _In_ PPH_AVL_LINKS  Element)

Finds the next element in an AVL tree.

Parameters
ElementThe element.
Returns
The next element, or NULL if there are no more elements.

Definition at line 806 of file collect.c.