Commit 738e88db authored by Alexandre Julliard's avatar Alexandre Julliard

Replace the ICOM_THIS_From macros by inline functions.

parent 54de6149
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
#include "wine/debug.h" #include "wine/debug.h"
/* #define ICOM_THIS_From_IROTData(class, name) class* This = (class*)(((char*)name)-sizeof(void*)) */
WINE_DEFAULT_DEBUG_CHANNEL(devenum); WINE_DEFAULT_DEBUG_CHANNEL(devenum);
static ULONG WINAPI DEVENUM_IEnumMoniker_AddRef(LPENUMMONIKER iface); static ULONG WINAPI DEVENUM_IEnumMoniker_AddRef(LPENUMMONIKER iface);
......
...@@ -63,12 +63,12 @@ struct OLEFontImpl ...@@ -63,12 +63,12 @@ struct OLEFontImpl
* The first two are supported by the first vtable, the next two are * The first two are supported by the first vtable, the next two are
* supported by the second table and the last two have their own. * supported by the second table and the last two have their own.
*/ */
const IFontVtbl* lpvtbl1; const IFontVtbl* lpVtbl;
const IDispatchVtbl* lpvtbl2; const IDispatchVtbl* lpvtblIDispatch;
const IPersistStreamVtbl* lpvtbl3; const IPersistStreamVtbl* lpvtblIPersistStream;
const IConnectionPointContainerVtbl* lpvtbl4; const IConnectionPointContainerVtbl* lpvtblIConnectionPointContainer;
const IPersistPropertyBagVtbl* lpvtbl5; const IPersistPropertyBagVtbl* lpvtblIPersistPropertyBag;
const IPersistStreamInitVtbl* lpvtbl6; const IPersistStreamInitVtbl* lpvtblIPersistStreamInit;
/* /*
* Reference count for that instance of the class. * Reference count for that instance of the class.
*/ */
...@@ -104,11 +104,31 @@ struct OLEFontImpl ...@@ -104,11 +104,31 @@ struct OLEFontImpl
* There is a version to accommodate all of the VTables implemented * There is a version to accommodate all of the VTables implemented
* by this object. * by this object.
*/ */
#define _ICOM_THIS_From_IDispatch(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
#define _ICOM_THIS_From_IPersistStream(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)) static inline OLEFontImpl *impl_from_IDispatch( IDispatch *iface )
#define _ICOM_THIS_From_IConnectionPointContainer(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)) {
#define _ICOM_THIS_From_IPersistPropertyBag(class, name) class* this = (class*)(((char*)name)-4*sizeof(void*)) return (OLEFontImpl *)((char*)iface - FIELD_OFFSET(OLEFontImpl, lpvtblIDispatch));
#define _ICOM_THIS_From_IPersistStreamInit(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*)) }
static inline OLEFontImpl *impl_from_IPersistStream( IPersistStream *iface )
{
return (OLEFontImpl *)((char*)iface - FIELD_OFFSET(OLEFontImpl, lpvtblIPersistStream));
}
static inline OLEFontImpl *impl_from_IConnectionPointContainer( IConnectionPointContainer *iface )
{
return (OLEFontImpl *)((char*)iface - FIELD_OFFSET(OLEFontImpl, lpvtblIConnectionPointContainer));
}
static inline OLEFontImpl *impl_from_IPersistPropertyBag( IPersistPropertyBag *iface )
{
return (OLEFontImpl *)((char*)iface - FIELD_OFFSET(OLEFontImpl, lpvtblIPersistPropertyBag));
}
static inline OLEFontImpl *impl_from_IPersistStreamInit( IPersistStreamInit *iface )
{
return (OLEFontImpl *)((char*)iface - FIELD_OFFSET(OLEFontImpl, lpvtblIPersistStreamInit));
}
/*********************************************************************** /***********************************************************************
...@@ -402,12 +422,12 @@ static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc) ...@@ -402,12 +422,12 @@ static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc)
/* /*
* Initialize the virtual function table. * Initialize the virtual function table.
*/ */
newObject->lpvtbl1 = &OLEFontImpl_VTable; newObject->lpVtbl = &OLEFontImpl_VTable;
newObject->lpvtbl2 = &OLEFontImpl_IDispatch_VTable; newObject->lpvtblIDispatch = &OLEFontImpl_IDispatch_VTable;
newObject->lpvtbl3 = &OLEFontImpl_IPersistStream_VTable; newObject->lpvtblIPersistStream = &OLEFontImpl_IPersistStream_VTable;
newObject->lpvtbl4 = &OLEFontImpl_IConnectionPointContainer_VTable; newObject->lpvtblIConnectionPointContainer = &OLEFontImpl_IConnectionPointContainer_VTable;
newObject->lpvtbl5 = &OLEFontImpl_IPersistPropertyBag_VTable; newObject->lpvtblIPersistPropertyBag = &OLEFontImpl_IPersistPropertyBag_VTable;
newObject->lpvtbl6 = &OLEFontImpl_IPersistStreamInit_VTable; newObject->lpvtblIPersistStreamInit = &OLEFontImpl_IPersistStreamInit_VTable;
/* /*
* Start with one reference count. The caller of this function * Start with one reference count. The caller of this function
...@@ -495,17 +515,17 @@ HRESULT WINAPI OLEFontImpl_QueryInterface( ...@@ -495,17 +515,17 @@ HRESULT WINAPI OLEFontImpl_QueryInterface(
if (IsEqualGUID(&IID_IFont, riid)) if (IsEqualGUID(&IID_IFont, riid))
*ppvObject = (IFont*)this; *ppvObject = (IFont*)this;
if (IsEqualGUID(&IID_IDispatch, riid)) if (IsEqualGUID(&IID_IDispatch, riid))
*ppvObject = (IDispatch*)&(this->lpvtbl2); *ppvObject = (IDispatch*)&(this->lpvtblIDispatch);
if (IsEqualGUID(&IID_IFontDisp, riid)) if (IsEqualGUID(&IID_IFontDisp, riid))
*ppvObject = (IDispatch*)&(this->lpvtbl2); *ppvObject = (IDispatch*)&(this->lpvtblIDispatch);
if (IsEqualGUID(&IID_IPersistStream, riid)) if (IsEqualGUID(&IID_IPersistStream, riid))
*ppvObject = (IPersistStream*)&(this->lpvtbl3); *ppvObject = (IPersistStream*)&(this->lpvtblIPersistStream);
if (IsEqualGUID(&IID_IConnectionPointContainer, riid)) if (IsEqualGUID(&IID_IConnectionPointContainer, riid))
*ppvObject = (IConnectionPointContainer*)&(this->lpvtbl4); *ppvObject = (IConnectionPointContainer*)&(this->lpvtblIConnectionPointContainer);
if (IsEqualGUID(&IID_IPersistPropertyBag, riid)) if (IsEqualGUID(&IID_IPersistPropertyBag, riid))
*ppvObject = (IPersistPropertyBag*)&(this->lpvtbl5); *ppvObject = (IPersistPropertyBag*)&(this->lpvtblIPersistPropertyBag);
if (IsEqualGUID(&IID_IPersistStreamInit, riid)) if (IsEqualGUID(&IID_IPersistStreamInit, riid))
*ppvObject = (IPersistStreamInit*)&(this->lpvtbl6); *ppvObject = (IPersistStreamInit*)&(this->lpvtblIPersistStreamInit);
/* /*
* Check that we obtained an interface. * Check that we obtained an interface.
...@@ -1156,9 +1176,9 @@ static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface( ...@@ -1156,9 +1176,9 @@ static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface(
REFIID riid, REFIID riid,
VOID** ppvoid) VOID** ppvoid)
{ {
_ICOM_THIS_From_IDispatch(IFont, iface); OLEFontImpl *this = impl_from_IDispatch(iface);
return IFont_QueryInterface(this, riid, ppvoid); return IFont_QueryInterface((IFont *)this, riid, ppvoid);
} }
/************************************************************************ /************************************************************************
...@@ -1169,9 +1189,9 @@ static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface( ...@@ -1169,9 +1189,9 @@ static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface(
static ULONG WINAPI OLEFontImpl_IDispatch_Release( static ULONG WINAPI OLEFontImpl_IDispatch_Release(
IDispatch* iface) IDispatch* iface)
{ {
_ICOM_THIS_From_IDispatch(IFont, iface); OLEFontImpl *this = impl_from_IDispatch(iface);
return IFont_Release(this); return IFont_Release((IFont *)this);
} }
/************************************************************************ /************************************************************************
...@@ -1182,9 +1202,9 @@ static ULONG WINAPI OLEFontImpl_IDispatch_Release( ...@@ -1182,9 +1202,9 @@ static ULONG WINAPI OLEFontImpl_IDispatch_Release(
static ULONG WINAPI OLEFontImpl_IDispatch_AddRef( static ULONG WINAPI OLEFontImpl_IDispatch_AddRef(
IDispatch* iface) IDispatch* iface)
{ {
_ICOM_THIS_From_IDispatch(IFont, iface); OLEFontImpl *this = impl_from_IDispatch(iface);
return IFont_AddRef(this); return IFont_AddRef((IFont *)this);
} }
/************************************************************************ /************************************************************************
...@@ -1196,7 +1216,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount( ...@@ -1196,7 +1216,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount(
IDispatch* iface, IDispatch* iface,
unsigned int* pctinfo) unsigned int* pctinfo)
{ {
_ICOM_THIS_From_IDispatch(IFont, iface); OLEFontImpl *this = impl_from_IDispatch(iface);
FIXME("(%p)->(%p): Stub\n", this, pctinfo); FIXME("(%p)->(%p): Stub\n", this, pctinfo);
return E_NOTIMPL; return E_NOTIMPL;
...@@ -1217,7 +1237,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo( ...@@ -1217,7 +1237,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
ITypeLib *tl; ITypeLib *tl;
HRESULT hres; HRESULT hres;
_ICOM_THIS_From_IDispatch(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IDispatch(iface);
TRACE("(%p, iTInfo=%d, lcid=%04x, %p)\n", this, iTInfo, (int)lcid, ppTInfo); TRACE("(%p, iTInfo=%d, lcid=%04x, %p)\n", this, iTInfo, (int)lcid, ppTInfo);
if (iTInfo != 0) if (iTInfo != 0)
return E_FAIL; return E_FAIL;
...@@ -1246,7 +1266,7 @@ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames( ...@@ -1246,7 +1266,7 @@ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames(
LCID lcid, LCID lcid,
DISPID* rgDispId) DISPID* rgDispId)
{ {
_ICOM_THIS_From_IDispatch(IFont, iface); OLEFontImpl *this = impl_from_IDispatch(iface);
FIXME("(%p,%s,%p,%d,%04x,%p), stub!\n", this, debugstr_guid(riid), rgszNames, FIXME("(%p,%s,%p,%d,%04x,%p), stub!\n", this, debugstr_guid(riid), rgszNames,
cNames, (int)lcid, rgDispId cNames, (int)lcid, rgDispId
); );
...@@ -1273,7 +1293,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1273,7 +1293,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
EXCEPINFO* pExepInfo, EXCEPINFO* pExepInfo,
UINT* puArgErr) UINT* puArgErr)
{ {
_ICOM_THIS_From_IDispatch(IFont, iface); OLEFontImpl *this = impl_from_IDispatch(iface);
OLEFontImpl *xthis = (OLEFontImpl*)this; OLEFontImpl *xthis = (OLEFontImpl*)this;
switch (dispIdMember) { switch (dispIdMember) {
...@@ -1282,7 +1302,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1282,7 +1302,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPATCH_PROPERTYGET: case DISPATCH_PROPERTYGET:
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
return OLEFontImpl_get_Name(this, &V_BSTR(pVarResult)); return OLEFontImpl_get_Name((IFont *)this, &V_BSTR(pVarResult));
case DISPATCH_PROPERTYPUT: { case DISPATCH_PROPERTYPUT: {
BSTR name; BSTR name;
BOOL freename; BOOL freename;
...@@ -1334,7 +1354,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1334,7 +1354,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPATCH_PROPERTYGET: case DISPATCH_PROPERTYGET:
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
V_VT(pVarResult) = VT_BOOL; V_VT(pVarResult) = VT_BOOL;
return OLEFontImpl_get_Bold(this, (BOOL*)&V_BOOL(pVarResult)); return OLEFontImpl_get_Bold((IFont *)this, (BOOL*)&V_BOOL(pVarResult));
case DISPATCH_PROPERTYPUT: case DISPATCH_PROPERTYPUT:
if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) { if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) {
FIXME("DISPID_FONT_BOLD/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0])); FIXME("DISPID_FONT_BOLD/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0]));
...@@ -1350,7 +1370,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1350,7 +1370,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPATCH_PROPERTYGET: case DISPATCH_PROPERTYGET:
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
V_VT(pVarResult) = VT_BOOL; V_VT(pVarResult) = VT_BOOL;
return OLEFontImpl_get_Italic(this, (BOOL*)&V_BOOL(pVarResult)); return OLEFontImpl_get_Italic((IFont *)this, (BOOL*)&V_BOOL(pVarResult));
case DISPATCH_PROPERTYPUT: case DISPATCH_PROPERTYPUT:
if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) { if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) {
FIXME("DISPID_FONT_ITALIC/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0])); FIXME("DISPID_FONT_ITALIC/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0]));
...@@ -1366,7 +1386,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1366,7 +1386,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPATCH_PROPERTYGET: case DISPATCH_PROPERTYGET:
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
V_VT(pVarResult) = VT_BOOL; V_VT(pVarResult) = VT_BOOL;
return OLEFontImpl_get_Underline(this, (BOOL*)&V_BOOL(pVarResult)); return OLEFontImpl_get_Underline((IFont *)this, (BOOL*)&V_BOOL(pVarResult));
case DISPATCH_PROPERTYPUT: case DISPATCH_PROPERTYPUT:
if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) { if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) {
FIXME("DISPID_FONT_UNDER/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0])); FIXME("DISPID_FONT_UNDER/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0]));
...@@ -1382,7 +1402,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1382,7 +1402,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPATCH_PROPERTYGET: case DISPATCH_PROPERTYGET:
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
V_VT(pVarResult) = VT_BOOL; V_VT(pVarResult) = VT_BOOL;
return OLEFontImpl_get_Strikethrough(this, (BOOL*)&V_BOOL(pVarResult)); return OLEFontImpl_get_Strikethrough((IFont *)this, (BOOL*)&V_BOOL(pVarResult));
case DISPATCH_PROPERTYPUT: case DISPATCH_PROPERTYPUT:
if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) { if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL) {
FIXME("DISPID_FONT_STRIKE/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0])); FIXME("DISPID_FONT_STRIKE/put, vt is %d, not VT_BOOL.\n",V_VT(&pDispParams->rgvarg[0]));
...@@ -1412,7 +1432,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1412,7 +1432,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPATCH_PROPERTYGET: case DISPATCH_PROPERTYGET:
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
V_VT(pVarResult) = VT_CY; V_VT(pVarResult) = VT_CY;
return OLEFontImpl_get_Size(this, &V_CY(pVarResult)); return OLEFontImpl_get_Size((IFont *)this, &V_CY(pVarResult));
} }
break; break;
case DISPID_FONT_CHARSET: case DISPID_FONT_CHARSET:
...@@ -1426,7 +1446,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1426,7 +1446,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPATCH_PROPERTYGET: case DISPATCH_PROPERTYGET:
case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
V_VT(pVarResult) = VT_I2; V_VT(pVarResult) = VT_I2;
return OLEFontImpl_get_Charset(this, &V_I2(pVarResult)); return OLEFontImpl_get_Charset((IFont *)this, &V_I2(pVarResult));
} }
break; break;
} }
...@@ -1447,9 +1467,9 @@ static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface( ...@@ -1447,9 +1467,9 @@ static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface(
REFIID riid, REFIID riid,
VOID** ppvoid) VOID** ppvoid)
{ {
_ICOM_THIS_From_IPersistStream(IFont, iface); OLEFontImpl *this = impl_from_IPersistStream(iface);
return IFont_QueryInterface(this, riid, ppvoid); return IFont_QueryInterface((IFont *)this, riid, ppvoid);
} }
/************************************************************************ /************************************************************************
...@@ -1460,9 +1480,9 @@ static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface( ...@@ -1460,9 +1480,9 @@ static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface(
static ULONG WINAPI OLEFontImpl_IPersistStream_Release( static ULONG WINAPI OLEFontImpl_IPersistStream_Release(
IPersistStream* iface) IPersistStream* iface)
{ {
_ICOM_THIS_From_IPersistStream(IFont, iface); OLEFontImpl *this = impl_from_IPersistStream(iface);
return IFont_Release(this); return IFont_Release((IFont *)this);
} }
/************************************************************************ /************************************************************************
...@@ -1473,9 +1493,9 @@ static ULONG WINAPI OLEFontImpl_IPersistStream_Release( ...@@ -1473,9 +1493,9 @@ static ULONG WINAPI OLEFontImpl_IPersistStream_Release(
static ULONG WINAPI OLEFontImpl_IPersistStream_AddRef( static ULONG WINAPI OLEFontImpl_IPersistStream_AddRef(
IPersistStream* iface) IPersistStream* iface)
{ {
_ICOM_THIS_From_IPersistStream(IFont, iface); OLEFontImpl *this = impl_from_IPersistStream(iface);
return IFont_AddRef(this); return IFont_AddRef((IFont *)this);
} }
/************************************************************************ /************************************************************************
...@@ -1540,7 +1560,7 @@ static HRESULT WINAPI OLEFontImpl_Load( ...@@ -1540,7 +1560,7 @@ static HRESULT WINAPI OLEFontImpl_Load(
BYTE bStringSize; BYTE bStringSize;
INT len; INT len;
_ICOM_THIS_From_IPersistStream(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IPersistStream(iface);
/* /*
* Read the version byte * Read the version byte
...@@ -1632,7 +1652,7 @@ static HRESULT WINAPI OLEFontImpl_Save( ...@@ -1632,7 +1652,7 @@ static HRESULT WINAPI OLEFontImpl_Save(
BYTE bAttributes; BYTE bAttributes;
BYTE bStringSize; BYTE bStringSize;
_ICOM_THIS_From_IPersistStream(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IPersistStream(iface);
/* /*
* Read the version byte * Read the version byte
...@@ -1725,7 +1745,7 @@ static HRESULT WINAPI OLEFontImpl_GetSizeMax( ...@@ -1725,7 +1745,7 @@ static HRESULT WINAPI OLEFontImpl_GetSizeMax(
IPersistStream* iface, IPersistStream* iface,
ULARGE_INTEGER* pcbSize) ULARGE_INTEGER* pcbSize)
{ {
_ICOM_THIS_From_IPersistStream(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IPersistStream(iface);
if (pcbSize==NULL) if (pcbSize==NULL)
return E_POINTER; return E_POINTER;
...@@ -1756,7 +1776,7 @@ static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface( ...@@ -1756,7 +1776,7 @@ static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface(
REFIID riid, REFIID riid,
VOID** ppvoid) VOID** ppvoid)
{ {
_ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IConnectionPointContainer(iface);
return IFont_QueryInterface((IFont*)this, riid, ppvoid); return IFont_QueryInterface((IFont*)this, riid, ppvoid);
} }
...@@ -1769,7 +1789,7 @@ static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface( ...@@ -1769,7 +1789,7 @@ static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface(
static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_Release( static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_Release(
IConnectionPointContainer* iface) IConnectionPointContainer* iface)
{ {
_ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IConnectionPointContainer(iface);
return IFont_Release((IFont*)this); return IFont_Release((IFont*)this);
} }
...@@ -1782,7 +1802,7 @@ static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_Release( ...@@ -1782,7 +1802,7 @@ static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_Release(
static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_AddRef( static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_AddRef(
IConnectionPointContainer* iface) IConnectionPointContainer* iface)
{ {
_ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IConnectionPointContainer(iface);
return IFont_AddRef((IFont*)this); return IFont_AddRef((IFont*)this);
} }
...@@ -1797,7 +1817,7 @@ static HRESULT WINAPI OLEFontImpl_EnumConnectionPoints( ...@@ -1797,7 +1817,7 @@ static HRESULT WINAPI OLEFontImpl_EnumConnectionPoints(
IConnectionPointContainer* iface, IConnectionPointContainer* iface,
IEnumConnectionPoints **ppEnum) IEnumConnectionPoints **ppEnum)
{ {
_ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IConnectionPointContainer(iface);
FIXME("(%p)->(%p): stub\n", this, ppEnum); FIXME("(%p)->(%p): stub\n", this, ppEnum);
return E_NOTIMPL; return E_NOTIMPL;
...@@ -1814,7 +1834,7 @@ static HRESULT WINAPI OLEFontImpl_FindConnectionPoint( ...@@ -1814,7 +1834,7 @@ static HRESULT WINAPI OLEFontImpl_FindConnectionPoint(
REFIID riid, REFIID riid,
IConnectionPoint **ppCp) IConnectionPoint **ppCp)
{ {
_ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl, iface); OLEFontImpl *this = impl_from_IConnectionPointContainer(iface);
TRACE("(%p)->(%s, %p): stub\n", this, debugstr_guid(riid), ppCp); TRACE("(%p)->(%s, %p): stub\n", this, debugstr_guid(riid), ppCp);
if(memcmp(riid, &IID_IPropertyNotifySink, sizeof(IID_IPropertyNotifySink)) == 0) { if(memcmp(riid, &IID_IPropertyNotifySink, sizeof(IID_IPropertyNotifySink)) == 0) {
...@@ -1832,22 +1852,22 @@ static HRESULT WINAPI OLEFontImpl_FindConnectionPoint( ...@@ -1832,22 +1852,22 @@ static HRESULT WINAPI OLEFontImpl_FindConnectionPoint(
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_QueryInterface( static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_QueryInterface(
IPersistPropertyBag *iface, REFIID riid, LPVOID *ppvObj IPersistPropertyBag *iface, REFIID riid, LPVOID *ppvObj
) { ) {
_ICOM_THIS_From_IPersistPropertyBag(IFont, iface); OLEFontImpl *this = impl_from_IPersistPropertyBag(iface);
return IFont_QueryInterface(this,riid,ppvObj); return IFont_QueryInterface((IFont *)this,riid,ppvObj);
} }
static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_AddRef( static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_AddRef(
IPersistPropertyBag *iface IPersistPropertyBag *iface
) { ) {
_ICOM_THIS_From_IPersistPropertyBag(IFont, iface); OLEFontImpl *this = impl_from_IPersistPropertyBag(iface);
return IFont_AddRef(this); return IFont_AddRef((IFont *)this);
} }
static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_Release( static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_Release(
IPersistPropertyBag *iface IPersistPropertyBag *iface
) { ) {
_ICOM_THIS_From_IPersistPropertyBag(IFont, iface); OLEFontImpl *this = impl_from_IPersistPropertyBag(iface);
return IFont_Release(this); return IFont_Release((IFont *)this);
} }
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_GetClassID( static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_GetClassID(
...@@ -1886,7 +1906,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1886,7 +1906,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
VARIANT rawAttr; VARIANT rawAttr;
VARIANT valueAttr; VARIANT valueAttr;
HRESULT iRes = S_OK; HRESULT iRes = S_OK;
_ICOM_THIS_From_IPersistPropertyBag(IFont, iface); OLEFontImpl *this = impl_from_IPersistPropertyBag(iface);
VariantInit(&rawAttr); VariantInit(&rawAttr);
VariantInit(&valueAttr); VariantInit(&valueAttr);
...@@ -1897,7 +1917,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1897,7 +1917,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
{ {
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BSTR); iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BSTR);
if (iRes == S_OK) if (iRes == S_OK)
iRes = IFont_put_Name(this, V_BSTR(&valueAttr)); iRes = IFont_put_Name((IFont *)this, V_BSTR(&valueAttr));
} }
else if (iRes == E_INVALIDARG) else if (iRes == E_INVALIDARG)
iRes = S_OK; iRes = S_OK;
...@@ -1911,7 +1931,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1911,7 +1931,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
{ {
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_CY); iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_CY);
if (iRes == S_OK) if (iRes == S_OK)
iRes = IFont_put_Size(this, V_CY(&valueAttr)); iRes = IFont_put_Size((IFont *)this, V_CY(&valueAttr));
} }
else if (iRes == E_INVALIDARG) else if (iRes == E_INVALIDARG)
iRes = S_OK; iRes = S_OK;
...@@ -1925,7 +1945,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1925,7 +1945,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
{ {
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_I2); iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_I2);
if (iRes == S_OK) if (iRes == S_OK)
iRes = IFont_put_Charset(this, V_I2(&valueAttr)); iRes = IFont_put_Charset((IFont *)this, V_I2(&valueAttr));
} }
else if (iRes == E_INVALIDARG) else if (iRes == E_INVALIDARG)
iRes = S_OK; iRes = S_OK;
...@@ -1939,7 +1959,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1939,7 +1959,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
{ {
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_I2); iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_I2);
if (iRes == S_OK) if (iRes == S_OK)
iRes = IFont_put_Weight(this, V_I2(&valueAttr)); iRes = IFont_put_Weight((IFont *)this, V_I2(&valueAttr));
} }
else if (iRes == E_INVALIDARG) else if (iRes == E_INVALIDARG)
iRes = S_OK; iRes = S_OK;
...@@ -1954,7 +1974,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1954,7 +1974,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
{ {
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL); iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL);
if (iRes == S_OK) if (iRes == S_OK)
iRes = IFont_put_Underline(this, V_BOOL(&valueAttr)); iRes = IFont_put_Underline((IFont *)this, V_BOOL(&valueAttr));
} }
else if (iRes == E_INVALIDARG) else if (iRes == E_INVALIDARG)
iRes = S_OK; iRes = S_OK;
...@@ -1968,7 +1988,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1968,7 +1988,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
{ {
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL); iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL);
if (iRes == S_OK) if (iRes == S_OK)
iRes = IFont_put_Italic(this, V_BOOL(&valueAttr)); iRes = IFont_put_Italic((IFont *)this, V_BOOL(&valueAttr));
} }
else if (iRes == E_INVALIDARG) else if (iRes == E_INVALIDARG)
iRes = S_OK; iRes = S_OK;
...@@ -1982,7 +2002,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( ...@@ -1982,7 +2002,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
{ {
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL); iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL);
if (iRes == S_OK) if (iRes == S_OK)
IFont_put_Strikethrough(this, V_BOOL(&valueAttr)); IFont_put_Strikethrough((IFont *)this, V_BOOL(&valueAttr));
} }
else if (iRes == E_INVALIDARG) else if (iRes == E_INVALIDARG)
iRes = S_OK; iRes = S_OK;
...@@ -2021,22 +2041,22 @@ static const IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable = ...@@ -2021,22 +2041,22 @@ static const IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable =
static HRESULT WINAPI OLEFontImpl_IPersistStreamInit_QueryInterface( static HRESULT WINAPI OLEFontImpl_IPersistStreamInit_QueryInterface(
IPersistStreamInit *iface, REFIID riid, LPVOID *ppvObj IPersistStreamInit *iface, REFIID riid, LPVOID *ppvObj
) { ) {
_ICOM_THIS_From_IPersistStreamInit(IFont, iface); OLEFontImpl *this = impl_from_IPersistStreamInit(iface);
return IFont_QueryInterface(this,riid,ppvObj); return IFont_QueryInterface((IFont *)this,riid,ppvObj);
} }
static ULONG WINAPI OLEFontImpl_IPersistStreamInit_AddRef( static ULONG WINAPI OLEFontImpl_IPersistStreamInit_AddRef(
IPersistStreamInit *iface IPersistStreamInit *iface
) { ) {
_ICOM_THIS_From_IPersistStreamInit(IFont, iface); OLEFontImpl *this = impl_from_IPersistStreamInit(iface);
return IFont_AddRef(this); return IFont_AddRef((IFont *)this);
} }
static ULONG WINAPI OLEFontImpl_IPersistStreamInit_Release( static ULONG WINAPI OLEFontImpl_IPersistStreamInit_Release(
IPersistStreamInit *iface IPersistStreamInit *iface
) { ) {
_ICOM_THIS_From_IPersistStreamInit(IFont, iface); OLEFontImpl *this = impl_from_IPersistStreamInit(iface);
return IFont_Release(this); return IFont_Release((IFont *)this);
} }
static HRESULT WINAPI OLEFontImpl_IPersistStreamInit_GetClassID( static HRESULT WINAPI OLEFontImpl_IPersistStreamInit_GetClassID(
......
...@@ -125,10 +125,10 @@ typedef struct OLEPictureImpl { ...@@ -125,10 +125,10 @@ typedef struct OLEPictureImpl {
* IPicture handles IUnknown * IPicture handles IUnknown
*/ */
const IPictureVtbl *lpvtbl1; const IPictureVtbl *lpVtbl;
const IDispatchVtbl *lpvtbl2; const IDispatchVtbl *lpvtblIDispatch;
const IPersistStreamVtbl *lpvtbl3; const IPersistStreamVtbl *lpvtblIPersistStream;
const IConnectionPointContainerVtbl *lpvtbl4; const IConnectionPointContainerVtbl *lpvtblIConnectionPointContainer;
/* Object reference count */ /* Object reference count */
LONG ref; LONG ref;
...@@ -168,12 +168,21 @@ typedef struct OLEPictureImpl { ...@@ -168,12 +168,21 @@ typedef struct OLEPictureImpl {
/* /*
* Macros to retrieve pointer to IUnknown (IPicture) from the other VTables. * Macros to retrieve pointer to IUnknown (IPicture) from the other VTables.
*/ */
#define ICOM_THIS_From_IDispatch(impl, name) \
impl *This = (impl*)(((char*)name)-sizeof(void*)); static inline OLEPictureImpl *impl_from_IDispatch( IDispatch *iface )
#define ICOM_THIS_From_IPersistStream(impl, name) \ {
impl *This = (impl*)(((char*)name)-2*sizeof(void*)); return (OLEPictureImpl *)((char*)iface - FIELD_OFFSET(OLEPictureImpl, lpvtblIDispatch));
#define ICOM_THIS_From_IConnectionPointContainer(impl, name) \ }
impl *This = (impl*)(((char*)name)-3*sizeof(void*));
static inline OLEPictureImpl *impl_from_IPersistStream( IPersistStream *iface )
{
return (OLEPictureImpl *)((char*)iface - FIELD_OFFSET(OLEPictureImpl, lpvtblIPersistStream));
}
static inline OLEPictureImpl *impl_from_IConnectionPointContainer( IConnectionPointContainer *iface )
{
return (OLEPictureImpl *)((char*)iface - FIELD_OFFSET(OLEPictureImpl, lpvtblIConnectionPointContainer));
}
/* /*
* Predeclare VTables. They get initialized at the end. * Predeclare VTables. They get initialized at the end.
...@@ -265,10 +274,10 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn) ...@@ -265,10 +274,10 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
/* /*
* Initialize the virtual function table. * Initialize the virtual function table.
*/ */
newObject->lpvtbl1 = &OLEPictureImpl_VTable; newObject->lpVtbl = &OLEPictureImpl_VTable;
newObject->lpvtbl2 = &OLEPictureImpl_IDispatch_VTable; newObject->lpvtblIDispatch = &OLEPictureImpl_IDispatch_VTable;
newObject->lpvtbl3 = &OLEPictureImpl_IPersistStream_VTable; newObject->lpvtblIPersistStream = &OLEPictureImpl_IPersistStream_VTable;
newObject->lpvtbl4 = &OLEPictureImpl_IConnectionPointContainer_VTable; newObject->lpvtblIConnectionPointContainer = &OLEPictureImpl_IConnectionPointContainer_VTable;
CreateConnectionPoint((IUnknown*)newObject,&IID_IPropertyNotifySink,&newObject->pCP); CreateConnectionPoint((IUnknown*)newObject,&IID_IPropertyNotifySink,&newObject->pCP);
...@@ -407,19 +416,19 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface( ...@@ -407,19 +416,19 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface(
} }
else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0) else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0)
{ {
*ppvObject = (IDispatch*)&(This->lpvtbl2); *ppvObject = (IDispatch*)&(This->lpvtblIDispatch);
} }
else if (memcmp(&IID_IPictureDisp, riid, sizeof(IID_IPictureDisp)) == 0) else if (memcmp(&IID_IPictureDisp, riid, sizeof(IID_IPictureDisp)) == 0)
{ {
*ppvObject = (IDispatch*)&(This->lpvtbl2); *ppvObject = (IDispatch*)&(This->lpvtblIDispatch);
} }
else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0) else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0)
{ {
*ppvObject = (IPersistStream*)&(This->lpvtbl3); *ppvObject = (IPersistStream*)&(This->lpvtblIPersistStream);
} }
else if (memcmp(&IID_IConnectionPointContainer, riid, sizeof(IID_IConnectionPointContainer)) == 0) else if (memcmp(&IID_IConnectionPointContainer, riid, sizeof(IID_IConnectionPointContainer)) == 0)
{ {
*ppvObject = (IConnectionPointContainer*)&(This->lpvtbl4); *ppvObject = (IConnectionPointContainer*)&(This->lpvtblIConnectionPointContainer);
} }
/* /*
* Check that we obtained an interface. * Check that we obtained an interface.
...@@ -791,34 +800,34 @@ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface, ...@@ -791,34 +800,34 @@ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
static HRESULT WINAPI OLEPictureImpl_IConnectionPointContainer_QueryInterface( static HRESULT WINAPI OLEPictureImpl_IConnectionPointContainer_QueryInterface(
IConnectionPointContainer* iface, IConnectionPointContainer* iface,
REFIID riid, REFIID riid,
VOID** ppvoid VOID** ppvoid)
) { {
ICOM_THIS_From_IConnectionPointContainer(IPicture,iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
return IPicture_QueryInterface(This,riid,ppvoid); return IPicture_QueryInterface((IPicture *)This,riid,ppvoid);
} }
static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_AddRef( static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_AddRef(
IConnectionPointContainer* iface) IConnectionPointContainer* iface)
{ {
ICOM_THIS_From_IConnectionPointContainer(IPicture, iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
return IPicture_AddRef(This); return IPicture_AddRef((IPicture *)This);
} }
static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_Release( static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_Release(
IConnectionPointContainer* iface) IConnectionPointContainer* iface)
{ {
ICOM_THIS_From_IConnectionPointContainer(IPicture, iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
return IPicture_Release(This); return IPicture_Release((IPicture *)This);
} }
static HRESULT WINAPI OLEPictureImpl_EnumConnectionPoints( static HRESULT WINAPI OLEPictureImpl_EnumConnectionPoints(
IConnectionPointContainer* iface, IConnectionPointContainer* iface,
IEnumConnectionPoints** ppEnum IEnumConnectionPoints** ppEnum)
) { {
ICOM_THIS_From_IConnectionPointContainer(IPicture, iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
FIXME("(%p,%p), stub!\n",This,ppEnum); FIXME("(%p,%p), stub!\n",This,ppEnum);
return E_NOTIMPL; return E_NOTIMPL;
...@@ -827,9 +836,9 @@ static HRESULT WINAPI OLEPictureImpl_EnumConnectionPoints( ...@@ -827,9 +836,9 @@ static HRESULT WINAPI OLEPictureImpl_EnumConnectionPoints(
static HRESULT WINAPI OLEPictureImpl_FindConnectionPoint( static HRESULT WINAPI OLEPictureImpl_FindConnectionPoint(
IConnectionPointContainer* iface, IConnectionPointContainer* iface,
REFIID riid, REFIID riid,
IConnectionPoint **ppCP IConnectionPoint **ppCP)
) { {
ICOM_THIS_From_IConnectionPointContainer(OLEPictureImpl, iface); OLEPictureImpl *This = impl_from_IConnectionPointContainer(iface);
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppCP); TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppCP);
if (!ppCP) if (!ppCP)
return E_POINTER; return E_POINTER;
...@@ -852,9 +861,9 @@ static HRESULT WINAPI OLEPictureImpl_IPersistStream_QueryInterface( ...@@ -852,9 +861,9 @@ static HRESULT WINAPI OLEPictureImpl_IPersistStream_QueryInterface(
REFIID riid, REFIID riid,
VOID** ppvoid) VOID** ppvoid)
{ {
ICOM_THIS_From_IPersistStream(IPicture, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
return IPicture_QueryInterface(This, riid, ppvoid); return IPicture_QueryInterface((IPicture *)This, riid, ppvoid);
} }
/************************************************************************ /************************************************************************
...@@ -865,9 +874,9 @@ static HRESULT WINAPI OLEPictureImpl_IPersistStream_QueryInterface( ...@@ -865,9 +874,9 @@ static HRESULT WINAPI OLEPictureImpl_IPersistStream_QueryInterface(
static ULONG WINAPI OLEPictureImpl_IPersistStream_AddRef( static ULONG WINAPI OLEPictureImpl_IPersistStream_AddRef(
IPersistStream* iface) IPersistStream* iface)
{ {
ICOM_THIS_From_IPersistStream(IPicture, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
return IPicture_AddRef(This); return IPicture_AddRef((IPicture *)This);
} }
/************************************************************************ /************************************************************************
...@@ -878,9 +887,9 @@ static ULONG WINAPI OLEPictureImpl_IPersistStream_AddRef( ...@@ -878,9 +887,9 @@ static ULONG WINAPI OLEPictureImpl_IPersistStream_AddRef(
static ULONG WINAPI OLEPictureImpl_IPersistStream_Release( static ULONG WINAPI OLEPictureImpl_IPersistStream_Release(
IPersistStream* iface) IPersistStream* iface)
{ {
ICOM_THIS_From_IPersistStream(IPicture, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
return IPicture_Release(This); return IPicture_Release((IPicture *)This);
} }
/************************************************************************ /************************************************************************
...@@ -889,7 +898,7 @@ static ULONG WINAPI OLEPictureImpl_IPersistStream_Release( ...@@ -889,7 +898,7 @@ static ULONG WINAPI OLEPictureImpl_IPersistStream_Release(
static HRESULT WINAPI OLEPictureImpl_GetClassID( static HRESULT WINAPI OLEPictureImpl_GetClassID(
IPersistStream* iface,CLSID* pClassID) IPersistStream* iface,CLSID* pClassID)
{ {
ICOM_THIS_From_IPersistStream(IPicture, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
FIXME("(%p),stub!\n",This); FIXME("(%p),stub!\n",This);
return E_FAIL; return E_FAIL;
} }
...@@ -900,7 +909,7 @@ static HRESULT WINAPI OLEPictureImpl_GetClassID( ...@@ -900,7 +909,7 @@ static HRESULT WINAPI OLEPictureImpl_GetClassID(
static HRESULT WINAPI OLEPictureImpl_IsDirty( static HRESULT WINAPI OLEPictureImpl_IsDirty(
IPersistStream* iface) IPersistStream* iface)
{ {
ICOM_THIS_From_IPersistStream(IPicture, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
FIXME("(%p),stub!\n",This); FIXME("(%p),stub!\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
...@@ -1028,7 +1037,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) { ...@@ -1028,7 +1037,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
DWORD header[2]; DWORD header[2];
WORD magic; WORD magic;
STATSTG statstg; STATSTG statstg;
ICOM_THIS_From_IPersistStream(OLEPictureImpl, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
TRACE("(%p,%p)\n",This,pStm); TRACE("(%p,%p)\n",This,pStm);
...@@ -1519,7 +1528,7 @@ static HRESULT WINAPI OLEPictureImpl_Save( ...@@ -1519,7 +1528,7 @@ static HRESULT WINAPI OLEPictureImpl_Save(
ULONG dummy; ULONG dummy;
int iSerializeResult = 0; int iSerializeResult = 0;
ICOM_THIS_From_IPersistStream(OLEPictureImpl, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
switch (This->desc.picType) { switch (This->desc.picType) {
case PICTYPE_ICON: case PICTYPE_ICON:
...@@ -1837,7 +1846,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength) ...@@ -1837,7 +1846,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
static HRESULT WINAPI OLEPictureImpl_GetSizeMax( static HRESULT WINAPI OLEPictureImpl_GetSizeMax(
IPersistStream* iface,ULARGE_INTEGER*pcbSize) IPersistStream* iface,ULARGE_INTEGER*pcbSize)
{ {
ICOM_THIS_From_IPersistStream(IPicture, iface); OLEPictureImpl *This = impl_from_IPersistStream(iface);
FIXME("(%p,%p),stub!\n",This,pcbSize); FIXME("(%p,%p),stub!\n",This,pcbSize);
return E_NOTIMPL; return E_NOTIMPL;
} }
...@@ -1855,9 +1864,9 @@ static HRESULT WINAPI OLEPictureImpl_IDispatch_QueryInterface( ...@@ -1855,9 +1864,9 @@ static HRESULT WINAPI OLEPictureImpl_IDispatch_QueryInterface(
REFIID riid, REFIID riid,
VOID** ppvoid) VOID** ppvoid)
{ {
ICOM_THIS_From_IDispatch(IPicture, iface); OLEPictureImpl *This = impl_from_IDispatch(iface);
return IPicture_QueryInterface(This, riid, ppvoid); return IPicture_QueryInterface((IPicture *)This, riid, ppvoid);
} }
/************************************************************************ /************************************************************************
...@@ -1868,9 +1877,9 @@ static HRESULT WINAPI OLEPictureImpl_IDispatch_QueryInterface( ...@@ -1868,9 +1877,9 @@ static HRESULT WINAPI OLEPictureImpl_IDispatch_QueryInterface(
static ULONG WINAPI OLEPictureImpl_IDispatch_AddRef( static ULONG WINAPI OLEPictureImpl_IDispatch_AddRef(
IDispatch* iface) IDispatch* iface)
{ {
ICOM_THIS_From_IDispatch(IPicture, iface); OLEPictureImpl *This = impl_from_IDispatch(iface);
return IPicture_AddRef(This); return IPicture_AddRef((IPicture *)This);
} }
/************************************************************************ /************************************************************************
...@@ -1881,9 +1890,9 @@ static ULONG WINAPI OLEPictureImpl_IDispatch_AddRef( ...@@ -1881,9 +1890,9 @@ static ULONG WINAPI OLEPictureImpl_IDispatch_AddRef(
static ULONG WINAPI OLEPictureImpl_IDispatch_Release( static ULONG WINAPI OLEPictureImpl_IDispatch_Release(
IDispatch* iface) IDispatch* iface)
{ {
ICOM_THIS_From_IDispatch(IPicture, iface); OLEPictureImpl *This = impl_from_IDispatch(iface);
return IPicture_Release(This); return IPicture_Release((IPicture *)This);
} }
/************************************************************************ /************************************************************************
......
...@@ -885,8 +885,10 @@ typedef struct tagITypeLibImpl ...@@ -885,8 +885,10 @@ typedef struct tagITypeLibImpl
static const ITypeLib2Vtbl tlbvt; static const ITypeLib2Vtbl tlbvt;
static const ITypeCompVtbl tlbtcvt; static const ITypeCompVtbl tlbtcvt;
#define _ITypeComp_Offset(impl) ((int)(&(((impl*)0)->lpVtblTypeComp))) static inline ITypeLibImpl *impl_from_ITypeComp( ITypeComp *iface )
#define ICOM_THIS_From_ITypeComp(impl, iface) impl* This = (impl*)(((char*)iface)-_ITypeComp_Offset(impl)) {
return (ITypeLibImpl *)((char*)iface - FIELD_OFFSET(ITypeLibImpl, lpVtblTypeComp));
}
/* ITypeLib methods */ /* ITypeLib methods */
static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength); static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength);
...@@ -995,6 +997,11 @@ typedef struct tagITypeInfoImpl ...@@ -995,6 +997,11 @@ typedef struct tagITypeInfoImpl
struct tagITypeInfoImpl * next; struct tagITypeInfoImpl * next;
} ITypeInfoImpl; } ITypeInfoImpl;
static inline ITypeInfoImpl *info_impl_from_ITypeComp( ITypeComp *iface )
{
return (ITypeInfoImpl *)((char*)iface - FIELD_OFFSET(ITypeInfoImpl, lpVtblTypeComp));
}
static const ITypeInfo2Vtbl tinfvt; static const ITypeInfo2Vtbl tinfvt;
static const ITypeCompVtbl tcompvt; static const ITypeCompVtbl tcompvt;
...@@ -4003,23 +4010,23 @@ static const ITypeLib2Vtbl tlbvt = { ...@@ -4003,23 +4010,23 @@ static const ITypeLib2Vtbl tlbvt = {
static HRESULT WINAPI ITypeLibComp_fnQueryInterface(ITypeComp * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI ITypeLibComp_fnQueryInterface(ITypeComp * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_ITypeComp(ITypeLibImpl, iface); ITypeLibImpl *This = impl_from_ITypeComp(iface);
return ITypeInfo_QueryInterface((ITypeInfo *)This, riid, ppv); return ITypeLib2_QueryInterface((ITypeLib *)This, riid, ppv);
} }
static ULONG WINAPI ITypeLibComp_fnAddRef(ITypeComp * iface) static ULONG WINAPI ITypeLibComp_fnAddRef(ITypeComp * iface)
{ {
ICOM_THIS_From_ITypeComp(ITypeLibImpl, iface); ITypeLibImpl *This = impl_from_ITypeComp(iface);
return ITypeInfo_AddRef((ITypeInfo *)This); return ITypeLib2_AddRef((ITypeLib2 *)This);
} }
static ULONG WINAPI ITypeLibComp_fnRelease(ITypeComp * iface) static ULONG WINAPI ITypeLibComp_fnRelease(ITypeComp * iface)
{ {
ICOM_THIS_From_ITypeComp(ITypeLibImpl, iface); ITypeLibImpl *This = impl_from_ITypeComp(iface);
return ITypeInfo_Release((ITypeInfo *)This); return ITypeLib2_Release((ITypeLib2 *)This);
} }
static HRESULT WINAPI ITypeLibComp_fnBind( static HRESULT WINAPI ITypeLibComp_fnBind(
...@@ -5955,21 +5962,21 @@ HRESULT WINAPI CreateDispTypeInfo( ...@@ -5955,21 +5962,21 @@ HRESULT WINAPI CreateDispTypeInfo(
static HRESULT WINAPI ITypeComp_fnQueryInterface(ITypeComp * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI ITypeComp_fnQueryInterface(ITypeComp * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_ITypeComp(ITypeInfoImpl, iface); ITypeInfoImpl *This = info_impl_from_ITypeComp(iface);
return ITypeInfo_QueryInterface((ITypeInfo *)This, riid, ppv); return ITypeInfo_QueryInterface((ITypeInfo *)This, riid, ppv);
} }
static ULONG WINAPI ITypeComp_fnAddRef(ITypeComp * iface) static ULONG WINAPI ITypeComp_fnAddRef(ITypeComp * iface)
{ {
ICOM_THIS_From_ITypeComp(ITypeInfoImpl, iface); ITypeInfoImpl *This = info_impl_from_ITypeComp(iface);
return ITypeInfo_AddRef((ITypeInfo *)This); return ITypeInfo_AddRef((ITypeInfo *)This);
} }
static ULONG WINAPI ITypeComp_fnRelease(ITypeComp * iface) static ULONG WINAPI ITypeComp_fnRelease(ITypeComp * iface)
{ {
ICOM_THIS_From_ITypeComp(ITypeInfoImpl, iface); ITypeInfoImpl *This = info_impl_from_ITypeComp(iface);
return ITypeInfo_Release((ITypeInfo *)This); return ITypeInfo_Release((ITypeInfo *)This);
} }
...@@ -5983,7 +5990,7 @@ static HRESULT WINAPI ITypeComp_fnBind( ...@@ -5983,7 +5990,7 @@ static HRESULT WINAPI ITypeComp_fnBind(
DESCKIND * pDescKind, DESCKIND * pDescKind,
BINDPTR * pBindPtr) BINDPTR * pBindPtr)
{ {
ICOM_THIS_From_ITypeComp(ITypeInfoImpl, iface); ITypeInfoImpl *This = info_impl_from_ITypeComp(iface);
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
......
...@@ -166,8 +166,10 @@ typedef struct tagICreateTypeLib2Impl ...@@ -166,8 +166,10 @@ typedef struct tagICreateTypeLib2Impl
struct tagICreateTypeInfo2Impl *last_typeinfo; struct tagICreateTypeInfo2Impl *last_typeinfo;
} ICreateTypeLib2Impl; } ICreateTypeLib2Impl;
#define _ITypeLib2_Offset(impl) ((int)(&(((impl*)0)->lpVtblTypeLib2))) static inline ICreateTypeLib2Impl *impl_from_ITypeLib2( ITypeLib2 *iface )
#define ICOM_THIS_From_ITypeLib2(impl, iface) impl* This = (impl*)(((char*)iface)-_ITypeLib2_Offset(impl)) {
return (ICreateTypeLib2Impl *)((char*)iface - FIELD_OFFSET(ICreateTypeLib2Impl, lpVtblTypeLib2));
}
typedef struct tagICreateTypeInfo2Impl typedef struct tagICreateTypeInfo2Impl
{ {
...@@ -192,8 +194,10 @@ typedef struct tagICreateTypeInfo2Impl ...@@ -192,8 +194,10 @@ typedef struct tagICreateTypeInfo2Impl
struct tagICreateTypeInfo2Impl *next_typeinfo; struct tagICreateTypeInfo2Impl *next_typeinfo;
} ICreateTypeInfo2Impl; } ICreateTypeInfo2Impl;
#define _ITypeInfo2_Offset(impl) ((int)(&(((impl*)0)->lpVtblTypeInfo2))) static inline ICreateTypeInfo2Impl *impl_from_ITypeInfo2( ITypeInfo2 *iface )
#define ICOM_THIS_From_ITypeInfo2(impl, iface) impl* This = (impl*)(((char*)iface)-_ITypeInfo2_Offset(impl)) {
return (ICreateTypeInfo2Impl *)((char*)iface - FIELD_OFFSET(ICreateTypeInfo2Impl, lpVtblTypeInfo2));
}
static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface); static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface);
...@@ -2198,7 +2202,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetName( ...@@ -2198,7 +2202,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetName(
*/ */
static HRESULT WINAPI ITypeInfo2_fnQueryInterface(ITypeInfo2 * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI ITypeInfo2_fnQueryInterface(ITypeInfo2 * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_ITypeInfo2(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = impl_from_ITypeInfo2(iface);
return ICreateTypeInfo2_QueryInterface((ICreateTypeInfo2 *)This, riid, ppv); return ICreateTypeInfo2_QueryInterface((ICreateTypeInfo2 *)This, riid, ppv);
} }
...@@ -2210,7 +2214,7 @@ static HRESULT WINAPI ITypeInfo2_fnQueryInterface(ITypeInfo2 * iface, REFIID rii ...@@ -2210,7 +2214,7 @@ static HRESULT WINAPI ITypeInfo2_fnQueryInterface(ITypeInfo2 * iface, REFIID rii
*/ */
static ULONG WINAPI ITypeInfo2_fnAddRef(ITypeInfo2 * iface) static ULONG WINAPI ITypeInfo2_fnAddRef(ITypeInfo2 * iface)
{ {
ICOM_THIS_From_ITypeInfo2(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = impl_from_ITypeInfo2(iface);
return ICreateTypeInfo2_AddRef((ICreateTypeInfo2 *)This); return ICreateTypeInfo2_AddRef((ICreateTypeInfo2 *)This);
} }
...@@ -2222,7 +2226,7 @@ static ULONG WINAPI ITypeInfo2_fnAddRef(ITypeInfo2 * iface) ...@@ -2222,7 +2226,7 @@ static ULONG WINAPI ITypeInfo2_fnAddRef(ITypeInfo2 * iface)
*/ */
static ULONG WINAPI ITypeInfo2_fnRelease(ITypeInfo2 * iface) static ULONG WINAPI ITypeInfo2_fnRelease(ITypeInfo2 * iface)
{ {
ICOM_THIS_From_ITypeInfo2(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = impl_from_ITypeInfo2(iface);
return ICreateTypeInfo2_Release((ICreateTypeInfo2 *)This); return ICreateTypeInfo2_Release((ICreateTypeInfo2 *)This);
} }
...@@ -2461,7 +2465,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetContainingTypeLib( ...@@ -2461,7 +2465,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetContainingTypeLib(
ITypeLib** ppTLib, ITypeLib** ppTLib,
UINT* pIndex) UINT* pIndex)
{ {
ICOM_THIS_From_ITypeInfo2(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = impl_from_ITypeInfo2(iface);
TRACE("(%p,%p,%p)\n", iface, ppTLib, pIndex); TRACE("(%p,%p,%p)\n", iface, ppTLib, pIndex);
...@@ -3431,7 +3435,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringDll( ...@@ -3431,7 +3435,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringDll(
*/ */
static HRESULT WINAPI ITypeLib2_fnQueryInterface(ITypeLib2 * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI ITypeLib2_fnQueryInterface(ITypeLib2 * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
return ICreateTypeLib2_QueryInterface((ICreateTypeLib2 *)This, riid, ppv); return ICreateTypeLib2_QueryInterface((ICreateTypeLib2 *)This, riid, ppv);
} }
...@@ -3443,7 +3447,7 @@ static HRESULT WINAPI ITypeLib2_fnQueryInterface(ITypeLib2 * iface, REFIID riid, ...@@ -3443,7 +3447,7 @@ static HRESULT WINAPI ITypeLib2_fnQueryInterface(ITypeLib2 * iface, REFIID riid,
*/ */
static ULONG WINAPI ITypeLib2_fnAddRef(ITypeLib2 * iface) static ULONG WINAPI ITypeLib2_fnAddRef(ITypeLib2 * iface)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
return ICreateTypeLib2_AddRef((ICreateTypeLib2 *)This); return ICreateTypeLib2_AddRef((ICreateTypeLib2 *)This);
} }
...@@ -3455,7 +3459,7 @@ static ULONG WINAPI ITypeLib2_fnAddRef(ITypeLib2 * iface) ...@@ -3455,7 +3459,7 @@ static ULONG WINAPI ITypeLib2_fnAddRef(ITypeLib2 * iface)
*/ */
static ULONG WINAPI ITypeLib2_fnRelease(ITypeLib2 * iface) static ULONG WINAPI ITypeLib2_fnRelease(ITypeLib2 * iface)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
return ICreateTypeLib2_Release((ICreateTypeLib2 *)This); return ICreateTypeLib2_Release((ICreateTypeLib2 *)This);
} }
...@@ -3468,7 +3472,7 @@ static ULONG WINAPI ITypeLib2_fnRelease(ITypeLib2 * iface) ...@@ -3468,7 +3472,7 @@ static ULONG WINAPI ITypeLib2_fnRelease(ITypeLib2 * iface)
static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( static UINT WINAPI ITypeLib2_fnGetTypeInfoCount(
ITypeLib2 * iface) ITypeLib2 * iface)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
TRACE("(%p)\n", iface); TRACE("(%p)\n", iface);
...@@ -3485,7 +3489,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo( ...@@ -3485,7 +3489,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
UINT index, UINT index,
ITypeInfo** ppTInfo) ITypeInfo** ppTInfo)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
TRACE("(%p,%d,%p)\n", iface, index, ppTInfo); TRACE("(%p,%d,%p)\n", iface, index, ppTInfo);
...@@ -3506,7 +3510,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType( ...@@ -3506,7 +3510,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType(
UINT index, UINT index,
TYPEKIND* pTKind) TYPEKIND* pTKind)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
TRACE("(%p,%d,%p)\n", iface, index, pTKind); TRACE("(%p,%d,%p)\n", iface, index, pTKind);
...@@ -3529,7 +3533,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid( ...@@ -3529,7 +3533,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid(
REFGUID guid, REFGUID guid,
ITypeInfo** ppTinfo) ITypeInfo** ppTinfo)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
int guidoffset; int guidoffset;
int typeinfo; int typeinfo;
...@@ -3554,9 +3558,9 @@ static HRESULT WINAPI ITypeLib2_fnGetLibAttr( ...@@ -3554,9 +3558,9 @@ static HRESULT WINAPI ITypeLib2_fnGetLibAttr(
ITypeLib2 * iface, ITypeLib2 * iface,
TLIBATTR** ppTLibAttr) TLIBATTR** ppTLibAttr)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%p), stub!\n", iface, ppTLibAttr); FIXME("(%p,%p), stub!\n", This, ppTLibAttr);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -3570,9 +3574,9 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeComp( ...@@ -3570,9 +3574,9 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeComp(
ITypeLib2 * iface, ITypeLib2 * iface,
ITypeComp** ppTComp) ITypeComp** ppTComp)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%p), stub!\n", iface, ppTComp); FIXME("(%p,%p), stub!\n", This, ppTComp);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -3590,9 +3594,9 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation( ...@@ -3590,9 +3594,9 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation(
DWORD* pdwHelpContext, DWORD* pdwHelpContext,
BSTR* pBstrHelpFile) BSTR* pBstrHelpFile)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%d,%p,%p,%p,%p), stub!\n", iface, index, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile); FIXME("(%p,%d,%p,%p,%p,%p), stub!\n", This, index, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -3608,7 +3612,7 @@ static HRESULT WINAPI ITypeLib2_fnIsName( ...@@ -3608,7 +3612,7 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
ULONG lHashVal, ULONG lHashVal,
BOOL* pfName) BOOL* pfName)
{ {
ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
char *encoded_name; char *encoded_name;
int nameoffset; int nameoffset;
...@@ -3646,9 +3650,9 @@ static HRESULT WINAPI ITypeLib2_fnFindName( ...@@ -3646,9 +3650,9 @@ static HRESULT WINAPI ITypeLib2_fnFindName(
MEMBERID* rgMemId, MEMBERID* rgMemId,
USHORT* pcFound) USHORT* pcFound)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%s,%lx,%p,%p,%p), stub!\n", iface, debugstr_w(szNameBuf), lHashVal, ppTInfo, rgMemId, pcFound); FIXME("(%p,%s,%lx,%p,%p,%p), stub!\n", This, debugstr_w(szNameBuf), lHashVal, ppTInfo, rgMemId, pcFound);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -3662,9 +3666,9 @@ static void WINAPI ITypeLib2_fnReleaseTLibAttr( ...@@ -3662,9 +3666,9 @@ static void WINAPI ITypeLib2_fnReleaseTLibAttr(
ITypeLib2 * iface, ITypeLib2 * iface,
TLIBATTR* pTLibAttr) TLIBATTR* pTLibAttr)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%p), stub!\n", iface, pTLibAttr); FIXME("(%p,%p), stub!\n", This, pTLibAttr);
} }
/****************************************************************************** /******************************************************************************
...@@ -3682,9 +3686,9 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData( ...@@ -3682,9 +3686,9 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData(
REFGUID guid, /* [I] The GUID under which the custom data is stored. */ REFGUID guid, /* [I] The GUID under which the custom data is stored. */
VARIANT* pVarVal) /* [O] The custom data. */ VARIANT* pVarVal) /* [O] The custom data. */
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%s,%p), stub!\n", iface, debugstr_guid(guid), pVarVal); FIXME("(%p,%s,%p), stub!\n", This, debugstr_guid(guid), pVarVal);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -3705,9 +3709,9 @@ static HRESULT WINAPI ITypeLib2_fnGetLibStatistics( ...@@ -3705,9 +3709,9 @@ static HRESULT WINAPI ITypeLib2_fnGetLibStatistics(
ULONG* pcUniqueNames, /* [O] The number of unique names in the type library. */ ULONG* pcUniqueNames, /* [O] The number of unique names in the type library. */
ULONG* pcchUniqueNames) /* [O] The number of changed (?) characters in names in the type library. */ ULONG* pcchUniqueNames) /* [O] The number of changed (?) characters in names in the type library. */
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%p,%p), stub!\n", iface, pcUniqueNames, pcchUniqueNames); FIXME("(%p,%p,%p), stub!\n", This, pcUniqueNames, pcchUniqueNames);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -3730,9 +3734,9 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2( ...@@ -3730,9 +3734,9 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2(
DWORD* pdwHelpStringContext, DWORD* pdwHelpStringContext,
BSTR* pbstrHelpStringDll) BSTR* pbstrHelpStringDll)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%d,%ld,%p,%p,%p), stub!\n", iface, index, lcid, pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll); FIXME("(%p,%d,%ld,%p,%p,%p), stub!\n", This, index, lcid, pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -3751,9 +3755,9 @@ static HRESULT WINAPI ITypeLib2_fnGetAllCustData( ...@@ -3751,9 +3755,9 @@ static HRESULT WINAPI ITypeLib2_fnGetAllCustData(
ITypeLib2 * iface, /* [I] The type library in which to find the custom data. */ ITypeLib2 * iface, /* [I] The type library in which to find the custom data. */
CUSTDATA* pCustData) /* [O] The structure in which to place the custom data. */ CUSTDATA* pCustData) /* [O] The structure in which to place the custom data. */
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%p), stub!\n", iface, pCustData); FIXME("(%p,%p), stub!\n", This, pCustData);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
......
...@@ -65,11 +65,15 @@ typedef struct CaptureGraphImpl ...@@ -65,11 +65,15 @@ typedef struct CaptureGraphImpl
static const ICaptureGraphBuilderVtbl builder_Vtbl; static const ICaptureGraphBuilderVtbl builder_Vtbl;
static const ICaptureGraphBuilder2Vtbl builder2_Vtbl; static const ICaptureGraphBuilder2Vtbl builder2_Vtbl;
#define _ICaptureGraphBuilder_Offset ((int)(&(((CaptureGraphImpl*)0)->lpVtbl))) static inline CaptureGraphImpl *impl_from_ICaptureGraphBuilder( ICaptureGraphBuilder *iface )
#define _ICOM_THIS_From_ICaptureGraphBuilder(class, name) class* This = (class*)(((char*)name)-_ICaptureGraphBuilder_Offset) {
return (CaptureGraphImpl *)((char*)iface - FIELD_OFFSET(CaptureGraphImpl, lpVtbl));
}
#define _ICaptureGraphBuilder2_Offset ((int)(&(((CaptureGraphImpl*)0)->lpVtbl2))) static inline CaptureGraphImpl *impl_from_ICaptureGraphBuilder2( ICaptureGraphBuilder2 *iface )
#define _ICOM_THIS_From_ICaptureGraphBuilder2(class, name) class* This = (class*)(((char*)name)-_ICaptureGraphBuilder2_Offset) {
return (CaptureGraphImpl *)((char*)iface - FIELD_OFFSET(CaptureGraphImpl, lpVtbl2));
}
/* /*
converts This to an interface pointer converts This to an interface pointer
...@@ -112,7 +116,7 @@ fnCaptureGraphBuilder2_QueryInterface(ICaptureGraphBuilder2 * iface, ...@@ -112,7 +116,7 @@ fnCaptureGraphBuilder2_QueryInterface(ICaptureGraphBuilder2 * iface,
REFIID riid, REFIID riid,
LPVOID * ppv) LPVOID * ppv)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv); TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
...@@ -138,7 +142,7 @@ fnCaptureGraphBuilder2_QueryInterface(ICaptureGraphBuilder2 * iface, ...@@ -138,7 +142,7 @@ fnCaptureGraphBuilder2_QueryInterface(ICaptureGraphBuilder2 * iface,
static ULONG WINAPI static ULONG WINAPI
fnCaptureGraphBuilder2_AddRef(ICaptureGraphBuilder2 * iface) fnCaptureGraphBuilder2_AddRef(ICaptureGraphBuilder2 * iface)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
DWORD ref = InterlockedIncrement(&This->ref); DWORD ref = InterlockedIncrement(&This->ref);
TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, ref - 1); TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, ref - 1);
...@@ -148,7 +152,7 @@ fnCaptureGraphBuilder2_AddRef(ICaptureGraphBuilder2 * iface) ...@@ -148,7 +152,7 @@ fnCaptureGraphBuilder2_AddRef(ICaptureGraphBuilder2 * iface)
static ULONG WINAPI static ULONG WINAPI
fnCaptureGraphBuilder2_Release(ICaptureGraphBuilder2 * iface) fnCaptureGraphBuilder2_Release(ICaptureGraphBuilder2 * iface)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
DWORD ref = InterlockedDecrement(&This->ref); DWORD ref = InterlockedDecrement(&This->ref);
TRACE("(%p/%p)->() Release from %ld\n", This, iface, ref + 1); TRACE("(%p/%p)->() Release from %ld\n", This, iface, ref + 1);
...@@ -175,7 +179,7 @@ fnCaptureGraphBuilder2_SetFilterGraph(ICaptureGraphBuilder2 * iface, ...@@ -175,7 +179,7 @@ fnCaptureGraphBuilder2_SetFilterGraph(ICaptureGraphBuilder2 * iface,
this method. If you call this method after the graph builder has created its this method. If you call this method after the graph builder has created its
own filter graph, the call will fail. */ own filter graph, the call will fail. */
IMediaEvent *pmev; IMediaEvent *pmev;
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, pfg); TRACE("(%p/%p)->(%p)\n", This, iface, pfg);
...@@ -200,7 +204,7 @@ static HRESULT WINAPI ...@@ -200,7 +204,7 @@ static HRESULT WINAPI
fnCaptureGraphBuilder2_GetFilterGraph(ICaptureGraphBuilder2 * iface, fnCaptureGraphBuilder2_GetFilterGraph(ICaptureGraphBuilder2 * iface,
IGraphBuilder **pfg) IGraphBuilder **pfg)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, pfg); TRACE("(%p/%p)->(%p)\n", This, iface, pfg);
...@@ -227,7 +231,7 @@ fnCaptureGraphBuilder2_SetOutputFileName(ICaptureGraphBuilder2 * iface, ...@@ -227,7 +231,7 @@ fnCaptureGraphBuilder2_SetOutputFileName(ICaptureGraphBuilder2 * iface,
IBaseFilter **ppf, IBaseFilter **ppf,
IFileSinkFilter **ppSink) IFileSinkFilter **ppSink)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
FIXME("(%p/%p)->(%s, %s, %p, %p) Stub!\n", This, iface, FIXME("(%p/%p)->(%s, %s, %p, %p) Stub!\n", This, iface,
debugstr_guid(pType), debugstr_w(lpstrFile), ppf, ppSink); debugstr_guid(pType), debugstr_w(lpstrFile), ppf, ppSink);
...@@ -243,7 +247,7 @@ fnCaptureGraphBuilder2_FindInterface(ICaptureGraphBuilder2 * iface, ...@@ -243,7 +247,7 @@ fnCaptureGraphBuilder2_FindInterface(ICaptureGraphBuilder2 * iface,
REFIID riid, REFIID riid,
void **ppint) void **ppint)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
FIXME("(%p/%p)->(%s, %s, %p, %s, %p) - workaround stub!\n", This, iface, FIXME("(%p/%p)->(%s, %s, %p, %s, %p) - workaround stub!\n", This, iface,
debugstr_guid(pCategory), debugstr_guid(pType), debugstr_guid(pCategory), debugstr_guid(pType),
...@@ -264,7 +268,7 @@ fnCaptureGraphBuilder2_RenderStream(ICaptureGraphBuilder2 * iface, ...@@ -264,7 +268,7 @@ fnCaptureGraphBuilder2_RenderStream(ICaptureGraphBuilder2 * iface,
IBaseFilter *pfCompressor, IBaseFilter *pfCompressor,
IBaseFilter *pfRenderer) IBaseFilter *pfRenderer)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
FIXME("(%p/%p)->(%s, %s, %p, %p, %p) Stub!\n", This, iface, FIXME("(%p/%p)->(%s, %s, %p, %p, %p) Stub!\n", This, iface,
debugstr_guid(pCategory), debugstr_guid(pType), debugstr_guid(pCategory), debugstr_guid(pType),
...@@ -283,7 +287,7 @@ fnCaptureGraphBuilder2_ControlStream(ICaptureGraphBuilder2 * iface, ...@@ -283,7 +287,7 @@ fnCaptureGraphBuilder2_ControlStream(ICaptureGraphBuilder2 * iface,
WORD wStartCookie, WORD wStartCookie,
WORD wStopCookie) WORD wStopCookie)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
FIXME("(%p/%p)->(%s, %s, %p, %p, %p, %i, %i) Stub!\n", This, iface, FIXME("(%p/%p)->(%s, %s, %p, %p, %p, %i, %i) Stub!\n", This, iface,
debugstr_guid(pCategory), debugstr_guid(pType), debugstr_guid(pCategory), debugstr_guid(pType),
...@@ -297,7 +301,7 @@ fnCaptureGraphBuilder2_AllocCapFile(ICaptureGraphBuilder2 * iface, ...@@ -297,7 +301,7 @@ fnCaptureGraphBuilder2_AllocCapFile(ICaptureGraphBuilder2 * iface,
LPCOLESTR lpwstr, LPCOLESTR lpwstr,
DWORDLONG dwlSize) DWORDLONG dwlSize)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
FIXME("(%p/%p)->(%s, %lld) Stub!\n", This, iface, FIXME("(%p/%p)->(%s, %lld) Stub!\n", This, iface,
debugstr_w(lpwstr), dwlSize); debugstr_w(lpwstr), dwlSize);
...@@ -312,7 +316,7 @@ fnCaptureGraphBuilder2_CopyCaptureFile(ICaptureGraphBuilder2 * iface, ...@@ -312,7 +316,7 @@ fnCaptureGraphBuilder2_CopyCaptureFile(ICaptureGraphBuilder2 * iface,
int fAllowEscAbort, int fAllowEscAbort,
IAMCopyCaptureFileProgress *pCallback) IAMCopyCaptureFileProgress *pCallback)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
FIXME("(%p/%p)->(%s, %s, %i, %p) Stub!\n", This, iface, FIXME("(%p/%p)->(%s, %s, %i, %p) Stub!\n", This, iface,
debugstr_w(lpwstrOld), debugstr_w(lpwstrNew), debugstr_w(lpwstrOld), debugstr_w(lpwstrNew),
...@@ -331,7 +335,7 @@ fnCaptureGraphBuilder2_FindPin(ICaptureGraphBuilder2 * iface, ...@@ -331,7 +335,7 @@ fnCaptureGraphBuilder2_FindPin(ICaptureGraphBuilder2 * iface,
int num, int num,
IPin **ppPin) IPin **ppPin)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder2(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
FIXME("(%p/%p)->(%p, %x, %s, %s, %d, %i, %p) Stub!\n", This, iface, FIXME("(%p/%p)->(%p, %x, %s, %s, %d, %i, %p) Stub!\n", This, iface,
pSource, pindir, debugstr_guid(pCategory), debugstr_guid(pType), pSource, pindir, debugstr_guid(pCategory), debugstr_guid(pType),
...@@ -361,7 +365,7 @@ static HRESULT WINAPI ...@@ -361,7 +365,7 @@ static HRESULT WINAPI
fnCaptureGraphBuilder_QueryInterface(ICaptureGraphBuilder * iface, fnCaptureGraphBuilder_QueryInterface(ICaptureGraphBuilder * iface,
REFIID riid, LPVOID * ppv) REFIID riid, LPVOID * ppv)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return IUnknown_QueryInterface(_ICaptureGraphBuilder2_(This), riid, ppv); return IUnknown_QueryInterface(_ICaptureGraphBuilder2_(This), riid, ppv);
} }
...@@ -369,7 +373,7 @@ fnCaptureGraphBuilder_QueryInterface(ICaptureGraphBuilder * iface, ...@@ -369,7 +373,7 @@ fnCaptureGraphBuilder_QueryInterface(ICaptureGraphBuilder * iface,
static ULONG WINAPI static ULONG WINAPI
fnCaptureGraphBuilder_AddRef(ICaptureGraphBuilder * iface) fnCaptureGraphBuilder_AddRef(ICaptureGraphBuilder * iface)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return IUnknown_AddRef(_ICaptureGraphBuilder2_(This)); return IUnknown_AddRef(_ICaptureGraphBuilder2_(This));
} }
...@@ -377,7 +381,7 @@ fnCaptureGraphBuilder_AddRef(ICaptureGraphBuilder * iface) ...@@ -377,7 +381,7 @@ fnCaptureGraphBuilder_AddRef(ICaptureGraphBuilder * iface)
static ULONG WINAPI static ULONG WINAPI
fnCaptureGraphBuilder_Release(ICaptureGraphBuilder * iface) fnCaptureGraphBuilder_Release(ICaptureGraphBuilder * iface)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return IUnknown_Release(_ICaptureGraphBuilder2_(This)); return IUnknown_Release(_ICaptureGraphBuilder2_(This));
} }
...@@ -386,7 +390,7 @@ static HRESULT WINAPI ...@@ -386,7 +390,7 @@ static HRESULT WINAPI
fnCaptureGraphBuilder_SetFiltergraph(ICaptureGraphBuilder * iface, fnCaptureGraphBuilder_SetFiltergraph(ICaptureGraphBuilder * iface,
IGraphBuilder *pfg) IGraphBuilder *pfg)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_SetFiltergraph(_ICaptureGraphBuilder2_(This), pfg); return ICaptureGraphBuilder2_SetFiltergraph(_ICaptureGraphBuilder2_(This), pfg);
} }
...@@ -395,7 +399,7 @@ static HRESULT WINAPI ...@@ -395,7 +399,7 @@ static HRESULT WINAPI
fnCaptureGraphBuilder_GetFiltergraph(ICaptureGraphBuilder * iface, fnCaptureGraphBuilder_GetFiltergraph(ICaptureGraphBuilder * iface,
IGraphBuilder **pfg) IGraphBuilder **pfg)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_GetFiltergraph(_ICaptureGraphBuilder2_(This), pfg); return ICaptureGraphBuilder2_GetFiltergraph(_ICaptureGraphBuilder2_(This), pfg);
} }
...@@ -405,7 +409,7 @@ fnCaptureGraphBuilder_SetOutputFileName(ICaptureGraphBuilder * iface, ...@@ -405,7 +409,7 @@ fnCaptureGraphBuilder_SetOutputFileName(ICaptureGraphBuilder * iface,
const GUID *pType, LPCOLESTR lpstrFile, const GUID *pType, LPCOLESTR lpstrFile,
IBaseFilter **ppf, IFileSinkFilter **ppSink) IBaseFilter **ppf, IFileSinkFilter **ppSink)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_SetOutputFileName(_ICaptureGraphBuilder2_(This), return ICaptureGraphBuilder2_SetOutputFileName(_ICaptureGraphBuilder2_(This),
pType, lpstrFile, ppf, ppSink); pType, lpstrFile, ppf, ppSink);
...@@ -416,7 +420,7 @@ fnCaptureGraphBuilder_FindInterface(ICaptureGraphBuilder * iface, ...@@ -416,7 +420,7 @@ fnCaptureGraphBuilder_FindInterface(ICaptureGraphBuilder * iface,
const GUID *pCategory, IBaseFilter *pf, const GUID *pCategory, IBaseFilter *pf,
REFIID riid, void **ppint) REFIID riid, void **ppint)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_FindInterface(_ICaptureGraphBuilder2_(This), return ICaptureGraphBuilder2_FindInterface(_ICaptureGraphBuilder2_(This),
pCategory, NULL, pf, riid, ppint); pCategory, NULL, pf, riid, ppint);
...@@ -427,7 +431,7 @@ fnCaptureGraphBuilder_RenderStream(ICaptureGraphBuilder * iface, ...@@ -427,7 +431,7 @@ fnCaptureGraphBuilder_RenderStream(ICaptureGraphBuilder * iface,
const GUID *pCategory, IUnknown *pSource, const GUID *pCategory, IUnknown *pSource,
IBaseFilter *pfCompressor, IBaseFilter *pfRenderer) IBaseFilter *pfCompressor, IBaseFilter *pfRenderer)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_RenderStream(_ICaptureGraphBuilder2_(This), return ICaptureGraphBuilder2_RenderStream(_ICaptureGraphBuilder2_(This),
pCategory, NULL, pSource, pCategory, NULL, pSource,
...@@ -440,7 +444,7 @@ fnCaptureGraphBuilder_ControlStream(ICaptureGraphBuilder * iface, ...@@ -440,7 +444,7 @@ fnCaptureGraphBuilder_ControlStream(ICaptureGraphBuilder * iface,
REFERENCE_TIME *pstart, REFERENCE_TIME *pstop, REFERENCE_TIME *pstart, REFERENCE_TIME *pstop,
WORD wStartCookie, WORD wStopCookie) WORD wStartCookie, WORD wStopCookie)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_ControlStream(_ICaptureGraphBuilder2_(This), return ICaptureGraphBuilder2_ControlStream(_ICaptureGraphBuilder2_(This),
pCategory, NULL, pFilter, pstart, pCategory, NULL, pFilter, pstart,
...@@ -451,7 +455,7 @@ static HRESULT WINAPI ...@@ -451,7 +455,7 @@ static HRESULT WINAPI
fnCaptureGraphBuilder_AllocCapFile(ICaptureGraphBuilder * iface, fnCaptureGraphBuilder_AllocCapFile(ICaptureGraphBuilder * iface,
LPCOLESTR lpstr, DWORDLONG dwlSize) LPCOLESTR lpstr, DWORDLONG dwlSize)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_AllocCapFile(_ICaptureGraphBuilder2_(This), return ICaptureGraphBuilder2_AllocCapFile(_ICaptureGraphBuilder2_(This),
lpstr, dwlSize); lpstr, dwlSize);
...@@ -463,7 +467,7 @@ fnCaptureGraphBuilder_CopyCaptureFile(ICaptureGraphBuilder * iface, ...@@ -463,7 +467,7 @@ fnCaptureGraphBuilder_CopyCaptureFile(ICaptureGraphBuilder * iface,
int fAllowEscAbort, int fAllowEscAbort,
IAMCopyCaptureFileProgress *pCallback) IAMCopyCaptureFileProgress *pCallback)
{ {
_ICOM_THIS_From_ICaptureGraphBuilder(CaptureGraphImpl, iface); CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
TRACE("%p --> Forwarding to v2 (%p)\n", iface, This); TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
return ICaptureGraphBuilder2_CopyCaptureFile(_ICaptureGraphBuilder2_(This), return ICaptureGraphBuilder2_CopyCaptureFile(_ICaptureGraphBuilder2_(This),
lpwstrOld, lpwstrNew, lpwstrOld, lpwstrNew,
......
...@@ -58,11 +58,10 @@ static const IAsyncReaderVtbl FileAsyncReader_Vtbl; ...@@ -58,11 +58,10 @@ static const IAsyncReaderVtbl FileAsyncReader_Vtbl;
static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
#define _IFileSourceFilter_Offset ((int)(&(((AsyncReader*)0)->lpVtblFSF))) static inline AsyncReader *impl_from_IFileSourceFilter( IFileSourceFilter *iface )
#define ICOM_THIS_From_IFileSourceFilter(impl, iface) impl* This = (impl*)(((char*)iface)-_IFileSourceFilter_Offset); {
return (AsyncReader *)((char*)iface - FIELD_OFFSET(AsyncReader, lpVtblFSF));
#define _IAsyncReader_Offset ((int)(&(((FileAsyncReader*)0)->lpVtblAR))) }
#define ICOM_THIS_From_IAsyncReader(impl, iface) impl* This = (impl*)(((char*)iface)-_IAsyncReader_Offset);
static HRESULT process_extensions(HKEY hkeyExtensions, LPCOLESTR pszFileName, GUID * majorType, GUID * minorType) static HRESULT process_extensions(HKEY hkeyExtensions, LPCOLESTR pszFileName, GUID * majorType, GUID * minorType)
{ {
...@@ -541,21 +540,21 @@ static const IBaseFilterVtbl AsyncReader_Vtbl = ...@@ -541,21 +540,21 @@ static const IBaseFilterVtbl AsyncReader_Vtbl =
static HRESULT WINAPI FileSource_QueryInterface(IFileSourceFilter * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI FileSource_QueryInterface(IFileSourceFilter * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_IFileSourceFilter(AsyncReader, iface); AsyncReader *This = impl_from_IFileSourceFilter(iface);
return IBaseFilter_QueryInterface((IFileSourceFilter*)&This->lpVtbl, riid, ppv); return IBaseFilter_QueryInterface((IFileSourceFilter*)&This->lpVtbl, riid, ppv);
} }
static ULONG WINAPI FileSource_AddRef(IFileSourceFilter * iface) static ULONG WINAPI FileSource_AddRef(IFileSourceFilter * iface)
{ {
ICOM_THIS_From_IFileSourceFilter(AsyncReader, iface); AsyncReader *This = impl_from_IFileSourceFilter(iface);
return IBaseFilter_AddRef((IFileSourceFilter*)&This->lpVtbl); return IBaseFilter_AddRef((IFileSourceFilter*)&This->lpVtbl);
} }
static ULONG WINAPI FileSource_Release(IFileSourceFilter * iface) static ULONG WINAPI FileSource_Release(IFileSourceFilter * iface)
{ {
ICOM_THIS_From_IFileSourceFilter(AsyncReader, iface); AsyncReader *This = impl_from_IFileSourceFilter(iface);
return IBaseFilter_Release((IFileSourceFilter*)&This->lpVtbl); return IBaseFilter_Release((IFileSourceFilter*)&This->lpVtbl);
} }
...@@ -565,7 +564,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi ...@@ -565,7 +564,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
HRESULT hr; HRESULT hr;
HANDLE hFile; HANDLE hFile;
IAsyncReader * pReader = NULL; IAsyncReader * pReader = NULL;
ICOM_THIS_From_IFileSourceFilter(AsyncReader, iface); AsyncReader *This = impl_from_IFileSourceFilter(iface);
TRACE("(%s, %p)\n", debugstr_w(pszFileName), pmt); TRACE("(%s, %p)\n", debugstr_w(pszFileName), pmt);
...@@ -634,7 +633,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi ...@@ -634,7 +633,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
static HRESULT WINAPI FileSource_GetCurFile(IFileSourceFilter * iface, LPOLESTR * ppszFileName, AM_MEDIA_TYPE * pmt) static HRESULT WINAPI FileSource_GetCurFile(IFileSourceFilter * iface, LPOLESTR * ppszFileName, AM_MEDIA_TYPE * pmt)
{ {
ICOM_THIS_From_IFileSourceFilter(AsyncReader, iface); AsyncReader *This = impl_from_IFileSourceFilter(iface);
TRACE("(%p, %p)\n", ppszFileName, pmt); TRACE("(%p, %p)\n", ppszFileName, pmt);
...@@ -697,6 +696,11 @@ typedef struct FileAsyncReader ...@@ -697,6 +696,11 @@ typedef struct FileAsyncReader
CRITICAL_SECTION csList; /* critical section to protect operations on list */ CRITICAL_SECTION csList; /* critical section to protect operations on list */
} FileAsyncReader; } FileAsyncReader;
static inline FileAsyncReader *impl_from_IAsyncReader( IAsyncReader *iface )
{
return (FileAsyncReader *)((char*)iface - FIELD_OFFSET(FileAsyncReader, lpVtblAR));
}
static HRESULT AcceptProcAFR(LPVOID iface, const AM_MEDIA_TYPE *pmt) static HRESULT AcceptProcAFR(LPVOID iface, const AM_MEDIA_TYPE *pmt)
{ {
AsyncReader *This = (AsyncReader *)iface; AsyncReader *This = (AsyncReader *)iface;
...@@ -865,21 +869,21 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter ...@@ -865,21 +869,21 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter
static HRESULT WINAPI FileAsyncReader_QueryInterface(IAsyncReader * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI FileAsyncReader_QueryInterface(IAsyncReader * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
return IPin_QueryInterface((IPin *)This, riid, ppv); return IPin_QueryInterface((IPin *)This, riid, ppv);
} }
static ULONG WINAPI FileAsyncReader_AddRef(IAsyncReader * iface) static ULONG WINAPI FileAsyncReader_AddRef(IAsyncReader * iface)
{ {
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
return IPin_AddRef((IPin *)This); return IPin_AddRef((IPin *)This);
} }
static ULONG WINAPI FileAsyncReader_Release(IAsyncReader * iface) static ULONG WINAPI FileAsyncReader_Release(IAsyncReader * iface)
{ {
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
return IPin_Release((IPin *)This); return IPin_Release((IPin *)This);
} }
...@@ -947,7 +951,7 @@ static HRESULT WINAPI FileAsyncReader_Request(IAsyncReader * iface, IMediaSample ...@@ -947,7 +951,7 @@ static HRESULT WINAPI FileAsyncReader_Request(IAsyncReader * iface, IMediaSample
DATAREQUEST * pDataRq; DATAREQUEST * pDataRq;
BYTE * pBuffer; BYTE * pBuffer;
HRESULT hr = S_OK; HRESULT hr = S_OK;
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
TRACE("(%p, %lx)\n", pSample, dwUser); TRACE("(%p, %lx)\n", pSample, dwUser);
...@@ -1025,7 +1029,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw ...@@ -1025,7 +1029,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
{ {
HRESULT hr = S_OK; HRESULT hr = S_OK;
DATAREQUEST * pDataRq = NULL; DATAREQUEST * pDataRq = NULL;
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
TRACE("(%lu, %p, %p)\n", dwTimeout, ppSample, pdwUser); TRACE("(%lu, %p, %p)\n", dwTimeout, ppSample, pdwUser);
...@@ -1115,7 +1119,7 @@ static HRESULT WINAPI FileAsyncReader_SyncRead(IAsyncReader * iface, LONGLONG ll ...@@ -1115,7 +1119,7 @@ static HRESULT WINAPI FileAsyncReader_SyncRead(IAsyncReader * iface, LONGLONG ll
{ {
OVERLAPPED ovl; OVERLAPPED ovl;
HRESULT hr = S_OK; HRESULT hr = S_OK;
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
TRACE("(%lx%08lx, %ld, %p)\n", (ULONG)(llPosition >> 32), (ULONG)llPosition, lLength, pBuffer); TRACE("(%lx%08lx, %ld, %p)\n", (ULONG)(llPosition >> 32), (ULONG)llPosition, lLength, pBuffer);
...@@ -1150,7 +1154,7 @@ static HRESULT WINAPI FileAsyncReader_Length(IAsyncReader * iface, LONGLONG * pT ...@@ -1150,7 +1154,7 @@ static HRESULT WINAPI FileAsyncReader_Length(IAsyncReader * iface, LONGLONG * pT
{ {
DWORD dwSizeLow; DWORD dwSizeLow;
DWORD dwSizeHigh; DWORD dwSizeHigh;
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
TRACE("(%p, %p)\n", pTotal, pAvailable); TRACE("(%p, %p)\n", pTotal, pAvailable);
...@@ -1167,7 +1171,7 @@ static HRESULT WINAPI FileAsyncReader_Length(IAsyncReader * iface, LONGLONG * pT ...@@ -1167,7 +1171,7 @@ static HRESULT WINAPI FileAsyncReader_Length(IAsyncReader * iface, LONGLONG * pT
static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface) static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface)
{ {
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
TRACE("()\n"); TRACE("()\n");
...@@ -1182,7 +1186,7 @@ static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface) ...@@ -1182,7 +1186,7 @@ static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface)
static HRESULT WINAPI FileAsyncReader_EndFlush(IAsyncReader * iface) static HRESULT WINAPI FileAsyncReader_EndFlush(IAsyncReader * iface)
{ {
ICOM_THIS_From_IAsyncReader(FileAsyncReader, iface); FileAsyncReader *This = impl_from_IAsyncReader(iface);
TRACE("()\n"); TRACE("()\n");
......
...@@ -52,8 +52,10 @@ typedef struct FilterMapper2Impl ...@@ -52,8 +52,10 @@ typedef struct FilterMapper2Impl
static const IFilterMapper2Vtbl fm2vtbl; static const IFilterMapper2Vtbl fm2vtbl;
static const IFilterMapperVtbl fmvtbl; static const IFilterMapperVtbl fmvtbl;
#define _IFilterMapper_Offset ((int)(&(((FilterMapper2Impl*)0)->lpVtblFilterMapper))) static inline FilterMapper2Impl *impl_from_IFilterMapper( IFilterMapper *iface )
#define ICOM_THIS_From_IFilterMapper(impl, iface) impl* This = (impl*)(((char*)iface)-_IFilterMapper_Offset) {
return (FilterMapper2Impl *)((char*)iface - FIELD_OFFSET(FilterMapper2Impl, lpVtblFilterMapper));
}
static const WCHAR wszClsidSlash[] = {'C','L','S','I','D','\\',0}; static const WCHAR wszClsidSlash[] = {'C','L','S','I','D','\\',0};
static const WCHAR wszSlashInstance[] = {'\\','I','n','s','t','a','n','c','e','\\',0}; static const WCHAR wszSlashInstance[] = {'\\','I','n','s','t','a','n','c','e','\\',0};
...@@ -1053,7 +1055,7 @@ static const IFilterMapper2Vtbl fm2vtbl = ...@@ -1053,7 +1055,7 @@ static const IFilterMapper2Vtbl fm2vtbl =
static HRESULT WINAPI FilterMapper_QueryInterface(IFilterMapper * iface, REFIID riid, LPVOID *ppv) static HRESULT WINAPI FilterMapper_QueryInterface(IFilterMapper * iface, REFIID riid, LPVOID *ppv)
{ {
ICOM_THIS_From_IFilterMapper(FilterMapper2Impl, iface); FilterMapper2Impl *This = impl_from_IFilterMapper(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv); TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
...@@ -1062,14 +1064,14 @@ static HRESULT WINAPI FilterMapper_QueryInterface(IFilterMapper * iface, REFIID ...@@ -1062,14 +1064,14 @@ static HRESULT WINAPI FilterMapper_QueryInterface(IFilterMapper * iface, REFIID
static ULONG WINAPI FilterMapper_AddRef(IFilterMapper * iface) static ULONG WINAPI FilterMapper_AddRef(IFilterMapper * iface)
{ {
ICOM_THIS_From_IFilterMapper(FilterMapper2Impl, iface); FilterMapper2Impl *This = impl_from_IFilterMapper(iface);
return FilterMapper2_AddRef((IFilterMapper2*)This); return FilterMapper2_AddRef((IFilterMapper2*)This);
} }
static ULONG WINAPI FilterMapper_Release(IFilterMapper * iface) static ULONG WINAPI FilterMapper_Release(IFilterMapper * iface)
{ {
ICOM_THIS_From_IFilterMapper(FilterMapper2Impl, iface); FilterMapper2Impl *This = impl_from_IFilterMapper(iface);
return FilterMapper2_Release((IFilterMapper2*)This); return FilterMapper2_Release((IFilterMapper2*)This);
} }
...@@ -1088,7 +1090,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( ...@@ -1088,7 +1090,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
CLSID clsOutMaj, CLSID clsOutMaj,
CLSID clsOutSub) CLSID clsOutSub)
{ {
ICOM_THIS_From_IFilterMapper(FilterMapper2Impl, iface); FilterMapper2Impl *This = impl_from_IFilterMapper(iface);
GUID InputType[2]; GUID InputType[2];
GUID OutputType[2]; GUID OutputType[2];
IEnumMoniker* ppEnumMoniker; IEnumMoniker* ppEnumMoniker;
......
...@@ -54,8 +54,11 @@ static HRESULT Parser_ChangeRate(LPVOID iface); ...@@ -54,8 +54,11 @@ static HRESULT Parser_ChangeRate(LPVOID iface);
static HRESULT Parser_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); static HRESULT Parser_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
#define _IMediaSeeking_Offset ((int)(&(((Parser_OutputPin*)0)->mediaSeeking))) static inline Parser_OutputPin *impl_from_IMediaSeeking( IMediaSeeking *iface )
#define ICOM_THIS_From_IMediaSeeking(impl, iface) impl* This = (impl*)(((char*)iface)-_IMediaSeeking_Offset); {
return (Parser_OutputPin *)((char*)iface - FIELD_OFFSET(Parser_OutputPin, mediaSeeking.lpVtbl));
}
HRESULT Parser_Create(ParserImpl* pParser, const CLSID* pClsid, PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect) HRESULT Parser_Create(ParserImpl* pParser, const CLSID* pClsid, PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect)
{ {
...@@ -550,21 +553,21 @@ static HRESULT Parser_ChangeRate(LPVOID iface) ...@@ -550,21 +553,21 @@ static HRESULT Parser_ChangeRate(LPVOID iface)
static HRESULT WINAPI Parser_Seeking_QueryInterface(IMediaSeeking * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI Parser_Seeking_QueryInterface(IMediaSeeking * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_IMediaSeeking(Parser_OutputPin, iface); Parser_OutputPin *This = impl_from_IMediaSeeking(iface);
return IUnknown_QueryInterface((IUnknown *)This, riid, ppv); return IUnknown_QueryInterface((IUnknown *)This, riid, ppv);
} }
static ULONG WINAPI Parser_Seeking_AddRef(IMediaSeeking * iface) static ULONG WINAPI Parser_Seeking_AddRef(IMediaSeeking * iface)
{ {
ICOM_THIS_From_IMediaSeeking(Parser_OutputPin, iface); Parser_OutputPin *This = impl_from_IMediaSeeking(iface);
return IUnknown_AddRef((IUnknown *)This); return IUnknown_AddRef((IUnknown *)This);
} }
static ULONG WINAPI Parser_Seeking_Release(IMediaSeeking * iface) static ULONG WINAPI Parser_Seeking_Release(IMediaSeeking * iface)
{ {
ICOM_THIS_From_IMediaSeeking(Parser_OutputPin, iface); Parser_OutputPin *This = impl_from_IMediaSeeking(iface);
return IUnknown_Release((IUnknown *)This); return IUnknown_Release((IUnknown *)This);
} }
......
...@@ -37,8 +37,11 @@ static const IPinVtbl PullPin_Vtbl; ...@@ -37,8 +37,11 @@ static const IPinVtbl PullPin_Vtbl;
#define ALIGNDOWN(value,boundary) ((value) & ~(boundary-1)) #define ALIGNDOWN(value,boundary) ((value) & ~(boundary-1))
#define ALIGNUP(value,boundary) (ALIGNDOWN(value - 1, boundary) + boundary) #define ALIGNUP(value,boundary) (ALIGNDOWN(value - 1, boundary) + boundary)
#define _IMemInputPin_Offset ((int)(&(((InputPin*)0)->lpVtblMemInput))) static inline InputPin *impl_from_IMemInputPin( IMemInputPin *iface )
#define ICOM_THIS_From_IMemInputPin(impl, iface) impl* This = (impl*)(((char*)iface)-_IMemInputPin_Offset); {
return (InputPin *)((char*)iface - FIELD_OFFSET(InputPin, lpVtblMemInput));
}
static void Copy_PinInfo(PIN_INFO * pDest, const PIN_INFO * pSrc) static void Copy_PinInfo(PIN_INFO * pDest, const PIN_INFO * pSrc)
{ {
...@@ -529,28 +532,28 @@ static const IPinVtbl InputPin_Vtbl = ...@@ -529,28 +532,28 @@ static const IPinVtbl InputPin_Vtbl =
HRESULT WINAPI MemInputPin_QueryInterface(IMemInputPin * iface, REFIID riid, LPVOID * ppv) HRESULT WINAPI MemInputPin_QueryInterface(IMemInputPin * iface, REFIID riid, LPVOID * ppv)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
return IPin_QueryInterface((IPin *)&This->pin, riid, ppv); return IPin_QueryInterface((IPin *)&This->pin, riid, ppv);
} }
ULONG WINAPI MemInputPin_AddRef(IMemInputPin * iface) ULONG WINAPI MemInputPin_AddRef(IMemInputPin * iface)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
return IPin_AddRef((IPin *)&This->pin); return IPin_AddRef((IPin *)&This->pin);
} }
ULONG WINAPI MemInputPin_Release(IMemInputPin * iface) ULONG WINAPI MemInputPin_Release(IMemInputPin * iface)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
return IPin_Release((IPin *)&This->pin); return IPin_Release((IPin *)&This->pin);
} }
HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** ppAllocator) HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** ppAllocator)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, ppAllocator); TRACE("(%p/%p)->(%p)\n", This, iface, ppAllocator);
...@@ -563,7 +566,7 @@ HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** p ...@@ -563,7 +566,7 @@ HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** p
HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * pAllocator, BOOL bReadOnly) HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * pAllocator, BOOL bReadOnly)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p, %d)\n", This, iface, pAllocator, bReadOnly); TRACE("(%p/%p)->(%p, %d)\n", This, iface, pAllocator, bReadOnly);
...@@ -578,7 +581,7 @@ HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * ...@@ -578,7 +581,7 @@ HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator *
HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCATOR_PROPERTIES * pProps) HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCATOR_PROPERTIES * pProps)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, pProps); TRACE("(%p/%p)->(%p)\n", This, iface, pProps);
...@@ -589,7 +592,7 @@ HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCA ...@@ -589,7 +592,7 @@ HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCA
HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample) HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
/* this trace commented out for performance reasons */ /* this trace commented out for performance reasons */
/*TRACE("(%p/%p)->(%p)\n", This, iface, pSample);*/ /*TRACE("(%p/%p)->(%p)\n", This, iface, pSample);*/
...@@ -600,7 +603,7 @@ HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample) ...@@ -600,7 +603,7 @@ HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample)
HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** pSamples, long nSamples, long *nSamplesProcessed) HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** pSamples, long nSamples, long *nSamplesProcessed)
{ {
HRESULT hr = S_OK; HRESULT hr = S_OK;
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p, %ld, %p)\n", This, iface, pSamples, nSamples, nSamplesProcessed); TRACE("(%p/%p)->(%p, %ld, %p)\n", This, iface, pSamples, nSamples, nSamplesProcessed);
...@@ -616,7 +619,7 @@ HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** ...@@ -616,7 +619,7 @@ HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample **
HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface) HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface)
{ {
ICOM_THIS_From_IMemInputPin(InputPin, iface); InputPin *This = impl_from_IMemInputPin(iface);
FIXME("(%p/%p)->()\n", This, iface); FIXME("(%p/%p)->()\n", This, iface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment