https://git.reactos.org/?p=reactos.git;a=commitdiff;h=786017c5b6251cac760d4…
commit 786017c5b6251cac760d48aa25dcf03b835e2b8b
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Jul 23 16:23:26 2022 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Aug 4 16:15:24 2022 +0200
[NTOS] Don't assert, when dispatching an exception to user mode fails
Instead continue with second chance handling.
---
ntoskrnl/ke/amd64/except.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/ke/amd64/except.c b/ntoskrnl/ke/amd64/except.c
index c9c97c9dd2f..de8e2b01697 100644
--- a/ntoskrnl/ke/amd64/except.c
+++ b/ntoskrnl/ke/amd64/except.c
@@ -361,9 +361,10 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
/* Forward exception to user mode debugger */
if (DbgkForwardException(ExceptionRecord, TRUE, FALSE)) return;
- /* Forward exception to user mode (does not return) */
+ /* Forward exception to user mode (does not return, if successful) */
KiDispatchExceptionToUser(TrapFrame, &Context, ExceptionRecord);
- NT_ASSERT(FALSE);
+
+ /* Failed to dispatch, fall through for second chance handling */
}
/* Try second chance */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ae39ad4d1057fb4438b55…
commit ae39ad4d1057fb4438b55bd3cf8e6c79101cbd56
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Jul 23 13:35:14 2022 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Aug 4 16:15:24 2022 +0200
[NTOS] Add a hack for VBox
---
ntoskrnl/ke/amd64/trap.S | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ntoskrnl/ke/amd64/trap.S b/ntoskrnl/ke/amd64/trap.S
index 644b4c2032d..0b4f0375af2 100644
--- a/ntoskrnl/ke/amd64/trap.S
+++ b/ntoskrnl/ke/amd64/trap.S
@@ -316,6 +316,10 @@ ENDFUNC
PUBLIC KiDoubleFaultAbort
FUNC KiDoubleFaultAbort
+
+ /* Hack for VBox, which "forgets" to push an error code on the stack! */
+ and rsp, HEX(FFFFFFFFFFFFFFF0)
+
/* A zero error code is pushed */
EnterTrap (TF_HAS_ERROR_CODE OR TF_SAVE_ALL)