[RTL/x64] Handle STATUS_UNWIND_CONSOLIDATE in RtlRestoreContext

It's not entirely correct yet and will probably fail on recursive c++ exceptions, but it fixes basic c++ exception handling.
This commit is contained in:
Timo Kreuzer 2023-10-22 18:21:42 +03:00
parent ff282894a8
commit bb444b93d9
2 changed files with 29 additions and 9 deletions

View file

@ -107,22 +107,19 @@ PUBLIC RtlCaptureContext
.ENDP
/*
* VOID NTAPI
* RtlRestoreContext(
* _In_ PCONTEXT ContextRecord@<rcx>,
* PEXCEPTION_RECORD *ExceptionRecord@<rdx>);
* VOID
* RtlpRestoreContextInternal(
* _In_ PCONTEXT ContextRecord@<rcx>);
*/
PUBLIC RtlRestoreContext
.PROC RtlRestoreContext
PUBLIC RtlpRestoreContextInternal
.PROC RtlpRestoreContextInternal
/* Allocate space */
sub rsp, HEX(8)
.ALLOCSTACK 8
.ENDPROLOG
// TODO: Handle ExceptionRecord
/* Restore legacy floating point registers (It's slow, so do it first) */
/* Restore legacy floating point registers (It is slow, so do it first) */
ldmxcsr [rcx + CxMxCsr]
fxrstor [rcx + CxFltSave]