mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
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)
This commit is contained in:
parent
0a3a76fe96
commit
68aad436e6
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user