diff --git a/dlls/msvcrt/heap.c b/dlls/msvcrt/heap.c index 3ee2048abe0..38715e5814c 100644 --- a/dlls/msvcrt/heap.c +++ b/dlls/msvcrt/heap.c @@ -39,6 +39,8 @@ static int MSVCRT_new_mode; /* FIXME - According to documentation it should be 8*1024, at runtime it returns 16 */ static unsigned int MSVCRT_amblksiz = 16; +/* FIXME - According to documentation it should be 480 bytes, at runtime default is 0 */ +static size_t MSVCRT_sbh_threshold = 0; /********************************************************************* * ??2@YAPAXI@Z (MSVCRT.@) @@ -291,3 +293,23 @@ unsigned int* __p__amblksiz(void) { return &MSVCRT_amblksiz; } + +/********************************************************************* + * _get_sbh_threshold (MSVCRT.@) + */ +size_t _get_sbh_threshold(void) +{ + return MSVCRT_sbh_threshold; +} + +/********************************************************************* + * _set_sbh_threshold (MSVCRT.@) + */ +int _set_sbh_threshold(size_t threshold) +{ + if(threshold > 1016) + return 0; + else + MSVCRT_sbh_threshold = threshold; + return 1; +} diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 8ca03658f0a..17ff3733728 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -248,7 +248,7 @@ @ cdecl _futime(long ptr) @ cdecl _gcvt(double long str) @ cdecl _get_osfhandle(long) -@ stub _get_sbh_threshold #() +@ cdecl _get_sbh_threshold() @ cdecl _getch() @ cdecl _getche() @ cdecl _getcwd(str long) @@ -424,7 +424,7 @@ @ cdecl _searchenv(str str ptr) @ stdcall -i386 _seh_longjmp_unwind(ptr) @ cdecl _set_error_mode(long) -@ stub _set_sbh_threshold #(long) +@ cdecl _set_sbh_threshold(long) @ cdecl _seterrormode(long) @ cdecl -i386 _setjmp(ptr) MSVCRT__setjmp @ cdecl -i386 _setjmp3(ptr long) MSVCRT__setjmp3 diff --git a/include/msvcrt/malloc.h b/include/msvcrt/malloc.h index 1e36d16e845..a5504db030f 100644 --- a/include/msvcrt/malloc.h +++ b/include/msvcrt/malloc.h @@ -71,6 +71,9 @@ void free(void*); void* malloc(size_t); void* realloc(void*,size_t); +size_t _get_sbh_threshold(void); +int _set_sbh_threshold(size_t size); + #ifdef __cplusplus } #endif