oleaut32: Avoid casts from COM objects to interfaces.

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-09-08 22:19:47 +02:00 committed by Alexandre Julliard
parent 502b9e9aa7
commit a3c5c50bdd
2 changed files with 6 additions and 3 deletions

View File

@ -1014,8 +1014,10 @@ static HRESULT WINAPI OLEFontImpl_Clone(
newObject->pPropertyNotifyCP = NULL; newObject->pPropertyNotifyCP = NULL;
newObject->pFontEventsCP = NULL; newObject->pFontEventsCP = NULL;
CreateConnectionPoint((IUnknown*)newObject, &IID_IPropertyNotifySink, &newObject->pPropertyNotifyCP); CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IPropertyNotifySink,
CreateConnectionPoint((IUnknown*)newObject, &IID_IFontEventsDisp, &newObject->pFontEventsCP); &newObject->pPropertyNotifyCP);
CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IFontEventsDisp,
&newObject->pFontEventsCP);
if (!newObject->pPropertyNotifyCP || !newObject->pFontEventsCP) if (!newObject->pPropertyNotifyCP || !newObject->pFontEventsCP)
{ {

View File

@ -299,7 +299,8 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
newObject->IConnectionPointContainer_iface.lpVtbl = &OLEPictureImpl_IConnectionPointContainer_VTable; newObject->IConnectionPointContainer_iface.lpVtbl = &OLEPictureImpl_IConnectionPointContainer_VTable;
newObject->pCP = NULL; newObject->pCP = NULL;
CreateConnectionPoint((IUnknown*)newObject,&IID_IPropertyNotifySink,&newObject->pCP); CreateConnectionPoint((IUnknown*)&newObject->IPicture_iface, &IID_IPropertyNotifySink,
&newObject->pCP);
if (!newObject->pCP) if (!newObject->pCP)
{ {
HeapFree(GetProcessHeap(), 0, newObject); HeapFree(GetProcessHeap(), 0, newObject);