https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f68d8d545978cd0c3426ba0038dd7c9131393398

commit f68d8d545978cd0c3426ba0038dd7c9131393398
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Sat Apr 13 14:27:02 2024 +0300
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Wed Sep 18 10:22:26 2024 +0300

    [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 <pseh/pseh2.h>
 #include <ndk/mmfuncs.h>
 
+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);

Reply via email to