X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=bin%2Fdefault%2Flibrpc%2Fgen_ndr%2Fpy_srvsvc.c;h=fb9873771480d9a687a01e7a66363d3e25b75b49;hb=4ca3c333cbff0365e3e84d87826023bb7e38b48d;hp=a9554824158233c41bec94eec416628879949877;hpb=f90d0a80513d4bfd352db51542a0861888312d0b;p=metze%2Fsamba%2Fwip.git diff --git a/bin/default/librpc/gen_ndr/py_srvsvc.c b/bin/default/librpc/gen_ndr/py_srvsvc.c index a95548241582..fb9873771480 100644 --- a/bin/default/librpc/gen_ndr/py_srvsvc.c +++ b/bin/default/librpc/gen_ndr/py_srvsvc.c @@ -8,133 +8,214 @@ #include "bin/default/librpc/gen_ndr/ndr_srvsvc.h" #include "bin/default/librpc/gen_ndr/ndr_srvsvc_c.h" +/* + * These functions are here to ensure they can be optomised out by + * the compiler based on the constant input values + */ + +static inline unsigned long long ndr_sizeof2uintmax(size_t var_size) +{ + switch (var_size) { + case 8: + return UINT64_MAX; + case 4: + return UINT32_MAX; + case 2: + return UINT16_MAX; + case 1: + return UINT8_MAX; + } + + return 0; +} + +static inline long long ndr_sizeof2intmax(size_t var_size) +{ + switch (var_size) { + case 8: + return INT64_MAX; + case 4: + return INT32_MAX; + case 2: + return INT16_MAX; + case 1: + return INT8_MAX; + } + + return 0; +} + +static inline PyObject *ndr_PyLong_FromLongLong(long long v) +{ + if (v > LONG_MAX || v < LONG_MIN) { + return PyLong_FromLongLong(v); + } else { + return PyInt_FromLong(v); + } +} + +static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v) +{ + if (v > LONG_MAX) { + return PyLong_FromUnsignedLongLong(v); + } else { + return PyInt_FromLong(v); + } +} + #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/svcctl.h" -staticforward PyTypeObject srvsvc_NetCharDevInfo0_Type; -staticforward PyTypeObject srvsvc_NetCharDevCtr0_Type; -staticforward PyTypeObject srvsvc_NetCharDevInfo1_Type; -staticforward PyTypeObject srvsvc_NetCharDevCtr1_Type; -staticforward PyTypeObject srvsvc_NetCharDevInfoCtr_Type; -staticforward PyTypeObject srvsvc_NetCharDevQInfo0_Type; -staticforward PyTypeObject srvsvc_NetCharDevQCtr0_Type; -staticforward PyTypeObject srvsvc_NetCharDevQInfo1_Type; -staticforward PyTypeObject srvsvc_NetCharDevQCtr1_Type; -staticforward PyTypeObject srvsvc_NetCharDevQInfoCtr_Type; -staticforward PyTypeObject srvsvc_NetConnInfo0_Type; -staticforward PyTypeObject srvsvc_NetConnCtr0_Type; -staticforward PyTypeObject srvsvc_NetConnInfo1_Type; -staticforward PyTypeObject srvsvc_NetConnCtr1_Type; -staticforward PyTypeObject srvsvc_NetConnInfoCtr_Type; -staticforward PyTypeObject srvsvc_NetFileInfo2_Type; -staticforward PyTypeObject srvsvc_NetFileCtr2_Type; -staticforward PyTypeObject srvsvc_NetFileInfo3_Type; -staticforward PyTypeObject srvsvc_NetFileCtr3_Type; -staticforward PyTypeObject srvsvc_NetFileInfoCtr_Type; -staticforward PyTypeObject srvsvc_NetSessInfo0_Type; -staticforward PyTypeObject srvsvc_NetSessCtr0_Type; -staticforward PyTypeObject srvsvc_NetSessInfo1_Type; -staticforward PyTypeObject srvsvc_NetSessCtr1_Type; -staticforward PyTypeObject srvsvc_NetSessInfo2_Type; -staticforward PyTypeObject srvsvc_NetSessCtr2_Type; -staticforward PyTypeObject srvsvc_NetSessInfo10_Type; -staticforward PyTypeObject srvsvc_NetSessCtr10_Type; -staticforward PyTypeObject srvsvc_NetSessInfo502_Type; -staticforward PyTypeObject srvsvc_NetSessCtr502_Type; -staticforward PyTypeObject srvsvc_NetSessInfoCtr_Type; -staticforward PyTypeObject srvsvc_NetShareInfo0_Type; -staticforward PyTypeObject srvsvc_NetShareCtr0_Type; -staticforward PyTypeObject srvsvc_NetShareInfo1_Type; -staticforward PyTypeObject srvsvc_NetShareCtr1_Type; -staticforward PyTypeObject srvsvc_NetShareInfo2_Type; -staticforward PyTypeObject srvsvc_NetShareCtr2_Type; -staticforward PyTypeObject srvsvc_NetShareInfo501_Type; -staticforward PyTypeObject srvsvc_NetShareCtr501_Type; -staticforward PyTypeObject srvsvc_NetShareInfo502_Type; -staticforward PyTypeObject srvsvc_NetShareCtr502_Type; -staticforward PyTypeObject srvsvc_NetShareInfo1004_Type; -staticforward PyTypeObject srvsvc_NetShareCtr1004_Type; -staticforward PyTypeObject srvsvc_NetShareInfo1005_Type; -staticforward PyTypeObject srvsvc_NetShareCtr1005_Type; -staticforward PyTypeObject srvsvc_NetShareInfo1006_Type; -staticforward PyTypeObject srvsvc_NetShareCtr1006_Type; -staticforward PyTypeObject srvsvc_NetShareInfo1007_Type; -staticforward PyTypeObject srvsvc_NetShareCtr1007_Type; -staticforward PyTypeObject srvsvc_NetShareCtr1501_Type; -staticforward PyTypeObject srvsvc_NetShareInfoCtr_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo100_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo101_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo102_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo402_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo403_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo502_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo503_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo599_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1005_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1010_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1016_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1017_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1018_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1107_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1501_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1502_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1503_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1506_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1509_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1510_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1511_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1512_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1513_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1514_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1515_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1516_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1518_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1520_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1521_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1522_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1523_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1524_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1525_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1528_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1529_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1530_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1533_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1534_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1535_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1536_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1537_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1538_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1539_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1540_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1541_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1542_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1543_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1544_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1545_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1546_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1547_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1548_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1549_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1550_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1552_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1553_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1554_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1555_Type; -staticforward PyTypeObject srvsvc_NetSrvInfo1556_Type; -staticforward PyTypeObject srvsvc_NetDiskInfo0_Type; -staticforward PyTypeObject srvsvc_NetDiskInfo_Type; -staticforward PyTypeObject srvsvc_Statistics_Type; -staticforward PyTypeObject srvsvc_NetTransportInfo0_Type; -staticforward PyTypeObject srvsvc_NetTransportCtr0_Type; -staticforward PyTypeObject srvsvc_NetTransportInfo1_Type; -staticforward PyTypeObject srvsvc_NetTransportCtr1_Type; -staticforward PyTypeObject srvsvc_NetTransportInfo2_Type; -staticforward PyTypeObject srvsvc_NetTransportCtr2_Type; -staticforward PyTypeObject srvsvc_NetTransportInfo3_Type; -staticforward PyTypeObject srvsvc_NetTransportCtr3_Type; -staticforward PyTypeObject srvsvc_NetTransportInfoCtr_Type; -staticforward PyTypeObject srvsvc_NetRemoteTODInfo_Type; -staticforward PyTypeObject srvsvc_InterfaceType; +static PyTypeObject srvsvc_NetCharDevInfo0_Type; +static PyTypeObject srvsvc_NetCharDevCtr0_Type; +static PyTypeObject srvsvc_NetCharDevInfo1_Type; +static PyTypeObject srvsvc_NetCharDevCtr1_Type; +PyObject *py_import_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevInfo *in); +union srvsvc_NetCharDevInfo *py_export_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in); +PyObject *py_import_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevCtr *in); +union srvsvc_NetCharDevCtr *py_export_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetCharDevInfoCtr_Type; +static PyTypeObject srvsvc_NetCharDevQInfo0_Type; +static PyTypeObject srvsvc_NetCharDevQCtr0_Type; +static PyTypeObject srvsvc_NetCharDevQInfo1_Type; +static PyTypeObject srvsvc_NetCharDevQCtr1_Type; +PyObject *py_import_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQInfo *in); +union srvsvc_NetCharDevQInfo *py_export_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in); +PyObject *py_import_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQCtr *in); +union srvsvc_NetCharDevQCtr *py_export_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetCharDevQInfoCtr_Type; +static PyTypeObject srvsvc_NetConnInfo0_Type; +static PyTypeObject srvsvc_NetConnCtr0_Type; +static PyTypeObject srvsvc_NetConnInfo1_Type; +static PyTypeObject srvsvc_NetConnCtr1_Type; +PyObject *py_import_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetConnCtr *in); +union srvsvc_NetConnCtr *py_export_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetConnInfoCtr_Type; +static PyTypeObject srvsvc_NetFileInfo2_Type; +static PyTypeObject srvsvc_NetFileCtr2_Type; +static PyTypeObject srvsvc_NetFileInfo3_Type; +static PyTypeObject srvsvc_NetFileCtr3_Type; +PyObject *py_import_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileInfo *in); +union srvsvc_NetFileInfo *py_export_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in); +PyObject *py_import_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileCtr *in); +union srvsvc_NetFileCtr *py_export_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetFileInfoCtr_Type; +static PyTypeObject srvsvc_NetSessInfo0_Type; +static PyTypeObject srvsvc_NetSessCtr0_Type; +static PyTypeObject srvsvc_NetSessInfo1_Type; +static PyTypeObject srvsvc_NetSessCtr1_Type; +static PyTypeObject srvsvc_NetSessInfo2_Type; +static PyTypeObject srvsvc_NetSessCtr2_Type; +static PyTypeObject srvsvc_NetSessInfo10_Type; +static PyTypeObject srvsvc_NetSessCtr10_Type; +static PyTypeObject srvsvc_NetSessInfo502_Type; +static PyTypeObject srvsvc_NetSessCtr502_Type; +PyObject *py_import_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetSessCtr *in); +union srvsvc_NetSessCtr *py_export_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetSessInfoCtr_Type; +static PyTypeObject srvsvc_NetShareInfo0_Type; +static PyTypeObject srvsvc_NetShareCtr0_Type; +static PyTypeObject srvsvc_NetShareInfo1_Type; +static PyTypeObject srvsvc_NetShareCtr1_Type; +static PyTypeObject srvsvc_NetShareInfo2_Type; +static PyTypeObject srvsvc_NetShareCtr2_Type; +static PyTypeObject srvsvc_NetShareInfo501_Type; +static PyTypeObject srvsvc_NetShareCtr501_Type; +static PyTypeObject srvsvc_NetShareInfo502_Type; +static PyTypeObject srvsvc_NetShareCtr502_Type; +static PyTypeObject srvsvc_NetShareInfo1004_Type; +static PyTypeObject srvsvc_NetShareCtr1004_Type; +static PyTypeObject srvsvc_NetShareInfo1005_Type; +static PyTypeObject srvsvc_NetShareCtr1005_Type; +static PyTypeObject srvsvc_NetShareInfo1006_Type; +static PyTypeObject srvsvc_NetShareCtr1006_Type; +static PyTypeObject srvsvc_NetShareInfo1007_Type; +static PyTypeObject srvsvc_NetShareCtr1007_Type; +static PyTypeObject srvsvc_NetShareCtr1501_Type; +PyObject *py_import_srvsvc_NetShareInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetShareInfo *in); +union srvsvc_NetShareInfo *py_export_srvsvc_NetShareInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in); +PyObject *py_import_srvsvc_NetShareCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetShareCtr *in); +union srvsvc_NetShareCtr *py_export_srvsvc_NetShareCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetShareInfoCtr_Type; +static PyTypeObject srvsvc_NetSrvInfo100_Type; +static PyTypeObject srvsvc_NetSrvInfo101_Type; +static PyTypeObject srvsvc_NetSrvInfo102_Type; +static PyTypeObject srvsvc_NetSrvInfo402_Type; +static PyTypeObject srvsvc_NetSrvInfo403_Type; +static PyTypeObject srvsvc_NetSrvInfo502_Type; +static PyTypeObject srvsvc_NetSrvInfo503_Type; +static PyTypeObject srvsvc_NetSrvInfo599_Type; +static PyTypeObject srvsvc_NetSrvInfo1005_Type; +static PyTypeObject srvsvc_NetSrvInfo1010_Type; +static PyTypeObject srvsvc_NetSrvInfo1016_Type; +static PyTypeObject srvsvc_NetSrvInfo1017_Type; +static PyTypeObject srvsvc_NetSrvInfo1018_Type; +static PyTypeObject srvsvc_NetSrvInfo1107_Type; +static PyTypeObject srvsvc_NetSrvInfo1501_Type; +static PyTypeObject srvsvc_NetSrvInfo1502_Type; +static PyTypeObject srvsvc_NetSrvInfo1503_Type; +static PyTypeObject srvsvc_NetSrvInfo1506_Type; +static PyTypeObject srvsvc_NetSrvInfo1509_Type; +static PyTypeObject srvsvc_NetSrvInfo1510_Type; +static PyTypeObject srvsvc_NetSrvInfo1511_Type; +static PyTypeObject srvsvc_NetSrvInfo1512_Type; +static PyTypeObject srvsvc_NetSrvInfo1513_Type; +static PyTypeObject srvsvc_NetSrvInfo1514_Type; +static PyTypeObject srvsvc_NetSrvInfo1515_Type; +static PyTypeObject srvsvc_NetSrvInfo1516_Type; +static PyTypeObject srvsvc_NetSrvInfo1518_Type; +static PyTypeObject srvsvc_NetSrvInfo1520_Type; +static PyTypeObject srvsvc_NetSrvInfo1521_Type; +static PyTypeObject srvsvc_NetSrvInfo1522_Type; +static PyTypeObject srvsvc_NetSrvInfo1523_Type; +static PyTypeObject srvsvc_NetSrvInfo1524_Type; +static PyTypeObject srvsvc_NetSrvInfo1525_Type; +static PyTypeObject srvsvc_NetSrvInfo1528_Type; +static PyTypeObject srvsvc_NetSrvInfo1529_Type; +static PyTypeObject srvsvc_NetSrvInfo1530_Type; +static PyTypeObject srvsvc_NetSrvInfo1533_Type; +static PyTypeObject srvsvc_NetSrvInfo1534_Type; +static PyTypeObject srvsvc_NetSrvInfo1535_Type; +static PyTypeObject srvsvc_NetSrvInfo1536_Type; +static PyTypeObject srvsvc_NetSrvInfo1537_Type; +static PyTypeObject srvsvc_NetSrvInfo1538_Type; +static PyTypeObject srvsvc_NetSrvInfo1539_Type; +static PyTypeObject srvsvc_NetSrvInfo1540_Type; +static PyTypeObject srvsvc_NetSrvInfo1541_Type; +static PyTypeObject srvsvc_NetSrvInfo1542_Type; +static PyTypeObject srvsvc_NetSrvInfo1543_Type; +static PyTypeObject srvsvc_NetSrvInfo1544_Type; +static PyTypeObject srvsvc_NetSrvInfo1545_Type; +static PyTypeObject srvsvc_NetSrvInfo1546_Type; +static PyTypeObject srvsvc_NetSrvInfo1547_Type; +static PyTypeObject srvsvc_NetSrvInfo1548_Type; +static PyTypeObject srvsvc_NetSrvInfo1549_Type; +static PyTypeObject srvsvc_NetSrvInfo1550_Type; +static PyTypeObject srvsvc_NetSrvInfo1552_Type; +static PyTypeObject srvsvc_NetSrvInfo1553_Type; +static PyTypeObject srvsvc_NetSrvInfo1554_Type; +static PyTypeObject srvsvc_NetSrvInfo1555_Type; +static PyTypeObject srvsvc_NetSrvInfo1556_Type; +PyObject *py_import_srvsvc_NetSrvInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetSrvInfo *in); +union srvsvc_NetSrvInfo *py_export_srvsvc_NetSrvInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetDiskInfo0_Type; +static PyTypeObject srvsvc_NetDiskInfo_Type; +static PyTypeObject srvsvc_Statistics_Type; +static PyTypeObject srvsvc_NetTransportInfo0_Type; +static PyTypeObject srvsvc_NetTransportCtr0_Type; +static PyTypeObject srvsvc_NetTransportInfo1_Type; +static PyTypeObject srvsvc_NetTransportCtr1_Type; +static PyTypeObject srvsvc_NetTransportInfo2_Type; +static PyTypeObject srvsvc_NetTransportCtr2_Type; +static PyTypeObject srvsvc_NetTransportInfo3_Type; +static PyTypeObject srvsvc_NetTransportCtr3_Type; +PyObject *py_import_srvsvc_NetTransportCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetTransportCtr *in); +union srvsvc_NetTransportCtr *py_export_srvsvc_NetTransportCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_NetTransportInfoCtr_Type; +static PyTypeObject srvsvc_NetRemoteTODInfo_Type; +PyObject *py_import_srvsvc_NetTransportInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetTransportInfo *in); +union srvsvc_NetTransportInfo *py_export_srvsvc_NetTransportInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in); +static PyTypeObject srvsvc_InterfaceType; void initsrvsvc(void);static PyTypeObject *Object_Type; static PyTypeObject *sec_desc_buf_Type; @@ -205,15 +286,42 @@ static PyObject *py_srvsvc_NetCharDevCtr0_get_count(PyObject *obj, void *closure { struct srvsvc_NetCharDevCtr0 *object = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetCharDevCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevCtr0 *object = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -231,7 +339,7 @@ static PyObject *py_srvsvc_NetCharDevCtr0_get_array(PyObject *obj, void *closure } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevInfo0_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -244,7 +352,7 @@ static PyObject *py_srvsvc_NetCharDevCtr0_get_array(PyObject *obj, void *closure static int py_srvsvc_NetCharDevCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevCtr0 *object = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -332,15 +440,42 @@ static PyObject *py_srvsvc_NetCharDevInfo1_get_status(PyObject *obj, void *closu { struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(obj); PyObject *py_status; - py_status = PyInt_FromLong(object->status); + py_status = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->status); return py_status; } static int py_srvsvc_NetCharDevInfo1_set_status(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->status = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->status = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->status = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -385,15 +520,42 @@ static PyObject *py_srvsvc_NetCharDevInfo1_get_time(PyObject *obj, void *closure { struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(obj); PyObject *py_time; - py_time = PyInt_FromLong(object->time); + py_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->time); return py_time; } static int py_srvsvc_NetCharDevInfo1_set_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -426,15 +588,42 @@ static PyObject *py_srvsvc_NetCharDevCtr1_get_count(PyObject *obj, void *closure { struct srvsvc_NetCharDevCtr1 *object = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetCharDevCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevCtr1 *object = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -452,7 +641,7 @@ static PyObject *py_srvsvc_NetCharDevCtr1_get_array(PyObject *obj, void *closure } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevInfo1_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -465,7 +654,7 @@ static PyObject *py_srvsvc_NetCharDevCtr1_get_array(PyObject *obj, void *closure static int py_srvsvc_NetCharDevCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevCtr1 *object = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -511,7 +700,7 @@ static PyTypeObject srvsvc_NetCharDevCtr1_Type = { .tp_new = py_srvsvc_NetCharDevCtr1_new, }; -static PyObject *py_import_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevInfo *in) +PyObject *py_import_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevInfo *in) { PyObject *ret; @@ -544,7 +733,7 @@ static PyObject *py_import_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, return NULL; } -static union srvsvc_NetCharDevInfo *py_export_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetCharDevInfo *py_export_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetCharDevInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevInfo); switch (level) { @@ -584,7 +773,7 @@ static union srvsvc_NetCharDevInfo *py_export_srvsvc_NetCharDevInfo(TALLOC_CTX * return ret; } -static PyObject *py_import_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevCtr *in) +PyObject *py_import_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevCtr *in) { PyObject *ret; @@ -617,7 +806,7 @@ static PyObject *py_import_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, return NULL; } -static union srvsvc_NetCharDevCtr *py_export_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetCharDevCtr *py_export_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetCharDevCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevCtr); switch (level) { @@ -662,15 +851,42 @@ static PyObject *py_srvsvc_NetCharDevInfoCtr_get_level(PyObject *obj, void *clos { struct srvsvc_NetCharDevInfoCtr *object = (struct srvsvc_NetCharDevInfoCtr *)pytalloc_get_ptr(obj); PyObject *py_level; - py_level = PyInt_FromLong(object->level); + py_level = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->level); return py_level; } static int py_srvsvc_NetCharDevInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevInfoCtr *object = (struct srvsvc_NetCharDevInfoCtr *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->level = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -785,15 +1001,42 @@ static PyObject *py_srvsvc_NetCharDevQCtr0_get_count(PyObject *obj, void *closur { struct srvsvc_NetCharDevQCtr0 *object = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetCharDevQCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQCtr0 *object = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -811,7 +1054,7 @@ static PyObject *py_srvsvc_NetCharDevQCtr0_get_array(PyObject *obj, void *closur } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevQInfo0_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -824,7 +1067,7 @@ static PyObject *py_srvsvc_NetCharDevQCtr0_get_array(PyObject *obj, void *closur static int py_srvsvc_NetCharDevQCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQCtr0 *object = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -912,15 +1155,42 @@ static PyObject *py_srvsvc_NetCharDevQInfo1_get_priority(PyObject *obj, void *cl { struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj); PyObject *py_priority; - py_priority = PyInt_FromLong(object->priority); + py_priority = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->priority); return py_priority; } static int py_srvsvc_NetCharDevQInfo1_set_priority(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->priority = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->priority = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->priority = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -965,15 +1235,42 @@ static PyObject *py_srvsvc_NetCharDevQInfo1_get_users(PyObject *obj, void *closu { struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj); PyObject *py_users; - py_users = PyInt_FromLong(object->users); + py_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->users); return py_users; } static int py_srvsvc_NetCharDevQInfo1_set_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -981,15 +1278,42 @@ static PyObject *py_srvsvc_NetCharDevQInfo1_get_num_ahead(PyObject *obj, void *c { struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj); PyObject *py_num_ahead; - py_num_ahead = PyInt_FromLong(object->num_ahead); + py_num_ahead = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_ahead); return py_num_ahead; } static int py_srvsvc_NetCharDevQInfo1_set_num_ahead(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->num_ahead = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_ahead)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_ahead = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_ahead = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1023,15 +1347,42 @@ static PyObject *py_srvsvc_NetCharDevQCtr1_get_count(PyObject *obj, void *closur { struct srvsvc_NetCharDevQCtr1 *object = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetCharDevQCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQCtr1 *object = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1049,7 +1400,7 @@ static PyObject *py_srvsvc_NetCharDevQCtr1_get_array(PyObject *obj, void *closur } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevQInfo1_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -1062,7 +1413,7 @@ static PyObject *py_srvsvc_NetCharDevQCtr1_get_array(PyObject *obj, void *closur static int py_srvsvc_NetCharDevQCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQCtr1 *object = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -1108,7 +1459,7 @@ static PyTypeObject srvsvc_NetCharDevQCtr1_Type = { .tp_new = py_srvsvc_NetCharDevQCtr1_new, }; -static PyObject *py_import_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQInfo *in) +PyObject *py_import_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQInfo *in) { PyObject *ret; @@ -1141,7 +1492,7 @@ static PyObject *py_import_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level return NULL; } -static union srvsvc_NetCharDevQInfo *py_export_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetCharDevQInfo *py_export_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetCharDevQInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevQInfo); switch (level) { @@ -1181,7 +1532,7 @@ static union srvsvc_NetCharDevQInfo *py_export_srvsvc_NetCharDevQInfo(TALLOC_CTX return ret; } -static PyObject *py_import_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQCtr *in) +PyObject *py_import_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQCtr *in) { PyObject *ret; @@ -1214,7 +1565,7 @@ static PyObject *py_import_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, return NULL; } -static union srvsvc_NetCharDevQCtr *py_export_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetCharDevQCtr *py_export_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetCharDevQCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevQCtr); switch (level) { @@ -1259,15 +1610,42 @@ static PyObject *py_srvsvc_NetCharDevQInfoCtr_get_level(PyObject *obj, void *clo { struct srvsvc_NetCharDevQInfoCtr *object = (struct srvsvc_NetCharDevQInfoCtr *)pytalloc_get_ptr(obj); PyObject *py_level; - py_level = PyInt_FromLong(object->level); + py_level = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->level); return py_level; } static int py_srvsvc_NetCharDevQInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetCharDevQInfoCtr *object = (struct srvsvc_NetCharDevQInfoCtr *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->level = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1323,15 +1701,42 @@ static PyObject *py_srvsvc_NetConnInfo0_get_conn_id(PyObject *obj, void *closure { struct srvsvc_NetConnInfo0 *object = (struct srvsvc_NetConnInfo0 *)pytalloc_get_ptr(obj); PyObject *py_conn_id; - py_conn_id = PyInt_FromLong(object->conn_id); + py_conn_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->conn_id); return py_conn_id; } static int py_srvsvc_NetConnInfo0_set_conn_id(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnInfo0 *object = (struct srvsvc_NetConnInfo0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->conn_id = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_id)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_id = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_id = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1361,15 +1766,42 @@ static PyObject *py_srvsvc_NetConnCtr0_get_count(PyObject *obj, void *closure) { struct srvsvc_NetConnCtr0 *object = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetConnCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnCtr0 *object = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1387,7 +1819,7 @@ static PyObject *py_srvsvc_NetConnCtr0_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetConnInfo0_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -1400,7 +1832,7 @@ static PyObject *py_srvsvc_NetConnCtr0_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetConnCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnCtr0 *object = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -1451,15 +1883,42 @@ static PyObject *py_srvsvc_NetConnInfo1_get_conn_id(PyObject *obj, void *closure { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj); PyObject *py_conn_id; - py_conn_id = PyInt_FromLong(object->conn_id); + py_conn_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->conn_id); return py_conn_id; } static int py_srvsvc_NetConnInfo1_set_conn_id(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->conn_id = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_id)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_id = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_id = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1467,15 +1926,42 @@ static PyObject *py_srvsvc_NetConnInfo1_get_conn_type(PyObject *obj, void *closu { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj); PyObject *py_conn_type; - py_conn_type = PyInt_FromLong(object->conn_type); + py_conn_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->conn_type); return py_conn_type; } static int py_srvsvc_NetConnInfo1_set_conn_type(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->conn_type = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_type)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_type = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1483,15 +1969,42 @@ static PyObject *py_srvsvc_NetConnInfo1_get_num_open(PyObject *obj, void *closur { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj); PyObject *py_num_open; - py_num_open = PyInt_FromLong(object->num_open); + py_num_open = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_open); return py_num_open; } static int py_srvsvc_NetConnInfo1_set_num_open(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->num_open = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1499,15 +2012,42 @@ static PyObject *py_srvsvc_NetConnInfo1_get_num_users(PyObject *obj, void *closu { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj); PyObject *py_num_users; - py_num_users = PyInt_FromLong(object->num_users); + py_num_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_users); return py_num_users; } static int py_srvsvc_NetConnInfo1_set_num_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->num_users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1515,15 +2055,42 @@ static PyObject *py_srvsvc_NetConnInfo1_get_conn_time(PyObject *obj, void *closu { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj); PyObject *py_conn_time; - py_conn_time = PyInt_FromLong(object->conn_time); + py_conn_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->conn_time); return py_conn_time; } static int py_srvsvc_NetConnInfo1_set_conn_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->conn_time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->conn_time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1633,15 +2200,42 @@ static PyObject *py_srvsvc_NetConnCtr1_get_count(PyObject *obj, void *closure) { struct srvsvc_NetConnCtr1 *object = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetConnCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnCtr1 *object = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1659,7 +2253,7 @@ static PyObject *py_srvsvc_NetConnCtr1_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetConnInfo1_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -1672,7 +2266,7 @@ static PyObject *py_srvsvc_NetConnCtr1_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetConnCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnCtr1 *object = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -1718,7 +2312,7 @@ static PyTypeObject srvsvc_NetConnCtr1_Type = { .tp_new = py_srvsvc_NetConnCtr1_new, }; -static PyObject *py_import_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetConnCtr *in) +PyObject *py_import_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetConnCtr *in) { PyObject *ret; @@ -1751,7 +2345,7 @@ static PyObject *py_import_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, uni return NULL; } -static union srvsvc_NetConnCtr *py_export_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetConnCtr *py_export_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetConnCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetConnCtr); switch (level) { @@ -1796,15 +2390,42 @@ static PyObject *py_srvsvc_NetConnInfoCtr_get_level(PyObject *obj, void *closure { struct srvsvc_NetConnInfoCtr *object = (struct srvsvc_NetConnInfoCtr *)pytalloc_get_ptr(obj); PyObject *py_level; - py_level = PyInt_FromLong(object->level); + py_level = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->level); return py_level; } static int py_srvsvc_NetConnInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetConnInfoCtr *object = (struct srvsvc_NetConnInfoCtr *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->level = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1860,15 +2481,42 @@ static PyObject *py_srvsvc_NetFileInfo2_get_fid(PyObject *obj, void *closure) { struct srvsvc_NetFileInfo2 *object = (struct srvsvc_NetFileInfo2 *)pytalloc_get_ptr(obj); PyObject *py_fid; - py_fid = PyInt_FromLong(object->fid); + py_fid = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->fid); return py_fid; } static int py_srvsvc_NetFileInfo2_set_fid(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileInfo2 *object = (struct srvsvc_NetFileInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->fid = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fid)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->fid = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->fid = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1898,15 +2546,42 @@ static PyObject *py_srvsvc_NetFileCtr2_get_count(PyObject *obj, void *closure) { struct srvsvc_NetFileCtr2 *object = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetFileCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileCtr2 *object = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -1924,7 +2599,7 @@ static PyObject *py_srvsvc_NetFileCtr2_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetFileInfo2_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -1937,7 +2612,7 @@ static PyObject *py_srvsvc_NetFileCtr2_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetFileCtr2_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileCtr2 *object = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -1988,15 +2663,42 @@ static PyObject *py_srvsvc_NetFileInfo3_get_fid(PyObject *obj, void *closure) { struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj); PyObject *py_fid; - py_fid = PyInt_FromLong(object->fid); + py_fid = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->fid); return py_fid; } static int py_srvsvc_NetFileInfo3_set_fid(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->fid = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fid)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->fid = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->fid = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2004,15 +2706,42 @@ static PyObject *py_srvsvc_NetFileInfo3_get_permissions(PyObject *obj, void *clo { struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj); PyObject *py_permissions; - py_permissions = PyInt_FromLong(object->permissions); + py_permissions = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->permissions); return py_permissions; } static int py_srvsvc_NetFileInfo3_set_permissions(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->permissions = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->permissions)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permissions = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permissions = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2020,15 +2749,42 @@ static PyObject *py_srvsvc_NetFileInfo3_get_num_locks(PyObject *obj, void *closu { struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj); PyObject *py_num_locks; - py_num_locks = PyInt_FromLong(object->num_locks); + py_num_locks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_locks); return py_num_locks; } static int py_srvsvc_NetFileInfo3_set_num_locks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->num_locks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_locks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_locks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_locks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2136,15 +2892,42 @@ static PyObject *py_srvsvc_NetFileCtr3_get_count(PyObject *obj, void *closure) { struct srvsvc_NetFileCtr3 *object = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetFileCtr3_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileCtr3 *object = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2162,7 +2945,7 @@ static PyObject *py_srvsvc_NetFileCtr3_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetFileInfo3_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -2175,7 +2958,7 @@ static PyObject *py_srvsvc_NetFileCtr3_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetFileCtr3_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileCtr3 *object = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -2221,7 +3004,7 @@ static PyTypeObject srvsvc_NetFileCtr3_Type = { .tp_new = py_srvsvc_NetFileCtr3_new, }; -static PyObject *py_import_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileInfo *in) +PyObject *py_import_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileInfo *in) { PyObject *ret; @@ -2254,7 +3037,7 @@ static PyObject *py_import_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, un return NULL; } -static union srvsvc_NetFileInfo *py_export_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetFileInfo *py_export_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetFileInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetFileInfo); switch (level) { @@ -2294,7 +3077,7 @@ static union srvsvc_NetFileInfo *py_export_srvsvc_NetFileInfo(TALLOC_CTX *mem_ct return ret; } -static PyObject *py_import_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileCtr *in) +PyObject *py_import_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileCtr *in) { PyObject *ret; @@ -2327,7 +3110,7 @@ static PyObject *py_import_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, uni return NULL; } -static union srvsvc_NetFileCtr *py_export_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetFileCtr *py_export_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetFileCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetFileCtr); switch (level) { @@ -2372,15 +3155,42 @@ static PyObject *py_srvsvc_NetFileInfoCtr_get_level(PyObject *obj, void *closure { struct srvsvc_NetFileInfoCtr *object = (struct srvsvc_NetFileInfoCtr *)pytalloc_get_ptr(obj); PyObject *py_level; - py_level = PyInt_FromLong(object->level); + py_level = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->level); return py_level; } static int py_srvsvc_NetFileInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetFileInfoCtr *object = (struct srvsvc_NetFileInfoCtr *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->level = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2495,15 +3305,42 @@ static PyObject *py_srvsvc_NetSessCtr0_get_count(PyObject *obj, void *closure) { struct srvsvc_NetSessCtr0 *object = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetSessCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr0 *object = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2521,7 +3358,7 @@ static PyObject *py_srvsvc_NetSessCtr0_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo0_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -2534,7 +3371,7 @@ static PyObject *py_srvsvc_NetSessCtr0_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetSessCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr0 *object = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -2659,15 +3496,42 @@ static PyObject *py_srvsvc_NetSessInfo1_get_num_open(PyObject *obj, void *closur { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj); PyObject *py_num_open; - py_num_open = PyInt_FromLong(object->num_open); + py_num_open = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_open); return py_num_open; } static int py_srvsvc_NetSessInfo1_set_num_open(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->num_open = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2675,15 +3539,42 @@ static PyObject *py_srvsvc_NetSessInfo1_get_time(PyObject *obj, void *closure) { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj); PyObject *py_time; - py_time = PyInt_FromLong(object->time); + py_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->time); return py_time; } static int py_srvsvc_NetSessInfo1_set_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2691,15 +3582,42 @@ static PyObject *py_srvsvc_NetSessInfo1_get_idle_time(PyObject *obj, void *closu { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj); PyObject *py_idle_time; - py_idle_time = PyInt_FromLong(object->idle_time); + py_idle_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->idle_time); return py_idle_time; } static int py_srvsvc_NetSessInfo1_set_idle_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->idle_time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2707,15 +3625,42 @@ static PyObject *py_srvsvc_NetSessInfo1_get_user_flags(PyObject *obj, void *clos { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj); PyObject *py_user_flags; - py_user_flags = PyInt_FromLong(object->user_flags); + py_user_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->user_flags); return py_user_flags; } static int py_srvsvc_NetSessInfo1_set_user_flags(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->user_flags = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->user_flags = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->user_flags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2750,15 +3695,42 @@ static PyObject *py_srvsvc_NetSessCtr1_get_count(PyObject *obj, void *closure) { struct srvsvc_NetSessCtr1 *object = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetSessCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr1 *object = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2776,7 +3748,7 @@ static PyObject *py_srvsvc_NetSessCtr1_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo1_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -2789,7 +3761,7 @@ static PyObject *py_srvsvc_NetSessCtr1_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetSessCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr1 *object = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -2914,15 +3886,42 @@ static PyObject *py_srvsvc_NetSessInfo2_get_num_open(PyObject *obj, void *closur { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj); PyObject *py_num_open; - py_num_open = PyInt_FromLong(object->num_open); + py_num_open = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_open); return py_num_open; } static int py_srvsvc_NetSessInfo2_set_num_open(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->num_open = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2930,15 +3929,42 @@ static PyObject *py_srvsvc_NetSessInfo2_get_time(PyObject *obj, void *closure) { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj); PyObject *py_time; - py_time = PyInt_FromLong(object->time); + py_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->time); return py_time; } static int py_srvsvc_NetSessInfo2_set_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2946,15 +3972,42 @@ static PyObject *py_srvsvc_NetSessInfo2_get_idle_time(PyObject *obj, void *closu { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj); PyObject *py_idle_time; - py_idle_time = PyInt_FromLong(object->idle_time); + py_idle_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->idle_time); return py_idle_time; } static int py_srvsvc_NetSessInfo2_set_idle_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->idle_time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -2962,15 +4015,42 @@ static PyObject *py_srvsvc_NetSessInfo2_get_user_flags(PyObject *obj, void *clos { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj); PyObject *py_user_flags; - py_user_flags = PyInt_FromLong(object->user_flags); + py_user_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->user_flags); return py_user_flags; } static int py_srvsvc_NetSessInfo2_set_user_flags(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->user_flags = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->user_flags = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->user_flags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3043,15 +4123,42 @@ static PyObject *py_srvsvc_NetSessCtr2_get_count(PyObject *obj, void *closure) { struct srvsvc_NetSessCtr2 *object = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetSessCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr2 *object = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3069,7 +4176,7 @@ static PyObject *py_srvsvc_NetSessCtr2_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo2_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -3082,7 +4189,7 @@ static PyObject *py_srvsvc_NetSessCtr2_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetSessCtr2_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr2 *object = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -3207,15 +4314,42 @@ static PyObject *py_srvsvc_NetSessInfo10_get_time(PyObject *obj, void *closure) { struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(obj); PyObject *py_time; - py_time = PyInt_FromLong(object->time); + py_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->time); return py_time; } static int py_srvsvc_NetSessInfo10_set_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3223,15 +4357,42 @@ static PyObject *py_srvsvc_NetSessInfo10_get_idle_time(PyObject *obj, void *clos { struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(obj); PyObject *py_idle_time; - py_idle_time = PyInt_FromLong(object->idle_time); + py_idle_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->idle_time); return py_idle_time; } static int py_srvsvc_NetSessInfo10_set_idle_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->idle_time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3264,15 +4425,42 @@ static PyObject *py_srvsvc_NetSessCtr10_get_count(PyObject *obj, void *closure) { struct srvsvc_NetSessCtr10 *object = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetSessCtr10_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr10 *object = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3290,7 +4478,7 @@ static PyObject *py_srvsvc_NetSessCtr10_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo10_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -3303,7 +4491,7 @@ static PyObject *py_srvsvc_NetSessCtr10_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetSessCtr10_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr10 *object = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -3428,15 +4616,42 @@ static PyObject *py_srvsvc_NetSessInfo502_get_num_open(PyObject *obj, void *clos { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj); PyObject *py_num_open; - py_num_open = PyInt_FromLong(object->num_open); + py_num_open = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_open); return py_num_open; } static int py_srvsvc_NetSessInfo502_set_num_open(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->num_open = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->num_open = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3444,15 +4659,42 @@ static PyObject *py_srvsvc_NetSessInfo502_get_time(PyObject *obj, void *closure) { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj); PyObject *py_time; - py_time = PyInt_FromLong(object->time); + py_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->time); return py_time; } static int py_srvsvc_NetSessInfo502_set_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3460,15 +4702,42 @@ static PyObject *py_srvsvc_NetSessInfo502_get_idle_time(PyObject *obj, void *clo { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj); PyObject *py_idle_time; - py_idle_time = PyInt_FromLong(object->idle_time); + py_idle_time = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->idle_time); return py_idle_time; } static int py_srvsvc_NetSessInfo502_set_idle_time(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->idle_time = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->idle_time = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3476,15 +4745,42 @@ static PyObject *py_srvsvc_NetSessInfo502_get_user_flags(PyObject *obj, void *cl { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj); PyObject *py_user_flags; - py_user_flags = PyInt_FromLong(object->user_flags); + py_user_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->user_flags); return py_user_flags; } static int py_srvsvc_NetSessInfo502_set_user_flags(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->user_flags = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->user_flags = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->user_flags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3595,15 +4891,42 @@ static PyObject *py_srvsvc_NetSessCtr502_get_count(PyObject *obj, void *closure) { struct srvsvc_NetSessCtr502 *object = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetSessCtr502_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr502 *object = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3621,7 +4944,7 @@ static PyObject *py_srvsvc_NetSessCtr502_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo502_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -3634,7 +4957,7 @@ static PyObject *py_srvsvc_NetSessCtr502_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetSessCtr502_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessCtr502 *object = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -3680,7 +5003,7 @@ static PyTypeObject srvsvc_NetSessCtr502_Type = { .tp_new = py_srvsvc_NetSessCtr502_new, }; -static PyObject *py_import_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetSessCtr *in) +PyObject *py_import_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetSessCtr *in) { PyObject *ret; @@ -3740,7 +5063,7 @@ static PyObject *py_import_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, uni return NULL; } -static union srvsvc_NetSessCtr *py_export_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetSessCtr *py_export_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetSessCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetSessCtr); switch (level) { @@ -3827,18 +5150,45 @@ static PyObject *py_srvsvc_NetSessInfoCtr_get_level(PyObject *obj, void *closure { struct srvsvc_NetSessInfoCtr *object = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(obj); PyObject *py_level; - py_level = PyInt_FromLong(object->level); + py_level = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->level); return py_level; } static int py_srvsvc_NetSessInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSessInfoCtr *object = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->level = PyInt_AsLong(value); - return 0; -} - + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } + return 0; +} + static PyObject *py_srvsvc_NetSessInfoCtr_get_ctr(PyObject *obj, void *closure) { struct srvsvc_NetSessInfoCtr *object = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(obj); @@ -3950,15 +5300,42 @@ static PyObject *py_srvsvc_NetShareCtr0_get_count(PyObject *obj, void *closure) { struct srvsvc_NetShareCtr0 *object = (struct srvsvc_NetShareCtr0 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr0 *object = (struct srvsvc_NetShareCtr0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -3976,7 +5353,7 @@ static PyObject *py_srvsvc_NetShareCtr0_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo0_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -3989,7 +5366,7 @@ static PyObject *py_srvsvc_NetShareCtr0_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetShareCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr0 *object = (struct srvsvc_NetShareCtr0 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -4077,21 +5454,41 @@ static PyObject *py_srvsvc_NetShareInfo1_get_type(PyObject *obj, void *closure) { struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(obj); PyObject *py_type; - py_type = PyInt_FromLong(object->type); + py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type); return py_type; } static int py_srvsvc_NetShareInfo1_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->type = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->type = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -4161,15 +5558,42 @@ static PyObject *py_srvsvc_NetShareCtr1_get_count(PyObject *obj, void *closure) { struct srvsvc_NetShareCtr1 *object = (struct srvsvc_NetShareCtr1 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1 *object = (struct srvsvc_NetShareCtr1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4187,7 +5611,7 @@ static PyObject *py_srvsvc_NetShareCtr1_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo1_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -4200,7 +5624,7 @@ static PyObject *py_srvsvc_NetShareCtr1_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetShareCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1 *object = (struct srvsvc_NetShareCtr1 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -4288,21 +5712,41 @@ static PyObject *py_srvsvc_NetShareInfo2_get_type(PyObject *obj, void *closure) { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj); PyObject *py_type; - py_type = PyInt_FromLong(object->type); + py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type); return py_type; } static int py_srvsvc_NetShareInfo2_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->type = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->type = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -4348,15 +5792,42 @@ static PyObject *py_srvsvc_NetShareInfo2_get_permissions(PyObject *obj, void *cl { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj); PyObject *py_permissions; - py_permissions = PyInt_FromLong(object->permissions); + py_permissions = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->permissions); return py_permissions; } static int py_srvsvc_NetShareInfo2_set_permissions(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->permissions = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->permissions)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permissions = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permissions = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4364,15 +5835,42 @@ static PyObject *py_srvsvc_NetShareInfo2_get_max_users(PyObject *obj, void *clos { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj); PyObject *py_max_users; - py_max_users = PyInt_FromLong(object->max_users); + py_max_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->max_users); return py_max_users; } static int py_srvsvc_NetShareInfo2_set_max_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->max_users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->max_users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->max_users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4380,15 +5878,42 @@ static PyObject *py_srvsvc_NetShareInfo2_get_current_users(PyObject *obj, void * { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj); PyObject *py_current_users; - py_current_users = PyInt_FromLong(object->current_users); + py_current_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->current_users); return py_current_users; } static int py_srvsvc_NetShareInfo2_set_current_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->current_users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->current_users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->current_users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->current_users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4499,15 +6024,42 @@ static PyObject *py_srvsvc_NetShareCtr2_get_count(PyObject *obj, void *closure) { struct srvsvc_NetShareCtr2 *object = (struct srvsvc_NetShareCtr2 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr2 *object = (struct srvsvc_NetShareCtr2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4525,7 +6077,7 @@ static PyObject *py_srvsvc_NetShareCtr2_get_array(PyObject *obj, void *closure) } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo2_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -4538,7 +6090,7 @@ static PyObject *py_srvsvc_NetShareCtr2_get_array(PyObject *obj, void *closure) static int py_srvsvc_NetShareCtr2_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr2 *object = (struct srvsvc_NetShareCtr2 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -4626,21 +6178,41 @@ static PyObject *py_srvsvc_NetShareInfo501_get_type(PyObject *obj, void *closure { struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(obj); PyObject *py_type; - py_type = PyInt_FromLong(object->type); + py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type); return py_type; } static int py_srvsvc_NetShareInfo501_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->type = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->type = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -4686,15 +6258,42 @@ static PyObject *py_srvsvc_NetShareInfo501_get_csc_policy(PyObject *obj, void *c { struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(obj); PyObject *py_csc_policy; - py_csc_policy = PyInt_FromLong(object->csc_policy); + py_csc_policy = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->csc_policy); return py_csc_policy; } static int py_srvsvc_NetShareInfo501_set_csc_policy(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->csc_policy = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->csc_policy)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->csc_policy = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->csc_policy = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4727,15 +6326,42 @@ static PyObject *py_srvsvc_NetShareCtr501_get_count(PyObject *obj, void *closure { struct srvsvc_NetShareCtr501 *object = (struct srvsvc_NetShareCtr501 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr501_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr501 *object = (struct srvsvc_NetShareCtr501 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4753,7 +6379,7 @@ static PyObject *py_srvsvc_NetShareCtr501_get_array(PyObject *obj, void *closure } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo501_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -4766,7 +6392,7 @@ static PyObject *py_srvsvc_NetShareCtr501_get_array(PyObject *obj, void *closure static int py_srvsvc_NetShareCtr501_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr501 *object = (struct srvsvc_NetShareCtr501 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -4854,21 +6480,41 @@ static PyObject *py_srvsvc_NetShareInfo502_get_type(PyObject *obj, void *closure { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj); PyObject *py_type; - py_type = PyInt_FromLong(object->type); + py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type); return py_type; } static int py_srvsvc_NetShareInfo502_set_type(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->type = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->type = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -4914,15 +6560,42 @@ static PyObject *py_srvsvc_NetShareInfo502_get_permissions(PyObject *obj, void * { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj); PyObject *py_permissions; - py_permissions = PyInt_FromLong(object->permissions); + py_permissions = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->permissions); return py_permissions; } static int py_srvsvc_NetShareInfo502_set_permissions(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->permissions = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->permissions)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permissions = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permissions = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4930,15 +6603,42 @@ static PyObject *py_srvsvc_NetShareInfo502_get_max_users(PyObject *obj, void *cl { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj); PyObject *py_max_users; - py_max_users = PyInt_FromLong(object->max_users); + py_max_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->max_users); return py_max_users; } static int py_srvsvc_NetShareInfo502_set_max_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->max_users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->max_users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->max_users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -4946,15 +6646,42 @@ static PyObject *py_srvsvc_NetShareInfo502_get_current_users(PyObject *obj, void { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj); PyObject *py_current_users; - py_current_users = PyInt_FromLong(object->current_users); + py_current_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->current_users); return py_current_users; } static int py_srvsvc_NetShareInfo502_set_current_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->current_users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->current_users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->current_users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->current_users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5086,15 +6813,42 @@ static PyObject *py_srvsvc_NetShareCtr502_get_count(PyObject *obj, void *closure { struct srvsvc_NetShareCtr502 *object = (struct srvsvc_NetShareCtr502 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr502_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr502 *object = (struct srvsvc_NetShareCtr502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5112,7 +6866,7 @@ static PyObject *py_srvsvc_NetShareCtr502_get_array(PyObject *obj, void *closure } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo502_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -5125,7 +6879,7 @@ static PyObject *py_srvsvc_NetShareCtr502_get_array(PyObject *obj, void *closure static int py_srvsvc_NetShareCtr502_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr502 *object = (struct srvsvc_NetShareCtr502 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -5235,15 +6989,42 @@ static PyObject *py_srvsvc_NetShareCtr1004_get_count(PyObject *obj, void *closur { struct srvsvc_NetShareCtr1004 *object = (struct srvsvc_NetShareCtr1004 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr1004_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1004 *object = (struct srvsvc_NetShareCtr1004 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5261,7 +7042,7 @@ static PyObject *py_srvsvc_NetShareCtr1004_get_array(PyObject *obj, void *closur } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo1004_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -5274,7 +7055,7 @@ static PyObject *py_srvsvc_NetShareCtr1004_get_array(PyObject *obj, void *closur static int py_srvsvc_NetShareCtr1004_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1004 *object = (struct srvsvc_NetShareCtr1004 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -5325,21 +7106,41 @@ static PyObject *py_srvsvc_NetShareInfo1005_get_dfs_flags(PyObject *obj, void *c { struct srvsvc_NetShareInfo1005 *object = (struct srvsvc_NetShareInfo1005 *)pytalloc_get_ptr(obj); PyObject *py_dfs_flags; - py_dfs_flags = PyInt_FromLong(object->dfs_flags); + py_dfs_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->dfs_flags); return py_dfs_flags; } static int py_srvsvc_NetShareInfo1005_set_dfs_flags(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo1005 *object = (struct srvsvc_NetShareInfo1005 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->dfs_flags = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->dfs_flags = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dfs_flags)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->dfs_flags = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->dfs_flags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -5370,15 +7171,42 @@ static PyObject *py_srvsvc_NetShareCtr1005_get_count(PyObject *obj, void *closur { struct srvsvc_NetShareCtr1005 *object = (struct srvsvc_NetShareCtr1005 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr1005_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1005 *object = (struct srvsvc_NetShareCtr1005 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5396,7 +7224,7 @@ static PyObject *py_srvsvc_NetShareCtr1005_get_array(PyObject *obj, void *closur } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo1005_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -5409,7 +7237,7 @@ static PyObject *py_srvsvc_NetShareCtr1005_get_array(PyObject *obj, void *closur static int py_srvsvc_NetShareCtr1005_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1005 *object = (struct srvsvc_NetShareCtr1005 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -5460,15 +7288,42 @@ static PyObject *py_srvsvc_NetShareInfo1006_get_max_users(PyObject *obj, void *c { struct srvsvc_NetShareInfo1006 *object = (struct srvsvc_NetShareInfo1006 *)pytalloc_get_ptr(obj); PyObject *py_max_users; - py_max_users = PyInt_FromLong(object->max_users); + py_max_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->max_users); return py_max_users; } static int py_srvsvc_NetShareInfo1006_set_max_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo1006 *object = (struct srvsvc_NetShareInfo1006 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->max_users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->max_users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->max_users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5498,15 +7353,42 @@ static PyObject *py_srvsvc_NetShareCtr1006_get_count(PyObject *obj, void *closur { struct srvsvc_NetShareCtr1006 *object = (struct srvsvc_NetShareCtr1006 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr1006_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1006 *object = (struct srvsvc_NetShareCtr1006 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5524,7 +7406,7 @@ static PyObject *py_srvsvc_NetShareCtr1006_get_array(PyObject *obj, void *closur } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo1006_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -5537,7 +7419,7 @@ static PyObject *py_srvsvc_NetShareCtr1006_get_array(PyObject *obj, void *closur static int py_srvsvc_NetShareCtr1006_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1006 *object = (struct srvsvc_NetShareCtr1006 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -5588,15 +7470,42 @@ static PyObject *py_srvsvc_NetShareInfo1007_get_flags(PyObject *obj, void *closu { struct srvsvc_NetShareInfo1007 *object = (struct srvsvc_NetShareInfo1007 *)pytalloc_get_ptr(obj); PyObject *py_flags; - py_flags = PyInt_FromLong(object->flags); + py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags); return py_flags; } static int py_srvsvc_NetShareInfo1007_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfo1007 *object = (struct srvsvc_NetShareInfo1007 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->flags = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->flags = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->flags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5664,15 +7573,42 @@ static PyObject *py_srvsvc_NetShareCtr1007_get_count(PyObject *obj, void *closur { struct srvsvc_NetShareCtr1007 *object = (struct srvsvc_NetShareCtr1007 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr1007_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1007 *object = (struct srvsvc_NetShareCtr1007 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5690,7 +7626,7 @@ static PyObject *py_srvsvc_NetShareCtr1007_get_array(PyObject *obj, void *closur } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo1007_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -5703,7 +7639,7 @@ static PyObject *py_srvsvc_NetShareCtr1007_get_array(PyObject *obj, void *closur static int py_srvsvc_NetShareCtr1007_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1007 *object = (struct srvsvc_NetShareCtr1007 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -5754,15 +7690,42 @@ static PyObject *py_srvsvc_NetShareCtr1501_get_count(PyObject *obj, void *closur { struct srvsvc_NetShareCtr1501 *object = (struct srvsvc_NetShareCtr1501 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetShareCtr1501_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1501 *object = (struct srvsvc_NetShareCtr1501 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -5780,7 +7743,7 @@ static PyObject *py_srvsvc_NetShareCtr1501_get_array(PyObject *obj, void *closur } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(sec_desc_buf_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -5793,7 +7756,7 @@ static PyObject *py_srvsvc_NetShareCtr1501_get_array(PyObject *obj, void *closur static int py_srvsvc_NetShareCtr1501_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareCtr1501 *object = (struct srvsvc_NetShareCtr1501 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -5839,7 +7802,7 @@ static PyTypeObject srvsvc_NetShareCtr1501_Type = { .tp_new = py_srvsvc_NetShareCtr1501_new, }; -static PyObject *py_import_srvsvc_NetShareInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetShareInfo *in) +PyObject *py_import_srvsvc_NetShareInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetShareInfo *in) { PyObject *ret; @@ -5944,7 +7907,7 @@ static PyObject *py_import_srvsvc_NetShareInfo(TALLOC_CTX *mem_ctx, int level, u return NULL; } -static union srvsvc_NetShareInfo *py_export_srvsvc_NetShareInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetShareInfo *py_export_srvsvc_NetShareInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetShareInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetShareInfo); switch (level) { @@ -6096,7 +8059,7 @@ static union srvsvc_NetShareInfo *py_export_srvsvc_NetShareInfo(TALLOC_CTX *mem_ return ret; } -static PyObject *py_import_srvsvc_NetShareCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetShareCtr *in) +PyObject *py_import_srvsvc_NetShareCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetShareCtr *in) { PyObject *ret; @@ -6201,7 +8164,7 @@ static PyObject *py_import_srvsvc_NetShareCtr(TALLOC_CTX *mem_ctx, int level, un return NULL; } -static union srvsvc_NetShareCtr *py_export_srvsvc_NetShareCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetShareCtr *py_export_srvsvc_NetShareCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetShareCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetShareCtr); switch (level) { @@ -6358,15 +8321,42 @@ static PyObject *py_srvsvc_NetShareInfoCtr_get_level(PyObject *obj, void *closur { struct srvsvc_NetShareInfoCtr *object = (struct srvsvc_NetShareInfoCtr *)pytalloc_get_ptr(obj); PyObject *py_level; - py_level = PyInt_FromLong(object->level); + py_level = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->level); return py_level; } static int py_srvsvc_NetShareInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetShareInfoCtr *object = (struct srvsvc_NetShareInfoCtr *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->level = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -6422,21 +8412,41 @@ static PyObject *py_srvsvc_NetSrvInfo100_get_platform_id(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo100 *object = (struct srvsvc_NetSrvInfo100 *)pytalloc_get_ptr(obj); PyObject *py_platform_id; - py_platform_id = PyInt_FromLong(object->platform_id); + py_platform_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->platform_id); return py_platform_id; } static int py_srvsvc_NetSrvInfo100_set_platform_id(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo100 *object = (struct srvsvc_NetSrvInfo100 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->platform_id = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->platform_id = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->platform_id)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->platform_id = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->platform_id = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -6574,21 +8584,41 @@ static PyObject *py_srvsvc_NetSrvInfo101_get_platform_id(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(obj); PyObject *py_platform_id; - py_platform_id = PyInt_FromLong(object->platform_id); + py_platform_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->platform_id); return py_platform_id; } static int py_srvsvc_NetSrvInfo101_set_platform_id(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->platform_id = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->platform_id = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->platform_id)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->platform_id = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->platform_id = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -6634,15 +8664,42 @@ static PyObject *py_srvsvc_NetSrvInfo101_get_version_major(PyObject *obj, void * { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(obj); PyObject *py_version_major; - py_version_major = PyInt_FromLong(object->version_major); + py_version_major = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version_major); return py_version_major; } static int py_srvsvc_NetSrvInfo101_set_version_major(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->version_major = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_major)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_major = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_major = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -6650,15 +8707,42 @@ static PyObject *py_srvsvc_NetSrvInfo101_get_version_minor(PyObject *obj, void * { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(obj); PyObject *py_version_minor; - py_version_minor = PyInt_FromLong(object->version_minor); + py_version_minor = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version_minor); return py_version_minor; } static int py_srvsvc_NetSrvInfo101_set_version_minor(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->version_minor = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_minor)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_minor = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_minor = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -6666,21 +8750,41 @@ static PyObject *py_srvsvc_NetSrvInfo101_get_server_type(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(obj); PyObject *py_server_type; - py_server_type = PyInt_FromLong(object->server_type); + py_server_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->server_type); return py_server_type; } static int py_srvsvc_NetSrvInfo101_set_server_type(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo101 *object = (struct srvsvc_NetSrvInfo101 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->server_type = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->server_type = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->server_type = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->server_type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -6822,21 +8926,41 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_platform_id(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_platform_id; - py_platform_id = PyInt_FromLong(object->platform_id); + py_platform_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->platform_id); return py_platform_id; } static int py_srvsvc_NetSrvInfo102_set_platform_id(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->platform_id = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->platform_id = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->platform_id)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->platform_id = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->platform_id = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -6882,15 +9006,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_version_major(PyObject *obj, void * { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_version_major; - py_version_major = PyInt_FromLong(object->version_major); + py_version_major = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version_major); return py_version_major; } static int py_srvsvc_NetSrvInfo102_set_version_major(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->version_major = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_major)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_major = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_major = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -6898,15 +9049,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_version_minor(PyObject *obj, void * { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_version_minor; - py_version_minor = PyInt_FromLong(object->version_minor); + py_version_minor = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version_minor); return py_version_minor; } static int py_srvsvc_NetSrvInfo102_set_version_minor(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->version_minor = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_minor)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_minor = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->version_minor = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -6914,21 +9092,41 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_server_type(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_server_type; - py_server_type = PyInt_FromLong(object->server_type); + py_server_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->server_type); return py_server_type; } static int py_srvsvc_NetSrvInfo102_set_server_type(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - if (PyLong_Check(value)) { - object->server_type = PyLong_AsLongLong(value); - } else if (PyInt_Check(value)) { - object->server_type = PyInt_AsLong(value); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return -1; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_type)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->server_type = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->server_type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } } return 0; } @@ -6974,15 +9172,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_users(PyObject *obj, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_users; - py_users = PyInt_FromLong(object->users); + py_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->users); return py_users; } static int py_srvsvc_NetSrvInfo102_set_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -6990,15 +9215,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_disc(PyObject *obj, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_disc; - py_disc = PyInt_FromLong(object->disc); + py_disc = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->disc); return py_disc; } static int py_srvsvc_NetSrvInfo102_set_disc(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->disc = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->disc)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->disc = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->disc = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7006,15 +9258,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_hidden(PyObject *obj, void *closure { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_hidden; - py_hidden = PyInt_FromLong(object->hidden); + py_hidden = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->hidden); return py_hidden; } static int py_srvsvc_NetSrvInfo102_set_hidden(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->hidden = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hidden)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hidden = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hidden = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7022,15 +9301,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_announce(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_announce; - py_announce = PyInt_FromLong(object->announce); + py_announce = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->announce); return py_announce; } static int py_srvsvc_NetSrvInfo102_set_announce(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->announce = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->announce)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->announce = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->announce = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7038,15 +9344,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_anndelta(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_anndelta; - py_anndelta = PyInt_FromLong(object->anndelta); + py_anndelta = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->anndelta); return py_anndelta; } static int py_srvsvc_NetSrvInfo102_set_anndelta(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->anndelta = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->anndelta)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->anndelta = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->anndelta = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7054,15 +9387,42 @@ static PyObject *py_srvsvc_NetSrvInfo102_get_licenses(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(obj); PyObject *py_licenses; - py_licenses = PyInt_FromLong(object->licenses); + py_licenses = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->licenses); return py_licenses; } static int py_srvsvc_NetSrvInfo102_set_licenses(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo102 *object = (struct srvsvc_NetSrvInfo102 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->licenses = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->licenses)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->licenses = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->licenses = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7141,15 +9501,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_ulist_mtime(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_ulist_mtime; - py_ulist_mtime = PyInt_FromLong(object->ulist_mtime); + py_ulist_mtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ulist_mtime); return py_ulist_mtime; } static int py_srvsvc_NetSrvInfo402_set_ulist_mtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->ulist_mtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ulist_mtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->ulist_mtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->ulist_mtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7157,15 +9544,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_glist_mtime(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_glist_mtime; - py_glist_mtime = PyInt_FromLong(object->glist_mtime); + py_glist_mtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->glist_mtime); return py_glist_mtime; } static int py_srvsvc_NetSrvInfo402_set_glist_mtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->glist_mtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->glist_mtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->glist_mtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->glist_mtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7173,15 +9587,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_alist_mtime(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_alist_mtime; - py_alist_mtime = PyInt_FromLong(object->alist_mtime); + py_alist_mtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alist_mtime); return py_alist_mtime; } static int py_srvsvc_NetSrvInfo402_set_alist_mtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->alist_mtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alist_mtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alist_mtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alist_mtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7226,15 +9667,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_security(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_security; - py_security = PyInt_FromLong(object->security); + py_security = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->security); return py_security; } static int py_srvsvc_NetSrvInfo402_set_security(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->security = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->security)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->security = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->security = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7242,15 +9710,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_numadmin(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_numadmin; - py_numadmin = PyInt_FromLong(object->numadmin); + py_numadmin = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numadmin); return py_numadmin; } static int py_srvsvc_NetSrvInfo402_set_numadmin(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numadmin = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numadmin)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numadmin = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numadmin = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7258,15 +9753,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_lanmask(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_lanmask; - py_lanmask = PyInt_FromLong(object->lanmask); + py_lanmask = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->lanmask); return py_lanmask; } static int py_srvsvc_NetSrvInfo402_set_lanmask(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->lanmask = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lanmask)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lanmask = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lanmask = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7311,15 +9833,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_chdevs(PyObject *obj, void *closure { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_chdevs; - py_chdevs = PyInt_FromLong(object->chdevs); + py_chdevs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->chdevs); return py_chdevs; } static int py_srvsvc_NetSrvInfo402_set_chdevs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->chdevs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->chdevs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7327,31 +9876,85 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_chdevqs(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_chdevqs; - py_chdevqs = PyInt_FromLong(object->chdevqs); + py_chdevqs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->chdevqs); return py_chdevqs; } static int py_srvsvc_NetSrvInfo402_set_chdevqs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->chdevqs = PyInt_AsLong(value); - return 0; -} - + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->chdevqs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevqs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevqs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } + return 0; +} + static PyObject *py_srvsvc_NetSrvInfo402_get_chdevjobs(PyObject *obj, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_chdevjobs; - py_chdevjobs = PyInt_FromLong(object->chdevjobs); + py_chdevjobs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->chdevjobs); return py_chdevjobs; } static int py_srvsvc_NetSrvInfo402_set_chdevjobs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->chdevjobs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->chdevjobs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevjobs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevjobs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7359,15 +9962,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_connections(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_connections; - py_connections = PyInt_FromLong(object->connections); + py_connections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->connections); return py_connections; } static int py_srvsvc_NetSrvInfo402_set_connections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->connections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->connections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->connections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->connections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7375,15 +10005,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_shares(PyObject *obj, void *closure { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_shares; - py_shares = PyInt_FromLong(object->shares); + py_shares = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->shares); return py_shares; } static int py_srvsvc_NetSrvInfo402_set_shares(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->shares = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shares)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->shares = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->shares = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7391,15 +10048,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_openfiles(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_openfiles; - py_openfiles = PyInt_FromLong(object->openfiles); + py_openfiles = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->openfiles); return py_openfiles; } static int py_srvsvc_NetSrvInfo402_set_openfiles(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->openfiles = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->openfiles)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->openfiles = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->openfiles = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7407,15 +10091,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_sessopen(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_sessopen; - py_sessopen = PyInt_FromLong(object->sessopen); + py_sessopen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessopen); return py_sessopen; } static int py_srvsvc_NetSrvInfo402_set_sessopen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessopen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessopen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7423,15 +10134,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_sesssvc(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_sesssvc; - py_sesssvc = PyInt_FromLong(object->sesssvc); + py_sesssvc = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sesssvc); return py_sesssvc; } static int py_srvsvc_NetSrvInfo402_set_sesssvc(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sesssvc = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sesssvc)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7439,15 +10177,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_sessreqs(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_sessreqs; - py_sessreqs = PyInt_FromLong(object->sessreqs); + py_sessreqs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessreqs); return py_sessreqs; } static int py_srvsvc_NetSrvInfo402_set_sessreqs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessreqs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessreqs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessreqs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessreqs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7455,15 +10220,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_opensearch(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_opensearch; - py_opensearch = PyInt_FromLong(object->opensearch); + py_opensearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->opensearch); return py_opensearch; } static int py_srvsvc_NetSrvInfo402_set_opensearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->opensearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opensearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7471,15 +10263,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_activelocks(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_activelocks; - py_activelocks = PyInt_FromLong(object->activelocks); + py_activelocks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->activelocks); return py_activelocks; } static int py_srvsvc_NetSrvInfo402_set_activelocks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->activelocks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->activelocks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->activelocks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->activelocks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7487,15 +10306,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_numreqbufs(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_numreqbufs; - py_numreqbufs = PyInt_FromLong(object->numreqbufs); + py_numreqbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numreqbufs); return py_numreqbufs; } static int py_srvsvc_NetSrvInfo402_set_numreqbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numreqbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numreqbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numreqbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numreqbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7503,15 +10349,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_sizereqbufs(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_sizereqbufs; - py_sizereqbufs = PyInt_FromLong(object->sizereqbufs); + py_sizereqbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sizereqbufs); return py_sizereqbufs; } static int py_srvsvc_NetSrvInfo402_set_sizereqbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sizereqbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sizereqbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7519,15 +10392,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_numbigbufs(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_numbigbufs; - py_numbigbufs = PyInt_FromLong(object->numbigbufs); + py_numbigbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numbigbufs); return py_numbigbufs; } static int py_srvsvc_NetSrvInfo402_set_numbigbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numbigbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numbigbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numbigbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numbigbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7535,15 +10435,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_numfiletasks(PyObject *obj, void *c { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_numfiletasks; - py_numfiletasks = PyInt_FromLong(object->numfiletasks); + py_numfiletasks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numfiletasks); return py_numfiletasks; } static int py_srvsvc_NetSrvInfo402_set_numfiletasks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numfiletasks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numfiletasks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numfiletasks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numfiletasks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7551,15 +10478,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_alertsched(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_alertsched; - py_alertsched = PyInt_FromLong(object->alertsched); + py_alertsched = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alertsched); return py_alertsched; } static int py_srvsvc_NetSrvInfo402_set_alertsched(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->alertsched = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alertsched)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7567,15 +10521,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_erroralert(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_erroralert; - py_erroralert = PyInt_FromLong(object->erroralert); + py_erroralert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->erroralert); return py_erroralert; } static int py_srvsvc_NetSrvInfo402_set_erroralert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->erroralert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->erroralert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->erroralert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->erroralert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7583,15 +10564,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_logonalert(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_logonalert; - py_logonalert = PyInt_FromLong(object->logonalert); + py_logonalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->logonalert); return py_logonalert; } static int py_srvsvc_NetSrvInfo402_set_logonalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->logonalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logonalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->logonalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->logonalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7599,15 +10607,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_accessalert(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_accessalert; - py_accessalert = PyInt_FromLong(object->accessalert); + py_accessalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->accessalert); return py_accessalert; } static int py_srvsvc_NetSrvInfo402_set_accessalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->accessalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->accessalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->accessalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->accessalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7615,15 +10650,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_diskalert(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_diskalert; - py_diskalert = PyInt_FromLong(object->diskalert); + py_diskalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->diskalert); return py_diskalert; } static int py_srvsvc_NetSrvInfo402_set_diskalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->diskalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->diskalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7631,15 +10693,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_netioalert(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_netioalert; - py_netioalert = PyInt_FromLong(object->netioalert); + py_netioalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->netioalert); return py_netioalert; } static int py_srvsvc_NetSrvInfo402_set_netioalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->netioalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->netioalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->netioalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->netioalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7647,15 +10736,42 @@ static PyObject *py_srvsvc_NetSrvInfo402_get_maxaudits(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(obj); PyObject *py_maxaudits; - py_maxaudits = PyInt_FromLong(object->maxaudits); + py_maxaudits = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxaudits); return py_maxaudits; } static int py_srvsvc_NetSrvInfo402_set_maxaudits(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo402 *object = (struct srvsvc_NetSrvInfo402 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxaudits = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxaudits)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxaudits = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxaudits = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7752,15 +10868,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_ulist_mtime(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_ulist_mtime; - py_ulist_mtime = PyInt_FromLong(object->ulist_mtime); + py_ulist_mtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ulist_mtime); return py_ulist_mtime; } static int py_srvsvc_NetSrvInfo403_set_ulist_mtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->ulist_mtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ulist_mtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->ulist_mtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->ulist_mtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7768,15 +10911,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_glist_mtime(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_glist_mtime; - py_glist_mtime = PyInt_FromLong(object->glist_mtime); + py_glist_mtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->glist_mtime); return py_glist_mtime; } static int py_srvsvc_NetSrvInfo403_set_glist_mtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->glist_mtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->glist_mtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->glist_mtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->glist_mtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7784,15 +10954,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_alist_mtime(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_alist_mtime; - py_alist_mtime = PyInt_FromLong(object->alist_mtime); + py_alist_mtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alist_mtime); return py_alist_mtime; } static int py_srvsvc_NetSrvInfo403_set_alist_mtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->alist_mtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alist_mtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alist_mtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alist_mtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7837,15 +11034,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_security(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_security; - py_security = PyInt_FromLong(object->security); + py_security = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->security); return py_security; } static int py_srvsvc_NetSrvInfo403_set_security(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->security = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->security)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->security = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->security = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7853,15 +11077,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_numadmin(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_numadmin; - py_numadmin = PyInt_FromLong(object->numadmin); + py_numadmin = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numadmin); return py_numadmin; } static int py_srvsvc_NetSrvInfo403_set_numadmin(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numadmin = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numadmin)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numadmin = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numadmin = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7869,15 +11120,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_lanmask(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_lanmask; - py_lanmask = PyInt_FromLong(object->lanmask); + py_lanmask = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->lanmask); return py_lanmask; } static int py_srvsvc_NetSrvInfo403_set_lanmask(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->lanmask = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lanmask)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lanmask = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lanmask = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7922,15 +11200,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_chdevs(PyObject *obj, void *closure { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_chdevs; - py_chdevs = PyInt_FromLong(object->chdevs); + py_chdevs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->chdevs); return py_chdevs; } static int py_srvsvc_NetSrvInfo403_set_chdevs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->chdevs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->chdevs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7938,15 +11243,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_chdevqs(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_chdevqs; - py_chdevqs = PyInt_FromLong(object->chdevqs); + py_chdevqs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->chdevqs); return py_chdevqs; } static int py_srvsvc_NetSrvInfo403_set_chdevqs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->chdevqs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->chdevqs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevqs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevqs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7954,15 +11286,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_chdevjobs(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_chdevjobs; - py_chdevjobs = PyInt_FromLong(object->chdevjobs); + py_chdevjobs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->chdevjobs); return py_chdevjobs; } static int py_srvsvc_NetSrvInfo403_set_chdevjobs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->chdevjobs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->chdevjobs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevjobs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->chdevjobs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7970,15 +11329,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_connections(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_connections; - py_connections = PyInt_FromLong(object->connections); + py_connections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->connections); return py_connections; } static int py_srvsvc_NetSrvInfo403_set_connections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->connections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->connections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->connections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->connections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -7986,15 +11372,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_shares(PyObject *obj, void *closure { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_shares; - py_shares = PyInt_FromLong(object->shares); + py_shares = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->shares); return py_shares; } static int py_srvsvc_NetSrvInfo403_set_shares(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->shares = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shares)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->shares = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->shares = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8002,15 +11415,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_openfiles(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_openfiles; - py_openfiles = PyInt_FromLong(object->openfiles); + py_openfiles = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->openfiles); return py_openfiles; } static int py_srvsvc_NetSrvInfo403_set_openfiles(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->openfiles = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->openfiles)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->openfiles = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->openfiles = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8018,15 +11458,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_sessopen(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_sessopen; - py_sessopen = PyInt_FromLong(object->sessopen); + py_sessopen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessopen); return py_sessopen; } static int py_srvsvc_NetSrvInfo403_set_sessopen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessopen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessopen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8034,15 +11501,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_sesssvc(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_sesssvc; - py_sesssvc = PyInt_FromLong(object->sesssvc); + py_sesssvc = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sesssvc); return py_sesssvc; } static int py_srvsvc_NetSrvInfo403_set_sesssvc(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sesssvc = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sesssvc)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8050,15 +11544,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_sessreqs(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_sessreqs; - py_sessreqs = PyInt_FromLong(object->sessreqs); + py_sessreqs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessreqs); return py_sessreqs; } static int py_srvsvc_NetSrvInfo403_set_sessreqs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessreqs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessreqs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessreqs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessreqs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8066,15 +11587,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_opensearch(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_opensearch; - py_opensearch = PyInt_FromLong(object->opensearch); + py_opensearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->opensearch); return py_opensearch; } static int py_srvsvc_NetSrvInfo403_set_opensearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->opensearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opensearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8082,15 +11630,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_activelocks(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_activelocks; - py_activelocks = PyInt_FromLong(object->activelocks); + py_activelocks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->activelocks); return py_activelocks; } static int py_srvsvc_NetSrvInfo403_set_activelocks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->activelocks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->activelocks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->activelocks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->activelocks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8098,15 +11673,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_numreqbufs(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_numreqbufs; - py_numreqbufs = PyInt_FromLong(object->numreqbufs); + py_numreqbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numreqbufs); return py_numreqbufs; } static int py_srvsvc_NetSrvInfo403_set_numreqbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numreqbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numreqbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numreqbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numreqbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8114,15 +11716,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_sizereqbufs(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_sizereqbufs; - py_sizereqbufs = PyInt_FromLong(object->sizereqbufs); + py_sizereqbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sizereqbufs); return py_sizereqbufs; } static int py_srvsvc_NetSrvInfo403_set_sizereqbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sizereqbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sizereqbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8130,15 +11759,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_numbigbufs(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_numbigbufs; - py_numbigbufs = PyInt_FromLong(object->numbigbufs); + py_numbigbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numbigbufs); return py_numbigbufs; } static int py_srvsvc_NetSrvInfo403_set_numbigbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numbigbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numbigbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numbigbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numbigbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8146,15 +11802,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_numfiletasks(PyObject *obj, void *c { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_numfiletasks; - py_numfiletasks = PyInt_FromLong(object->numfiletasks); + py_numfiletasks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numfiletasks); return py_numfiletasks; } static int py_srvsvc_NetSrvInfo403_set_numfiletasks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numfiletasks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numfiletasks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numfiletasks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numfiletasks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8162,15 +11845,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_alertsched(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_alertsched; - py_alertsched = PyInt_FromLong(object->alertsched); + py_alertsched = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alertsched); return py_alertsched; } static int py_srvsvc_NetSrvInfo403_set_alertsched(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->alertsched = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alertsched)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8178,15 +11888,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_erroralert(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_erroralert; - py_erroralert = PyInt_FromLong(object->erroralert); + py_erroralert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->erroralert); return py_erroralert; } static int py_srvsvc_NetSrvInfo403_set_erroralert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->erroralert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->erroralert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->erroralert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->erroralert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8194,15 +11931,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_logonalert(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_logonalert; - py_logonalert = PyInt_FromLong(object->logonalert); + py_logonalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->logonalert); return py_logonalert; } static int py_srvsvc_NetSrvInfo403_set_logonalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->logonalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logonalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->logonalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->logonalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8210,15 +11974,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_accessalert(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_accessalert; - py_accessalert = PyInt_FromLong(object->accessalert); + py_accessalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->accessalert); return py_accessalert; } static int py_srvsvc_NetSrvInfo403_set_accessalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->accessalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->accessalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->accessalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->accessalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8226,15 +12017,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_diskalert(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_diskalert; - py_diskalert = PyInt_FromLong(object->diskalert); + py_diskalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->diskalert); return py_diskalert; } static int py_srvsvc_NetSrvInfo403_set_diskalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->diskalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->diskalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8242,15 +12060,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_netioalert(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_netioalert; - py_netioalert = PyInt_FromLong(object->netioalert); + py_netioalert = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->netioalert); return py_netioalert; } static int py_srvsvc_NetSrvInfo403_set_netioalert(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->netioalert = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->netioalert)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->netioalert = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->netioalert = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8258,15 +12103,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_maxaudits(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_maxaudits; - py_maxaudits = PyInt_FromLong(object->maxaudits); + py_maxaudits = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxaudits); return py_maxaudits; } static int py_srvsvc_NetSrvInfo403_set_maxaudits(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxaudits = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxaudits)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxaudits = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxaudits = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8311,15 +12183,42 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_auditedevents(PyObject *obj, void * { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_auditedevents; - py_auditedevents = PyInt_FromLong(object->auditedevents); + py_auditedevents = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->auditedevents); return py_auditedevents; } static int py_srvsvc_NetSrvInfo403_set_auditedevents(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->auditedevents = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditedevents)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->auditedevents = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->auditedevents = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8327,18 +12226,45 @@ static PyObject *py_srvsvc_NetSrvInfo403_get_auditprofile(PyObject *obj, void *c { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); PyObject *py_auditprofile; - py_auditprofile = PyInt_FromLong(object->auditprofile); + py_auditprofile = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->auditprofile); return py_auditprofile; } static int py_srvsvc_NetSrvInfo403_set_auditprofile(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->auditprofile = PyInt_AsLong(value); - return 0; -} - + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditprofile)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->auditprofile = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->auditprofile = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } + return 0; +} + static PyObject *py_srvsvc_NetSrvInfo403_get_autopath(PyObject *obj, void *closure) { struct srvsvc_NetSrvInfo403 *object = (struct srvsvc_NetSrvInfo403 *)pytalloc_get_ptr(obj); @@ -8435,15 +12361,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_sessopen(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_sessopen; - py_sessopen = PyInt_FromLong(object->sessopen); + py_sessopen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessopen); return py_sessopen; } static int py_srvsvc_NetSrvInfo502_set_sessopen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessopen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessopen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8451,15 +12404,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_sesssvc(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_sesssvc; - py_sesssvc = PyInt_FromLong(object->sesssvc); + py_sesssvc = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sesssvc); return py_sesssvc; } static int py_srvsvc_NetSrvInfo502_set_sesssvc(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sesssvc = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sesssvc)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8467,15 +12447,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_opensearch(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_opensearch; - py_opensearch = PyInt_FromLong(object->opensearch); + py_opensearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->opensearch); return py_opensearch; } static int py_srvsvc_NetSrvInfo502_set_opensearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->opensearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opensearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8483,15 +12490,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_sizereqbufs(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_sizereqbufs; - py_sizereqbufs = PyInt_FromLong(object->sizereqbufs); + py_sizereqbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sizereqbufs); return py_sizereqbufs; } static int py_srvsvc_NetSrvInfo502_set_sizereqbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sizereqbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sizereqbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8499,15 +12533,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_initworkitems(PyObject *obj, void * { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_initworkitems; - py_initworkitems = PyInt_FromLong(object->initworkitems); + py_initworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initworkitems); return py_initworkitems; } static int py_srvsvc_NetSrvInfo502_set_initworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8515,15 +12576,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_maxworkitems(PyObject *obj, void *c { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_maxworkitems; - py_maxworkitems = PyInt_FromLong(object->maxworkitems); + py_maxworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxworkitems); return py_maxworkitems; } static int py_srvsvc_NetSrvInfo502_set_maxworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8531,15 +12619,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_rawworkitems(PyObject *obj, void *c { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_rawworkitems; - py_rawworkitems = PyInt_FromLong(object->rawworkitems); + py_rawworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->rawworkitems); return py_rawworkitems; } static int py_srvsvc_NetSrvInfo502_set_rawworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->rawworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rawworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->rawworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->rawworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8547,15 +12662,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_irpstacksize(PyObject *obj, void *c { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_irpstacksize; - py_irpstacksize = PyInt_FromLong(object->irpstacksize); + py_irpstacksize = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->irpstacksize); return py_irpstacksize; } static int py_srvsvc_NetSrvInfo502_set_irpstacksize(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->irpstacksize = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->irpstacksize)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->irpstacksize = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->irpstacksize = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8563,15 +12705,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_maxrawbuflen(PyObject *obj, void *c { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_maxrawbuflen; - py_maxrawbuflen = PyInt_FromLong(object->maxrawbuflen); + py_maxrawbuflen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxrawbuflen); return py_maxrawbuflen; } static int py_srvsvc_NetSrvInfo502_set_maxrawbuflen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxrawbuflen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxrawbuflen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8579,15 +12748,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_sessusers(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_sessusers; - py_sessusers = PyInt_FromLong(object->sessusers); + py_sessusers = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessusers); return py_sessusers; } static int py_srvsvc_NetSrvInfo502_set_sessusers(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessusers = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessusers)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8595,15 +12791,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_sessconns(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_sessconns; - py_sessconns = PyInt_FromLong(object->sessconns); + py_sessconns = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessconns); return py_sessconns; } static int py_srvsvc_NetSrvInfo502_set_sessconns(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessconns = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessconns)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessconns = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessconns = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8611,15 +12834,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_maxpagedmemoryusage(PyObject *obj, { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_maxpagedmemoryusage; - py_maxpagedmemoryusage = PyInt_FromLong(object->maxpagedmemoryusage); + py_maxpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxpagedmemoryusage); return py_maxpagedmemoryusage; } static int py_srvsvc_NetSrvInfo502_set_maxpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8627,15 +12877,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_maxnonpagedmemoryusage(PyObject *ob { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_maxnonpagedmemoryusage; - py_maxnonpagedmemoryusage = PyInt_FromLong(object->maxnonpagedmemoryusage); + py_maxnonpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxnonpagedmemoryusage); return py_maxnonpagedmemoryusage; } static int py_srvsvc_NetSrvInfo502_set_maxnonpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxnonpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxnonpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8643,15 +12920,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_enablesoftcompat(PyObject *obj, voi { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_enablesoftcompat; - py_enablesoftcompat = PyInt_FromLong(object->enablesoftcompat); + py_enablesoftcompat = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablesoftcompat); return py_enablesoftcompat; } static int py_srvsvc_NetSrvInfo502_set_enablesoftcompat(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablesoftcompat = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablesoftcompat)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8659,15 +12963,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_enableforcedlogoff(PyObject *obj, v { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_enableforcedlogoff; - py_enableforcedlogoff = PyInt_FromLong(object->enableforcedlogoff); + py_enableforcedlogoff = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableforcedlogoff); return py_enableforcedlogoff; } static int py_srvsvc_NetSrvInfo502_set_enableforcedlogoff(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableforcedlogoff = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableforcedlogoff)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8675,15 +13006,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_timesource(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_timesource; - py_timesource = PyInt_FromLong(object->timesource); + py_timesource = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->timesource); return py_timesource; } static int py_srvsvc_NetSrvInfo502_set_timesource(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->timesource = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timesource)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8691,15 +13049,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_acceptdownlevelapis(PyObject *obj, { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_acceptdownlevelapis; - py_acceptdownlevelapis = PyInt_FromLong(object->acceptdownlevelapis); + py_acceptdownlevelapis = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->acceptdownlevelapis); return py_acceptdownlevelapis; } static int py_srvsvc_NetSrvInfo502_set_acceptdownlevelapis(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->acceptdownlevelapis = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acceptdownlevelapis)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->acceptdownlevelapis = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->acceptdownlevelapis = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8707,15 +13092,42 @@ static PyObject *py_srvsvc_NetSrvInfo502_get_lmannounce(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(obj); PyObject *py_lmannounce; - py_lmannounce = PyInt_FromLong(object->lmannounce); + py_lmannounce = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->lmannounce); return py_lmannounce; } static int py_srvsvc_NetSrvInfo502_set_lmannounce(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo502 *object = (struct srvsvc_NetSrvInfo502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->lmannounce = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmannounce)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8762,15 +13174,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_sessopen(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_sessopen; - py_sessopen = PyInt_FromLong(object->sessopen); + py_sessopen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessopen); return py_sessopen; } static int py_srvsvc_NetSrvInfo503_set_sessopen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessopen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessopen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8778,15 +13217,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_sesssvc(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_sesssvc; - py_sesssvc = PyInt_FromLong(object->sesssvc); + py_sesssvc = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sesssvc); return py_sesssvc; } static int py_srvsvc_NetSrvInfo503_set_sesssvc(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sesssvc = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sesssvc)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8794,15 +13260,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_opensearch(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_opensearch; - py_opensearch = PyInt_FromLong(object->opensearch); + py_opensearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->opensearch); return py_opensearch; } static int py_srvsvc_NetSrvInfo503_set_opensearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->opensearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opensearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8810,15 +13303,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_sizereqbufs(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_sizereqbufs; - py_sizereqbufs = PyInt_FromLong(object->sizereqbufs); + py_sizereqbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sizereqbufs); return py_sizereqbufs; } static int py_srvsvc_NetSrvInfo503_set_sizereqbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sizereqbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sizereqbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8826,15 +13346,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_initworkitems(PyObject *obj, void * { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_initworkitems; - py_initworkitems = PyInt_FromLong(object->initworkitems); + py_initworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initworkitems); return py_initworkitems; } static int py_srvsvc_NetSrvInfo503_set_initworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8842,15 +13389,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxworkitems(PyObject *obj, void *c { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxworkitems; - py_maxworkitems = PyInt_FromLong(object->maxworkitems); + py_maxworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxworkitems); return py_maxworkitems; } static int py_srvsvc_NetSrvInfo503_set_maxworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8858,15 +13432,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_rawworkitems(PyObject *obj, void *c { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_rawworkitems; - py_rawworkitems = PyInt_FromLong(object->rawworkitems); + py_rawworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->rawworkitems); return py_rawworkitems; } static int py_srvsvc_NetSrvInfo503_set_rawworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->rawworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rawworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->rawworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->rawworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8874,15 +13475,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_irpstacksize(PyObject *obj, void *c { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_irpstacksize; - py_irpstacksize = PyInt_FromLong(object->irpstacksize); + py_irpstacksize = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->irpstacksize); return py_irpstacksize; } static int py_srvsvc_NetSrvInfo503_set_irpstacksize(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->irpstacksize = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->irpstacksize)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->irpstacksize = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->irpstacksize = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8890,15 +13518,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxrawbuflen(PyObject *obj, void *c { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxrawbuflen; - py_maxrawbuflen = PyInt_FromLong(object->maxrawbuflen); + py_maxrawbuflen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxrawbuflen); return py_maxrawbuflen; } static int py_srvsvc_NetSrvInfo503_set_maxrawbuflen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxrawbuflen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxrawbuflen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8906,15 +13561,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_sessusers(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_sessusers; - py_sessusers = PyInt_FromLong(object->sessusers); + py_sessusers = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessusers); return py_sessusers; } static int py_srvsvc_NetSrvInfo503_set_sessusers(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessusers = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessusers)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8922,15 +13604,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_sessconns(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_sessconns; - py_sessconns = PyInt_FromLong(object->sessconns); + py_sessconns = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessconns); return py_sessconns; } static int py_srvsvc_NetSrvInfo503_set_sessconns(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessconns = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessconns)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessconns = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessconns = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8938,15 +13647,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxpagedmemoryusage(PyObject *obj, { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxpagedmemoryusage; - py_maxpagedmemoryusage = PyInt_FromLong(object->maxpagedmemoryusage); + py_maxpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxpagedmemoryusage); return py_maxpagedmemoryusage; } static int py_srvsvc_NetSrvInfo503_set_maxpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8954,15 +13690,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxnonpagedmemoryusage(PyObject *ob { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxnonpagedmemoryusage; - py_maxnonpagedmemoryusage = PyInt_FromLong(object->maxnonpagedmemoryusage); + py_maxnonpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxnonpagedmemoryusage); return py_maxnonpagedmemoryusage; } static int py_srvsvc_NetSrvInfo503_set_maxnonpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxnonpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxnonpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8970,15 +13733,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_enablesoftcompat(PyObject *obj, voi { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_enablesoftcompat; - py_enablesoftcompat = PyInt_FromLong(object->enablesoftcompat); + py_enablesoftcompat = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablesoftcompat); return py_enablesoftcompat; } static int py_srvsvc_NetSrvInfo503_set_enablesoftcompat(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablesoftcompat = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablesoftcompat)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -8986,15 +13776,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_enableforcedlogoff(PyObject *obj, v { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_enableforcedlogoff; - py_enableforcedlogoff = PyInt_FromLong(object->enableforcedlogoff); + py_enableforcedlogoff = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableforcedlogoff); return py_enableforcedlogoff; } static int py_srvsvc_NetSrvInfo503_set_enableforcedlogoff(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableforcedlogoff = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableforcedlogoff)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9002,15 +13819,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_timesource(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_timesource; - py_timesource = PyInt_FromLong(object->timesource); + py_timesource = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->timesource); return py_timesource; } static int py_srvsvc_NetSrvInfo503_set_timesource(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->timesource = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timesource)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9018,15 +13862,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_acceptdownlevelapis(PyObject *obj, { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_acceptdownlevelapis; - py_acceptdownlevelapis = PyInt_FromLong(object->acceptdownlevelapis); + py_acceptdownlevelapis = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->acceptdownlevelapis); return py_acceptdownlevelapis; } static int py_srvsvc_NetSrvInfo503_set_acceptdownlevelapis(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->acceptdownlevelapis = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acceptdownlevelapis)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->acceptdownlevelapis = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->acceptdownlevelapis = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9034,15 +13905,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_lmannounce(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_lmannounce; - py_lmannounce = PyInt_FromLong(object->lmannounce); + py_lmannounce = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->lmannounce); return py_lmannounce; } static int py_srvsvc_NetSrvInfo503_set_lmannounce(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->lmannounce = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmannounce)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9087,15 +13985,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxcopyreadlen(PyObject *obj, void { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxcopyreadlen; - py_maxcopyreadlen = PyInt_FromLong(object->maxcopyreadlen); + py_maxcopyreadlen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxcopyreadlen); return py_maxcopyreadlen; } static int py_srvsvc_NetSrvInfo503_set_maxcopyreadlen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxcopyreadlen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxcopyreadlen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopyreadlen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopyreadlen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9103,15 +14028,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxcopywritelen(PyObject *obj, void { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxcopywritelen; - py_maxcopywritelen = PyInt_FromLong(object->maxcopywritelen); + py_maxcopywritelen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxcopywritelen); return py_maxcopywritelen; } static int py_srvsvc_NetSrvInfo503_set_maxcopywritelen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxcopywritelen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxcopywritelen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopywritelen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopywritelen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9119,15 +14071,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_minkeepsearch(PyObject *obj, void * { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_minkeepsearch; - py_minkeepsearch = PyInt_FromLong(object->minkeepsearch); + py_minkeepsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minkeepsearch); return py_minkeepsearch; } static int py_srvsvc_NetSrvInfo503_set_minkeepsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minkeepsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minkeepsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9135,15 +14114,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxkeepsearch(PyObject *obj, void * { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxkeepsearch; - py_maxkeepsearch = PyInt_FromLong(object->maxkeepsearch); + py_maxkeepsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxkeepsearch); return py_maxkeepsearch; } static int py_srvsvc_NetSrvInfo503_set_maxkeepsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxkeepsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxkeepsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9151,15 +14157,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_minkeepcomplsearch(PyObject *obj, v { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_minkeepcomplsearch; - py_minkeepcomplsearch = PyInt_FromLong(object->minkeepcomplsearch); + py_minkeepcomplsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minkeepcomplsearch); return py_minkeepcomplsearch; } static int py_srvsvc_NetSrvInfo503_set_minkeepcomplsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minkeepcomplsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minkeepcomplsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepcomplsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepcomplsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9167,15 +14200,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxkeepcomplsearch(PyObject *obj, v { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxkeepcomplsearch; - py_maxkeepcomplsearch = PyInt_FromLong(object->maxkeepcomplsearch); + py_maxkeepcomplsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxkeepcomplsearch); return py_maxkeepcomplsearch; } static int py_srvsvc_NetSrvInfo503_set_maxkeepcomplsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxkeepcomplsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxkeepcomplsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepcomplsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepcomplsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9183,15 +14243,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_threadcountadd(PyObject *obj, void { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_threadcountadd; - py_threadcountadd = PyInt_FromLong(object->threadcountadd); + py_threadcountadd = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->threadcountadd); return py_threadcountadd; } static int py_srvsvc_NetSrvInfo503_set_threadcountadd(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->threadcountadd = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->threadcountadd)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadcountadd = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadcountadd = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9199,15 +14286,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_numlockthreads(PyObject *obj, void { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_numlockthreads; - py_numlockthreads = PyInt_FromLong(object->numlockthreads); + py_numlockthreads = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numlockthreads); return py_numlockthreads; } static int py_srvsvc_NetSrvInfo503_set_numlockthreads(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numlockthreads = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numlockthreads)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numlockthreads = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numlockthreads = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9215,15 +14329,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_scavtimeout(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_scavtimeout; - py_scavtimeout = PyInt_FromLong(object->scavtimeout); + py_scavtimeout = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->scavtimeout); return py_scavtimeout; } static int py_srvsvc_NetSrvInfo503_set_scavtimeout(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->scavtimeout = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->scavtimeout)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavtimeout = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavtimeout = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9231,15 +14372,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_minrcvqueue(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_minrcvqueue; - py_minrcvqueue = PyInt_FromLong(object->minrcvqueue); + py_minrcvqueue = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minrcvqueue); return py_minrcvqueue; } static int py_srvsvc_NetSrvInfo503_set_minrcvqueue(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minrcvqueue = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minrcvqueue)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minrcvqueue = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minrcvqueue = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9247,15 +14415,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_minfreeworkitems(PyObject *obj, voi { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_minfreeworkitems; - py_minfreeworkitems = PyInt_FromLong(object->minfreeworkitems); + py_minfreeworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minfreeworkitems); return py_minfreeworkitems; } static int py_srvsvc_NetSrvInfo503_set_minfreeworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minfreeworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minfreeworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9263,15 +14458,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_xactmemsize(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_xactmemsize; - py_xactmemsize = PyInt_FromLong(object->xactmemsize); + py_xactmemsize = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->xactmemsize); return py_xactmemsize; } static int py_srvsvc_NetSrvInfo503_set_xactmemsize(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->xactmemsize = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->xactmemsize)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->xactmemsize = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->xactmemsize = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9279,15 +14501,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_threadpriority(PyObject *obj, void { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_threadpriority; - py_threadpriority = PyInt_FromLong(object->threadpriority); + py_threadpriority = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->threadpriority); return py_threadpriority; } static int py_srvsvc_NetSrvInfo503_set_threadpriority(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->threadpriority = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->threadpriority)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadpriority = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadpriority = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9295,15 +14544,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxmpxct(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxmpxct; - py_maxmpxct = PyInt_FromLong(object->maxmpxct); + py_maxmpxct = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxmpxct); return py_maxmpxct; } static int py_srvsvc_NetSrvInfo503_set_maxmpxct(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxmpxct = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxmpxct)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxmpxct = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxmpxct = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9311,15 +14587,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_oplockbreakwait(PyObject *obj, void { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_oplockbreakwait; - py_oplockbreakwait = PyInt_FromLong(object->oplockbreakwait); + py_oplockbreakwait = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->oplockbreakwait); return py_oplockbreakwait; } static int py_srvsvc_NetSrvInfo503_set_oplockbreakwait(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->oplockbreakwait = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->oplockbreakwait)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakwait = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakwait = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9327,15 +14630,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_oplockbreakresponsewait(PyObject *o { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_oplockbreakresponsewait; - py_oplockbreakresponsewait = PyInt_FromLong(object->oplockbreakresponsewait); + py_oplockbreakresponsewait = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->oplockbreakresponsewait); return py_oplockbreakresponsewait; } static int py_srvsvc_NetSrvInfo503_set_oplockbreakresponsewait(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->oplockbreakresponsewait = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->oplockbreakresponsewait)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakresponsewait = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakresponsewait = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9343,15 +14673,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_enableoplocks(PyObject *obj, void * { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_enableoplocks; - py_enableoplocks = PyInt_FromLong(object->enableoplocks); + py_enableoplocks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableoplocks); return py_enableoplocks; } static int py_srvsvc_NetSrvInfo503_set_enableoplocks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableoplocks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableoplocks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplocks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplocks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9359,15 +14716,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_enableoplockforceclose(PyObject *ob { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_enableoplockforceclose; - py_enableoplockforceclose = PyInt_FromLong(object->enableoplockforceclose); + py_enableoplockforceclose = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableoplockforceclose); return py_enableoplockforceclose; } static int py_srvsvc_NetSrvInfo503_set_enableoplockforceclose(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableoplockforceclose = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableoplockforceclose)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplockforceclose = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplockforceclose = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9375,15 +14759,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_enablefcbopens(PyObject *obj, void { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_enablefcbopens; - py_enablefcbopens = PyInt_FromLong(object->enablefcbopens); + py_enablefcbopens = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablefcbopens); return py_enablefcbopens; } static int py_srvsvc_NetSrvInfo503_set_enablefcbopens(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablefcbopens = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablefcbopens)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablefcbopens = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablefcbopens = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9391,15 +14802,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_enableraw(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_enableraw; - py_enableraw = PyInt_FromLong(object->enableraw); + py_enableraw = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableraw); return py_enableraw; } static int py_srvsvc_NetSrvInfo503_set_enableraw(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableraw = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableraw)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableraw = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableraw = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9407,15 +14845,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_enablesharednetdrives(PyObject *obj { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_enablesharednetdrives; - py_enablesharednetdrives = PyInt_FromLong(object->enablesharednetdrives); + py_enablesharednetdrives = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablesharednetdrives); return py_enablesharednetdrives; } static int py_srvsvc_NetSrvInfo503_set_enablesharednetdrives(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablesharednetdrives = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablesharednetdrives)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesharednetdrives = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesharednetdrives = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9423,15 +14888,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_minfreeconnections(PyObject *obj, v { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_minfreeconnections; - py_minfreeconnections = PyInt_FromLong(object->minfreeconnections); + py_minfreeconnections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minfreeconnections); return py_minfreeconnections; } static int py_srvsvc_NetSrvInfo503_set_minfreeconnections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minfreeconnections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minfreeconnections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeconnections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeconnections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9439,15 +14931,42 @@ static PyObject *py_srvsvc_NetSrvInfo503_get_maxfreeconnections(PyObject *obj, v { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(obj); PyObject *py_maxfreeconnections; - py_maxfreeconnections = PyInt_FromLong(object->maxfreeconnections); + py_maxfreeconnections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxfreeconnections); return py_maxfreeconnections; } static int py_srvsvc_NetSrvInfo503_set_maxfreeconnections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo503 *object = (struct srvsvc_NetSrvInfo503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxfreeconnections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxfreeconnections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxfreeconnections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxfreeconnections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9518,15 +15037,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_sessopen(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_sessopen; - py_sessopen = PyInt_FromLong(object->sessopen); + py_sessopen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessopen); return py_sessopen; } static int py_srvsvc_NetSrvInfo599_set_sessopen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessopen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessopen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9534,15 +15080,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_sesssvc(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_sesssvc; - py_sesssvc = PyInt_FromLong(object->sesssvc); + py_sesssvc = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sesssvc); return py_sesssvc; } static int py_srvsvc_NetSrvInfo599_set_sesssvc(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sesssvc = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sesssvc)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesssvc = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9550,15 +15123,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_opensearch(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_opensearch; - py_opensearch = PyInt_FromLong(object->opensearch); + py_opensearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->opensearch); return py_opensearch; } static int py_srvsvc_NetSrvInfo599_set_opensearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->opensearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opensearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9566,15 +15166,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_sizereqbufs(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_sizereqbufs; - py_sizereqbufs = PyInt_FromLong(object->sizereqbufs); + py_sizereqbufs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sizereqbufs); return py_sizereqbufs; } static int py_srvsvc_NetSrvInfo599_set_sizereqbufs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sizereqbufs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sizereqbufs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sizereqbufs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9582,15 +15209,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_initworkitems(PyObject *obj, void * { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_initworkitems; - py_initworkitems = PyInt_FromLong(object->initworkitems); + py_initworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initworkitems); return py_initworkitems; } static int py_srvsvc_NetSrvInfo599_set_initworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9598,15 +15252,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxworkitems(PyObject *obj, void *c { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxworkitems; - py_maxworkitems = PyInt_FromLong(object->maxworkitems); + py_maxworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxworkitems); return py_maxworkitems; } static int py_srvsvc_NetSrvInfo599_set_maxworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9614,15 +15295,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_rawworkitems(PyObject *obj, void *c { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_rawworkitems; - py_rawworkitems = PyInt_FromLong(object->rawworkitems); + py_rawworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->rawworkitems); return py_rawworkitems; } static int py_srvsvc_NetSrvInfo599_set_rawworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->rawworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rawworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->rawworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->rawworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9630,15 +15338,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_irpstacksize(PyObject *obj, void *c { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_irpstacksize; - py_irpstacksize = PyInt_FromLong(object->irpstacksize); + py_irpstacksize = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->irpstacksize); return py_irpstacksize; } static int py_srvsvc_NetSrvInfo599_set_irpstacksize(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->irpstacksize = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->irpstacksize)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->irpstacksize = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->irpstacksize = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9646,15 +15381,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxrawbuflen(PyObject *obj, void *c { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxrawbuflen; - py_maxrawbuflen = PyInt_FromLong(object->maxrawbuflen); + py_maxrawbuflen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxrawbuflen); return py_maxrawbuflen; } static int py_srvsvc_NetSrvInfo599_set_maxrawbuflen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxrawbuflen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxrawbuflen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9662,15 +15424,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_sessusers(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_sessusers; - py_sessusers = PyInt_FromLong(object->sessusers); + py_sessusers = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessusers); return py_sessusers; } static int py_srvsvc_NetSrvInfo599_set_sessusers(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessusers = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessusers)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9678,15 +15467,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_sessconns(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_sessconns; - py_sessconns = PyInt_FromLong(object->sessconns); + py_sessconns = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessconns); return py_sessconns; } static int py_srvsvc_NetSrvInfo599_set_sessconns(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessconns = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessconns)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessconns = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessconns = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9694,15 +15510,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxpagedmemoryusage(PyObject *obj, { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxpagedmemoryusage; - py_maxpagedmemoryusage = PyInt_FromLong(object->maxpagedmemoryusage); + py_maxpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxpagedmemoryusage); return py_maxpagedmemoryusage; } static int py_srvsvc_NetSrvInfo599_set_maxpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9710,15 +15553,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxnonpagedmemoryusage(PyObject *ob { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxnonpagedmemoryusage; - py_maxnonpagedmemoryusage = PyInt_FromLong(object->maxnonpagedmemoryusage); + py_maxnonpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxnonpagedmemoryusage); return py_maxnonpagedmemoryusage; } static int py_srvsvc_NetSrvInfo599_set_maxnonpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxnonpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxnonpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9726,15 +15596,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_enablesoftcompat(PyObject *obj, voi { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_enablesoftcompat; - py_enablesoftcompat = PyInt_FromLong(object->enablesoftcompat); + py_enablesoftcompat = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablesoftcompat); return py_enablesoftcompat; } static int py_srvsvc_NetSrvInfo599_set_enablesoftcompat(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablesoftcompat = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablesoftcompat)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9742,15 +15639,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_enableforcedlogoff(PyObject *obj, v { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_enableforcedlogoff; - py_enableforcedlogoff = PyInt_FromLong(object->enableforcedlogoff); + py_enableforcedlogoff = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableforcedlogoff); return py_enableforcedlogoff; } static int py_srvsvc_NetSrvInfo599_set_enableforcedlogoff(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableforcedlogoff = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableforcedlogoff)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9758,15 +15682,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_timesource(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_timesource; - py_timesource = PyInt_FromLong(object->timesource); + py_timesource = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->timesource); return py_timesource; } static int py_srvsvc_NetSrvInfo599_set_timesource(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->timesource = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timesource)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9774,15 +15725,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_acceptdownlevelapis(PyObject *obj, { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_acceptdownlevelapis; - py_acceptdownlevelapis = PyInt_FromLong(object->acceptdownlevelapis); + py_acceptdownlevelapis = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->acceptdownlevelapis); return py_acceptdownlevelapis; } static int py_srvsvc_NetSrvInfo599_set_acceptdownlevelapis(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->acceptdownlevelapis = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acceptdownlevelapis)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->acceptdownlevelapis = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->acceptdownlevelapis = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9790,15 +15768,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_lmannounce(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_lmannounce; - py_lmannounce = PyInt_FromLong(object->lmannounce); + py_lmannounce = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->lmannounce); return py_lmannounce; } static int py_srvsvc_NetSrvInfo599_set_lmannounce(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->lmannounce = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmannounce)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9843,15 +15848,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxcopyreadlen(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxcopyreadlen; - py_maxcopyreadlen = PyInt_FromLong(object->maxcopyreadlen); + py_maxcopyreadlen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxcopyreadlen); return py_maxcopyreadlen; } static int py_srvsvc_NetSrvInfo599_set_maxcopyreadlen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxcopyreadlen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxcopyreadlen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopyreadlen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopyreadlen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9859,15 +15891,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxcopywritelen(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxcopywritelen; - py_maxcopywritelen = PyInt_FromLong(object->maxcopywritelen); + py_maxcopywritelen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxcopywritelen); return py_maxcopywritelen; } static int py_srvsvc_NetSrvInfo599_set_maxcopywritelen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxcopywritelen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxcopywritelen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopywritelen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopywritelen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9875,15 +15934,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_minkeepsearch(PyObject *obj, void * { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_minkeepsearch; - py_minkeepsearch = PyInt_FromLong(object->minkeepsearch); + py_minkeepsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minkeepsearch); return py_minkeepsearch; } static int py_srvsvc_NetSrvInfo599_set_minkeepsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minkeepsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minkeepsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9891,15 +15977,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_minkeepcomplsearch(PyObject *obj, v { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_minkeepcomplsearch; - py_minkeepcomplsearch = PyInt_FromLong(object->minkeepcomplsearch); + py_minkeepcomplsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minkeepcomplsearch); return py_minkeepcomplsearch; } static int py_srvsvc_NetSrvInfo599_set_minkeepcomplsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minkeepcomplsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minkeepcomplsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepcomplsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepcomplsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9907,15 +16020,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxkeepcomplsearch(PyObject *obj, v { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxkeepcomplsearch; - py_maxkeepcomplsearch = PyInt_FromLong(object->maxkeepcomplsearch); + py_maxkeepcomplsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxkeepcomplsearch); return py_maxkeepcomplsearch; } static int py_srvsvc_NetSrvInfo599_set_maxkeepcomplsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxkeepcomplsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxkeepcomplsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepcomplsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepcomplsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9923,15 +16063,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_threadcountadd(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_threadcountadd; - py_threadcountadd = PyInt_FromLong(object->threadcountadd); + py_threadcountadd = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->threadcountadd); return py_threadcountadd; } static int py_srvsvc_NetSrvInfo599_set_threadcountadd(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->threadcountadd = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->threadcountadd)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadcountadd = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadcountadd = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9939,15 +16106,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_numlockthreads(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_numlockthreads; - py_numlockthreads = PyInt_FromLong(object->numlockthreads); + py_numlockthreads = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->numlockthreads); return py_numlockthreads; } static int py_srvsvc_NetSrvInfo599_set_numlockthreads(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->numlockthreads = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->numlockthreads)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numlockthreads = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->numlockthreads = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9955,15 +16149,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_scavtimeout(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_scavtimeout; - py_scavtimeout = PyInt_FromLong(object->scavtimeout); + py_scavtimeout = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->scavtimeout); return py_scavtimeout; } static int py_srvsvc_NetSrvInfo599_set_scavtimeout(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->scavtimeout = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->scavtimeout)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavtimeout = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavtimeout = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9971,15 +16192,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_minrcvqueue(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_minrcvqueue; - py_minrcvqueue = PyInt_FromLong(object->minrcvqueue); + py_minrcvqueue = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minrcvqueue); return py_minrcvqueue; } static int py_srvsvc_NetSrvInfo599_set_minrcvqueue(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minrcvqueue = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minrcvqueue)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minrcvqueue = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minrcvqueue = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -9987,15 +16235,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_minfreeworkitems(PyObject *obj, voi { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_minfreeworkitems; - py_minfreeworkitems = PyInt_FromLong(object->minfreeworkitems); + py_minfreeworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minfreeworkitems); return py_minfreeworkitems; } static int py_srvsvc_NetSrvInfo599_set_minfreeworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minfreeworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minfreeworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10003,15 +16278,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_xactmemsize(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_xactmemsize; - py_xactmemsize = PyInt_FromLong(object->xactmemsize); + py_xactmemsize = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->xactmemsize); return py_xactmemsize; } static int py_srvsvc_NetSrvInfo599_set_xactmemsize(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->xactmemsize = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->xactmemsize)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->xactmemsize = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->xactmemsize = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10019,15 +16321,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_threadpriority(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_threadpriority; - py_threadpriority = PyInt_FromLong(object->threadpriority); + py_threadpriority = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->threadpriority); return py_threadpriority; } static int py_srvsvc_NetSrvInfo599_set_threadpriority(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->threadpriority = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->threadpriority)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadpriority = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->threadpriority = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10035,15 +16364,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxmpxct(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxmpxct; - py_maxmpxct = PyInt_FromLong(object->maxmpxct); + py_maxmpxct = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxmpxct); return py_maxmpxct; } static int py_srvsvc_NetSrvInfo599_set_maxmpxct(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxmpxct = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxmpxct)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxmpxct = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxmpxct = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10051,15 +16407,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_oplockbreakwait(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_oplockbreakwait; - py_oplockbreakwait = PyInt_FromLong(object->oplockbreakwait); + py_oplockbreakwait = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->oplockbreakwait); return py_oplockbreakwait; } static int py_srvsvc_NetSrvInfo599_set_oplockbreakwait(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->oplockbreakwait = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->oplockbreakwait)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakwait = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakwait = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10067,15 +16450,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_oplockbreakresponsewait(PyObject *o { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_oplockbreakresponsewait; - py_oplockbreakresponsewait = PyInt_FromLong(object->oplockbreakresponsewait); + py_oplockbreakresponsewait = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->oplockbreakresponsewait); return py_oplockbreakresponsewait; } static int py_srvsvc_NetSrvInfo599_set_oplockbreakresponsewait(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->oplockbreakresponsewait = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->oplockbreakresponsewait)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakresponsewait = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakresponsewait = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10083,15 +16493,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_enableoplocks(PyObject *obj, void * { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_enableoplocks; - py_enableoplocks = PyInt_FromLong(object->enableoplocks); + py_enableoplocks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableoplocks); return py_enableoplocks; } static int py_srvsvc_NetSrvInfo599_set_enableoplocks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableoplocks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableoplocks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplocks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplocks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10099,15 +16536,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_enableoplockforceclose(PyObject *ob { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_enableoplockforceclose; - py_enableoplockforceclose = PyInt_FromLong(object->enableoplockforceclose); + py_enableoplockforceclose = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableoplockforceclose); return py_enableoplockforceclose; } static int py_srvsvc_NetSrvInfo599_set_enableoplockforceclose(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableoplockforceclose = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableoplockforceclose)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplockforceclose = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplockforceclose = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10115,15 +16579,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_enablefcbopens(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_enablefcbopens; - py_enablefcbopens = PyInt_FromLong(object->enablefcbopens); + py_enablefcbopens = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablefcbopens); return py_enablefcbopens; } static int py_srvsvc_NetSrvInfo599_set_enablefcbopens(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablefcbopens = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablefcbopens)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablefcbopens = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablefcbopens = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10131,15 +16622,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_enableraw(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_enableraw; - py_enableraw = PyInt_FromLong(object->enableraw); + py_enableraw = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableraw); return py_enableraw; } static int py_srvsvc_NetSrvInfo599_set_enableraw(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableraw = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableraw)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableraw = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableraw = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10147,15 +16665,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_enablesharednetdrives(PyObject *obj { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_enablesharednetdrives; - py_enablesharednetdrives = PyInt_FromLong(object->enablesharednetdrives); + py_enablesharednetdrives = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablesharednetdrives); return py_enablesharednetdrives; } static int py_srvsvc_NetSrvInfo599_set_enablesharednetdrives(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablesharednetdrives = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablesharednetdrives)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesharednetdrives = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesharednetdrives = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10163,15 +16708,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_minfreeconnections(PyObject *obj, v { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_minfreeconnections; - py_minfreeconnections = PyInt_FromLong(object->minfreeconnections); + py_minfreeconnections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minfreeconnections); return py_minfreeconnections; } static int py_srvsvc_NetSrvInfo599_set_minfreeconnections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minfreeconnections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minfreeconnections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeconnections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeconnections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10179,15 +16751,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxfreeconnections(PyObject *obj, v { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxfreeconnections; - py_maxfreeconnections = PyInt_FromLong(object->maxfreeconnections); + py_maxfreeconnections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxfreeconnections); return py_maxfreeconnections; } static int py_srvsvc_NetSrvInfo599_set_maxfreeconnections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxfreeconnections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxfreeconnections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxfreeconnections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxfreeconnections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10195,15 +16794,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_initsesstable(PyObject *obj, void * { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_initsesstable; - py_initsesstable = PyInt_FromLong(object->initsesstable); + py_initsesstable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initsesstable); return py_initsesstable; } static int py_srvsvc_NetSrvInfo599_set_initsesstable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initsesstable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initsesstable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsesstable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsesstable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10211,15 +16837,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_initconntable(PyObject *obj, void * { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_initconntable; - py_initconntable = PyInt_FromLong(object->initconntable); + py_initconntable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initconntable); return py_initconntable; } static int py_srvsvc_NetSrvInfo599_set_initconntable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initconntable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initconntable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initconntable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initconntable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10227,15 +16880,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_initfiletable(PyObject *obj, void * { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_initfiletable; - py_initfiletable = PyInt_FromLong(object->initfiletable); + py_initfiletable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initfiletable); return py_initfiletable; } static int py_srvsvc_NetSrvInfo599_set_initfiletable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initfiletable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initfiletable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initfiletable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initfiletable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10243,15 +16923,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_initsearchtable(PyObject *obj, void { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_initsearchtable; - py_initsearchtable = PyInt_FromLong(object->initsearchtable); + py_initsearchtable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initsearchtable); return py_initsearchtable; } static int py_srvsvc_NetSrvInfo599_set_initsearchtable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initsearchtable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initsearchtable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsearchtable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsearchtable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10259,15 +16966,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_alertsched(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_alertsched; - py_alertsched = PyInt_FromLong(object->alertsched); + py_alertsched = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alertsched); return py_alertsched; } static int py_srvsvc_NetSrvInfo599_set_alertsched(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->alertsched = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alertsched)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10275,15 +17009,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_errortreshold(PyObject *obj, void * { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_errortreshold; - py_errortreshold = PyInt_FromLong(object->errortreshold); + py_errortreshold = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->errortreshold); return py_errortreshold; } static int py_srvsvc_NetSrvInfo599_set_errortreshold(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->errortreshold = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->errortreshold)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->errortreshold = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->errortreshold = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10291,15 +17052,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_networkerrortreshold(PyObject *obj, { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_networkerrortreshold; - py_networkerrortreshold = PyInt_FromLong(object->networkerrortreshold); + py_networkerrortreshold = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->networkerrortreshold); return py_networkerrortreshold; } static int py_srvsvc_NetSrvInfo599_set_networkerrortreshold(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->networkerrortreshold = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->networkerrortreshold)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->networkerrortreshold = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->networkerrortreshold = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10307,15 +17095,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_diskspacetreshold(PyObject *obj, vo { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_diskspacetreshold; - py_diskspacetreshold = PyInt_FromLong(object->diskspacetreshold); + py_diskspacetreshold = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->diskspacetreshold); return py_diskspacetreshold; } static int py_srvsvc_NetSrvInfo599_set_diskspacetreshold(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->diskspacetreshold = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->diskspacetreshold)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskspacetreshold = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskspacetreshold = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10323,15 +17138,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_reserved(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_reserved; - py_reserved = PyInt_FromLong(object->reserved); + py_reserved = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->reserved); return py_reserved; } static int py_srvsvc_NetSrvInfo599_set_reserved(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->reserved = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->reserved = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->reserved = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10339,15 +17181,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxlinkdelay(PyObject *obj, void *c { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxlinkdelay; - py_maxlinkdelay = PyInt_FromLong(object->maxlinkdelay); + py_maxlinkdelay = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxlinkdelay); return py_maxlinkdelay; } static int py_srvsvc_NetSrvInfo599_set_maxlinkdelay(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxlinkdelay = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxlinkdelay)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxlinkdelay = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxlinkdelay = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10355,15 +17224,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_minlinkthroughput(PyObject *obj, vo { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_minlinkthroughput; - py_minlinkthroughput = PyInt_FromLong(object->minlinkthroughput); + py_minlinkthroughput = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minlinkthroughput); return py_minlinkthroughput; } static int py_srvsvc_NetSrvInfo599_set_minlinkthroughput(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minlinkthroughput = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minlinkthroughput)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minlinkthroughput = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minlinkthroughput = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10371,15 +17267,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_linkinfovalidtime(PyObject *obj, vo { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_linkinfovalidtime; - py_linkinfovalidtime = PyInt_FromLong(object->linkinfovalidtime); + py_linkinfovalidtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->linkinfovalidtime); return py_linkinfovalidtime; } static int py_srvsvc_NetSrvInfo599_set_linkinfovalidtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->linkinfovalidtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->linkinfovalidtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->linkinfovalidtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->linkinfovalidtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10387,15 +17310,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_scavqosinfoupdatetime(PyObject *obj { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_scavqosinfoupdatetime; - py_scavqosinfoupdatetime = PyInt_FromLong(object->scavqosinfoupdatetime); + py_scavqosinfoupdatetime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->scavqosinfoupdatetime); return py_scavqosinfoupdatetime; } static int py_srvsvc_NetSrvInfo599_set_scavqosinfoupdatetime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->scavqosinfoupdatetime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->scavqosinfoupdatetime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavqosinfoupdatetime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavqosinfoupdatetime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10403,15 +17353,42 @@ static PyObject *py_srvsvc_NetSrvInfo599_get_maxworkitemidletime(PyObject *obj, { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(obj); PyObject *py_maxworkitemidletime; - py_maxworkitemidletime = PyInt_FromLong(object->maxworkitemidletime); + py_maxworkitemidletime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxworkitemidletime); return py_maxworkitemidletime; } static int py_srvsvc_NetSrvInfo599_set_maxworkitemidletime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo599 *object = (struct srvsvc_NetSrvInfo599 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxworkitemidletime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxworkitemidletime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitemidletime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitemidletime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10554,15 +17531,42 @@ static PyObject *py_srvsvc_NetSrvInfo1010_get_disc(PyObject *obj, void *closure) { struct srvsvc_NetSrvInfo1010 *object = (struct srvsvc_NetSrvInfo1010 *)pytalloc_get_ptr(obj); PyObject *py_disc; - py_disc = PyInt_FromLong(object->disc); + py_disc = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->disc); return py_disc; } static int py_srvsvc_NetSrvInfo1010_set_disc(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1010 *object = (struct srvsvc_NetSrvInfo1010 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->disc = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->disc)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->disc = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->disc = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10592,15 +17596,42 @@ static PyObject *py_srvsvc_NetSrvInfo1016_get_hidden(PyObject *obj, void *closur { struct srvsvc_NetSrvInfo1016 *object = (struct srvsvc_NetSrvInfo1016 *)pytalloc_get_ptr(obj); PyObject *py_hidden; - py_hidden = PyInt_FromLong(object->hidden); + py_hidden = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->hidden); return py_hidden; } static int py_srvsvc_NetSrvInfo1016_set_hidden(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1016 *object = (struct srvsvc_NetSrvInfo1016 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->hidden = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hidden)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hidden = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hidden = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10630,15 +17661,42 @@ static PyObject *py_srvsvc_NetSrvInfo1017_get_announce(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo1017 *object = (struct srvsvc_NetSrvInfo1017 *)pytalloc_get_ptr(obj); PyObject *py_announce; - py_announce = PyInt_FromLong(object->announce); + py_announce = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->announce); return py_announce; } static int py_srvsvc_NetSrvInfo1017_set_announce(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1017 *object = (struct srvsvc_NetSrvInfo1017 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->announce = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->announce)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->announce = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->announce = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10668,15 +17726,42 @@ static PyObject *py_srvsvc_NetSrvInfo1018_get_anndelta(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo1018 *object = (struct srvsvc_NetSrvInfo1018 *)pytalloc_get_ptr(obj); PyObject *py_anndelta; - py_anndelta = PyInt_FromLong(object->anndelta); + py_anndelta = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->anndelta); return py_anndelta; } static int py_srvsvc_NetSrvInfo1018_set_anndelta(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1018 *object = (struct srvsvc_NetSrvInfo1018 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->anndelta = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->anndelta)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->anndelta = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->anndelta = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10706,15 +17791,42 @@ static PyObject *py_srvsvc_NetSrvInfo1107_get_users(PyObject *obj, void *closure { struct srvsvc_NetSrvInfo1107 *object = (struct srvsvc_NetSrvInfo1107 *)pytalloc_get_ptr(obj); PyObject *py_users; - py_users = PyInt_FromLong(object->users); + py_users = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->users); return py_users; } static int py_srvsvc_NetSrvInfo1107_set_users(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1107 *object = (struct srvsvc_NetSrvInfo1107 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->users = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->users)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->users = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->users = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10744,15 +17856,42 @@ static PyObject *py_srvsvc_NetSrvInfo1501_get_sessopens(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo1501 *object = (struct srvsvc_NetSrvInfo1501 *)pytalloc_get_ptr(obj); PyObject *py_sessopens; - py_sessopens = PyInt_FromLong(object->sessopens); + py_sessopens = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessopens); return py_sessopens; } static int py_srvsvc_NetSrvInfo1501_set_sessopens(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1501 *object = (struct srvsvc_NetSrvInfo1501 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessopens = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessopens)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopens = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessopens = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10782,15 +17921,42 @@ static PyObject *py_srvsvc_NetSrvInfo1502_get_sessvcs(PyObject *obj, void *closu { struct srvsvc_NetSrvInfo1502 *object = (struct srvsvc_NetSrvInfo1502 *)pytalloc_get_ptr(obj); PyObject *py_sessvcs; - py_sessvcs = PyInt_FromLong(object->sessvcs); + py_sessvcs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessvcs); return py_sessvcs; } static int py_srvsvc_NetSrvInfo1502_set_sessvcs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1502 *object = (struct srvsvc_NetSrvInfo1502 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessvcs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessvcs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessvcs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessvcs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10820,15 +17986,42 @@ static PyObject *py_srvsvc_NetSrvInfo1503_get_opensearch(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo1503 *object = (struct srvsvc_NetSrvInfo1503 *)pytalloc_get_ptr(obj); PyObject *py_opensearch; - py_opensearch = PyInt_FromLong(object->opensearch); + py_opensearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->opensearch); return py_opensearch; } static int py_srvsvc_NetSrvInfo1503_set_opensearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1503 *object = (struct srvsvc_NetSrvInfo1503 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->opensearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opensearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->opensearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10858,15 +18051,42 @@ static PyObject *py_srvsvc_NetSrvInfo1506_get_maxworkitems(PyObject *obj, void * { struct srvsvc_NetSrvInfo1506 *object = (struct srvsvc_NetSrvInfo1506 *)pytalloc_get_ptr(obj); PyObject *py_maxworkitems; - py_maxworkitems = PyInt_FromLong(object->maxworkitems); + py_maxworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxworkitems); return py_maxworkitems; } static int py_srvsvc_NetSrvInfo1506_set_maxworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1506 *object = (struct srvsvc_NetSrvInfo1506 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10896,15 +18116,42 @@ static PyObject *py_srvsvc_NetSrvInfo1509_get_maxrawbuflen(PyObject *obj, void * { struct srvsvc_NetSrvInfo1509 *object = (struct srvsvc_NetSrvInfo1509 *)pytalloc_get_ptr(obj); PyObject *py_maxrawbuflen; - py_maxrawbuflen = PyInt_FromLong(object->maxrawbuflen); + py_maxrawbuflen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxrawbuflen); return py_maxrawbuflen; } static int py_srvsvc_NetSrvInfo1509_set_maxrawbuflen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1509 *object = (struct srvsvc_NetSrvInfo1509 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxrawbuflen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxrawbuflen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxrawbuflen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10934,15 +18181,42 @@ static PyObject *py_srvsvc_NetSrvInfo1510_get_sessusers(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo1510 *object = (struct srvsvc_NetSrvInfo1510 *)pytalloc_get_ptr(obj); PyObject *py_sessusers; - py_sessusers = PyInt_FromLong(object->sessusers); + py_sessusers = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sessusers); return py_sessusers; } static int py_srvsvc_NetSrvInfo1510_set_sessusers(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1510 *object = (struct srvsvc_NetSrvInfo1510 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sessusers = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sessusers)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sessusers = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -10972,15 +18246,42 @@ static PyObject *py_srvsvc_NetSrvInfo1511_get_sesscons(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo1511 *object = (struct srvsvc_NetSrvInfo1511 *)pytalloc_get_ptr(obj); PyObject *py_sesscons; - py_sesscons = PyInt_FromLong(object->sesscons); + py_sesscons = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sesscons); return py_sesscons; } static int py_srvsvc_NetSrvInfo1511_set_sesscons(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1511 *object = (struct srvsvc_NetSrvInfo1511 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sesscons = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sesscons)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesscons = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sesscons = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11010,15 +18311,42 @@ static PyObject *py_srvsvc_NetSrvInfo1512_get_maxnonpagedmemoryusage(PyObject *o { struct srvsvc_NetSrvInfo1512 *object = (struct srvsvc_NetSrvInfo1512 *)pytalloc_get_ptr(obj); PyObject *py_maxnonpagedmemoryusage; - py_maxnonpagedmemoryusage = PyInt_FromLong(object->maxnonpagedmemoryusage); + py_maxnonpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxnonpagedmemoryusage); return py_maxnonpagedmemoryusage; } static int py_srvsvc_NetSrvInfo1512_set_maxnonpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1512 *object = (struct srvsvc_NetSrvInfo1512 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxnonpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxnonpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxnonpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11048,15 +18376,42 @@ static PyObject *py_srvsvc_NetSrvInfo1513_get_maxpagedmemoryusage(PyObject *obj, { struct srvsvc_NetSrvInfo1513 *object = (struct srvsvc_NetSrvInfo1513 *)pytalloc_get_ptr(obj); PyObject *py_maxpagedmemoryusage; - py_maxpagedmemoryusage = PyInt_FromLong(object->maxpagedmemoryusage); + py_maxpagedmemoryusage = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxpagedmemoryusage); return py_maxpagedmemoryusage; } static int py_srvsvc_NetSrvInfo1513_set_maxpagedmemoryusage(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1513 *object = (struct srvsvc_NetSrvInfo1513 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxpagedmemoryusage = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxpagedmemoryusage)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxpagedmemoryusage = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11086,15 +18441,42 @@ static PyObject *py_srvsvc_NetSrvInfo1514_get_enablesoftcompat(PyObject *obj, vo { struct srvsvc_NetSrvInfo1514 *object = (struct srvsvc_NetSrvInfo1514 *)pytalloc_get_ptr(obj); PyObject *py_enablesoftcompat; - py_enablesoftcompat = PyInt_FromLong(object->enablesoftcompat); + py_enablesoftcompat = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablesoftcompat); return py_enablesoftcompat; } static int py_srvsvc_NetSrvInfo1514_set_enablesoftcompat(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1514 *object = (struct srvsvc_NetSrvInfo1514 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablesoftcompat = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablesoftcompat)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesoftcompat = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11124,15 +18506,42 @@ static PyObject *py_srvsvc_NetSrvInfo1515_get_enableforcedlogoff(PyObject *obj, { struct srvsvc_NetSrvInfo1515 *object = (struct srvsvc_NetSrvInfo1515 *)pytalloc_get_ptr(obj); PyObject *py_enableforcedlogoff; - py_enableforcedlogoff = PyInt_FromLong(object->enableforcedlogoff); + py_enableforcedlogoff = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableforcedlogoff); return py_enableforcedlogoff; } static int py_srvsvc_NetSrvInfo1515_set_enableforcedlogoff(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1515 *object = (struct srvsvc_NetSrvInfo1515 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableforcedlogoff = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableforcedlogoff)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableforcedlogoff = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11162,15 +18571,42 @@ static PyObject *py_srvsvc_NetSrvInfo1516_get_timesource(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo1516 *object = (struct srvsvc_NetSrvInfo1516 *)pytalloc_get_ptr(obj); PyObject *py_timesource; - py_timesource = PyInt_FromLong(object->timesource); + py_timesource = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->timesource); return py_timesource; } static int py_srvsvc_NetSrvInfo1516_set_timesource(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1516 *object = (struct srvsvc_NetSrvInfo1516 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->timesource = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timesource)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->timesource = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11200,15 +18636,42 @@ static PyObject *py_srvsvc_NetSrvInfo1518_get_lmannounce(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo1518 *object = (struct srvsvc_NetSrvInfo1518 *)pytalloc_get_ptr(obj); PyObject *py_lmannounce; - py_lmannounce = PyInt_FromLong(object->lmannounce); + py_lmannounce = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->lmannounce); return py_lmannounce; } static int py_srvsvc_NetSrvInfo1518_set_lmannounce(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1518 *object = (struct srvsvc_NetSrvInfo1518 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->lmannounce = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lmannounce)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->lmannounce = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11238,15 +18701,42 @@ static PyObject *py_srvsvc_NetSrvInfo1520_get_maxcopyreadlen(PyObject *obj, void { struct srvsvc_NetSrvInfo1520 *object = (struct srvsvc_NetSrvInfo1520 *)pytalloc_get_ptr(obj); PyObject *py_maxcopyreadlen; - py_maxcopyreadlen = PyInt_FromLong(object->maxcopyreadlen); + py_maxcopyreadlen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxcopyreadlen); return py_maxcopyreadlen; } static int py_srvsvc_NetSrvInfo1520_set_maxcopyreadlen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1520 *object = (struct srvsvc_NetSrvInfo1520 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxcopyreadlen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxcopyreadlen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopyreadlen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopyreadlen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11276,15 +18766,42 @@ static PyObject *py_srvsvc_NetSrvInfo1521_get_maxcopywritelen(PyObject *obj, voi { struct srvsvc_NetSrvInfo1521 *object = (struct srvsvc_NetSrvInfo1521 *)pytalloc_get_ptr(obj); PyObject *py_maxcopywritelen; - py_maxcopywritelen = PyInt_FromLong(object->maxcopywritelen); + py_maxcopywritelen = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxcopywritelen); return py_maxcopywritelen; } static int py_srvsvc_NetSrvInfo1521_set_maxcopywritelen(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1521 *object = (struct srvsvc_NetSrvInfo1521 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxcopywritelen = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxcopywritelen)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopywritelen = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxcopywritelen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11314,15 +18831,42 @@ static PyObject *py_srvsvc_NetSrvInfo1522_get_minkeepsearch(PyObject *obj, void { struct srvsvc_NetSrvInfo1522 *object = (struct srvsvc_NetSrvInfo1522 *)pytalloc_get_ptr(obj); PyObject *py_minkeepsearch; - py_minkeepsearch = PyInt_FromLong(object->minkeepsearch); + py_minkeepsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minkeepsearch); return py_minkeepsearch; } static int py_srvsvc_NetSrvInfo1522_set_minkeepsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1522 *object = (struct srvsvc_NetSrvInfo1522 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minkeepsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minkeepsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11352,15 +18896,42 @@ static PyObject *py_srvsvc_NetSrvInfo1523_get_maxkeepsearch(PyObject *obj, void { struct srvsvc_NetSrvInfo1523 *object = (struct srvsvc_NetSrvInfo1523 *)pytalloc_get_ptr(obj); PyObject *py_maxkeepsearch; - py_maxkeepsearch = PyInt_FromLong(object->maxkeepsearch); + py_maxkeepsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxkeepsearch); return py_maxkeepsearch; } static int py_srvsvc_NetSrvInfo1523_set_maxkeepsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1523 *object = (struct srvsvc_NetSrvInfo1523 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxkeepsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxkeepsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11390,15 +18961,42 @@ static PyObject *py_srvsvc_NetSrvInfo1524_get_minkeepcomplsearch(PyObject *obj, { struct srvsvc_NetSrvInfo1524 *object = (struct srvsvc_NetSrvInfo1524 *)pytalloc_get_ptr(obj); PyObject *py_minkeepcomplsearch; - py_minkeepcomplsearch = PyInt_FromLong(object->minkeepcomplsearch); + py_minkeepcomplsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minkeepcomplsearch); return py_minkeepcomplsearch; } static int py_srvsvc_NetSrvInfo1524_set_minkeepcomplsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1524 *object = (struct srvsvc_NetSrvInfo1524 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minkeepcomplsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minkeepcomplsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepcomplsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minkeepcomplsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11428,15 +19026,42 @@ static PyObject *py_srvsvc_NetSrvInfo1525_get_maxkeepcomplsearch(PyObject *obj, { struct srvsvc_NetSrvInfo1525 *object = (struct srvsvc_NetSrvInfo1525 *)pytalloc_get_ptr(obj); PyObject *py_maxkeepcomplsearch; - py_maxkeepcomplsearch = PyInt_FromLong(object->maxkeepcomplsearch); + py_maxkeepcomplsearch = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxkeepcomplsearch); return py_maxkeepcomplsearch; } static int py_srvsvc_NetSrvInfo1525_set_maxkeepcomplsearch(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1525 *object = (struct srvsvc_NetSrvInfo1525 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxkeepcomplsearch = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxkeepcomplsearch)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepcomplsearch = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxkeepcomplsearch = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11466,15 +19091,42 @@ static PyObject *py_srvsvc_NetSrvInfo1528_get_scavtimeout(PyObject *obj, void *c { struct srvsvc_NetSrvInfo1528 *object = (struct srvsvc_NetSrvInfo1528 *)pytalloc_get_ptr(obj); PyObject *py_scavtimeout; - py_scavtimeout = PyInt_FromLong(object->scavtimeout); + py_scavtimeout = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->scavtimeout); return py_scavtimeout; } static int py_srvsvc_NetSrvInfo1528_set_scavtimeout(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1528 *object = (struct srvsvc_NetSrvInfo1528 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->scavtimeout = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->scavtimeout)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavtimeout = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavtimeout = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11504,15 +19156,42 @@ static PyObject *py_srvsvc_NetSrvInfo1529_get_minrcvqueue(PyObject *obj, void *c { struct srvsvc_NetSrvInfo1529 *object = (struct srvsvc_NetSrvInfo1529 *)pytalloc_get_ptr(obj); PyObject *py_minrcvqueue; - py_minrcvqueue = PyInt_FromLong(object->minrcvqueue); + py_minrcvqueue = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minrcvqueue); return py_minrcvqueue; } static int py_srvsvc_NetSrvInfo1529_set_minrcvqueue(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1529 *object = (struct srvsvc_NetSrvInfo1529 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minrcvqueue = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minrcvqueue)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minrcvqueue = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minrcvqueue = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11542,15 +19221,42 @@ static PyObject *py_srvsvc_NetSrvInfo1530_get_minfreeworkitems(PyObject *obj, vo { struct srvsvc_NetSrvInfo1530 *object = (struct srvsvc_NetSrvInfo1530 *)pytalloc_get_ptr(obj); PyObject *py_minfreeworkitems; - py_minfreeworkitems = PyInt_FromLong(object->minfreeworkitems); + py_minfreeworkitems = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minfreeworkitems); return py_minfreeworkitems; } static int py_srvsvc_NetSrvInfo1530_set_minfreeworkitems(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1530 *object = (struct srvsvc_NetSrvInfo1530 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minfreeworkitems = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minfreeworkitems)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeworkitems = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeworkitems = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11580,15 +19286,42 @@ static PyObject *py_srvsvc_NetSrvInfo1533_get_maxmpxct(PyObject *obj, void *clos { struct srvsvc_NetSrvInfo1533 *object = (struct srvsvc_NetSrvInfo1533 *)pytalloc_get_ptr(obj); PyObject *py_maxmpxct; - py_maxmpxct = PyInt_FromLong(object->maxmpxct); + py_maxmpxct = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxmpxct); return py_maxmpxct; } static int py_srvsvc_NetSrvInfo1533_set_maxmpxct(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1533 *object = (struct srvsvc_NetSrvInfo1533 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxmpxct = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxmpxct)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxmpxct = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxmpxct = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11618,15 +19351,42 @@ static PyObject *py_srvsvc_NetSrvInfo1534_get_oplockbreakwait(PyObject *obj, voi { struct srvsvc_NetSrvInfo1534 *object = (struct srvsvc_NetSrvInfo1534 *)pytalloc_get_ptr(obj); PyObject *py_oplockbreakwait; - py_oplockbreakwait = PyInt_FromLong(object->oplockbreakwait); + py_oplockbreakwait = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->oplockbreakwait); return py_oplockbreakwait; } static int py_srvsvc_NetSrvInfo1534_set_oplockbreakwait(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1534 *object = (struct srvsvc_NetSrvInfo1534 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->oplockbreakwait = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->oplockbreakwait)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakwait = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakwait = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11656,15 +19416,42 @@ static PyObject *py_srvsvc_NetSrvInfo1535_get_oplockbreakresponsewait(PyObject * { struct srvsvc_NetSrvInfo1535 *object = (struct srvsvc_NetSrvInfo1535 *)pytalloc_get_ptr(obj); PyObject *py_oplockbreakresponsewait; - py_oplockbreakresponsewait = PyInt_FromLong(object->oplockbreakresponsewait); + py_oplockbreakresponsewait = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->oplockbreakresponsewait); return py_oplockbreakresponsewait; } static int py_srvsvc_NetSrvInfo1535_set_oplockbreakresponsewait(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1535 *object = (struct srvsvc_NetSrvInfo1535 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->oplockbreakresponsewait = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->oplockbreakresponsewait)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakresponsewait = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->oplockbreakresponsewait = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11694,15 +19481,42 @@ static PyObject *py_srvsvc_NetSrvInfo1536_get_enableoplocks(PyObject *obj, void { struct srvsvc_NetSrvInfo1536 *object = (struct srvsvc_NetSrvInfo1536 *)pytalloc_get_ptr(obj); PyObject *py_enableoplocks; - py_enableoplocks = PyInt_FromLong(object->enableoplocks); + py_enableoplocks = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableoplocks); return py_enableoplocks; } static int py_srvsvc_NetSrvInfo1536_set_enableoplocks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1536 *object = (struct srvsvc_NetSrvInfo1536 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableoplocks = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableoplocks)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplocks = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplocks = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11732,15 +19546,42 @@ static PyObject *py_srvsvc_NetSrvInfo1537_get_enableoplockforceclose(PyObject *o { struct srvsvc_NetSrvInfo1537 *object = (struct srvsvc_NetSrvInfo1537 *)pytalloc_get_ptr(obj); PyObject *py_enableoplockforceclose; - py_enableoplockforceclose = PyInt_FromLong(object->enableoplockforceclose); + py_enableoplockforceclose = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableoplockforceclose); return py_enableoplockforceclose; } static int py_srvsvc_NetSrvInfo1537_set_enableoplockforceclose(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1537 *object = (struct srvsvc_NetSrvInfo1537 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableoplockforceclose = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableoplockforceclose)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplockforceclose = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableoplockforceclose = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11770,15 +19611,42 @@ static PyObject *py_srvsvc_NetSrvInfo1538_get_enablefcbopens(PyObject *obj, void { struct srvsvc_NetSrvInfo1538 *object = (struct srvsvc_NetSrvInfo1538 *)pytalloc_get_ptr(obj); PyObject *py_enablefcbopens; - py_enablefcbopens = PyInt_FromLong(object->enablefcbopens); + py_enablefcbopens = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablefcbopens); return py_enablefcbopens; } static int py_srvsvc_NetSrvInfo1538_set_enablefcbopens(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1538 *object = (struct srvsvc_NetSrvInfo1538 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablefcbopens = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablefcbopens)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablefcbopens = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablefcbopens = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11808,15 +19676,42 @@ static PyObject *py_srvsvc_NetSrvInfo1539_get_enableraw(PyObject *obj, void *clo { struct srvsvc_NetSrvInfo1539 *object = (struct srvsvc_NetSrvInfo1539 *)pytalloc_get_ptr(obj); PyObject *py_enableraw; - py_enableraw = PyInt_FromLong(object->enableraw); + py_enableraw = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enableraw); return py_enableraw; } static int py_srvsvc_NetSrvInfo1539_set_enableraw(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1539 *object = (struct srvsvc_NetSrvInfo1539 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enableraw = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enableraw)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableraw = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enableraw = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11846,15 +19741,42 @@ static PyObject *py_srvsvc_NetSrvInfo1540_get_enablesharednetdrives(PyObject *ob { struct srvsvc_NetSrvInfo1540 *object = (struct srvsvc_NetSrvInfo1540 *)pytalloc_get_ptr(obj); PyObject *py_enablesharednetdrives; - py_enablesharednetdrives = PyInt_FromLong(object->enablesharednetdrives); + py_enablesharednetdrives = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enablesharednetdrives); return py_enablesharednetdrives; } static int py_srvsvc_NetSrvInfo1540_set_enablesharednetdrives(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1540 *object = (struct srvsvc_NetSrvInfo1540 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->enablesharednetdrives = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enablesharednetdrives)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesharednetdrives = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->enablesharednetdrives = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11884,15 +19806,42 @@ static PyObject *py_srvsvc_NetSrvInfo1541_get_minfreeconnections(PyObject *obj, { struct srvsvc_NetSrvInfo1541 *object = (struct srvsvc_NetSrvInfo1541 *)pytalloc_get_ptr(obj); PyObject *py_minfreeconnections; - py_minfreeconnections = PyInt_FromLong(object->minfreeconnections); + py_minfreeconnections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minfreeconnections); return py_minfreeconnections; } static int py_srvsvc_NetSrvInfo1541_set_minfreeconnections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1541 *object = (struct srvsvc_NetSrvInfo1541 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minfreeconnections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minfreeconnections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeconnections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minfreeconnections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11922,15 +19871,42 @@ static PyObject *py_srvsvc_NetSrvInfo1542_get_maxfreeconnections(PyObject *obj, { struct srvsvc_NetSrvInfo1542 *object = (struct srvsvc_NetSrvInfo1542 *)pytalloc_get_ptr(obj); PyObject *py_maxfreeconnections; - py_maxfreeconnections = PyInt_FromLong(object->maxfreeconnections); + py_maxfreeconnections = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxfreeconnections); return py_maxfreeconnections; } static int py_srvsvc_NetSrvInfo1542_set_maxfreeconnections(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1542 *object = (struct srvsvc_NetSrvInfo1542 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxfreeconnections = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxfreeconnections)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxfreeconnections = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxfreeconnections = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11960,15 +19936,42 @@ static PyObject *py_srvsvc_NetSrvInfo1543_get_initsesstable(PyObject *obj, void { struct srvsvc_NetSrvInfo1543 *object = (struct srvsvc_NetSrvInfo1543 *)pytalloc_get_ptr(obj); PyObject *py_initsesstable; - py_initsesstable = PyInt_FromLong(object->initsesstable); + py_initsesstable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initsesstable); return py_initsesstable; } static int py_srvsvc_NetSrvInfo1543_set_initsesstable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1543 *object = (struct srvsvc_NetSrvInfo1543 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initsesstable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initsesstable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsesstable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsesstable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -11998,15 +20001,42 @@ static PyObject *py_srvsvc_NetSrvInfo1544_get_initconntable(PyObject *obj, void { struct srvsvc_NetSrvInfo1544 *object = (struct srvsvc_NetSrvInfo1544 *)pytalloc_get_ptr(obj); PyObject *py_initconntable; - py_initconntable = PyInt_FromLong(object->initconntable); + py_initconntable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initconntable); return py_initconntable; } static int py_srvsvc_NetSrvInfo1544_set_initconntable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1544 *object = (struct srvsvc_NetSrvInfo1544 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initconntable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initconntable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initconntable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initconntable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12036,15 +20066,42 @@ static PyObject *py_srvsvc_NetSrvInfo1545_get_initfiletable(PyObject *obj, void { struct srvsvc_NetSrvInfo1545 *object = (struct srvsvc_NetSrvInfo1545 *)pytalloc_get_ptr(obj); PyObject *py_initfiletable; - py_initfiletable = PyInt_FromLong(object->initfiletable); + py_initfiletable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initfiletable); return py_initfiletable; } static int py_srvsvc_NetSrvInfo1545_set_initfiletable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1545 *object = (struct srvsvc_NetSrvInfo1545 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initfiletable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initfiletable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initfiletable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initfiletable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12074,15 +20131,42 @@ static PyObject *py_srvsvc_NetSrvInfo1546_get_initsearchtable(PyObject *obj, voi { struct srvsvc_NetSrvInfo1546 *object = (struct srvsvc_NetSrvInfo1546 *)pytalloc_get_ptr(obj); PyObject *py_initsearchtable; - py_initsearchtable = PyInt_FromLong(object->initsearchtable); + py_initsearchtable = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->initsearchtable); return py_initsearchtable; } static int py_srvsvc_NetSrvInfo1546_set_initsearchtable(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1546 *object = (struct srvsvc_NetSrvInfo1546 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->initsearchtable = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->initsearchtable)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsearchtable = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->initsearchtable = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12112,15 +20196,42 @@ static PyObject *py_srvsvc_NetSrvInfo1547_get_alertsched(PyObject *obj, void *cl { struct srvsvc_NetSrvInfo1547 *object = (struct srvsvc_NetSrvInfo1547 *)pytalloc_get_ptr(obj); PyObject *py_alertsched; - py_alertsched = PyInt_FromLong(object->alertsched); + py_alertsched = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alertsched); return py_alertsched; } static int py_srvsvc_NetSrvInfo1547_set_alertsched(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1547 *object = (struct srvsvc_NetSrvInfo1547 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->alertsched = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alertsched)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->alertsched = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12150,15 +20261,42 @@ static PyObject *py_srvsvc_NetSrvInfo1548_get_errortreshold(PyObject *obj, void { struct srvsvc_NetSrvInfo1548 *object = (struct srvsvc_NetSrvInfo1548 *)pytalloc_get_ptr(obj); PyObject *py_errortreshold; - py_errortreshold = PyInt_FromLong(object->errortreshold); + py_errortreshold = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->errortreshold); return py_errortreshold; } static int py_srvsvc_NetSrvInfo1548_set_errortreshold(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1548 *object = (struct srvsvc_NetSrvInfo1548 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->errortreshold = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->errortreshold)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->errortreshold = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->errortreshold = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12188,15 +20326,42 @@ static PyObject *py_srvsvc_NetSrvInfo1549_get_networkerrortreshold(PyObject *obj { struct srvsvc_NetSrvInfo1549 *object = (struct srvsvc_NetSrvInfo1549 *)pytalloc_get_ptr(obj); PyObject *py_networkerrortreshold; - py_networkerrortreshold = PyInt_FromLong(object->networkerrortreshold); + py_networkerrortreshold = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->networkerrortreshold); return py_networkerrortreshold; } static int py_srvsvc_NetSrvInfo1549_set_networkerrortreshold(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1549 *object = (struct srvsvc_NetSrvInfo1549 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->networkerrortreshold = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->networkerrortreshold)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->networkerrortreshold = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->networkerrortreshold = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12226,15 +20391,42 @@ static PyObject *py_srvsvc_NetSrvInfo1550_get_diskspacetreshold(PyObject *obj, v { struct srvsvc_NetSrvInfo1550 *object = (struct srvsvc_NetSrvInfo1550 *)pytalloc_get_ptr(obj); PyObject *py_diskspacetreshold; - py_diskspacetreshold = PyInt_FromLong(object->diskspacetreshold); + py_diskspacetreshold = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->diskspacetreshold); return py_diskspacetreshold; } static int py_srvsvc_NetSrvInfo1550_set_diskspacetreshold(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1550 *object = (struct srvsvc_NetSrvInfo1550 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->diskspacetreshold = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->diskspacetreshold)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskspacetreshold = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->diskspacetreshold = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12264,15 +20456,42 @@ static PyObject *py_srvsvc_NetSrvInfo1552_get_maxlinkdelay(PyObject *obj, void * { struct srvsvc_NetSrvInfo1552 *object = (struct srvsvc_NetSrvInfo1552 *)pytalloc_get_ptr(obj); PyObject *py_maxlinkdelay; - py_maxlinkdelay = PyInt_FromLong(object->maxlinkdelay); + py_maxlinkdelay = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxlinkdelay); return py_maxlinkdelay; } static int py_srvsvc_NetSrvInfo1552_set_maxlinkdelay(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1552 *object = (struct srvsvc_NetSrvInfo1552 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxlinkdelay = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxlinkdelay)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxlinkdelay = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxlinkdelay = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12302,15 +20521,42 @@ static PyObject *py_srvsvc_NetSrvInfo1553_get_minlinkthroughput(PyObject *obj, v { struct srvsvc_NetSrvInfo1553 *object = (struct srvsvc_NetSrvInfo1553 *)pytalloc_get_ptr(obj); PyObject *py_minlinkthroughput; - py_minlinkthroughput = PyInt_FromLong(object->minlinkthroughput); + py_minlinkthroughput = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->minlinkthroughput); return py_minlinkthroughput; } static int py_srvsvc_NetSrvInfo1553_set_minlinkthroughput(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1553 *object = (struct srvsvc_NetSrvInfo1553 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->minlinkthroughput = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minlinkthroughput)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minlinkthroughput = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->minlinkthroughput = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12340,15 +20586,42 @@ static PyObject *py_srvsvc_NetSrvInfo1554_get_linkinfovalidtime(PyObject *obj, v { struct srvsvc_NetSrvInfo1554 *object = (struct srvsvc_NetSrvInfo1554 *)pytalloc_get_ptr(obj); PyObject *py_linkinfovalidtime; - py_linkinfovalidtime = PyInt_FromLong(object->linkinfovalidtime); + py_linkinfovalidtime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->linkinfovalidtime); return py_linkinfovalidtime; } static int py_srvsvc_NetSrvInfo1554_set_linkinfovalidtime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1554 *object = (struct srvsvc_NetSrvInfo1554 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->linkinfovalidtime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->linkinfovalidtime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->linkinfovalidtime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->linkinfovalidtime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12378,15 +20651,42 @@ static PyObject *py_srvsvc_NetSrvInfo1555_get_scavqosinfoupdatetime(PyObject *ob { struct srvsvc_NetSrvInfo1555 *object = (struct srvsvc_NetSrvInfo1555 *)pytalloc_get_ptr(obj); PyObject *py_scavqosinfoupdatetime; - py_scavqosinfoupdatetime = PyInt_FromLong(object->scavqosinfoupdatetime); + py_scavqosinfoupdatetime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->scavqosinfoupdatetime); return py_scavqosinfoupdatetime; } static int py_srvsvc_NetSrvInfo1555_set_scavqosinfoupdatetime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1555 *object = (struct srvsvc_NetSrvInfo1555 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->scavqosinfoupdatetime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->scavqosinfoupdatetime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavqosinfoupdatetime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->scavqosinfoupdatetime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12416,15 +20716,42 @@ static PyObject *py_srvsvc_NetSrvInfo1556_get_maxworkitemidletime(PyObject *obj, { struct srvsvc_NetSrvInfo1556 *object = (struct srvsvc_NetSrvInfo1556 *)pytalloc_get_ptr(obj); PyObject *py_maxworkitemidletime; - py_maxworkitemidletime = PyInt_FromLong(object->maxworkitemidletime); + py_maxworkitemidletime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maxworkitemidletime); return py_maxworkitemidletime; } static int py_srvsvc_NetSrvInfo1556_set_maxworkitemidletime(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetSrvInfo1556 *object = (struct srvsvc_NetSrvInfo1556 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->maxworkitemidletime = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxworkitemidletime)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitemidletime = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->maxworkitemidletime = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -12449,7 +20776,7 @@ static PyTypeObject srvsvc_NetSrvInfo1556_Type = { .tp_new = py_srvsvc_NetSrvInfo1556_new, }; -static PyObject *py_import_srvsvc_NetSrvInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetSrvInfo *in) +PyObject *py_import_srvsvc_NetSrvInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetSrvInfo *in) { PyObject *ret; @@ -12995,7 +21322,7 @@ static PyObject *py_import_srvsvc_NetSrvInfo(TALLOC_CTX *mem_ctx, int level, uni return NULL; } -static union srvsvc_NetSrvInfo *py_export_srvsvc_NetSrvInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetSrvInfo *py_export_srvsvc_NetSrvInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetSrvInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetSrvInfo); switch (level) { @@ -13838,15 +22165,42 @@ static PyObject *py_srvsvc_NetDiskInfo0_get___disk_offset(PyObject *obj, void *c { struct srvsvc_NetDiskInfo0 *object = (struct srvsvc_NetDiskInfo0 *)pytalloc_get_ptr(obj); PyObject *py___disk_offset; - py___disk_offset = PyInt_FromLong(object->__disk_offset); + py___disk_offset = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->__disk_offset); return py___disk_offset; } static int py_srvsvc_NetDiskInfo0_set___disk_offset(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetDiskInfo0 *object = (struct srvsvc_NetDiskInfo0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->__disk_offset = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__disk_offset)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->__disk_offset = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->__disk_offset = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -13854,15 +22208,42 @@ static PyObject *py_srvsvc_NetDiskInfo0_get___disk_length(PyObject *obj, void *c { struct srvsvc_NetDiskInfo0 *object = (struct srvsvc_NetDiskInfo0 *)pytalloc_get_ptr(obj); PyObject *py___disk_length; - py___disk_length = PyInt_FromLong(object->__disk_length); + py___disk_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->__disk_length); return py___disk_length; } static int py_srvsvc_NetDiskInfo0_set___disk_length(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetDiskInfo0 *object = (struct srvsvc_NetDiskInfo0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->__disk_length = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__disk_length)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->__disk_length = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->__disk_length = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -13921,15 +22302,42 @@ static PyObject *py_srvsvc_NetDiskInfo_get_count(PyObject *obj, void *closure) { struct srvsvc_NetDiskInfo *object = (struct srvsvc_NetDiskInfo *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetDiskInfo_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetDiskInfo *object = (struct srvsvc_NetDiskInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -13947,7 +22355,7 @@ static PyObject *py_srvsvc_NetDiskInfo_get_disks(PyObject *obj, void *closure) } { int disks_cntr_1; - for (disks_cntr_1 = 0; disks_cntr_1 < object->count; disks_cntr_1++) { + for (disks_cntr_1 = 0; disks_cntr_1 < (object->count); disks_cntr_1++) { PyObject *py_disks_1; py_disks_1 = pytalloc_reference_ex(&srvsvc_NetDiskInfo0_Type, object->disks, &object->disks[disks_cntr_1]); PyList_SetItem(py_disks, disks_cntr_1, py_disks_1); @@ -13960,7 +22368,7 @@ static PyObject *py_srvsvc_NetDiskInfo_get_disks(PyObject *obj, void *closure) static int py_srvsvc_NetDiskInfo_set_disks(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetDiskInfo *object = (struct srvsvc_NetDiskInfo *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->disks); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->disks)); if (value == Py_None) { object->disks = NULL; } else { @@ -14011,15 +22419,42 @@ static PyObject *py_srvsvc_Statistics_get_start(PyObject *obj, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_start; - py_start = PyInt_FromLong(object->start); + py_start = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->start); return py_start; } static int py_srvsvc_Statistics_set_start(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->start = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->start = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->start = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14027,15 +22462,42 @@ static PyObject *py_srvsvc_Statistics_get_fopens(PyObject *obj, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_fopens; - py_fopens = PyInt_FromLong(object->fopens); + py_fopens = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->fopens); return py_fopens; } static int py_srvsvc_Statistics_set_fopens(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->fopens = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fopens)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->fopens = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->fopens = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14043,15 +22505,42 @@ static PyObject *py_srvsvc_Statistics_get_devopens(PyObject *obj, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_devopens; - py_devopens = PyInt_FromLong(object->devopens); + py_devopens = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->devopens); return py_devopens; } static int py_srvsvc_Statistics_set_devopens(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->devopens = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->devopens)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->devopens = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->devopens = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14059,15 +22548,42 @@ static PyObject *py_srvsvc_Statistics_get_jobsqueued(PyObject *obj, void *closur { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_jobsqueued; - py_jobsqueued = PyInt_FromLong(object->jobsqueued); + py_jobsqueued = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->jobsqueued); return py_jobsqueued; } static int py_srvsvc_Statistics_set_jobsqueued(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->jobsqueued = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->jobsqueued)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->jobsqueued = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->jobsqueued = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14075,15 +22591,42 @@ static PyObject *py_srvsvc_Statistics_get_sopens(PyObject *obj, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_sopens; - py_sopens = PyInt_FromLong(object->sopens); + py_sopens = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sopens); return py_sopens; } static int py_srvsvc_Statistics_set_sopens(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->sopens = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sopens)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sopens = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->sopens = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14091,15 +22634,42 @@ static PyObject *py_srvsvc_Statistics_get_stimeouts(PyObject *obj, void *closure { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_stimeouts; - py_stimeouts = PyInt_FromLong(object->stimeouts); + py_stimeouts = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->stimeouts); return py_stimeouts; } static int py_srvsvc_Statistics_set_stimeouts(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->stimeouts = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->stimeouts)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->stimeouts = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->stimeouts = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14107,15 +22677,42 @@ static PyObject *py_srvsvc_Statistics_get_serrorout(PyObject *obj, void *closure { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_serrorout; - py_serrorout = PyInt_FromLong(object->serrorout); + py_serrorout = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->serrorout); return py_serrorout; } static int py_srvsvc_Statistics_set_serrorout(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->serrorout = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serrorout)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->serrorout = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->serrorout = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14123,15 +22720,42 @@ static PyObject *py_srvsvc_Statistics_get_pwerrors(PyObject *obj, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_pwerrors; - py_pwerrors = PyInt_FromLong(object->pwerrors); + py_pwerrors = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->pwerrors); return py_pwerrors; } static int py_srvsvc_Statistics_set_pwerrors(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->pwerrors = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pwerrors)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->pwerrors = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->pwerrors = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14139,15 +22763,42 @@ static PyObject *py_srvsvc_Statistics_get_permerrors(PyObject *obj, void *closur { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_permerrors; - py_permerrors = PyInt_FromLong(object->permerrors); + py_permerrors = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->permerrors); return py_permerrors; } static int py_srvsvc_Statistics_set_permerrors(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->permerrors = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->permerrors)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permerrors = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->permerrors = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14155,15 +22806,42 @@ static PyObject *py_srvsvc_Statistics_get_syserrors(PyObject *obj, void *closure { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_syserrors; - py_syserrors = PyInt_FromLong(object->syserrors); + py_syserrors = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->syserrors); return py_syserrors; } static int py_srvsvc_Statistics_set_syserrors(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->syserrors = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->syserrors)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->syserrors = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->syserrors = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14171,15 +22849,42 @@ static PyObject *py_srvsvc_Statistics_get_bytessent_low(PyObject *obj, void *clo { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_bytessent_low; - py_bytessent_low = PyInt_FromLong(object->bytessent_low); + py_bytessent_low = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->bytessent_low); return py_bytessent_low; } static int py_srvsvc_Statistics_set_bytessent_low(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->bytessent_low = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bytessent_low)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytessent_low = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytessent_low = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14187,15 +22892,42 @@ static PyObject *py_srvsvc_Statistics_get_bytessent_high(PyObject *obj, void *cl { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_bytessent_high; - py_bytessent_high = PyInt_FromLong(object->bytessent_high); + py_bytessent_high = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->bytessent_high); return py_bytessent_high; } static int py_srvsvc_Statistics_set_bytessent_high(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->bytessent_high = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bytessent_high)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytessent_high = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytessent_high = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14203,15 +22935,42 @@ static PyObject *py_srvsvc_Statistics_get_bytesrcvd_low(PyObject *obj, void *clo { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_bytesrcvd_low; - py_bytesrcvd_low = PyInt_FromLong(object->bytesrcvd_low); + py_bytesrcvd_low = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->bytesrcvd_low); return py_bytesrcvd_low; } static int py_srvsvc_Statistics_set_bytesrcvd_low(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->bytesrcvd_low = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bytesrcvd_low)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytesrcvd_low = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytesrcvd_low = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14219,15 +22978,42 @@ static PyObject *py_srvsvc_Statistics_get_bytesrcvd_high(PyObject *obj, void *cl { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_bytesrcvd_high; - py_bytesrcvd_high = PyInt_FromLong(object->bytesrcvd_high); + py_bytesrcvd_high = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->bytesrcvd_high); return py_bytesrcvd_high; } static int py_srvsvc_Statistics_set_bytesrcvd_high(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->bytesrcvd_high = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bytesrcvd_high)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytesrcvd_high = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bytesrcvd_high = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14235,15 +23021,42 @@ static PyObject *py_srvsvc_Statistics_get_avresponse(PyObject *obj, void *closur { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_avresponse; - py_avresponse = PyInt_FromLong(object->avresponse); + py_avresponse = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->avresponse); return py_avresponse; } static int py_srvsvc_Statistics_set_avresponse(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->avresponse = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->avresponse)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->avresponse = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->avresponse = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14251,15 +23064,42 @@ static PyObject *py_srvsvc_Statistics_get_reqbufneed(PyObject *obj, void *closur { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_reqbufneed; - py_reqbufneed = PyInt_FromLong(object->reqbufneed); + py_reqbufneed = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->reqbufneed); return py_reqbufneed; } static int py_srvsvc_Statistics_set_reqbufneed(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->reqbufneed = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reqbufneed)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->reqbufneed = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->reqbufneed = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14267,15 +23107,42 @@ static PyObject *py_srvsvc_Statistics_get_bigbufneed(PyObject *obj, void *closur { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(obj); PyObject *py_bigbufneed; - py_bigbufneed = PyInt_FromLong(object->bigbufneed); + py_bigbufneed = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->bigbufneed); return py_bigbufneed; } static int py_srvsvc_Statistics_set_bigbufneed(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_Statistics *object = (struct srvsvc_Statistics *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->bigbufneed = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bigbufneed)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bigbufneed = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->bigbufneed = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14321,15 +23188,42 @@ static PyObject *py_srvsvc_NetTransportInfo0_get_vcs(PyObject *obj, void *closur { struct srvsvc_NetTransportInfo0 *object = (struct srvsvc_NetTransportInfo0 *)pytalloc_get_ptr(obj); PyObject *py_vcs; - py_vcs = PyInt_FromLong(object->vcs); + py_vcs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->vcs); return py_vcs; } static int py_srvsvc_NetTransportInfo0_set_vcs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo0 *object = (struct srvsvc_NetTransportInfo0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->vcs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vcs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14384,9 +23278,9 @@ static PyObject *py_srvsvc_NetTransportInfo0_get_addr(PyObject *obj, void *closu } { int addr_cntr_1; - for (addr_cntr_1 = 0; addr_cntr_1 < object->addr_len; addr_cntr_1++) { + for (addr_cntr_1 = 0; addr_cntr_1 < (object->addr_len); addr_cntr_1++) { PyObject *py_addr_1; - py_addr_1 = PyInt_FromLong(object->addr[addr_cntr_1]); + py_addr_1 = PyInt_FromLong((uint16_t)object->addr[addr_cntr_1]); PyList_SetItem(py_addr, addr_cntr_1, py_addr_1); } } @@ -14397,7 +23291,7 @@ static PyObject *py_srvsvc_NetTransportInfo0_get_addr(PyObject *obj, void *closu static int py_srvsvc_NetTransportInfo0_set_addr(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo0 *object = (struct srvsvc_NetTransportInfo0 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->addr); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->addr)); if (value == Py_None) { object->addr = NULL; } else { @@ -14409,8 +23303,35 @@ static int py_srvsvc_NetTransportInfo0_set_addr(PyObject *py_obj, PyObject *valu if (!object->addr) { return -1;; } talloc_set_name_const(object->addr, "ARRAY: object->addr"); for (addr_cntr_1 = 0; addr_cntr_1 < PyList_GET_SIZE(value); addr_cntr_1++) { - PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, addr_cntr_1), return -1;); - object->addr[addr_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr[addr_cntr_1])); + if (PyLong_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else if (PyInt_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + long test_var; + test_var = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } } } } @@ -14421,15 +23342,42 @@ static PyObject *py_srvsvc_NetTransportInfo0_get_addr_len(PyObject *obj, void *c { struct srvsvc_NetTransportInfo0 *object = (struct srvsvc_NetTransportInfo0 *)pytalloc_get_ptr(obj); PyObject *py_addr_len; - py_addr_len = PyInt_FromLong(object->addr_len); + py_addr_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->addr_len); return py_addr_len; } static int py_srvsvc_NetTransportInfo0_set_addr_len(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo0 *object = (struct srvsvc_NetTransportInfo0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->addr_len = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr_len)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14500,15 +23448,42 @@ static PyObject *py_srvsvc_NetTransportCtr0_get_count(PyObject *obj, void *closu { struct srvsvc_NetTransportCtr0 *object = (struct srvsvc_NetTransportCtr0 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetTransportCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr0 *object = (struct srvsvc_NetTransportCtr0 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14526,7 +23501,7 @@ static PyObject *py_srvsvc_NetTransportCtr0_get_array(PyObject *obj, void *closu } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetTransportInfo0_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -14539,7 +23514,7 @@ static PyObject *py_srvsvc_NetTransportCtr0_get_array(PyObject *obj, void *closu static int py_srvsvc_NetTransportCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr0 *object = (struct srvsvc_NetTransportCtr0 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -14590,15 +23565,42 @@ static PyObject *py_srvsvc_NetTransportInfo1_get_vcs(PyObject *obj, void *closur { struct srvsvc_NetTransportInfo1 *object = (struct srvsvc_NetTransportInfo1 *)pytalloc_get_ptr(obj); PyObject *py_vcs; - py_vcs = PyInt_FromLong(object->vcs); + py_vcs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->vcs); return py_vcs; } static int py_srvsvc_NetTransportInfo1_set_vcs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo1 *object = (struct srvsvc_NetTransportInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->vcs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vcs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14653,9 +23655,9 @@ static PyObject *py_srvsvc_NetTransportInfo1_get_addr(PyObject *obj, void *closu } { int addr_cntr_1; - for (addr_cntr_1 = 0; addr_cntr_1 < object->addr_len; addr_cntr_1++) { + for (addr_cntr_1 = 0; addr_cntr_1 < (object->addr_len); addr_cntr_1++) { PyObject *py_addr_1; - py_addr_1 = PyInt_FromLong(object->addr[addr_cntr_1]); + py_addr_1 = PyInt_FromLong((uint16_t)object->addr[addr_cntr_1]); PyList_SetItem(py_addr, addr_cntr_1, py_addr_1); } } @@ -14666,7 +23668,7 @@ static PyObject *py_srvsvc_NetTransportInfo1_get_addr(PyObject *obj, void *closu static int py_srvsvc_NetTransportInfo1_set_addr(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo1 *object = (struct srvsvc_NetTransportInfo1 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->addr); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->addr)); if (value == Py_None) { object->addr = NULL; } else { @@ -14678,8 +23680,35 @@ static int py_srvsvc_NetTransportInfo1_set_addr(PyObject *py_obj, PyObject *valu if (!object->addr) { return -1;; } talloc_set_name_const(object->addr, "ARRAY: object->addr"); for (addr_cntr_1 = 0; addr_cntr_1 < PyList_GET_SIZE(value); addr_cntr_1++) { - PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, addr_cntr_1), return -1;); - object->addr[addr_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr[addr_cntr_1])); + if (PyLong_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else if (PyInt_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + long test_var; + test_var = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } } } } @@ -14690,15 +23719,42 @@ static PyObject *py_srvsvc_NetTransportInfo1_get_addr_len(PyObject *obj, void *c { struct srvsvc_NetTransportInfo1 *object = (struct srvsvc_NetTransportInfo1 *)pytalloc_get_ptr(obj); PyObject *py_addr_len; - py_addr_len = PyInt_FromLong(object->addr_len); + py_addr_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->addr_len); return py_addr_len; } static int py_srvsvc_NetTransportInfo1_set_addr_len(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo1 *object = (struct srvsvc_NetTransportInfo1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->addr_len = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr_len)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14807,15 +23863,42 @@ static PyObject *py_srvsvc_NetTransportCtr1_get_count(PyObject *obj, void *closu { struct srvsvc_NetTransportCtr1 *object = (struct srvsvc_NetTransportCtr1 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetTransportCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr1 *object = (struct srvsvc_NetTransportCtr1 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14833,7 +23916,7 @@ static PyObject *py_srvsvc_NetTransportCtr1_get_array(PyObject *obj, void *closu } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetTransportInfo1_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -14846,7 +23929,7 @@ static PyObject *py_srvsvc_NetTransportCtr1_get_array(PyObject *obj, void *closu static int py_srvsvc_NetTransportCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr1 *object = (struct srvsvc_NetTransportCtr1 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -14897,15 +23980,42 @@ static PyObject *py_srvsvc_NetTransportInfo2_get_vcs(PyObject *obj, void *closur { struct srvsvc_NetTransportInfo2 *object = (struct srvsvc_NetTransportInfo2 *)pytalloc_get_ptr(obj); PyObject *py_vcs; - py_vcs = PyInt_FromLong(object->vcs); + py_vcs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->vcs); return py_vcs; } static int py_srvsvc_NetTransportInfo2_set_vcs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo2 *object = (struct srvsvc_NetTransportInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->vcs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vcs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -14960,9 +24070,9 @@ static PyObject *py_srvsvc_NetTransportInfo2_get_addr(PyObject *obj, void *closu } { int addr_cntr_1; - for (addr_cntr_1 = 0; addr_cntr_1 < object->addr_len; addr_cntr_1++) { + for (addr_cntr_1 = 0; addr_cntr_1 < (object->addr_len); addr_cntr_1++) { PyObject *py_addr_1; - py_addr_1 = PyInt_FromLong(object->addr[addr_cntr_1]); + py_addr_1 = PyInt_FromLong((uint16_t)object->addr[addr_cntr_1]); PyList_SetItem(py_addr, addr_cntr_1, py_addr_1); } } @@ -14973,7 +24083,7 @@ static PyObject *py_srvsvc_NetTransportInfo2_get_addr(PyObject *obj, void *closu static int py_srvsvc_NetTransportInfo2_set_addr(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo2 *object = (struct srvsvc_NetTransportInfo2 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->addr); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->addr)); if (value == Py_None) { object->addr = NULL; } else { @@ -14985,8 +24095,35 @@ static int py_srvsvc_NetTransportInfo2_set_addr(PyObject *py_obj, PyObject *valu if (!object->addr) { return -1;; } talloc_set_name_const(object->addr, "ARRAY: object->addr"); for (addr_cntr_1 = 0; addr_cntr_1 < PyList_GET_SIZE(value); addr_cntr_1++) { - PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, addr_cntr_1), return -1;); - object->addr[addr_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr[addr_cntr_1])); + if (PyLong_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else if (PyInt_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + long test_var; + test_var = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } } } } @@ -14997,15 +24134,42 @@ static PyObject *py_srvsvc_NetTransportInfo2_get_addr_len(PyObject *obj, void *c { struct srvsvc_NetTransportInfo2 *object = (struct srvsvc_NetTransportInfo2 *)pytalloc_get_ptr(obj); PyObject *py_addr_len; - py_addr_len = PyInt_FromLong(object->addr_len); + py_addr_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->addr_len); return py_addr_len; } static int py_srvsvc_NetTransportInfo2_set_addr_len(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo2 *object = (struct srvsvc_NetTransportInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->addr_len = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr_len)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15087,15 +24251,42 @@ static PyObject *py_srvsvc_NetTransportInfo2_get_unknown(PyObject *obj, void *cl { struct srvsvc_NetTransportInfo2 *object = (struct srvsvc_NetTransportInfo2 *)pytalloc_get_ptr(obj); PyObject *py_unknown; - py_unknown = PyInt_FromLong(object->unknown); + py_unknown = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->unknown); return py_unknown; } static int py_srvsvc_NetTransportInfo2_set_unknown(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo2 *object = (struct srvsvc_NetTransportInfo2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->unknown = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15131,15 +24322,42 @@ static PyObject *py_srvsvc_NetTransportCtr2_get_count(PyObject *obj, void *closu { struct srvsvc_NetTransportCtr2 *object = (struct srvsvc_NetTransportCtr2 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetTransportCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr2 *object = (struct srvsvc_NetTransportCtr2 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15157,7 +24375,7 @@ static PyObject *py_srvsvc_NetTransportCtr2_get_array(PyObject *obj, void *closu } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetTransportInfo2_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -15170,7 +24388,7 @@ static PyObject *py_srvsvc_NetTransportCtr2_get_array(PyObject *obj, void *closu static int py_srvsvc_NetTransportCtr2_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr2 *object = (struct srvsvc_NetTransportCtr2 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -15221,15 +24439,42 @@ static PyObject *py_srvsvc_NetTransportInfo3_get_vcs(PyObject *obj, void *closur { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(obj); PyObject *py_vcs; - py_vcs = PyInt_FromLong(object->vcs); + py_vcs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->vcs); return py_vcs; } static int py_srvsvc_NetTransportInfo3_set_vcs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->vcs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vcs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->vcs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15284,9 +24529,9 @@ static PyObject *py_srvsvc_NetTransportInfo3_get_addr(PyObject *obj, void *closu } { int addr_cntr_1; - for (addr_cntr_1 = 0; addr_cntr_1 < object->addr_len; addr_cntr_1++) { + for (addr_cntr_1 = 0; addr_cntr_1 < (object->addr_len); addr_cntr_1++) { PyObject *py_addr_1; - py_addr_1 = PyInt_FromLong(object->addr[addr_cntr_1]); + py_addr_1 = PyInt_FromLong((uint16_t)object->addr[addr_cntr_1]); PyList_SetItem(py_addr, addr_cntr_1, py_addr_1); } } @@ -15297,7 +24542,7 @@ static PyObject *py_srvsvc_NetTransportInfo3_get_addr(PyObject *obj, void *closu static int py_srvsvc_NetTransportInfo3_set_addr(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->addr); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->addr)); if (value == Py_None) { object->addr = NULL; } else { @@ -15309,8 +24554,35 @@ static int py_srvsvc_NetTransportInfo3_set_addr(PyObject *py_obj, PyObject *valu if (!object->addr) { return -1;; } talloc_set_name_const(object->addr, "ARRAY: object->addr"); for (addr_cntr_1 = 0; addr_cntr_1 < PyList_GET_SIZE(value); addr_cntr_1++) { - PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, addr_cntr_1), return -1;); - object->addr[addr_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr[addr_cntr_1])); + if (PyLong_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else if (PyInt_Check(PyList_GET_ITEM(value, addr_cntr_1))) { + long test_var; + test_var = PyInt_AsLong(PyList_GET_ITEM(value, addr_cntr_1)); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr[addr_cntr_1] = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } } } } @@ -15321,15 +24593,42 @@ static PyObject *py_srvsvc_NetTransportInfo3_get_addr_len(PyObject *obj, void *c { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(obj); PyObject *py_addr_len; - py_addr_len = PyInt_FromLong(object->addr_len); + py_addr_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->addr_len); return py_addr_len; } static int py_srvsvc_NetTransportInfo3_set_addr_len(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->addr_len = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->addr_len)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->addr_len = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15411,15 +24710,42 @@ static PyObject *py_srvsvc_NetTransportInfo3_get_unknown1(PyObject *obj, void *c { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(obj); PyObject *py_unknown1; - py_unknown1 = PyInt_FromLong(object->unknown1); + py_unknown1 = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->unknown1); return py_unknown1; } static int py_srvsvc_NetTransportInfo3_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->unknown1 = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown1 = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown1 = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15427,15 +24753,42 @@ static PyObject *py_srvsvc_NetTransportInfo3_get_unknown2(PyObject *obj, void *c { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(obj); PyObject *py_unknown2; - py_unknown2 = PyInt_FromLong(object->unknown2); + py_unknown2 = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->unknown2); return py_unknown2; } static int py_srvsvc_NetTransportInfo3_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfo3 *object = (struct srvsvc_NetTransportInfo3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->unknown2 = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown2 = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown2 = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15449,9 +24802,9 @@ static PyObject *py_srvsvc_NetTransportInfo3_get_unknown3(PyObject *obj, void *c } { int unknown3_cntr_0; - for (unknown3_cntr_0 = 0; unknown3_cntr_0 < 256; unknown3_cntr_0++) { + for (unknown3_cntr_0 = 0; unknown3_cntr_0 < (256); unknown3_cntr_0++) { PyObject *py_unknown3_0; - py_unknown3_0 = PyInt_FromLong(object->unknown3[unknown3_cntr_0]); + py_unknown3_0 = PyInt_FromLong((uint16_t)object->unknown3[unknown3_cntr_0]); PyList_SetItem(py_unknown3, unknown3_cntr_0, py_unknown3_0); } } @@ -15464,9 +24817,40 @@ static int py_srvsvc_NetTransportInfo3_set_unknown3(PyObject *py_obj, PyObject * PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int unknown3_cntr_0; + if (ARRAY_SIZE(object->unknown3) != PyList_GET_SIZE(value)) { + PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->unknown3), PyList_GET_SIZE(value)); + return -1; + } for (unknown3_cntr_0 = 0; unknown3_cntr_0 < PyList_GET_SIZE(value); unknown3_cntr_0++) { - PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, unknown3_cntr_0), return -1;); - object->unknown3[unknown3_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, unknown3_cntr_0)); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3[unknown3_cntr_0])); + if (PyLong_Check(PyList_GET_ITEM(value, unknown3_cntr_0))) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unknown3_cntr_0)); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown3[unknown3_cntr_0] = test_var; + } else if (PyInt_Check(PyList_GET_ITEM(value, unknown3_cntr_0))) { + long test_var; + test_var = PyInt_AsLong(PyList_GET_ITEM(value, unknown3_cntr_0)); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->unknown3[unknown3_cntr_0] = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } } } return 0; @@ -15506,15 +24890,42 @@ static PyObject *py_srvsvc_NetTransportCtr3_get_count(PyObject *obj, void *closu { struct srvsvc_NetTransportCtr3 *object = (struct srvsvc_NetTransportCtr3 *)pytalloc_get_ptr(obj); PyObject *py_count; - py_count = PyInt_FromLong(object->count); + py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_srvsvc_NetTransportCtr3_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr3 *object = (struct srvsvc_NetTransportCtr3 *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->count = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->count = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15532,7 +24943,7 @@ static PyObject *py_srvsvc_NetTransportCtr3_get_array(PyObject *obj, void *closu } { int array_cntr_1; - for (array_cntr_1 = 0; array_cntr_1 < object->count; array_cntr_1++) { + for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) { PyObject *py_array_1; py_array_1 = pytalloc_reference_ex(&srvsvc_NetTransportInfo3_Type, object->array, &object->array[array_cntr_1]); PyList_SetItem(py_array, array_cntr_1, py_array_1); @@ -15545,7 +24956,7 @@ static PyObject *py_srvsvc_NetTransportCtr3_get_array(PyObject *obj, void *closu static int py_srvsvc_NetTransportCtr3_set_array(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportCtr3 *object = (struct srvsvc_NetTransportCtr3 *)pytalloc_get_ptr(py_obj); - talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->array); + talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array)); if (value == Py_None) { object->array = NULL; } else { @@ -15591,7 +25002,7 @@ static PyTypeObject srvsvc_NetTransportCtr3_Type = { .tp_new = py_srvsvc_NetTransportCtr3_new, }; -static PyObject *py_import_srvsvc_NetTransportCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetTransportCtr *in) +PyObject *py_import_srvsvc_NetTransportCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetTransportCtr *in) { PyObject *ret; @@ -15642,7 +25053,7 @@ static PyObject *py_import_srvsvc_NetTransportCtr(TALLOC_CTX *mem_ctx, int level return NULL; } -static union srvsvc_NetTransportCtr *py_export_srvsvc_NetTransportCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetTransportCtr *py_export_srvsvc_NetTransportCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetTransportCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetTransportCtr); switch (level) { @@ -15715,15 +25126,42 @@ static PyObject *py_srvsvc_NetTransportInfoCtr_get_level(PyObject *obj, void *cl { struct srvsvc_NetTransportInfoCtr *object = (struct srvsvc_NetTransportInfoCtr *)pytalloc_get_ptr(obj); PyObject *py_level; - py_level = PyInt_FromLong(object->level); + py_level = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->level); return py_level; } static int py_srvsvc_NetTransportInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetTransportInfoCtr *object = (struct srvsvc_NetTransportInfoCtr *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->level = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15779,15 +25217,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_elapsed(PyObject *obj, void *clo { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_elapsed; - py_elapsed = PyInt_FromLong(object->elapsed); + py_elapsed = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->elapsed); return py_elapsed; } static int py_srvsvc_NetRemoteTODInfo_set_elapsed(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->elapsed = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->elapsed)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->elapsed = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->elapsed = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15795,15 +25260,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_msecs(PyObject *obj, void *closu { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_msecs; - py_msecs = PyInt_FromLong(object->msecs); + py_msecs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->msecs); return py_msecs; } static int py_srvsvc_NetRemoteTODInfo_set_msecs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->msecs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->msecs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->msecs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->msecs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15811,15 +25303,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_hours(PyObject *obj, void *closu { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_hours; - py_hours = PyInt_FromLong(object->hours); + py_hours = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->hours); return py_hours; } static int py_srvsvc_NetRemoteTODInfo_set_hours(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->hours = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hours)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hours = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hours = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15827,15 +25346,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_mins(PyObject *obj, void *closur { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_mins; - py_mins = PyInt_FromLong(object->mins); + py_mins = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->mins); return py_mins; } static int py_srvsvc_NetRemoteTODInfo_set_mins(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->mins = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->mins)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->mins = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->mins = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15843,15 +25389,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_secs(PyObject *obj, void *closur { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_secs; - py_secs = PyInt_FromLong(object->secs); + py_secs = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->secs); return py_secs; } static int py_srvsvc_NetRemoteTODInfo_set_secs(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->secs = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->secs)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->secs = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->secs = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15859,15 +25432,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_hunds(PyObject *obj, void *closu { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_hunds; - py_hunds = PyInt_FromLong(object->hunds); + py_hunds = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->hunds); return py_hunds; } static int py_srvsvc_NetRemoteTODInfo_set_hunds(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->hunds = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hunds)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hunds = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->hunds = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15882,8 +25482,36 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_timezone(PyObject *obj, void *cl static int py_srvsvc_NetRemoteTODInfo_set_timezone(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->timezone = PyInt_AsLong(value); + { + const long long int_max = ndr_sizeof2intmax(sizeof(object->timezone)); + const long long int_min = -int_max - 1; + if (PyLong_Check(value)) { + long long test_var; + test_var = PyLong_AsLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var < int_min || test_var > int_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var); + return -1; + } + object->timezone = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < int_min || test_var > int_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var); + return -1; + } + object->timezone = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15891,15 +25519,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_tinterval(PyObject *obj, void *c { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_tinterval; - py_tinterval = PyInt_FromLong(object->tinterval); + py_tinterval = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->tinterval); return py_tinterval; } static int py_srvsvc_NetRemoteTODInfo_set_tinterval(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->tinterval = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tinterval)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->tinterval = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->tinterval = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15907,15 +25562,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_day(PyObject *obj, void *closure { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_day; - py_day = PyInt_FromLong(object->day); + py_day = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->day); return py_day; } static int py_srvsvc_NetRemoteTODInfo_set_day(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->day = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->day)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->day = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->day = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15923,15 +25605,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_month(PyObject *obj, void *closu { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_month; - py_month = PyInt_FromLong(object->month); + py_month = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->month); return py_month; } static int py_srvsvc_NetRemoteTODInfo_set_month(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->month = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->month)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->month = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->month = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15939,15 +25648,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_year(PyObject *obj, void *closur { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_year; - py_year = PyInt_FromLong(object->year); + py_year = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->year); return py_year; } static int py_srvsvc_NetRemoteTODInfo_set_year(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->year = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->year)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->year = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->year = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15955,15 +25691,42 @@ static PyObject *py_srvsvc_NetRemoteTODInfo_get_weekday(PyObject *obj, void *clo { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(obj); PyObject *py_weekday; - py_weekday = PyInt_FromLong(object->weekday); + py_weekday = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->weekday); return py_weekday; } static int py_srvsvc_NetRemoteTODInfo_set_weekday(PyObject *py_obj, PyObject *value, void *closure) { struct srvsvc_NetRemoteTODInfo *object = (struct srvsvc_NetRemoteTODInfo *)pytalloc_get_ptr(py_obj); - PY_CHECK_TYPE(&PyInt_Type, value, return -1;); - object->weekday = PyInt_AsLong(value); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->weekday)); + if (PyLong_Check(value)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred() != NULL) { + return -1; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->weekday = test_var; + } else if (PyInt_Check(value)) { + long test_var; + test_var = PyInt_AsLong(value); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return -1; + } + object->weekday = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return -1; + } + } return 0; } @@ -15999,7 +25762,7 @@ static PyTypeObject srvsvc_NetRemoteTODInfo_Type = { .tp_new = py_srvsvc_NetRemoteTODInfo_new, }; -static PyObject *py_import_srvsvc_NetTransportInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetTransportInfo *in) +PyObject *py_import_srvsvc_NetTransportInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetTransportInfo *in) { PyObject *ret; @@ -16025,7 +25788,7 @@ static PyObject *py_import_srvsvc_NetTransportInfo(TALLOC_CTX *mem_ctx, int leve return NULL; } -static union srvsvc_NetTransportInfo *py_export_srvsvc_NetTransportInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) +union srvsvc_NetTransportInfo *py_export_srvsvc_NetTransportInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union srvsvc_NetTransportInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetTransportInfo); switch (level) { @@ -16109,14 +25872,68 @@ static bool pack_py_srvsvc_NetCharDevEnum_args_in(PyObject *args, PyObject *kwar return false; } r->in.info_ctr = (struct srvsvc_NetCharDevInfoCtr *)pytalloc_get_ptr(py_info_ctr); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -16130,13 +25947,13 @@ static PyObject *unpack_py_srvsvc_NetCharDevEnum_args_out(struct srvsvc_NetCharD result = PyTuple_New(3); py_info_ctr = pytalloc_reference_ex(&srvsvc_NetCharDevInfoCtr_Type, r->out.info_ctr, r->out.info_ctr); PyTuple_SetItem(result, 0, py_info_ctr); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -16181,8 +25998,35 @@ static bool pack_py_srvsvc_NetCharDevGetInfo_args_in(PyObject *args, PyObject *k PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_device_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -16237,8 +26081,35 @@ static bool pack_py_srvsvc_NetCharDevControl_args_in(PyObject *args, PyObject *k PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_device_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_opcode, return false;); - r->in.opcode = PyInt_AsLong(py_opcode); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.opcode)); + if (PyLong_Check(py_opcode)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_opcode); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.opcode = test_var; + } else if (PyInt_Check(py_opcode)) { + long test_var; + test_var = PyInt_AsLong(py_opcode); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.opcode = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -16303,14 +26174,68 @@ static bool pack_py_srvsvc_NetCharDevQEnum_args_in(PyObject *args, PyObject *kwa return false; } r->in.info_ctr = (struct srvsvc_NetCharDevQInfoCtr *)pytalloc_get_ptr(py_info_ctr); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -16324,13 +26249,13 @@ static PyObject *unpack_py_srvsvc_NetCharDevQEnum_args_out(struct srvsvc_NetChar result = PyTuple_New(3); py_info_ctr = pytalloc_reference_ex(&srvsvc_NetCharDevQInfoCtr_Type, r->out.info_ctr, r->out.info_ctr); PyTuple_SetItem(result, 0, py_info_ctr); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -16384,8 +26309,35 @@ static bool pack_py_srvsvc_NetCharDevQGetInfo_args_in(PyObject *args, PyObject * PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -16442,8 +26394,35 @@ static bool pack_py_srvsvc_NetCharDevQSetInfo_args_in(PyObject *args, PyObject * PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_queue_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } { union srvsvc_NetCharDevQInfo *info_switch_0; info_switch_0 = py_export_srvsvc_NetCharDevQInfo(r, r->in.level, py_info); @@ -16456,8 +26435,35 @@ static bool pack_py_srvsvc_NetCharDevQSetInfo_args_in(PyObject *args, PyObject * r->in.parm_error = NULL; } else { r->in.parm_error = talloc_ptrtype(r, r->in.parm_error); - PY_CHECK_TYPE(&PyInt_Type, py_parm_error, return false;); - *r->in.parm_error = PyInt_AsLong(py_parm_error); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.parm_error)); + if (PyLong_Check(py_parm_error)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_parm_error); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else if (PyInt_Check(py_parm_error)) { + long test_var; + test_var = PyInt_AsLong(py_parm_error); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -16470,7 +26476,7 @@ static PyObject *unpack_py_srvsvc_NetCharDevQSetInfo_args_out(struct srvsvc_NetC py_parm_error = Py_None; Py_INCREF(py_parm_error); } else { - py_parm_error = PyInt_FromLong(*r->out.parm_error); + py_parm_error = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.parm_error); } result = py_parm_error; if (!W_ERROR_IS_OK(r->out.result)) { @@ -16636,14 +26642,68 @@ static bool pack_py_srvsvc_NetConnEnum_args_in(PyObject *args, PyObject *kwargs, return false; } r->in.info_ctr = (struct srvsvc_NetConnInfoCtr *)pytalloc_get_ptr(py_info_ctr); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -16657,13 +26717,13 @@ static PyObject *unpack_py_srvsvc_NetConnEnum_args_out(struct srvsvc_NetConnEnum result = PyTuple_New(3); py_info_ctr = pytalloc_reference_ex(&srvsvc_NetConnInfoCtr_Type, r->out.info_ctr, r->out.info_ctr); PyTuple_SetItem(result, 0, py_info_ctr); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -16736,14 +26796,68 @@ static bool pack_py_srvsvc_NetFileEnum_args_in(PyObject *args, PyObject *kwargs, return false; } r->in.info_ctr = (struct srvsvc_NetFileInfoCtr *)pytalloc_get_ptr(py_info_ctr); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -16757,13 +26871,13 @@ static PyObject *unpack_py_srvsvc_NetFileEnum_args_out(struct srvsvc_NetFileEnum result = PyTuple_New(3); py_info_ctr = pytalloc_reference_ex(&srvsvc_NetFileInfoCtr_Type, r->out.info_ctr, r->out.info_ctr); PyTuple_SetItem(result, 0, py_info_ctr); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -16800,10 +26914,64 @@ static bool pack_py_srvsvc_NetFileGetInfo_args_in(PyObject *args, PyObject *kwar return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_fid, return false;); - r->in.fid = PyInt_AsLong(py_fid); - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.fid)); + if (PyLong_Check(py_fid)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_fid); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.fid = test_var; + } else if (PyInt_Check(py_fid)) { + long test_var; + test_var = PyInt_AsLong(py_fid); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.fid = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -16849,8 +27017,35 @@ static bool pack_py_srvsvc_NetFileClose_args_in(PyObject *args, PyObject *kwargs return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_fid, return false;); - r->in.fid = PyInt_AsLong(py_fid); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.fid)); + if (PyLong_Check(py_fid)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_fid); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.fid = test_var; + } else if (PyInt_Check(py_fid)) { + long test_var; + test_var = PyInt_AsLong(py_fid); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.fid = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -16929,14 +27124,68 @@ static bool pack_py_srvsvc_NetSessEnum_args_in(PyObject *args, PyObject *kwargs, return false; } r->in.info_ctr = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(py_info_ctr); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -16950,13 +27199,13 @@ static PyObject *unpack_py_srvsvc_NetSessEnum_args_out(struct srvsvc_NetSessEnum result = PyTuple_New(3); py_info_ctr = pytalloc_reference_ex(&srvsvc_NetSessInfoCtr_Type, r->out.info_ctr, r->out.info_ctr); PyTuple_SetItem(result, 0, py_info_ctr); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -17062,8 +27311,35 @@ static bool pack_py_srvsvc_NetShareAdd_args_in(PyObject *args, PyObject *kwargs, return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } r->in.info = talloc_ptrtype(r, r->in.info); { union srvsvc_NetShareInfo *info_switch_1; @@ -17077,8 +27353,35 @@ static bool pack_py_srvsvc_NetShareAdd_args_in(PyObject *args, PyObject *kwargs, r->in.parm_error = NULL; } else { r->in.parm_error = talloc_ptrtype(r, r->in.parm_error); - PY_CHECK_TYPE(&PyInt_Type, py_parm_error, return false;); - *r->in.parm_error = PyInt_AsLong(py_parm_error); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.parm_error)); + if (PyLong_Check(py_parm_error)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_parm_error); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else if (PyInt_Check(py_parm_error)) { + long test_var; + test_var = PyInt_AsLong(py_parm_error); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -17091,7 +27394,7 @@ static PyObject *unpack_py_srvsvc_NetShareAdd_args_out(struct srvsvc_NetShareAdd py_parm_error = Py_None; Py_INCREF(py_parm_error); } else { - py_parm_error = PyInt_FromLong(*r->out.parm_error); + py_parm_error = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.parm_error); } result = py_parm_error; if (!W_ERROR_IS_OK(r->out.result)) { @@ -17136,14 +27439,68 @@ static bool pack_py_srvsvc_NetShareEnumAll_args_in(PyObject *args, PyObject *kwa return false; } r->in.info_ctr = (struct srvsvc_NetShareInfoCtr *)pytalloc_get_ptr(py_info_ctr); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -17157,13 +27514,13 @@ static PyObject *unpack_py_srvsvc_NetShareEnumAll_args_out(struct srvsvc_NetShar result = PyTuple_New(3); py_info_ctr = pytalloc_reference_ex(&srvsvc_NetShareInfoCtr_Type, r->out.info_ctr, r->out.info_ctr); PyTuple_SetItem(result, 0, py_info_ctr); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -17208,8 +27565,35 @@ static bool pack_py_srvsvc_NetShareGetInfo_args_in(PyObject *args, PyObject *kwa PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -17266,8 +27650,35 @@ static bool pack_py_srvsvc_NetShareSetInfo_args_in(PyObject *args, PyObject *kwa PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } r->in.info = talloc_ptrtype(r, r->in.info); { union srvsvc_NetShareInfo *info_switch_1; @@ -17281,8 +27692,35 @@ static bool pack_py_srvsvc_NetShareSetInfo_args_in(PyObject *args, PyObject *kwa r->in.parm_error = NULL; } else { r->in.parm_error = talloc_ptrtype(r, r->in.parm_error); - PY_CHECK_TYPE(&PyInt_Type, py_parm_error, return false;); - *r->in.parm_error = PyInt_AsLong(py_parm_error); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.parm_error)); + if (PyLong_Check(py_parm_error)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_parm_error); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else if (PyInt_Check(py_parm_error)) { + long test_var; + test_var = PyInt_AsLong(py_parm_error); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -17295,7 +27733,7 @@ static PyObject *unpack_py_srvsvc_NetShareSetInfo_args_out(struct srvsvc_NetShar py_parm_error = Py_None; Py_INCREF(py_parm_error); } else { - py_parm_error = PyInt_FromLong(*r->out.parm_error); + py_parm_error = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.parm_error); } result = py_parm_error; if (!W_ERROR_IS_OK(r->out.result)) { @@ -17340,8 +27778,35 @@ static bool pack_py_srvsvc_NetShareDel_args_in(PyObject *args, PyObject *kwargs, PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_reserved, return false;); - r->in.reserved = PyInt_AsLong(py_reserved); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.reserved)); + if (PyLong_Check(py_reserved)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_reserved); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.reserved = test_var; + } else if (PyInt_Check(py_reserved)) { + long test_var; + test_var = PyInt_AsLong(py_reserved); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.reserved = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -17392,8 +27857,35 @@ static bool pack_py_srvsvc_NetShareDelSticky_args_in(PyObject *args, PyObject *k PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_reserved, return false;); - r->in.reserved = PyInt_AsLong(py_reserved); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.reserved)); + if (PyLong_Check(py_reserved)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_reserved); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.reserved = test_var; + } else if (PyInt_Check(py_reserved)) { + long test_var; + test_var = PyInt_AsLong(py_reserved); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.reserved = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -17450,7 +27942,7 @@ static PyObject *unpack_py_srvsvc_NetShareCheck_args_out(struct srvsvc_NetShareC { PyObject *result; PyObject *py_type; - py_type = PyInt_FromLong(*r->out.type); + py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.type); result = py_type; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); @@ -17485,8 +27977,35 @@ static bool pack_py_srvsvc_NetSrvGetInfo_args_in(PyObject *args, PyObject *kwarg return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -17534,8 +28053,35 @@ static bool pack_py_srvsvc_NetSrvSetInfo_args_in(PyObject *args, PyObject *kwarg return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } r->in.info = talloc_ptrtype(r, r->in.info); { union srvsvc_NetSrvInfo *info_switch_1; @@ -17549,8 +28095,35 @@ static bool pack_py_srvsvc_NetSrvSetInfo_args_in(PyObject *args, PyObject *kwarg r->in.parm_error = NULL; } else { r->in.parm_error = talloc_ptrtype(r, r->in.parm_error); - PY_CHECK_TYPE(&PyInt_Type, py_parm_error, return false;); - *r->in.parm_error = PyInt_AsLong(py_parm_error); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.parm_error)); + if (PyLong_Check(py_parm_error)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_parm_error); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else if (PyInt_Check(py_parm_error)) { + long test_var; + test_var = PyInt_AsLong(py_parm_error); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.parm_error = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -17563,7 +28136,7 @@ static PyObject *unpack_py_srvsvc_NetSrvSetInfo_args_out(struct srvsvc_NetSrvSet py_parm_error = Py_None; Py_INCREF(py_parm_error); } else { - py_parm_error = PyInt_FromLong(*r->out.parm_error); + py_parm_error = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.parm_error); } result = py_parm_error; if (!W_ERROR_IS_OK(r->out.result)) { @@ -17602,8 +28175,35 @@ static bool pack_py_srvsvc_NetDiskEnum_args_in(PyObject *args, PyObject *kwargs, return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } r->in.info = talloc_ptrtype(r, r->in.info); PY_CHECK_TYPE(&srvsvc_NetDiskInfo_Type, py_info, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) { @@ -17611,14 +28211,68 @@ static bool pack_py_srvsvc_NetDiskEnum_args_in(PyObject *args, PyObject *kwargs, return false; } r->in.info = (struct srvsvc_NetDiskInfo *)pytalloc_get_ptr(py_info); - PY_CHECK_TYPE(&PyInt_Type, py_maxlen, return false;); - r->in.maxlen = PyInt_AsLong(py_maxlen); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.maxlen)); + if (PyLong_Check(py_maxlen)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_maxlen); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.maxlen = test_var; + } else if (PyInt_Check(py_maxlen)) { + long test_var; + test_var = PyInt_AsLong(py_maxlen); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.maxlen = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -17632,13 +28286,13 @@ static PyObject *unpack_py_srvsvc_NetDiskEnum_args_out(struct srvsvc_NetDiskEnum result = PyTuple_New(3); py_info = pytalloc_reference_ex(&srvsvc_NetDiskInfo_Type, r->out.info, r->out.info); PyTuple_SetItem(result, 0, py_info); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -17689,10 +28343,64 @@ static bool pack_py_srvsvc_NetServerStatisticsGet_args_in(PyObject *args, PyObje return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); - PY_CHECK_TYPE(&PyInt_Type, py_options, return false;); - r->in.options = PyInt_AsLong(py_options); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.options)); + if (PyLong_Check(py_options)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_options); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.options = test_var; + } else if (PyInt_Check(py_options)) { + long test_var; + test_var = PyInt_AsLong(py_options); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.options = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -17741,8 +28449,35 @@ static bool pack_py_srvsvc_NetTransportAdd_args_in(PyObject *args, PyObject *kwa return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } { union srvsvc_NetTransportInfo *info_switch_0; info_switch_0 = py_export_srvsvc_NetTransportInfo(r, r->in.level, py_info); @@ -17801,14 +28536,68 @@ static bool pack_py_srvsvc_NetTransportEnum_args_in(PyObject *args, PyObject *kw return false; } r->in.transports = (struct srvsvc_NetTransportInfoCtr *)pytalloc_get_ptr(py_transports); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -17822,13 +28611,13 @@ static PyObject *unpack_py_srvsvc_NetTransportEnum_args_out(struct srvsvc_NetTra result = PyTuple_New(3); py_transports = pytalloc_reference_ex(&srvsvc_NetTransportInfoCtr_Type, r->out.transports, r->out.transports); PyTuple_SetItem(result, 0, py_transports); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -17865,8 +28654,35 @@ static bool pack_py_srvsvc_NetTransportDel_args_in(PyObject *args, PyObject *kwa return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } r->in.info0 = talloc_ptrtype(r, r->in.info0); PY_CHECK_TYPE(&srvsvc_NetTransportInfo0_Type, py_info0, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_info0)) == NULL) { @@ -17976,10 +28792,64 @@ static bool pack_py_srvsvc_NetSetServiceBits_args_in(PyObject *args, PyObject *k return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_servicebits, return false;); - r->in.servicebits = PyInt_AsLong(py_servicebits); - PY_CHECK_TYPE(&PyInt_Type, py_updateimmediately, return false;); - r->in.updateimmediately = PyInt_AsLong(py_updateimmediately); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.servicebits)); + if (PyLong_Check(py_servicebits)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_servicebits); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.servicebits = test_var; + } else if (PyInt_Check(py_servicebits)) { + long test_var; + test_var = PyInt_AsLong(py_servicebits); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.servicebits = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.updateimmediately)); + if (PyLong_Check(py_updateimmediately)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_updateimmediately); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.updateimmediately = test_var; + } else if (PyInt_Check(py_updateimmediately)) { + long test_var; + test_var = PyInt_AsLong(py_updateimmediately); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.updateimmediately = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -18030,8 +28900,35 @@ static bool pack_py_srvsvc_NetPathType_args_in(PyObject *args, PyObject *kwargs, PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_path)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_pathflags, return false;); - r->in.pathflags = PyInt_AsLong(py_pathflags); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.pathflags)); + if (PyLong_Check(py_pathflags)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_pathflags); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathflags = test_var; + } else if (PyInt_Check(py_pathflags)) { + long test_var; + test_var = PyInt_AsLong(py_pathflags); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathflags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -18039,7 +28936,7 @@ static PyObject *unpack_py_srvsvc_NetPathType_args_out(struct srvsvc_NetPathType { PyObject *result; PyObject *py_pathtype; - py_pathtype = PyInt_FromLong(*r->out.pathtype); + py_pathtype = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.pathtype); result = py_pathtype; if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); @@ -18086,8 +28983,35 @@ static bool pack_py_srvsvc_NetPathCanonicalize_args_in(PyObject *args, PyObject PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_path)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_maxbuf, return false;); - r->in.maxbuf = PyInt_AsLong(py_maxbuf); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.maxbuf)); + if (PyLong_Check(py_maxbuf)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_maxbuf); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.maxbuf = test_var; + } else if (PyInt_Check(py_maxbuf)) { + long test_var; + test_var = PyInt_AsLong(py_maxbuf); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.maxbuf = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (PyUnicode_Check(py_prefix)) { r->in.prefix = PyString_AS_STRING(PyUnicode_AsEncodedString(py_prefix, "utf-8", "ignore")); } else if (PyString_Check(py_prefix)) { @@ -18097,10 +29021,64 @@ static bool pack_py_srvsvc_NetPathCanonicalize_args_in(PyObject *args, PyObject return false; } r->in.pathtype = talloc_ptrtype(r, r->in.pathtype); - PY_CHECK_TYPE(&PyInt_Type, py_pathtype, return false;); - *r->in.pathtype = PyInt_AsLong(py_pathtype); - PY_CHECK_TYPE(&PyInt_Type, py_pathflags, return false;); - r->in.pathflags = PyInt_AsLong(py_pathflags); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.pathtype)); + if (PyLong_Check(py_pathtype)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_pathtype); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.pathtype = test_var; + } else if (PyInt_Check(py_pathtype)) { + long test_var; + test_var = PyInt_AsLong(py_pathtype); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.pathtype = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.pathflags)); + if (PyLong_Check(py_pathflags)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_pathflags); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathflags = test_var; + } else if (PyInt_Check(py_pathflags)) { + long test_var; + test_var = PyInt_AsLong(py_pathflags); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathflags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -18116,14 +29094,14 @@ static PyObject *unpack_py_srvsvc_NetPathCanonicalize_args_out(struct srvsvc_Net } { int can_path_cntr_0; - for (can_path_cntr_0 = 0; can_path_cntr_0 < r->in.maxbuf; can_path_cntr_0++) { + for (can_path_cntr_0 = 0; can_path_cntr_0 < (r->in.maxbuf); can_path_cntr_0++) { PyObject *py_can_path_0; - py_can_path_0 = PyInt_FromLong(r->out.can_path[can_path_cntr_0]); + py_can_path_0 = PyInt_FromLong((uint16_t)r->out.can_path[can_path_cntr_0]); PyList_SetItem(py_can_path, can_path_cntr_0, py_can_path_0); } } PyTuple_SetItem(result, 0, py_can_path); - py_pathtype = PyInt_FromLong(*r->out.pathtype); + py_pathtype = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.pathtype); PyTuple_SetItem(result, 1, py_pathtype); if (!W_ERROR_IS_OK(r->out.result)) { PyErr_SetWERROR(r->out.result); @@ -18177,10 +29155,64 @@ static bool pack_py_srvsvc_NetPathCompare_args_in(PyObject *args, PyObject *kwar PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_path2)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_pathtype, return false;); - r->in.pathtype = PyInt_AsLong(py_pathtype); - PY_CHECK_TYPE(&PyInt_Type, py_pathflags, return false;); - r->in.pathflags = PyInt_AsLong(py_pathflags); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.pathtype)); + if (PyLong_Check(py_pathtype)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_pathtype); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathtype = test_var; + } else if (PyInt_Check(py_pathtype)) { + long test_var; + test_var = PyInt_AsLong(py_pathtype); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathtype = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.pathflags)); + if (PyLong_Check(py_pathflags)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_pathflags); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathflags = test_var; + } else if (PyInt_Check(py_pathflags)) { + long test_var; + test_var = PyInt_AsLong(py_pathflags); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.pathflags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -18232,10 +29264,64 @@ static bool pack_py_srvsvc_NetNameValidate_args_in(PyObject *args, PyObject *kwa PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_name)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_name_type, return false;); - r->in.name_type = PyInt_AsLong(py_name_type); - PY_CHECK_TYPE(&PyInt_Type, py_flags, return false;); - r->in.flags = PyInt_AsLong(py_flags); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.name_type)); + if (PyLong_Check(py_name_type)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_name_type); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.name_type = test_var; + } else if (PyInt_Check(py_name_type)) { + long test_var; + test_var = PyInt_AsLong(py_name_type); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.name_type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags)); + if (PyLong_Check(py_flags)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_flags); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.flags = test_var; + } else if (PyInt_Check(py_flags)) { + long test_var; + test_var = PyInt_AsLong(py_flags); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.flags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -18296,10 +29382,64 @@ static bool pack_py_srvsvc_NetPRNameCompare_args_in(PyObject *args, PyObject *kw PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_name2)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_name_type, return false;); - r->in.name_type = PyInt_AsLong(py_name_type); - PY_CHECK_TYPE(&PyInt_Type, py_flags, return false;); - r->in.flags = PyInt_AsLong(py_flags); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.name_type)); + if (PyLong_Check(py_name_type)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_name_type); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.name_type = test_var; + } else if (PyInt_Check(py_name_type)) { + long test_var; + test_var = PyInt_AsLong(py_name_type); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.name_type = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags)); + if (PyLong_Check(py_flags)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_flags); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.flags = test_var; + } else if (PyInt_Check(py_flags)) { + long test_var; + test_var = PyInt_AsLong(py_flags); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.flags = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -18350,14 +29490,68 @@ static bool pack_py_srvsvc_NetShareEnum_args_in(PyObject *args, PyObject *kwargs return false; } r->in.info_ctr = (struct srvsvc_NetShareInfoCtr *)pytalloc_get_ptr(py_info_ctr); - PY_CHECK_TYPE(&PyInt_Type, py_max_buffer, return false;); - r->in.max_buffer = PyInt_AsLong(py_max_buffer); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_buffer)); + if (PyLong_Check(py_max_buffer)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_max_buffer); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else if (PyInt_Check(py_max_buffer)) { + long test_var; + test_var = PyInt_AsLong(py_max_buffer); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.max_buffer = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } if (py_resume_handle == Py_None) { r->in.resume_handle = NULL; } else { r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); - PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;); - *r->in.resume_handle = PyInt_AsLong(py_resume_handle); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); + if (PyLong_Check(py_resume_handle)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_resume_handle); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else if (PyInt_Check(py_resume_handle)) { + long test_var; + test_var = PyInt_AsLong(py_resume_handle); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + *r->in.resume_handle = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } } return true; } @@ -18371,13 +29565,13 @@ static PyObject *unpack_py_srvsvc_NetShareEnum_args_out(struct srvsvc_NetShareEn result = PyTuple_New(3); py_info_ctr = pytalloc_reference_ex(&srvsvc_NetShareInfoCtr_Type, r->out.info_ctr, r->out.info_ctr); PyTuple_SetItem(result, 0, py_info_ctr); - py_totalentries = PyInt_FromLong(*r->out.totalentries); + py_totalentries = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.totalentries); PyTuple_SetItem(result, 1, py_totalentries); if (r->out.resume_handle == NULL) { py_resume_handle = Py_None; Py_INCREF(py_resume_handle); } else { - py_resume_handle = PyInt_FromLong(*r->out.resume_handle); + py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); } PyTuple_SetItem(result, 2, py_resume_handle); if (!W_ERROR_IS_OK(r->out.result)) { @@ -18422,8 +29616,35 @@ static bool pack_py_srvsvc_NetShareDelStart_args_in(PyObject *args, PyObject *kw PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share)->tp_name); return false; } - PY_CHECK_TYPE(&PyInt_Type, py_reserved, return false;); - r->in.reserved = PyInt_AsLong(py_reserved); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.reserved)); + if (PyLong_Check(py_reserved)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_reserved); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.reserved = test_var; + } else if (PyInt_Check(py_reserved)) { + long test_var; + test_var = PyInt_AsLong(py_reserved); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.reserved = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -18538,14 +29759,34 @@ static bool pack_py_srvsvc_NetGetFileSecurity_args_in(PyObject *args, PyObject * PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_file)->tp_name); return false; } - if (PyLong_Check(py_securityinformation)) { - r->in.securityinformation = PyLong_AsLongLong(py_securityinformation); - } else if (PyInt_Check(py_securityinformation)) { - r->in.securityinformation = PyInt_AsLong(py_securityinformation); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return false; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.securityinformation)); + if (PyLong_Check(py_securityinformation)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_securityinformation); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.securityinformation = test_var; + } else if (PyInt_Check(py_securityinformation)) { + long test_var; + test_var = PyInt_AsLong(py_securityinformation); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.securityinformation = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } } return true; } @@ -18618,14 +29859,34 @@ static bool pack_py_srvsvc_NetSetFileSecurity_args_in(PyObject *args, PyObject * PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_file)->tp_name); return false; } - if (PyLong_Check(py_securityinformation)) { - r->in.securityinformation = PyLong_AsLongLong(py_securityinformation); - } else if (PyInt_Check(py_securityinformation)) { - r->in.securityinformation = PyInt_AsLong(py_securityinformation); - } else { - PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ - PyInt_Type.tp_name, PyLong_Type.tp_name); - return false; + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.securityinformation)); + if (PyLong_Check(py_securityinformation)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_securityinformation); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.securityinformation = test_var; + } else if (PyInt_Check(py_securityinformation)) { + long test_var; + test_var = PyInt_AsLong(py_securityinformation); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.securityinformation = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } } r->in.sd_buf = talloc_ptrtype(r, r->in.sd_buf); PY_CHECK_TYPE(sec_desc_buf_Type, py_sd_buf, return false;); @@ -18676,8 +29937,35 @@ static bool pack_py_srvsvc_NetServerTransportAddEx_args_in(PyObject *args, PyObj return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_level, return false;); - r->in.level = PyInt_AsLong(py_level); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level)); + if (PyLong_Check(py_level)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_level); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else if (PyInt_Check(py_level)) { + long test_var; + test_var = PyInt_AsLong(py_level); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.level = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } { union srvsvc_NetTransportInfo *info_switch_0; info_switch_0 = py_export_srvsvc_NetTransportInfo(r, r->in.level, py_info); @@ -18757,12 +30045,93 @@ static bool pack_py_srvsvc_NetServerSetServiceBitsEx_args_in(PyObject *args, PyO return false; } } - PY_CHECK_TYPE(&PyInt_Type, py_servicebitsofinterest, return false;); - r->in.servicebitsofinterest = PyInt_AsLong(py_servicebitsofinterest); - PY_CHECK_TYPE(&PyInt_Type, py_servicebits, return false;); - r->in.servicebits = PyInt_AsLong(py_servicebits); - PY_CHECK_TYPE(&PyInt_Type, py_updateimmediately, return false;); - r->in.updateimmediately = PyInt_AsLong(py_updateimmediately); + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.servicebitsofinterest)); + if (PyLong_Check(py_servicebitsofinterest)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_servicebitsofinterest); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.servicebitsofinterest = test_var; + } else if (PyInt_Check(py_servicebitsofinterest)) { + long test_var; + test_var = PyInt_AsLong(py_servicebitsofinterest); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.servicebitsofinterest = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.servicebits)); + if (PyLong_Check(py_servicebits)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_servicebits); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.servicebits = test_var; + } else if (PyInt_Check(py_servicebits)) { + long test_var; + test_var = PyInt_AsLong(py_servicebits); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.servicebits = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } + { + const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.updateimmediately)); + if (PyLong_Check(py_updateimmediately)) { + unsigned long long test_var; + test_var = PyLong_AsUnsignedLongLong(py_updateimmediately); + if (PyErr_Occurred() != NULL) { + return false; + } + if (test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.updateimmediately = test_var; + } else if (PyInt_Check(py_updateimmediately)) { + long test_var; + test_var = PyInt_AsLong(py_updateimmediately); + if (test_var < 0 || test_var > uint_max) { + PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\ + PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var); + return false; + } + r->in.updateimmediately = test_var; + } else { + PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\ + PyInt_Type.tp_name, PyLong_Type.tp_name); + return false; + } + } return true; } @@ -19795,41 +31164,50 @@ void initsrvsvc(void) if (m == NULL) return; - PyModule_AddObject(m, "STYPE_TEMPORARY", PyInt_FromLong(0x40000000)); - PyModule_AddObject(m, "STYPE_HIDDEN", PyInt_FromLong(0x80000000)); - PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_MANUAL_REINT", PyInt_FromLong(0x00000000)); - PyModule_AddObject(m, "SHARE_1005_CSC_POLICY_MASK", PyInt_FromLong(0x00000030)); - PyModule_AddObject(m, "SHARE_1005_CSC_POLICY_SHIFT", PyInt_FromLong(4)); - PyModule_AddObject(m, "STYPE_DISKTREE", PyInt_FromLong(STYPE_DISKTREE)); - PyModule_AddObject(m, "STYPE_DISKTREE_TEMPORARY", PyInt_FromLong(STYPE_DISKTREE_TEMPORARY)); - PyModule_AddObject(m, "STYPE_DISKTREE_HIDDEN", PyInt_FromLong(STYPE_DISKTREE_HIDDEN)); - PyModule_AddObject(m, "STYPE_PRINTQ", PyInt_FromLong(STYPE_PRINTQ)); - PyModule_AddObject(m, "STYPE_PRINTQ_TEMPORARY", PyInt_FromLong(STYPE_PRINTQ_TEMPORARY)); - PyModule_AddObject(m, "STYPE_PRINTQ_HIDDEN", PyInt_FromLong(STYPE_PRINTQ_HIDDEN)); - PyModule_AddObject(m, "STYPE_DEVICE", PyInt_FromLong(STYPE_DEVICE)); - PyModule_AddObject(m, "STYPE_DEVICE_TEMPORARY", PyInt_FromLong(STYPE_DEVICE_TEMPORARY)); - PyModule_AddObject(m, "STYPE_DEVICE_HIDDEN", PyInt_FromLong(STYPE_DEVICE_HIDDEN)); - PyModule_AddObject(m, "STYPE_IPC", PyInt_FromLong(STYPE_IPC)); - PyModule_AddObject(m, "STYPE_IPC_TEMPORARY", PyInt_FromLong(STYPE_IPC_TEMPORARY)); - PyModule_AddObject(m, "STYPE_IPC_HIDDEN", PyInt_FromLong(STYPE_IPC_HIDDEN)); - PyModule_AddObject(m, "SHARE_1005_IN_DFS", PyInt_FromLong(SHARE_1005_IN_DFS)); - PyModule_AddObject(m, "SHARE_1005_DFS_ROOT", PyInt_FromLong(SHARE_1005_DFS_ROOT)); - PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_AUTO_REINT", PyInt_FromLong(SHARE_1005_CSC_CACHE_AUTO_REINT)); - PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_VDO", PyInt_FromLong(SHARE_1005_CSC_CACHE_VDO)); - PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_NONE", PyInt_FromLong(SHARE_1005_CSC_CACHE_NONE)); - PyModule_AddObject(m, "SHARE_1005_RESTRICT_EXCLUSIVE_OPENS", PyInt_FromLong(SHARE_1005_RESTRICT_EXCLUSIVE_OPENS)); - PyModule_AddObject(m, "SHARE_1005_FORCE_SHARED_DELETE", PyInt_FromLong(SHARE_1005_FORCE_SHARED_DELETE)); - PyModule_AddObject(m, "SHARE_1005_ALLOW_NAMESPACE_CACHING", PyInt_FromLong(SHARE_1005_ALLOW_NAMESPACE_CACHING)); - PyModule_AddObject(m, "SHARE_1005_ACCESS_BASED_DIRECTORY_ENUM", PyInt_FromLong(SHARE_1005_ACCESS_BASED_DIRECTORY_ENUM)); - PyModule_AddObject(m, "SHARE_1005_FORCE_LEVELII_OPLOCK", PyInt_FromLong(SHARE_1005_FORCE_LEVELII_OPLOCK)); - PyModule_AddObject(m, "SHARE_1005_ENABLE_HASH", PyInt_FromLong(SHARE_1005_ENABLE_HASH)); - PyModule_AddObject(m, "SHARE_1005_ENABLE_CA", PyInt_FromLong(SHARE_1005_ENABLE_CA)); - PyModule_AddObject(m, "SHARE_1005_ENCRYPT_DATA", PyInt_FromLong(SHARE_1005_ENCRYPT_DATA)); - PyModule_AddObject(m, "PLATFORM_ID_DOS", PyInt_FromLong(PLATFORM_ID_DOS)); - PyModule_AddObject(m, "PLATFORM_ID_OS2", PyInt_FromLong(PLATFORM_ID_OS2)); - PyModule_AddObject(m, "PLATFORM_ID_NT", PyInt_FromLong(PLATFORM_ID_NT)); - PyModule_AddObject(m, "PLATFORM_ID_OSF", PyInt_FromLong(PLATFORM_ID_OSF)); - PyModule_AddObject(m, "PLATFORM_ID_VMS", PyInt_FromLong(PLATFORM_ID_VMS)); + PyModule_AddObject(m, "STYPE_TEMPORARY", ndr_PyLong_FromUnsignedLongLong(0x40000000)); + PyModule_AddObject(m, "STYPE_HIDDEN", ndr_PyLong_FromUnsignedLongLong(0x80000000)); + PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_MANUAL_REINT", ndr_PyLong_FromUnsignedLongLong(0x00000000)); + PyModule_AddObject(m, "SHARE_1005_CSC_POLICY_MASK", ndr_PyLong_FromUnsignedLongLong(0x00000030)); + PyModule_AddObject(m, "SHARE_1005_CSC_POLICY_SHIFT", ndr_PyLong_FromUnsignedLongLong(4)); + PyModule_AddObject(m, "STYPE_DISKTREE", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_DISKTREE)); + PyModule_AddObject(m, "STYPE_DISKTREE_TEMPORARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_DISKTREE_TEMPORARY)); + PyModule_AddObject(m, "STYPE_DISKTREE_HIDDEN", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_DISKTREE_HIDDEN)); + PyModule_AddObject(m, "STYPE_PRINTQ", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_PRINTQ)); + PyModule_AddObject(m, "STYPE_PRINTQ_TEMPORARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_PRINTQ_TEMPORARY)); + PyModule_AddObject(m, "STYPE_PRINTQ_HIDDEN", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_PRINTQ_HIDDEN)); + PyModule_AddObject(m, "STYPE_DEVICE", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_DEVICE)); + PyModule_AddObject(m, "STYPE_DEVICE_TEMPORARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_DEVICE_TEMPORARY)); + PyModule_AddObject(m, "STYPE_DEVICE_HIDDEN", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_DEVICE_HIDDEN)); + PyModule_AddObject(m, "STYPE_IPC", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_IPC)); + PyModule_AddObject(m, "STYPE_IPC_TEMPORARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_IPC_TEMPORARY)); + PyModule_AddObject(m, "STYPE_IPC_HIDDEN", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_IPC_HIDDEN)); + PyModule_AddObject(m, "STYPE_CLUSTER_FS", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_FS)); + PyModule_AddObject(m, "STYPE_CLUSTER_FS_TEMPORARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_FS_TEMPORARY)); + PyModule_AddObject(m, "STYPE_CLUSTER_FS_HIDDEN", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_FS_HIDDEN)); + PyModule_AddObject(m, "STYPE_CLUSTER_SOFS", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_SOFS)); + PyModule_AddObject(m, "STYPE_CLUSTER_SOFS_TEMPORARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_SOFS_TEMPORARY)); + PyModule_AddObject(m, "STYPE_CLUSTER_SOFS_HIDDEN", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_SOFS_HIDDEN)); + PyModule_AddObject(m, "STYPE_CLUSTER_DFS", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_DFS)); + PyModule_AddObject(m, "STYPE_CLUSTER_DFS_TEMPORARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_DFS_TEMPORARY)); + PyModule_AddObject(m, "STYPE_CLUSTER_DFS_HIDDEN", ndr_PyLong_FromUnsignedLongLong((uint32_t)STYPE_CLUSTER_DFS_HIDDEN)); + PyModule_AddObject(m, "SHARE_1005_IN_DFS", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_IN_DFS)); + PyModule_AddObject(m, "SHARE_1005_DFS_ROOT", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_DFS_ROOT)); + PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_AUTO_REINT", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_CSC_CACHE_AUTO_REINT)); + PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_VDO", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_CSC_CACHE_VDO)); + PyModule_AddObject(m, "SHARE_1005_CSC_CACHE_NONE", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_CSC_CACHE_NONE)); + PyModule_AddObject(m, "SHARE_1005_RESTRICT_EXCLUSIVE_OPENS", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_RESTRICT_EXCLUSIVE_OPENS)); + PyModule_AddObject(m, "SHARE_1005_FORCE_SHARED_DELETE", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_FORCE_SHARED_DELETE)); + PyModule_AddObject(m, "SHARE_1005_ALLOW_NAMESPACE_CACHING", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_ALLOW_NAMESPACE_CACHING)); + PyModule_AddObject(m, "SHARE_1005_ACCESS_BASED_DIRECTORY_ENUM", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_ACCESS_BASED_DIRECTORY_ENUM)); + PyModule_AddObject(m, "SHARE_1005_FORCE_LEVELII_OPLOCK", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_FORCE_LEVELII_OPLOCK)); + PyModule_AddObject(m, "SHARE_1005_ENABLE_HASH", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_ENABLE_HASH)); + PyModule_AddObject(m, "SHARE_1005_ENABLE_CA", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_ENABLE_CA)); + PyModule_AddObject(m, "SHARE_1005_ENCRYPT_DATA", ndr_PyLong_FromUnsignedLongLong((uint32_t)SHARE_1005_ENCRYPT_DATA)); + PyModule_AddObject(m, "PLATFORM_ID_DOS", ndr_PyLong_FromUnsignedLongLong((uint32_t)PLATFORM_ID_DOS)); + PyModule_AddObject(m, "PLATFORM_ID_OS2", ndr_PyLong_FromUnsignedLongLong((uint32_t)PLATFORM_ID_OS2)); + PyModule_AddObject(m, "PLATFORM_ID_NT", ndr_PyLong_FromUnsignedLongLong((uint32_t)PLATFORM_ID_NT)); + PyModule_AddObject(m, "PLATFORM_ID_OSF", ndr_PyLong_FromUnsignedLongLong((uint32_t)PLATFORM_ID_OSF)); + PyModule_AddObject(m, "PLATFORM_ID_VMS", ndr_PyLong_FromUnsignedLongLong((uint32_t)PLATFORM_ID_VMS)); Py_INCREF((PyObject *)(void *)&srvsvc_NetCharDevInfo0_Type); PyModule_AddObject(m, "NetCharDevInfo0", (PyObject *)(void *)&srvsvc_NetCharDevInfo0_Type); Py_INCREF((PyObject *)(void *)&srvsvc_NetCharDevCtr0_Type);