Commit 936198ce authored by Alexandre Julliard's avatar Alexandre Julliard

Moved ICOM_THIS_MULTI definition out of objbase.h and into the files

that use it.
parent ff039ccd
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "comcat.h" #include "comcat.h"
#include "wine/unicode.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 * Dll lifetime tracking declaration for comcat.dll
*/ */
......
...@@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK { ...@@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */ DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_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 * Parsing utilities
*/ */
......
...@@ -267,6 +267,8 @@ typedef struct { ...@@ -267,6 +267,8 @@ typedef struct {
#define FE(x) { x, #x } #define FE(x) { x, #x }
#define GE(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) */ /* check whether the given DWORD is even (return 0) or odd (return 1) */
extern int even_or_odd (DWORD number); extern int even_or_odd (DWORD number);
/* FOURCC to string conversion for debug messages */ /* FOURCC to string conversion for debug messages */
......
...@@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK { ...@@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */ DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_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 * Parsing utilities
*/ */
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include "dmusicf.h" #include "dmusicf.h"
#include "dmusics.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) */ /* dmloader.dll global (for DllCanUnloadNow) */
extern DWORD dwDirectMusicLoader; /* number of DirectMusicLoader(CF) instances */ extern DWORD dwDirectMusicLoader; /* number of DirectMusicLoader(CF) instances */
extern DWORD dwDirectMusicContainer; /* number of DirectMusicContainer(CF) instances */ extern DWORD dwDirectMusicContainer; /* number of DirectMusicContainer(CF) instances */
......
...@@ -200,6 +200,8 @@ typedef struct { ...@@ -200,6 +200,8 @@ typedef struct {
#define FE(x) { x, #x } #define FE(x) { x, #x }
#define GE(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) */ /* check whether the given DWORD is even (return 0) or odd (return 1) */
extern int even_or_odd (DWORD number); extern int even_or_odd (DWORD number);
/* FOURCC to string conversion for debug messages */ /* FOURCC to string conversion for debug messages */
......
...@@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK { ...@@ -27,6 +27,8 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */ DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_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 * Parsing utilities
*/ */
......
...@@ -412,8 +412,8 @@ void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVO ...@@ -412,8 +412,8 @@ void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVO
* Misc. * Misc.
*/ */
/* my custom ICOM stuff */ /* 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_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 */ /* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK { typedef struct _DMUS_PRIVATE_CHUNK {
......
...@@ -160,6 +160,8 @@ typedef struct { ...@@ -160,6 +160,8 @@ typedef struct {
#define FE(x) { x, #x } #define FE(x) { x, #x }
#define GE(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) */ /* check whether the given DWORD is even (return 0) or odd (return 1) */
extern int even_or_odd (DWORD number); extern int even_or_odd (DWORD number);
/* FOURCC to string conversion for debug messages */ /* FOURCC to string conversion for debug messages */
......
...@@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang); ...@@ -45,6 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang);
#define CP_UNICODE 1200 #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); static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj);
/* FIXME: /* FIXME:
......
...@@ -189,4 +189,6 @@ static inline APARTMENT* COM_CurrentApt(void) ...@@ -189,4 +189,6 @@ static inline APARTMENT* COM_CurrentApt(void)
APARTMENT* COM_CreateApartment(DWORD model); APARTMENT* COM_CreateApartment(DWORD model);
HWND COM_GetApartmentWin(OXID oxid); 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 */ #endif /* __WINE_OLE_COMPOBJ_H */
...@@ -53,6 +53,8 @@ static const WCHAR ppvObjectW[] = {'p','p','v','O','b','j','e','c','t',0}; ...@@ -53,6 +53,8 @@ static const WCHAR ppvObjectW[] = {'p','p','v','O','b','j','e','c','t',0};
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(olerelay); 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 { typedef struct _marshal_state {
LPBYTE base; LPBYTE base;
int size; int size;
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#define BYTES_FROM_MEDIATIME(time) SEC_FROM_MEDIATIME(time) #define BYTES_FROM_MEDIATIME(time) SEC_FROM_MEDIATIME(time)
#define MSEC_FROM_MEDIATIME(time) ((time) / 10000) #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 FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) ;
HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj); HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj);
HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv); HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv);
......
...@@ -55,6 +55,8 @@ typedef struct { ...@@ -55,6 +55,8 @@ typedef struct {
static IRpcProxyBufferVtbl StdProxy_Vtbl; 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 /* How the Windows stubless proxy thunks work is explained at
* http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp, * http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp,
* but I'll use a slightly different method, to make life easier */ * but I'll use a slightly different method, to make life easier */
......
...@@ -26,4 +26,6 @@ ...@@ -26,4 +26,6 @@
extern HINSTANCE URLMON_hInstance; 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 */ #endif /* __WINE_URLMON_MAIN_H */
...@@ -298,7 +298,6 @@ ...@@ -298,7 +298,6 @@
/* Wine-specific macros */ /* Wine-specific macros */
#define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface) #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 <objidl.h> #include <objidl.h>
......
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