Common/PageFaultHandler: Fix for Windows/ARM64

This commit is contained in:
Connor McLaughlin 2020-11-22 14:49:49 +10:00
parent ea355c20ad
commit 44b3c9be6e

View file

@ -68,7 +68,7 @@ static bool IsStoreInstruction(const void* ptr)
} }
#endif #endif
#if defined(WIN32) && defined(CPU_X64) #if defined(WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64))
static PVOID s_veh_handle; static PVOID s_veh_handle;
static LONG ExceptionHandler(PEXCEPTION_POINTERS exi) static LONG ExceptionHandler(PEXCEPTION_POINTERS exi)
@ -190,7 +190,7 @@ bool InstallHandler(void* owner, Callback callback)
if (was_empty) if (was_empty)
{ {
#if defined(WIN32) && defined(CPU_X64) #if defined(WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64))
s_veh_handle = AddVectoredExceptionHandler(1, ExceptionHandler); s_veh_handle = AddVectoredExceptionHandler(1, ExceptionHandler);
if (!s_veh_handle) if (!s_veh_handle)
{ {
@ -247,7 +247,7 @@ bool RemoveHandler(void* owner)
if (m_handlers.empty()) if (m_handlers.empty())
{ {
#if defined(WIN32) && defined(CPU_X64) #if defined(WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64))
RemoveVectoredExceptionHandler(s_veh_handle); RemoveVectoredExceptionHandler(s_veh_handle);
s_veh_handle = nullptr; s_veh_handle = nullptr;
#elif defined(USE_SIGSEGV) #elif defined(USE_SIGSEGV)