summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-07 16:47:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:38 -0500
commit485df40bf96abbd80d69ff2a9fdca86516a4eae7 (patch)
tree1693fd3073bb4d5d0db2f465b8d4c5c2f604fdee /source4/build
parent63b2fef51ec3d2e4a8eaddc85ebb1a1ddbf95031 (diff)
downloadsamba-485df40bf96abbd80d69ff2a9fdca86516a4eae7.tar.gz
samba-485df40bf96abbd80d69ff2a9fdca86516a4eae7.tar.bz2
samba-485df40bf96abbd80d69ff2a9fdca86516a4eae7.zip
r3601: Lots of smaller DCOM updates and fixes. Adds oxid tables, proper
use of contexts. (This used to be commit 93eb3cd99c4fb065a69eabcead0c33804259c976)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/client.pm58
-rw-r--r--source4/build/pidl/header.pm10
2 files changed, 49 insertions, 19 deletions
diff --git a/source4/build/pidl/client.pm b/source4/build/pidl/client.pm
index 10ae81ec18..d9d2a0ca14 100644
--- a/source4/build/pidl/client.pm
+++ b/source4/build/pidl/client.pm
@@ -19,22 +19,35 @@ sub ParseFunction($)
return if (util::has_property($fn, "local"));
- my $objargdef = "";
- my $objarg = ", NULL";
+ my $objarg;
if (util::has_property($fn, "object")) {
- $objargdef = ", struct GUID *object";
- $objarg = ", object";
+ $objarg = "&d->objref->u_objref.u_standard.std.ipid";
+ # FIXME: Support custom marshalling
+
+ $res .= "
+struct rpc_request *dcerpc_$name\_send(struct dcom_interface *d, TALLOC_CTX *mem_ctx, struct $name *r)
+{
+ struct dcerpc_pipe *p;
+ NTSTATUS status = dcom_get_pipe(d, &p);
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return NULL;
}
- $res .=
-"
-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) {
+";
+ } else {
+ $objarg = "NULL";
+ $res .= "
+struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)
+{";
+ }
+
+ $res.="
+ if (p->flags & DCERPC_DEBUG_PRINT_IN) {
NDR_PRINT_IN_DEBUG($name, r);
}
- return dcerpc_ndr_request_send(p$objarg, 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));
@@ -42,13 +55,32 @@ struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p$objargdef, TALLOC_C
";
- $objarg = "" unless (util::has_property($fn, "object"));
+ if (util::has_property($fn, "object")) {
$res .=
"
-NTSTATUS dcerpc_$name(struct dcerpc_pipe *p$objargdef, TALLOC_CTX *mem_ctx, struct $name *r)
+NTSTATUS dcerpc_$name(struct dcom_interface *d, TALLOC_CTX *mem_ctx, struct $name *r)
{
- struct rpc_request *req = dcerpc_$name\_send(p$objarg, mem_ctx, r);
+ struct dcerpc_pipe *p;
+ NTSTATUS status = dcom_get_pipe(d, &p);
+ struct rpc_request *req;
+
+ if (NT_STATUS_IS_ERR(status)) {
+ return status;
+ }
+
+ ";
+ } else {
+ $res .=
+"
+NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)
+{
+ struct rpc_request *req;
NTSTATUS status;
+ ";
+ }
+
+ $res .= "
+ req = dcerpc_$name\_send(p, mem_ctx, r);
if (req == NULL) return NT_STATUS_NO_MEMORY;
status = dcerpc_ndr_request_recv(req);
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index d1eb1d1630..0c4c5df425 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -303,16 +303,14 @@ sub HeaderFnProto($)
my $fn = shift;
my $name = $fn->{NAME};
- return if (util::has_property($fn, "call_as") );
-
- my $objarg = "";
+ my $firstarg = "dcerpc_pipe";
if (util::has_property($fn, "object")) {
- $objarg = ", struct GUID *";
+ $firstarg = "dcom_interface";
}
$res .= "void ndr_print_$name(struct ndr_print *, const char *, int, 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 .= "struct rpc_request *dcerpc_$name\_send(struct $firstarg *, TALLOC_CTX *, struct $name *);\n";
+ $res .= "NTSTATUS dcerpc_$name(struct $firstarg *, TALLOC_CTX *, struct $name *);\n";
$res .= "\n";
}