Octavian Voicu : ole32: Fix a few incorrect pointer/integer casts on 64-bit .

Alexandre Julliard julliard at winehq.org
Wed Aug 31 13:19:23 CDT 2011


Module: wine
Branch: master
Commit: 9b1fc0fd74d48bffb3987bb3c59088b2fd16d607
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9b1fc0fd74d48bffb3987bb3c59088b2fd16d607

Author: Octavian Voicu <octavian.voicu at gmail.com>
Date:   Wed Aug 31 13:52:02 2011 +0300

ole32: Fix a few incorrect pointer/integer casts on 64-bit.

---

 dlls/ole32/pointermoniker.c |    2 +-
 dlls/ole32/tests/moniker.c  |    4 ++--
 dlls/ole32/usrmarshal.c     |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c
index d79afd2..d39be1d 100644
--- a/dlls/ole32/pointermoniker.c
+++ b/dlls/ole32/pointermoniker.c
@@ -370,7 +370,7 @@ static HRESULT WINAPI PointerMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
     if (pdwHash==NULL)
         return E_POINTER;
 
-    *pdwHash = (DWORD)This->pObject;
+    *pdwHash = PtrToUlong(This->pObject);
 
     return S_OK;
 }
diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c
index 54a5f8c..aa57b9b 100644
--- a/dlls/ole32/tests/moniker.c
+++ b/dlls/ole32/tests/moniker.c
@@ -1780,9 +1780,9 @@ static void test_pointer_moniker(void)
     /* Hashing */
     hr = IMoniker_Hash(moniker, &hash);
     ok_ole_success(hr, IMoniker_Hash);
-    ok(hash == (DWORD)&Test_ClassFactory,
+    ok(hash == PtrToUlong(&Test_ClassFactory),
         "Hash value should have been 0x%08x, instead of 0x%08x\n",
-        (DWORD)&Test_ClassFactory, hash);
+        PtrToUlong(&Test_ClassFactory), hash);
 
     /* IsSystemMoniker test */
     hr = IMoniker_IsSystemMoniker(moniker, &moniker_type);
diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c
index 2d238e6..8f5feef 100644
--- a/dlls/ole32/usrmarshal.c
+++ b/dlls/ole32/usrmarshal.c
@@ -429,7 +429,7 @@ unsigned char * __RPC_USER HGLOBAL_UserMarshal(ULONG *pFlags, unsigned char *pBu
     {
         *(ULONG *)pBuffer = WDT_REMOTE_CALL;
         pBuffer += sizeof(ULONG);
-        *(ULONG *)pBuffer = (ULONG)*phGlobal;
+        *(ULONG *)pBuffer = HandleToULong(*phGlobal);
         pBuffer += sizeof(ULONG);
         if (*phGlobal)
         {
@@ -437,7 +437,7 @@ unsigned char * __RPC_USER HGLOBAL_UserMarshal(ULONG *pFlags, unsigned char *pBu
             SIZE_T size = GlobalSize(*phGlobal);
             *(ULONG *)pBuffer = (ULONG)size;
             pBuffer += sizeof(ULONG);
-            *(ULONG *)pBuffer = (ULONG)*phGlobal;
+            *(ULONG *)pBuffer = HandleToULong(*phGlobal);
             pBuffer += sizeof(ULONG);
             *(ULONG *)pBuffer = (ULONG)size;
             pBuffer += sizeof(ULONG);




More information about the wine-cvs mailing list