Bitdefender Hypervisor Memory Introspection
hook_xcr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _HOOK_XCR_H_
6 #define _HOOK_XCR_H_
7 
8 #include "introtypes.h"
9 
10 
18 typedef INTSTATUS
20  _In_opt_ void *Context,
21  _In_ DWORD Xcr,
22  _Out_ INTRO_ACTION *Action
23  );
24 
25 
29 typedef struct _XCR_HOOK_STATE
30 {
34 
35 
39 typedef struct _HOOK_XCR
40 {
46  void *Context;
48 
49 
50 //
51 // XCR hooks related API
52 //
55  _In_ DWORD Xcr,
56  _In_ DWORD Flags,
58  _In_opt_ void *Context,
59  _Out_opt_ HOOK_XCR **Hook
60  );
61 
64  _In_ HOOK_XCR *Hook
65  );
66 
69  void
70  );
71 
74  void
75  );
76 
79  void
80  );
81 
82 #endif // _HOOK_XCR_H_
INTSTATUS IntHookXcrCommit(void)
Commit the extended control register hooks.
Definition: hook_xcr.c:169
#define _In_opt_
Definition: intro_sal.h:16
_Bool BOOLEAN
Definition: intro_types.h:58
#define _Out_
Definition: intro_sal.h:22
long long INT64
Definition: intro_types.h:45
#define _In_
Definition: intro_sal.h:21
struct _XCR_HOOK_STATE XCR_HOOK_STATE
int INTSTATUS
The status data type.
Definition: introstatus.h:24
INTSTATUS IntHookXcrInit(void)
Initialize the extended control registers hook state.
Definition: hook_xcr.c:207
INTSTATUS IntHookXcrUninit(void)
Uninit the extended control register hooks state.
Definition: hook_xcr.c:230
DWORD Flags
Flags. Can be used by the caller.
Definition: hook_xcr.h:42
BOOLEAN Disabled
If true, the hook has been removed/disabled.
Definition: hook_xcr.h:44
#define _Out_opt_
Definition: intro_sal.h:30
INTSTATUS IntHookXcrRemoveHook(HOOK_XCR *Hook)
Remove an extended control register hook.
Definition: hook_xcr.c:110
void * Context
Optional context.
Definition: hook_xcr.h:46
uint32_t DWORD
Definition: intro_types.h:49
enum _INTRO_ACTION INTRO_ACTION
Event actions.
PFUNC_XcrWriteHookCallback Callback
Callback.
Definition: hook_xcr.h:45
struct _XCR_HOOK_STATE * PXCR_HOOK_STATE
INTSTATUS IntHookXcrSetHook(DWORD Xcr, DWORD Flags, PFUNC_XcrWriteHookCallback Callback, void *Context, HOOK_XCR **Hook)
Set an extended control register write hook.
Definition: hook_xcr.c:11
struct _HOOK_XCR * PHOOK_XCR
LIST_HEAD XcrHooksList
The list of XCR hooks.
Definition: hook_xcr.h:31
struct _HOOK_XCR HOOK_XCR
LIST_ENTRY Link
List entry element.
Definition: hook_xcr.h:41
INT64 HooksCount
Total number of XCR hooks.
Definition: hook_xcr.h:32
DWORD Xcr
Intercepted XCR.
Definition: hook_xcr.h:43
INTSTATUS(* PFUNC_XcrWriteHookCallback)(void *Context, DWORD Xcr, INTRO_ACTION *Action)
Extended control register write callback.
Definition: hook_xcr.h:19