summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/build/pidl/swig.pm8
-rw-r--r--source4/scripting/swig/dcerpc.i2
2 files changed, 7 insertions, 3 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";
diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i
index 08b47d6329..125b32df78 100644
--- a/source4/scripting/swig/dcerpc.i
+++ b/source4/scripting/swig/dcerpc.i
@@ -289,7 +289,7 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
%exception {
$action
- if (!NT_STATUS_IS_OK(result)) {
+ if (NT_STATUS_IS_ERR(result)) {
set_ntstatus_exception(NT_STATUS_V(result));
return NULL;
}