Commit 93217c60 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Better set of macros for defining the COM interfaces.

parent 123501fb
...@@ -180,7 +180,7 @@ LPCLASSFACTORY IShellLink_CF_Constructor(void) ...@@ -180,7 +180,7 @@ LPCLASSFACTORY IShellLink_CF_Constructor(void)
* IShellLink_CF_QueryInterface * IShellLink_CF_QueryInterface
*/ */
static HRESULT WINAPI IShellLink_CF_QueryInterface( static HRESULT WINAPI IShellLink_CF_QueryInterface(
LPUNKNOWN iface, REFIID riid, LPVOID *ppvObj) LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
char xriid[50]; char xriid[50];
...@@ -207,7 +207,7 @@ static HRESULT WINAPI IShellLink_CF_QueryInterface( ...@@ -207,7 +207,7 @@ static HRESULT WINAPI IShellLink_CF_QueryInterface(
/****************************************************************************** /******************************************************************************
* IShellLink_CF_AddRef * IShellLink_CF_AddRef
*/ */
static ULONG WINAPI IShellLink_CF_AddRef(LPUNKNOWN iface) static ULONG WINAPI IShellLink_CF_AddRef(LPCLASSFACTORY iface)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref); TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
...@@ -218,7 +218,7 @@ static ULONG WINAPI IShellLink_CF_AddRef(LPUNKNOWN iface) ...@@ -218,7 +218,7 @@ static ULONG WINAPI IShellLink_CF_AddRef(LPUNKNOWN iface)
/****************************************************************************** /******************************************************************************
* IShellLink_CF_Release * IShellLink_CF_Release
*/ */
static ULONG WINAPI IShellLink_CF_Release(LPUNKNOWN iface) static ULONG WINAPI IShellLink_CF_Release(LPCLASSFACTORY iface)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref); TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
...@@ -280,11 +280,9 @@ static HRESULT WINAPI IShellLink_CF_LockServer(LPCLASSFACTORY iface, BOOL32 fLoc ...@@ -280,11 +280,9 @@ static HRESULT WINAPI IShellLink_CF_LockServer(LPCLASSFACTORY iface, BOOL32 fLoc
} }
static ICOM_VTABLE(IClassFactory) slcfvt = static ICOM_VTABLE(IClassFactory) slcfvt =
{ {
{
IShellLink_CF_QueryInterface, IShellLink_CF_QueryInterface,
IShellLink_CF_AddRef, IShellLink_CF_AddRef,
IShellLink_CF_Release IShellLink_CF_Release,
},
IShellLink_CF_CreateInstance, IShellLink_CF_CreateInstance,
IShellLink_CF_LockServer IShellLink_CF_LockServer
}; };
...@@ -519,7 +517,7 @@ LPCLASSFACTORY IShellLinkW_CF_Constructor(void) ...@@ -519,7 +517,7 @@ LPCLASSFACTORY IShellLinkW_CF_Constructor(void)
* IShellLinkW_CF_QueryInterface * IShellLinkW_CF_QueryInterface
*/ */
static HRESULT WINAPI IShellLinkW_CF_QueryInterface( static HRESULT WINAPI IShellLinkW_CF_QueryInterface(
LPUNKNOWN iface, REFIID riid, LPVOID *ppvObj) LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
char xriid[50]; char xriid[50];
...@@ -546,7 +544,7 @@ static HRESULT WINAPI IShellLinkW_CF_QueryInterface( ...@@ -546,7 +544,7 @@ static HRESULT WINAPI IShellLinkW_CF_QueryInterface(
/****************************************************************************** /******************************************************************************
* IShellLinkW_CF_AddRef * IShellLinkW_CF_AddRef
*/ */
static ULONG WINAPI IShellLinkW_CF_AddRef(LPUNKNOWN iface) static ULONG WINAPI IShellLinkW_CF_AddRef(LPCLASSFACTORY iface)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref); TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
...@@ -557,7 +555,7 @@ static ULONG WINAPI IShellLinkW_CF_AddRef(LPUNKNOWN iface) ...@@ -557,7 +555,7 @@ static ULONG WINAPI IShellLinkW_CF_AddRef(LPUNKNOWN iface)
/****************************************************************************** /******************************************************************************
* IShellLinkW_CF_Release * IShellLinkW_CF_Release
*/ */
static ULONG WINAPI IShellLinkW_CF_Release(LPUNKNOWN iface) static ULONG WINAPI IShellLinkW_CF_Release(LPCLASSFACTORY iface)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref); TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
...@@ -621,11 +619,9 @@ static HRESULT WINAPI IShellLinkW_CF_LockServer(LPCLASSFACTORY iface, BOOL32 fLo ...@@ -621,11 +619,9 @@ static HRESULT WINAPI IShellLinkW_CF_LockServer(LPCLASSFACTORY iface, BOOL32 fLo
static ICOM_VTABLE(IClassFactory) slwcfvt = static ICOM_VTABLE(IClassFactory) slwcfvt =
{ {
{
IShellLinkW_CF_QueryInterface, IShellLinkW_CF_QueryInterface,
IShellLinkW_CF_AddRef, IShellLinkW_CF_AddRef,
IShellLinkW_CF_Release IShellLinkW_CF_Release,
},
IShellLinkW_CF_CreateInstance, IShellLinkW_CF_CreateInstance,
IShellLinkW_CF_LockServer IShellLinkW_CF_LockServer
}; };
......
...@@ -232,7 +232,7 @@ LPCLASSFACTORY IClassFactory_Constructor(void) ...@@ -232,7 +232,7 @@ LPCLASSFACTORY IClassFactory_Constructor(void)
* IClassFactory_QueryInterface * IClassFactory_QueryInterface
*/ */
static HRESULT WINAPI IClassFactory_fnQueryInterface( static HRESULT WINAPI IClassFactory_fnQueryInterface(
LPUNKNOWN iface, REFIID riid, LPVOID *ppvObj) LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
char xriid[50]; char xriid[50];
...@@ -259,7 +259,7 @@ static HRESULT WINAPI IClassFactory_fnQueryInterface( ...@@ -259,7 +259,7 @@ static HRESULT WINAPI IClassFactory_fnQueryInterface(
/****************************************************************************** /******************************************************************************
* IClassFactory_AddRef * IClassFactory_AddRef
*/ */
static ULONG WINAPI IClassFactory_fnAddRef(LPUNKNOWN iface) static ULONG WINAPI IClassFactory_fnAddRef(LPCLASSFACTORY iface)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref); TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
...@@ -270,7 +270,7 @@ static ULONG WINAPI IClassFactory_fnAddRef(LPUNKNOWN iface) ...@@ -270,7 +270,7 @@ static ULONG WINAPI IClassFactory_fnAddRef(LPUNKNOWN iface)
/****************************************************************************** /******************************************************************************
* IClassFactory_Release * IClassFactory_Release
*/ */
static ULONG WINAPI IClassFactory_fnRelease(LPUNKNOWN iface) static ULONG WINAPI IClassFactory_fnRelease(LPCLASSFACTORY iface)
{ {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref); TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
...@@ -345,11 +345,9 @@ static HRESULT WINAPI IClassFactory_fnLockServer(LPCLASSFACTORY iface, BOOL32 fL ...@@ -345,11 +345,9 @@ static HRESULT WINAPI IClassFactory_fnLockServer(LPCLASSFACTORY iface, BOOL32 fL
static ICOM_VTABLE(IClassFactory) clfvt = static ICOM_VTABLE(IClassFactory) clfvt =
{ {
{
IClassFactory_fnQueryInterface, IClassFactory_fnQueryInterface,
IClassFactory_fnAddRef, IClassFactory_fnAddRef,
IClassFactory_fnRelease IClassFactory_fnRelease,
},
IClassFactory_fnCreateInstance, IClassFactory_fnCreateInstance,
IClassFactory_fnLockServer IClassFactory_fnLockServer
}; };
...@@ -2160,7 +2160,7 @@ HRESULT WINAPI DirectSoundCreate(LPGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pUn ...@@ -2160,7 +2160,7 @@ HRESULT WINAPI DirectSoundCreate(LPGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pUn
* DirectSound ClassFactory * DirectSound ClassFactory
*/ */
static HRESULT WINAPI static HRESULT WINAPI
DSCF_QueryInterface(LPUNKNOWN iface,REFIID riid,LPVOID *ppobj) { DSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
char buf[80]; char buf[80];
...@@ -2173,12 +2173,12 @@ DSCF_QueryInterface(LPUNKNOWN iface,REFIID riid,LPVOID *ppobj) { ...@@ -2173,12 +2173,12 @@ DSCF_QueryInterface(LPUNKNOWN iface,REFIID riid,LPVOID *ppobj) {
} }
static ULONG WINAPI static ULONG WINAPI
DSCF_AddRef(LPUNKNOWN iface) { DSCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
return ++(this->ref); return ++(this->ref);
} }
static ULONG WINAPI DSCF_Release(LPUNKNOWN iface) { static ULONG WINAPI DSCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactory,iface); ICOM_THIS(IClassFactory,iface);
/* static class, won't be freed */ /* static class, won't be freed */
return --(this->ref); return --(this->ref);
...@@ -2206,11 +2206,9 @@ static HRESULT WINAPI DSCF_LockServer(LPCLASSFACTORY iface,BOOL32 dolock) { ...@@ -2206,11 +2206,9 @@ static HRESULT WINAPI DSCF_LockServer(LPCLASSFACTORY iface,BOOL32 dolock) {
} }
static ICOM_VTABLE(IClassFactory) DSCF_VTable = { static ICOM_VTABLE(IClassFactory) DSCF_VTable = {
{
DSCF_QueryInterface, DSCF_QueryInterface,
DSCF_AddRef, DSCF_AddRef,
DSCF_Release DSCF_Release,
},
DSCF_CreateInstance, DSCF_CreateInstance,
DSCF_LockServer DSCF_LockServer
}; };
......
...@@ -689,7 +689,7 @@ HRESULT WINE_StringFromCLSID( ...@@ -689,7 +689,7 @@ HRESULT WINE_StringFromCLSID(
* the string representation and OLESTATUS * the string representation and OLESTATUS
*/ */
HRESULT WINAPI StringFromCLSID16( HRESULT WINAPI StringFromCLSID16(
const CLSID *id, /* [in] the GUID to be converted */ REFCLSID id, /* [in] the GUID to be converted */
LPOLESTR16 *idstr /* [out] a pointer to a to-be-allocated segmented pointer pointing to the resulting string */ LPOLESTR16 *idstr /* [out] a pointer to a to-be-allocated segmented pointer pointing to the resulting string */
) { ) {
...@@ -729,7 +729,7 @@ HRESULT WINAPI StringFromCLSID16( ...@@ -729,7 +729,7 @@ HRESULT WINAPI StringFromCLSID16(
* the string representation and OLESTATUS * the string representation and OLESTATUS
*/ */
HRESULT WINAPI StringFromCLSID32( HRESULT WINAPI StringFromCLSID32(
const CLSID *id, /* [in] the GUID to be converted */ REFCLSID id, /* [in] the GUID to be converted */
LPOLESTR32 *idstr /* [out] a pointer to a to-be-allocated pointer pointing to the resulting string */ LPOLESTR32 *idstr /* [out] a pointer to a to-be-allocated pointer pointing to the resulting string */
) { ) {
char buf[80]; char buf[80];
......
...@@ -97,7 +97,7 @@ typedef struct _IMalloc16 { ...@@ -97,7 +97,7 @@ typedef struct _IMalloc16 {
/****************************************************************************** /******************************************************************************
* IMalloc16_QueryInterface [COMPOBJ.500] * IMalloc16_QueryInterface [COMPOBJ.500]
*/ */
HRESULT WINAPI IMalloc16_fnQueryInterface(LPUNKNOWN iface,REFIID refiid,LPVOID *obj) { HRESULT WINAPI IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID *obj) {
ICOM_THIS(IMalloc16,iface); ICOM_THIS(IMalloc16,iface);
char xrefiid[50]; char xrefiid[50];
...@@ -115,7 +115,7 @@ HRESULT WINAPI IMalloc16_fnQueryInterface(LPUNKNOWN iface,REFIID refiid,LPVOID * ...@@ -115,7 +115,7 @@ HRESULT WINAPI IMalloc16_fnQueryInterface(LPUNKNOWN iface,REFIID refiid,LPVOID *
/****************************************************************************** /******************************************************************************
* IMalloc16_AddRef [COMPOBJ.501] * IMalloc16_AddRef [COMPOBJ.501]
*/ */
ULONG WINAPI IMalloc16_fnAddRef(LPUNKNOWN iface) { ULONG WINAPI IMalloc16_fnAddRef(IMalloc16* iface) {
ICOM_THIS(IMalloc16,iface); ICOM_THIS(IMalloc16,iface);
TRACE(relay,"(%p)->AddRef()\n",this); TRACE(relay,"(%p)->AddRef()\n",this);
return 1; /* cannot be freed */ return 1; /* cannot be freed */
...@@ -124,7 +124,7 @@ ULONG WINAPI IMalloc16_fnAddRef(LPUNKNOWN iface) { ...@@ -124,7 +124,7 @@ ULONG WINAPI IMalloc16_fnAddRef(LPUNKNOWN iface) {
/****************************************************************************** /******************************************************************************
* IMalloc16_Release [COMPOBJ.502] * IMalloc16_Release [COMPOBJ.502]
*/ */
ULONG WINAPI IMalloc16_fnRelease(LPUNKNOWN iface) { ULONG WINAPI IMalloc16_fnRelease(IMalloc16* iface) {
ICOM_THIS(IMalloc16,iface); ICOM_THIS(IMalloc16,iface);
TRACE(relay,"(%p)->Release()\n",this); TRACE(relay,"(%p)->Release()\n",this);
return 1; /* cannot be freed */ return 1; /* cannot be freed */
...@@ -198,12 +198,10 @@ IMalloc16_Constructor() { ...@@ -198,12 +198,10 @@ IMalloc16_Constructor() {
if (!msegvt16) { if (!msegvt16) {
this->lpvtbl = msegvt16 = SEGPTR_NEW(ICOM_VTABLE(IMalloc16)); this->lpvtbl = msegvt16 = SEGPTR_NEW(ICOM_VTABLE(IMalloc16));
#define VTENT(x) msegvt16->bvt.fn##x = (void*)WIN32_GetProcAddress16(hcomp,"IMalloc16_"#x);assert(msegvt16->bvt.fn##x) #define VTENT(x) msegvt16->fn##x = (void*)WIN32_GetProcAddress16(hcomp,"IMalloc16_"#x);assert(msegvt16->fn##x)
VTENT(QueryInterface); VTENT(QueryInterface);
VTENT(AddRef); VTENT(AddRef);
VTENT(Release); VTENT(Release);
#undef VTENT
#define VTENT(x) msegvt16->fn##x = (void*)WIN32_GetProcAddress16(hcomp,"IMalloc16_"#x);assert(msegvt16->fn##x)
VTENT(Alloc); VTENT(Alloc);
VTENT(Realloc); VTENT(Realloc);
VTENT(Free); VTENT(Free);
...@@ -232,7 +230,7 @@ typedef struct _IMalloc32 { ...@@ -232,7 +230,7 @@ typedef struct _IMalloc32 {
/****************************************************************************** /******************************************************************************
* IMalloc32_QueryInterface [VTABLE] * IMalloc32_QueryInterface [VTABLE]
*/ */
static HRESULT WINAPI IMalloc32_fnQueryInterface(LPUNKNOWN iface,REFIID refiid,LPVOID *obj) { static HRESULT WINAPI IMalloc32_fnQueryInterface(LPMALLOC32 iface,REFIID refiid,LPVOID *obj) {
ICOM_THIS(IMalloc32,iface); ICOM_THIS(IMalloc32,iface);
char xrefiid[50]; char xrefiid[50];
...@@ -250,7 +248,7 @@ static HRESULT WINAPI IMalloc32_fnQueryInterface(LPUNKNOWN iface,REFIID refiid,L ...@@ -250,7 +248,7 @@ static HRESULT WINAPI IMalloc32_fnQueryInterface(LPUNKNOWN iface,REFIID refiid,L
/****************************************************************************** /******************************************************************************
* IMalloc32_AddRef [VTABLE] * IMalloc32_AddRef [VTABLE]
*/ */
static ULONG WINAPI IMalloc32_fnAddRef(LPUNKNOWN iface) { static ULONG WINAPI IMalloc32_fnAddRef(LPMALLOC32 iface) {
ICOM_THIS(IMalloc32,iface); ICOM_THIS(IMalloc32,iface);
TRACE(relay,"(%p)->AddRef()\n",this); TRACE(relay,"(%p)->AddRef()\n",this);
return 1; /* cannot be freed */ return 1; /* cannot be freed */
...@@ -259,7 +257,7 @@ static ULONG WINAPI IMalloc32_fnAddRef(LPUNKNOWN iface) { ...@@ -259,7 +257,7 @@ static ULONG WINAPI IMalloc32_fnAddRef(LPUNKNOWN iface) {
/****************************************************************************** /******************************************************************************
* IMalloc32_Release [VTABLE] * IMalloc32_Release [VTABLE]
*/ */
static ULONG WINAPI IMalloc32_fnRelease(LPUNKNOWN iface) { static ULONG WINAPI IMalloc32_fnRelease(LPMALLOC32 iface) {
ICOM_THIS(IMalloc32,iface); ICOM_THIS(IMalloc32,iface);
TRACE(relay,"(%p)->Release()\n",this); TRACE(relay,"(%p)->Release()\n",this);
return 1; /* cannot be freed */ return 1; /* cannot be freed */
...@@ -320,11 +318,9 @@ static LPVOID WINAPI IMalloc32_fnHeapMinimize(LPMALLOC32 iface) { ...@@ -320,11 +318,9 @@ static LPVOID WINAPI IMalloc32_fnHeapMinimize(LPMALLOC32 iface) {
} }
static ICOM_VTABLE(IMalloc32) VT_IMalloc32 = { static ICOM_VTABLE(IMalloc32) VT_IMalloc32 = {
{
IMalloc32_fnQueryInterface, IMalloc32_fnQueryInterface,
IMalloc32_fnAddRef, IMalloc32_fnAddRef,
IMalloc32_fnRelease IMalloc32_fnRelease,
},
IMalloc32_fnAlloc, IMalloc32_fnAlloc,
IMalloc32_fnRealloc, IMalloc32_fnRealloc,
IMalloc32_fnFree, IMalloc32_fnFree,
......
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