unknwn.idl

Ove Kaaven ovehk at ping.uio.no
Sat Dec 14 09:07:26 CST 2002


(Apply that widl ICOM patch first.)

Attached is unknwn.idl. The generated unknwn.h is not attached, but here's
a patch to remove the stuff from wine/obj_base.h that gets superseded by
the unknwn.h you'll generate. Still need to IDL-ify all the other
interfaces that should be included from objbase.h (i.e. objidl.h) before
wine/obj_base.h can be completely removed.

Log:
Ove Kaaven <ovek at transgaming.com>
Wrote a Wine-compatible unknwn.idl, moving the IUnknown definition from
wine/obj_base.h to the generated unknwn.h.

Index: include/wine/obj_base.h
===================================================================
RCS file: /cvsroot/rewind/rewind/include/wine/obj_base.h,v
retrieving revision 1.50
diff -u -r1.50 obj_base.h
--- include/wine/obj_base.h	6 Dec 2002 20:50:16 -0000	1.50
+++ include/wine/obj_base.h	14 Dec 2002 14:52:36 -0000
@@ -283,12 +283,6 @@
 #define ICOM_CINTERFACE 1
 #endif
 
-#ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE
-#define ICOM_COM_INTERFACE_ATTRIBUTE __attribute__((com_interface))
-#else
-#define ICOM_COM_INTERFACE_ATTRIBUTE
-#endif
-
 #ifndef ICOM_CINTERFACE
 /* C++ interface */
 
@@ -533,16 +527,6 @@
 #define ICOM_VFIELD(iface)       ICOM_VTABLE(iface)* lpVtbl
 #define ICOM_VTBL(iface)         (iface)->lpVtbl
 
-#ifdef ICOM_MSVTABLE_COMPAT
-#define ICOM_MSVTABLE_COMPAT_FIELDS \
-        long dummyRTTI1; \
-        long dummyRTTI2;
-#define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 0,0,
-#else
-#define ICOM_MSVTABLE_COMPAT_FIELDS
-#define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
-#endif /* ICOM_MSVTABLE_COMPAT */
-
 #define ICOM_DEFINE(iface,ibase) \
     typedef struct ICOM_VTABLE(iface) ICOM_VTABLE(iface); \
     struct iface { \
@@ -598,60 +582,6 @@
 #define ICOM_CALL24(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x)
 #define ICOM_CALL25(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y)
 #define ICOM_CALL26(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)
-
-
-/*****************************************************************************
- * Predeclare the interfaces
- */
-DEFINE_OLEGUID(IID_IClassFactory,	0x00000001L, 0, 0);
-typedef struct IClassFactory IClassFactory, *LPCLASSFACTORY;
-
-DEFINE_OLEGUID(IID_IUnknown,		0x00000000L, 0, 0);
-typedef struct IUnknown IUnknown, *LPUNKNOWN;
-
-
-/*****************************************************************************
- * IUnknown interface
- */
-#define ICOM_INTERFACE IUnknown
-#define IUnknown_METHODS \
-    ICOM_METHOD2(HRESULT,QueryInterface,REFIID,riid, LPVOID*,ppvObj) \
-    ICOM_METHOD (ULONG,AddRef) \
-    ICOM_METHOD (ULONG,Release)
-#define IUnknown_IMETHODS \
-    IUnknown_METHODS
-ICOM_DEFINE1(IUnknown)
-#undef ICOM_INTERFACE
-
-/*** IUnknown methods ***/
-#define IUnknown_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IUnknown_AddRef(p)             ICOM_CALL (AddRef,p)
-#define IUnknown_Release(p)            ICOM_CALL (Release,p)
-
-HRESULT CALLBACK IUnknown_QueryInterface_Proxy(IUnknown *This,REFIID riid,LPVOID*ppvObj);
-ULONG   CALLBACK IUnknown_AddRef_Proxy(IUnknown *This);
-ULONG   CALLBACK IUnknown_Release_Proxy(IUnknown *This);
-
-/*****************************************************************************
- * IClassFactory interface
- */
-#define ICOM_INTERFACE IClassFactory
-#define IClassFactory_METHODS \
-    ICOM_METHOD3(HRESULT,CreateInstance, LPUNKNOWN,pUnkOuter, REFIID,riid, LPVOID*,ppvObject) \
-    ICOM_METHOD1(HRESULT,LockServer,     BOOL,fLock)
-#define IClassFactory_IMETHODS \
-    IUnknown_IMETHODS \
-    IClassFactory_METHODS
-ICOM_DEFINE(IClassFactory,IUnknown)
-#undef ICOM_INTERFACE
-
-/*** IUnknown methods ***/
-#define IClassFactory_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
-#define IClassFactory_AddRef(p)             ICOM_CALL (AddRef,p)
-#define IClassFactory_Release(p)            ICOM_CALL (Release,p)
-/*** IClassFactory methods ***/
-#define IClassFactory_CreateInstance(p,a,b,c) ICOM_CALL3(CreateInstance,p,a,b,c)
-#define IClassFactory_LockServer(p,a)         ICOM_CALL1(LockServer,p,a)
 
 
 #ifdef __cplusplus
-------------- next part --------------
import "wtypes.idl";

/* need this until objidl.h and objbase.h is complete */
cpp_quote("#define __WINE_INCLUDE_UNKNWN")
cpp_quote("#include \"wine/obj_base.h\"")
cpp_quote("#undef __WINE_INCLUDE_UNKNWN")

/* COM vtable compatibility macros for g++ */
/* Included here because the generated header needs them */

cpp_quote("#if defined(__cplusplus) && !defined(CINTERFACE)")
cpp_quote(" #ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE")
cpp_quote("  #define ICOM_COM_INTERFACE_ATTRIBUTE __attribute__((com_interface))")
cpp_quote(" #else")
cpp_quote("  #define ICOM_COM_INTERFACE_ATTRIBUTE")
cpp_quote(" #endif")
cpp_quote("#else")
cpp_quote(" #ifdef ICOM_MSVTABLE_COMPAT")
cpp_quote("  #define ICOM_MSVTABLE_COMPAT_FIELDS \\")
cpp_quote("    long dummyRTTI1; \\")
cpp_quote("    long dummyRTTI2;")
cpp_quote("  #define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 0,0,")
cpp_quote(" #else")
cpp_quote("  #define ICOM_MSVTABLE_COMPAT_FIELDS")
cpp_quote("  #define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE")
cpp_quote(" #endif")
cpp_quote("#endif")

/* Interfaces */

[
  local,
  object,
  uuid(00000000-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface IUnknown
{
  typedef [unique] IUnknown *LPUNKNOWN;

  HRESULT QueryInterface(
    [in] REFIID riid,
    [out, iid_is(riid)] void **ppvObject);
  ULONG AddRef();
  ULONG Release();
}

[
  object,
  uuid(00000001-0000-0000-C000-000000000046),
  pointer_default(unique)
]
interface IClassFactory : IUnknown
{
  typedef [unique] IClassFactory *LPCLASSFACTORY;

  [local]
  HRESULT CreateInstance(
    [in, unique] IUnknown *pUnkOuter,
    [in] REFIID riid,
    [out, iid_is(riid)] void **ppvObject);

  [call_as(CreateInstance)]
  HRESULT RemoteCreateInstance(
    [in] REFIID riid,
    [out, iid_is(riid)] IUnknown **ppvObject);

  [local]
  HRESULT LockServer(
    [in] BOOL fLock);

  [call_as(LockServer)]
  HRESULT RemoteLockServer(
    [in] BOOL fLock);
}


More information about the wine-patches mailing list