r8559: Couple of (D)COM updates:
authorJelmer Vernooij <jelmer@samba.org>
Mon, 18 Jul 2005 23:58:59 +0000 (23:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:38 +0000 (13:29 -0500)
 - Fixes annoying array-of-pointers bug in pidl.
 - No longer "inherit" alignment thru subcontexts
 - Use "Image Object" as example DCOM object, rather then the "My Computer" object, which is built-in and can't be accessed remotely as far as I can see
(This used to be commit bd706d496405d274b68c1ee560211837a8e63009)

source4/build/pidl/Parse/Pidl/NDR.pm
source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm
source4/build/pidl/TODO
source4/librpc/idl/remact.idl
source4/script/tests/selftest.sh
source4/script/tests/test_functions.sh [changed mode: 0644->0755]
source4/torture/rpc/oxidresolve.c
source4/torture/rpc/remact.c

index e039934b1b8a8c4e72805309b197102e0b50abaf..0c2b00539dc4077052bb7f805c60cbbcc560652b 100644 (file)
@@ -257,7 +257,9 @@ sub find_largest_alignment($)
 
                if ($e->{POINTERS}) {
                        $a = 4; 
-               } else { 
+               } elsif (has_property($e, "subcontext")){ 
+                       $a = 1;
+               } else {
                        $a = align_type($e->{TYPE}); 
                }
 
index b281dae9e76e68f3d5b2ae42bfb3cacf2cdf0868..bf245c0ac65247c3f13e9591b13836ca669886f8 100644 (file)
@@ -231,7 +231,7 @@ sub ParseArrayPushHeader($$$$$)
        }
        
        if ($l->{IS_VARYING}) {
-               pidl "NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, 0));";
+               pidl "NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, 0));";  # array offset
                pidl "NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, $length));";
        } 
 
@@ -552,7 +552,7 @@ sub ParseElementPushLevel
                        }
                }
                $var_name = get_value_of($var_name);
-               ParseElementPushLevel($e, Parse::Pidl::NDR::GetNextLevel($e, $l), $ndr, $var_name, $env, $primitives, $deferred);
+               ParseElementPushLevel($e, Parse::Pidl::NDR::GetNextLevel($e, $l), $ndr, $var_name, $env, 1, 1);
 
                if ($l->{POINTER_TYPE} ne "ref") {
                        deindent;
@@ -865,7 +865,7 @@ sub ParseElementPullLevel
                }
 
                $var_name = get_value_of($var_name);
-               ParseElementPullLevel($e,Parse::Pidl::NDR::GetNextLevel($e,$l), $ndr, $var_name, $env, $primitives, $deferred);
+               ParseElementPullLevel($e,Parse::Pidl::NDR::GetNextLevel($e,$l), $ndr, $var_name, $env, 1, 1);
 
                if ($l->{POINTER_TYPE} ne "ref") {
                        if ($l->{POINTER_TYPE} eq "relative") {
index 00f875e00d72f09db7ad43b030ce185bc421abd5..860b5d912c83be1dbec11722fa4c0aa2f4f4fea9 100644 (file)
@@ -4,3 +4,6 @@
 - compatibility mode for generating MIDL-readable data:
  - strip out pidl-specific properties
  - convert subcontext() to an array of uint8.
+
+- don't be so strict on array boundaries.. arrays can and will be empty when 
+  a (regular) remote error occurs
index 6f64a5c02c543e67bed0bac667cc993ebeec75e3..05192e31a554fa74537fc36e11507c808679340b 100644 (file)
@@ -23,10 +23,6 @@ interface IRemoteActivation
                RPC_C_IMP_LEVEL_DELEGATE = 4
        } imp_levels;
 
-       typedef struct {
-               MInterfacePointer *ip;
-       } pMInterfacePointer;
-
        const uint32 MODE_GET_CLASS_OBJECT = 0xffffffff;
        WERROR RemoteActivation (
                        [in] ORPCTHIS this,
@@ -46,7 +42,7 @@ interface IRemoteActivation
                        [out] uint32 AuthnHint,
                        [out] COMVERSION ServerVersion,
                        [out] WERROR hr,
-                       [out,size_is(Interfaces)] pMInterfacePointer ifaces[],
+                       [out,size_is(Interfaces)] MInterfacePointer *ifaces[],
                        [out,size_is(Interfaces)] WERROR results[]
                        );
 }
index 6579623e2c3ef5258263e920a11cf6bd2fefd3c4..9b0c5f3a4afeaa35713c3bfa454e661532b7a822 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/sh
+# Bootstrap Samba and run a number of tests against it.
+
 DOMAIN=SAMBADOMAIN
 USERNAME=administrator
 REALM=$DOMAIN
old mode 100644 (file)
new mode 100755 (executable)
index 3b0269891cbf5362a3f1983e2906b49c3b9747fc..8bb1a7ae0ab80efe013c25c3f1909589456e5acb 100644 (file)
@@ -25,6 +25,8 @@
 #include "librpc/gen_ndr/ndr_epmapper.h"
 #include "librpc/gen_ndr/com_dcom.h"
 
+#define CLSID_IMAGEDOC "02B01C80-E03D-101A-B294-00DD010F2BF9"
+
 static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t *oxid, struct GUID *oid)
 {
        struct RemoteActivation r;
@@ -36,7 +38,7 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uin
        r.in.this.version.MajorVersion = 5;
        r.in.this.version.MinorVersion = 1;
        r.in.this.cid = GUID_random();
-       GUID_from_string(CLSID_SIMPLE, &r.in.Clsid);
+       GUID_from_string(CLSID_IMAGEDOC, &r.in.Clsid);
        r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
        r.in.num_protseqs = 3;
        r.in.protseq = protseq;
index 1d145dd1cb2fc2f458821bd934272c419eeaec97..bbda1978546478eacb9f30666259f738f0aae7f2 100644 (file)
 #include "librpc/gen_ndr/ndr_epmapper.h"
 #include "librpc/gen_ndr/com_dcom.h"
 
+#define CLSID_IMAGEDOC "02B01C80-E03D-101A-B294-00DD010F2BF9"
+
 static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 {
        struct RemoteActivation r;
        NTSTATUS status;
-       struct GUID iids[2];
+       struct GUID iids[1];
        uint16_t protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID };
 
        ZERO_STRUCT(r.in);
        r.in.this.version.MajorVersion = 5;
        r.in.this.version.MinorVersion = 1;
        r.in.this.cid = GUID_random();
-       GUID_from_string(CLSID_SIMPLE, &r.in.Clsid);
+       GUID_from_string(CLSID_IMAGEDOC, &r.in.Clsid);
        r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
        r.in.num_protseqs = 3;
        r.in.protseq = protseq;
-       r.in.Interfaces = 2;
+       r.in.Interfaces = 1;
        GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]);
-       GUID_from_string(DCERPC_ISTREAM_UUID, &iids[1]);
        r.in.pIIDs = iids;
 
        status = dcerpc_RemoteActivation(p, mem_ctx, &r);