diff options
author | Günther Deschner <gd@samba.org> | 2007-12-03 16:49:45 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:47:31 +0100 |
commit | ef792cc8a54d99d8c32251fbae9e2178f5838576 (patch) | |
tree | 7084647096e4127eb06966d75481357ab2ad5eda /source4 | |
parent | cbdad76b0d6b893a26c5dc20def034149fb3aa97 (diff) | |
download | samba-ef792cc8a54d99d8c32251fbae9e2178f5838576.tar.gz samba-ef792cc8a54d99d8c32251fbae9e2178f5838576.tar.bz2 samba-ef792cc8a54d99d8c32251fbae9e2178f5838576.zip |
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)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 11 |
1 files changed, 11 insertions, 0 deletions
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"); |