Bitdefender Hypervisor Memory Introspection
structs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _INTSTRUCTS_H_
6 #define _INTSTRUCTS_H_
7 
8 #include "introcore.h"
9 
26  _In_reads_bytes_(Size) const void *Buffer,
27  _In_ size_t Size,
28  _Inout_ size_t *Offset,
29  _Inout_opt_ void *Context
30  );
31 
32 
36 typedef struct _INT_STRUCT_INVARIANT
37 {
42  size_t Offset;
43 
48 
50 #define INT_OFFSET_NOT_INITIALIZED ((size_t) -1)
51 
53 #define INT_STRUCT_MAX_SEARCH_SIZE ((size_t) PAGE_SIZE) // for now, just page size
54 
56 #define INT_STRUCT_MAX_INVARIANT_CNT ((size_t) 64) // needed?
57 
60  _In_reads_bytes_(Size) const void *Buffer,
61  _In_ size_t Size,
62  _Inout_updates_(Count) INT_STRUCT_INVARIANT *Invariants,
63  _In_ size_t Count,
64  _In_ BOOLEAN LogErrors,
65  _Inout_opt_ void *Context
66  );
67 
68 #endif // !_INTSTRUCTS_H_
_Bool BOOLEAN
Definition: intro_types.h:58
PFUNC_IntStructGetter Getter
Callback function that is responsible for searching for the offset and extracting a field/structure f...
Definition: structs.h:46
#define _In_
Definition: intro_sal.h:21
int INTSTATUS
The status data type.
Definition: introstatus.h:24
INTSTATUS IntStructFill(const void *Buffer, size_t Size, INT_STRUCT_INVARIANT *Invariants, size_t Count, BOOLEAN LogErrors, void *Context)
Fill an internal structure with information gathered from the guest by applying a list of invariants ...
Definition: structs.c:8
#define _Inout_opt_
Definition: intro_sal.h:31
#define _Inout_
Definition: intro_sal.h:20
#define _Inout_updates_(expr)
Definition: intro_sal.h:32
#define _In_reads_bytes_(expr)
Definition: intro_sal.h:25
#define _Function_class_(expr)
Definition: intro_sal.h:40
size_t Offset
Offset from where the field/structure is to be extracted.
Definition: structs.h:42
struct _INT_STRUCT_INVARIANT INT_STRUCT_INVARIANT
INTSTATUS(* PFUNC_IntStructGetter)(const void *Buffer, size_t Size, size_t *Offset, void *Context)
Structure getter callback.
Definition: structs.h:25