From 0cb5067698470d3beec827a9b41b3d23d606eb44 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Mon, 21 Apr 2014 13:08:00 +0200 Subject: [PATCH] msvcrt: Don't raise exception in _invalid_parameter. --- dlls/msvcrt/errno.c | 2 ++ dlls/msvcrt/tests/misc.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c index 97e37c0c86a..e8e964a6348 100644 --- a/dlls/msvcrt/errno.c +++ b/dlls/msvcrt/errno.c @@ -437,7 +437,9 @@ void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_ else { ERR( "%s:%u %s: %s %lx\n", debugstr_w(file), line, debugstr_w(func), debugstr_w(expr), arg ); +#if _MSVCR_VER > 0 RaiseException( STATUS_INVALID_CRUNTIME_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, NULL ); +#endif } } diff --git a/dlls/msvcrt/tests/misc.c b/dlls/msvcrt/tests/misc.c index 26225f34ce1..3a72e686f13 100644 --- a/dlls/msvcrt/tests/misc.c +++ b/dlls/msvcrt/tests/misc.c @@ -30,6 +30,8 @@ static int (__cdecl *p_get_doserrno)(int *); static int (__cdecl *p_get_errno)(int *); static int (__cdecl *p_set_doserrno)(int); static int (__cdecl *p_set_errno)(int); +static void (__cdecl *p__invalid_parameter)(const wchar_t*, + const wchar_t*, const wchar_t*, unsigned int, uintptr_t); static void init(void) { @@ -42,6 +44,7 @@ static void init(void) p_get_errno = (void *)GetProcAddress(hmod, "_get_errno"); p_set_doserrno = (void *)GetProcAddress(hmod, "_set_doserrno"); p_set_errno = (void *)GetProcAddress(hmod, "_set_errno"); + p__invalid_parameter = (void *)GetProcAddress(hmod, "_invalid_parameter"); } static void test_rand_s(void) @@ -341,6 +344,16 @@ static void test__popen(const char *name) ok(errno == EBADF, "errno = %d\n", errno); } +static void test__invalid_parameter(void) +{ + if(!p__invalid_parameter) { + win_skip("_invalid_parameter not available\n"); + return; + } + + p__invalid_parameter(NULL, NULL, NULL, 0, 0); +} + START_TEST(misc) { int arg_c; @@ -366,4 +379,5 @@ START_TEST(misc) test__set_doserrno(); test__set_errno(); test__popen(arg_v[0]); + test__invalid_parameter(); }