diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-11-12 00:48:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:44 -0500 |
commit | 79c5d73a71c35f5b16232072a7b52033cb9364cb (patch) | |
tree | 62aec59516dd088a0b71b4f86119497b621acb16 /source4/build/pidl/client.pm | |
parent | c8b894b670a2e854c5a6af598ab1f02b142b3406 (diff) | |
download | samba-79c5d73a71c35f5b16232072a7b52033cb9364cb.tar.gz samba-79c5d73a71c35f5b16232072a7b52033cb9364cb.tar.bz2 samba-79c5d73a71c35f5b16232072a7b52033cb9364cb.zip |
r3689: Large number of COM updates:
- Work on server side and local COM support (should work, just no
example classes yet)
- Use vtables so that local and remote calls can be used transparently
- Generate 'proxies and stubs' rather then heavily modified code in client.pm and server.pm. proxies (client side code) are generated in proxy.pm, stubs (server side dispatchers) are generated in stubs.pm
- Support registering classes and interfaces
- DCOM interfaces no longer have to be in the same IDL file as their
base interface, which will allow us to split up dcom.idl
(This used to be commit 7466947a23985f9bb15209b67880f7b94dc515c8)
Diffstat (limited to 'source4/build/pidl/client.pm')
-rw-r--r-- | source4/build/pidl/client.pm | 79 |
1 files changed, 9 insertions, 70 deletions
diff --git a/source4/build/pidl/client.pm b/source4/build/pidl/client.pm index 549a5d0dd3..015ac05223 100644 --- a/source4/build/pidl/client.pm +++ b/source4/build/pidl/client.pm @@ -11,82 +11,33 @@ my($res); ##################################################################### # parse a function -sub ParseFunction($) +sub ParseFunction($$) { + my $interface = shift; my $fn = shift; my $name = $fn->{NAME}; my $uname = uc $name; - return if (util::has_property($fn, "local")); - - my $objarg; - if (util::has_property($fn, "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; - } - - ZERO_STRUCT(r->in.ORPCthis); - r->in.ORPCthis.version.MajorVersion = COM_MAJOR_VERSION; - r->in.ORPCthis.version.MinorVersion = COM_MINOR_VERSION; - -"; - } else { - $objarg = "NULL"; - $res .= " + $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, NULL, DCERPC_$uname, mem_ctx, (ndr_push_flags_fn_t) ndr_push_$name, (ndr_pull_flags_fn_t) ndr_pull_$name, r, sizeof(*r)); } -"; - - if (util::has_property($fn, "object")) { - $res .= -" -NTSTATUS dcerpc_$name(struct dcom_interface *d, TALLOC_CTX *mem_ctx, struct $name *r) -{ - struct dcerpc_pipe *p; - NTSTATUS status = dcom_get_pipe(d, &p); - struct rpc_request *req; - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - "; - $objarg = "d"; - } else { - $res .= -" NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) { struct rpc_request *req; NTSTATUS status; - "; - $objarg = "p"; - } - - $res .= " - req = dcerpc_$name\_send($objarg, mem_ctx, r); + + req = dcerpc_$name\_send(p, mem_ctx, r); if (req == NULL) return NT_STATUS_NO_MEMORY; status = dcerpc_ndr_request_recv(req); @@ -112,22 +63,10 @@ sub ParseInterface($) { my($interface) = shift; my($data) = $interface->{DATA}; + $res = "/* Client functions generated by pidl */\n\n"; foreach my $d (@{$data}) { ($d->{TYPE} eq "FUNCTION") && - ParseFunction($d); - } -} - - -##################################################################### -# parse a parsed IDL structure back into an IDL file -sub Parse($) -{ - my($idl) = shift; - $res = "/* dcerpc client calls generated by pidl */\n\n"; - foreach my $x (@{$idl}) { - ($x->{TYPE} eq "INTERFACE") && - ParseInterface($x); + ParseFunction($interface, $d); } return $res; } |