From 18b8f951bfe8fab2726e7ac47b4d3917d3e2281e Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 20 Apr 2011 12:37:56 +0200 Subject: [PATCH] msvcrt: Added _resetstkoflw implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr70/msvcr70.spec | 2 +- dlls/msvcr71/msvcr71.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/misc.c | 12 +++++++++++- dlls/msvcrt/msvcrt.spec | 2 +- 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index cf5b3e1386f..6d7718c8208 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1045,7 +1045,7 @@ @ cdecl _realloc_crt(ptr long) msvcrt.realloc @ cdecl _recalloc(ptr long long) msvcr90._recalloc @ stub _recalloc_crt -@ stub _resetstkoflw +@ cdecl _resetstkoflw() msvcrt._resetstkoflw @ cdecl _rmdir(str) msvcrt._rmdir @ cdecl _rmtmp() msvcrt._rmtmp @ cdecl _rotl(long long) msvcrt._rotl diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec index 9df4d9ca478..a48003b6dd2 100644 --- a/dlls/msvcr70/msvcr70.spec +++ b/dlls/msvcr70/msvcr70.spec @@ -499,7 +499,7 @@ @ cdecl _putws(wstr) msvcrt._putws @ stub _pwctype @ cdecl _read(long ptr long) msvcrt._read -@ stub _resetstkoflw +@ cdecl _resetstkoflw() msvcrt._resetstkoflw @ cdecl _rmdir(str) msvcrt._rmdir @ cdecl _rmtmp() msvcrt._rmtmp @ cdecl _rotl(long long) msvcrt._rotl diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec index 7949a4b16b0..9caefb7ddfb 100644 --- a/dlls/msvcr71/msvcr71.spec +++ b/dlls/msvcr71/msvcr71.spec @@ -494,7 +494,7 @@ @ cdecl _putws(wstr) msvcrt._putws @ extern _pwctype msvcrt._pwctype @ cdecl _read(long ptr long) msvcrt._read -@ stub _resetstkoflw +@ cdecl _resetstkoflw() msvcrt._resetstkoflw @ cdecl _rmdir(str) msvcrt._rmdir @ cdecl _rmtmp() msvcrt._rmtmp @ cdecl _rotl(long long) msvcrt._rotl diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index e2aec87005d..fa2a2714a89 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -893,7 +893,7 @@ @ cdecl _realloc_crt(ptr long) msvcrt.realloc @ cdecl _recalloc(ptr long long) msvcr90._recalloc @ stub _recalloc_crt -@ stub _resetstkoflw +@ cdecl _resetstkoflw() msvcrt._resetstkoflw @ cdecl _rmdir(str) msvcrt._rmdir @ cdecl _rmtmp() msvcrt._rmtmp @ cdecl _rotl(long long) msvcrt._rotl diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 36c7bdb4b21..cbf4f7476b6 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -879,7 +879,7 @@ @ cdecl _realloc_crt(ptr long) msvcrt.realloc @ cdecl _recalloc(ptr long long) @ stub _recalloc_crt -@ stub _resetstkoflw +@ cdecl _resetstkoflw() msvcrt._resetstkoflw @ cdecl _rmdir(str) msvcrt._rmdir @ cdecl _rmtmp() msvcrt._rmtmp @ cdecl _rotl(long long) msvcrt._rotl diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index b32fdb950d0..a5726364403 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -256,9 +256,19 @@ void CDECL MSVCRT_qsort_s(void *base, MSVCRT_size_t nmemb, MSVCRT_size_t size, /********************************************************************* * _get_output_format (MSVCRT.@) - * */ unsigned int CDECL _get_output_format(void) { return 0; } + +/********************************************************************* + * _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 ); +} diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 9777e321816..aaaca940a36 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -827,7 +827,7 @@ # extern _pwctype @ cdecl _read(long ptr long) MSVCRT__read # stub _realloc_dbg -# stub _resetstkoflw +@ cdecl _resetstkoflw() @ cdecl _rmdir(str) MSVCRT__rmdir @ cdecl _rmtmp() @ cdecl _rotl(long long)