From ef792cc8a54d99d8c32251fbae9e2178f5838576 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 3 Dec 2007 16:49:45 +0100 Subject: r26256: When generating Samba3 pidl output for WERROR based functions, make sure the client caller can retrieve the WERROR. Jelmer, no idea how to add a test for that... Guenther (This used to be commit cf55365177e2d9ca64a80bbeafeb91deb7e2c8b3) --- source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm index f6c9a04a8e..d77a166445 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm @@ -46,6 +46,11 @@ sub ParseFunction($$$) foreach (@{$fn->{ELEMENTS}}) { $defargs .= ", " . DeclLong($_); } + + if ($fn->{RETURN_TYPE} eq "WERROR") { + $defargs .= ", WERROR *werror"; + } + $self->fn_declare("NTSTATUS rpccli_$fn->{NAME}(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx$defargs)"); $self->pidl("{"); $self->indent; @@ -123,6 +128,12 @@ sub ParseFunction($$$) } elsif ($fn->{RETURN_TYPE} eq "NTSTATUS") { $self->pidl("return r.out.result;"); } elsif ($fn->{RETURN_TYPE} eq "WERROR") { + $self->pidl("if (werror) {"); + $self->indent; + $self->pidl("*werror = r.out.result;"); + $self->deindent; + $self->pidl("}"); + $self->pidl(""); $self->pidl("return werror_to_ntstatus(r.out.result);"); } else { warning($fn->{ORIGINAL}, "Unable to convert $fn->{RETURN_TYPE} to NTSTATUS"); -- cgit