- implement _chkesp

svn path=/trunk/; revision=54455
This commit is contained in:
Jérôme Gardou 2011-11-20 14:04:40 +00:00
parent 1f402857de
commit 17abc7b17d
4 changed files with 41 additions and 7 deletions

View file

@ -306,6 +306,7 @@ list(APPEND CRT_SOURCE
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

View file

@ -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>

View file

@ -0,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

View file

@ -24,14 +24,10 @@
#ifdef __i386__
void _chkesp(void)
{
}
#else
void _chkesp(void)
void _chkesp_failed(void)
{
ERR("stack got corrupted!\n");
__debugbreak();
}
#endif /* __i386__ */