mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
s4:pyrpc: add py_dcerpc_syntax_init_helper()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
4f0d5981f1
commit
ae02bf6f06
@ -304,6 +304,28 @@ bool PyInterface_AddNdrRpcMethods(PyTypeObject *ifacetype, const struct PyNdrRpc
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyObject *py_dcerpc_syntax_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs,
|
||||||
|
const struct ndr_syntax_id *syntax)
|
||||||
|
{
|
||||||
|
PyObject *ret;
|
||||||
|
struct ndr_syntax_id *obj;
|
||||||
|
const char *kwnames[] = { NULL };
|
||||||
|
|
||||||
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":abstract_syntax", discard_const_p(char *, kwnames))) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = pytalloc_new(struct ndr_syntax_id, type);
|
||||||
|
if (ret == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
obj = (struct ndr_syntax_id *)pytalloc_get_ptr(ret);
|
||||||
|
*obj = *syntax;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status)
|
void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status)
|
||||||
{
|
{
|
||||||
if (p && NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
|
if (p && NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
|
||||||
|
@ -50,6 +50,10 @@ bool py_check_dcerpc_type(PyObject *obj, const char *module, const char *type_na
|
|||||||
bool PyInterface_AddNdrRpcMethods(PyTypeObject *object, const struct PyNdrRpcMethodDef *mds);
|
bool PyInterface_AddNdrRpcMethods(PyTypeObject *object, const struct PyNdrRpcMethodDef *mds);
|
||||||
PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs, const struct ndr_interface_table *table);
|
PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs, const struct ndr_interface_table *table);
|
||||||
|
|
||||||
|
struct ndr_syntax_id;
|
||||||
|
PyObject *py_dcerpc_syntax_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs,
|
||||||
|
const struct ndr_syntax_id *syntax);
|
||||||
|
|
||||||
PyObject *py_return_ndr_struct(const char *module_name, const char *type_name,
|
PyObject *py_return_ndr_struct(const char *module_name, const char *type_name,
|
||||||
TALLOC_CTX *r_ctx, void *r);
|
TALLOC_CTX *r_ctx, void *r);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user