[ROSTESTS] Fix 64 bit issues

This commit is contained in:
Timo Kreuzer 2018-07-14 12:32:57 +02:00
parent a265dc9ce1
commit 7cf7b27a3a
12 changed files with 67 additions and 21 deletions

View file

@ -144,7 +144,7 @@ Test_CreateOpenKey(void)
ok_key_name(ClassesRootKey, &HKLM_ClassesPath, L"Apitest_HKLM");
/* Try opening it in HKCU */
UserKey = (HKEY)0xCAFEF00D;
UserKey = (HKEY)(ULONG_PTR)0xCAFEF00DCAFEF00DULL;
ErrorCode = RegOpenKeyExW(
HKEY_CURRENT_USER,
L"Software\\Classes\\Apitest_HKLM",
@ -186,7 +186,7 @@ Test_CreateOpenKey(void)
ok(!IS_HKCR(MachineKey), "\n");
/* But not in HKCU */
UserKey = (HKEY)0xCAFEF00D;
UserKey = (HKEY)(ULONG_PTR)0xCAFEF00DCAFEF00DULL;
ErrorCode = RegOpenKeyExW(
HKEY_CURRENT_USER,
L"Software\\Classes\\Apitest_HKCR",
@ -205,7 +205,7 @@ Test_CreateOpenKey(void)
RegCloseKey(MachineKey);
/* Test that it is really not present anymore */
MachineKey = (HKEY)0xCAFEF00D;
MachineKey = (HKEY)(ULONG_PTR)0xCAFEF00DCAFEF00DULL;
ErrorCode = RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
L"Software\\Classes\\Apitest_HKCR",
@ -258,7 +258,7 @@ Test_CreateOpenKey(void)
RegCloseKey(UserKey);
/* Test that it is really not present anymore */
UserKey = (HKEY)0xCAFEF00D;
UserKey = (HKEY)(ULONG_PTR)0xCAFEF00DCAFEF00DULL;
ErrorCode = RegOpenKeyExW(
HKEY_CURRENT_USER,
L"Software\\Classes\\Apitest_HKCU",

View file

@ -24,7 +24,7 @@ static void Test_LockUnlockServiceDatabase(void)
ok_err(ERROR_INVALID_HANDLE);
SetLastError(0xdeadbeef);
hScm = (SC_HANDLE)0xdeadbeef;
hScm = (SC_HANDLE)(ULONG_PTR)0xdeadbeefdeadbeefull;
hLock = LockServiceDatabase(hScm);
ok(hLock == NULL, "hLock = 0x%p, expected 0\n", hLock);
ok_err(ERROR_INVALID_HANDLE);
@ -38,7 +38,7 @@ static void Test_LockUnlockServiceDatabase(void)
/*****************************************************************************************/
SetLastError(0xdeadbeef);
hLock = (SC_LOCK)0xdeadbeef;
hLock = (SC_LOCK)(ULONG_PTR)0xdeadbeefdeadbeefull;
bError = UnlockServiceDatabase(hLock);
ok(bError == FALSE, "bError = %u, expected FALSE\n", bError);
ok_err(ERROR_INVALID_SERVICE_LOCK);

View file

@ -71,7 +71,7 @@ static const char* safe_str(const char* ptr)
return ptr;
index ^= 1;
StringCchPrintfA(buffer[index], _countof(buffer[index]), "#%d", (int)ptr);
StringCchPrintfA(buffer[index], _countof(buffer[index]), "#%Id", (intptr_t)ptr);
return buffer[index];
}

View file

@ -61,7 +61,7 @@ static const char* safe_str(const char* ptr)
return ptr;
index ^= 1;
StringCchPrintfA(buffer[index], _countof(buffer[index]), "#%d", (int)ptr);
StringCchPrintfA(buffer[index], _countof(buffer[index]), "#%Id", (intptr_t)ptr);
return buffer[index];
}

View file

@ -35,7 +35,7 @@ typedef struct _EXPLORER_INFO
ULONG Padding[PADDING_SIZE];
} EXPLORER_INFO, *PEXPLORER_INFO;
UINT (WINAPI *SHExplorerParseCmdLine)(_Out_ PEXPLORER_INFO Info);
UINT_PTR (WINAPI *SHExplorerParseCmdLine)(_Out_ PEXPLORER_INFO Info);
#define PIDL_IS_UNTOUCHED -1
#define PIDL_IS_NULL -2
@ -87,7 +87,7 @@ _In_ PCWSTR PidlPath,
_Out_opt_ PUINT PWriteEnd)
{
EXPLORER_INFO Info;
UINT Ret;
UINT_PTR Ret;
ULONG i;
PDWORD InfoWords = (PDWORD) &Info;
@ -99,7 +99,7 @@ _Out_opt_ PUINT PWriteEnd)
if (ExpectedRet == -1)
ok((LPITEMIDLIST) Ret == Info.pidl, "Ret = %x, expected %p\n", Ret, Info.pidl);
else
ok(Ret == ExpectedRet, "Ret = %x, expected %p\n", Ret, (PVOID) ExpectedRet);
ok(Ret == ExpectedRet, "Ret = %x, expected %08x\n", Ret, ExpectedRet);
if (ExpectedFileName == NULL)
ok(Info.FileName == InvalidPointer, "FileName = %p\n", Info.FileName);
@ -410,7 +410,7 @@ START_TEST(SHExplorerParseCmdLine)
WCHAR winDir[MAX_PATH];
HMODULE browseui = LoadLibraryA("browseui.dll");
SHExplorerParseCmdLine = (UINT (__stdcall *)(PEXPLORER_INFO))GetProcAddress(browseui, MAKEINTRESOURCEA(107));
SHExplorerParseCmdLine = (UINT_PTR (__stdcall *)(PEXPLORER_INFO))GetProcAddress(browseui, MAKEINTRESOURCEA(107));
if (!SHExplorerParseCmdLine)
{
skip("SHExplorerParseCmdLine not found, NT 6.0?\n");

View file

@ -23,7 +23,7 @@ START_TEST(CloseThemeData)
pVEH = AddVectoredExceptionHandler(1, VEHandler);
hr = CloseThemeData((HTHEME)0xdeaddead);
hr = CloseThemeData((HTHEME)(ULONG_PTR)0xdeaddeaddeaddeadULL);
ok( hr == E_HANDLE, "Expected E_HANDLE, got 0x%lx\n", hr);
RemoveVectoredExceptionHandler(pVEH);

View file

@ -138,13 +138,13 @@ void Test_Params()
hr = DrawThemeParentBackground(NULL, NULL, NULL);
ok (hr == E_HANDLE, "Expected E_HANDLE got 0x%lx error\n", hr);
hr = DrawThemeParentBackground((HWND)0xdeaddead, NULL, NULL);
hr = DrawThemeParentBackground((HWND)(ULONG_PTR)0xdeaddeaddeaddeadULL, NULL, NULL);
ok (hr == E_HANDLE, "Expected E_HANDLE got 0x%lx error\n", hr);
hr = DrawThemeParentBackground(NULL, (HDC)0xdeaddead, NULL);
hr = DrawThemeParentBackground(NULL, (HDC)(ULONG_PTR)0xdeaddeaddeaddeadULL, NULL);
ok (hr == E_HANDLE, "Expected E_HANDLE got 0x%lx error\n", hr);
hr = DrawThemeParentBackground((HWND)0xdeaddead, (HDC)0xdeaddead, NULL);
hr = DrawThemeParentBackground((HWND)(ULONG_PTR)0xdeaddeaddeaddeadULL, (HDC)(ULONG_PTR)0xdeaddeaddeaddeadULL, NULL);
ok (hr == E_HANDLE, "Expected E_HANDLE got 0x%lx error\n", hr);
RemoveVectoredExceptionHandler(pVEH);
@ -173,11 +173,11 @@ void Test_Params()
hr = DrawThemeParentBackground(hWnd1, hdc, NULL);
ok (hr == S_OK, "Expected success got 0x%lx error\n", hr);
hr = DrawThemeParentBackground(hWnd1, (HDC)0xdeaddead, NULL);
hr = DrawThemeParentBackground(hWnd1, (HDC)(ULONG_PTR)0xdeaddeaddeaddeadULL, NULL);
ok (hr == S_OK, "Expected success got 0x%lx error\n", hr);
pVEH = AddVectoredExceptionHandler(1, VEHandler_2);
hr = DrawThemeParentBackground(hWnd1, hdc, (RECT*)0xdeaddead);
hr = DrawThemeParentBackground(hWnd1, hdc, (RECT*)(ULONG_PTR)0xdeaddeaddeaddeadULL);
ok (hr == E_POINTER, "Expected success got 0x%lx error\n", hr);
RemoveVectoredExceptionHandler(pVEH);
ok (bGotException == TRUE, "Excepted a handled exception\n");

View file

@ -17,7 +17,7 @@ void TestParams(HWND hwnd)
hr = SetWindowTheme(0, NULL, NULL);
ok (hr == E_HANDLE, "Expected E_HANDLE got 0x%lx error\n", hr);
hr = SetWindowTheme((HWND)0xdeaddead, NULL, NULL);
hr = SetWindowTheme((HWND)(ULONG_PTR)0xdeaddeaddeaddeadULL, NULL, NULL);
ok (hr == E_HANDLE, "Expected E_HANDLE got 0x%lx error\n", hr);
hr = SetWindowTheme(hwnd, NULL, NULL);

View file

@ -56,7 +56,7 @@ static void WlanOpenHandle_test(void)
static void WlanCloseHandle_test(void)
{
DWORD ret;
HANDLE hClientHandle = (HANDLE) 0xdeadbeef;
HANDLE hClientHandle = (HANDLE)(ULONG_PTR)0xdeadbeefdeadbeef;
/* invalid pReserved */
ret = WlanCloseHandle(hClientHandle, (PVOID) 1);

View file

@ -27,7 +27,7 @@ CALLBACK completion(
ok(lpOverlapped != NULL, "lpOverlapped %p\n", lpOverlapped);
if (lpOverlapped)
{
ok(lpOverlapped->hEvent != INVALID_HANDLE_VALUE, "lpOverlapped->hEvent %d\n", (int)lpOverlapped->hEvent);
ok(lpOverlapped->hEvent != INVALID_HANDLE_VALUE, "lpOverlapped->hEvent %p\n", lpOverlapped->hEvent);
if (lpOverlapped->hEvent != INVALID_HANDLE_VALUE)
WSASetEvent(lpOverlapped->hEvent);
}

View file

@ -91,7 +91,11 @@ static void test_RunSetupCommand(void)
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d\n", hr);
/* try to run a nonexistent exe */
#ifdef __REACTOS__
hexe = (HANDLE)(ULONG_PTR)0xdeadbeefdeadbeefull;
#else
hexe = (HANDLE)0xdeadbeef;
#endif
hr = pRunSetupCommand(NULL, "idontexist.exe", "Install", systemdir, "Title", &hexe, 0, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr);
@ -99,7 +103,11 @@ static void test_RunSetupCommand(void)
ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n");
/* try a bad directory */
#ifdef __REACTOS__
hexe = (HANDLE)(ULONG_PTR)0xdeadbeefdeadbeefull;
#else
hexe = (HANDLE)0xdeadbeef;
#endif
hr = pRunSetupCommand(NULL, "winver.exe", "Install", "non\\existent\\directory", "Title", &hexe, 0, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_DIRECTORY),
"Expected HRESULT_FROM_WIN32(ERROR_DIRECTORY), got %d\n", hr);
@ -107,14 +115,26 @@ static void test_RunSetupCommand(void)
ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n");
/* try to run an exe with the RSC_FLAG_INF flag */
#ifdef __REACTOS__
hexe = (HANDLE)(ULONG_PTR)0xdeadbeefdeadbeefull;
#else
hexe = (HANDLE)0xdeadbeef;
#endif
hr = pRunSetupCommand(NULL, "winver.exe", "Install", systemdir, "Title", &hexe, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
ok(is_spapi_err(hr), "Expected a setupapi error, got %d\n", hr);
#ifdef __REACTOS__
ok(hexe == (HANDLE)(ULONG_PTR)0xdeadbeefdeadbeefull, "Expected hexe to be 0xdeadbeef\n");
#else
ok(hexe == (HANDLE)0xdeadbeef, "Expected hexe to be 0xdeadbeef\n");
#endif
ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n");
/* run winver.exe */
#ifdef __REACTOS__
hexe = (HANDLE)(ULONG_PTR)0xdeadbeefdeadbeefull;
#else
hexe = (HANDLE)0xdeadbeef;
#endif
hr = pRunSetupCommand(NULL, "winver.exe", "Install", systemdir, "Title", &hexe, 0, NULL);
ok(hr == S_ASYNCHRONOUS, "Expected S_ASYNCHRONOUS, got %d\n", hr);
ok(hexe != NULL, "Expected hexe to be non-NULL\n");

View file

@ -6548,17 +6548,30 @@ static void test_COM(void)
IDirectPlay3A *dp3A;
IDirectPlay3 *dp3;
IDirectPlay4A *dp4A;
#ifdef __REACTOS__
IDirectPlay4 *dp4 = (IDirectPlay4*)(ULONG_PTR)0xdeadbeefdeadbeefull;
#else
IDirectPlay4 *dp4 = (IDirectPlay4*)0xdeadbeef;
#endif
IUnknown *unk;
ULONG refcount;
HRESULT hr;
/* COM aggregation */
#ifdef __REACTOS__
hr = CoCreateInstance(&CLSID_DirectPlay, (IUnknown*)(ULONG_PTR)0xdeadbeefdeadbeefull, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&dp4);
#else
hr = CoCreateInstance(&CLSID_DirectPlay, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&dp4);
#endif
ok(hr == CLASS_E_NOAGGREGATION || broken(hr == E_INVALIDARG),
"DirectPlay create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
#ifdef __REACTOS__
ok(!dp4 || dp4 == (IDirectPlay4*)(ULONG_PTR)0xdeadbeefdeadbeefull, "dp4 = %p\n", dp4);
#else
ok(!dp4 || dp4 == (IDirectPlay4*)0xdeadbeef, "dp4 = %p\n", dp4);
#endif
/* Invalid RIID */
hr = CoCreateInstance(&CLSID_DirectPlay, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlayLobby,
@ -6630,7 +6643,11 @@ static void test_COM(void)
static void test_COM_dplobby(void)
{
#ifdef __REACTOS__
IDirectPlayLobby *dpl = (IDirectPlayLobby*)(ULONG_PTR)0xdeadbeefdeadbeefull;
#else
IDirectPlayLobby *dpl = (IDirectPlayLobby*)0xdeadbeef;
#endif
IDirectPlayLobbyA *dplA;
IDirectPlayLobby2A *dpl2A;
IDirectPlayLobby2 *dpl2;
@ -6641,11 +6658,20 @@ static void test_COM_dplobby(void)
HRESULT hr;
/* COM aggregation */
#ifdef __REACTOS__
hr = CoCreateInstance(&CLSID_DirectPlayLobby, (IUnknown*)(ULONG_PTR)0xdeadbeefdeadbeefull, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&dpl);
#else
hr = CoCreateInstance(&CLSID_DirectPlayLobby, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void**)&dpl);
#endif
ok(hr == CLASS_E_NOAGGREGATION || broken(hr == E_INVALIDARG),
"DirectPlayLobby create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
#ifdef __REACTOS__
ok(!dpl || dpl == (IDirectPlayLobby*)(ULONG_PTR)0xdeadbeefdeadbeefull, "dpl = %p\n", dpl);
#else
ok(!dpl || dpl == (IDirectPlayLobby*)0xdeadbeef, "dpl = %p\n", dpl);
#endif
/* Invalid RIID */
hr = CoCreateInstance(&CLSID_DirectPlayLobby, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlay,