diff --git a/reactos/dll/win32/msvcrt/msvcrt.spec b/reactos/dll/win32/msvcrt/msvcrt.spec index 3b4a4a937a7..e1202fd3782 100644 --- a/reactos/dll/win32/msvcrt/msvcrt.spec +++ b/reactos/dll/win32/msvcrt/msvcrt.spec @@ -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) diff --git a/reactos/lib/sdk/crt/crt.cmake b/reactos/lib/sdk/crt/crt.cmake index 14fd0fa5975..a6e79cb47c1 100644 --- a/reactos/lib/sdk/crt/crt.cmake +++ b/reactos/lib/sdk/crt/crt.cmake @@ -21,11 +21,11 @@ list(APPEND CRT_SOURCE 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 diff --git a/reactos/lib/sdk/crt/crt.rbuild b/reactos/lib/sdk/crt/crt.rbuild index 035908ea74e..e45776e8af9 100644 --- a/reactos/lib/sdk/crt/crt.rbuild +++ b/reactos/lib/sdk/crt/crt.rbuild @@ -77,11 +77,11 @@ abnorter.c - checkesp.c cpp.c cppexcept.c except.c matherr.c + stack.c prolog.s diff --git a/reactos/lib/sdk/crt/except/checkesp.c b/reactos/lib/sdk/crt/except/stack.c similarity index 70% rename from reactos/lib/sdk/crt/except/checkesp.c rename to reactos/lib/sdk/crt/except/stack.c index 02e41f4aab7..556692658ba 100644 --- a/reactos/lib/sdk/crt/except/checkesp.c +++ b/reactos/lib/sdk/crt/except/stack.c @@ -1,3 +1,5 @@ +#include + /********************************************************************* * _chkesp (MSVCRT.@) * @@ -33,3 +35,14 @@ void _chkesp(void) } #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 ); +}