oleaut32: Use ifaces instead of vtbl pointers in OLEPictureImpl.

This commit is contained in:
Michael Stefaniuc 2010-12-10 09:33:13 +01:00 committed by Alexandre Julliard
parent 79d03435ad
commit 812a0495c5
1 changed files with 53 additions and 52 deletions

View File

@ -115,10 +115,10 @@ typedef struct OLEPictureImpl {
* IPicture handles IUnknown * IPicture handles IUnknown
*/ */
const IPictureVtbl *lpVtbl; IPicture IPicture_iface;
const IDispatchVtbl *lpvtblIDispatch; IDispatch IDispatch_iface;
const IPersistStreamVtbl *lpvtblIPersistStream; IPersistStream IPersistStream_iface;
const IConnectionPointContainerVtbl *lpvtblIConnectionPointContainer; IConnectionPointContainer IConnectionPointContainer_iface;
/* Object reference count */ /* Object reference count */
LONG ref; LONG ref;
@ -155,23 +155,24 @@ typedef struct OLEPictureImpl {
unsigned int loadtime_format; /* for PICTYPE_BITMAP only, keeps track of image format (GIF/BMP/JPEG) */ unsigned int loadtime_format; /* for PICTYPE_BITMAP only, keeps track of image format (GIF/BMP/JPEG) */
} OLEPictureImpl; } OLEPictureImpl;
/* static inline OLEPictureImpl *impl_from_IPicture(IPicture *iface)
* Macros to retrieve pointer to IUnknown (IPicture) from the other VTables. {
*/ return CONTAINING_RECORD(iface, OLEPictureImpl, IPicture_iface);
}
static inline OLEPictureImpl *impl_from_IDispatch( IDispatch *iface ) static inline OLEPictureImpl *impl_from_IDispatch( IDispatch *iface )
{ {
return (OLEPictureImpl *)((char*)iface - FIELD_OFFSET(OLEPictureImpl, lpvtblIDispatch)); return CONTAINING_RECORD(iface, OLEPictureImpl, IDispatch_iface);
} }
static inline OLEPictureImpl *impl_from_IPersistStream( IPersistStream *iface ) static inline OLEPictureImpl *impl_from_IPersistStream( IPersistStream *iface )
{ {
return (OLEPictureImpl *)((char*)iface - FIELD_OFFSET(OLEPictureImpl, lpvtblIPersistStream)); return CONTAINING_RECORD(iface, OLEPictureImpl, IPersistStream_iface);
} }
static inline OLEPictureImpl *impl_from_IConnectionPointContainer( IConnectionPointContainer *iface ) static inline OLEPictureImpl *impl_from_IConnectionPointContainer( IConnectionPointContainer *iface )
{ {
return (OLEPictureImpl *)((char*)iface - FIELD_OFFSET(OLEPictureImpl, lpvtblIConnectionPointContainer)); return CONTAINING_RECORD(iface, OLEPictureImpl, IConnectionPointContainer_iface);
} }
/* /*
@ -281,10 +282,10 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
/* /*
* Initialize the virtual function table. * Initialize the virtual function table.
*/ */
newObject->lpVtbl = &OLEPictureImpl_VTable; newObject->IPicture_iface.lpVtbl = &OLEPictureImpl_VTable;
newObject->lpvtblIDispatch = &OLEPictureImpl_IDispatch_VTable; newObject->IDispatch_iface.lpVtbl = &OLEPictureImpl_IDispatch_VTable;
newObject->lpvtblIPersistStream = &OLEPictureImpl_IPersistStream_VTable; newObject->IPersistStream_iface.lpVtbl = &OLEPictureImpl_IPersistStream_VTable;
newObject->lpvtblIConnectionPointContainer = &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,&IID_IPropertyNotifySink,&newObject->pCP);
@ -399,7 +400,7 @@ static void OLEPictureImpl_Destroy(OLEPictureImpl* Obj)
static ULONG WINAPI OLEPictureImpl_AddRef( static ULONG WINAPI OLEPictureImpl_AddRef(
IPicture* iface) IPicture* iface)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
ULONG refCount = InterlockedIncrement(&This->ref); ULONG refCount = InterlockedIncrement(&This->ref);
TRACE("(%p)->(ref before=%d)\n", This, refCount - 1); TRACE("(%p)->(ref before=%d)\n", This, refCount - 1);
@ -415,7 +416,7 @@ static ULONG WINAPI OLEPictureImpl_AddRef(
static ULONG WINAPI OLEPictureImpl_Release( static ULONG WINAPI OLEPictureImpl_Release(
IPicture* iface) IPicture* iface)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
ULONG refCount = InterlockedDecrement(&This->ref); ULONG refCount = InterlockedDecrement(&This->ref);
TRACE("(%p)->(ref before=%d)\n", This, refCount + 1); TRACE("(%p)->(ref before=%d)\n", This, refCount + 1);
@ -438,7 +439,7 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface(
REFIID riid, REFIID riid,
void** ppvObject) void** ppvObject)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject); TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject);
@ -450,13 +451,13 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface(
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IPicture, riid)) if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IPicture, riid))
*ppvObject = This; *ppvObject = This;
else if (IsEqualIID(&IID_IDispatch, riid)) else if (IsEqualIID(&IID_IDispatch, riid))
*ppvObject = &This->lpvtblIDispatch; *ppvObject = &This->IDispatch_iface;
else if (IsEqualIID(&IID_IPictureDisp, riid)) else if (IsEqualIID(&IID_IPictureDisp, riid))
*ppvObject = &This->lpvtblIDispatch; *ppvObject = &This->IDispatch_iface;
else if (IsEqualIID(&IID_IPersist, riid) || IsEqualIID(&IID_IPersistStream, riid)) else if (IsEqualIID(&IID_IPersist, riid) || IsEqualIID(&IID_IPersistStream, riid))
*ppvObject = &This->lpvtblIPersistStream; *ppvObject = &This->IPersistStream_iface;
else if (IsEqualIID(&IID_IConnectionPointContainer, riid)) else if (IsEqualIID(&IID_IConnectionPointContainer, riid))
*ppvObject = &This->lpvtblIConnectionPointContainer; *ppvObject = &This->IConnectionPointContainer_iface;
if (!*ppvObject) if (!*ppvObject)
{ {
@ -499,7 +500,7 @@ static void OLEPicture_SendNotify(OLEPictureImpl* this, DISPID dispID)
static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface,
OLE_HANDLE *phandle) OLE_HANDLE *phandle)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p)\n", This, phandle); TRACE("(%p)->(%p)\n", This, phandle);
if(!phandle) if(!phandle)
@ -536,7 +537,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface,
OLE_HANDLE *phandle) OLE_HANDLE *phandle)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
HRESULT hres; HRESULT hres;
TRACE("(%p)->(%p)\n", This, phandle); TRACE("(%p)->(%p)\n", This, phandle);
@ -575,7 +576,7 @@ static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_get_Type(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_Type(IPicture *iface,
short *ptype) short *ptype)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p): type is %d\n", This, ptype, This->desc.picType); TRACE("(%p)->(%p): type is %d\n", This, ptype, This->desc.picType);
if(!ptype) if(!ptype)
@ -591,7 +592,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Type(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_get_Width(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_Width(IPicture *iface,
OLE_XSIZE_HIMETRIC *pwidth) OLE_XSIZE_HIMETRIC *pwidth)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p): width is %d\n", This, pwidth, This->himetricWidth); TRACE("(%p)->(%p): width is %d\n", This, pwidth, This->himetricWidth);
*pwidth = This->himetricWidth; *pwidth = This->himetricWidth;
return S_OK; return S_OK;
@ -603,7 +604,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Width(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_get_Height(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_Height(IPicture *iface,
OLE_YSIZE_HIMETRIC *pheight) OLE_YSIZE_HIMETRIC *pheight)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p): height is %d\n", This, pheight, This->himetricHeight); TRACE("(%p)->(%p): height is %d\n", This, pheight, This->himetricHeight);
*pheight = This->himetricHeight; *pheight = This->himetricHeight;
return S_OK; return S_OK;
@ -620,7 +621,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
OLE_YSIZE_HIMETRIC cySrc, OLE_YSIZE_HIMETRIC cySrc,
LPCRECT prcWBounds) LPCRECT prcWBounds)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p, (%d,%d), (%d,%d) <- (%d,%d), (%d,%d), %p)\n", TRACE("(%p)->(%p, (%d,%d), (%d,%d) <- (%d,%d), (%d,%d), %p)\n",
This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, prcWBounds); This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, prcWBounds);
if(prcWBounds) if(prcWBounds)
@ -739,7 +740,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface,
OLE_HANDLE hpal) OLE_HANDLE hpal)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
FIXME("(%p)->(%08x): stub\n", This, hpal); FIXME("(%p)->(%08x): stub\n", This, hpal);
OLEPicture_SendNotify(This,DISPID_PICT_HPAL); OLEPicture_SendNotify(This,DISPID_PICT_HPAL);
return E_NOTIMPL; return E_NOTIMPL;
@ -751,7 +752,7 @@ static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_get_CurDC(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_CurDC(IPicture *iface,
HDC *phdc) HDC *phdc)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p), returning %p\n", This, This->hDCCur); TRACE("(%p), returning %p\n", This, This->hDCCur);
if (phdc) *phdc = This->hDCCur; if (phdc) *phdc = This->hDCCur;
return S_OK; return S_OK;
@ -765,7 +766,7 @@ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface,
HDC *phdcOut, HDC *phdcOut,
OLE_HANDLE *phbmpOut) OLE_HANDLE *phbmpOut)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p, %p, %p)\n", This, hdcIn, phdcOut, phbmpOut); TRACE("(%p)->(%p, %p, %p)\n", This, hdcIn, phdcOut, phbmpOut);
if (This->desc.picType == PICTYPE_BITMAP) { if (This->desc.picType == PICTYPE_BITMAP) {
SelectObject(hdcIn,This->desc.u.bmp.hbitmap); SelectObject(hdcIn,This->desc.u.bmp.hbitmap);
@ -788,7 +789,7 @@ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_get_KeepOriginalFormat(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_KeepOriginalFormat(IPicture *iface,
BOOL *pfKeep) BOOL *pfKeep)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p)\n", This, pfKeep); TRACE("(%p)->(%p)\n", This, pfKeep);
if (!pfKeep) if (!pfKeep)
return E_POINTER; return E_POINTER;
@ -802,7 +803,7 @@ static HRESULT WINAPI OLEPictureImpl_get_KeepOriginalFormat(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_put_KeepOriginalFormat(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_put_KeepOriginalFormat(IPicture *iface,
BOOL keep) BOOL keep)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%d)\n", This, keep); TRACE("(%p)->(%d)\n", This, keep);
This->keepOrigFormat = keep; This->keepOrigFormat = keep;
/* FIXME: what DISPID notification here? */ /* FIXME: what DISPID notification here? */
@ -814,7 +815,7 @@ static HRESULT WINAPI OLEPictureImpl_put_KeepOriginalFormat(IPicture *iface,
*/ */
static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface) static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->()\n", This); TRACE("(%p)->()\n", This);
OLEPicture_SendNotify(This,DISPID_PICT_HANDLE); OLEPicture_SendNotify(This,DISPID_PICT_HANDLE);
This->bIsDirty = TRUE; This->bIsDirty = TRUE;
@ -829,7 +830,7 @@ static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface,
BOOL SaveMemCopy, BOOL SaveMemCopy,
LONG *pcbSize) LONG *pcbSize)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
FIXME("(%p)->(%p, %d, %p), hacked stub.\n", This, pstream, SaveMemCopy, pcbSize); FIXME("(%p)->(%p, %d, %p), hacked stub.\n", This, pstream, SaveMemCopy, pcbSize);
return IStream_Write(pstream,This->data,This->datalen,(ULONG*)pcbSize); return IStream_Write(pstream,This->data,This->datalen,(ULONG*)pcbSize);
} }
@ -840,7 +841,7 @@ static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface, static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
DWORD *pdwAttr) DWORD *pdwAttr)
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p).\n", This, pdwAttr); TRACE("(%p)->(%p).\n", This, pdwAttr);
if(!pdwAttr) if(!pdwAttr)
@ -870,7 +871,7 @@ static HRESULT WINAPI OLEPictureImpl_IConnectionPointContainer_QueryInterface(
{ {
OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
return IPicture_QueryInterface((IPicture *)This,riid,ppvoid); return IPicture_QueryInterface(&This->IPicture_iface,riid,ppvoid);
} }
static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_AddRef( static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_AddRef(
@ -878,7 +879,7 @@ static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_AddRef(
{ {
OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
return IPicture_AddRef((IPicture *)This); return IPicture_AddRef(&This->IPicture_iface);
} }
static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_Release( static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_Release(
@ -886,7 +887,7 @@ static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_Release(
{ {
OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
return IPicture_Release((IPicture *)This); return IPicture_Release(&This->IPicture_iface);
} }
static HRESULT WINAPI OLEPictureImpl_EnumConnectionPoints( static HRESULT WINAPI OLEPictureImpl_EnumConnectionPoints(
@ -932,7 +933,7 @@ static HRESULT WINAPI OLEPictureImpl_IPersistStream_QueryInterface(
{ {
OLEPictureImpl *This = impl_from_IPersistStream(iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
return IPicture_QueryInterface((IPicture *)This, riid, ppvoid); return IPicture_QueryInterface(&This->IPicture_iface, riid, ppvoid);
} }
/************************************************************************ /************************************************************************
@ -945,7 +946,7 @@ static ULONG WINAPI OLEPictureImpl_IPersistStream_AddRef(
{ {
OLEPictureImpl *This = impl_from_IPersistStream(iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
return IPicture_AddRef((IPicture *)This); return IPicture_AddRef(&This->IPicture_iface);
} }
/************************************************************************ /************************************************************************
@ -958,7 +959,7 @@ static ULONG WINAPI OLEPictureImpl_IPersistStream_Release(
{ {
OLEPictureImpl *This = impl_from_IPersistStream(iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
return IPicture_Release((IPicture *)This); return IPicture_Release(&This->IPicture_iface);
} }
/************************************************************************ /************************************************************************
@ -1846,7 +1847,7 @@ static HRESULT WINAPI OLEPictureImpl_IDispatch_QueryInterface(
{ {
OLEPictureImpl *This = impl_from_IDispatch(iface); OLEPictureImpl *This = impl_from_IDispatch(iface);
return IPicture_QueryInterface((IPicture *)This, riid, ppvoid); return IPicture_QueryInterface(&This->IPicture_iface, riid, ppvoid);
} }
/************************************************************************ /************************************************************************
@ -1859,7 +1860,7 @@ static ULONG WINAPI OLEPictureImpl_IDispatch_AddRef(
{ {
OLEPictureImpl *This = impl_from_IDispatch(iface); OLEPictureImpl *This = impl_from_IDispatch(iface);
return IPicture_AddRef((IPicture *)This); return IPicture_AddRef(&This->IPicture_iface);
} }
/************************************************************************ /************************************************************************
@ -1872,7 +1873,7 @@ static ULONG WINAPI OLEPictureImpl_IDispatch_Release(
{ {
OLEPictureImpl *This = impl_from_IDispatch(iface); OLEPictureImpl *This = impl_from_IDispatch(iface);
return IPicture_Release((IPicture *)This); return IPicture_Release(&This->IPicture_iface);
} }
/************************************************************************ /************************************************************************
@ -2028,7 +2029,7 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
{ {
TRACE("DISPID_PICT_HANDLE\n"); TRACE("DISPID_PICT_HANDLE\n");
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
return IPicture_get_Handle((IPicture *)&This->lpVtbl, &V_UINT(pVarResult)); return IPicture_get_Handle(&This->IPicture_iface, &V_UINT(pVarResult));
} }
break; break;
case DISPID_PICT_HPAL: case DISPID_PICT_HPAL:
@ -2036,7 +2037,7 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
{ {
TRACE("DISPID_PICT_HPAL\n"); TRACE("DISPID_PICT_HPAL\n");
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
return IPicture_get_hPal((IPicture *)&This->lpVtbl, &V_UINT(pVarResult)); return IPicture_get_hPal(&This->IPicture_iface, &V_UINT(pVarResult));
} }
else if (wFlags & DISPATCH_PROPERTYPUT) else if (wFlags & DISPATCH_PROPERTYPUT)
{ {
@ -2049,7 +2050,7 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
hr = IPicture_set_hPal((IPicture *)&This->lpVtbl, V_I4(&vararg)); hr = IPicture_set_hPal(&This->IPicture_iface, V_I4(&vararg));
VariantClear(&vararg); VariantClear(&vararg);
return hr; return hr;
@ -2060,7 +2061,7 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
{ {
TRACE("DISPID_PICT_TYPE\n"); TRACE("DISPID_PICT_TYPE\n");
V_VT(pVarResult) = VT_I2; V_VT(pVarResult) = VT_I2;
return OLEPictureImpl_get_Type((IPicture *)&This->lpVtbl, &V_I2(pVarResult)); return OLEPictureImpl_get_Type(&This->IPicture_iface, &V_I2(pVarResult));
} }
break; break;
case DISPID_PICT_WIDTH: case DISPID_PICT_WIDTH:
@ -2068,7 +2069,7 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
{ {
TRACE("DISPID_PICT_WIDTH\n"); TRACE("DISPID_PICT_WIDTH\n");
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
return IPicture_get_Width((IPicture *)&This->lpVtbl, &V_I4(pVarResult)); return IPicture_get_Width(&This->IPicture_iface, &V_I4(pVarResult));
} }
break; break;
case DISPID_PICT_HEIGHT: case DISPID_PICT_HEIGHT:
@ -2076,7 +2077,7 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
{ {
TRACE("DISPID_PICT_HEIGHT\n"); TRACE("DISPID_PICT_HEIGHT\n");
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
return IPicture_get_Height((IPicture *)&This->lpVtbl, &V_I4(pVarResult)); return IPicture_get_Height(&This->IPicture_iface, &V_I4(pVarResult));
} }
break; break;
} }
@ -2160,13 +2161,13 @@ HRESULT WINAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid,
/* /*
* Make sure it supports the interface required by the caller. * Make sure it supports the interface required by the caller.
*/ */
hr = IPicture_QueryInterface((IPicture*)newPict, riid, ppvObj); hr = IPicture_QueryInterface(&newPict->IPicture_iface, riid, ppvObj);
/* /*
* Release the reference obtained in the constructor. If * Release the reference obtained in the constructor. If
* the QueryInterface was unsuccessful, it will free the class. * the QueryInterface was unsuccessful, it will free the class.
*/ */
IPicture_Release((IPicture*)newPict); IPicture_Release(&newPict->IPicture_iface);
return hr; return hr;
} }