| 801 | } |
| 802 | |
| 803 | NTSTATUS ResetToConsistentState(EXCEPTION_RECORD* Exception, CONTEXT* GuestContext, ARM64_NT_CONTEXT* NativeContext) { |
| 804 | bool Cont {}; |
| 805 | if (Exception->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { |
| 806 | const auto FaultAddress = static_cast<uint64_t>(Exception->ExceptionInformation[1]); |
| 807 | |
| 808 | if (OvercommitTracker) { |
| 809 | { |
| 810 | ScopedCallbackDisable guard; |
| 811 | Cont = OvercommitTracker->HandleAccessViolation(FaultAddress); |
| 812 | } |
| 813 | if (Cont) { |
| 814 | NtContinueNative(NativeContext, false); |
| 815 | } |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | if (!GetCPUArea().ThreadState()) { |
| 820 | return STATUS_SUCCESS; |
| 821 | } |
| 822 | |
| 823 | { |
| 824 | |
| 825 | ScopedCallbackDisable guard; |
| 826 | Cont = ResetToConsistentStateImpl(Exception, GuestContext, NativeContext); |
| 827 | } |
| 828 | |
| 829 | if (Cont) { |
| 830 | NtContinueNative(NativeContext, false); |
| 831 | } |
| 832 | |
| 833 | GetCPUArea().Area->InSimulation = false; |
| 834 | GetCPUArea().Area->InSyscallCallback = false; |
| 835 | return STATUS_SUCCESS; |
| 836 | } |
| 837 | |
| 838 | void NotifyMemoryAlloc(void* Address, SIZE_T Size, ULONG Type, ULONG Prot, BOOL After, NTSTATUS Status) { |
| 839 | if (!InvalidationTracker || !GetCPUArea().ThreadState()) { |
nothing calls this directly
no test coverage detected