r3626: More minor DCOM fixes
authorJelmer Vernooij <jelmer@samba.org>
Mon, 8 Nov 2004 22:18:18 +0000 (22:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:05:40 +0000 (13:05 -0500)
(This used to be commit 709f279b192c8f9eeea04749169c00f2d57b20d3)

source4/build/pidl/client.pm
source4/build/pidl/parser.pm
source4/lib/dcom/common/main.c
source4/librpc/idl/dcom.idl
source4/torture/rpc/epmapper.c

index 1c0baa16f84cb157a28fcdd6e59575dffc3562ed..549a5d0dd35339df954b1d8ec1f63773af1b30ac 100644 (file)
@@ -35,8 +35,8 @@ struct rpc_request *dcerpc_$name\_send(struct dcom_interface *d, TALLOC_CTX *mem
        }
 
        ZERO_STRUCT(r->in.ORPCthis);
-       r->in.ORPCthis.version.MajorVersion = 5;
-       r->in.ORPCthis.version.MinorVersion = 1;
+       r->in.ORPCthis.version.MajorVersion = COM_MAJOR_VERSION;
+       r->in.ORPCthis.version.MinorVersion = COM_MINOR_VERSION;
 
 ";
        } else {
index 2ace0fdd8f8424d2bb0b366fcd4c358f300af2b8..fd95f916652c17bd1737efd1e44ce833b1793833 100644 (file)
@@ -1316,10 +1316,6 @@ sub ParseFunctionPush($)
 
        pidl "\n\tif (!(flags & NDR_IN)) goto ndr_out;\n\n";
 
-       if (util::has_property($fn, "object")) {
-               # FIXME: Set COM version and possibly causality ID 
-       }
-       
        foreach my $e (@{$fn->{DATA}}) {
                if (util::has_property($e, "in")) {
                        ParseFunctionElementPush($e, "in");
index c276b5e61a1131cbb2e966e81fad9dffe972bcd4..b2cb782953634fe7f8f4cd01615a2989fb6ab0ea 100644 (file)
@@ -115,6 +115,13 @@ WERROR dcom_init(struct dcom_context **ctx, const char *domain, const char *user
        return WERR_OK;
 }
 
+WERROR dcom_ping(struct dcom_context *ctx)
+{
+       /* FIXME: If OID's waiting in queue, do a ComplexPing call */
+       /* FIXME: otherwise, do a SimplePing call */
+       return WERR_OK;
+}
+
 WERROR dcom_create_object(struct dcom_context *ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct dcom_interface **ip, WERROR *results)
 {
        struct dcom_oxid_mapping *m;
@@ -131,8 +138,8 @@ WERROR dcom_create_object(struct dcom_context *ctx, struct GUID *clsid, const ch
        }
 
        ZERO_STRUCT(r.in);
-       r.in.this.version.MajorVersion = 5;
-       r.in.this.version.MinorVersion = 1;
+       r.in.this.version.MajorVersion = COM_MAJOR_VERSION;
+       r.in.this.version.MinorVersion = COM_MINOR_VERSION;
        uuid_generate_random(&r.in.this.cid);
        r.in.Clsid = *clsid;
        r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
@@ -171,7 +178,7 @@ WERROR dcom_create_object(struct dcom_context *ctx, struct GUID *clsid, const ch
        m->oxid = r.out.pOxid;
        m->bindings = *r.out.pdsaOxidBindings;
        DLIST_ADD(ctx->oxids, m);
-
+       
        return WERR_OK;
 }
 
@@ -191,8 +198,8 @@ WERROR dcom_get_class_object(struct dcom_context *ctx, struct GUID *clsid, const
        }
 
        ZERO_STRUCT(r.in);
-       r.in.this.version.MajorVersion = 5;
-       r.in.this.version.MinorVersion = 1;
+       r.in.this.version.MajorVersion = COM_MAJOR_VERSION;
+       r.in.this.version.MinorVersion = COM_MINOR_VERSION;
        uuid_generate_random(&r.in.this.cid);
        r.in.Clsid = *clsid;
        r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
index 10e63772dd80714d588b66f026ad578f9caefffa..165d47473ab71dd4d601826acb116a54337c4fff 100644 (file)
        void dcomu_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 */
        /*//////////////////////////////////////////////////////////////// */
@@ -70,7 +42,7 @@ interface ObjectRpcBaseTypes
 
        /* current version */
        const uint16 COM_MAJOR_VERSION = 5;
-       const uint16 COM_MINOR_VERSION = 6;
+       const uint16 COM_MINOR_VERSION = 1;
 
        /* Body Extensions */
        const string dcom_ext_debugging = "f1f19680-4d2a-11ce-a66a-0020af6e72f4";
@@ -84,17 +56,6 @@ interface ObjectRpcBaseTypes
                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. */
        typedef enum {
@@ -133,7 +94,7 @@ interface ObjectRpcBaseTypes
                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 */
+               GUID cid; /* causality id of caller */
                /* Extensions. */
                [unique] ORPC_EXTENT_ARRAY *extensions;
        }       ORPCTHIS;
@@ -198,9 +159,9 @@ interface ObjectRpcBaseTypes
        {
                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 pointer to this object */
+               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
@@ -221,7 +182,7 @@ interface ObjectRpcBaseTypes
                GUID clsid; /* Clsid of unmarshaling code */
                uint32 cbExtension; /* size of extension data */
                uint32 size; /* size of data that follows */
-               [size_is(size)] uint8 pData[]; /* extension + class specific data */
+               uint8 pData[size]; /* extension + class specific data */
        } u_custom;
 
        typedef struct
@@ -265,7 +226,7 @@ interface IUnknown
        /* Function 0x00 */
        /* Returns the interface with the specified IID 
           if implemented by this object */
-       [local] WERROR IUnknown_QueryInterface([in] IID *riid,
+       [local] WERROR IUnknown_QueryInterface([in] GUID *iid,
           [out,iid_is(riid)] MInterfacePointer *data);
 
        /*****************/
@@ -285,7 +246,7 @@ interface IUnknown
 ] interface IClassFactory : IUnknown
 {
        [local] WERROR CreateInstance(/*FIXME[in] IUnknown *pUnknown*/, 
-                              [in] IID *riid,
+                              [in] GUID *iid,
                               [out, iid_is(riid)] MInterfacePointer *ppv);
 
        [call_as(CreateInstance)] WERROR RemoteCreateInstance();
@@ -321,16 +282,16 @@ interface IRemUnknown : IUnknown
        REMQIRESULT;
 
        [call_as(QueryInterface)] WERROR RemQueryInterface (
-               [in] IPID *ripid, /* interface to QI on */
+               [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)] IID* iids, /*, // IIDs to QI for */
+               [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;
@@ -354,7 +315,7 @@ interface IRemUnknown : IUnknown
 {
        void GetClassObject([in] GUID clsid, 
                                [in] uint32 context,
-                                               [in] LCID locale,
+                                               [in] uint32 locale,
                                                [in] GUID iid,
                                                [out, iid_is(iid)] MInterfacePointer data);
 }
@@ -395,9 +356,9 @@ interface IRemUnknown : IUnknown
 interface IRemUnknown2 : IRemUnknown
 {
        [call_as(QueryInterface2)] WERROR RemQueryInterface2 (
-                [in] IPID *ripid,
+                [in] GUID *ripid,
                 [in] uint16 cIids,
-                [in, size_is(cIids)] IID *iids,
+                [in, size_is(cIids)] GUID*iids,
                 [out, size_is(cIids)] WERROR *phr,
                 [out, size_is(cIids)] MInterfacePointer *ppMIF
                );
@@ -428,17 +389,17 @@ object,
        /* Function 0x04 */
        WERROR GetTypeInfo (
                        [in] uint16 iTInfo,
-                       [in] LCID lcid,
+                       [in] uint32 lcid,
                        [out] REF_ITypeInfo *ppTInfo);
 
        /*****************/
        /* Function 0x05 */
        WERROR GetIDsOfNames(
-                       [in] IID *riid,
+                       [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;
@@ -457,9 +418,9 @@ object,
        /*****************/
        /* Function 0x06 */
        WERROR Invoke(
-                       [in] DISPID dispIdMember,
-                       [in] IID *riid,
-                       [in] LCID lcid,
+                       [in] uint32 dispIdMember,
+                       [in] GUID *riid,
+                       [in] uint32 lcid,
                        [in] uint16 wFlags,
                        [out,in] DISPPARAMS *pDispParams,
                        [out] VARIANT *pVarResult,
index 714e6f3f8c1597ec9b2f3ca630fca3f2764a2256..c3a847684f50af0fe4d71cd57998f96cc19410e3 100644 (file)
@@ -182,6 +182,19 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                }
        }
 
+       twr->tower.floors[3].lhs.protocol = EPM_PROTOCOL_UDP;
+       twr->tower.floors[3].lhs.info.lhs_data = data_blob(NULL, 0);
+       twr->tower.floors[3].rhs.http.port = 0;
+
+       status = dcerpc_epm_Map(p, mem_ctx, &r);
+       if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
+               for (i=0;i<r.out.num_towers;i++) {
+                       if (r.out.towers[i].twr) {
+                               display_tower(mem_ctx, &r.out.towers[i].twr->tower);
+                       }
+               }
+       }
+
        twr->tower.floors[3].lhs.protocol = EPM_PROTOCOL_SMB;
        twr->tower.floors[3].lhs.info.lhs_data = data_blob(NULL, 0);
        twr->tower.floors[3].rhs.smb.unc = "";