26#define FLAG_BUGGY_ServicePackMajorMinor 1
27#define FLAG_AlternateHookOrder 2
49 winetest_ok(lib == 0,
"Expected LibrarayName to be %s, was: %s for %s\n",
library,
hook->LibraryName, shim);
50 winetest_ok(
fn == 0,
"Expected FunctionName to be %s, was: %s for %s\n", function,
hook->FunctionName, shim);
51 *same = (lib == 0 &&
fn == 0);
61 skip(
"Skipping implementation tests for %s\n", shim);
65 while (
v1.dwOSVersionInfoSize)
72 winetest_ok(ok1 ==
ok2,
"Expected ok1 to equal ok2, was: %i, %i for %s\n", ok1,
ok2, shim);
75 char szCSDVersion[128] =
"";
76 winetest_ok(
v1.dwOSVersionInfoSize ==
v2.dwOSVersionInfoSize,
"Expected dwOSVersionInfoSize to be equal, was: %u, %u for %s\n",
v1.dwOSVersionInfoSize,
v2.dwOSVersionInfoSize, shim);
77 winetest_ok(
info->dwMajorVersion ==
v2.dwMajorVersion,
"Expected dwMajorVersion to be equal, was: %u, %u for %s\n",
info->dwMajorVersion,
v2.dwMajorVersion, shim);
78 winetest_ok(
info->dwMinorVersion ==
v2.dwMinorVersion,
"Expected dwMinorVersion to be equal, was: %u, %u for %s\n",
info->dwMinorVersion,
v2.dwMinorVersion, shim);
79 winetest_ok(
info->dwBuildNumber ==
v2.dwBuildNumber,
"Expected dwBuildNumber to be equal, was: %u, %u for %s\n",
info->dwBuildNumber,
v2.dwBuildNumber, shim);
80 winetest_ok(
info->dwPlatformId ==
v2.dwPlatformId,
"Expected dwPlatformId to be equal, was: %u, %u for %s\n",
info->dwPlatformId,
v2.dwPlatformId, shim);
82 if (
info->wServicePackMajor)
84 winetest_ok(
lstrcmpA(szCSDVersion,
v2.szCSDVersion) == 0,
"Expected szCSDVersion to be equal, was: %s, %s for %s\n", szCSDVersion,
v2.szCSDVersion, shim);
90 winetest_ok(
info->wServicePackMajor ==
v2.wServicePackMajor,
"Expected wServicePackMajor to be equal, was: %i, %i for %s\n",
info->wServicePackMajor,
v2.wServicePackMajor, shim);
91 winetest_ok(
info->wServicePackMinor ==
v2.wServicePackMinor,
"Expected wServicePackMinor to be equal, was: %i, %i for %s\n",
info->wServicePackMinor,
v2.wServicePackMinor, shim);
95 winetest_ok(
v1.wServicePackMajor ==
v2.wServicePackMajor,
"Expected wServicePackMajor to be equal, was: %i, %i for %s\n",
v1.wServicePackMajor,
v2.wServicePackMajor, shim);
96 winetest_ok(
v1.wServicePackMinor ==
v2.wServicePackMinor,
"Expected wServicePackMinor to be equal, was: %i, %i for %s\n",
v1.wServicePackMinor,
v2.wServicePackMinor, shim);
98 winetest_ok(
v1.wSuiteMask ==
v2.wSuiteMask,
"Expected wSuiteMask to be equal, was: %i, %i for %s\n",
v1.wSuiteMask,
v2.wSuiteMask, shim);
99 winetest_ok(
v1.wProductType ==
v2.wProductType,
"Expected wProductType to be equal, was: %i, %i for %s\n",
v1.wProductType,
v2.wProductType, shim);
100 winetest_ok(
v1.wReserved ==
v2.wReserved,
"Expected wReserved to be equal, was: %i, %i for %s\n",
v1.wReserved,
v2.wReserved, shim);
104 winetest_ok(
v1.wServicePackMajor == 0 &&
v2.wServicePackMajor == 0,
"Expected wServicePackMajor to be 0, was: %i, %i for %s\n",
v1.wServicePackMajor,
v2.wServicePackMajor, shim);
105 winetest_ok(
v1.wServicePackMinor == 0 &&
v2.wServicePackMinor == 0,
"Expected wServicePackMinor to be 0, was: %i, %i for %s\n",
v1.wServicePackMinor,
v2.wServicePackMinor, shim);
106 winetest_ok(
v1.wSuiteMask == 0 &&
v2.wSuiteMask == 0,
"Expected wSuiteMask to be 0, was: %i, %i for %s\n",
v1.wSuiteMask,
v2.wSuiteMask, shim);
107 winetest_ok(
v1.wProductType == 0 &&
v2.wProductType == 0,
"Expected wProductType to be 0, was: %i, %i for %s\n",
v1.wProductType,
v2.wProductType, shim);
108 winetest_ok(
v1.wReserved == 0 &&
v2.wReserved == 0,
"Expected wReserved to be 0, was: %i, %i for %s\n",
v1.wReserved,
v2.wReserved, shim);
126 skip(
"Skipping implementation tests for %s\n", shim);
130 while (
v1.dwOSVersionInfoSize)
139 skip(
"Skipping first check because 0x%x is (falsely) not accepted by the shim %s\n",
sizeof(
v1), shim);
143 winetest_ok(ok1 ==
ok2,
"Expected ok1 to equal ok2, was: %i, %i for %s(first:%d)\n", ok1,
ok2, shim,
first);
147 WCHAR szCSDVersion[128] = { 0 };
148 winetest_ok(
v1.dwOSVersionInfoSize ==
v2.dwOSVersionInfoSize,
"Expected dwOSVersionInfoSize to be equal, was: %u, %u for %s\n",
v1.dwOSVersionInfoSize,
v2.dwOSVersionInfoSize, shim);
149 winetest_ok(
info->dwMajorVersion ==
v2.dwMajorVersion,
"Expected dwMajorVersion to be equal, was: %u, %u for %s\n",
info->dwMajorVersion,
v2.dwMajorVersion, shim);
150 winetest_ok(
info->dwMinorVersion ==
v2.dwMinorVersion,
"Expected dwMinorVersion to be equal, was: %u, %u for %s\n",
info->dwMinorVersion,
v2.dwMinorVersion, shim);
151 winetest_ok(
info->dwBuildNumber ==
v2.dwBuildNumber,
"Expected dwBuildNumber to be equal, was: %u, %u for %s\n",
info->dwBuildNumber,
v2.dwBuildNumber, shim);
152 winetest_ok(
info->dwPlatformId ==
v2.dwPlatformId,
"Expected dwPlatformId to be equal, was: %u, %u for %s\n",
info->dwPlatformId,
v2.dwPlatformId, shim);
154 if (
info->wServicePackMajor)
162 winetest_ok(
info->wServicePackMajor ==
v2.wServicePackMajor,
"Expected wServicePackMajor to be equal, was: %i, %i for %s\n",
info->wServicePackMajor,
v2.wServicePackMajor, shim);
163 winetest_ok(
info->wServicePackMinor ==
v2.wServicePackMinor,
"Expected wServicePackMinor to be equal, was: %i, %i for %s\n",
info->wServicePackMinor,
v2.wServicePackMinor, shim);
167 winetest_ok(
v1.wServicePackMajor ==
v2.wServicePackMajor,
"Expected wServicePackMajor to be equal, was: %i, %i for %s\n",
v1.wServicePackMajor,
v2.wServicePackMajor, shim);
168 winetest_ok(
v1.wServicePackMinor ==
v2.wServicePackMinor,
"Expected wServicePackMinor to be equal, was: %i, %i for %s\n",
v1.wServicePackMinor,
v2.wServicePackMinor, shim);
170 winetest_ok(
v1.wSuiteMask ==
v2.wSuiteMask,
"Expected wSuiteMask to be equal, was: %i, %i for %s\n",
v1.wSuiteMask,
v2.wSuiteMask, shim);
171 winetest_ok(
v1.wProductType ==
v2.wProductType,
"Expected wProductType to be equal, was: %i, %i for %s\n",
v1.wProductType,
v2.wProductType, shim);
172 winetest_ok(
v1.wReserved ==
v2.wReserved,
"Expected wReserved to be equal, was: %i, %i for %s\n",
v1.wReserved,
v2.wReserved, shim);
176 winetest_ok(
v1.wServicePackMajor == 0 &&
v2.wServicePackMajor == 0,
"Expected wServicePackMajor to be 0, was: %i, %i for %s\n",
v1.wServicePackMajor,
v2.wServicePackMajor, shim);
177 winetest_ok(
v1.wServicePackMinor == 0 &&
v2.wServicePackMinor == 0,
"Expected wServicePackMinor to be 0, was: %i, %i for %s\n",
v1.wServicePackMinor,
v2.wServicePackMinor, shim);
178 winetest_ok(
v1.wSuiteMask == 0 &&
v2.wSuiteMask == 0,
"Expected wSuiteMask to be 0, was: %i, %i for %s\n",
v1.wSuiteMask,
v2.wSuiteMask, shim);
179 winetest_ok(
v1.wProductType == 0 &&
v2.wProductType == 0,
"Expected wProductType to be 0, was: %i, %i for %s\n",
v1.wProductType,
v2.wProductType, shim);
180 winetest_ok(
v1.wReserved == 0 &&
v2.wReserved == 0,
"Expected wReserved to be 0, was: %i, %i for %s\n",
v1.wReserved,
v2.wReserved, shim);
197 skip(
"Skipping implementation tests for %s\n", shim);
201 winetest_ok(
info->FullVersion == ver,
"Expected GetVersion to return 0x%x, was: 0x%x for %s\n",
info->FullVersion, ver, shim);
205#define verify_shima (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : verify_shima_imp
206#define verify_shimw (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : verify_shimw_imp
207#define verify_shim (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : verify_shim_imp
215 WCHAR wide_shim[50] = { 0 };
220 ver = (
info->dwMajorVersion << 8) |
info->dwMinorVersion;
223 skip(
"Skipping tests for layers (%s) not present in this os (0x%x)\n", shim,
g_WinVersion);
226 ok(
hook !=
NULL,
"Expected hook to be a valid pointer for %s\n", shim);
229 ok(num_shims == 3,
"Expected num_shims to be 3, was: %u for %s\n", num_shims, shim);
230 if (
hook && num_shims == 3)
244 ok(shimnum_ok,
"Expected num_shims to be 4%s, was: %u for %s\n", ((ver <
_WIN32_WINNT_WINXP) ?
" or 3":
""), num_shims, shim);
245 if (
hook && shimnum_ok)
303 pRtlGetVersion(&rtlinfo);
312 if (!pSdbGetAppPatchDir)
317 if (!pSdbGetAppPatchDir)
319 skip(
"Unable to retrieve SdbGetAppPatchDir (%p, %p)\n",
dll, pSdbGetAppPatchDir);
325 skip(
"Unable to retrieve AppPatch dir, building manually\n");
328 skip(
"Unable to build AppPatch name(1)\n");
333 skip(
"Unable to build AppPatch name(2)\n");
340 skip(
"Unable to append dll name\n");
347 skip(
"Unable to load shim dll from AppPatch\n");
358 skip(
"Unable to load shim dll from System32 (Recent Win10)\n");
365 return *ppGetHookAPIs !=
NULL;
377 skip(
"No GetHookAPIs found\n");
#define ok2(expression, text, expected, got)
PHOOKAPI(WINAPI * tGETHOOKAPIS)(LPCSTR szCommandLine, LPCWSTR wszShimName, PDWORD pdwHookCount)
HRESULT(WINAPI * tSDBGETAPPPATCHDIR)(PVOID hsdb, LPWSTR path, DWORD size)
struct VersionLieInfo VersionLieInfo
VersionLieInfo g_Win2k3SP1
VersionLieInfo g_Win2000SP2
VersionLieInfo g_WinNT4SP5
VersionLieInfo g_WinVistaRTM
VersionLieInfo g_WinXPSP1
BOOL(WINAPI * GETVERSIONEXAPROC)(LPOSVERSIONINFOEXA)
VersionLieInfo g_Win2000SP1
VersionLieInfo g_Win81RTM
VersionLieInfo g_Win10RTM
VersionLieInfo g_Win2k19RTM
VersionLieInfo g_Win2k16RTM
VersionLieInfo g_Win2k3RTM
VersionLieInfo g_WinXPSP2
VersionLieInfo g_Win2000SP3
VersionLieInfo g_WinVistaSP2
VersionLieInfo g_WinXPSP3
VersionLieInfo g_WinVistaSP1
#define GetProcAddress(x, y)
#define MultiByteToWideChar
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
BOOL WINAPI GetVersionExA(IN LPOSVERSIONINFOA lpVersionInformation)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLfloat GLfloat GLfloat v2
DWORD get_host_winver(void)
static void verify_shimw_imp(PHOOKAPI hook, const VersionLieInfo *info, PCSTR shim, int same, int first_might_be_broken)
static void verify_shima_imp(PHOOKAPI hook, const VersionLieInfo *info, PCSTR shim, int same)
#define FLAG_AlternateHookOrder
static void verify_shim_imp(PHOOKAPI hook, const VersionLieInfo *info, PCSTR shim, int same)
BOOL LoadShimDLL(PCWSTR ShimDll, HMODULE *module, tGETHOOKAPIS *ppGetHookAPIs)
DWORD(WINAPI * GETVERSIONPROC)(void)
static DWORD g_WinVersion
tGETHOOKAPIS LoadShimDLL2(PCWSTR ShimDll)
#define FLAG_BUGGY_ServicePackMajorMinor
static tGETHOOKAPIS pGetHookAPIs
BOOL(WINAPI * GETVERSIONEXWPROC)(LPOSVERSIONINFOEXW)
void expect_shim_imp(PHOOKAPI hook, PCSTR library, PCSTR function, PCSTR shim, int *same)
#define VER_PLATFORM_WIN32_NT
#define VER_PLATFORM_WIN32_WINDOWS
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
#define _WIN32_WINNT_WINXP
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat,...)
ULONG dwOSVersionInfoSize
static GLenum _GLUfuncptr fn
struct _OSVERSIONINFOA OSVERSIONINFOA
struct _OSVERSIONINFOEXA * LPOSVERSIONINFOEXA
struct _OSVERSIONINFOW OSVERSIONINFOW
struct _OSVERSIONINFOEXW * LPOSVERSIONINFOEXW