summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-09-06 11:09:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:33 -0500
commit68aad436e61fa0a429ee1aaf51f43e091f195fe5 (patch)
treeb9d0896acb8bfe8c26f12f8e0bd9388893a6a00a /source4
parent0a3a76fe969fc56a033af1745374b90fd4aff6c7 (diff)
downloadsamba-68aad436e61fa0a429ee1aaf51f43e091f195fe5.tar.gz
samba-68aad436e61fa0a429ee1aaf51f43e091f195fe5.tar.bz2
samba-68aad436e61fa0a429ee1aaf51f43e091f195fe5.zip
r2236: Zero request structure to let the REF_ALLOC flag work its magic.
Add argout typemap which throws an exception if NTSTATUS != OK and creates a dictionary of return values. samr_Connect2 function now works! (This used to be commit fdfabbd4a597b0d9b44832fdbfc200f857728c2b)
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/swig/samr.i21
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/scripting/swig/samr.i b/source4/scripting/swig/samr.i
index 030f5defc2..89144a29d0 100644
--- a/source4/scripting/swig/samr.i
+++ b/source4/scripting/swig/samr.i
@@ -29,10 +29,31 @@ const int DCERPC_SAMR_VERSION = 1.0;
PyErr_SetString(PyExc_TypeError, "dict arg expected");
return NULL;
}
+ memset(&temp, 0, sizeof(temp));
temp.in.system_name = get_string_property($input, "system_name");
temp.in.access_mask = get_uint32_property($input, "access_mask");
$1 = &temp;
}
+%typemap(argout) struct samr_Connect2 * {
+ long status = PyLong_AsLong(resultobj);
+ PyObject *dict;
+
+ /* Throw exception if result was not OK */
+
+ if (status != 0) {
+ set_ntstatus_exception(status);
+ return NULL;
+ }
+
+ dict = PyDict_New();
+
+ PyDict_SetItem(dict, PyString_FromString("handle"),
+ PyString_FromStringAndSize($1->out.handle,
+ sizeof(*($1->out.handle))));
+
+ resultobj = dict;
+}
+
%rename(samr_Connect2) dcerpc_samr_Connect2;
NTSTATUS dcerpc_samr_Connect2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct samr_Connect2 *r);