diff --git a/dlls/comcat/comcat_private.h b/dlls/comcat/comcat_private.h index 7e02b9f6cf3..d0045d2c45b 100644 --- a/dlls/comcat/comcat_private.h +++ b/dlls/comcat/comcat_private.h @@ -31,6 +31,8 @@ #include "comcat.h" #include "wine/unicode.h" +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /********************************************************************** * Dll lifetime tracking declaration for comcat.dll */ diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h index c8651619d7b..3acf8ec97d7 100644 --- a/dlls/dmband/dmutils.h +++ b/dlls/dmband/dmutils.h @@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK { DWORD dwSize; /* size of the chunk */ } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /** * Parsing utilities */ diff --git a/dlls/dmcompos/dmcompos_private.h b/dlls/dmcompos/dmcompos_private.h index 34e3db3ed24..598a4f260d0 100644 --- a/dlls/dmcompos/dmcompos_private.h +++ b/dlls/dmcompos/dmcompos_private.h @@ -267,6 +267,8 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /* check whether the given DWORD is even (return 0) or odd (return 1) */ extern int even_or_odd (DWORD number); /* FOURCC to string conversion for debug messages */ diff --git a/dlls/dmime/dmutils.h b/dlls/dmime/dmutils.h index c8651619d7b..3acf8ec97d7 100644 --- a/dlls/dmime/dmutils.h +++ b/dlls/dmime/dmutils.h @@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK { DWORD dwSize; /* size of the chunk */ } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /** * Parsing utilities */ diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h index 6e29428bbbb..32665114cc8 100644 --- a/dlls/dmloader/dmloader_private.h +++ b/dlls/dmloader/dmloader_private.h @@ -41,6 +41,8 @@ #include "dmusicf.h" #include "dmusics.h" +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /* dmloader.dll global (for DllCanUnloadNow) */ extern DWORD dwDirectMusicLoader; /* number of DirectMusicLoader(CF) instances */ extern DWORD dwDirectMusicContainer; /* number of DirectMusicContainer(CF) instances */ diff --git a/dlls/dmscript/dmscript_private.h b/dlls/dmscript/dmscript_private.h index ab2b189a268..51f1c1cb3cf 100644 --- a/dlls/dmscript/dmscript_private.h +++ b/dlls/dmscript/dmscript_private.h @@ -200,6 +200,8 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /* check whether the given DWORD is even (return 0) or odd (return 1) */ extern int even_or_odd (DWORD number); /* FOURCC to string conversion for debug messages */ diff --git a/dlls/dmstyle/dmutils.h b/dlls/dmstyle/dmutils.h index c8651619d7b..3acf8ec97d7 100644 --- a/dlls/dmstyle/dmutils.h +++ b/dlls/dmstyle/dmutils.h @@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK { DWORD dwSize; /* size of the chunk */ } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /** * Parsing utilities */ diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 6562df80fe4..d6683a63c47 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -412,8 +412,8 @@ void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVO * Misc. */ /* my custom ICOM stuff */ -#define ICOM_NAME(impl,iface,name) impl* const name=(impl*)(iface) #define ICOM_NAME_MULTI(impl,field,iface,name) impl* const name=(impl*)((char*)(iface) - offsetof(impl,field)) +#define ICOM_THIS_MULTI(impl,field,iface) ICOM_NAME_MULTI(impl,field,iface,This) /* for simpler reading */ typedef struct _DMUS_PRIVATE_CHUNK { diff --git a/dlls/dswave/dswave_private.h b/dlls/dswave/dswave_private.h index d690900be22..93bfc7638c0 100644 --- a/dlls/dswave/dswave_private.h +++ b/dlls/dswave/dswave_private.h @@ -160,6 +160,8 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /* check whether the given DWORD is even (return 0) or odd (return 1) */ extern int even_or_odd (DWORD number); /* FOURCC to string conversion for debug messages */ diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index 2242a079cf6..7eb2d235b8a 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang); #define CP_UNICODE 1200 +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj); /* FIXME: diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index d69d1796643..ee4e33b4c58 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -189,4 +189,6 @@ static inline APARTMENT* COM_CurrentApt(void) APARTMENT* COM_CreateApartment(DWORD model); HWND COM_GetApartmentWin(OXID oxid); +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + #endif /* __WINE_OLE_COMPOBJ_H */ diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index 14f1975fb92..44b7a68b2d1 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -53,6 +53,8 @@ static const WCHAR ppvObjectW[] = {'p','p','v','O','b','j','e','c','t',0}; WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DECLARE_DEBUG_CHANNEL(olerelay); +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + typedef struct _marshal_state { LPBYTE base; int size; diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index bdda4be8101..1cdb59af4fd 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -37,6 +37,8 @@ #define BYTES_FROM_MEDIATIME(time) SEC_FROM_MEDIATIME(time) #define MSEC_FROM_MEDIATIME(time) ((time) / 10000) +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) ; HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj); HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv); diff --git a/dlls/rpcrt4/cproxy.c b/dlls/rpcrt4/cproxy.c index 81c1e78fe7f..10639cbfedf 100644 --- a/dlls/rpcrt4/cproxy.c +++ b/dlls/rpcrt4/cproxy.c @@ -55,6 +55,8 @@ typedef struct { static IRpcProxyBufferVtbl StdProxy_Vtbl; +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + /* How the Windows stubless proxy thunks work is explained at * http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp, * but I'll use a slightly different method, to make life easier */ diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 4544ab47c42..141e8ac2fde 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -26,4 +26,6 @@ extern HINSTANCE URLMON_hInstance; +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + #endif /* __WINE_URLMON_MAIN_H */ diff --git a/include/objbase.h b/include/objbase.h index c39f714c99d..b825f51c4bc 100644 --- a/include/objbase.h +++ b/include/objbase.h @@ -298,7 +298,6 @@ /* Wine-specific macros */ #define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface) -#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) #include