summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-03 20:32:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:23 -0500
commit6d3c74a67b935f348777feb3fac7653a9c4277a8 (patch)
treebf051f28dabe9bd91ea5d39f3b7ba38bdb77cc88 /source4/build
parente0e6e0f99d9c7645e1809a3bde1a6ab01843de67 (diff)
downloadsamba-6d3c74a67b935f348777feb3fac7653a9c4277a8.tar.gz
samba-6d3c74a67b935f348777feb3fac7653a9c4277a8.tar.bz2
samba-6d3c74a67b935f348777feb3fac7653a9c4277a8.zip
r3513: Add (the infrastructure for) DCOM support. Contents:
- Support for sending over the object UUID in DCERPC calls - Simple torture test for the DCOM "Simple" object - Generate extra argument for "object" interfaces in pidl - Some stubs for common DCOM functions (This used to be commit c052f2e1edd816206d8974af3140cec7ef97a70c)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/client.pm16
-rw-r--r--source4/build/pidl/header.pm9
-rw-r--r--source4/build/pidl/idl.pm1
-rw-r--r--source4/build/pidl/idl.yp1
-rw-r--r--source4/build/pidl/parser.pm12
5 files changed, 32 insertions, 7 deletions
diff --git a/source4/build/pidl/client.pm b/source4/build/pidl/client.pm
index c2c2c622ae..10ae81ec18 100644
--- a/source4/build/pidl/client.pm
+++ b/source4/build/pidl/client.pm
@@ -19,15 +19,22 @@ sub ParseFunction($)
return if (util::has_property($fn, "local"));
+ my $objargdef = "";
+ my $objarg = ", NULL";
+ if (util::has_property($fn, "object")) {
+ $objargdef = ", struct GUID *object";
+ $objarg = ", object";
+ }
+
$res .=
"
-struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)
+struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p$objargdef, TALLOC_CTX *mem_ctx, struct $name *r)
{
if (p->flags & DCERPC_DEBUG_PRINT_IN) {
NDR_PRINT_IN_DEBUG($name, r);
}
- return dcerpc_ndr_request_send(p, DCERPC_$uname, mem_ctx,
+ return dcerpc_ndr_request_send(p$objarg, DCERPC_$uname, mem_ctx,
(ndr_push_flags_fn_t) ndr_push_$name,
(ndr_pull_flags_fn_t) ndr_pull_$name,
r, sizeof(*r));
@@ -35,11 +42,12 @@ struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct
";
+ $objarg = "" unless (util::has_property($fn, "object"));
$res .=
"
-NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)
+NTSTATUS dcerpc_$name(struct dcerpc_pipe *p$objargdef, TALLOC_CTX *mem_ctx, struct $name *r)
{
- struct rpc_request *req = dcerpc_$name\_send(p, mem_ctx, r);
+ struct rpc_request *req = dcerpc_$name\_send(p$objarg, mem_ctx, r);
NTSTATUS status;
if (req == NULL) return NT_STATUS_NO_MEMORY;
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index ac0f0f8f11..3f652bd4a1 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -304,10 +304,15 @@ sub HeaderFnProto($)
my $name = $fn->{NAME};
return if (util::has_property($fn, "call_as") );
+
+ my $objarg = "";
+ if (util::has_property($fn, "object")) {
+ $objarg = ", struct GUID *";
+ }
$res .= "void ndr_print_$name(struct ndr_print *, const char *, int, struct $name *);\n";
- $res .= "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *, TALLOC_CTX *, struct $name *);\n";
- $res .= "NTSTATUS dcerpc_$name(struct dcerpc_pipe *, TALLOC_CTX *, struct $name *);\n";
+ $res .= "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *$objarg, TALLOC_CTX *, struct $name *);\n";
+ $res .= "NTSTATUS dcerpc_$name(struct dcerpc_pipe *$objarg, TALLOC_CTX *, struct $name *);\n";
$res .= "\n";
}
diff --git a/source4/build/pidl/idl.pm b/source4/build/pidl/idl.pm
index 3adcca946a..19525e42f3 100644
--- a/source4/build/pidl/idl.pm
+++ b/source4/build/pidl/idl.pm
@@ -2055,6 +2055,7 @@ sub parse_idl($$)
if (defined($x->{PROPERTIES}->{object})) {
foreach my $e (@{$x->{DATA}}) {
if($e->{TYPE} eq "FUNCTION") {
+ $e->{PROPERTIES}->{object} = 1;
unshift(@{$e->{DATA}},
{ 'NAME' => 'ORPCthis',
'POINTERS' => 0,
diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp
index f512985ea0..24f88dd531 100644
--- a/source4/build/pidl/idl.yp
+++ b/source4/build/pidl/idl.yp
@@ -343,6 +343,7 @@ sub parse_idl($$)
if (defined($x->{PROPERTIES}->{object})) {
foreach my $e (@{$x->{DATA}}) {
if($e->{TYPE} eq "FUNCTION") {
+ $e->{PROPERTIES}->{object} = 1;
unshift(@{$e->{DATA}},
{ 'NAME' => 'ORPCthis',
'POINTERS' => 0,
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 34f9df197f..39ec8a89a0 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -162,7 +162,10 @@ sub struct_alignment
for my $e (@{$s->{ELEMENTS}}) {
my $a = 1;
- if (!util::need_wire_pointer($e)
+ if (util::has_property($e, "align"))
+ {
+ $a = $e->{PROPERTIES}->{align};
+ } elsif (!util::need_wire_pointer($e)
&& defined $structs{$e->{TYPE}}) {
if ($structs{$e->{TYPE}}->{DATA}->{TYPE} eq "STRUCT") {
$a = struct_alignment($structs{$e->{TYPE}}->{DATA});
@@ -1315,6 +1318,11 @@ sub ParseFunctionPush($)
pidl $static . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, struct $fn->{NAME} *r)\n{\n";
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");
@@ -1323,6 +1331,7 @@ sub ParseFunctionPush($)
pidl "\nndr_out:\n";
pidl "\tif (!(flags & NDR_OUT)) goto done;\n\n";
+
foreach my $e (@{$fn->{DATA}}) {
if (util::has_property($e, "out")) {
ParseFunctionElementPush($e, "out");
@@ -1449,6 +1458,7 @@ sub ParseFunctionPull($)
pidl "\nndr_out:\n";
pidl "\tif (!(flags & NDR_OUT)) goto done;\n\n";
+
foreach my $e (@{$fn->{DATA}}) {
if (util::has_property($e, "out")) {
ParseFunctionElementPull($e, "out");