/* Python wrapper functions auto-generated by pidl */
+#define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
#include <Python.h>
#include "includes.h"
#include <pytalloc.h>
#include "bin/default/librpc/gen_ndr/ndr_echo_c.h"
/*
- * These functions are here to ensure they can be optomised out by
+ * These functions are here to ensure they can be optimized out by
* the compiler based on the constant input values
*/
static PyTypeObject echo_Surrounding_Type;
static PyTypeObject rpcecho_InterfaceType;
-void initecho(void);static PyTypeObject *Object_Type;
+void initecho(void);static PyTypeObject *BaseObject_Type;
static PyTypeObject *ClientConnection_Type;
static PyTypeObject *ndr_syntax_id_Type;
static int py_echo_info1_set_v(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info1 *object = (struct echo_info1 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v));
if (PyLong_Check(value)) {
}
static PyGetSetDef py_echo_info1_getsetters[] = {
- { discard_const_p(char, "v"), py_echo_info1_get_v, py_echo_info1_set_v },
- { NULL }
+ {
+ .name = discard_const_p(char, "v"),
+ .get = py_echo_info1_get_v,
+ .set = py_echo_info1_set_v,
+ .doc = discard_const_p(char, "PIDL-generated element v")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_info1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
static PyObject *py_echo_info1_ndr_pack(PyObject *py_obj)
{
struct echo_info1 *object = (struct echo_info1 *)pytalloc_get_ptr(py_obj);
+ PyObject *ret = NULL;
DATA_BLOB blob;
enum ndr_err_code err;
- err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_echo_info1);
+ TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
+ if (tmp_ctx == NULL) {
+ PyErr_SetNdrError(NDR_ERR_ALLOC);
+ return NULL;
+ }
+ err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_echo_info1);
if (err != NDR_ERR_SUCCESS) {
+ TALLOC_FREE(tmp_ctx);
PyErr_SetNdrError(err);
return NULL;
}
- return PyString_FromStringAndSize((char *)blob.data, blob.length);
+ ret = PyString_FromStringAndSize((char *)blob.data, blob.length);
+ TALLOC_FREE(tmp_ctx);
+ return ret;
}
static PyObject *py_echo_info1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
struct echo_info1 *object = (struct echo_info1 *)pytalloc_get_ptr(py_obj);
DATA_BLOB blob;
- int blob_length = 0;
+ Py_ssize_t blob_length = 0;
enum ndr_err_code err;
const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
PyObject *allow_remaining_obj = NULL;
.tp_getset = py_echo_info1_getsetters,
.tp_methods = py_echo_info1_methods,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_info1_new,
};
static int py_echo_info2_set_v(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info2 *object = (struct echo_info2 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v));
if (PyLong_Check(value)) {
}
static PyGetSetDef py_echo_info2_getsetters[] = {
- { discard_const_p(char, "v"), py_echo_info2_get_v, py_echo_info2_set_v },
- { NULL }
+ {
+ .name = discard_const_p(char, "v"),
+ .get = py_echo_info2_get_v,
+ .set = py_echo_info2_set_v,
+ .doc = discard_const_p(char, "PIDL-generated element v")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_info2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_info2_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_info2_new,
};
static int py_echo_info3_set_v(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info3 *object = (struct echo_info3 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v));
if (PyLong_Check(value)) {
}
static PyGetSetDef py_echo_info3_getsetters[] = {
- { discard_const_p(char, "v"), py_echo_info3_get_v, py_echo_info3_set_v },
- { NULL }
+ {
+ .name = discard_const_p(char, "v"),
+ .get = py_echo_info3_get_v,
+ .set = py_echo_info3_set_v,
+ .doc = discard_const_p(char, "PIDL-generated element v")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_info3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_info3_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_info3_new,
};
static int py_echo_info4_set_v(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info4 *object = (struct echo_info4 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v));
if (PyLong_Check(value)) {
}
static PyGetSetDef py_echo_info4_getsetters[] = {
- { discard_const_p(char, "v"), py_echo_info4_get_v, py_echo_info4_set_v },
- { NULL }
+ {
+ .name = discard_const_p(char, "v"),
+ .get = py_echo_info4_get_v,
+ .set = py_echo_info4_set_v,
+ .doc = discard_const_p(char, "PIDL-generated element v")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_info4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_info4_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_info4_new,
};
static int py_echo_info5_set_v1(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info5 *object = (struct echo_info5 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v1");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v1));
if (PyLong_Check(value)) {
static int py_echo_info5_set_v2(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info5 *object = (struct echo_info5 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v2");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v2));
if (PyLong_Check(value)) {
}
static PyGetSetDef py_echo_info5_getsetters[] = {
- { discard_const_p(char, "v1"), py_echo_info5_get_v1, py_echo_info5_set_v1 },
- { discard_const_p(char, "v2"), py_echo_info5_get_v2, py_echo_info5_set_v2 },
- { NULL }
+ {
+ .name = discard_const_p(char, "v1"),
+ .get = py_echo_info5_get_v1,
+ .set = py_echo_info5_set_v1,
+ .doc = discard_const_p(char, "PIDL-generated element v1")
+ },
+ {
+ .name = discard_const_p(char, "v2"),
+ .get = py_echo_info5_get_v2,
+ .set = py_echo_info5_set_v2,
+ .doc = discard_const_p(char, "PIDL-generated element v2")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_info5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_info5_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_info5_new,
};
static int py_echo_info6_set_v1(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info6 *object = (struct echo_info6 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v1");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v1));
if (PyLong_Check(value)) {
static int py_echo_info6_set_info1(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info6 *object = (struct echo_info6 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info1");
+ return -1;
+ }
PY_CHECK_TYPE(&echo_info1_Type, value, return -1;);
if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
PyErr_NoMemory();
}
static PyGetSetDef py_echo_info6_getsetters[] = {
- { discard_const_p(char, "v1"), py_echo_info6_get_v1, py_echo_info6_set_v1 },
- { discard_const_p(char, "info1"), py_echo_info6_get_info1, py_echo_info6_set_info1 },
- { NULL }
+ {
+ .name = discard_const_p(char, "v1"),
+ .get = py_echo_info6_get_v1,
+ .set = py_echo_info6_set_v1,
+ .doc = discard_const_p(char, "PIDL-generated element v1")
+ },
+ {
+ .name = discard_const_p(char, "info1"),
+ .get = py_echo_info6_get_info1,
+ .set = py_echo_info6_set_info1,
+ .doc = discard_const_p(char, "PIDL-generated element info1")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_info6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_info6_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_info6_new,
};
static int py_echo_info7_set_v1(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info7 *object = (struct echo_info7 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->v1");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->v1));
if (PyLong_Check(value)) {
static int py_echo_info7_set_info4(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_info7 *object = (struct echo_info7 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info4");
+ return -1;
+ }
PY_CHECK_TYPE(&echo_info4_Type, value, return -1;);
if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
PyErr_NoMemory();
}
static PyGetSetDef py_echo_info7_getsetters[] = {
- { discard_const_p(char, "v1"), py_echo_info7_get_v1, py_echo_info7_set_v1 },
- { discard_const_p(char, "info4"), py_echo_info7_get_info4, py_echo_info7_set_info4 },
- { NULL }
+ {
+ .name = discard_const_p(char, "v1"),
+ .get = py_echo_info7_get_v1,
+ .set = py_echo_info7_set_v1,
+ .doc = discard_const_p(char, "PIDL-generated element v1")
+ },
+ {
+ .name = discard_const_p(char, "info4"),
+ .get = py_echo_info7_get_info4,
+ .set = py_echo_info7_set_info4,
+ .doc = discard_const_p(char, "PIDL-generated element info4")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_info7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_info7_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_info7_new,
};
union echo_Info *ret = talloc_zero(mem_ctx, union echo_Info);
switch (level) {
case 1:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_info1_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
break;
case 2:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_info2_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
break;
case 3:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_info3_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
break;
case 4:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_info4_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
break;
case 5:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_info5_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
break;
case 6:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info6");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_info6_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
break;
case 7:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info7");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_info7_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
static int py_echo_Enum2_set_e1(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_Enum2 *object = (struct echo_Enum2 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->e1");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->e1));
if (PyLong_Check(value)) {
static int py_echo_Enum2_set_e2(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_Enum2 *object = (struct echo_Enum2 *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->e2");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->e2));
if (PyLong_Check(value)) {
}
static PyGetSetDef py_echo_Enum2_getsetters[] = {
- { discard_const_p(char, "e1"), py_echo_Enum2_get_e1, py_echo_Enum2_set_e1 },
- { discard_const_p(char, "e2"), py_echo_Enum2_get_e2, py_echo_Enum2_set_e2 },
- { NULL }
+ {
+ .name = discard_const_p(char, "e1"),
+ .get = py_echo_Enum2_get_e1,
+ .set = py_echo_Enum2_set_e1,
+ .doc = discard_const_p(char, "PIDL-generated element e1")
+ },
+ {
+ .name = discard_const_p(char, "e2"),
+ .get = py_echo_Enum2_get_e2,
+ .set = py_echo_Enum2_set_e2,
+ .doc = discard_const_p(char, "PIDL-generated element e2")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_Enum2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_Enum2_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_Enum2_new,
};
union echo_Enum3 *ret = talloc_zero(mem_ctx, union echo_Enum3);
switch (level) {
case ECHO_ENUM1:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->e1");
+ talloc_free(ret); return NULL;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->e1));
if (PyLong_Check(in)) {
break;
case ECHO_ENUM2:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->e2");
+ talloc_free(ret); return NULL;
+ }
PY_CHECK_TYPE(&echo_Enum2_Type, in, talloc_free(ret); return NULL;);
if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
PyErr_NoMemory();
static int py_echo_Surrounding_set_x(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_Surrounding *object = (struct echo_Surrounding *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->x");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->x));
if (PyLong_Check(value)) {
static int py_echo_Surrounding_set_surrounding(PyObject *py_obj, PyObject *value, void *closure)
{
struct echo_Surrounding *object = (struct echo_Surrounding *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->surrounding");
+ return -1;
+ }
PY_CHECK_TYPE(&PyList_Type, value, return -1;);
{
int surrounding_cntr_0;
if (!object->surrounding) { return -1;; }
talloc_set_name_const(object->surrounding, "ARRAY: object->surrounding");
for (surrounding_cntr_0 = 0; surrounding_cntr_0 < PyList_GET_SIZE(value); surrounding_cntr_0++) {
+ if (PyList_GET_ITEM(value, surrounding_cntr_0) == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->surrounding[surrounding_cntr_0]");
+ return -1;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->surrounding[surrounding_cntr_0]));
if (PyLong_Check(PyList_GET_ITEM(value, surrounding_cntr_0))) {
}
static PyGetSetDef py_echo_Surrounding_getsetters[] = {
- { discard_const_p(char, "x"), py_echo_Surrounding_get_x, py_echo_Surrounding_set_x },
- { discard_const_p(char, "surrounding"), py_echo_Surrounding_get_surrounding, py_echo_Surrounding_set_surrounding },
- { NULL }
+ {
+ .name = discard_const_p(char, "x"),
+ .get = py_echo_Surrounding_get_x,
+ .set = py_echo_Surrounding_set_x,
+ .doc = discard_const_p(char, "PIDL-generated element x")
+ },
+ {
+ .name = discard_const_p(char, "surrounding"),
+ .get = py_echo_Surrounding_get_surrounding,
+ .set = py_echo_Surrounding_set_surrounding,
+ .doc = discard_const_p(char, "PIDL-generated element surrounding")
+ },
+ { .name = NULL }
};
static PyObject *py_echo_Surrounding_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_echo_Surrounding_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_echo_Surrounding_new,
};
return false;
}
+ if (py_in_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.in_data");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.in_data));
if (PyLong_Check(py_in_data)) {
PY_CHECK_TYPE(&PyList_Type, py_in_data, return false;);
r->in.len = PyList_GET_SIZE(py_in_data);
+ if (py_in_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.in_data");
+ return false;
+ }
PY_CHECK_TYPE(&PyList_Type, py_in_data, return false;);
{
int in_data_cntr_0;
if (!r->in.in_data) { return false;; }
talloc_set_name_const(r->in.in_data, "ARRAY: r->in.in_data");
for (in_data_cntr_0 = 0; in_data_cntr_0 < PyList_GET_SIZE(py_in_data); in_data_cntr_0++) {
+ if (PyList_GET_ITEM(py_in_data, in_data_cntr_0) == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.in_data[in_data_cntr_0]");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.in_data[in_data_cntr_0]));
if (PyLong_Check(PyList_GET_ITEM(py_in_data, in_data_cntr_0))) {
PY_CHECK_TYPE(&PyList_Type, py_data, return false;);
r->in.len = PyList_GET_SIZE(py_data);
+ if (py_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data");
+ return false;
+ }
PY_CHECK_TYPE(&PyList_Type, py_data, return false;);
{
int data_cntr_0;
if (!r->in.data) { return false;; }
talloc_set_name_const(r->in.data, "ARRAY: r->in.data");
for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(py_data); data_cntr_0++) {
+ if (PyList_GET_ITEM(py_data, data_cntr_0) == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data[data_cntr_0]");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.data[data_cntr_0]));
if (PyLong_Check(PyList_GET_ITEM(py_data, data_cntr_0))) {
return false;
}
+ if (py_len == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.len");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.len));
if (PyLong_Check(py_len)) {
return false;
}
+ if (py_s1 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.s1");
+ return false;
+ }
r->in.s1 = talloc_ptrtype(r, r->in.s1);
- if (PyUnicode_Check(py_s1)) {
- r->in.s1 = PyString_AS_STRING(PyUnicode_AsEncodedString(py_s1, "utf-8", "ignore"));
- } else if (PyString_Check(py_s1)) {
- r->in.s1 = PyString_AS_STRING(py_s1);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_s1)->tp_name);
+ if (py_s1 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.s1");
return false;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_s1)) {
+ unicode = PyUnicode_AsEncodedString(py_s1, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_s1)) {
+ test_str = PyString_AS_STRING(py_s1);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_s1)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.s1 = talloc_str;
+ }
return true;
}
return false;
}
+ if (py_level == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
if (PyLong_Check(py_level)) {
return false;
}
+ if (py_seconds == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.seconds");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.seconds));
if (PyLong_Check(py_seconds)) {
return false;
}
+ if (py_foo1 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.foo1");
+ return false;
+ }
r->in.foo1 = talloc_ptrtype(r, r->in.foo1);
+ if (py_foo1 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.foo1");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.foo1));
if (PyLong_Check(py_foo1)) {
return false;
}
}
+ if (py_foo2 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.foo2");
+ return false;
+ }
r->in.foo2 = talloc_ptrtype(r, r->in.foo2);
+ if (py_foo2 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.foo2");
+ return false;
+ }
PY_CHECK_TYPE(&echo_Enum2_Type, py_foo2, return false;);
if (talloc_reference(r, pytalloc_get_mem_ctx(py_foo2)) == NULL) {
PyErr_NoMemory();
return false;
}
r->in.foo2 = (struct echo_Enum2 *)pytalloc_get_ptr(py_foo2);
+ if (py_foo3 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.foo3");
+ return false;
+ }
r->in.foo3 = talloc_ptrtype(r, r->in.foo3);
+ if (py_foo3 == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.foo3");
+ return false;
+ }
{
union echo_Enum3 *foo3_switch_1;
foo3_switch_1 = py_export_echo_Enum3(r, *r->in.foo1, py_foo3);
return false;
}
+ if (py_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data");
+ return false;
+ }
r->in.data = talloc_ptrtype(r, r->in.data);
+ if (py_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.data");
+ return false;
+ }
PY_CHECK_TYPE(&echo_Surrounding_Type, py_data, return false;);
if (talloc_reference(r, pytalloc_get_mem_ctx(py_data)) == NULL) {
PyErr_NoMemory();
return false;
}
+ if (py_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data");
+ return false;
+ }
r->in.data = talloc_ptrtype(r, r->in.data);
+ if (py_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.data");
+ return false;
+ }
if (py_data == Py_None) {
*r->in.data = NULL;
} else {
*r->in.data = NULL;
+ if (py_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct **r->in.data");
+ return false;
+ }
if (py_data == Py_None) {
**r->in.data = NULL;
} else {
**r->in.data = talloc_ptrtype(r, **r->in.data);
+ if (py_data == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ***r->in.data");
+ return false;
+ }
{
const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(***r->in.data));
if (PyLong_Check(py_data)) {
static PyTypeObject rpcecho_SyntaxType = {
PyObject_HEAD_INIT(NULL) 0,
.tp_name = "echo.rpcecho",
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_doc = "abstract_syntax()\n"PY_DOC_RPCECHO_SYNTAX,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
.tp_new = syntax_rpcecho_new,
if (dep_samba_dcerpc_misc == NULL)
return;
- Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
- if (Object_Type == NULL)
+ BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
+ if (BaseObject_Type == NULL)
return;
ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
if (ndr_syntax_id_Type == NULL)
return;
- echo_info1_Type.tp_base = Object_Type;
+ echo_info1_Type.tp_base = BaseObject_Type;
+ echo_info1_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_info2_Type.tp_base = Object_Type;
+ echo_info2_Type.tp_base = BaseObject_Type;
+ echo_info2_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_info3_Type.tp_base = Object_Type;
+ echo_info3_Type.tp_base = BaseObject_Type;
+ echo_info3_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_info4_Type.tp_base = Object_Type;
+ echo_info4_Type.tp_base = BaseObject_Type;
+ echo_info4_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_info5_Type.tp_base = Object_Type;
+ echo_info5_Type.tp_base = BaseObject_Type;
+ echo_info5_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_info6_Type.tp_base = Object_Type;
+ echo_info6_Type.tp_base = BaseObject_Type;
+ echo_info6_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_info7_Type.tp_base = Object_Type;
+ echo_info7_Type.tp_base = BaseObject_Type;
+ echo_info7_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_Enum2_Type.tp_base = Object_Type;
+ echo_Enum2_Type.tp_base = BaseObject_Type;
+ echo_Enum2_Type.tp_basicsize = pytalloc_BaseObject_size();
- echo_Surrounding_Type.tp_base = Object_Type;
+ echo_Surrounding_Type.tp_base = BaseObject_Type;
+ echo_Surrounding_Type.tp_basicsize = pytalloc_BaseObject_size();
rpcecho_InterfaceType.tp_base = ClientConnection_Type;
rpcecho_SyntaxType.tp_base = ndr_syntax_id_Type;
+ rpcecho_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
if (PyType_Ready(&echo_info1_Type) < 0)
return;