From 44a9bae9f8f97180f26501dcc6d59e9f73f63fa5 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 9 Dec 2009 12:04:01 +0100 Subject: [PATCH] ole32: Fix some pointer cast warnings on 64-bit. --- dlls/ole32/compobj.c | 8 +++----- dlls/ole32/rpc.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 58e8f0d6a57..583a9cbcd00 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -2062,6 +2062,7 @@ HRESULT WINAPI CoRegisterClassObject( DWORD flags, LPDWORD lpdwRegister) { + static LONG next_cookie; RegisteredClass* newClass; LPUNKNOWN foundObject; HRESULT hr; @@ -2115,11 +2116,8 @@ HRESULT WINAPI CoRegisterClassObject( newClass->pMarshaledData = NULL; newClass->RpcRegistration = NULL; - /* - * Use the address of the chain node as the cookie since we are sure it's - * unique. FIXME: not on 64-bit platforms. - */ - newClass->dwCookie = (DWORD)newClass; + if (!(newClass->dwCookie = InterlockedIncrement( &next_cookie ))) + newClass->dwCookie = InterlockedIncrement( &next_cookie ); /* * Since we're making a copy of the object pointer, we have to increase its diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index 9a344653248..0daa4ab815d 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -1358,7 +1358,7 @@ void RPC_ExecuteCall(struct dispatch_params *params) handlecall = IMessageFilter_HandleInComingCall(COM_CurrentApt()->filter, calltype, - (HTASK)GetCurrentProcessId(), + UlongToHandle(GetCurrentProcessId()), 0 /* FIXME */, &interface_info); TRACE("IMessageFilter_HandleInComingCall returned %d\n", handlecall); -- 2.11.4.GIT