Author: jgardou
Date: Sun Nov 20 14:04:40 2011
New Revision: 54455

URL: http://svn.reactos.org/svn/reactos?rev=54455&view=rev
Log:
[CRT]
- implement _chkesp

Added:
    trunk/reactos/lib/sdk/crt/except/i386/chkesp.s   (with props)
Modified:
    trunk/reactos/lib/sdk/crt/crt.cmake
    trunk/reactos/lib/sdk/crt/crt.rbuild
    trunk/reactos/lib/sdk/crt/except/stack.c

Modified: trunk/reactos/lib/sdk/crt/crt.cmake
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.cmake?rev=54455&r1=54454&r2=54455&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/crt.cmake [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/crt.cmake [iso-8859-1] Sun Nov 20 14:04:40 2011
@@ -306,6 +306,7 @@
 
 if(ARCH MATCHES i386)
     list(APPEND CRT_SOURCE
+        except/i386/chkesp.s
         except/i386/prolog.s
         except/i386/seh.s
         except/i386/seh_prolog.s

Modified: trunk/reactos/lib/sdk/crt/crt.rbuild
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.rbuild?rev=54455&r1=54454&r2=54455&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] Sun Nov 20 14:04:40 2011
@@ -5,6 +5,7 @@
        <directory name="except">
                <if property="ARCH" value="i386">
                        <directory name="i386">
+                <file>chkesp.s</file>
                                <file>chkstk_asm.s</file>
                                <file>chkstk_ms.s</file>
                        </directory>

Added: trunk/reactos/lib/sdk/crt/except/i386/chkesp.s
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/i386/chkesp.s?rev=54455&view=auto
==============================================================================
--- trunk/reactos/lib/sdk/crt/except/i386/chkesp.s (added)
+++ trunk/reactos/lib/sdk/crt/except/i386/chkesp.s [iso-8859-1] Sun Nov 20 
14:04:40 2011
@@ -1,0 +1,36 @@
+/*
+ * COPYRIGHT:         See COPYING in the top level directory
+ * PROJECT:           ReactOS C run time library
+ * PURPOSE:           Stack checker
+ * PROGRAMMERS:       Jérôme Gardou
+ */
+
+#include <asm.inc>
+#include <ks386.inc>
+
+/* Code is taken from wine 1.3.33, 
+ * Copyright Jon Griffiths and Alexandre Julliard
+ */
+EXTERN __chkesp_failed:PROC
+
+PUBLIC __chkesp
+.code
+__chkesp:
+    jnz .test_failed
+    ret
+           
+.test_failed:
+    push  ebp
+    mov ebp, esp
+    sub esp, 12
+    push eax
+    push ecx
+    push edx
+    call __chkesp_failed
+    pop edx
+    pop ecx
+    pop eax
+    leave
+    ret
+    
+END

Propchange: trunk/reactos/lib/sdk/crt/except/i386/chkesp.s
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/lib/sdk/crt/except/stack.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/stack.c?rev=54455&r1=54454&r2=54455&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/except/stack.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/except/stack.c [iso-8859-1] Sun Nov 20 14:04:40 
2011
@@ -24,14 +24,10 @@
 
 #ifdef __i386__
 
-void _chkesp(void)
+void _chkesp_failed(void)
 {
-}
-
-#else
-
-void _chkesp(void)
-{
+    ERR("stack got corrupted!\n");
+    __debugbreak();
 }
 
 #endif  /* __i386__ */


Reply via email to