164 __nonnull()
static void 211 if ((PathSize < 2) || (PathSize > 0xFFFF))
213 ERROR(
"[ERROR] Path size (%d) is invalid for module\n", PathSize);
229 if (NULL == pPath->
Path)
239 for (i = 0; i < pPath->
PathSize / 2; i++)
241 pPath->
Path[i] = ((Path[i] >= u
'A') && (Path[i] <= u
'Z')) ? (Path[i] | 0x20) : Path[i];
243 if (pPath->
Path[i] == u
'\\')
275 WARNING(
"[WARNING] IntWinUmPathCreate called with duplicated subsection: %llx Path: %s!\n",
281 ERROR(
"[ERROR] RbInsertNode failed: 0x%08x\n", status);
368 if (NULL == pPath || pPath == &gInvalidUmPath)
WINUM_PATH * IntWinUmPathReference(WINUM_PATH *Path)
Increases the reference count of the given WINUM_PATH object.
#define CONTAINING_RECORD(List, Type, Member)
void IntWinUmPathDereference(WINUM_PATH **Path)
Dereferences a WINUM_PATH object, releasing the resources if the reference count has reached 0...
DWORD NameSize
The number of bytes in the name string.
static WINUM_PATH gInvalidUmPath
void FUNC_RbTreeNodeFree(RBNODE *Node)
#define INT_SUCCESS(Status)
INTSTATUS RbLookupNode(RBTREE *Tree, RBNODE *NodeToSearch, RBNODE **NodeFound)
DWORD PathSize
The number of bytes in the path string.
WINUM_PATH * IntWinUmPathFetchAndReferenceBySubsection(QWORD SubsectionGva)
Fetches a WINUM_PATH object by the unique identifier and increments the reference counter on it...
#define HpAllocWithTag(Len, Tag)
int INTSTATUS
The status data type.
int FUNC_RbTreeNodeCompare(RBNODE *Left, RBNODE *Right)
#define INITIAL_CRC_VALUE
static void IntWinUmPathFree(WINUM_PATH *Path)
Releases resources associated to a WINUM_PATH object.
QWORD SubsectionGva
The subsection guest virtual address from where the path was read. Serves as an unique identifier...
#define HpFreeAndNullWithTag(Add, Tag)
#define INT_STATUS_KEY_ALREADY_EXISTS
static WINUM_PATH * IntWinUmPathFetchBySubsection(QWORD SubsectionGva)
Fetches a path object by the given unique identifier, which is the subsection virtual address...
static void IntWinUmPathRbTreeNodeFree(RBNODE *Node)
Function called whenever a node from the red-black tree is freed.
static int IntWinUmPathRbTreeNodeCompare(RBNODE *Left, RBNODE *Right)
Function used for comparison of two red-black tree nodes describing two different paths...
DWORD Crc32Wstring(const WCHAR *String, DWORD InitialCrc)
Computes the CRC for a NULL-terminated wide char string.
#define UNREFERENCED_PARAMETER(P)
DWORD NameHash
The CRC32 hash of the name. Used for fast matching.
WINUM_PATH * IntWinUmPathCreate(const WCHAR *Path, DWORD PathSize, QWORD SubsectionGva)
Creates a WINUM_PATH object from the given parameters.
WCHAR * Name
The name of the module contained in the path.
#define _Function_class_(expr)
#define CWSTRLEN(Wstring)
void RbDeleteNode(RBTREE *Tree, RBNODE *Node)
static WCHAR gInvalidModulePath[8]
INTSTATUS RbInsertNode(RBTREE *Tree, RBNODE *Node)
char * utf16_for_log(const WCHAR *WString)
Converts a UTF-16 to a UTF-8 string to be used inside logging macros.
RBNODE RbNode
The node which is inserted into gPaths tree.
#define RB_TREE_INIT(Name, Free, Compare)
Initializes a RBTREE structure.
INT32 RefCount
The reference count of the current object. When reaching 0, the path will be freed.
WCHAR * Path
The string which represents the user-mode module path.