summaryrefslogtreecommitdiffstats
path: root/source/scripting
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-10-15 07:17:51 +0000
committerTim Potter <tpot@samba.org>2004-10-15 07:17:51 +0000
commitd5486c16b0d39b70875b18c4f5fd31395abfe47a (patch)
tree150f1ba0538ef72ed51574b94d583ef8be0ce78a /source/scripting
parent029375561ed05684ee7788ebe549cf78e1f66cca (diff)
downloadsamba-d5486c16b0d39b70875b18c4f5fd31395abfe47a.tar.gz
samba-d5486c16b0d39b70875b18c4f5fd31395abfe47a.tar.xz
samba-d5486c16b0d39b70875b18c4f5fd31395abfe47a.zip
r2986: Add correct value to dict when generating wrapper for functions that
return WERROR values. Clean up WERROR vs NTSTATUS handling a bit.
Diffstat (limited to 'source/scripting')
-rw-r--r--source/scripting/swig/dcerpc.i8
-rw-r--r--source/scripting/swig/samba.i4
2 files changed, 8 insertions, 4 deletions
diff --git a/source/scripting/swig/dcerpc.i b/source/scripting/swig/dcerpc.i
index f91f6648201..52481648818 100644
--- a/source/scripting/swig/dcerpc.i
+++ b/source/scripting/swig/dcerpc.i
@@ -352,6 +352,7 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
%exception {
$action
+
if (NT_STATUS_IS_ERR(result)) {
set_ntstatus_exception(NT_STATUS_V(result));
return NULL;
@@ -365,10 +366,14 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
%exception {
$action
+
if (NT_STATUS_IS_ERR(result)) {
set_ntstatus_exception(NT_STATUS_V(result));
return NULL;
}
+
+ /* Emulate NT_STATUS_IS_ERR() */
+
if (!W_ERROR_IS_OK(arg3->out.result) &&
!(W_ERROR_EQUAL(arg3->out.result, WERR_INSUFFICIENT_BUFFER))) {
set_werror_exception(W_ERROR_V(arg3->out.result));
@@ -379,4 +384,7 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
%include "librpc/gen_ndr/winreg.i"
%include "librpc/gen_ndr/spoolss.i"
+/* The status codes must be included last otherwise the automatically
+ generated .i files get confused. This is kind of yucky. */
+
%include "status_codes.i"
diff --git a/source/scripting/swig/samba.i b/source/scripting/swig/samba.i
index faa46dc348d..6a34f9b1483 100644
--- a/source/scripting/swig/samba.i
+++ b/source/scripting/swig/samba.i
@@ -32,10 +32,6 @@
$1 = (uint32_t)PyInt_AsLong($input);
}
-/* For the moment treat NTSTATUS as an integer */
-
-#define WERROR NTSTATUS
-
%typemap(out) NTSTATUS {
$result = PyInt_FromLong(NT_STATUS_V($1));
}