Bitdefender Hypervisor Memory Introspection
utils.c File Reference
#include "utils.h"
#include "introcrt.h"

Go to the source code of this file.

Macros

#define RANGES_OVERLAP(S1, E1, S2, E2)   (!((E1) < (S2) || (S1) > (E2)))
 
#define QUICKSORT_FUNCTION(Array, TypeOfArray)
 

Functions

size_t UtilBinarySearch (void *Buffer, size_t Length, size_t SizeOfElements, void *Target)
 
size_t UtilInsertOrdered (void *Buffer, size_t Length, size_t MaximumLength, size_t SizeOfElements, void *Target)
 
 QUICKSORT_FUNCTION (Array, QWORD)
 
 QUICKSORT_FUNCTION (Array, DWORD)
 
 QUICKSORT_FUNCTION (Array, WORD)
 
 QUICKSORT_FUNCTION (Array, BYTE)
 
void UtilQuickSort (void *Array, const DWORD NumberOfElements, const BYTE ElementSize)
 
size_t UtilBinarySearchStructure (void *Buffer, size_t Count, size_t SizeOfElements, DWORD CompareFieldOffset, void *Target, DWORD TargetSize)
 
void UtilSortQwords (QWORD *Array, const DWORD NumberOfElements)
 
BOOLEAN UtilIsBufferZero (void *Buffer, size_t BufferSize)
 

Macro Definition Documentation

◆ QUICKSORT_FUNCTION

#define QUICKSORT_FUNCTION (   Array,
  TypeOfArray 
)

Definition at line 189 of file utils.c.

◆ RANGES_OVERLAP

#define RANGES_OVERLAP (   S1,
  E1,
  S2,
  E2 
)    (!((E1) < (S2) || (S1) > (E2)))

Definition at line 9 of file utils.c.

Function Documentation

◆ QUICKSORT_FUNCTION() [1/4]

QUICKSORT_FUNCTION ( Array  ,
QWORD   
)

◆ QUICKSORT_FUNCTION() [2/4]

QUICKSORT_FUNCTION ( Array  ,
DWORD   
)

◆ QUICKSORT_FUNCTION() [3/4]

QUICKSORT_FUNCTION ( Array  ,
WORD   
)

◆ QUICKSORT_FUNCTION() [4/4]

QUICKSORT_FUNCTION ( Array  ,
BYTE   
)

◆ UtilBinarySearch()

size_t UtilBinarySearch ( void *  Buffer,
size_t  Length,
size_t  SizeOfElements,
void *  Target 
)

Definition at line 13 of file utils.c.

◆ UtilBinarySearchStructure()

size_t UtilBinarySearchStructure ( void *  Buffer,
size_t  Count,
size_t  SizeOfElements,
DWORD  CompareFieldOffset,
void *  Target,
DWORD  TargetSize 
)

Definition at line 292 of file utils.c.

◆ UtilInsertOrdered()

size_t UtilInsertOrdered ( void *  Buffer,
size_t  Length,
size_t  MaximumLength,
size_t  SizeOfElements,
void *  Target 
)

Definition at line 102 of file utils.c.

◆ UtilIsBufferZero()

BOOLEAN UtilIsBufferZero ( void *  Buffer,
size_t  BufferSize 
)

Definition at line 413 of file utils.c.

Referenced by IntWinSudCheckIntegrity().

◆ UtilQuickSort()

void UtilQuickSort ( void *  Array,
const DWORD  NumberOfElements,
const BYTE  ElementSize 
)

◆ UtilSortQwords()

void UtilSortQwords ( QWORD Array,
const DWORD  NumberOfElements 
)

Definition at line 384 of file utils.c.

Referenced by IntThrSafeWinInspectRunningThreadOnCpu().