r3689: Large number of COM updates:
[samba.git] / source4 / librpc / idl / dcom.idl
index c9e81f7397b28cba00012b079cb0c02245c7c160..d9c5a72ab293b2856f2a35d19761b2236220a2f6 100644 (file)
   http://www.grimes.demon.co.uk/DCOM/DCOMSpec.htm
  */
 
-#define HRESULT uint32
 #define OLESTR unistr
 
 [
-       uuid(18f70770-8e64-11cf-9af1-0020af6e72f4),
+       uuid("18f70770-8e64-11cf-9af1-0020af6e72f4"),
        version(0.0)
 ] interface dcom_Unknown
 {
-       void dcomu_UseProtSeq();
-       void dcomu_GetCustomProtseqInfo();
-       void dcomu_UpdateResolverBindings();
+       void UseProtSeq();
+       void GetCustomProtseqInfo();
+       void UpdateResolverBindings();
 }
 
-[
-       uuid(99fcfe60-5260-101b-bbcb-00aa0021347a),
-       pointer_default(unique)
-]
 interface ObjectRpcBaseTypes
 {
-       WERROR stub();
-       
-       // Machine Identifier
-#define MID HYPER_T
-
-        // Object Exporter Identifier
-#define OXID HYPER_T
-       
-        // Object Identifer
-#define OID HYPER_T
-       
-       // Interface Pointer Identifier
-#define IPID GUID
-       
-       // Causality Identifier
-#define CID GUID
-
-       // Interface identifier
-#define IID GUID
-
-#define LCID uint32
-
-#define DISPID uint32
-
-       //////////////////////////////////////////////////////////////////
-       // ORPC Call Packet Format
-       //////////////////////////////////////////////////////////////////
-       // COM_MINOR_VERSION = 1 (NT4.0, SP1, SP2, DCOM95).
-       // - Initial Release
-       // - Must be used when talking to downlevel machines, including
-       // on Remote Activation calls.
-       // COM_MINOR_VERSION = 2 (NT4.0 SP3 and beyond).
-       // - Added ResolveOxid2 to IObjectExporter to retrieve the
-       // COM version number of the server. Passed to the NDR engine
-       // to fix fatal endian-ness flaw in the way OLEAUTOMATION marshals
-       // BSTRS. Previous way used trailing padding, which is not NDR
-       // compatible. See Bug# 69189.
-       // COM_MINOR_VERSION = 3 (NT4.0 SP4 and DCOM95 builds 1018 and beyond)
-       // - OLEAUT32 added two new types to the SAFEARRAY, but SAFEARRAY
-       // previously included the "default" keyword, which prevented
-       // downlevel NDR engines from correctly handling any extensions.
-       // Machines with version >=5.3 don't use "default" and will
-       // gracefully handle future extensions to SAFEARRAY.
-       // old constants (for convenience)
-
-       // current version
+       /* COM_MINOR_VERSION = 1 (NT4.0, SP1, SP2, DCOM95). */
+       /* - Initial Release */
+       /* - Must be used when talking to downlevel machines, including */
+       /* on Remote Activation calls. */
+       /* COM_MINOR_VERSION = 2 (NT4.0 SP3 and beyond). */
+       /* - Added ResolveOxid2 to IObjectExporter to retrieve the */
+       /* COM version number of the server. Passed to the NDR engine */
+       /* to fix fatal endian-ness flaw in the way OLEAUTOMATION marshals */
+       /* BSTRS. Previous way used trailing padding, which is not NDR */
+       /* compatible. See Bug# 69189. */
+       /* COM_MINOR_VERSION = 3 (NT4.0 SP4 and DCOM95 builds 1018 and beyond) */
+       /* - OLEAUT32 added two new types to the SAFEARRAY, but SAFEARRAY */
+       /* previously included the "default" keyword, which prevented */
+       /* downlevel NDR engines from correctly handling any extensions. */
+       /* Machines with version >=5.3 don't use "default" and will */
+       /* gracefully handle future extensions to SAFEARRAY. */
+       /* old constants (for convenience) */
+
+       /* current version */
        const uint16 COM_MAJOR_VERSION = 5;
-       const uint16 COM_MINOR_VERSION = 6;
+       const uint16 COM_MINOR_VERSION = 1;
 
-       // Body Extensions
+       /* Body Extensions */
        const string dcom_ext_debugging = "f1f19680-4d2a-11ce-a66a-0020af6e72f4";
        const string dcom_ext_extended_error = "f1f19681-4d2a-11ce-a66a-0020af6e72f4";
 
-       // Component Object Model version number
+       /* Component Object Model version number */
 
        typedef [public] struct 
        {
-               uint16 MajorVersion; // Major version number
-               uint16 MinorVersion; // Minor version number
+               uint16 MajorVersion; /* Major version number */
+               uint16 MinorVersion; /* Minor version number */
        } COMVERSION;
 
-       typedef [public] struct 
-       {
-               uint32 reserved1;
-               uint32 reserved2;
-       } COSERVERINFO;
-
-       typedef [public] struct
-       {
-               uint32 FIXME;
-       } MULTI_QI;
-
-       // enumeration of additional information present in the call packet.
-       // Should be an enum but DCE IDL does not support sparse enumerators.
+       /* enumeration of additional information present in the call packet. */
        typedef enum {
-               ORPCF_NULL = 0, // no additional info in packet
-               ORPCF_LOCAL = 1, // call is local to this machine
-               ORPCF_RESERVED1 = 2, // reserved for local use
-               ORPCF_RESERVED2 = 4, // reserved for local use
-               ORPCF_RESERVED3 = 8, // reserved for local use
-               ORPCF_RESERVED4 = 16 // reserved for local use
+               ORPCF_NULL =                    0x00, /* no additional info in packet */
+               ORPCF_LOCAL =                   0x01, /* call is local to this machine */
+               ORPCF_RESERVED1 =               0x02, /* reserved for local use */
+               ORPCF_RESERVED2 =               0x04, /* reserved for local use */
+               ORPCF_RESERVED3 =               0x08, /* reserved for local use */
+               ORPCF_RESERVED4 =           0x10  /* reserved for local use */
        } ORPC_FLAGS;
 
-       // Extension to implicit parameters.
+       /* Extension to implicit parameters. */
        typedef [public] struct 
        {       
-               GUID id; // Extension identifier.
-               uint32 size; // Extension size.
-               //FIXME[size_is((size+7)&~7)] uint8 data[]; // Extension data.
+               GUID id; /* Extension identifier. */
+               uint32 size; /* Extension size. */
+               /*FIXME[size_is((size+7)&~7)] uint8 data[]; Extension data. */
                [size_is(size)] uint8 data[];
        }       ORPC_EXTENT;
 
 
-       // Array of extensions.
+       /* Array of extensions. */
        typedef struct 
        {
-               uint32 size; // Num extents.
-               uint32 reserved; // Must be zero.
-               //FIXME[size_is((size+1)&~1,), unique] ORPC_EXTENT **extent; // extents
+               uint32 size; /* Num extents. */
+               uint32 reserved; /* Must be zero. */
+               /*FIXME[size_is((size+1)&~1,), unique] ORPC_EXTENT **extent; extents */
                [size_is(size),unique] ORPC_EXTENT extent[];
        } ORPC_EXTENT_ARRAY;
 
 
-       // implicit 'this' pointer which is the first [in] parameter on
-       // every ORPC call.
+       /* implicit 'this' pointer which is the first [in] parameter on */
+       /* every ORPC call. */
        typedef [public] struct 
        {
-               COMVERSION version; // COM version number
-               uint32 flags; // ORPCF flags for presence of other data
-               uint32 reserved1; // set to zero
-               CID cid; // causality id of caller
-               // Extensions.
+               COMVERSION version; /* COM version number */
+               uint32 flags; /* ORPCF flags for presence of other data */
+               uint32 reserved1; /* set to zero */
+               GUID cid; /* causality id of caller */
+               /* Extensions. */
                [unique] ORPC_EXTENT_ARRAY *extensions;
        }       ORPCTHIS;
 
 
-       // implicit 'that' pointer which is the first [out] parameter on
-       // every ORPC call.
+       /* implicit 'that' pointer which is the first [out] parameter on */
+       /* every ORPC call. */
        typedef [public] struct 
        {
-               uint32 flags; // ORPCF flags for presence of other data
-               // Extensions.
+               uint32 flags; /* ORPCF flags for presence of other data */
+               /* Extensions. */
                [unique] ORPC_EXTENT_ARRAY *extensions;
        }       ORPCTHAT;
 
 
-       // DUALSTRINGARRAYS are the return type for arrays of network addresses,
-       // arrays of endpoints and arrays of both used in many ORPC interfaces
-       typedef struct 
+       /* DUALSTRINGARRAYS are the return type for arrays of network addresses, */
+       /* arrays of endpoints and arrays of both used in many ORPC interfaces */
+       typedef [public] struct 
        {
-               uint16 wTowerId; // Cannot be zero.
-               uint16 aNetworkAddr; // Zero terminated.
+               uint16 wTowerId; /* Cannot be zero. */
+               nstring NetworkAddr; 
        }       STRINGBINDING;
 
 
        const uint16 COM_C_AUTHZ_NONE = 0xffff;
-       typedef struct 
-       {
-               uint16 wAuthnSvc; // Cannot be zero.
-               uint16 wAuthzSvc; // Must not be zero.
-               uint16 aPrincName; // Zero terminated.
-       }       SECURITYBINDING;
-
-
        typedef [public] struct 
        {
-               uint16 wNumEntries; // Number of entries in array.
-               uint16 wSecurityOffset; // Offset of security info.
-               // The array contains two parts, a set of STRINGBINDINGs
-               // and a set of SECURITYBINDINGs. Each set is terminated by an
-               // extra zero. The shortest array contains four zeros.
-               [size_is(wNumEntries)] uint16 aStringArray[];
-       }       DUALSTRINGARRAY;
-
+               uint16 wAuthnSvc; /* Cannot be zero. */
+               nstring PrincName; 
+       }       SECURITYBINDING;
 
-       // signature value for OBJREF (object reference, actually the
-       // marshaled form of a COM interface).
-       const uint32 OBJREF_SIGNATURE = 0x574f454d; // 'MEOW'
+       /* signature value for OBJREF (object reference, actually the */
+       /* marshaled form of a COM interface). 
+        * MEOW apparently stands for "Microsoft Extended Object Wireformat"
+        */
+       const uint32 OBJREF_SIGNATURE = 0x574f454d; /* 'MEOW' */
 
-       // flag values for OBJREF
+       /* flag values for OBJREF */
        typedef enum {
-               OBJREF_NULL = 0x0, // NULL pointer
-               OBJREF_STANDARD = 0x1, // standard marshaled objref
-               OBJREF_HANDLER = 0x2, // handler marshaled objref
-               OBJREF_CUSTOM = 0x4 // custom marshaled objref
+               OBJREF_NULL = 0x0, /* NULL pointer */
+               OBJREF_STANDARD = 0x1, /* standard marshaled objref */
+               OBJREF_HANDLER = 0x2, /* handler marshaled objref */
+               OBJREF_CUSTOM = 0x4 /* custom marshaled objref */
        } OBJREF_FLAGS;
 
-       // Flag values for a STDOBJREF (standard part of an OBJREF).
-       // SORF_OXRES1 - SORF_OXRES8 are reserved for the object exporters
-       // use only, object importers must ignore them and must not enforce MBZ.
+       /* Flag values for a STDOBJREF (standard part of an OBJREF). */
+       /* SORF_OXRES1 - SORF_OXRES8 are reserved for the object exporters */
+       /* use only, object importers must ignore them and must not enforce MBZ. */
        typedef enum {
-               SORF_NULL   = 0x0000, // convenient for initializing SORF
-               SORF_OXRES1 = 0x0001, // reserved for exporter
-               SORF_OXRES2 = 0x0020, // reserved for exporter
-               SORF_OXRES3 = 0x0040, // reserved for exporter
-               SORF_OXRES4 = 0x0080, // reserved for exporter
-               SORF_OXRES5 = 0x0100, // reserved for exporter
-               SORF_OXRES6 = 0x0200, // reserved for exporter
-               SORF_OXRES7 = 0x0400, // reserved for exporter
-               SORF_OXRES8 = 0x0800, // reserved for exporter
-               SORF_NOPING = 0x1000  // Pinging is not required 
+               SORF_NULL   = 0x0000, /* convenient for initializing SORF */
+               SORF_OXRES1 = 0x0001, /* reserved for exporter */
+               SORF_OXRES2 = 0x0020, /* reserved for exporter */
+               SORF_OXRES3 = 0x0040, /* reserved for exporter */
+               SORF_OXRES4 = 0x0080, /* reserved for exporter */
+               SORF_OXRES5 = 0x0100, /* reserved for exporter */
+               SORF_OXRES6 = 0x0200, /* reserved for exporter */
+               SORF_OXRES7 = 0x0400, /* reserved for exporter */
+               SORF_OXRES8 = 0x0800, /* reserved for exporter */
+               SORF_NOPING = 0x1000  /* Pinging is not required  */
        } STDOBJREF_FLAGS;
 
-       // standard object reference
+       /* standard object reference */
        typedef [public] struct 
        {
-               uint32 flags; // STDOBJREF flags (see above)
-               uint32 cPublicRefs; // count of references passed
-               OXID oxid; // oxid of server with this oid
-               OID oid; // oid of object with this ipid
-               IPID ipid; // ipid of Interface
+               uint32 flags; /* STDOBJREF flags (see above) */
+               uint32 cPublicRefs; /* count of references passed */
+               HYPER_T oxid; /* oxid of server with this oid */
+               HYPER_T oid; /* oid of object with this ipid */
+               GUID ipid; /* ipid of interface pointer to this object */
        }       STDOBJREF;
 
        typedef struct
        {
-               STDOBJREF std; // standard objref
-               DUALSTRINGARRAY saResAddr; // resolver address
+               STDOBJREF std; /* standard objref */
+               STRINGARRAY saResAddr; /* resolver address */
        } u_standard;
 
        typedef struct
        {
-               STDOBJREF std; // standard objref
-               GUID clsid; // Clsid of handler code
-               DUALSTRINGARRAY saResAddr; // resolver address
+               STDOBJREF std; /* standard objref */
+               GUID clsid; /* Clsid of handler code */
+               STRINGARRAY saResAddr; /* resolver address */
        } u_handler;
 
        typedef struct
        {
-               GUID clsid; // Clsid of unmarshaling code
-               uint32 cbExtension; // size of extension data
-               uint32 size; // size of data that follows
-               [size_is(size), ref] uint8 *pData; // extension + class specific data
+               GUID clsid; /* Clsid of unmarshaling code */
+               uint32 cbExtension; /* size of extension data */
+               uint32 size; /* size of data that follows */
+               uint8 pData[size]; /* extension + class specific data */
        } u_custom;
 
        typedef struct
@@ -250,28 +195,28 @@ interface ObjectRpcBaseTypes
                [case(OBJREF_CUSTOM)] u_custom u_custom;
        } OBJREF_Types;
 
-       // OBJREF is the format of a marshaled interface pointer.
-       typedef [public] struct 
+       /* OBJREF is the format of a marshaled interface pointer. */
+       typedef [public,flag(NDR_LITTLE_ENDIAN)] struct 
        {
                uint32 signature;
-               uint32 flags; // OBJREF flags (see above)
-               GUID iid; // interface identifier
+               uint32 flags; /* OBJREF flags (see above) */
+               GUID iid; /* interface identifier */
                [switch_is(flags), switch_type(uint32)] OBJREF_Types u_objref;
        } OBJREF;
 
-       // wire representation of a marshalled interface pointer
+       /* wire representation of a marshalled interface pointer */
        typedef [public] struct 
        {
                uint32 size;
-               [size_is(size)] uint8 data[];
+               [subcontext(4)] OBJREF obj;
        } MInterfacePointer;
 }
 
 
 [
        object,
-       uuid(00000000-0000-0000-C000-000000000046),
-       helpstring("Base interface for most COM interfaces")
+       uuid("00000000-0000-0000-C000-000000000046"),
+       helpstring("Base interface for all COM interfaces")
 ]
 interface IUnknown
 {
@@ -279,49 +224,47 @@ interface IUnknown
        /* Function 0x00 */
        /* Returns the interface with the specified IID 
           if implemented by this object */
-       HRESULT QueryInterface([in] IID *riid
-          /*FIXME, [out] void **data*/);
+       [local] WERROR QueryInterface([in] GUID *iid,
+          [out,iid_is(riid)] MInterfacePointer *data);
 
        /*****************/
        /* Function 0x01 */
-       uint32 AddRef();
+       [local] uint32 AddRef();
 
        /*****************/
        /* Function 0x02 */
-       uint32 Release();
+       [local] uint32 Release();
 }
 
 
 [
        object,
-       uuid(00000001-0000-0000-C000-000000000046),
+       uuid("00000001-0000-0000-C000-000000000046"),
        pointer_default(unique)
 ] interface IClassFactory : IUnknown
 {
-       HRESULT CreateInstance(/*FIXME[in] IUnknown *pUnknown, 
-                              [in] IID *riid,
-                              [out, iid_is(riid)] void **ppv*/);
+       [local] WERROR CreateInstance([in] MInterfacePointer *pUnknown, 
+                              [in] GUID *iid,
+                              [out, iid_is(riid)] MInterfacePointer *ppv);
 
-       HRESULT RemoteCreateInstance();
+       [call_as(CreateInstance)] WERROR RemoteCreateInstance();
 
        /* Set lock to TRUE when you want to do a lock
        and set it to FALSE when you want to unlock */
-       HRESULT LockServer([in] uint8 lock);
+       [local] WERROR LockServer([in] uint8 lock);
 
-       HRESULT RemoteLockServer();
+       [call_as(LockServer)] WERROR RemoteLockServer();
 }
 
-//////////////////////////////////////////////////////////////////
-
-// The remote version of IUnknown. This interface exists on every
-// OXID (whether an OXID represents either a thread or a process is
-// implementation specific). It is used by clients to query for new
-// interfaces, get additional references (for marshaling), and release
-// outstanding references.
-// This interface is passed along during OXID resolution.
-//
+/* The remote version of IUnknown. This interface exists on every */
+/* OXID (whether an OXID represents either a thread or a process is */
+/* implementation specific). It is used by clients to query for new */
+/* interfaces, get additional references (for marshaling), and release */
+/* outstanding references. */
+/* This interface is passed along during OXID resolution. */
+/* */
 [
-       uuid(00000131-0000-0000-C000-000000000046),
+       uuid("00000131-0000-0000-C000-000000000046"),
        object,
        helpstring("Remote version of IUnknown")
 ]
@@ -329,59 +272,67 @@ interface IRemUnknown : IUnknown
 {
        typedef [public] struct 
        {
-               HRESULT hResult; // result of call
-               STDOBJREF std; // data for returned interface
+               WERROR hResult; /* result of call */
+               STDOBJREF std; /* data for returned interface */
        }
        REMQIRESULT;
 
-       HRESULT RemQueryInterface (
-                [in] IPID *ripid, // interface to QI on
-                [in] uint32 cRefs, // count of AddRefs requested
-                [in] uint16 cIids, // count of IIDs that follow
-                [in, size_is(cIids)] IID* iids, //, // IIDs to QI for
-                [out] MInterfacePointer *ip
+       [call_as(QueryInterface)] WERROR RemQueryInterface (
+               [in] GUID *ripid, /* interface to QI on */
+               [in] uint32 cRefs, /* count of AddRefs requested */
+               [in] uint16 cIids, /* count of IIDs that follow */
+               [in, size_is(cIids)] GUID* iids, /* IIDs to QI for */
+               [out, size_is(cIids)] MInterfacePointer *ip
                );
 
        typedef struct 
        {
-               IPID ipid; // ipid to AddRef/Release
+               GUID ipid; /* ipid to AddRef/Release */
                uint32 cPublicRefs;
                uint32 cPrivateRefs;
        } REMINTERFACEREF;
 
-       HRESULT RemAddRef (
+       [call_as(AddRef)] WERROR RemAddRef (
                 [in] uint16 cInterfaceRefs,
                 [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[],
-                [out, size_is(cInterfaceRefs)] HRESULT* pResults
+                [out, size_is(cInterfaceRefs)] WERROR* pResults
                );
 
-       HRESULT RemRelease (
+       [call_as(Release)] WERROR RemRelease (
                 [in] uint16 cInterfaceRefs,
                 [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[]
                );
 }
 
 [
-       uuid(00000140-0000-0000-c000-000000000046),
+       uuid("00000140-0000-0000-c000-000000000046"),
        object
 ] interface IClassActivator : IUnknown
 {
-       void RemoteGetClassObject([in] GUID clsid, 
-                                                                                         [in] uint32 context,
-                                                                                         [in] LCID locale,
-                                                                                         [in] GUID iid/*FIXME,
-                                                                                         [out, iid_is(iid)] void *data */);
+       void GetClassObject([in] GUID clsid, 
+                               [in] uint32 context,
+                                               [in] uint32 locale,
+                                               [in] GUID iid,
+                                               [out, iid_is(iid)] MInterfacePointer data);
+}
+
+[
+       uuid("00000136-0000-0000-c000-000000000046"),
+       object
+] interface ISCMLocalActivator : IClassActivator
+{
+       WERROR ISCMLocalActivator_CreateInstance( );
 }
 
 /* Looks like this is the equivalent of .NET's 
    System.Activator class */
 [
-       uuid(000001a0-0000-0000-c000-000000000046),
+       uuid("000001a0-0000-0000-c000-000000000046"),
        object
 ]
        interface ISystemActivator : IClassActivator
 {
-       HRESULT ISystemActivatorRemoteCreateInstance([in] HYPER_T unknown1,  /* IPID ? */
+       WERROR ISystemActivatorRemoteCreateInstance([in] HYPER_T unknown1,  /* OXID ? */
                                                                                          [in] MInterfacePointer iface,
                                                                                          [in] HYPER_T unknown2,
                                                                                          [out] uint32 unknown3, 
@@ -390,67 +341,61 @@ interface IRemUnknown : IUnknown
 
 
 
-// Derived from IRemUnknown, this interface supports Remote Query interface
-// for objects that supply additional data beyond the STDOBJREF in their
-// marshaled interface packets.
+/* Derived from IRemUnknown, this interface supports Remote Query interface */
+/* for objects that supply additional data beyond the STDOBJREF in their */
+/* marshaled interface packets. */
 [
        object,
-       uuid(00000143-0000-0000-C000-000000000046)
+       uuid("00000143-0000-0000-C000-000000000046")
 ]
 
 interface IRemUnknown2 : IRemUnknown
 {
-       HRESULT RemQueryInterface2 (
-                [in] IPID *ripid,
+       [call_as(QueryInterface2)] WERROR RemQueryInterface2 (
+                [in] GUID *ripid,
                 [in] uint16 cIids,
-                [in, size_is(cIids)] IID *iids,
-                [out, size_is(cIids)] HRESULT *phr,
+                [in, size_is(cIids)] GUID*iids,
+                [out, size_is(cIids)] WERROR *phr,
                 [out, size_is(cIids)] MInterfacePointer *ppMIF
                );
 }
 
 [
 object,
-       uuid(00000136-0000-0000-C000-000000000046)
-       ] interface ISCMActivator : IUnknown
+       uuid("00000136-0000-0000-C000-000000000046")
+       ] interface ISCMActivator : IClassActivator
 {
-       WERROR SCMActivator_GetClassObject();
        WERROR SCMActivator_CreateInstance();
 }
 
 [
        object,
-       uuid(00020400-0000-0000-C000-000000000046)
+       uuid("00020400-0000-0000-C000-000000000046")
        ] interface IDispatch : IUnknown
 {
        /*****************/
        /* Function 0x03 */
-       HRESULT GetTypeInfoCount(
+       WERROR GetTypeInfoCount(
                        [out] uint16 *pctinfo);
 
        typedef struct {
-               uint8 FIXME;
-       } ITypeInfo;
-
-       typedef struct {
-               ITypeInfo *pTInfo;
        } REF_ITypeInfo;
 
        /*****************/
        /* Function 0x04 */
-       HRESULT GetTypeInfo (
+       WERROR GetTypeInfo (
                        [in] uint16 iTInfo,
-                       [in] LCID lcid,
+                       [in] uint32 lcid,
                        [out] REF_ITypeInfo *ppTInfo);
 
        /*****************/
        /* Function 0x05 */
-       HRESULT GetIDsOfNames(
-                       [in] IID *riid,
+       WERROR GetIDsOfNames(
+                       [in] GUID *riid,
                        /*FIXME[in,size_is(cNames)] OLESTR *rgszNames[], */
                        [in] uint16 cNames,
-                       [in] LCID lcid,
-                       [out,size_is(cNames)] DISPID *rgDispId);
+                       [in] uint32 lcid,
+                       [out,size_is(cNames)] uint32 *rgDispId);
 
        typedef struct {
                uint16 vartype;
@@ -468,10 +413,10 @@ object,
 
        /*****************/
        /* Function 0x06 */
-       HRESULT Invoke(
-                       [in] DISPID dispIdMember,
-                       [in] IID *riid,
-                       [in] LCID lcid,
+       WERROR Invoke(
+                       [in] uint32 dispIdMember,
+                       [in] GUID *riid,
+                       [in] uint32 lcid,
                        [in] uint16 wFlags,
                        [out,in] DISPPARAMS *pDispParams,
                        [out] VARIANT *pVarResult,
@@ -480,20 +425,48 @@ object,
 }
 
 [
-object,
-       uuid(330E9E75-DF48-11CF-8E2C-00A0C90DC94B),
+       object,
+       local,
+       uuid("00000003-0000-0000-C000-000000000046")
+] interface IMarshal : IUnknown
+{
+       WERROR MarshalInterface();
+       WERROR UnMarshalInterface();
+}
+
+[
+uuid(DB7C21F8-FE33-4C11-AEA5-CEB56F076FBB),
+       helpstring("CoffeeMachine Class")
+] coclass CoffeeMachine
+{
+       [
+       uuid(DA23F6DB-6F45-466C-9EED-0B65286F2D78),
+       helpstring("ICoffeeMachine Interface"),
        pointer_default(unique)
        ]
-       interface IDcomEchoServ : IDispatch
-{
-       HRESULT EchoPlusOne([in] uint32 x, [out] uint32 *y);
+
+       interface ICoffeeMachine : IUnknown
+       {
+               [helpstring("method MakeCoffee")] HRESULT MakeCoffee(BSTR *flavor);
+       }
 }
 
 [
        object,
-       uuid(00000003-0000-0000-C000-000000000046)
-] interface IMarshal : IUnknown
+       uuid("0000000C-0000-0000-C000-000000000046"),
+       helpstring("Stream")
+]
+interface IStream : IUnknown
 {
-       HRESULT MarshalInterface();
-       HRESULT UnMarshalInterface();
+       WERROR Read(
+                               [out, size_is(num_requested), length_is(num_read)] uint8 pv[],
+                               [in] uint32 num_requested, 
+                               [in] uint32 *num_readx,
+                               [out] uint32 num_read
+                               );
+
+       WERROR Write(
+                               [in,size_is(num_requested)] uint8 *data,
+                                [in] uint32 num_requested,
+                                [out] uint32 num_written);
 }