Commit 74e0072d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Get rid of ICOM_THIS_MULTI macro.

parent 67d2fdc3
...@@ -35,11 +35,13 @@ typedef struct { ...@@ -35,11 +35,13 @@ typedef struct {
static IEnumFORMATETC *EnumFORMATETC_Create(UINT cfmtetc, const FORMATETC *rgfmtetc, UINT it); static IEnumFORMATETC *EnumFORMATETC_Create(UINT cfmtetc, const FORMATETC *rgfmtetc, UINT it);
#define ENUMF_THIS(iface) ICOM_THIS_MULTI(EnumFORMATETC, lpEnumFORMATETCVtbl, iface) #define ENUMF_THIS(iface) DEFINE_THIS(EnumFORMATETC, EnumFORMATETC, iface)
static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID riid, void **ppv) static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID riid, void **ppv)
{ {
TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); EnumFORMATETC *This = ENUMF_THIS(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
*ppv = NULL; *ppv = NULL;
...@@ -55,7 +57,7 @@ static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID ...@@ -55,7 +57,7 @@ static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID
static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface) static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface)
{ {
ENUMF_THIS(iface); EnumFORMATETC *This = ENUMF_THIS(iface);
LONG ref = InterlockedIncrement(&This->ref); LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
return ref; return ref;
...@@ -63,7 +65,7 @@ static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface) ...@@ -63,7 +65,7 @@ static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface)
static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface) static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface)
{ {
ENUMF_THIS(iface); EnumFORMATETC *This = ENUMF_THIS(iface);
LONG ref = InterlockedDecrement(&This->ref); LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
...@@ -81,7 +83,7 @@ static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface) ...@@ -81,7 +83,7 @@ static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface)
static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt, static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt,
FORMATETC *rgelt, ULONG *pceltFetched) FORMATETC *rgelt, ULONG *pceltFetched)
{ {
ENUMF_THIS(iface); EnumFORMATETC *This = ENUMF_THIS(iface);
ULONG cnt; ULONG cnt;
TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched); TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched);
...@@ -108,7 +110,7 @@ static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt, ...@@ -108,7 +110,7 @@ static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt,
static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt) static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt)
{ {
ENUMF_THIS(iface); EnumFORMATETC *This = ENUMF_THIS(iface);
TRACE("(%p)->(%d)\n", This, celt); TRACE("(%p)->(%d)\n", This, celt);
...@@ -118,7 +120,7 @@ static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt) ...@@ -118,7 +120,7 @@ static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt)
static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface) static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface)
{ {
ENUMF_THIS(iface); EnumFORMATETC *This = ENUMF_THIS(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
...@@ -128,7 +130,7 @@ static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface) ...@@ -128,7 +130,7 @@ static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface)
static HRESULT WINAPI EnumFORMATETC_Clone(IEnumFORMATETC *iface, IEnumFORMATETC **ppenum) static HRESULT WINAPI EnumFORMATETC_Clone(IEnumFORMATETC *iface, IEnumFORMATETC **ppenum)
{ {
ENUMF_THIS(iface); EnumFORMATETC *This = ENUMF_THIS(iface);
TRACE("(%p)->(%p)\n", This, ppenum); TRACE("(%p)->(%p)\n", This, ppenum);
......
...@@ -53,7 +53,6 @@ extern LONG URLMON_refCount; ...@@ -53,7 +53,6 @@ extern LONG URLMON_refCount;
static inline void URLMON_LockModule(void) { InterlockedIncrement( &URLMON_refCount ); } static inline void URLMON_LockModule(void) { InterlockedIncrement( &URLMON_refCount ); }
static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_refCount ); } static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_refCount ); }
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc))) #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface) #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,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