mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:46:13 +00:00
[APPSHIM_APITEST] Fix 2k3 test failures
This commit is contained in:
parent
b3b40b35c9
commit
1292f5f881
3 changed files with 27 additions and 20 deletions
|
@ -15,7 +15,6 @@
|
||||||
#include "appshim_apitest.h"
|
#include "appshim_apitest.h"
|
||||||
|
|
||||||
static DWORD g_WinVersion;
|
static DWORD g_WinVersion;
|
||||||
#define WINVER_WIN8 0x0602
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct expect_shim_hook
|
typedef struct expect_shim_hook
|
||||||
|
@ -36,7 +35,7 @@ static expect_shim_data data[] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
L"IgnoreChromeSandbox",
|
L"IgnoreChromeSandbox",
|
||||||
WINVER_WIN8,
|
_WIN32_WINNT_WIN8,
|
||||||
{
|
{
|
||||||
{ "KERNEL32.DLL", "CreateProcessW" },
|
{ "KERNEL32.DLL", "CreateProcessW" },
|
||||||
}
|
}
|
||||||
|
@ -98,7 +97,10 @@ START_TEST(genral_hooks)
|
||||||
PHOOKAPI hook = pGetHookAPIs("", current->ShimName, &num_shims);
|
PHOOKAPI hook = pGetHookAPIs("", current->ShimName, &num_shims);
|
||||||
|
|
||||||
if (current->MinVersion > g_WinVersion && !hook)
|
if (current->MinVersion > g_WinVersion && !hook)
|
||||||
|
{
|
||||||
|
skip("Shim %s not present\n", wine_dbgstr_w(current->ShimName));
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ok(!!hook, "Expected a valid pointer, got nothing for %s\n", wine_dbgstr_w(current->ShimName));
|
ok(!!hook, "Expected a valid pointer, got nothing for %s\n", wine_dbgstr_w(current->ShimName));
|
||||||
ok(num_shims == expected_shims, "Expected %u shims, got %u for %s\n",
|
ok(num_shims == expected_shims, "Expected %u shims, got %u for %s\n",
|
||||||
|
|
|
@ -47,7 +47,7 @@ static expect_shim_data data[] =
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
L"VerifyVersionInfoLite",
|
L"VerifyVersionInfoLite",
|
||||||
0,
|
_WIN32_WINNT_VISTA,
|
||||||
{
|
{
|
||||||
{ "KERNEL32.DLL", "VerifyVersionInfoA" },
|
{ "KERNEL32.DLL", "VerifyVersionInfoA" },
|
||||||
{ "KERNEL32.DLL", "VerifyVersionInfoW" },
|
{ "KERNEL32.DLL", "VerifyVersionInfoW" },
|
||||||
|
@ -56,7 +56,7 @@ static expect_shim_data data[] =
|
||||||
/* Show that it is not case sensitive */
|
/* Show that it is not case sensitive */
|
||||||
{
|
{
|
||||||
L"VeRiFyVeRsIoNInFoLiTe",
|
L"VeRiFyVeRsIoNInFoLiTe",
|
||||||
0,
|
_WIN32_WINNT_VISTA,
|
||||||
{
|
{
|
||||||
{ "KERNEL32.DLL", "VerifyVersionInfoA" },
|
{ "KERNEL32.DLL", "VerifyVersionInfoA" },
|
||||||
{ "KERNEL32.DLL", "VerifyVersionInfoW" },
|
{ "KERNEL32.DLL", "VerifyVersionInfoW" },
|
||||||
|
@ -109,7 +109,10 @@ START_TEST(layer_hooks)
|
||||||
PHOOKAPI hook = pGetHookAPIs("", current->ShimName, &num_shims);
|
PHOOKAPI hook = pGetHookAPIs("", current->ShimName, &num_shims);
|
||||||
|
|
||||||
if (current->MinVersion > g_WinVersion && !hook)
|
if (current->MinVersion > g_WinVersion && !hook)
|
||||||
|
{
|
||||||
|
skip("Shim %s not present\n", wine_dbgstr_w(current->ShimName));
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ok(!!hook, "Expected a valid pointer, got nothing for %s\n", wine_dbgstr_w(current->ShimName));
|
ok(!!hook, "Expected a valid pointer, got nothing for %s\n", wine_dbgstr_w(current->ShimName));
|
||||||
ok(num_shims == expected_shims, "Expected %u shims, got %u for %s\n",
|
ok(num_shims == expected_shims, "Expected %u shims, got %u for %s\n",
|
||||||
|
|
|
@ -22,8 +22,9 @@ static tGETHOOKAPIS pGetHookAPIs;
|
||||||
|
|
||||||
|
|
||||||
static DWORD g_WinVersion;
|
static DWORD g_WinVersion;
|
||||||
#define WINVER_WINXP 0x0501
|
|
||||||
|
|
||||||
|
#define FLAG_BUGGY_ServicePackMajorMinor 1
|
||||||
|
#define FLAG_AlternateHookOrder 2
|
||||||
|
|
||||||
typedef struct VersionLieInfo
|
typedef struct VersionLieInfo
|
||||||
{
|
{
|
||||||
|
@ -34,6 +35,7 @@ typedef struct VersionLieInfo
|
||||||
DWORD dwPlatformId;
|
DWORD dwPlatformId;
|
||||||
WORD wServicePackMajor;
|
WORD wServicePackMajor;
|
||||||
WORD wServicePackMinor;
|
WORD wServicePackMinor;
|
||||||
|
WORD wFlags;
|
||||||
} VersionLieInfo;
|
} VersionLieInfo;
|
||||||
|
|
||||||
typedef BOOL(WINAPI* GETVERSIONEXAPROC)(LPOSVERSIONINFOEXA);
|
typedef BOOL(WINAPI* GETVERSIONEXAPROC)(LPOSVERSIONINFOEXA);
|
||||||
|
@ -83,7 +85,7 @@ static void verify_shima_imp(PHOOKAPI hook, const VersionLieInfo* info, PCSTR sh
|
||||||
|
|
||||||
if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA))
|
if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA))
|
||||||
{
|
{
|
||||||
if (info->dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)
|
if (!(info->wFlags & FLAG_BUGGY_ServicePackMajorMinor))
|
||||||
{
|
{
|
||||||
winetest_ok(info->wServicePackMajor == v2.wServicePackMajor, "Expected wServicePackMajor to be equal, was: %i, %i for %s\n", info->wServicePackMajor, v2.wServicePackMajor, shim);
|
winetest_ok(info->wServicePackMajor == v2.wServicePackMajor, "Expected wServicePackMajor to be equal, was: %i, %i for %s\n", info->wServicePackMajor, v2.wServicePackMajor, shim);
|
||||||
winetest_ok(info->wServicePackMinor == v2.wServicePackMinor, "Expected wServicePackMinor to be equal, was: %i, %i for %s\n", info->wServicePackMinor, v2.wServicePackMinor, shim);
|
winetest_ok(info->wServicePackMinor == v2.wServicePackMinor, "Expected wServicePackMinor to be equal, was: %i, %i for %s\n", info->wServicePackMinor, v2.wServicePackMinor, shim);
|
||||||
|
@ -155,7 +157,7 @@ static void verify_shimw_imp(PHOOKAPI hook, const VersionLieInfo* info, PCSTR sh
|
||||||
|
|
||||||
if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
|
if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
|
||||||
{
|
{
|
||||||
if (info->dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)
|
if (!(info->wFlags & FLAG_BUGGY_ServicePackMajorMinor))
|
||||||
{
|
{
|
||||||
winetest_ok(info->wServicePackMajor == v2.wServicePackMajor, "Expected wServicePackMajor to be equal, was: %i, %i for %s\n", info->wServicePackMajor, v2.wServicePackMajor, shim);
|
winetest_ok(info->wServicePackMajor == v2.wServicePackMajor, "Expected wServicePackMajor to be equal, was: %i, %i for %s\n", info->wServicePackMajor, v2.wServicePackMajor, shim);
|
||||||
winetest_ok(info->wServicePackMinor == v2.wServicePackMinor, "Expected wServicePackMinor to be equal, was: %i, %i for %s\n", info->wServicePackMinor, v2.wServicePackMinor, shim);
|
winetest_ok(info->wServicePackMinor == v2.wServicePackMinor, "Expected wServicePackMinor to be equal, was: %i, %i for %s\n", info->wServicePackMinor, v2.wServicePackMinor, shim);
|
||||||
|
@ -222,24 +224,24 @@ static void run_test(LPCSTR shim, const VersionLieInfo* info)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ok(hook != NULL, "Expected hook to be a valid pointer for %s\n", shim);
|
ok(hook != NULL, "Expected hook to be a valid pointer for %s\n", shim);
|
||||||
if (info->dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
|
if (info->wFlags & FLAG_AlternateHookOrder)
|
||||||
{
|
{
|
||||||
ok(num_shims == 3, "Expected num_shims to be 3, was: %u for %s\n", num_shims, shim);
|
ok(num_shims == 3, "Expected num_shims to be 3, was: %u for %s\n", num_shims, shim);
|
||||||
if (hook && num_shims == 3)
|
if (hook && num_shims == 3)
|
||||||
{
|
{
|
||||||
int off = info->dwBuildNumber == 0x040A08AE ? 0 : 1, same = 0;
|
int same = 0;
|
||||||
expect_shim(hook + ((0+off)%3), "KERNEL32.DLL", "GetVersionExA", shim, &same);
|
expect_shim(hook + 0, "KERNEL32.DLL", "GetVersion", shim, &same);
|
||||||
verify_shima(hook + ((0+off)%3), info, shim, same);
|
verify_shim(hook + 0, info, shim, same);
|
||||||
expect_shim(hook + ((1+off)%3), "KERNEL32.DLL", "GetVersionExW", shim, &same);
|
expect_shim(hook + 1, "KERNEL32.DLL", "GetVersionExA", shim, &same);
|
||||||
verify_shimw(hook + ((1+off)%3), info, shim, same, 0);
|
verify_shima(hook + 1, info, shim, same);
|
||||||
expect_shim(hook + ((2+off)%3), "KERNEL32.DLL", "GetVersion", shim, &same);
|
expect_shim(hook + 2, "KERNEL32.DLL", "GetVersionExW", shim, &same);
|
||||||
verify_shim(hook + ((2+off)%3), info, shim, same);
|
verify_shimw(hook + 2, info, shim, same, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int shimnum_ok = num_shims == 4 || ((ver < WINVER_WINXP) && (num_shims == 3));
|
int shimnum_ok = num_shims == 4 || ((ver < _WIN32_WINNT_WINXP) && (num_shims == 3));
|
||||||
ok(shimnum_ok, "Expected num_shims to be 4%s, was: %u for %s\n", ((ver < WINVER_WINXP) ? " or 3":""), num_shims, shim);
|
ok(shimnum_ok, "Expected num_shims to be 4%s, was: %u for %s\n", ((ver < _WIN32_WINNT_WINXP) ? " or 3":""), num_shims, shim);
|
||||||
if (hook && shimnum_ok)
|
if (hook && shimnum_ok)
|
||||||
{
|
{
|
||||||
int same = 0;
|
int same = 0;
|
||||||
|
@ -259,9 +261,9 @@ static void run_test(LPCSTR shim, const VersionLieInfo* info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VersionLieInfo g_Win95 = { 0xC3B60004, 4, 0, 950, VER_PLATFORM_WIN32_WINDOWS, 0, 0 };
|
VersionLieInfo g_Win95 = { 0xC3B60004, 4, 0, 950, VER_PLATFORM_WIN32_WINDOWS, 0, 0, FLAG_BUGGY_ServicePackMajorMinor | FLAG_AlternateHookOrder };
|
||||||
VersionLieInfo g_WinNT4SP5 = { 0x05650004, 4, 0, 1381, VER_PLATFORM_WIN32_NT, 5, 0 };
|
VersionLieInfo g_WinNT4SP5 = { 0x05650004, 4, 0, 1381, VER_PLATFORM_WIN32_NT, 5, 0, FLAG_BUGGY_ServicePackMajorMinor };
|
||||||
VersionLieInfo g_Win98 = { 0xC0000A04, 4, 10, 0x040A08AE, VER_PLATFORM_WIN32_WINDOWS, 0, 0 };
|
VersionLieInfo g_Win98 = { 0xC0000A04, 4, 10, 0x040A08AE, VER_PLATFORM_WIN32_WINDOWS, 0, 0, FLAG_BUGGY_ServicePackMajorMinor };
|
||||||
|
|
||||||
VersionLieInfo g_Win2000 = { 0x08930005, 5, 0, 2195, VER_PLATFORM_WIN32_NT, 0, 0 };
|
VersionLieInfo g_Win2000 = { 0x08930005, 5, 0, 2195, VER_PLATFORM_WIN32_NT, 0, 0 };
|
||||||
VersionLieInfo g_Win2000SP1 = { 0x08930005, 5, 0, 2195, VER_PLATFORM_WIN32_NT, 1, 0 };
|
VersionLieInfo g_Win2000SP1 = { 0x08930005, 5, 0, 2195, VER_PLATFORM_WIN32_NT, 1, 0 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue