Module: wine Branch: master Commit: a3c5c50bdd066b2e5196f79db93c4918f5d5ec1b URL: http://source.winehq.org/git/wine.git/?a=commit;h=a3c5c50bdd066b2e5196f79db9...
Author: Michael Stefaniuc mstefani@redhat.de Date: Thu Sep 8 22:19:47 2016 +0200
oleaut32: Avoid casts from COM objects to interfaces.
Signed-off-by: Michael Stefaniuc mstefani@redhat.de Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 4b3411e..c20093c 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 96c109a..bfca22f 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);