Bitdefender Hypervisor Memory Introspection
utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _UTILS_H_
6 #define _UTILS_H_
7 
8 #include "introtypes.h"
9 
10 size_t
12  _In_bytecount_(Length) void *Buffer,
13  _In_ size_t Length, // Length in bytes!
14  _In_ size_t SizeOfElements,
15  _In_bytecount_(SizeOfElements) void *Target
16  );
17 
18 size_t
20  _In_bytecount_(Length) void *Buffer,
21  _In_ size_t Length,
22  _In_ size_t MaximumLength,
23  _In_ size_t SizeOfElements,
24  _In_bytecount_(SizeOfElements) void *Target
25  );
26 
27 size_t
29  _In_bytecount_(Count *SizeOfElements) void *Buffer,
30  _In_ size_t Count, // Number of structures
31  _In_ size_t SizeOfElements, // Elements size
32  _In_ DWORD CompareFieldOffset, // The offset of the compare field
33  _In_bytecount_(TargetSize) void *Target,
34  _In_ DWORD TargetSize
35  );
36 
37 void
39  _Inout_updates_bytes_(NumberOfElements *ElementSize) void *Array,
40  _In_ const DWORD NumberOfElements,
41  _In_ const BYTE ElementSize
42  );
43 
44 void
46  _Inout_updates_(NumberOfElements) PQWORD Array,
47  _In_ const DWORD NumberOfElements
48  );
49 
50 #endif // _UTILS_H_
uint8_t BYTE
Definition: intro_types.h:47
#define _In_
Definition: intro_sal.h:21
size_t UtilBinarySearchStructure(void *Buffer, size_t Count, size_t SizeOfElements, DWORD CompareFieldOffset, void *Target, DWORD TargetSize)
Definition: utils.c:292
size_t UtilInsertOrdered(void *Buffer, size_t Length, size_t MaximumLength, size_t SizeOfElements, void *Target)
Definition: utils.c:102
void UtilSortQwords(PQWORD Array, const DWORD NumberOfElements)
Definition: utils.c:384
#define _In_bytecount_(expr)
Definition: intro_sal.h:42
#define _Inout_updates_bytes_(expr)
Definition: intro_sal.h:33
size_t UtilBinarySearch(void *Buffer, size_t Length, size_t SizeOfElements, void *Target)
Definition: utils.c:13
#define _Inout_updates_(expr)
Definition: intro_sal.h:32
uint32_t DWORD
Definition: intro_types.h:49
unsigned long long * PQWORD
Definition: intro_types.h:53
void UtilQuickSort(void *Array, const DWORD NumberOfElements, const BYTE ElementSize)
Definition: utils.c:267