Commit b1a9701b authored by Alexandre Julliard's avatar Alexandre Julliard

Replace the _ICOM_THIS_From macros by inline functions the way it's

already done in shelllink.c.
parent 54508df5
......@@ -55,6 +55,16 @@ typedef struct
} IShellBrowserImpl;
static inline IShellBrowserImpl *impl_from_ICommDlgBrowser( ICommDlgBrowser *iface )
{
return (IShellBrowserImpl *)((char*)iface - FIELD_OFFSET(IShellBrowserImpl, lpVtblCommDlgBrowser));
}
static inline IShellBrowserImpl *impl_from_IServiceProvider( IServiceProvider *iface )
{
return (IShellBrowserImpl *)((char*)iface - FIELD_OFFSET(IShellBrowserImpl, lpVtblServiceProvider));
}
/**************************************************************************
* vtable
*/
......@@ -728,11 +738,11 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppvObj);
}
/**************************************************************************
......@@ -740,11 +750,11 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
*/
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
{
_ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
return IShellBrowserImpl_AddRef(This);
return IShellBrowserImpl_AddRef((IShellBrowser *)This);
}
/**************************************************************************
......@@ -752,11 +762,11 @@ static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * i
*/
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
{
_ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
return IShellBrowserImpl_Release(This);
return IShellBrowserImpl_Release((IShellBrowser *)This);
}
/**************************************************************************
......@@ -770,7 +780,7 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDl
LPITEMIDLIST pidl;
FileOpenDlgInfos *fodInfos;
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
......@@ -812,7 +822,7 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBr
ULONG uChange)
{
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p shv=%p)\n", This, ppshv);
......@@ -855,7 +865,7 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBr
STRRET str;
WCHAR szPathW[MAX_PATH];
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
TRACE("(%p)\n", This);
......@@ -895,7 +905,7 @@ static HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *if
{
FileOpenDlgInfos *fodInfos;
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
......@@ -942,11 +952,11 @@ static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n", This);
return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppvObj);
}
/**************************************************************************
......@@ -954,11 +964,11 @@ static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
*/
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
{
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n", This);
return IShellBrowserImpl_AddRef(This);
return IShellBrowserImpl_AddRef((IShellBrowser *)This);
}
/**************************************************************************
......@@ -966,11 +976,11 @@ static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider *
*/
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
{
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n", This);
return IShellBrowserImpl_Release(This);
return IShellBrowserImpl_Release((IShellBrowser *)This);
}
/**************************************************************************
......@@ -990,14 +1000,14 @@ static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
REFIID riid,
void** ppv)
{
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
*ppv = NULL;
if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
{
return IShellBrowserImpl_QueryInterface(This,riid,ppv);
return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppv);
}
FIXME("(%p) unknown interface requested\n", This);
return E_NOINTERFACE;
......
......@@ -37,11 +37,6 @@
/***********************************************************************
* Defines and global variables
*/
#define _ICommDlgBrowser_Offset ((int)(&(((IShellBrowserImpl*)0)->lpVtblCommDlgBrowser)))
#define _ICOM_THIS_FromICommDlgBrowser(class, name) class* This = (class*)(((char*)name)-_ICommDlgBrowser_Offset);
#define _IServiceProvider_Offset ((int)(&(((IShellBrowserImpl*)0)->lpVtblServiceProvider)))
#define _ICOM_THIS_FromIServiceProvider(class, name) class* This = (class*)(((char*)name)-_IServiceProvider_Offset);
/* dialog internal property */
......
......@@ -53,6 +53,11 @@ typedef struct AntiMonikerImpl{
} AntiMonikerImpl;
static inline IMoniker *impl_from_IROTData( IROTData *iface )
{
return (IMoniker *)((char*)iface - FIELD_OFFSET(AntiMonikerImpl, lpvtbl2));
}
/*******************************************************************************
* AntiMoniker_QueryInterface
......@@ -485,7 +490,7 @@ AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
static HRESULT WINAPI
AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
......@@ -497,7 +502,7 @@ AntiMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObje
*/
static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
......@@ -509,7 +514,7 @@ static ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface)
*/
static ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
......
......@@ -80,6 +80,10 @@ typedef struct EnumMonikerImpl{
} EnumMonikerImpl;
static inline IMoniker *impl_from_IROTData( IROTData *iface )
{
return (IMoniker *)((char*)iface - FIELD_OFFSET(CompositeMonikerImpl, lpvtbl2));
}
static HRESULT EnumMonikerImpl_CreateEnumMoniker(IMoniker** tabMoniker,ULONG tabSize,ULONG currentPos,BOOL leftToRigth,IEnumMoniker ** ppmk);
......@@ -1208,7 +1212,7 @@ CompositeMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,
VOID** ppvObject)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
......@@ -1221,7 +1225,7 @@ CompositeMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,
static ULONG WINAPI
CompositeMonikerROTDataImpl_AddRef(IROTData *iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
......@@ -1233,7 +1237,7 @@ CompositeMonikerROTDataImpl_AddRef(IROTData *iface)
*/
static ULONG WINAPI CompositeMonikerROTDataImpl_Release(IROTData* iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
......
......@@ -147,14 +147,22 @@ static const ISupportErrorInfoVtbl ISupportErrorInfoImpl_VTable;
/*
converts an object pointer to This
*/
#define _IErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtei)))
#define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset)
#define _ICreateErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtcei)))
#define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset)
static inline ErrorInfoImpl *impl_from_IErrorInfo( IErrorInfo *iface )
{
return (ErrorInfoImpl *)((char*)iface - FIELD_OFFSET(ErrorInfoImpl, lpvtei));
}
static inline ErrorInfoImpl *impl_from_ICreateErrorInfo( ICreateErrorInfo *iface )
{
return (ErrorInfoImpl *)((char*)iface - FIELD_OFFSET(ErrorInfoImpl, lpvtcei));
}
static inline ErrorInfoImpl *impl_from_ISupportErrorInfo( ISupportErrorInfo *iface )
{
return (ErrorInfoImpl *)((char*)iface - FIELD_OFFSET(ErrorInfoImpl, lpvtsei));
}
#define _ISupportErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtsei)))
#define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset)
/*
converts This to an object pointer
......@@ -186,7 +194,7 @@ static HRESULT WINAPI IErrorInfoImpl_QueryInterface(
REFIID riid,
VOID** ppvoid)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvoid);
*ppvoid = NULL;
......@@ -217,7 +225,7 @@ static HRESULT WINAPI IErrorInfoImpl_QueryInterface(
static ULONG WINAPI IErrorInfoImpl_AddRef(
IErrorInfo* iface)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
return InterlockedIncrement(&This->ref);
}
......@@ -225,7 +233,7 @@ static ULONG WINAPI IErrorInfoImpl_AddRef(
static ULONG WINAPI IErrorInfoImpl_Release(
IErrorInfo* iface)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(count=%lu)\n",This,ref+1);
......@@ -243,7 +251,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetGUID(
IErrorInfo* iface,
GUID * pGUID)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
if(!pGUID )return E_INVALIDARG;
memcpy(pGUID, &This->m_Guid, sizeof(GUID));
......@@ -254,7 +262,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetSource(
IErrorInfo* iface,
BSTR *pBstrSource)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
TRACE("(%p)->(pBstrSource=%p)\n",This,pBstrSource);
if (pBstrSource == NULL)
return E_INVALIDARG;
......@@ -266,7 +274,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetDescription(
IErrorInfo* iface,
BSTR *pBstrDescription)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
TRACE("(%p)->(pBstrDescription=%p)\n",This,pBstrDescription);
if (pBstrDescription == NULL)
......@@ -280,7 +288,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetHelpFile(
IErrorInfo* iface,
BSTR *pBstrHelpFile)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
TRACE("(%p)->(pBstrHelpFile=%p)\n",This, pBstrHelpFile);
if (pBstrHelpFile == NULL)
......@@ -294,7 +302,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetHelpContext(
IErrorInfo* iface,
DWORD *pdwHelpContext)
{
_ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_IErrorInfo(iface);
TRACE("(%p)->(pdwHelpContext=%p)\n",This, pdwHelpContext);
if (pdwHelpContext == NULL)
return E_INVALIDARG;
......@@ -322,7 +330,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_QueryInterface(
REFIID riid,
VOID** ppvoid)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p)\n", This);
return IErrorInfo_QueryInterface(_IErrorInfo_(This), riid, ppvoid);
}
......@@ -330,7 +338,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_QueryInterface(
static ULONG WINAPI ICreateErrorInfoImpl_AddRef(
ICreateErrorInfo* iface)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p)\n", This);
return IErrorInfo_AddRef(_IErrorInfo_(This));
}
......@@ -338,7 +346,7 @@ static ULONG WINAPI ICreateErrorInfoImpl_AddRef(
static ULONG WINAPI ICreateErrorInfoImpl_Release(
ICreateErrorInfo* iface)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p)\n", This);
return IErrorInfo_Release(_IErrorInfo_(This));
}
......@@ -348,7 +356,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetGUID(
ICreateErrorInfo* iface,
REFGUID rguid)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p)->(%s)\n", This, debugstr_guid(rguid));
memcpy(&This->m_Guid, rguid, sizeof(GUID));
return S_OK;
......@@ -358,7 +366,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetSource(
ICreateErrorInfo* iface,
LPOLESTR szSource)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p): %s\n",This, debugstr_w(szSource));
if (This->bstrSource != NULL)
ERRORINFO_SysFreeString(This->bstrSource);
......@@ -371,7 +379,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetDescription(
ICreateErrorInfo* iface,
LPOLESTR szDescription)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p): %s\n",This, debugstr_w(szDescription));
if (This->bstrDescription != NULL)
ERRORINFO_SysFreeString(This->bstrDescription);
......@@ -384,7 +392,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetHelpFile(
ICreateErrorInfo* iface,
LPOLESTR szHelpFile)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p,%s)\n",This,debugstr_w(szHelpFile));
if (This->bstrHelpFile != NULL)
ERRORINFO_SysFreeString(This->bstrHelpFile);
......@@ -396,7 +404,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetHelpContext(
ICreateErrorInfo* iface,
DWORD dwHelpContext)
{
_ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface);
TRACE("(%p,%ld)\n",This,dwHelpContext);
This->m_dwHelpContext = dwHelpContext;
return S_OK;
......@@ -420,7 +428,7 @@ static HRESULT WINAPI ISupportErrorInfoImpl_QueryInterface(
REFIID riid,
VOID** ppvoid)
{
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ISupportErrorInfo(iface);
TRACE("(%p)\n", This);
return IErrorInfo_QueryInterface(_IErrorInfo_(This), riid, ppvoid);
......@@ -429,7 +437,7 @@ static HRESULT WINAPI ISupportErrorInfoImpl_QueryInterface(
static ULONG WINAPI ISupportErrorInfoImpl_AddRef(
ISupportErrorInfo* iface)
{
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ISupportErrorInfo(iface);
TRACE("(%p)\n", This);
return IErrorInfo_AddRef(_IErrorInfo_(This));
}
......@@ -437,7 +445,7 @@ static ULONG WINAPI ISupportErrorInfoImpl_AddRef(
static ULONG WINAPI ISupportErrorInfoImpl_Release(
ISupportErrorInfo* iface)
{
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ISupportErrorInfo(iface);
TRACE("(%p)\n", This);
return IErrorInfo_Release(_IErrorInfo_(This));
}
......@@ -447,7 +455,7 @@ static HRESULT WINAPI ISupportErrorInfoImpl_InterfaceSupportsErrorInfo(
ISupportErrorInfo* iface,
REFIID riid)
{
_ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface);
ErrorInfoImpl *This = impl_from_ISupportErrorInfo(iface);
TRACE("(%p)->(%s)\n", This, debugstr_guid(riid));
return (IsEqualIID(riid, &This->m_Guid)) ? S_OK : S_FALSE;
}
......
......@@ -60,6 +60,11 @@ typedef struct FileMonikerImpl{
IUnknown *pMarshal; /* custom marshaler */
} FileMonikerImpl;
static inline IMoniker *impl_from_IROTData( IROTData *iface )
{
return (IMoniker *)((char*)iface - FIELD_OFFSET(FileMonikerImpl, lpvtbl2));
}
/* Local function used by filemoniker implementation */
static HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* iface, LPCOLESTR lpszPathName);
static HRESULT WINAPI FileMonikerImpl_Destroy(FileMonikerImpl* iface);
......@@ -1198,7 +1203,7 @@ static HRESULT WINAPI
FileMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
......@@ -1211,7 +1216,7 @@ FileMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObje
static ULONG WINAPI
FileMonikerROTDataImpl_AddRef(IROTData *iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",This);
......@@ -1224,7 +1229,7 @@ FileMonikerROTDataImpl_AddRef(IROTData *iface)
static ULONG WINAPI
FileMonikerROTDataImpl_Release(IROTData* iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",This);
......@@ -1238,7 +1243,7 @@ static HRESULT WINAPI
FileMonikerROTDataImpl_GetComparisonData(IROTData* iface, BYTE* pbData,
ULONG cbMax, ULONG* pcbData)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
FileMonikerImpl *This1 = (FileMonikerImpl *)This;
int len = (strlenW(This1->filePathName)+1);
int i;
......
......@@ -47,8 +47,10 @@ typedef struct _FTMarshalImpl {
#define _IFTMUnknown_(This)(IUnknown*)&(This->lpVtbl)
#define _IFTMarshal_(This) (IMarshal*)&(This->lpvtblFTM)
#define _IFTMarshall_Offset ((int)(&(((FTMarshalImpl*)0)->lpvtblFTM)))
#define _ICOM_THIS_From_IFTMarshal(class, name) class* This = (class*)(((char*)name)-_IFTMarshall_Offset);
static inline FTMarshalImpl *impl_from_IMarshal( IMarshal *iface )
{
return (FTMarshalImpl *)((char*)iface - FIELD_OFFSET(FTMarshalImpl, lpvtblFTM));
}
/* inner IUnknown to handle aggregation */
static HRESULT WINAPI
......@@ -104,7 +106,7 @@ static HRESULT WINAPI
FTMarshalImpl_QueryInterface (LPMARSHAL iface, REFIID riid, LPVOID * ppv)
{
_ICOM_THIS_From_IFTMarshal (FTMarshalImpl, iface);
FTMarshalImpl *This = impl_from_IMarshal(iface);
TRACE ("(%p)->(\n\tIID:\t%s,%p)\n", This, debugstr_guid (riid), ppv);
return IUnknown_QueryInterface (This->pUnkOuter, riid, ppv);
......@@ -114,7 +116,7 @@ static ULONG WINAPI
FTMarshalImpl_AddRef (LPMARSHAL iface)
{
_ICOM_THIS_From_IFTMarshal (FTMarshalImpl, iface);
FTMarshalImpl *This = impl_from_IMarshal(iface);
TRACE ("\n");
return IUnknown_AddRef (This->pUnkOuter);
......@@ -124,7 +126,7 @@ static ULONG WINAPI
FTMarshalImpl_Release (LPMARSHAL iface)
{
_ICOM_THIS_From_IFTMarshal (FTMarshalImpl, iface);
FTMarshalImpl *This = impl_from_IMarshal(iface);
TRACE ("\n");
return IUnknown_Release (This->pUnkOuter);
......@@ -146,7 +148,7 @@ FTMarshalImpl_GetMarshalSizeMax (LPMARSHAL iface, REFIID riid, void *pv, DWORD d
IMarshal *pMarshal = NULL;
HRESULT hres;
_ICOM_THIS_From_IFTMarshal (FTMarshalImpl, iface);
FTMarshalImpl *This = impl_from_IMarshal(iface);
FIXME ("(), stub!\n");
......@@ -172,7 +174,7 @@ FTMarshalImpl_MarshalInterface (LPMARSHAL iface, IStream * pStm, REFIID riid, vo
IMarshal *pMarshal = NULL;
HRESULT hres;
_ICOM_THIS_From_IFTMarshal (FTMarshalImpl, iface);
FTMarshalImpl *This = impl_from_IMarshal(iface);
FIXME ("(), stub!\n");
......
......@@ -61,6 +61,11 @@ typedef struct ItemMonikerImpl{
IUnknown *pMarshal; /* custom marshaler */
} ItemMonikerImpl;
static inline IMoniker *impl_from_IROTData( IROTData *iface )
{
return (IMoniker *)((char*)iface - FIELD_OFFSET(ItemMonikerImpl, lpvtbl2));
}
/********************************************************************************/
/* ItemMoniker prototype functions : */
......@@ -929,7 +934,7 @@ HRESULT WINAPI ItemMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
HRESULT WINAPI ItemMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid,VOID** ppvObject)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p,%p,%p)\n",iface,riid,ppvObject);
......@@ -941,7 +946,7 @@ HRESULT WINAPI ItemMonikerROTDataImpl_QueryInterface(IROTData *iface,REFIID riid
*/
ULONG WINAPI ItemMonikerROTDataImpl_AddRef(IROTData *iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
......@@ -953,7 +958,7 @@ ULONG WINAPI ItemMonikerROTDataImpl_AddRef(IROTData *iface)
*/
ULONG WINAPI ItemMonikerROTDataImpl_Release(IROTData* iface)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
TRACE("(%p)\n",iface);
......@@ -968,7 +973,7 @@ HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData* iface,
ULONG cbMax,
ULONG* pcbData)
{
ICOM_THIS_From_IROTData(IMoniker, iface);
IMoniker *This = impl_from_IROTData(iface);
ItemMonikerImpl *This1 = (ItemMonikerImpl *)This;
int len = (strlenW(This1->itemName)+1);
int i;
......
......@@ -981,8 +981,6 @@ static HRESULT WINAPI EnumMonikerImpl_CreateEnumROTMoniker(MInterfacePointer **m
/* Shared implementation of moniker marshaler based on saving and loading of
* monikers */
#define ICOM_THIS_From_IMoniker(class, name) class* This = (class*)(((char*)name)-FIELD_OFFSET(class, lpVtblMarshal))
typedef struct MonikerMarshal
{
const IUnknownVtbl *lpVtbl;
......@@ -992,6 +990,11 @@ typedef struct MonikerMarshal
IMoniker *moniker;
} MonikerMarshal;
static inline MonikerMarshal *impl_from_IMarshal( IMarshal *iface )
{
return (MonikerMarshal *)((char*)iface - FIELD_OFFSET(MonikerMarshal, lpVtblMarshal));
}
static HRESULT WINAPI MonikerMarshalInner_QueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppv)
{
MonikerMarshal *This = (MonikerMarshal *)iface;
......@@ -1031,19 +1034,19 @@ static const IUnknownVtbl VT_MonikerMarshalInner =
static HRESULT WINAPI MonikerMarshal_QueryInterface(IMarshal *iface, REFIID riid, LPVOID *ppv)
{
ICOM_THIS_From_IMoniker(MonikerMarshal, iface);
MonikerMarshal *This = impl_from_IMarshal(iface);
return IMoniker_QueryInterface(This->moniker, riid, ppv);
}
static ULONG WINAPI MonikerMarshal_AddRef(IMarshal *iface)
{
ICOM_THIS_From_IMoniker(MonikerMarshal, iface);
MonikerMarshal *This = impl_from_IMarshal(iface);
return IMoniker_AddRef(This->moniker);
}
static ULONG WINAPI MonikerMarshal_Release(IMarshal *iface)
{
ICOM_THIS_From_IMoniker(MonikerMarshal, iface);
MonikerMarshal *This = impl_from_IMarshal(iface);
return IMoniker_Release(This->moniker);
}
......@@ -1051,7 +1054,7 @@ static HRESULT WINAPI MonikerMarshal_GetUnmarshalClass(
LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags, CLSID* pCid)
{
ICOM_THIS_From_IMoniker(MonikerMarshal, iface);
MonikerMarshal *This = impl_from_IMarshal(iface);
TRACE("(%s, %p, %lx, %p, %lx, %p)\n", debugstr_guid(riid), pv,
dwDestContext, pvDestContext, mshlflags, pCid);
......@@ -1063,7 +1066,7 @@ static HRESULT WINAPI MonikerMarshal_GetMarshalSizeMax(
LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags, DWORD* pSize)
{
ICOM_THIS_From_IMoniker(MonikerMarshal, iface);
MonikerMarshal *This = impl_from_IMarshal(iface);
HRESULT hr;
ULARGE_INTEGER size;
......@@ -1080,7 +1083,7 @@ static HRESULT WINAPI MonikerMarshal_MarshalInterface(LPMARSHAL iface, IStream *
REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags)
{
ICOM_THIS_From_IMoniker(MonikerMarshal, iface);
MonikerMarshal *This = impl_from_IMarshal(iface);
TRACE("(%p, %s, %p, %lx, %p, %lx)\n", pStm, debugstr_guid(riid), pv,
dwDestContext, pvDestContext, mshlflags);
......@@ -1090,7 +1093,7 @@ static HRESULT WINAPI MonikerMarshal_MarshalInterface(LPMARSHAL iface, IStream *
static HRESULT WINAPI MonikerMarshal_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv)
{
ICOM_THIS_From_IMoniker(MonikerMarshal, iface);
MonikerMarshal *This = impl_from_IMarshal(iface);
HRESULT hr;
TRACE("(%p, %s, %p)\n", pStm, debugstr_guid(riid), ppv);
......
#ifndef __WINE_MONIKER_H__
#define __WINE_MONIKER_H__
#define ICOM_THIS_From_IROTData(class, name) class* This = (class*)(((char*)name)-sizeof(void*))
extern const CLSID CLSID_FileMoniker;
extern const CLSID CLSID_ItemMoniker;
extern const CLSID CLSID_AntiMoniker;
......
......@@ -63,9 +63,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(storage);
#define _IPropertySetStorage_Offset ((int)(&(((StorageImpl*)0)->base.pssVtbl)))
#define _ICOM_THIS_From_IPropertySetStorage(class, name) \
class* This = (class*)(((char*)name)-_IPropertySetStorage_Offset)
static inline StorageImpl *impl_from_IPropertySetStorage( IPropertySetStorage *iface )
{
return (StorageImpl *)((char*)iface - FIELD_OFFSET(StorageImpl, base.pssVtbl));
}
/* These are documented in MSDN, e.g.
* http://msdn.microsoft.com/library/en-us/stg/stg/property_set_header.asp
......@@ -2039,7 +2040,7 @@ static HRESULT WINAPI IPropertySetStorage_fnQueryInterface(
REFIID riid,
void** ppvObject)
{
_ICOM_THIS_From_IPropertySetStorage(StorageImpl, ppstg);
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
return IStorage_QueryInterface( (IStorage*)This, riid, ppvObject );
}
......@@ -2051,7 +2052,7 @@ static HRESULT WINAPI IPropertySetStorage_fnQueryInterface(
static ULONG WINAPI IPropertySetStorage_fnAddRef(
IPropertySetStorage *ppstg)
{
_ICOM_THIS_From_IPropertySetStorage(StorageImpl, ppstg);
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
return IStorage_AddRef( (IStorage*)This );
}
......@@ -2063,7 +2064,7 @@ static ULONG WINAPI IPropertySetStorage_fnAddRef(
static ULONG WINAPI IPropertySetStorage_fnRelease(
IPropertySetStorage *ppstg)
{
_ICOM_THIS_From_IPropertySetStorage(StorageImpl, ppstg);
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
return IStorage_Release( (IStorage*)This );
}
......@@ -2078,7 +2079,7 @@ static HRESULT WINAPI IPropertySetStorage_fnCreate(
DWORD grfMode,
IPropertyStorage** ppprstg)
{
_ICOM_THIS_From_IPropertySetStorage(StorageImpl, ppstg);
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
WCHAR name[CCH_MAX_PROPSTG_NAME];
IStream *stm = NULL;
HRESULT r;
......@@ -2133,7 +2134,7 @@ static HRESULT WINAPI IPropertySetStorage_fnOpen(
DWORD grfMode,
IPropertyStorage** ppprstg)
{
_ICOM_THIS_From_IPropertySetStorage(StorageImpl, ppstg);
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
IStream *stm = NULL;
WCHAR name[CCH_MAX_PROPSTG_NAME];
HRESULT r;
......@@ -2176,7 +2177,7 @@ static HRESULT WINAPI IPropertySetStorage_fnDelete(
IPropertySetStorage *ppstg,
REFFMTID rfmtid)
{
_ICOM_THIS_From_IPropertySetStorage(StorageImpl, ppstg);
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
IStorage *stg = NULL;
WCHAR name[CCH_MAX_PROPSTG_NAME];
HRESULT r;
......@@ -2201,7 +2202,7 @@ static HRESULT WINAPI IPropertySetStorage_fnEnum(
IPropertySetStorage *ppstg,
IEnumSTATPROPSETSTG** ppenum)
{
_ICOM_THIS_From_IPropertySetStorage(StorageImpl, ppstg);
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
FIXME("%p\n", This);
return E_NOTIMPL;
}
......
......@@ -79,8 +79,11 @@ typedef struct
static const IAutoCompleteVtbl acvt;
static const IAutoComplete2Vtbl ac2vt;
#define _IAutoComplete2_Offset ((int)(&(((IAutoCompleteImpl*)0)->lpvtblAutoComplete2)))
#define _ICOM_THIS_From_IAutoComplete2(class, name) class* This = (class*)(((char*)name)-_IAutoComplete2_Offset);
static inline IAutoCompleteImpl *impl_from_IAutoComplete2( IAutoComplete2 *iface )
{
return (IAutoCompleteImpl *)((char*)iface - FIELD_OFFSET(IAutoCompleteImpl, lpvtblAutoComplete2));
}
/*
converts This to an interface pointer
......@@ -329,7 +332,7 @@ static HRESULT WINAPI IAutoComplete2_fnQueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface);
TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
......@@ -342,7 +345,7 @@ static HRESULT WINAPI IAutoComplete2_fnQueryInterface(
static ULONG WINAPI IAutoComplete2_fnAddRef(
IAutoComplete2 * iface)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl,iface);
IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
......@@ -355,7 +358,7 @@ static ULONG WINAPI IAutoComplete2_fnAddRef(
static ULONG WINAPI IAutoComplete2_fnRelease(
IAutoComplete2 * iface)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl,iface);
IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
......@@ -369,7 +372,7 @@ static HRESULT WINAPI IAutoComplete2_fnEnable(
IAutoComplete2 * iface,
BOOL fEnable)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface);
TRACE ("(%p)->(%s)\n", This, (fEnable)?"true":"false");
......@@ -386,7 +389,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
LPCOLESTR pwzsRegKeyPath,
LPCOLESTR pwszQuickComplete)
{
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface);
TRACE("(%p)\n", This);
......@@ -402,7 +405,7 @@ static HRESULT WINAPI IAutoComplete2_fnGetOptions(
{
HRESULT hr = S_OK;
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface);
TRACE("(%p) -> (%p)\n", This, pdwFlag);
......@@ -420,7 +423,7 @@ static HRESULT WINAPI IAutoComplete2_fnSetOptions(
{
HRESULT hr = S_OK;
_ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface);
IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface);
TRACE("(%p) -> (0x%lx)\n", This, dwFlag);
......
......@@ -76,14 +76,20 @@ static const IPersistFolder2Vtbl vt_PersistFolder2;
static const IShellExecuteHookWVtbl vt_ShellExecuteHookW;
static const IShellExecuteHookAVtbl vt_ShellExecuteHookA;
#define _IPersistFolder2_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblPersistFolder2)))
#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset);
static inline ICPanelImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface )
{
return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2));
}
#define IShellExecuteHookW_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookW)))
#define _ICOM_THIS_From_IShellExecuteHookW(class, name) class* This = (class*)(((char*)name)-IShellExecuteHookW_Offset);
static inline ICPanelImpl *impl_from_IShellExecuteHookW( IShellExecuteHookW *iface )
{
return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW));
}
#define IShellExecuteHookA_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookA)))
#define _ICOM_THIS_From_IShellExecuteHookA(class, name) class* This = (class*)(((char*)name)-IShellExecuteHookA_Offset);
static inline ICPanelImpl *impl_from_IShellExecuteHookA( IShellExecuteHookA *iface )
{
return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA));
}
/*
......@@ -824,7 +830,7 @@ static const IShellFolder2Vtbl vt_ShellFolder2 =
*/
static HRESULT WINAPI ICPanel_PersistFolder2_QueryInterface(IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObject)
{
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IPersistFolder2(iface);
TRACE("(%p)\n", This);
......@@ -836,7 +842,7 @@ static HRESULT WINAPI ICPanel_PersistFolder2_QueryInterface(IPersistFolder2 * if
*/
static ULONG WINAPI ICPanel_PersistFolder2_AddRef(IPersistFolder2 * iface)
{
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IPersistFolder2(iface);
TRACE("(%p)->(count=%lu)\n", This, This->ref);
......@@ -848,7 +854,7 @@ static ULONG WINAPI ICPanel_PersistFolder2_AddRef(IPersistFolder2 * iface)
*/
static ULONG WINAPI ICPanel_PersistFolder2_Release(IPersistFolder2 * iface)
{
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IPersistFolder2(iface);
TRACE("(%p)->(count=%lu)\n", This, This->ref);
......@@ -860,7 +866,7 @@ static ULONG WINAPI ICPanel_PersistFolder2_Release(IPersistFolder2 * iface)
*/
static HRESULT WINAPI ICPanel_PersistFolder2_GetClassID(IPersistFolder2 * iface, CLSID * lpClassId)
{
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IPersistFolder2(iface);
TRACE("(%p)\n", This);
......@@ -878,7 +884,7 @@ static HRESULT WINAPI ICPanel_PersistFolder2_GetClassID(IPersistFolder2 * iface,
*/
static HRESULT WINAPI ICPanel_PersistFolder2_Initialize(IPersistFolder2 * iface, LPCITEMIDLIST pidl)
{
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IPersistFolder2(iface);
TRACE("(%p)->(%p)\n", This, pidl);
return E_NOTIMPL;
}
......@@ -888,7 +894,7 @@ static HRESULT WINAPI ICPanel_PersistFolder2_Initialize(IPersistFolder2 * iface,
*/
static HRESULT WINAPI ICPanel_PersistFolder2_GetCurFolder(IPersistFolder2 * iface, LPITEMIDLIST * pidl)
{
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IPersistFolder2(iface);
TRACE("(%p)->(%p)\n", This, pidl);
......@@ -931,7 +937,7 @@ HRESULT CPanel_GetIconLocationW(LPITEMIDLIST pidl,
static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface(
IShellExecuteHookW* iface, REFIID riid, void** ppvObject)
{
_ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IShellExecuteHookW(iface);
TRACE("(%p)->(count=%lu)\n", This, This->ref);
......@@ -940,7 +946,7 @@ static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface(
static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnAddRef(IShellExecuteHookW* iface)
{
_ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IShellExecuteHookW(iface);
TRACE("(%p)->(count=%lu)\n", This, This->ref);
......@@ -949,7 +955,7 @@ static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnAddRef(IShellExecuteHookW* i
static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnRelease(IShellExecuteHookW* iface)
{
_ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IShellExecuteHookW(iface);
TRACE("(%p)\n", This);
......@@ -1017,7 +1023,7 @@ static const IShellExecuteHookWVtbl vt_ShellExecuteHookW =
static HRESULT WINAPI IShellExecuteHookA_fnQueryInterface(IShellExecuteHookA* iface, REFIID riid, void** ppvObject)
{
_ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IShellExecuteHookA(iface);
TRACE("(%p)->(count=%lu)\n", This, This->ref);
......@@ -1026,7 +1032,7 @@ static HRESULT WINAPI IShellExecuteHookA_fnQueryInterface(IShellExecuteHookA* if
static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnAddRef(IShellExecuteHookA* iface)
{
_ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IShellExecuteHookA(iface);
TRACE("(%p)->(count=%lu)\n", This, This->ref);
......@@ -1035,7 +1041,7 @@ static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnAddRef(IShellExecuteHookA* i
static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnRelease(IShellExecuteHookA* iface)
{
_ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface);
ICPanelImpl *This = impl_from_IShellExecuteHookA(iface);
TRACE("(%p)\n", This);
......
......@@ -60,11 +60,16 @@ static const IExtractIconAVtbl eiavt;
static const IExtractIconWVtbl eivt;
static const IPersistFileVtbl pfvt;
#define _IPersistFile_Offset ((int)(&(((IExtractIconWImpl*)0)->lpvtblPersistFile)))
#define _ICOM_THIS_From_IPersistFile(class, name) class* This = (class*)(((char*)name)-_IPersistFile_Offset);
static inline IExtractIconW *impl_from_IPersistFile( IPersistFile *iface )
{
return (IExtractIconW *)((char*)iface - FIELD_OFFSET(IExtractIconWImpl, lpvtblPersistFile));
}
static inline IExtractIconW *impl_from_IExtractIconA( IExtractIconA *iface )
{
return (IExtractIconW *)((char*)iface - FIELD_OFFSET(IExtractIconWImpl, lpvtblExtractIconA));
}
#define _IExtractIconA_Offset ((int)(&(((IExtractIconWImpl*)0)->lpvtblExtractIconA)))
#define _ICOM_THIS_From_IExtractIconA(class, name) class* This = (class*)(((char*)name)-_IExtractIconA_Offset);
/**************************************************************************
* IExtractIconW_Constructor
......@@ -422,7 +427,7 @@ IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
*/
static HRESULT WINAPI IExtractIconA_fnQueryInterface(IExtractIconA * iface, REFIID riid, LPVOID *ppvObj)
{
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
IExtractIconW *This = impl_from_IExtractIconA(iface);
return IExtractIconW_QueryInterface(This, riid, ppvObj);
}
......@@ -432,7 +437,7 @@ static HRESULT WINAPI IExtractIconA_fnQueryInterface(IExtractIconA * iface, REFI
*/
static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface)
{
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
IExtractIconW *This = impl_from_IExtractIconA(iface);
return IExtractIconW_AddRef(This);
}
......@@ -441,7 +446,7 @@ static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface)
*/
static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface)
{
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
IExtractIconW *This = impl_from_IExtractIconA(iface);
return IExtractIconW_AddRef(This);
}
......@@ -460,7 +465,7 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation(
{
HRESULT ret;
LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, cchMax * sizeof(WCHAR));
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
IExtractIconW *This = impl_from_IExtractIconA(iface);
TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags);
......@@ -479,7 +484,7 @@ static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszF
HRESULT ret;
INT len = MultiByteToWideChar(CP_ACP, 0, pszFile, -1, NULL, 0);
LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
IExtractIconW *This = impl_from_IExtractIconA(iface);
TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
......@@ -506,7 +511,7 @@ static HRESULT WINAPI IEIPersistFile_fnQueryInterface(
REFIID iid,
LPVOID *ppvObj)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
IExtractIconW *This = impl_from_IPersistFile(iface);
return IExtractIconW_QueryInterface(This, iid, ppvObj);
}
......@@ -517,7 +522,7 @@ static HRESULT WINAPI IEIPersistFile_fnQueryInterface(
static ULONG WINAPI IEIPersistFile_fnAddRef(
IPersistFile *iface)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
IExtractIconW *This = impl_from_IPersistFile(iface);
return IExtractIconW_AddRef(This);
}
......@@ -528,7 +533,7 @@ static ULONG WINAPI IEIPersistFile_fnAddRef(
static ULONG WINAPI IEIPersistFile_fnRelease(
IPersistFile *iface)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
IExtractIconW *This = impl_from_IPersistFile(iface);
return IExtractIconW_Release(This);
}
......@@ -555,7 +560,7 @@ static HRESULT WINAPI IEIPersistFile_fnGetClassID(
*/
static HRESULT WINAPI IEIPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
{
_ICOM_THIS_From_IPersistFile(IExtractIconW, iface);
IExtractIconW *This = impl_from_IPersistFile(iface);
FIXME("%p\n", This);
return E_NOTIMPL;
......
......@@ -66,8 +66,11 @@ typedef struct {
static const IShellFolder2Vtbl vt_ShellFolder2;
static const IPersistFolder2Vtbl vt_PersistFolder2;
#define _IPersistFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpVtblPersistFolder2)))
#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset);
static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface )
{
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2));
}
/*
converts This to an interface pointer
......@@ -855,7 +858,7 @@ static const IShellFolder2Vtbl vt_ShellFolder2 =
static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (
IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)\n", This);
......@@ -867,7 +870,7 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (
*/
static ULONG WINAPI IMCFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
......@@ -879,7 +882,7 @@ static ULONG WINAPI IMCFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
*/
static ULONG WINAPI IMCFldr_PersistFolder2_Release (IPersistFolder2 * iface)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(count=%lu)\n", This, This->ref);
......@@ -892,7 +895,7 @@ static ULONG WINAPI IMCFldr_PersistFolder2_Release (IPersistFolder2 * iface)
static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (
IPersistFolder2 * iface, CLSID * lpClassId)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)\n", This);
......@@ -911,7 +914,7 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (
static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (
IPersistFolder2 * iface, LPCITEMIDLIST pidl)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(%p)\n", This, pidl);
return E_NOTIMPL;
}
......@@ -922,7 +925,7 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (
static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (
IPersistFolder2 * iface, LPITEMIDLIST * pidl)
{
_ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(%p)\n", This, pidl);
......
......@@ -104,20 +104,30 @@ typedef struct
static const IShellViewVtbl svvt;
static const IOleCommandTargetVtbl ctvt;
#define _IOleCommandTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblOleCommandTarget)))
#define _ICOM_THIS_From_IOleCommandTarget(class, name) class* This = (class*)(((char*)name)-_IOleCommandTarget_Offset);
static const IDropTargetVtbl dtvt;
#define _IDropTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropTarget)))
#define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset);
static const IDropSourceVtbl dsvt;
#define _IDropSource_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropSource)))
#define _ICOM_THIS_From_IDropSource(class, name) class* This = (class*)(((char*)name)-_IDropSource_Offset);
static const IViewObjectVtbl vovt;
#define _IViewObject_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblViewObject)))
#define _ICOM_THIS_From_IViewObject(class, name) class* This = (class*)(((char*)name)-_IViewObject_Offset);
static inline IShellViewImpl *impl_from_IOleCommandTarget( IOleCommandTarget *iface )
{
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblOleCommandTarget));
}
static inline IShellViewImpl *impl_from_IDropTarget( IDropTarget *iface )
{
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropTarget));
}
static inline IShellViewImpl *impl_from_IDropSource( IDropSource *iface )
{
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropSource));
}
static inline IShellViewImpl *impl_from_IViewObject( IViewObject *iface )
{
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblViewObject));
}
/* ListView Header ID's */
#define LISTVIEW_COLUMN_NAME 0
......@@ -2017,7 +2027,7 @@ static HRESULT WINAPI ISVOleCmdTarget_QueryInterface(
REFIID iid,
LPVOID* ppvObj)
{
_ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IOleCommandTarget(iface);
return IShellFolder_QueryInterface((IShellFolder*)This, iid, ppvObj);
}
......@@ -2028,7 +2038,7 @@ static HRESULT WINAPI ISVOleCmdTarget_QueryInterface(
static ULONG WINAPI ISVOleCmdTarget_AddRef(
IOleCommandTarget * iface)
{
_ICOM_THIS_From_IOleCommandTarget(IShellFolder, iface);
IShellViewImpl *This = impl_from_IOleCommandTarget(iface);
return IShellFolder_AddRef((IShellFolder*)This);
}
......@@ -2039,7 +2049,7 @@ static ULONG WINAPI ISVOleCmdTarget_AddRef(
static ULONG WINAPI ISVOleCmdTarget_Release(
IOleCommandTarget * iface)
{
_ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IOleCommandTarget(iface);
return IShellFolder_Release((IShellFolder*)This);
}
......@@ -2055,7 +2065,7 @@ static HRESULT WINAPI ISVOleCmdTarget_QueryStatus(
OLECMDTEXT* pCmdText)
{
UINT i;
_ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IOleCommandTarget(iface);
FIXME("(%p)->(%p(%s) 0x%08lx %p %p\n",
This, pguidCmdGroup, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, pCmdText);
......@@ -2083,7 +2093,7 @@ static HRESULT WINAPI ISVOleCmdTarget_Exec(
VARIANT* pvaIn,
VARIANT* pvaOut)
{
_ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IOleCommandTarget(iface);
FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08lx Opt:0x%08lx %p %p)\n",
This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, pvaIn, pvaOut);
......@@ -2118,7 +2128,7 @@ static HRESULT WINAPI ISVDropTarget_QueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropTarget(iface);
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
......@@ -2127,7 +2137,7 @@ static HRESULT WINAPI ISVDropTarget_QueryInterface(
static ULONG WINAPI ISVDropTarget_AddRef( IDropTarget *iface)
{
_ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropTarget(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
......@@ -2136,7 +2146,7 @@ static ULONG WINAPI ISVDropTarget_AddRef( IDropTarget *iface)
static ULONG WINAPI ISVDropTarget_Release( IDropTarget *iface)
{
_ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropTarget(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
......@@ -2151,7 +2161,7 @@ static HRESULT WINAPI ISVDropTarget_DragEnter(
DWORD *pdwEffect)
{
_ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropTarget(iface);
FIXME("Stub: This=%p, DataObject=%p\n",This,pDataObject);
......@@ -2164,7 +2174,7 @@ static HRESULT WINAPI ISVDropTarget_DragOver(
POINTL pt,
DWORD *pdwEffect)
{
_ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropTarget(iface);
FIXME("Stub: This=%p\n",This);
......@@ -2174,7 +2184,7 @@ static HRESULT WINAPI ISVDropTarget_DragOver(
static HRESULT WINAPI ISVDropTarget_DragLeave(
IDropTarget *iface)
{
_ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropTarget(iface);
FIXME("Stub: This=%p\n",This);
......@@ -2188,7 +2198,7 @@ static HRESULT WINAPI ISVDropTarget_Drop(
POINTL pt,
DWORD *pdwEffect)
{
_ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropTarget(iface);
FIXME("Stub: This=%p\n",This);
......@@ -2215,7 +2225,7 @@ static HRESULT WINAPI ISVDropSource_QueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropSource(iface);
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
......@@ -2224,7 +2234,7 @@ static HRESULT WINAPI ISVDropSource_QueryInterface(
static ULONG WINAPI ISVDropSource_AddRef( IDropSource *iface)
{
_ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropSource(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
......@@ -2233,7 +2243,7 @@ static ULONG WINAPI ISVDropSource_AddRef( IDropSource *iface)
static ULONG WINAPI ISVDropSource_Release( IDropSource *iface)
{
_ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropSource(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
......@@ -2244,7 +2254,7 @@ static HRESULT WINAPI ISVDropSource_QueryContinueDrag(
BOOL fEscapePressed,
DWORD grfKeyState)
{
_ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropSource(iface);
TRACE("(%p)\n",This);
if (fEscapePressed)
......@@ -2259,7 +2269,7 @@ static HRESULT WINAPI ISVDropSource_GiveFeedback(
IDropSource *iface,
DWORD dwEffect)
{
_ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IDropSource(iface);
TRACE("(%p)\n",This);
return DRAGDROP_S_USEDEFAULTCURSORS;
......@@ -2282,7 +2292,7 @@ static HRESULT WINAPI ISVViewObject_QueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
......@@ -2291,7 +2301,7 @@ static HRESULT WINAPI ISVViewObject_QueryInterface(
static ULONG WINAPI ISVViewObject_AddRef( IViewObject *iface)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
......@@ -2300,7 +2310,7 @@ static ULONG WINAPI ISVViewObject_AddRef( IViewObject *iface)
static ULONG WINAPI ISVViewObject_Release( IViewObject *iface)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
TRACE("(%p)->(count=%lu)\n",This,This->ref);
......@@ -2321,7 +2331,7 @@ static HRESULT WINAPI ISVViewObject_Draw(
ULONG_PTR dwContinue)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
FIXME("Stub: This=%p\n",This);
......@@ -2337,7 +2347,7 @@ static HRESULT WINAPI ISVViewObject_GetColorSet(
LOGPALETTE** ppColorSet)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
FIXME("Stub: This=%p\n",This);
......@@ -2351,7 +2361,7 @@ static HRESULT WINAPI ISVViewObject_Freeze(
DWORD* pdwFreeze)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
FIXME("Stub: This=%p\n",This);
......@@ -2362,7 +2372,7 @@ static HRESULT WINAPI ISVViewObject_Unfreeze(
DWORD dwFreeze)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
FIXME("Stub: This=%p\n",This);
......@@ -2375,7 +2385,7 @@ static HRESULT WINAPI ISVViewObject_SetAdvise(
IAdviseSink* pAdvSink)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
FIXME("partial stub: %p %08lx %08lx %p\n",
This, aspects, advf, pAdvSink);
......@@ -2395,7 +2405,7 @@ static HRESULT WINAPI ISVViewObject_GetAdvise(
IAdviseSink** ppAdvSink)
{
_ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
IShellViewImpl *This = impl_from_IViewObject(iface);
TRACE("This=%p pAspects=%p pAdvf=%p ppAdvSink=%p\n",
This, pAspects, pAdvf, ppAdvSink);
......
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