From 99721cc7c827457814f97c401462243c3584f480 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 22 Sep 2004 03:42:58 +0000 Subject: r2490: Some changes to take into account non-error NTSTATUS codes being returned: - Only throw an exception if NT_STATUS_IS_ERR() instead of !NT_STATUS_IS_OK(). - Add the NTSTATUS value to the returned dictionary under a key of 'result' so calling functions can access it. (This used to be commit 4ddcae90a2e9b93e58bd57932cd9ae4c95be6ae8) --- source4/build/pidl/swig.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/pidl/swig.pm b/source4/build/pidl/swig.pm index 6442aff005..66cb72dd73 100644 --- a/source4/build/pidl/swig.pm +++ b/source4/build/pidl/swig.pm @@ -337,10 +337,10 @@ sub ParseFunction($) # Output typemap - $result .= "%typemap(argout) struct $fn->{NAME} * {\n"; + $result .= "%typemap(argout) struct $fn->{NAME} * (PyObject *temp) {\n"; $result .= "\tTALLOC_CTX *mem_ctx = talloc_init(\"typemap(argout) $fn->{NAME}\");\n\n"; - $result .= "\tresultobj = $fn->{NAME}_ptr_to_python(mem_ctx, \$1"; + $result .= "\ttemp = $fn->{NAME}_ptr_to_python(mem_ctx, \$1"; foreach my $e (@{$fn->{DATA}}) { if ((my $switch_is = util::has_property($e, "switch_is"))) { @@ -349,6 +349,10 @@ sub ParseFunction($) } $result .= ");\n\n"; + + $result .= "\tPyDict_SetItemString(temp, \"result\", resultobj);\n"; + $result .= "\tresultobj = temp;\n"; + $result .= "\ttalloc_free(mem_ctx);\n"; $result .= "}\n\n"; -- cgit