- implement _chkesp
svn path=/trunk/; revision=54455
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
<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>
--- /dev/null
+/*
+ * 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
\ No newline at end of file
#ifdef __i386__
-void _chkesp(void)
-{
-}
-
-#else
-
-void _chkesp(void)
+void _chkesp_failed(void)
{
+ ERR("stack got corrupted!\n");
+ __debugbreak();
}
#endif /* __i386__ */