From a3c5c50bdd066b2e5196f79db93c4918f5d5ec1b Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Thu, 8 Sep 2016 22:19:47 +0200 Subject: [PATCH] oleaut32: Avoid casts from COM objects to interfaces. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/oleaut32/olefont.c | 6 ++++-- dlls/oleaut32/olepicture.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 4b3411ecfcd..c20093c7023 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -1014,8 +1014,10 @@ static HRESULT WINAPI OLEFontImpl_Clone( newObject->pPropertyNotifyCP = NULL; newObject->pFontEventsCP = NULL; - CreateConnectionPoint((IUnknown*)newObject, &IID_IPropertyNotifySink, &newObject->pPropertyNotifyCP); - CreateConnectionPoint((IUnknown*)newObject, &IID_IFontEventsDisp, &newObject->pFontEventsCP); + CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IPropertyNotifySink, + &newObject->pPropertyNotifyCP); + CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IFontEventsDisp, + &newObject->pFontEventsCP); if (!newObject->pPropertyNotifyCP || !newObject->pFontEventsCP) { diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 96c109a557e..bfca22f7efe 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -299,7 +299,8 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn) newObject->IConnectionPointContainer_iface.lpVtbl = &OLEPictureImpl_IConnectionPointContainer_VTable; newObject->pCP = NULL; - CreateConnectionPoint((IUnknown*)newObject,&IID_IPropertyNotifySink,&newObject->pCP); + CreateConnectionPoint((IUnknown*)&newObject->IPicture_iface, &IID_IPropertyNotifySink, + &newObject->pCP); if (!newObject->pCP) { HeapFree(GetProcessHeap(), 0, newObject); -- 2.11.4.GIT