[CRT_APITEST] Fix version check

This commit is contained in:
Timo Kreuzer 2024-04-13 14:27:02 +03:00
parent a54be9726d
commit f68d8d5459

View file

@ -11,6 +11,8 @@
#include <pseh/pseh2.h> #include <pseh/pseh2.h>
#include <ndk/mmfuncs.h> #include <ndk/mmfuncs.h>
ULONG g_WinVersion;
/* /*
* cmp functions can either return 1/-1 or the actual difference between the * cmp functions can either return 1/-1 or the actual difference between the
* first two differing characters. * first two differing characters.
@ -20,7 +22,7 @@
#ifdef TEST_CRTDLL #ifdef TEST_CRTDLL
#define RETURN_DIFF 0 #define RETURN_DIFF 0
#else #else
#define RETURN_DIFF (GetVersion() >= 0x0600) #define RETURN_DIFF (g_WinVersion >= _WIN32_WINNT_VISTA)
#endif #endif
#define DIFF_RETURN(sign, absolute) (sign (RETURN_DIFF ? absolute : 1)) #define DIFF_RETURN(sign, absolute) (sign (RETURN_DIFF ? absolute : 1))
@ -29,6 +31,9 @@ START_TEST(_mbsncmp)
{ {
int ret; int ret;
ULONG Version = GetVersion();
g_WinVersion = (Version & 0xFF) << 8 | (Version & 0xFF00) >> 8;
/* Zero length always returns true */ /* Zero length always returns true */
ret = _mbsncmp(NULL, NULL, 0); ret = _mbsncmp(NULL, NULL, 0);
ok(ret == 0, "ret = %d\n", ret); ok(ret == 0, "ret = %d\n", ret);