From: Piotr Caban Subject: [PATCH 1/3] ucrtbase: Fix fopen x mode test failures. Message-Id: <30dc05a2-2b26-b3b9-8ed2-55ec11692d13@codeweavers.com> Date: Mon, 18 Oct 2021 14:57:29 +0200 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51894 Signed-off-by: Piotr Caban --- dlls/ucrtbase/tests/misc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index a91ea6c98b8..f5dbac70ddb 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -1545,17 +1545,18 @@ static void test_fopen_exclusive( void ) DWORD len; FILE *fp; - if (!GetProcAddress(GetModuleHandleA("ucrtbase.dll"), "__std_terminate")) - { - win_skip("skipping fopen x mode tests.\n"); - return; - } - len = GetTempPathA(MAX_PATH, path); ok(len, "GetTempPathA failed\n"); strcat(path, "\\fileexcl.tst"); + SET_EXPECT(global_invalid_parameter_handler); fp = fopen(path, "wx"); + if(called_global_invalid_parameter_handler) + { + win_skip("skipping fopen x mode tests.\n"); + return; + } + expect_global_invalid_parameter_handler = FALSE; ok(fp != NULL, "creating file with mode wx failed\n"); fclose(fp); @@ -1582,7 +1583,7 @@ static void test_fopen_exclusive( void ) ok(!fp, "creating file with mode xw succeeded\n"); fp = fopen(path, "wbx"); - ok(fp != NULL, "creating file with mode wx failed\n"); + ok(fp != NULL, "creating file with mode wbx failed\n"); fclose(fp); unlink(path); }