From 20980eb7870cf3478d9e8e78fb412c5bd299cca5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 27 Feb 2010 10:34:04 +0100 Subject: pidl:NDR/Client.pm: generate explicit _recv functions metze --- pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'pidl') diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 9d3ccaf8c8..958f215a2e 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -43,6 +43,37 @@ sub ParseFunctionSend($$$) $res .= "}\n\n"; } +sub ParseFunctionRecv($$$) +{ + my ($interface, $fn, $name) = @_; + my $uname = uc $name; + + my $proto = "NTSTATUS dcerpc_$name\_recv(struct rpc_request *rreq)"; + + $res_hdr .= "\n$proto;\n"; + + $res .= "$proto\n{\n"; + + if (has_property($fn, "todo")) { + $res .= "\treturn NT_STATUS_NOT_IMPLEMENTED;\n"; + } else { + $res .= "NTSTATUS status; + struct dcerpc_pipe *p = rreq->p; + struct $name *r = (struct $name *)rreq->ndr.struct_ptr; + + status = dcerpc_ndr_request_recv(rreq); + + if (NT_STATUS_IS_OK(status) && (p->conn->flags & DCERPC_DEBUG_PRINT_OUT)) { + NDR_PRINT_OUT_DEBUG($name, r); + } + + return status; +"; + } + + $res .= "}\n\n"; +} + sub ParseFunctionSync($$$) { my ($interface, $fn, $name) = @_; @@ -90,6 +121,7 @@ sub ParseFunction($$) my ($interface, $fn) = @_; ParseFunctionSend($interface, $fn, $fn->{NAME}); + ParseFunctionRecv($interface, $fn, $fn->{NAME}); ParseFunctionSync($interface, $fn, $fn->{NAME}); } -- cgit