[ros-diffs] [tkreuzer] 50483: [CRT] Implement __SEH_epilog

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Tue Jan 25 09:33:37 UTC 2011


Author: tkreuzer
Date: Tue Jan 25 09:33:37 2011
New Revision: 50483

URL: http://svn.reactos.org/svn/reactos?rev=50483&view=rev
Log:
[CRT]
Implement __SEH_epilog

Modified:
    branches/cmake-bringup/lib/sdk/crt/except/i386/seh_prolog.s

Modified: branches/cmake-bringup/lib/sdk/crt/except/i386/seh_prolog.s
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/sdk/crt/except/i386/seh_prolog.s?rev=50483&r1=50482&r2=50483&view=diff
==============================================================================
--- branches/cmake-bringup/lib/sdk/crt/except/i386/seh_prolog.s [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/sdk/crt/except/i386/seh_prolog.s [iso-8859-1] Tue Jan 25 09:33:37 2011
@@ -103,16 +103,16 @@
     /* Safe SEH table, overwriting OLDFRAME.ReturnAddress */
     mov [ebp - SEH_FRAME_OriginalEbp + SEH_FRAME_SEHTable], eax
 
+    /* Safe the disable value, overwriting OLDFRAME.SEHTable */
+    mov dword ptr [ebp - SEH_FRAME_OriginalEbp + SEH_FRAME_Disable], -1
+
+    /* Load the address of the new registration record */
+    lea eax, [ebp - SEH_FRAME_OriginalEbp + SEH_FRAME_PreviousRecord]
+
     /* Save registers */
     mov [esp + SAFE_AREA_Edi], edi
     mov [esp + SAFE_AREA_Esi], esi
     mov [esp + SAFE_AREA_Ebx], ebx
-
-    /* Load the address of the new registration record */
-    lea eax, [ebp - SEH_FRAME_OriginalEbp + SEH_FRAME_PreviousRecord]
-
-    /* Safe the disable value, overwriting OLDFRAME.SEHTable */
-    mov dword ptr [ebp - SEH_FRAME_OriginalEbp + SEH_FRAME_Disable], -1
 
     /* Enqueue the new record */
     mov fs:[0], eax
@@ -120,4 +120,33 @@
     /* Return to the caller */
     ret
 
+
+PUBLIC __SEH_epilog
+__SEH_epilog:
+
+    /* Restore the previous exception registration record */
+    mov ecx, [ebp - SEH_FRAME_OriginalEbp + SEH_FRAME_PreviousRecord]
+    mov fs:[0], ecx
+
+    /* Restore saved registers */
+    mov edi, [esp + 4 + SAFE_AREA_Edi]
+    mov esi, [esp + 4 + SAFE_AREA_Esi]
+    mov ebx, [esp + 4 + SAFE_AREA_Ebx]
+
+    /* Get the return address */
+    mov ecx, [esp]
+
+    /* Clean up stack */
+    mov esp, ebp
+
+    /* Get previous ebp */
+    mov ebp, [esp]
+
+    /* Save return address */
+    mov [esp], ecx
+
+    /* Return to the caller */
+    ret
+
+
 END




More information about the Ros-diffs mailing list