From 63c2a19e6e9d0e5e9b662fafe9fd531c2c073174 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 May 2008 23:39:38 +0200 Subject: Add helper function to return DCE/RPC fault codes. (This used to be commit 4716cdfb5d5abad85cba18be89d72fe8ee18f359) --- source4/pidl/lib/Parse/Pidl/Samba4/Python.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/pidl') 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; -- cgit