svn commit: samba r26256 - in branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3: .

gd at samba.org gd at samba.org
Mon Dec 3 16:49:46 GMT 2007


Author: gd
Date: 2007-12-03 16:49:45 +0000 (Mon, 03 Dec 2007)
New Revision: 26256

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26256

Log:
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

Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm	2007-12-03 16:46:45 UTC (rev 26255)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm	2007-12-03 16:49:45 UTC (rev 26256)
@@ -46,6 +46,11 @@
 	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 @@
 	} 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");



More information about the samba-cvs mailing list