-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhypervbsod.h
57 lines (48 loc) · 1.41 KB
/
hypervbsod.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Ntifs.h"
#include "wdmsec.h"
#include "hvgdk.h"
#include "wdf.h"
// #include "hypervenlightments.h"
//
// SDDL string used when creating the device. This string
// limits access to this driver to system and admins only.
//
#define DEVICE_SDDL L"D:P(A;;GA;;;SY)(A;;GA;;;BA)"
//
// driver object vars
//
#define SYM_LINK_NAME L"\\DosDevices\\hypervbsod"
#define DEVICE_NAME L"\\Device\\hypervbsod"
//
// device extension
//
typedef struct _HVDETECT_DEVICE_EXTENSION
{
PDEVICE_OBJECT fdo;
UNICODE_STRING ustrSymLinkName;
} HVDETECT_DEVICE_EXTENSION, * PHVDETECT_DEVICE_EXTENSION;
#define MAX_CPU_COUNT 0x100
#define POOLTAG 'Hvhv'
#define MSR_IA32_VMX_BASIC 0x480
typedef union _IA32_VMX_BASIC_MSR
{
ULONG64 All;
struct
{
ULONG32 RevisionIdentifier : 31; // [0-30]
ULONG32 Reserved1 : 1; // [31]
ULONG32 RegionSize : 12; // [32-43]
ULONG32 RegionClear : 1; // [44]
ULONG32 Reserved2 : 3; // [45-47]
ULONG32 SupportedIA64 : 1; // [48]
ULONG32 SupportedDualMoniter : 1; // [49]
ULONG32 MemoryType : 4; // [50-53]
ULONG32 VmExitReport : 1; // [54]
ULONG32 VmxCapabilityHint : 1; // [55]
ULONG32 Reserved3 : 8; // [56-63]
} Fields;
} IA32_VMX_BASIC_MSR, * PIA32_VMX_BASIC_MSR;
BOOLEAN HvActivateVpPages();
VOID ArchEnableVmx(VOID);
VOID ArchChangeCr3(VOID);