From f68d8d545978cd0c3426ba0038dd7c9131393398 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 13 Apr 2024 14:27:02 +0300 Subject: [PATCH] [CRT_APITEST] Fix version check --- modules/rostests/apitests/crt/_mbsncmp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/rostests/apitests/crt/_mbsncmp.c b/modules/rostests/apitests/crt/_mbsncmp.c index 836f19afd85..97ca44c13d1 100644 --- a/modules/rostests/apitests/crt/_mbsncmp.c +++ b/modules/rostests/apitests/crt/_mbsncmp.c @@ -11,6 +11,8 @@ #include #include +ULONG g_WinVersion; + /* * cmp functions can either return 1/-1 or the actual difference between the * first two differing characters. @@ -20,7 +22,7 @@ #ifdef TEST_CRTDLL #define RETURN_DIFF 0 #else -#define RETURN_DIFF (GetVersion() >= 0x0600) +#define RETURN_DIFF (g_WinVersion >= _WIN32_WINNT_VISTA) #endif #define DIFF_RETURN(sign, absolute) (sign (RETURN_DIFF ? absolute : 1)) @@ -29,6 +31,9 @@ START_TEST(_mbsncmp) { int ret; + ULONG Version = GetVersion(); + g_WinVersion = (Version & 0xFF) << 8 | (Version & 0xFF00) >> 8; + /* Zero length always returns true */ ret = _mbsncmp(NULL, NULL, 0); ok(ret == 0, "ret = %d\n", ret);