diff options
author | Tim Potter <tpot@samba.org> | 2004-09-22 03:42:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:57 -0500 |
commit | 99721cc7c827457814f97c401462243c3584f480 (patch) | |
tree | 7120d82d892280e39dc44bc625bf9f9aba46fd19 /source4/build | |
parent | cde8c60e883ae8a4a163e371c1e7f9b0d465e741 (diff) | |
download | samba-99721cc7c827457814f97c401462243c3584f480.tar.gz samba-99721cc7c827457814f97c401462243c3584f480.tar.bz2 samba-99721cc7c827457814f97c401462243c3584f480.zip |
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)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/swig.pm | 8 |
1 files changed, 6 insertions, 2 deletions
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"; |