diff --git a/src/windows-emulator/exception_dispatch.cpp b/src/windows-emulator/exception_dispatch.cpp index e4626cf2..df4164b1 100644 --- a/src/windows-emulator/exception_dispatch.cpp +++ b/src/windows-emulator/exception_dispatch.cpp @@ -2,6 +2,7 @@ #include "exception_dispatch.hpp" #include "process_context.hpp" #include "cpu_context.hpp" +#include namespace { @@ -182,6 +183,16 @@ void dispatch_access_violation(x86_64_emulator& emu, const process_context& proc }); } +void dispatch_guard_page_violation(x86_64_emulator& emu, const process_context& proc, const uint64_t address, + const memory_operation operation) +{ + dispatch_exception(emu, proc, STATUS_GUARD_PAGE_VIOLATION, + { + map_violation_operation_to_parameter(operation), + address, + }); +} + void dispatch_illegal_instruction_violation(x86_64_emulator& emu, const process_context& proc) { dispatch_exception(emu, proc, STATUS_ILLEGAL_INSTRUCTION, {}); diff --git a/src/windows-emulator/exception_dispatch.hpp b/src/windows-emulator/exception_dispatch.hpp index 4a717c3d..428c55ef 100644 --- a/src/windows-emulator/exception_dispatch.hpp +++ b/src/windows-emulator/exception_dispatch.hpp @@ -19,6 +19,8 @@ void dispatch_exception(x86_64_emulator& emu, const process_context& proc, const void dispatch_access_violation(x86_64_emulator& emu, const process_context& proc, uint64_t address, memory_operation operation); +void dispatch_guard_page_violation(x86_64_emulator& emu, const process_context& proc, uint64_t address, + memory_operation operation); void dispatch_illegal_instruction_violation(x86_64_emulator& emu, const process_context& proc); void dispatch_integer_division_by_zero(x86_64_emulator& emu, const process_context& proc); void dispatch_single_step(x86_64_emulator& emu, const process_context& proc);