1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r8559: Couple of (D)COM updates:

- 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 commit is contained in:
Jelmer Vernooij 2005-07-18 23:58:59 +00:00 committed by Gerald (Jerry) Carter
parent b6ef32ddd1
commit bd706d4964
8 changed files with 20 additions and 14 deletions

View 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});
}

View 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") {

View 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

View 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[]
);
}

View File

@ -1,4 +1,6 @@
#!/bin/sh
# Bootstrap Samba and run a number of tests against it.
DOMAIN=SAMBADOMAIN
USERNAME=administrator
REALM=$DOMAIN

0
source/script/tests/test_functions.sh Normal file → Executable file
View File

View 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;

View File

@ -24,24 +24,25 @@
#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);