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

commit 7cf7b27a3a989d8c4f65eaa1b1a11b3e9b59f3ab
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Sat Jul 14 12:32:57 2018 +0200
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Sat Aug 4 14:39:13 2018 +0200

    [ROSTESTS] Fix 64 bit issues
---
 .../rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c |  8 +++----
 .../apitests/advapi32/LockServiceDatabase.c        |  4 ++--
 modules/rostests/apitests/appshim/genral_hooks.c   |  2 +-
 modules/rostests/apitests/appshim/layer_hooks.c    |  2 +-
 .../apitests/browseui/SHExplorerParseCmdLine.c     |  8 +++----
 modules/rostests/apitests/uxtheme/CloseThemeData.c |  2 +-
 .../apitests/uxtheme/DrawThemeParentBackground.c   | 10 ++++-----
 modules/rostests/apitests/uxtheme/SetWindowTheme.c |  2 +-
 modules/rostests/apitests/wlanapi/wlanapi.c        |  2 +-
 modules/rostests/apitests/ws2_32/WSARecv.c         |  2 +-
 modules/rostests/winetests/advpack/install.c       | 20 +++++++++++++++++
 modules/rostests/winetests/dplayx/dplayx.c         | 26 ++++++++++++++++++++++
 12 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/modules/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c 
b/modules/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c
index cec975f5b0..818a8b7500 100644
--- a/modules/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c
+++ b/modules/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c
@@ -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",
diff --git a/modules/rostests/apitests/advapi32/LockServiceDatabase.c 
b/modules/rostests/apitests/advapi32/LockServiceDatabase.c
index d52610a030..a567315771 100644
--- a/modules/rostests/apitests/advapi32/LockServiceDatabase.c
+++ b/modules/rostests/apitests/advapi32/LockServiceDatabase.c
@@ -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);
diff --git a/modules/rostests/apitests/appshim/genral_hooks.c 
b/modules/rostests/apitests/appshim/genral_hooks.c
index 72680c75a8..2e9887c64b 100644
--- a/modules/rostests/apitests/appshim/genral_hooks.c
+++ b/modules/rostests/apitests/appshim/genral_hooks.c
@@ -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];
 }
 
diff --git a/modules/rostests/apitests/appshim/layer_hooks.c 
b/modules/rostests/apitests/appshim/layer_hooks.c
index e47d9aad29..e1568629bf 100644
--- a/modules/rostests/apitests/appshim/layer_hooks.c
+++ b/modules/rostests/apitests/appshim/layer_hooks.c
@@ -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];
 }
 
diff --git a/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c 
b/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c
index bc9023a08e..c01eba1a5d 100644
--- a/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c
+++ b/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c
@@ -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");
diff --git a/modules/rostests/apitests/uxtheme/CloseThemeData.c 
b/modules/rostests/apitests/uxtheme/CloseThemeData.c
index 367525b129..4811cd6801 100644
--- a/modules/rostests/apitests/uxtheme/CloseThemeData.c
+++ b/modules/rostests/apitests/uxtheme/CloseThemeData.c
@@ -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);
diff --git a/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c 
b/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c
index 28abdb8d97..aef329fafe 100644
--- a/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c
+++ b/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c
@@ -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");
diff --git a/modules/rostests/apitests/uxtheme/SetWindowTheme.c 
b/modules/rostests/apitests/uxtheme/SetWindowTheme.c
index f429a0bed1..6adf17c0f0 100644
--- a/modules/rostests/apitests/uxtheme/SetWindowTheme.c
+++ b/modules/rostests/apitests/uxtheme/SetWindowTheme.c
@@ -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);
diff --git a/modules/rostests/apitests/wlanapi/wlanapi.c 
b/modules/rostests/apitests/wlanapi/wlanapi.c
index 3d8f1382f1..e9ea3f0046 100644
--- a/modules/rostests/apitests/wlanapi/wlanapi.c
+++ b/modules/rostests/apitests/wlanapi/wlanapi.c
@@ -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);
diff --git a/modules/rostests/apitests/ws2_32/WSARecv.c 
b/modules/rostests/apitests/ws2_32/WSARecv.c
index 4a076b2f96..89f500f706 100644
--- a/modules/rostests/apitests/ws2_32/WSARecv.c
+++ b/modules/rostests/apitests/ws2_32/WSARecv.c
@@ -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);
     }
diff --git a/modules/rostests/winetests/advpack/install.c 
b/modules/rostests/winetests/advpack/install.c
index 16593d1c5e..5aa5888fd3 100644
--- a/modules/rostests/winetests/advpack/install.c
+++ b/modules/rostests/winetests/advpack/install.c
@@ -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");
diff --git a/modules/rostests/winetests/dplayx/dplayx.c 
b/modules/rostests/winetests/dplayx/dplayx.c
index f4e7301da7..c67d1b78e9 100644
--- a/modules/rostests/winetests/dplayx/dplayx.c
+++ b/modules/rostests/winetests/dplayx/dplayx.c
@@ -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,

Reply via email to