From 6113a251ef3955f2ac3436d90a523faf4c03bc0a Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 29 Jan 2020 14:27:35 +0100 Subject: [PATCH] msvcrt: Reimplement _set_new_mode function. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/heap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/msvcrt/heap.c b/dlls/msvcrt/heap.c index 52f800e824d..31153fa5b18 100644 --- a/dlls/msvcrt/heap.c +++ b/dlls/msvcrt/heap.c @@ -226,12 +226,8 @@ MSVCRT_new_handler_func CDECL MSVCRT_set_new_handler(void *func) */ int CDECL MSVCRT__set_new_mode(int mode) { - int old_mode; - LOCK_HEAP; - old_mode = MSVCRT_new_mode; - MSVCRT_new_mode = mode; - UNLOCK_HEAP; - return old_mode; + if(!MSVCRT_CHECK_PMT(mode == 0 || mode == 1)) return -1; + return InterlockedExchange(&MSVCRT_new_mode, mode); } /*********************************************************************