Author: tfaber Date: Sun Nov 6 12:51:18 2011 New Revision: 54312
URL: http://svn.reactos.org/svn/reactos?rev=54312&view=rev Log: [CRT] - Export _resetstkoflw from msvcrt. Implementation from Wine 1.3.32
Added: trunk/reactos/lib/sdk/crt/except/stack.c - copied, changed from r54294, trunk/reactos/lib/sdk/crt/except/checkesp.c Removed: trunk/reactos/lib/sdk/crt/except/checkesp.c Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.spec trunk/reactos/lib/sdk/crt/crt.cmake trunk/reactos/lib/sdk/crt/crt.rbuild
Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.spe... ============================================================================== --- trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] Sun Nov 6 12:51:18 2011 @@ -783,7 +783,7 @@ # extern _pwctype @ cdecl _read(long ptr long) # stub _realloc_dbg -# stub _resetstkoflw +@ cdecl _resetstkoflw() @ cdecl _rmdir(str) @ cdecl _rmtmp() @ cdecl _rotl(long long)
Modified: trunk/reactos/lib/sdk/crt/crt.cmake URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.cmake?rev=5... ============================================================================== --- trunk/reactos/lib/sdk/crt/crt.cmake [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/crt.cmake [iso-8859-1] Sun Nov 6 12:51:18 2011 @@ -21,11 +21,11 @@ direct/wmkdir.c direct/wrmdir.c except/abnorter.c - except/checkesp.c except/cpp.c except/cppexcept.c except/except.c except/matherr.c + except/stack.c except/xcptfil.c float/chgsign.c float/copysign.c
Modified: trunk/reactos/lib/sdk/crt/crt.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/crt.rbuild?rev=... ============================================================================== --- trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/crt.rbuild [iso-8859-1] Sun Nov 6 12:51:18 2011 @@ -77,11 +77,11 @@ </directory> <directory name="except"> <file>abnorter.c</file> - <file>checkesp.c</file> <file>cpp.c</file> <file>cppexcept.c</file> <file>except.c</file> <file>matherr.c</file> + <file>stack.c</file> <if property="ARCH" value="i386"> <directory name="i386"> <file>prolog.s</file>
Removed: trunk/reactos/lib/sdk/crt/except/checkesp.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/checkesp... ============================================================================== --- trunk/reactos/lib/sdk/crt/except/checkesp.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/except/checkesp.c (removed) @@ -1,35 +1,0 @@ -/********************************************************************* -* _chkesp (MSVCRT.@) -* -* Trap to a debugger if the value of the stack pointer has changed. -* -* PARAMS -* None. -* -* RETURNS -* Does not return. -* -* NOTES -* This function is available for iX86 only. -* -* When VC++ generates debug code, it stores the value of the stack pointer -* before calling any external function, and checks the value following -* the call. It then calls this function, which will trap if the values are -* not the same. Usually this means that the prototype used to call -* the function is incorrect. It can also mean that the .spec entry has -* the wrong calling convention or parameters. -*/ - -#ifdef __i386__ - -void _chkesp(void) -{ -} - -#else - -void _chkesp(void) -{ -} - -#endif /* __i386__ */
Copied: trunk/reactos/lib/sdk/crt/except/stack.c (from r54294, trunk/reactos/lib/sdk/crt/except/checkesp.c) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/stack.c?... ============================================================================== --- trunk/reactos/lib/sdk/crt/except/checkesp.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/except/stack.c [iso-8859-1] Sun Nov 6 12:51:18 2011 @@ -1,3 +1,5 @@ +#include <precomp.h> + /********************************************************************* * _chkesp (MSVCRT.@) * @@ -33,3 +35,14 @@ }
#endif /* __i386__ */ + +/********************************************************************* + * _resetstkoflw (MSVCRT.@) + */ +int CDECL _resetstkoflw(void) +{ + int stack_addr; + + /* causes stack fault that updates NtCurrentTeb()->Tib.StackLimit */ + return VirtualProtect( &stack_addr, 1, PAGE_GUARD|PAGE_READWRITE, NULL ); +}