Alexandre Julliard : ntdll: Reimplement RtlRaiseException() to build a correct context on ARM.

Alexandre Julliard julliard at winehq.org
Tue Jul 28 15:53:31 CDT 2020


Module: wine
Branch: master
Commit: d775b9fd93ecfbbd12945f1e167e4bb381612c69
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d775b9fd93ecfbbd12945f1e167e4bb381612c69

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jul 28 13:40:13 2020 +0200

ntdll: Reimplement RtlRaiseException() to build a correct context on ARM.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/signal_arm.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index 8e1df477ff..e9f6cc6212 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -239,14 +239,21 @@ void WINAPI RtlUnwind( void *endframe, void *target_ip, EXCEPTION_RECORD *rec, v
 /***********************************************************************
  *		RtlRaiseException (NTDLL.@)
  */
-void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec )
-{
-    CONTEXT context;
-
-    RtlCaptureContext( &context );
-    rec->ExceptionAddress = (LPVOID)context.Pc;
-    RtlRaiseStatus( NtRaiseException( rec, &context, TRUE ));
-}
+__ASM_STDCALL_FUNC( RtlRaiseException, 4,
+                    "push {r0, lr}\n\t"
+                    "sub sp, sp, #0x1a0\n\t"  /* sizeof(CONTEXT) */
+                    "mov r0, sp\n\t"  /* context */
+                    "bl " __ASM_NAME("RtlCaptureContext") "\n\t"
+                    "ldr r0, [sp, #0x1a0]\n\t" /* rec */
+                    "ldr r1, [sp, #0x1a4]\n\t"
+                    "str r1, [sp, #0x40]\n\t"  /* context->Pc */
+                    "str r1, [r0, #12]\n\t"    /* rec->ExceptionAddress */
+                    "add r1, sp, #0x1a8\n\t"
+                    "str r1, [sp, #0x38]\n\t"  /* context->Sp */
+                    "mov r1, sp\n\t"
+                    "mov r2, #1\n\t"
+                    "bl " __ASM_NAME("NtRaiseException") "\n\t"
+                    "bl " __ASM_NAME("RtlRaiseStatus") )
 
 /*************************************************************************
  *             RtlCaptureStackBackTrace (NTDLL.@)




More information about the wine-cvs mailing list