HyperPlatform Programmer's Reference
Macros | Enumerations | Functions | Variables
common.h File Reference

Declares and implements common things across the project. More...

#include <fltKernel.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HYPERPLATFORM_COMMON_DBG_BREAK()
 Sets a break point that works only when a debugger is present. More...
 
#define HYPERPLATFORM_COMMON_BUG_CHECK(hp_bug_check_code, param1, param2, param3)
 Issues a bug check. More...
 
#define HYPERPLATFORM_PERFORMANCE_ENABLE_PERFCOUNTER   1
 Enable or disable performance monitoring globally. More...
 

Enumerations

enum  HyperPlatformBugCheck : ULONG {
  HyperPlatformBugCheck::kUnspecified, HyperPlatformBugCheck::kUnexpectedVmExit, HyperPlatformBugCheck::kTripleFaultVmExit, HyperPlatformBugCheck::kExhaustedPreallocatedEntries,
  HyperPlatformBugCheck::kCriticalVmxInstructionFailure, HyperPlatformBugCheck::kEptMisconfigVmExit, HyperPlatformBugCheck::kCritialPoolAllocationFailure
}
 BugCheck codes for HYPERPLATFORM_COMMON_BUG_CHECK(). More...
 

Functions

constexpr bool IsX64 ()
 Checks if a system is x64. More...
 
constexpr bool IsReleaseBuild ()
 Checks if the project is compiled as Release. More...
 

Variables

static const ULONG kHyperPlatformCommonPoolTag = 'PpyH'
 A pool tag. More...
 

Detailed Description

Declares and implements common things across the project.

Definition in file common.h.

Macro Definition Documentation

◆ HYPERPLATFORM_COMMON_BUG_CHECK

#define HYPERPLATFORM_COMMON_BUG_CHECK (   hp_bug_check_code,
  param1,
  param2,
  param3 
)
Value:
const HyperPlatformBugCheck code = (hp_bug_check_code); \
__pragma(warning(push)) \
__pragma(warning(disable: __WARNING_USE_OTHER_FUNCTION)) \
KeBugCheckEx(MANUALLY_INITIATED_CRASH, static_cast<ULONG>(code), (param1), \
(param2), (param3)) \
__pragma(warning(pop))
#define HYPERPLATFORM_COMMON_DBG_BREAK()
Sets a break point that works only when a debugger is present.
Definition: common.h:55
HyperPlatformBugCheck
BugCheck codes for HYPERPLATFORM_COMMON_BUG_CHECK().
Definition: common.h:101

Issues a bug check.

Parameters
hp_bug_check_codeType of a bug
param11st parameter for KeBugCheckEx()
param22nd parameter for KeBugCheckEx()
param33rd parameter for KeBugCheckEx()

Definition at line 69 of file common.h.

◆ HYPERPLATFORM_COMMON_DBG_BREAK

#define HYPERPLATFORM_COMMON_DBG_BREAK ( )
Value:
if (KD_DEBUGGER_NOT_PRESENT) { \
} else { \
__debugbreak(); \
} \
reinterpret_cast<void*>(0)

Sets a break point that works only when a debugger is present.

Definition at line 55 of file common.h.

◆ HYPERPLATFORM_PERFORMANCE_ENABLE_PERFCOUNTER

#define HYPERPLATFORM_PERFORMANCE_ENABLE_PERFCOUNTER   1

Enable or disable performance monitoring globally.

Enables HYPERPLATFORM_PERFORMANCE_MEASURE_THIS_SCOPE() which measures an elapsed time of the scope when set to non 0. Enabling it introduces negative performance impact.

Definition at line 90 of file common.h.

Enumeration Type Documentation

◆ HyperPlatformBugCheck

enum HyperPlatformBugCheck : ULONG
strong

BugCheck codes for HYPERPLATFORM_COMMON_BUG_CHECK().

Enumerator
kUnspecified 

An unspecified bug occurred.

kUnexpectedVmExit 

An unexpected VM-exit occurred.

kTripleFaultVmExit 

A triple fault VM-exit occurred.

kExhaustedPreallocatedEntries 

All pre-allocated entries are used.

kCriticalVmxInstructionFailure 

VMRESUME or VMXOFF has failed.

kEptMisconfigVmExit 

EPT misconfiguration VM-exit occurred.

kCritialPoolAllocationFailure 

Critical pool allocation failed.

Definition at line 101 of file common.h.

Function Documentation

◆ IsReleaseBuild()

constexpr bool IsReleaseBuild ( )

Checks if the project is compiled as Release.

Returns
true if the project is compiled as Release

Definition at line 138 of file common.h.

Here is the caller graph for this function:

◆ IsX64()

constexpr bool IsX64 ( )

Checks if a system is x64.

Returns
true if a system is x64

Definition at line 128 of file common.h.

Here is the caller graph for this function:

Variable Documentation

◆ kHyperPlatformCommonPoolTag

const ULONG kHyperPlatformCommonPoolTag = 'PpyH'
static

A pool tag.

Definition at line 93 of file common.h.