summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-24 23:39:38 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-24 23:39:38 +0200
commit63c2a19e6e9d0e5e9b662fafe9fd531c2c073174 (patch)
treec7fbade07e23970fddc0a0d1a74b20edc1d1f35a /source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
parent21b6e9ec9ea08cc5e19a068d68331c178091caa6 (diff)
downloadsamba-63c2a19e6e9d0e5e9b662fafe9fd531c2c073174.tar.gz
samba-63c2a19e6e9d0e5e9b662fafe9fd531c2c073174.tar.bz2
samba-63c2a19e6e9d0e5e9b662fafe9fd531c2c073174.zip
Add helper function to return DCE/RPC fault codes.
(This used to be commit 4716cdfb5d5abad85cba18be89d72fe8ee18f359)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/Python.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 26197365ee..2795d987f7 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -409,7 +409,14 @@ sub PythonFunctionBody($$$)
}
}
$self->pidl("status = dcerpc_$fn->{NAME}(iface->pipe, mem_ctx, r);");
- $self->handle_ntstatus("status", "NULL", "mem_ctx");
+ $self->pidl("if (NT_STATUS_IS_ERR(status)) {");
+ $self->indent;
+ $self->pidl("PyErr_SetDCERPCStatus(iface->pipe, status);");
+ $self->pidl("talloc_free(mem_ctx);");
+ $self->pidl("return NULL;");
+ $self->deindent;
+ $self->pidl("}");
+ $self->pidl("");
$env = GenerateFunctionOutEnv($fn, "r->");
my $i = 0;