LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_mdssvc.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 65 2287 2.8 %
Date: 2021-09-23 10:06:22 Functions: 2 152 1.3 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include <Python.h>
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_mdssvc.h"
      12             : #include "bin/default/librpc/gen_ndr/ndr_mdssvc_c.h"
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32           0 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34           0 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37           0 :         case 4:
      38           0 :                 return UINT32_MAX;
      39           0 :         case 2:
      40           0 :                 return UINT16_MAX;
      41           0 :         case 1:
      42           0 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48             : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50             :         switch (var_size) {
      51             :         case 8:
      52             :                 return INT64_MAX;
      53             :         case 4:
      54             :                 return INT32_MAX;
      55             :         case 2:
      56             :                 return INT16_MAX;
      57             :         case 1:
      58             :                 return INT8_MAX;
      59             :         }
      60             : 
      61             :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/misc.h"
      65             : static PyTypeObject mdssvc_blob_Type;
      66             : static PyTypeObject mdssvc_InterfaceType;
      67             : static PyTypeObject mdssvc_open_Type;
      68             : static PyTypeObject mdssvc_unknown1_Type;
      69             : static PyTypeObject mdssvc_cmd_Type;
      70             : static PyTypeObject mdssvc_close_Type;
      71             : 
      72             : static PyTypeObject *BaseObject_Type;
      73             : static PyTypeObject *policy_handle_Type;
      74             : static PyTypeObject *ClientConnection_Type;
      75             : static PyTypeObject *ndr_syntax_id_Type;
      76             : 
      77           0 : static PyObject *py_mdssvc_blob_get_length(PyObject *obj, void *closure)
      78             : {
      79           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(obj);
      80             :         PyObject *py_length;
      81           0 :         py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
      82           0 :         return py_length;
      83             : }
      84             : 
      85           0 : static int py_mdssvc_blob_set_length(PyObject *py_obj, PyObject *value, void *closure)
      86             : {
      87           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(py_obj);
      88           0 :         if (value == NULL) {
      89           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
      90           0 :                 return -1;
      91             :         }
      92             :         {
      93           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
      94           0 :                 if (PyLong_Check(value)) {
      95             :                         unsigned long long test_var;
      96           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
      97           0 :                         if (PyErr_Occurred() != NULL) {
      98           0 :                                 return -1;
      99             :                         }
     100           0 :                         if (test_var > uint_max) {
     101           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     102             :                                   PyLong_Type.tp_name, uint_max, test_var);
     103           0 :                                 return -1;
     104             :                         }
     105           0 :                         object->length = test_var;
     106             :                 } else {
     107           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     108             :                           PyLong_Type.tp_name);
     109           0 :                         return -1;
     110             :                 }
     111             :         }
     112           0 :         return 0;
     113             : }
     114             : 
     115           0 : static PyObject *py_mdssvc_blob_get_size(PyObject *obj, void *closure)
     116             : {
     117           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(obj);
     118             :         PyObject *py_size;
     119           0 :         py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
     120           0 :         return py_size;
     121             : }
     122             : 
     123           0 : static int py_mdssvc_blob_set_size(PyObject *py_obj, PyObject *value, void *closure)
     124             : {
     125           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(py_obj);
     126           0 :         if (value == NULL) {
     127           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
     128           0 :                 return -1;
     129             :         }
     130             :         {
     131           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
     132           0 :                 if (PyLong_Check(value)) {
     133             :                         unsigned long long test_var;
     134           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     135           0 :                         if (PyErr_Occurred() != NULL) {
     136           0 :                                 return -1;
     137             :                         }
     138           0 :                         if (test_var > uint_max) {
     139           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     140             :                                   PyLong_Type.tp_name, uint_max, test_var);
     141           0 :                                 return -1;
     142             :                         }
     143           0 :                         object->size = test_var;
     144             :                 } else {
     145           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     146             :                           PyLong_Type.tp_name);
     147           0 :                         return -1;
     148             :                 }
     149             :         }
     150           0 :         return 0;
     151             : }
     152             : 
     153           0 : static PyObject *py_mdssvc_blob_get_spotlight_blob(PyObject *obj, void *closure)
     154             : {
     155           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(obj);
     156             :         PyObject *py_spotlight_blob;
     157           0 :         if (object->spotlight_blob == NULL) {
     158           0 :                 Py_RETURN_NONE;
     159             :         }
     160           0 :         if (object->spotlight_blob == NULL) {
     161           0 :                 py_spotlight_blob = Py_None;
     162           0 :                 Py_INCREF(py_spotlight_blob);
     163             :         } else {
     164           0 :                 py_spotlight_blob = PyList_New(object->length);
     165           0 :                 if (py_spotlight_blob == NULL) {
     166           0 :                         return NULL;
     167             :                 }
     168             :                 {
     169             :                         int spotlight_blob_cntr_1;
     170           0 :                         for (spotlight_blob_cntr_1 = 0; spotlight_blob_cntr_1 < (object->length); spotlight_blob_cntr_1++) {
     171             :                                 PyObject *py_spotlight_blob_1;
     172           0 :                                 py_spotlight_blob_1 = PyLong_FromLong((uint16_t)object->spotlight_blob[spotlight_blob_cntr_1]);
     173           0 :                                 PyList_SetItem(py_spotlight_blob, spotlight_blob_cntr_1, py_spotlight_blob_1);
     174             :                         }
     175             :                 }
     176             :         }
     177           0 :         return py_spotlight_blob;
     178             : }
     179             : 
     180           0 : static int py_mdssvc_blob_set_spotlight_blob(PyObject *py_obj, PyObject *value, void *closure)
     181             : {
     182           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(py_obj);
     183           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->spotlight_blob));
     184           0 :         if (value == NULL) {
     185           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->spotlight_blob");
     186           0 :                 return -1;
     187             :         }
     188           0 :         if (value == Py_None) {
     189           0 :                 object->spotlight_blob = NULL;
     190             :         } else {
     191           0 :                 object->spotlight_blob = NULL;
     192           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     193             :                 {
     194             :                         int spotlight_blob_cntr_1;
     195           0 :                         object->spotlight_blob = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->spotlight_blob, PyList_GET_SIZE(value));
     196           0 :                         if (!object->spotlight_blob) { return -1;; }
     197           0 :                         talloc_set_name_const(object->spotlight_blob, "ARRAY: object->spotlight_blob");
     198           0 :                         for (spotlight_blob_cntr_1 = 0; spotlight_blob_cntr_1 < PyList_GET_SIZE(value); spotlight_blob_cntr_1++) {
     199           0 :                                 if (PyList_GET_ITEM(value, spotlight_blob_cntr_1) == NULL) {
     200           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->spotlight_blob[spotlight_blob_cntr_1]");
     201           0 :                                         return -1;
     202             :                                 }
     203             :                                 {
     204           0 :                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->spotlight_blob[spotlight_blob_cntr_1]));
     205           0 :                                         if (PyLong_Check(PyList_GET_ITEM(value, spotlight_blob_cntr_1))) {
     206             :                                                 unsigned long long test_var;
     207           0 :                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, spotlight_blob_cntr_1));
     208           0 :                                                 if (PyErr_Occurred() != NULL) {
     209           0 :                                                         return -1;
     210             :                                                 }
     211           0 :                                                 if (test_var > uint_max) {
     212           0 :                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     213             :                                                           PyLong_Type.tp_name, uint_max, test_var);
     214           0 :                                                         return -1;
     215             :                                                 }
     216           0 :                                                 object->spotlight_blob[spotlight_blob_cntr_1] = test_var;
     217             :                                         } else {
     218           0 :                                                 PyErr_Format(PyExc_TypeError, "Expected type %s",\
     219             :                                                   PyLong_Type.tp_name);
     220           0 :                                                 return -1;
     221             :                                         }
     222             :                                 }
     223             :                         }
     224             :                 }
     225             :         }
     226           0 :         return 0;
     227             : }
     228             : 
     229             : static PyGetSetDef py_mdssvc_blob_getsetters[] = {
     230             :         {
     231             :                 .name = discard_const_p(char, "length"),
     232             :                 .get = py_mdssvc_blob_get_length,
     233             :                 .set = py_mdssvc_blob_set_length,
     234             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     235             :         },
     236             :         {
     237             :                 .name = discard_const_p(char, "size"),
     238             :                 .get = py_mdssvc_blob_get_size,
     239             :                 .set = py_mdssvc_blob_set_size,
     240             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     241             :         },
     242             :         {
     243             :                 .name = discard_const_p(char, "spotlight_blob"),
     244             :                 .get = py_mdssvc_blob_get_spotlight_blob,
     245             :                 .set = py_mdssvc_blob_set_spotlight_blob,
     246             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     247             :         },
     248             :         { .name = NULL }
     249             : };
     250             : 
     251           0 : static PyObject *py_mdssvc_blob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     252             : {
     253           0 :         return pytalloc_new(struct mdssvc_blob, type);
     254             : }
     255             : 
     256           0 : static PyObject *py_mdssvc_blob_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     257             : {
     258           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(py_obj);
     259           0 :         PyObject *ret = NULL;
     260             :         DATA_BLOB blob;
     261             :         enum ndr_err_code err;
     262           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     263           0 :         if (tmp_ctx == NULL) {
     264           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     265           0 :                 return NULL;
     266             :         }
     267           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_mdssvc_blob);
     268           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     269           0 :                 TALLOC_FREE(tmp_ctx);
     270           0 :                 PyErr_SetNdrError(err);
     271           0 :                 return NULL;
     272             :         }
     273             : 
     274           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     275           0 :         TALLOC_FREE(tmp_ctx);
     276           0 :         return ret;
     277             : }
     278             : 
     279           0 : static PyObject *py_mdssvc_blob_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     280             : {
     281           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(py_obj);
     282           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     283           0 :         Py_ssize_t blob_length = 0;
     284             :         enum ndr_err_code err;
     285           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     286           0 :         PyObject *allow_remaining_obj = NULL;
     287           0 :         bool allow_remaining = false;
     288             : 
     289           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     290             :                 discard_const_p(char *, kwnames),
     291             :                 &blob.data, &blob_length,
     292             :                 &allow_remaining_obj)) {
     293           0 :                 return NULL;
     294             :         }
     295           0 :         blob.length = blob_length;
     296             : 
     297           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     298           0 :                 allow_remaining = true;
     299             :         }
     300             : 
     301           0 :         if (allow_remaining) {
     302           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_mdssvc_blob);
     303             :         } else {
     304           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_mdssvc_blob);
     305             :         }
     306           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     307           0 :                 PyErr_SetNdrError(err);
     308           0 :                 return NULL;
     309             :         }
     310             : 
     311           0 :         Py_RETURN_NONE;
     312             : }
     313             : 
     314           0 : static PyObject *py_mdssvc_blob_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     315             : {
     316           0 :         struct mdssvc_blob *object = (struct mdssvc_blob *)pytalloc_get_ptr(py_obj);
     317             :         PyObject *ret;
     318             :         char *retstr;
     319             : 
     320           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_mdssvc_blob, "mdssvc_blob", object);
     321           0 :         ret = PyUnicode_FromString(retstr);
     322           0 :         talloc_free(retstr);
     323             : 
     324           0 :         return ret;
     325             : }
     326             : 
     327             : static PyMethodDef py_mdssvc_blob_methods[] = {
     328             :         { "__ndr_pack__", (PyCFunction)py_mdssvc_blob_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     329             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_blob_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     330             :         { "__ndr_print__", (PyCFunction)py_mdssvc_blob_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     331             :         { NULL, NULL, 0, NULL }
     332             : };
     333             : 
     334             : 
     335             : static PyTypeObject mdssvc_blob_Type = {
     336             :         PyVarObject_HEAD_INIT(NULL, 0)
     337             :         .tp_name = "mdssvc.blob",
     338             :         .tp_getset = py_mdssvc_blob_getsetters,
     339             :         .tp_methods = py_mdssvc_blob_methods,
     340             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     341             :         .tp_new = py_mdssvc_blob_new,
     342             : };
     343             : 
     344             : 
     345             : 
     346           0 : static PyObject *py_mdssvc_open_in_get_device_id(PyObject *obj, void *closure)
     347             : {
     348           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     349             :         PyObject *py_device_id;
     350           0 :         if (object->in.device_id == NULL) {
     351           0 :                 Py_RETURN_NONE;
     352             :         }
     353           0 :         py_device_id = PyLong_FromUnsignedLongLong((uint32_t)*object->in.device_id);
     354           0 :         return py_device_id;
     355             : }
     356             : 
     357           0 : static int py_mdssvc_open_in_set_device_id(PyObject *py_obj, PyObject *value, void *closure)
     358             : {
     359           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     360           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.device_id));
     361           0 :         if (value == NULL) {
     362           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.device_id");
     363           0 :                 return -1;
     364             :         }
     365           0 :         object->in.device_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.device_id);
     366           0 :         if (object->in.device_id == NULL) {
     367           0 :                 PyErr_NoMemory();
     368           0 :                 return -1;
     369             :         }
     370             :         {
     371           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.device_id));
     372           0 :                 if (PyLong_Check(value)) {
     373             :                         unsigned long long test_var;
     374           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     375           0 :                         if (PyErr_Occurred() != NULL) {
     376           0 :                                 return -1;
     377             :                         }
     378           0 :                         if (test_var > uint_max) {
     379           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     380             :                                   PyLong_Type.tp_name, uint_max, test_var);
     381           0 :                                 return -1;
     382             :                         }
     383           0 :                         *object->in.device_id = test_var;
     384             :                 } else {
     385           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     386             :                           PyLong_Type.tp_name);
     387           0 :                         return -1;
     388             :                 }
     389             :         }
     390           0 :         return 0;
     391             : }
     392             : 
     393           0 : static PyObject *py_mdssvc_open_out_get_device_id(PyObject *obj, void *closure)
     394             : {
     395           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     396             :         PyObject *py_device_id;
     397           0 :         if (object->out.device_id == NULL) {
     398           0 :                 Py_RETURN_NONE;
     399             :         }
     400           0 :         py_device_id = PyLong_FromUnsignedLongLong((uint32_t)*object->out.device_id);
     401           0 :         return py_device_id;
     402             : }
     403             : 
     404           0 : static int py_mdssvc_open_out_set_device_id(PyObject *py_obj, PyObject *value, void *closure)
     405             : {
     406           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     407           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.device_id));
     408           0 :         if (value == NULL) {
     409           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.device_id");
     410           0 :                 return -1;
     411             :         }
     412           0 :         object->out.device_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.device_id);
     413           0 :         if (object->out.device_id == NULL) {
     414           0 :                 PyErr_NoMemory();
     415           0 :                 return -1;
     416             :         }
     417             :         {
     418           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.device_id));
     419           0 :                 if (PyLong_Check(value)) {
     420             :                         unsigned long long test_var;
     421           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     422           0 :                         if (PyErr_Occurred() != NULL) {
     423           0 :                                 return -1;
     424             :                         }
     425           0 :                         if (test_var > uint_max) {
     426           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     427             :                                   PyLong_Type.tp_name, uint_max, test_var);
     428           0 :                                 return -1;
     429             :                         }
     430           0 :                         *object->out.device_id = test_var;
     431             :                 } else {
     432           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     433             :                           PyLong_Type.tp_name);
     434           0 :                         return -1;
     435             :                 }
     436             :         }
     437           0 :         return 0;
     438             : }
     439             : 
     440           0 : static PyObject *py_mdssvc_open_in_get_unkn2(PyObject *obj, void *closure)
     441             : {
     442           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     443             :         PyObject *py_unkn2;
     444           0 :         if (object->in.unkn2 == NULL) {
     445           0 :                 Py_RETURN_NONE;
     446             :         }
     447           0 :         py_unkn2 = PyLong_FromUnsignedLongLong((uint32_t)*object->in.unkn2);
     448           0 :         return py_unkn2;
     449             : }
     450             : 
     451           0 : static int py_mdssvc_open_in_set_unkn2(PyObject *py_obj, PyObject *value, void *closure)
     452             : {
     453           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     454           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.unkn2));
     455           0 :         if (value == NULL) {
     456           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn2");
     457           0 :                 return -1;
     458             :         }
     459           0 :         object->in.unkn2 = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.unkn2);
     460           0 :         if (object->in.unkn2 == NULL) {
     461           0 :                 PyErr_NoMemory();
     462           0 :                 return -1;
     463             :         }
     464             :         {
     465           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.unkn2));
     466           0 :                 if (PyLong_Check(value)) {
     467             :                         unsigned long long test_var;
     468           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     469           0 :                         if (PyErr_Occurred() != NULL) {
     470           0 :                                 return -1;
     471             :                         }
     472           0 :                         if (test_var > uint_max) {
     473           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     474             :                                   PyLong_Type.tp_name, uint_max, test_var);
     475           0 :                                 return -1;
     476             :                         }
     477           0 :                         *object->in.unkn2 = test_var;
     478             :                 } else {
     479           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     480             :                           PyLong_Type.tp_name);
     481           0 :                         return -1;
     482             :                 }
     483             :         }
     484           0 :         return 0;
     485             : }
     486             : 
     487           0 : static PyObject *py_mdssvc_open_out_get_unkn2(PyObject *obj, void *closure)
     488             : {
     489           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     490             :         PyObject *py_unkn2;
     491           0 :         if (object->out.unkn2 == NULL) {
     492           0 :                 Py_RETURN_NONE;
     493             :         }
     494           0 :         py_unkn2 = PyLong_FromUnsignedLongLong((uint32_t)*object->out.unkn2);
     495           0 :         return py_unkn2;
     496             : }
     497             : 
     498           0 : static int py_mdssvc_open_out_set_unkn2(PyObject *py_obj, PyObject *value, void *closure)
     499             : {
     500           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     501           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.unkn2));
     502           0 :         if (value == NULL) {
     503           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.unkn2");
     504           0 :                 return -1;
     505             :         }
     506           0 :         object->out.unkn2 = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.unkn2);
     507           0 :         if (object->out.unkn2 == NULL) {
     508           0 :                 PyErr_NoMemory();
     509           0 :                 return -1;
     510             :         }
     511             :         {
     512           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.unkn2));
     513           0 :                 if (PyLong_Check(value)) {
     514             :                         unsigned long long test_var;
     515           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     516           0 :                         if (PyErr_Occurred() != NULL) {
     517           0 :                                 return -1;
     518             :                         }
     519           0 :                         if (test_var > uint_max) {
     520           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     521             :                                   PyLong_Type.tp_name, uint_max, test_var);
     522           0 :                                 return -1;
     523             :                         }
     524           0 :                         *object->out.unkn2 = test_var;
     525             :                 } else {
     526           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     527             :                           PyLong_Type.tp_name);
     528           0 :                         return -1;
     529             :                 }
     530             :         }
     531           0 :         return 0;
     532             : }
     533             : 
     534           0 : static PyObject *py_mdssvc_open_in_get_unkn3(PyObject *obj, void *closure)
     535             : {
     536           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     537             :         PyObject *py_unkn3;
     538           0 :         if (object->in.unkn3 == NULL) {
     539           0 :                 Py_RETURN_NONE;
     540             :         }
     541           0 :         py_unkn3 = PyLong_FromUnsignedLongLong((uint32_t)*object->in.unkn3);
     542           0 :         return py_unkn3;
     543             : }
     544             : 
     545           0 : static int py_mdssvc_open_in_set_unkn3(PyObject *py_obj, PyObject *value, void *closure)
     546             : {
     547           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     548           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.unkn3));
     549           0 :         if (value == NULL) {
     550           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn3");
     551           0 :                 return -1;
     552             :         }
     553           0 :         object->in.unkn3 = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.unkn3);
     554           0 :         if (object->in.unkn3 == NULL) {
     555           0 :                 PyErr_NoMemory();
     556           0 :                 return -1;
     557             :         }
     558             :         {
     559           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.unkn3));
     560           0 :                 if (PyLong_Check(value)) {
     561             :                         unsigned long long test_var;
     562           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     563           0 :                         if (PyErr_Occurred() != NULL) {
     564           0 :                                 return -1;
     565             :                         }
     566           0 :                         if (test_var > uint_max) {
     567           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     568             :                                   PyLong_Type.tp_name, uint_max, test_var);
     569           0 :                                 return -1;
     570             :                         }
     571           0 :                         *object->in.unkn3 = test_var;
     572             :                 } else {
     573           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     574             :                           PyLong_Type.tp_name);
     575           0 :                         return -1;
     576             :                 }
     577             :         }
     578           0 :         return 0;
     579             : }
     580             : 
     581           0 : static PyObject *py_mdssvc_open_out_get_unkn3(PyObject *obj, void *closure)
     582             : {
     583           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     584             :         PyObject *py_unkn3;
     585           0 :         if (object->out.unkn3 == NULL) {
     586           0 :                 Py_RETURN_NONE;
     587             :         }
     588           0 :         py_unkn3 = PyLong_FromUnsignedLongLong((uint32_t)*object->out.unkn3);
     589           0 :         return py_unkn3;
     590             : }
     591             : 
     592           0 : static int py_mdssvc_open_out_set_unkn3(PyObject *py_obj, PyObject *value, void *closure)
     593             : {
     594           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     595           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.unkn3));
     596           0 :         if (value == NULL) {
     597           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.unkn3");
     598           0 :                 return -1;
     599             :         }
     600           0 :         object->out.unkn3 = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.unkn3);
     601           0 :         if (object->out.unkn3 == NULL) {
     602           0 :                 PyErr_NoMemory();
     603           0 :                 return -1;
     604             :         }
     605             :         {
     606           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.unkn3));
     607           0 :                 if (PyLong_Check(value)) {
     608             :                         unsigned long long test_var;
     609           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     610           0 :                         if (PyErr_Occurred() != NULL) {
     611           0 :                                 return -1;
     612             :                         }
     613           0 :                         if (test_var > uint_max) {
     614           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     615             :                                   PyLong_Type.tp_name, uint_max, test_var);
     616           0 :                                 return -1;
     617             :                         }
     618           0 :                         *object->out.unkn3 = test_var;
     619             :                 } else {
     620           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     621             :                           PyLong_Type.tp_name);
     622           0 :                         return -1;
     623             :                 }
     624             :         }
     625           0 :         return 0;
     626             : }
     627             : 
     628           0 : static PyObject *py_mdssvc_open_in_get_share_mount_path(PyObject *obj, void *closure)
     629             : {
     630           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     631             :         PyObject *py_share_mount_path;
     632           0 :         if (object->in.share_mount_path == NULL) {
     633           0 :                 py_share_mount_path = Py_None;
     634           0 :                 Py_INCREF(py_share_mount_path);
     635             :         } else {
     636           0 :                 py_share_mount_path = PyUnicode_Decode(object->in.share_mount_path, strlen(object->in.share_mount_path), "utf-8", "ignore");
     637             :         }
     638           0 :         return py_share_mount_path;
     639             : }
     640             : 
     641           0 : static int py_mdssvc_open_in_set_share_mount_path(PyObject *py_obj, PyObject *value, void *closure)
     642             : {
     643           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     644           0 :         if (value == NULL) {
     645           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.share_mount_path");
     646           0 :                 return -1;
     647             :         }
     648             :         {
     649             :                 const char *test_str;
     650             :                 const char *talloc_str;
     651           0 :                 PyObject *unicode = NULL;
     652           0 :                 if (PyUnicode_Check(value)) {
     653           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     654           0 :                         if (unicode == NULL) {
     655           0 :                                 PyErr_NoMemory();
     656           0 :                                 return -1;
     657             :                         }
     658           0 :                         test_str = PyBytes_AS_STRING(unicode);
     659           0 :                 } else if (PyBytes_Check(value)) {
     660           0 :                         test_str = PyBytes_AS_STRING(value);
     661             :                 } else {
     662           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     663           0 :                         return -1;
     664             :                 }
     665           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     666           0 :                 if (unicode != NULL) {
     667           0 :                         Py_DECREF(unicode);
     668             :                 }
     669           0 :                 if (talloc_str == NULL) {
     670           0 :                         PyErr_NoMemory();
     671           0 :                         return -1;
     672             :                 }
     673           0 :                 object->in.share_mount_path = talloc_str;
     674             :         }
     675           0 :         return 0;
     676             : }
     677             : 
     678           0 : static PyObject *py_mdssvc_open_in_get_share_name(PyObject *obj, void *closure)
     679             : {
     680           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     681             :         PyObject *py_share_name;
     682           0 :         if (object->in.share_name == NULL) {
     683           0 :                 py_share_name = Py_None;
     684           0 :                 Py_INCREF(py_share_name);
     685             :         } else {
     686           0 :                 py_share_name = PyUnicode_Decode(object->in.share_name, strlen(object->in.share_name), "utf-8", "ignore");
     687             :         }
     688           0 :         return py_share_name;
     689             : }
     690             : 
     691           0 : static int py_mdssvc_open_in_set_share_name(PyObject *py_obj, PyObject *value, void *closure)
     692             : {
     693           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     694           0 :         if (value == NULL) {
     695           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.share_name");
     696           0 :                 return -1;
     697             :         }
     698             :         {
     699             :                 const char *test_str;
     700             :                 const char *talloc_str;
     701           0 :                 PyObject *unicode = NULL;
     702           0 :                 if (PyUnicode_Check(value)) {
     703           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     704           0 :                         if (unicode == NULL) {
     705           0 :                                 PyErr_NoMemory();
     706           0 :                                 return -1;
     707             :                         }
     708           0 :                         test_str = PyBytes_AS_STRING(unicode);
     709           0 :                 } else if (PyBytes_Check(value)) {
     710           0 :                         test_str = PyBytes_AS_STRING(value);
     711             :                 } else {
     712           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     713           0 :                         return -1;
     714             :                 }
     715           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     716           0 :                 if (unicode != NULL) {
     717           0 :                         Py_DECREF(unicode);
     718             :                 }
     719           0 :                 if (talloc_str == NULL) {
     720           0 :                         PyErr_NoMemory();
     721           0 :                         return -1;
     722             :                 }
     723           0 :                 object->in.share_name = talloc_str;
     724             :         }
     725           0 :         return 0;
     726             : }
     727             : 
     728           0 : static PyObject *py_mdssvc_open_out_get_share_path(PyObject *obj, void *closure)
     729             : {
     730           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     731             :         PyObject *py_share_path;
     732           0 :         if (object->out.share_path == NULL) {
     733           0 :                 py_share_path = Py_None;
     734           0 :                 Py_INCREF(py_share_path);
     735             :         } else {
     736           0 :                 py_share_path = PyUnicode_Decode(object->out.share_path, strlen(object->out.share_path), "utf-8", "ignore");
     737             :         }
     738           0 :         return py_share_path;
     739             : }
     740             : 
     741           0 : static int py_mdssvc_open_out_set_share_path(PyObject *py_obj, PyObject *value, void *closure)
     742             : {
     743           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     744           0 :         if (value == NULL) {
     745           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.share_path");
     746           0 :                 return -1;
     747             :         }
     748             :         {
     749             :                 const char *test_str;
     750             :                 const char *talloc_str;
     751           0 :                 PyObject *unicode = NULL;
     752           0 :                 if (PyUnicode_Check(value)) {
     753           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     754           0 :                         if (unicode == NULL) {
     755           0 :                                 PyErr_NoMemory();
     756           0 :                                 return -1;
     757             :                         }
     758           0 :                         test_str = PyBytes_AS_STRING(unicode);
     759           0 :                 } else if (PyBytes_Check(value)) {
     760           0 :                         test_str = PyBytes_AS_STRING(value);
     761             :                 } else {
     762           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     763           0 :                         return -1;
     764             :                 }
     765           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     766           0 :                 if (unicode != NULL) {
     767           0 :                         Py_DECREF(unicode);
     768             :                 }
     769           0 :                 if (talloc_str == NULL) {
     770           0 :                         PyErr_NoMemory();
     771           0 :                         return -1;
     772             :                 }
     773           0 :                 object->out.share_path = talloc_str;
     774             :         }
     775           0 :         return 0;
     776             : }
     777             : 
     778           0 : static PyObject *py_mdssvc_open_out_get_handle(PyObject *obj, void *closure)
     779             : {
     780           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(obj);
     781             :         PyObject *py_handle;
     782           0 :         if (object->out.handle == NULL) {
     783           0 :                 Py_RETURN_NONE;
     784             :         }
     785           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
     786           0 :         return py_handle;
     787             : }
     788             : 
     789           0 : static int py_mdssvc_open_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
     790             : {
     791           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     792           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
     793           0 :         if (value == NULL) {
     794           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
     795           0 :                 return -1;
     796             :         }
     797           0 :         object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
     798           0 :         if (object->out.handle == NULL) {
     799           0 :                 PyErr_NoMemory();
     800           0 :                 return -1;
     801             :         }
     802           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
     803           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     804           0 :                 PyErr_NoMemory();
     805           0 :                 return -1;
     806             :         }
     807           0 :         object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
     808           0 :         return 0;
     809             : }
     810             : 
     811             : static PyGetSetDef py_mdssvc_open_getsetters[] = {
     812             :         {
     813             :                 .name = discard_const_p(char, "in_device_id"),
     814             :                 .get = py_mdssvc_open_in_get_device_id,
     815             :                 .set = py_mdssvc_open_in_set_device_id,
     816             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     817             :         },
     818             :         {
     819             :                 .name = discard_const_p(char, "out_device_id"),
     820             :                 .get = py_mdssvc_open_out_get_device_id,
     821             :                 .set = py_mdssvc_open_out_set_device_id,
     822             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     823             :         },
     824             :         {
     825             :                 .name = discard_const_p(char, "in_unkn2"),
     826             :                 .get = py_mdssvc_open_in_get_unkn2,
     827             :                 .set = py_mdssvc_open_in_set_unkn2,
     828             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     829             :         },
     830             :         {
     831             :                 .name = discard_const_p(char, "out_unkn2"),
     832             :                 .get = py_mdssvc_open_out_get_unkn2,
     833             :                 .set = py_mdssvc_open_out_set_unkn2,
     834             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     835             :         },
     836             :         {
     837             :                 .name = discard_const_p(char, "in_unkn3"),
     838             :                 .get = py_mdssvc_open_in_get_unkn3,
     839             :                 .set = py_mdssvc_open_in_set_unkn3,
     840             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     841             :         },
     842             :         {
     843             :                 .name = discard_const_p(char, "out_unkn3"),
     844             :                 .get = py_mdssvc_open_out_get_unkn3,
     845             :                 .set = py_mdssvc_open_out_set_unkn3,
     846             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     847             :         },
     848             :         {
     849             :                 .name = discard_const_p(char, "in_share_mount_path"),
     850             :                 .get = py_mdssvc_open_in_get_share_mount_path,
     851             :                 .set = py_mdssvc_open_in_set_share_mount_path,
     852             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     853             :         },
     854             :         {
     855             :                 .name = discard_const_p(char, "in_share_name"),
     856             :                 .get = py_mdssvc_open_in_get_share_name,
     857             :                 .set = py_mdssvc_open_in_set_share_name,
     858             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     859             :         },
     860             :         {
     861             :                 .name = discard_const_p(char, "out_share_path"),
     862             :                 .get = py_mdssvc_open_out_get_share_path,
     863             :                 .set = py_mdssvc_open_out_set_share_path,
     864             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     865             :         },
     866             :         {
     867             :                 .name = discard_const_p(char, "out_handle"),
     868             :                 .get = py_mdssvc_open_out_get_handle,
     869             :                 .set = py_mdssvc_open_out_set_handle,
     870             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
     871             :         },
     872             :         { .name = NULL }
     873             : };
     874             : 
     875           0 : static PyObject *py_mdssvc_open_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     876             : {
     877           0 :         PyObject *self = pytalloc_new(struct mdssvc_open, type);
     878           0 :         struct mdssvc_open *_self = (struct mdssvc_open *)pytalloc_get_ptr(self);
     879           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
     880           0 :         _self->in.device_id = talloc_zero(mem_ctx, uint32_t);
     881           0 :         _self->out.device_id = talloc_zero(mem_ctx, uint32_t);
     882           0 :         _self->in.unkn2 = talloc_zero(mem_ctx, uint32_t);
     883           0 :         _self->out.unkn2 = talloc_zero(mem_ctx, uint32_t);
     884           0 :         _self->in.unkn3 = talloc_zero(mem_ctx, uint32_t);
     885           0 :         _self->out.unkn3 = talloc_zero(mem_ctx, uint32_t);
     886           0 :         _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
     887           0 :         return self;
     888             : }
     889             : 
     890           0 : static PyObject *py_mdssvc_open_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
     891             : {
     892             : 
     893             : 
     894           0 :         return PyLong_FromLong(0);
     895             : }
     896             : 
     897           0 : static PyObject *py_mdssvc_open_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
     898             : {
     899           0 :         const struct ndr_interface_call *call = NULL;
     900           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     901           0 :         PyObject *ret = NULL;
     902           0 :         struct ndr_push *push = NULL;
     903             :         DATA_BLOB blob;
     904             :         enum ndr_err_code err;
     905             : 
     906           0 :         if (ndr_table_mdssvc.num_calls < 1) {
     907           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_open_ndr_pack");
     908           0 :                 return NULL;
     909             :         }
     910           0 :         call = &ndr_table_mdssvc.calls[0];
     911             : 
     912           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
     913           0 :         if (push == NULL) {
     914           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     915           0 :                 return NULL;
     916             :         }
     917             : 
     918           0 :         push->flags |= ndr_push_flags;
     919             : 
     920           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
     921           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     922           0 :                 TALLOC_FREE(push);
     923           0 :                 PyErr_SetNdrError(err);
     924           0 :                 return NULL;
     925             :         }
     926           0 :         blob = ndr_push_blob(push);
     927           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     928           0 :         TALLOC_FREE(push);
     929           0 :         return ret;
     930             : }
     931             : 
     932           0 : static PyObject *py_mdssvc_open_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     933             : {
     934           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
     935           0 :         PyObject *bigendian_obj = NULL;
     936           0 :         PyObject *ndr64_obj = NULL;
     937           0 :         uint32_t ndr_push_flags = 0;
     938             : 
     939           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
     940             :                 discard_const_p(char *, kwnames),
     941             :                 &bigendian_obj,
     942             :                 &ndr64_obj)) {
     943           0 :                 return NULL;
     944             :         }
     945             : 
     946           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
     947           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
     948             :         }
     949           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
     950           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
     951             :         }
     952             : 
     953           0 :         return py_mdssvc_open_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
     954             : }
     955             : 
     956           0 : static PyObject *py_mdssvc_open_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     957             : {
     958           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
     959           0 :         PyObject *bigendian_obj = NULL;
     960           0 :         PyObject *ndr64_obj = NULL;
     961           0 :         uint32_t ndr_push_flags = 0;
     962             : 
     963           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
     964             :                 discard_const_p(char *, kwnames),
     965             :                 &bigendian_obj,
     966             :                 &ndr64_obj)) {
     967           0 :                 return NULL;
     968             :         }
     969             : 
     970           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
     971           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
     972             :         }
     973           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
     974           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
     975             :         }
     976             : 
     977           0 :         return py_mdssvc_open_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
     978             : }
     979             : 
     980           0 : static PyObject *py_mdssvc_open_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
     981             : {
     982           0 :         const struct ndr_interface_call *call = NULL;
     983           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
     984           0 :         struct ndr_pull *pull = NULL;
     985             :         enum ndr_err_code err;
     986             : 
     987           0 :         if (ndr_table_mdssvc.num_calls < 1) {
     988           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_open_ndr_unpack");
     989           0 :                 return NULL;
     990             :         }
     991           0 :         call = &ndr_table_mdssvc.calls[0];
     992             : 
     993           0 :         pull = ndr_pull_init_blob(blob, object);
     994           0 :         if (pull == NULL) {
     995           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     996           0 :                 return NULL;
     997             :         }
     998             : 
     999           0 :         pull->flags |= ndr_pull_flags;
    1000             : 
    1001           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    1002           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1003           0 :                 TALLOC_FREE(pull);
    1004           0 :                 PyErr_SetNdrError(err);
    1005           0 :                 return NULL;
    1006             :         }
    1007           0 :         if (!allow_remaining) {
    1008             :                 uint32_t highest_ofs;
    1009             : 
    1010           0 :                 if (pull->offset > pull->relative_highest_offset) {
    1011           0 :                         highest_ofs = pull->offset;
    1012             :                 } else {
    1013           0 :                         highest_ofs = pull->relative_highest_offset;
    1014             :                 }
    1015           0 :                 if (highest_ofs < pull->data_size) {
    1016           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    1017             :                                 "not all bytes consumed ofs[%u] size[%u]",
    1018             :                                 highest_ofs, pull->data_size);
    1019           0 :                         TALLOC_FREE(pull);
    1020           0 :                         PyErr_SetNdrError(err);
    1021           0 :                         return NULL;
    1022             :                 }
    1023             :         }
    1024             : 
    1025           0 :         TALLOC_FREE(pull);
    1026           0 :         Py_RETURN_NONE;
    1027             : }
    1028             : 
    1029           0 : static PyObject *py_mdssvc_open_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1030             : {
    1031             :         DATA_BLOB blob;
    1032           0 :         Py_ssize_t blob_length = 0;
    1033           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    1034           0 :         PyObject *bigendian_obj = NULL;
    1035           0 :         PyObject *ndr64_obj = NULL;
    1036           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    1037           0 :         PyObject *allow_remaining_obj = NULL;
    1038           0 :         bool allow_remaining = false;
    1039             : 
    1040           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    1041             :                 discard_const_p(char *, kwnames),
    1042             :                 &blob.data, &blob_length,
    1043             :                 &bigendian_obj,
    1044             :                 &ndr64_obj,
    1045             :                 &allow_remaining_obj)) {
    1046           0 :                 return NULL;
    1047             :         }
    1048           0 :         blob.length = blob_length;
    1049             : 
    1050           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    1051           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    1052             :         }
    1053           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    1054           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    1055             :         }
    1056             : 
    1057           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1058           0 :                 allow_remaining = true;
    1059             :         }
    1060             : 
    1061           0 :         return py_mdssvc_open_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    1062             : }
    1063             : 
    1064           0 : static PyObject *py_mdssvc_open_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1065             : {
    1066             :         DATA_BLOB blob;
    1067           0 :         Py_ssize_t blob_length = 0;
    1068           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    1069           0 :         PyObject *bigendian_obj = NULL;
    1070           0 :         PyObject *ndr64_obj = NULL;
    1071           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    1072           0 :         PyObject *allow_remaining_obj = NULL;
    1073           0 :         bool allow_remaining = false;
    1074             : 
    1075           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    1076             :                 discard_const_p(char *, kwnames),
    1077             :                 &blob.data, &blob_length,
    1078             :                 &bigendian_obj,
    1079             :                 &ndr64_obj,
    1080             :                 &allow_remaining_obj)) {
    1081           0 :                 return NULL;
    1082             :         }
    1083           0 :         blob.length = blob_length;
    1084             : 
    1085           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    1086           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    1087             :         }
    1088           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    1089           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    1090             :         }
    1091             : 
    1092           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1093           0 :                 allow_remaining = true;
    1094             :         }
    1095             : 
    1096           0 :         return py_mdssvc_open_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    1097             : }
    1098             : 
    1099           0 : static PyObject *py_mdssvc_open_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    1100             : {
    1101           0 :         const struct ndr_interface_call *call = NULL;
    1102           0 :         struct mdssvc_open *object = (struct mdssvc_open *)pytalloc_get_ptr(py_obj);
    1103             :         PyObject *ret;
    1104             :         char *retstr;
    1105             : 
    1106           0 :         if (ndr_table_mdssvc.num_calls < 1) {
    1107           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_open_ndr_print");
    1108           0 :                 return NULL;
    1109             :         }
    1110           0 :         call = &ndr_table_mdssvc.calls[0];
    1111             : 
    1112           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    1113           0 :         ret = PyUnicode_FromString(retstr);
    1114           0 :         TALLOC_FREE(retstr);
    1115             : 
    1116           0 :         return ret;
    1117             : }
    1118             : 
    1119           0 : static PyObject *py_mdssvc_open_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1120             : {
    1121           0 :         return py_mdssvc_open_ndr_print(py_obj, "mdssvc_open_in", NDR_IN);
    1122             : }
    1123             : 
    1124           0 : static PyObject *py_mdssvc_open_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1125             : {
    1126           0 :         return py_mdssvc_open_ndr_print(py_obj, "mdssvc_open_out", NDR_OUT);
    1127             : }
    1128             : 
    1129             : static PyMethodDef py_mdssvc_open_methods[] = {
    1130             :         { "opnum", (PyCFunction)py_mdssvc_open_ndr_opnum, METH_NOARGS|METH_CLASS,
    1131             :                 "mdssvc.open.opnum() -> 0 (0x00) " },
    1132             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_open_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    1133             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    1134             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_open_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    1135             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    1136             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_open_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    1137             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    1138             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_open_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    1139             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    1140             :         { "__ndr_print_in__", (PyCFunction)py_mdssvc_open_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    1141             :         { "__ndr_print_out__", (PyCFunction)py_mdssvc_open_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    1142             :         { NULL, NULL, 0, NULL }
    1143             : };
    1144             : 
    1145             : 
    1146             : static PyTypeObject mdssvc_open_Type = {
    1147             :         PyVarObject_HEAD_INIT(NULL, 0)
    1148             :         .tp_name = "mdssvc.open",
    1149             :         .tp_getset = py_mdssvc_open_getsetters,
    1150             :         .tp_methods = py_mdssvc_open_methods,
    1151             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1152             :         .tp_new = py_mdssvc_open_new,
    1153             : };
    1154             : 
    1155           0 : static bool pack_py_mdssvc_open_args_in(PyObject *args, PyObject *kwargs, struct mdssvc_open *r)
    1156             : {
    1157             :         PyObject *py_device_id;
    1158             :         PyObject *py_unkn2;
    1159             :         PyObject *py_unkn3;
    1160             :         PyObject *py_share_mount_path;
    1161             :         PyObject *py_share_name;
    1162           0 :         const char *kwnames[] = {
    1163             :                 "device_id", "unkn2", "unkn3", "share_mount_path", "share_name", NULL
    1164             :         };
    1165             : 
    1166           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:mdssvc_open", discard_const_p(char *, kwnames), &py_device_id, &py_unkn2, &py_unkn3, &py_share_mount_path, &py_share_name)) {
    1167           0 :                 return false;
    1168             :         }
    1169             : 
    1170           0 :         if (py_device_id == NULL) {
    1171           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.device_id");
    1172           0 :                 return false;
    1173             :         }
    1174           0 :         r->in.device_id = talloc_ptrtype(r, r->in.device_id);
    1175           0 :         if (r->in.device_id == NULL) {
    1176           0 :                 PyErr_NoMemory();
    1177           0 :                 return false;
    1178             :         }
    1179             :         {
    1180           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.device_id));
    1181           0 :                 if (PyLong_Check(py_device_id)) {
    1182             :                         unsigned long long test_var;
    1183           0 :                         test_var = PyLong_AsUnsignedLongLong(py_device_id);
    1184           0 :                         if (PyErr_Occurred() != NULL) {
    1185           0 :                                 return false;
    1186             :                         }
    1187           0 :                         if (test_var > uint_max) {
    1188           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1189             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1190           0 :                                 return false;
    1191             :                         }
    1192           0 :                         *r->in.device_id = test_var;
    1193             :                 } else {
    1194           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1195             :                           PyLong_Type.tp_name);
    1196           0 :                         return false;
    1197             :                 }
    1198             :         }
    1199           0 :         if (py_unkn2 == NULL) {
    1200           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn2");
    1201           0 :                 return false;
    1202             :         }
    1203           0 :         r->in.unkn2 = talloc_ptrtype(r, r->in.unkn2);
    1204           0 :         if (r->in.unkn2 == NULL) {
    1205           0 :                 PyErr_NoMemory();
    1206           0 :                 return false;
    1207             :         }
    1208             :         {
    1209           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.unkn2));
    1210           0 :                 if (PyLong_Check(py_unkn2)) {
    1211             :                         unsigned long long test_var;
    1212           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn2);
    1213           0 :                         if (PyErr_Occurred() != NULL) {
    1214           0 :                                 return false;
    1215             :                         }
    1216           0 :                         if (test_var > uint_max) {
    1217           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1218             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1219           0 :                                 return false;
    1220             :                         }
    1221           0 :                         *r->in.unkn2 = test_var;
    1222             :                 } else {
    1223           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1224             :                           PyLong_Type.tp_name);
    1225           0 :                         return false;
    1226             :                 }
    1227             :         }
    1228           0 :         if (py_unkn3 == NULL) {
    1229           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn3");
    1230           0 :                 return false;
    1231             :         }
    1232           0 :         r->in.unkn3 = talloc_ptrtype(r, r->in.unkn3);
    1233           0 :         if (r->in.unkn3 == NULL) {
    1234           0 :                 PyErr_NoMemory();
    1235           0 :                 return false;
    1236             :         }
    1237             :         {
    1238           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.unkn3));
    1239           0 :                 if (PyLong_Check(py_unkn3)) {
    1240             :                         unsigned long long test_var;
    1241           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn3);
    1242           0 :                         if (PyErr_Occurred() != NULL) {
    1243           0 :                                 return false;
    1244             :                         }
    1245           0 :                         if (test_var > uint_max) {
    1246           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1247             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1248           0 :                                 return false;
    1249             :                         }
    1250           0 :                         *r->in.unkn3 = test_var;
    1251             :                 } else {
    1252           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1253             :                           PyLong_Type.tp_name);
    1254           0 :                         return false;
    1255             :                 }
    1256             :         }
    1257           0 :         if (py_share_mount_path == NULL) {
    1258           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.share_mount_path");
    1259           0 :                 return false;
    1260             :         }
    1261             :         {
    1262             :                 const char *test_str;
    1263             :                 const char *talloc_str;
    1264           0 :                 PyObject *unicode = NULL;
    1265           0 :                 if (PyUnicode_Check(py_share_mount_path)) {
    1266           0 :                         unicode = PyUnicode_AsEncodedString(py_share_mount_path, "utf-8", "ignore");
    1267           0 :                         if (unicode == NULL) {
    1268           0 :                                 PyErr_NoMemory();
    1269           0 :                                 return false;
    1270             :                         }
    1271           0 :                         test_str = PyBytes_AS_STRING(unicode);
    1272           0 :                 } else if (PyBytes_Check(py_share_mount_path)) {
    1273           0 :                         test_str = PyBytes_AS_STRING(py_share_mount_path);
    1274             :                 } else {
    1275           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_mount_path)->tp_name);
    1276           0 :                         return false;
    1277             :                 }
    1278           0 :                 talloc_str = talloc_strdup(r, test_str);
    1279           0 :                 if (unicode != NULL) {
    1280           0 :                         Py_DECREF(unicode);
    1281             :                 }
    1282           0 :                 if (talloc_str == NULL) {
    1283           0 :                         PyErr_NoMemory();
    1284           0 :                         return false;
    1285             :                 }
    1286           0 :                 r->in.share_mount_path = talloc_str;
    1287             :         }
    1288           0 :         if (py_share_name == NULL) {
    1289           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.share_name");
    1290           0 :                 return false;
    1291             :         }
    1292             :         {
    1293             :                 const char *test_str;
    1294             :                 const char *talloc_str;
    1295           0 :                 PyObject *unicode = NULL;
    1296           0 :                 if (PyUnicode_Check(py_share_name)) {
    1297           0 :                         unicode = PyUnicode_AsEncodedString(py_share_name, "utf-8", "ignore");
    1298           0 :                         if (unicode == NULL) {
    1299           0 :                                 PyErr_NoMemory();
    1300           0 :                                 return false;
    1301             :                         }
    1302           0 :                         test_str = PyBytes_AS_STRING(unicode);
    1303           0 :                 } else if (PyBytes_Check(py_share_name)) {
    1304           0 :                         test_str = PyBytes_AS_STRING(py_share_name);
    1305             :                 } else {
    1306           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name);
    1307           0 :                         return false;
    1308             :                 }
    1309           0 :                 talloc_str = talloc_strdup(r, test_str);
    1310           0 :                 if (unicode != NULL) {
    1311           0 :                         Py_DECREF(unicode);
    1312             :                 }
    1313           0 :                 if (talloc_str == NULL) {
    1314           0 :                         PyErr_NoMemory();
    1315           0 :                         return false;
    1316             :                 }
    1317           0 :                 r->in.share_name = talloc_str;
    1318             :         }
    1319           0 :         return true;
    1320             : }
    1321             : 
    1322           0 : static PyObject *unpack_py_mdssvc_open_args_out(struct mdssvc_open *r)
    1323             : {
    1324             :         PyObject *result;
    1325             :         PyObject *py_device_id;
    1326             :         PyObject *py_unkn2;
    1327             :         PyObject *py_unkn3;
    1328             :         PyObject *py_share_path;
    1329             :         PyObject *py_handle;
    1330           0 :         result = PyTuple_New(5);
    1331           0 :         py_device_id = PyLong_FromUnsignedLongLong((uint32_t)*r->out.device_id);
    1332           0 :         PyTuple_SetItem(result, 0, py_device_id);
    1333           0 :         py_unkn2 = PyLong_FromUnsignedLongLong((uint32_t)*r->out.unkn2);
    1334           0 :         PyTuple_SetItem(result, 1, py_unkn2);
    1335           0 :         py_unkn3 = PyLong_FromUnsignedLongLong((uint32_t)*r->out.unkn3);
    1336           0 :         PyTuple_SetItem(result, 2, py_unkn3);
    1337           0 :         if (r->out.share_path == NULL) {
    1338           0 :                 py_share_path = Py_None;
    1339           0 :                 Py_INCREF(py_share_path);
    1340             :         } else {
    1341           0 :                 py_share_path = PyUnicode_Decode(r->out.share_path, strlen(r->out.share_path), "utf-8", "ignore");
    1342             :         }
    1343           0 :         PyTuple_SetItem(result, 3, py_share_path);
    1344           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
    1345           0 :         PyTuple_SetItem(result, 4, py_handle);
    1346           0 :         return result;
    1347             : }
    1348             : 
    1349             : 
    1350           0 : static PyObject *py_mdssvc_unknown1_in_get_handle(PyObject *obj, void *closure)
    1351             : {
    1352           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1353             :         PyObject *py_handle;
    1354           0 :         if (object->in.handle == NULL) {
    1355           0 :                 Py_RETURN_NONE;
    1356             :         }
    1357           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    1358           0 :         return py_handle;
    1359             : }
    1360             : 
    1361           0 : static int py_mdssvc_unknown1_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    1362             : {
    1363           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1364           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    1365           0 :         if (value == NULL) {
    1366           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    1367           0 :                 return -1;
    1368             :         }
    1369           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    1370           0 :         if (object->in.handle == NULL) {
    1371           0 :                 PyErr_NoMemory();
    1372           0 :                 return -1;
    1373             :         }
    1374           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    1375           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1376           0 :                 PyErr_NoMemory();
    1377           0 :                 return -1;
    1378             :         }
    1379           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    1380           0 :         return 0;
    1381             : }
    1382             : 
    1383           0 : static PyObject *py_mdssvc_unknown1_in_get_unkn1(PyObject *obj, void *closure)
    1384             : {
    1385           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1386             :         PyObject *py_unkn1;
    1387           0 :         py_unkn1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn1);
    1388           0 :         return py_unkn1;
    1389             : }
    1390             : 
    1391           0 : static int py_mdssvc_unknown1_in_set_unkn1(PyObject *py_obj, PyObject *value, void *closure)
    1392             : {
    1393           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1394           0 :         if (value == NULL) {
    1395           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn1");
    1396           0 :                 return -1;
    1397             :         }
    1398             :         {
    1399           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn1));
    1400           0 :                 if (PyLong_Check(value)) {
    1401             :                         unsigned long long test_var;
    1402           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1403           0 :                         if (PyErr_Occurred() != NULL) {
    1404           0 :                                 return -1;
    1405             :                         }
    1406           0 :                         if (test_var > uint_max) {
    1407           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1408             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1409           0 :                                 return -1;
    1410             :                         }
    1411           0 :                         object->in.unkn1 = test_var;
    1412             :                 } else {
    1413           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1414             :                           PyLong_Type.tp_name);
    1415           0 :                         return -1;
    1416             :                 }
    1417             :         }
    1418           0 :         return 0;
    1419             : }
    1420             : 
    1421           0 : static PyObject *py_mdssvc_unknown1_in_get_device_id(PyObject *obj, void *closure)
    1422             : {
    1423           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1424             :         PyObject *py_device_id;
    1425           0 :         py_device_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.device_id);
    1426           0 :         return py_device_id;
    1427             : }
    1428             : 
    1429           0 : static int py_mdssvc_unknown1_in_set_device_id(PyObject *py_obj, PyObject *value, void *closure)
    1430             : {
    1431           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1432           0 :         if (value == NULL) {
    1433           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.device_id");
    1434           0 :                 return -1;
    1435             :         }
    1436             :         {
    1437           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.device_id));
    1438           0 :                 if (PyLong_Check(value)) {
    1439             :                         unsigned long long test_var;
    1440           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1441           0 :                         if (PyErr_Occurred() != NULL) {
    1442           0 :                                 return -1;
    1443             :                         }
    1444           0 :                         if (test_var > uint_max) {
    1445           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1446             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1447           0 :                                 return -1;
    1448             :                         }
    1449           0 :                         object->in.device_id = test_var;
    1450             :                 } else {
    1451           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1452             :                           PyLong_Type.tp_name);
    1453           0 :                         return -1;
    1454             :                 }
    1455             :         }
    1456           0 :         return 0;
    1457             : }
    1458             : 
    1459           0 : static PyObject *py_mdssvc_unknown1_in_get_unkn3(PyObject *obj, void *closure)
    1460             : {
    1461           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1462             :         PyObject *py_unkn3;
    1463           0 :         py_unkn3 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn3);
    1464           0 :         return py_unkn3;
    1465             : }
    1466             : 
    1467           0 : static int py_mdssvc_unknown1_in_set_unkn3(PyObject *py_obj, PyObject *value, void *closure)
    1468             : {
    1469           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1470           0 :         if (value == NULL) {
    1471           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn3");
    1472           0 :                 return -1;
    1473             :         }
    1474             :         {
    1475           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn3));
    1476           0 :                 if (PyLong_Check(value)) {
    1477             :                         unsigned long long test_var;
    1478           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1479           0 :                         if (PyErr_Occurred() != NULL) {
    1480           0 :                                 return -1;
    1481             :                         }
    1482           0 :                         if (test_var > uint_max) {
    1483           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1484             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1485           0 :                                 return -1;
    1486             :                         }
    1487           0 :                         object->in.unkn3 = test_var;
    1488             :                 } else {
    1489           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1490             :                           PyLong_Type.tp_name);
    1491           0 :                         return -1;
    1492             :                 }
    1493             :         }
    1494           0 :         return 0;
    1495             : }
    1496             : 
    1497           0 : static PyObject *py_mdssvc_unknown1_in_get_unkn4(PyObject *obj, void *closure)
    1498             : {
    1499           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1500             :         PyObject *py_unkn4;
    1501           0 :         py_unkn4 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn4);
    1502           0 :         return py_unkn4;
    1503             : }
    1504             : 
    1505           0 : static int py_mdssvc_unknown1_in_set_unkn4(PyObject *py_obj, PyObject *value, void *closure)
    1506             : {
    1507           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1508           0 :         if (value == NULL) {
    1509           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn4");
    1510           0 :                 return -1;
    1511             :         }
    1512             :         {
    1513           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn4));
    1514           0 :                 if (PyLong_Check(value)) {
    1515             :                         unsigned long long test_var;
    1516           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1517           0 :                         if (PyErr_Occurred() != NULL) {
    1518           0 :                                 return -1;
    1519             :                         }
    1520           0 :                         if (test_var > uint_max) {
    1521           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1522             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1523           0 :                                 return -1;
    1524             :                         }
    1525           0 :                         object->in.unkn4 = test_var;
    1526             :                 } else {
    1527           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1528             :                           PyLong_Type.tp_name);
    1529           0 :                         return -1;
    1530             :                 }
    1531             :         }
    1532           0 :         return 0;
    1533             : }
    1534             : 
    1535           0 : static PyObject *py_mdssvc_unknown1_in_get_uid(PyObject *obj, void *closure)
    1536             : {
    1537           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1538             :         PyObject *py_uid;
    1539           0 :         py_uid = PyLong_FromUnsignedLongLong((uint32_t)object->in.uid);
    1540           0 :         return py_uid;
    1541             : }
    1542             : 
    1543           0 : static int py_mdssvc_unknown1_in_set_uid(PyObject *py_obj, PyObject *value, void *closure)
    1544             : {
    1545           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1546           0 :         if (value == NULL) {
    1547           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.uid");
    1548           0 :                 return -1;
    1549             :         }
    1550             :         {
    1551           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.uid));
    1552           0 :                 if (PyLong_Check(value)) {
    1553             :                         unsigned long long test_var;
    1554           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1555           0 :                         if (PyErr_Occurred() != NULL) {
    1556           0 :                                 return -1;
    1557             :                         }
    1558           0 :                         if (test_var > uint_max) {
    1559           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1560             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1561           0 :                                 return -1;
    1562             :                         }
    1563           0 :                         object->in.uid = test_var;
    1564             :                 } else {
    1565           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1566             :                           PyLong_Type.tp_name);
    1567           0 :                         return -1;
    1568             :                 }
    1569             :         }
    1570           0 :         return 0;
    1571             : }
    1572             : 
    1573           0 : static PyObject *py_mdssvc_unknown1_in_get_gid(PyObject *obj, void *closure)
    1574             : {
    1575           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1576             :         PyObject *py_gid;
    1577           0 :         py_gid = PyLong_FromUnsignedLongLong((uint32_t)object->in.gid);
    1578           0 :         return py_gid;
    1579             : }
    1580             : 
    1581           0 : static int py_mdssvc_unknown1_in_set_gid(PyObject *py_obj, PyObject *value, void *closure)
    1582             : {
    1583           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1584           0 :         if (value == NULL) {
    1585           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.gid");
    1586           0 :                 return -1;
    1587             :         }
    1588             :         {
    1589           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.gid));
    1590           0 :                 if (PyLong_Check(value)) {
    1591             :                         unsigned long long test_var;
    1592           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1593           0 :                         if (PyErr_Occurred() != NULL) {
    1594           0 :                                 return -1;
    1595             :                         }
    1596           0 :                         if (test_var > uint_max) {
    1597           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1598             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1599           0 :                                 return -1;
    1600             :                         }
    1601           0 :                         object->in.gid = test_var;
    1602             :                 } else {
    1603           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1604             :                           PyLong_Type.tp_name);
    1605           0 :                         return -1;
    1606             :                 }
    1607             :         }
    1608           0 :         return 0;
    1609             : }
    1610             : 
    1611           0 : static PyObject *py_mdssvc_unknown1_out_get_status(PyObject *obj, void *closure)
    1612             : {
    1613           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1614             :         PyObject *py_status;
    1615           0 :         if (object->out.status == NULL) {
    1616           0 :                 Py_RETURN_NONE;
    1617             :         }
    1618           0 :         py_status = PyLong_FromUnsignedLongLong((uint32_t)*object->out.status);
    1619           0 :         return py_status;
    1620             : }
    1621             : 
    1622           0 : static int py_mdssvc_unknown1_out_set_status(PyObject *py_obj, PyObject *value, void *closure)
    1623             : {
    1624           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1625           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.status));
    1626           0 :         if (value == NULL) {
    1627           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.status");
    1628           0 :                 return -1;
    1629             :         }
    1630           0 :         object->out.status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.status);
    1631           0 :         if (object->out.status == NULL) {
    1632           0 :                 PyErr_NoMemory();
    1633           0 :                 return -1;
    1634             :         }
    1635             :         {
    1636           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.status));
    1637           0 :                 if (PyLong_Check(value)) {
    1638             :                         unsigned long long test_var;
    1639           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1640           0 :                         if (PyErr_Occurred() != NULL) {
    1641           0 :                                 return -1;
    1642             :                         }
    1643           0 :                         if (test_var > uint_max) {
    1644           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1645             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1646           0 :                                 return -1;
    1647             :                         }
    1648           0 :                         *object->out.status = test_var;
    1649             :                 } else {
    1650           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1651             :                           PyLong_Type.tp_name);
    1652           0 :                         return -1;
    1653             :                 }
    1654             :         }
    1655           0 :         return 0;
    1656             : }
    1657             : 
    1658           0 : static PyObject *py_mdssvc_unknown1_out_get_flags(PyObject *obj, void *closure)
    1659             : {
    1660           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1661             :         PyObject *py_flags;
    1662           0 :         if (object->out.flags == NULL) {
    1663           0 :                 Py_RETURN_NONE;
    1664             :         }
    1665           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.flags);
    1666           0 :         return py_flags;
    1667             : }
    1668             : 
    1669           0 : static int py_mdssvc_unknown1_out_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    1670             : {
    1671           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1672           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.flags));
    1673           0 :         if (value == NULL) {
    1674           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.flags");
    1675           0 :                 return -1;
    1676             :         }
    1677           0 :         object->out.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.flags);
    1678           0 :         if (object->out.flags == NULL) {
    1679           0 :                 PyErr_NoMemory();
    1680           0 :                 return -1;
    1681             :         }
    1682             :         {
    1683           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.flags));
    1684           0 :                 if (PyLong_Check(value)) {
    1685             :                         unsigned long long test_var;
    1686           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1687           0 :                         if (PyErr_Occurred() != NULL) {
    1688           0 :                                 return -1;
    1689             :                         }
    1690           0 :                         if (test_var > uint_max) {
    1691           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1692             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1693           0 :                                 return -1;
    1694             :                         }
    1695           0 :                         *object->out.flags = test_var;
    1696             :                 } else {
    1697           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1698             :                           PyLong_Type.tp_name);
    1699           0 :                         return -1;
    1700             :                 }
    1701             :         }
    1702           0 :         return 0;
    1703             : }
    1704             : 
    1705           0 : static PyObject *py_mdssvc_unknown1_out_get_unkn7(PyObject *obj, void *closure)
    1706             : {
    1707           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(obj);
    1708             :         PyObject *py_unkn7;
    1709           0 :         if (object->out.unkn7 == NULL) {
    1710           0 :                 Py_RETURN_NONE;
    1711             :         }
    1712           0 :         py_unkn7 = PyLong_FromUnsignedLongLong((uint32_t)*object->out.unkn7);
    1713           0 :         return py_unkn7;
    1714             : }
    1715             : 
    1716           0 : static int py_mdssvc_unknown1_out_set_unkn7(PyObject *py_obj, PyObject *value, void *closure)
    1717             : {
    1718           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1719           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.unkn7));
    1720           0 :         if (value == NULL) {
    1721           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.unkn7");
    1722           0 :                 return -1;
    1723             :         }
    1724           0 :         object->out.unkn7 = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.unkn7);
    1725           0 :         if (object->out.unkn7 == NULL) {
    1726           0 :                 PyErr_NoMemory();
    1727           0 :                 return -1;
    1728             :         }
    1729             :         {
    1730           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.unkn7));
    1731           0 :                 if (PyLong_Check(value)) {
    1732             :                         unsigned long long test_var;
    1733           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1734           0 :                         if (PyErr_Occurred() != NULL) {
    1735           0 :                                 return -1;
    1736             :                         }
    1737           0 :                         if (test_var > uint_max) {
    1738           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1739             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1740           0 :                                 return -1;
    1741             :                         }
    1742           0 :                         *object->out.unkn7 = test_var;
    1743             :                 } else {
    1744           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1745             :                           PyLong_Type.tp_name);
    1746           0 :                         return -1;
    1747             :                 }
    1748             :         }
    1749           0 :         return 0;
    1750             : }
    1751             : 
    1752             : static PyGetSetDef py_mdssvc_unknown1_getsetters[] = {
    1753             :         {
    1754             :                 .name = discard_const_p(char, "in_handle"),
    1755             :                 .get = py_mdssvc_unknown1_in_get_handle,
    1756             :                 .set = py_mdssvc_unknown1_in_set_handle,
    1757             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    1758             :         },
    1759             :         {
    1760             :                 .name = discard_const_p(char, "in_unkn1"),
    1761             :                 .get = py_mdssvc_unknown1_in_get_unkn1,
    1762             :                 .set = py_mdssvc_unknown1_in_set_unkn1,
    1763             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1764             :         },
    1765             :         {
    1766             :                 .name = discard_const_p(char, "in_device_id"),
    1767             :                 .get = py_mdssvc_unknown1_in_get_device_id,
    1768             :                 .set = py_mdssvc_unknown1_in_set_device_id,
    1769             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1770             :         },
    1771             :         {
    1772             :                 .name = discard_const_p(char, "in_unkn3"),
    1773             :                 .get = py_mdssvc_unknown1_in_get_unkn3,
    1774             :                 .set = py_mdssvc_unknown1_in_set_unkn3,
    1775             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1776             :         },
    1777             :         {
    1778             :                 .name = discard_const_p(char, "in_unkn4"),
    1779             :                 .get = py_mdssvc_unknown1_in_get_unkn4,
    1780             :                 .set = py_mdssvc_unknown1_in_set_unkn4,
    1781             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1782             :         },
    1783             :         {
    1784             :                 .name = discard_const_p(char, "in_uid"),
    1785             :                 .get = py_mdssvc_unknown1_in_get_uid,
    1786             :                 .set = py_mdssvc_unknown1_in_set_uid,
    1787             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1788             :         },
    1789             :         {
    1790             :                 .name = discard_const_p(char, "in_gid"),
    1791             :                 .get = py_mdssvc_unknown1_in_get_gid,
    1792             :                 .set = py_mdssvc_unknown1_in_set_gid,
    1793             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1794             :         },
    1795             :         {
    1796             :                 .name = discard_const_p(char, "out_status"),
    1797             :                 .get = py_mdssvc_unknown1_out_get_status,
    1798             :                 .set = py_mdssvc_unknown1_out_set_status,
    1799             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1800             :         },
    1801             :         {
    1802             :                 .name = discard_const_p(char, "out_flags"),
    1803             :                 .get = py_mdssvc_unknown1_out_get_flags,
    1804             :                 .set = py_mdssvc_unknown1_out_set_flags,
    1805             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1806             :         },
    1807             :         {
    1808             :                 .name = discard_const_p(char, "out_unkn7"),
    1809             :                 .get = py_mdssvc_unknown1_out_get_unkn7,
    1810             :                 .set = py_mdssvc_unknown1_out_set_unkn7,
    1811             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1812             :         },
    1813             :         { .name = NULL }
    1814             : };
    1815             : 
    1816           0 : static PyObject *py_mdssvc_unknown1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1817             : {
    1818           0 :         PyObject *self = pytalloc_new(struct mdssvc_unknown1, type);
    1819           0 :         struct mdssvc_unknown1 *_self = (struct mdssvc_unknown1 *)pytalloc_get_ptr(self);
    1820           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    1821           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    1822           0 :         _self->out.status = talloc_zero(mem_ctx, uint32_t);
    1823           0 :         _self->out.flags = talloc_zero(mem_ctx, uint32_t);
    1824           0 :         _self->out.unkn7 = talloc_zero(mem_ctx, uint32_t);
    1825           0 :         return self;
    1826             : }
    1827             : 
    1828           0 : static PyObject *py_mdssvc_unknown1_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    1829             : {
    1830             : 
    1831             : 
    1832           0 :         return PyLong_FromLong(1);
    1833             : }
    1834             : 
    1835           0 : static PyObject *py_mdssvc_unknown1_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    1836             : {
    1837           0 :         const struct ndr_interface_call *call = NULL;
    1838           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1839           0 :         PyObject *ret = NULL;
    1840           0 :         struct ndr_push *push = NULL;
    1841             :         DATA_BLOB blob;
    1842             :         enum ndr_err_code err;
    1843             : 
    1844           0 :         if (ndr_table_mdssvc.num_calls < 2) {
    1845           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_unknown1_ndr_pack");
    1846           0 :                 return NULL;
    1847             :         }
    1848           0 :         call = &ndr_table_mdssvc.calls[1];
    1849             : 
    1850           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    1851           0 :         if (push == NULL) {
    1852           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1853           0 :                 return NULL;
    1854             :         }
    1855             : 
    1856           0 :         push->flags |= ndr_push_flags;
    1857             : 
    1858           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    1859           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1860           0 :                 TALLOC_FREE(push);
    1861           0 :                 PyErr_SetNdrError(err);
    1862           0 :                 return NULL;
    1863             :         }
    1864           0 :         blob = ndr_push_blob(push);
    1865           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1866           0 :         TALLOC_FREE(push);
    1867           0 :         return ret;
    1868             : }
    1869             : 
    1870           0 : static PyObject *py_mdssvc_unknown1_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1871             : {
    1872           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    1873           0 :         PyObject *bigendian_obj = NULL;
    1874           0 :         PyObject *ndr64_obj = NULL;
    1875           0 :         uint32_t ndr_push_flags = 0;
    1876             : 
    1877           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    1878             :                 discard_const_p(char *, kwnames),
    1879             :                 &bigendian_obj,
    1880             :                 &ndr64_obj)) {
    1881           0 :                 return NULL;
    1882             :         }
    1883             : 
    1884           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    1885           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    1886             :         }
    1887           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    1888           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    1889             :         }
    1890             : 
    1891           0 :         return py_mdssvc_unknown1_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    1892             : }
    1893             : 
    1894           0 : static PyObject *py_mdssvc_unknown1_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1895             : {
    1896           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    1897           0 :         PyObject *bigendian_obj = NULL;
    1898           0 :         PyObject *ndr64_obj = NULL;
    1899           0 :         uint32_t ndr_push_flags = 0;
    1900             : 
    1901           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    1902             :                 discard_const_p(char *, kwnames),
    1903             :                 &bigendian_obj,
    1904             :                 &ndr64_obj)) {
    1905           0 :                 return NULL;
    1906             :         }
    1907             : 
    1908           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    1909           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    1910             :         }
    1911           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    1912           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    1913             :         }
    1914             : 
    1915           0 :         return py_mdssvc_unknown1_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    1916             : }
    1917             : 
    1918           0 : static PyObject *py_mdssvc_unknown1_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    1919             : {
    1920           0 :         const struct ndr_interface_call *call = NULL;
    1921           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    1922           0 :         struct ndr_pull *pull = NULL;
    1923             :         enum ndr_err_code err;
    1924             : 
    1925           0 :         if (ndr_table_mdssvc.num_calls < 2) {
    1926           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_unknown1_ndr_unpack");
    1927           0 :                 return NULL;
    1928             :         }
    1929           0 :         call = &ndr_table_mdssvc.calls[1];
    1930             : 
    1931           0 :         pull = ndr_pull_init_blob(blob, object);
    1932           0 :         if (pull == NULL) {
    1933           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1934           0 :                 return NULL;
    1935             :         }
    1936             : 
    1937           0 :         pull->flags |= ndr_pull_flags;
    1938             : 
    1939           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    1940           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1941           0 :                 TALLOC_FREE(pull);
    1942           0 :                 PyErr_SetNdrError(err);
    1943           0 :                 return NULL;
    1944             :         }
    1945           0 :         if (!allow_remaining) {
    1946             :                 uint32_t highest_ofs;
    1947             : 
    1948           0 :                 if (pull->offset > pull->relative_highest_offset) {
    1949           0 :                         highest_ofs = pull->offset;
    1950             :                 } else {
    1951           0 :                         highest_ofs = pull->relative_highest_offset;
    1952             :                 }
    1953           0 :                 if (highest_ofs < pull->data_size) {
    1954           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    1955             :                                 "not all bytes consumed ofs[%u] size[%u]",
    1956             :                                 highest_ofs, pull->data_size);
    1957           0 :                         TALLOC_FREE(pull);
    1958           0 :                         PyErr_SetNdrError(err);
    1959           0 :                         return NULL;
    1960             :                 }
    1961             :         }
    1962             : 
    1963           0 :         TALLOC_FREE(pull);
    1964           0 :         Py_RETURN_NONE;
    1965             : }
    1966             : 
    1967           0 : static PyObject *py_mdssvc_unknown1_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1968             : {
    1969             :         DATA_BLOB blob;
    1970           0 :         Py_ssize_t blob_length = 0;
    1971           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    1972           0 :         PyObject *bigendian_obj = NULL;
    1973           0 :         PyObject *ndr64_obj = NULL;
    1974           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    1975           0 :         PyObject *allow_remaining_obj = NULL;
    1976           0 :         bool allow_remaining = false;
    1977             : 
    1978           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    1979             :                 discard_const_p(char *, kwnames),
    1980             :                 &blob.data, &blob_length,
    1981             :                 &bigendian_obj,
    1982             :                 &ndr64_obj,
    1983             :                 &allow_remaining_obj)) {
    1984           0 :                 return NULL;
    1985             :         }
    1986           0 :         blob.length = blob_length;
    1987             : 
    1988           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    1989           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    1990             :         }
    1991           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    1992           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    1993             :         }
    1994             : 
    1995           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1996           0 :                 allow_remaining = true;
    1997             :         }
    1998             : 
    1999           0 :         return py_mdssvc_unknown1_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    2000             : }
    2001             : 
    2002           0 : static PyObject *py_mdssvc_unknown1_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2003             : {
    2004             :         DATA_BLOB blob;
    2005           0 :         Py_ssize_t blob_length = 0;
    2006           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    2007           0 :         PyObject *bigendian_obj = NULL;
    2008           0 :         PyObject *ndr64_obj = NULL;
    2009           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    2010           0 :         PyObject *allow_remaining_obj = NULL;
    2011           0 :         bool allow_remaining = false;
    2012             : 
    2013           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    2014             :                 discard_const_p(char *, kwnames),
    2015             :                 &blob.data, &blob_length,
    2016             :                 &bigendian_obj,
    2017             :                 &ndr64_obj,
    2018             :                 &allow_remaining_obj)) {
    2019           0 :                 return NULL;
    2020             :         }
    2021           0 :         blob.length = blob_length;
    2022             : 
    2023           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2024           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    2025             :         }
    2026           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2027           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    2028             :         }
    2029             : 
    2030           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2031           0 :                 allow_remaining = true;
    2032             :         }
    2033             : 
    2034           0 :         return py_mdssvc_unknown1_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    2035             : }
    2036             : 
    2037           0 : static PyObject *py_mdssvc_unknown1_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    2038             : {
    2039           0 :         const struct ndr_interface_call *call = NULL;
    2040           0 :         struct mdssvc_unknown1 *object = (struct mdssvc_unknown1 *)pytalloc_get_ptr(py_obj);
    2041             :         PyObject *ret;
    2042             :         char *retstr;
    2043             : 
    2044           0 :         if (ndr_table_mdssvc.num_calls < 2) {
    2045           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_unknown1_ndr_print");
    2046           0 :                 return NULL;
    2047             :         }
    2048           0 :         call = &ndr_table_mdssvc.calls[1];
    2049             : 
    2050           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    2051           0 :         ret = PyUnicode_FromString(retstr);
    2052           0 :         TALLOC_FREE(retstr);
    2053             : 
    2054           0 :         return ret;
    2055             : }
    2056             : 
    2057           0 : static PyObject *py_mdssvc_unknown1_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2058             : {
    2059           0 :         return py_mdssvc_unknown1_ndr_print(py_obj, "mdssvc_unknown1_in", NDR_IN);
    2060             : }
    2061             : 
    2062           0 : static PyObject *py_mdssvc_unknown1_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2063             : {
    2064           0 :         return py_mdssvc_unknown1_ndr_print(py_obj, "mdssvc_unknown1_out", NDR_OUT);
    2065             : }
    2066             : 
    2067             : static PyMethodDef py_mdssvc_unknown1_methods[] = {
    2068             :         { "opnum", (PyCFunction)py_mdssvc_unknown1_ndr_opnum, METH_NOARGS|METH_CLASS,
    2069             :                 "mdssvc.unknown1.opnum() -> 1 (0x01) " },
    2070             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_unknown1_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    2071             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    2072             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_unknown1_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    2073             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    2074             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_unknown1_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    2075             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    2076             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_unknown1_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    2077             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    2078             :         { "__ndr_print_in__", (PyCFunction)py_mdssvc_unknown1_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    2079             :         { "__ndr_print_out__", (PyCFunction)py_mdssvc_unknown1_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    2080             :         { NULL, NULL, 0, NULL }
    2081             : };
    2082             : 
    2083             : 
    2084             : static PyTypeObject mdssvc_unknown1_Type = {
    2085             :         PyVarObject_HEAD_INIT(NULL, 0)
    2086             :         .tp_name = "mdssvc.unknown1",
    2087             :         .tp_getset = py_mdssvc_unknown1_getsetters,
    2088             :         .tp_methods = py_mdssvc_unknown1_methods,
    2089             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2090             :         .tp_new = py_mdssvc_unknown1_new,
    2091             : };
    2092             : 
    2093           0 : static bool pack_py_mdssvc_unknown1_args_in(PyObject *args, PyObject *kwargs, struct mdssvc_unknown1 *r)
    2094             : {
    2095             :         PyObject *py_handle;
    2096             :         PyObject *py_unkn1;
    2097             :         PyObject *py_device_id;
    2098             :         PyObject *py_unkn3;
    2099             :         PyObject *py_unkn4;
    2100             :         PyObject *py_uid;
    2101             :         PyObject *py_gid;
    2102           0 :         const char *kwnames[] = {
    2103             :                 "handle", "unkn1", "device_id", "unkn3", "unkn4", "uid", "gid", NULL
    2104             :         };
    2105             : 
    2106           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:mdssvc_unknown1", discard_const_p(char *, kwnames), &py_handle, &py_unkn1, &py_device_id, &py_unkn3, &py_unkn4, &py_uid, &py_gid)) {
    2107           0 :                 return false;
    2108             :         }
    2109             : 
    2110           0 :         if (py_handle == NULL) {
    2111           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    2112           0 :                 return false;
    2113             :         }
    2114           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    2115           0 :         if (r->in.handle == NULL) {
    2116           0 :                 PyErr_NoMemory();
    2117           0 :                 return false;
    2118             :         }
    2119           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    2120           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    2121           0 :                 PyErr_NoMemory();
    2122           0 :                 return false;
    2123             :         }
    2124           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    2125           0 :         if (py_unkn1 == NULL) {
    2126           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn1");
    2127           0 :                 return false;
    2128             :         }
    2129             :         {
    2130           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn1));
    2131           0 :                 if (PyLong_Check(py_unkn1)) {
    2132             :                         unsigned long long test_var;
    2133           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn1);
    2134           0 :                         if (PyErr_Occurred() != NULL) {
    2135           0 :                                 return false;
    2136             :                         }
    2137           0 :                         if (test_var > uint_max) {
    2138           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2139             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2140           0 :                                 return false;
    2141             :                         }
    2142           0 :                         r->in.unkn1 = test_var;
    2143             :                 } else {
    2144           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2145             :                           PyLong_Type.tp_name);
    2146           0 :                         return false;
    2147             :                 }
    2148             :         }
    2149           0 :         if (py_device_id == NULL) {
    2150           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.device_id");
    2151           0 :                 return false;
    2152             :         }
    2153             :         {
    2154           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.device_id));
    2155           0 :                 if (PyLong_Check(py_device_id)) {
    2156             :                         unsigned long long test_var;
    2157           0 :                         test_var = PyLong_AsUnsignedLongLong(py_device_id);
    2158           0 :                         if (PyErr_Occurred() != NULL) {
    2159           0 :                                 return false;
    2160             :                         }
    2161           0 :                         if (test_var > uint_max) {
    2162           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2163             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2164           0 :                                 return false;
    2165             :                         }
    2166           0 :                         r->in.device_id = test_var;
    2167             :                 } else {
    2168           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2169             :                           PyLong_Type.tp_name);
    2170           0 :                         return false;
    2171             :                 }
    2172             :         }
    2173           0 :         if (py_unkn3 == NULL) {
    2174           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn3");
    2175           0 :                 return false;
    2176             :         }
    2177             :         {
    2178           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn3));
    2179           0 :                 if (PyLong_Check(py_unkn3)) {
    2180             :                         unsigned long long test_var;
    2181           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn3);
    2182           0 :                         if (PyErr_Occurred() != NULL) {
    2183           0 :                                 return false;
    2184             :                         }
    2185           0 :                         if (test_var > uint_max) {
    2186           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2187             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2188           0 :                                 return false;
    2189             :                         }
    2190           0 :                         r->in.unkn3 = test_var;
    2191             :                 } else {
    2192           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2193             :                           PyLong_Type.tp_name);
    2194           0 :                         return false;
    2195             :                 }
    2196             :         }
    2197           0 :         if (py_unkn4 == NULL) {
    2198           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn4");
    2199           0 :                 return false;
    2200             :         }
    2201             :         {
    2202           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn4));
    2203           0 :                 if (PyLong_Check(py_unkn4)) {
    2204             :                         unsigned long long test_var;
    2205           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn4);
    2206           0 :                         if (PyErr_Occurred() != NULL) {
    2207           0 :                                 return false;
    2208             :                         }
    2209           0 :                         if (test_var > uint_max) {
    2210           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2211             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2212           0 :                                 return false;
    2213             :                         }
    2214           0 :                         r->in.unkn4 = test_var;
    2215             :                 } else {
    2216           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2217             :                           PyLong_Type.tp_name);
    2218           0 :                         return false;
    2219             :                 }
    2220             :         }
    2221           0 :         if (py_uid == NULL) {
    2222           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.uid");
    2223           0 :                 return false;
    2224             :         }
    2225             :         {
    2226           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.uid));
    2227           0 :                 if (PyLong_Check(py_uid)) {
    2228             :                         unsigned long long test_var;
    2229           0 :                         test_var = PyLong_AsUnsignedLongLong(py_uid);
    2230           0 :                         if (PyErr_Occurred() != NULL) {
    2231           0 :                                 return false;
    2232             :                         }
    2233           0 :                         if (test_var > uint_max) {
    2234           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2235             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2236           0 :                                 return false;
    2237             :                         }
    2238           0 :                         r->in.uid = test_var;
    2239             :                 } else {
    2240           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2241             :                           PyLong_Type.tp_name);
    2242           0 :                         return false;
    2243             :                 }
    2244             :         }
    2245           0 :         if (py_gid == NULL) {
    2246           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.gid");
    2247           0 :                 return false;
    2248             :         }
    2249             :         {
    2250           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.gid));
    2251           0 :                 if (PyLong_Check(py_gid)) {
    2252             :                         unsigned long long test_var;
    2253           0 :                         test_var = PyLong_AsUnsignedLongLong(py_gid);
    2254           0 :                         if (PyErr_Occurred() != NULL) {
    2255           0 :                                 return false;
    2256             :                         }
    2257           0 :                         if (test_var > uint_max) {
    2258           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2259             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2260           0 :                                 return false;
    2261             :                         }
    2262           0 :                         r->in.gid = test_var;
    2263             :                 } else {
    2264           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2265             :                           PyLong_Type.tp_name);
    2266           0 :                         return false;
    2267             :                 }
    2268             :         }
    2269           0 :         return true;
    2270             : }
    2271             : 
    2272           0 : static PyObject *unpack_py_mdssvc_unknown1_args_out(struct mdssvc_unknown1 *r)
    2273             : {
    2274             :         PyObject *result;
    2275             :         PyObject *py_status;
    2276             :         PyObject *py_flags;
    2277             :         PyObject *py_unkn7;
    2278           0 :         result = PyTuple_New(3);
    2279           0 :         py_status = PyLong_FromUnsignedLongLong((uint32_t)*r->out.status);
    2280           0 :         PyTuple_SetItem(result, 0, py_status);
    2281           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.flags);
    2282           0 :         PyTuple_SetItem(result, 1, py_flags);
    2283           0 :         py_unkn7 = PyLong_FromUnsignedLongLong((uint32_t)*r->out.unkn7);
    2284           0 :         PyTuple_SetItem(result, 2, py_unkn7);
    2285           0 :         return result;
    2286             : }
    2287             : 
    2288             : 
    2289           0 : static PyObject *py_mdssvc_cmd_in_get_handle(PyObject *obj, void *closure)
    2290             : {
    2291           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2292             :         PyObject *py_handle;
    2293           0 :         if (object->in.handle == NULL) {
    2294           0 :                 Py_RETURN_NONE;
    2295             :         }
    2296           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    2297           0 :         return py_handle;
    2298             : }
    2299             : 
    2300           0 : static int py_mdssvc_cmd_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    2301             : {
    2302           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2303           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    2304           0 :         if (value == NULL) {
    2305           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    2306           0 :                 return -1;
    2307             :         }
    2308           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    2309           0 :         if (object->in.handle == NULL) {
    2310           0 :                 PyErr_NoMemory();
    2311           0 :                 return -1;
    2312             :         }
    2313           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    2314           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2315           0 :                 PyErr_NoMemory();
    2316           0 :                 return -1;
    2317             :         }
    2318           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    2319           0 :         return 0;
    2320             : }
    2321             : 
    2322           0 : static PyObject *py_mdssvc_cmd_in_get_unkn1(PyObject *obj, void *closure)
    2323             : {
    2324           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2325             :         PyObject *py_unkn1;
    2326           0 :         py_unkn1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn1);
    2327           0 :         return py_unkn1;
    2328             : }
    2329             : 
    2330           0 : static int py_mdssvc_cmd_in_set_unkn1(PyObject *py_obj, PyObject *value, void *closure)
    2331             : {
    2332           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2333           0 :         if (value == NULL) {
    2334           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn1");
    2335           0 :                 return -1;
    2336             :         }
    2337             :         {
    2338           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn1));
    2339           0 :                 if (PyLong_Check(value)) {
    2340             :                         unsigned long long test_var;
    2341           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2342           0 :                         if (PyErr_Occurred() != NULL) {
    2343           0 :                                 return -1;
    2344             :                         }
    2345           0 :                         if (test_var > uint_max) {
    2346           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2347             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2348           0 :                                 return -1;
    2349             :                         }
    2350           0 :                         object->in.unkn1 = test_var;
    2351             :                 } else {
    2352           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2353             :                           PyLong_Type.tp_name);
    2354           0 :                         return -1;
    2355             :                 }
    2356             :         }
    2357           0 :         return 0;
    2358             : }
    2359             : 
    2360           0 : static PyObject *py_mdssvc_cmd_in_get_device_id(PyObject *obj, void *closure)
    2361             : {
    2362           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2363             :         PyObject *py_device_id;
    2364           0 :         py_device_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.device_id);
    2365           0 :         return py_device_id;
    2366             : }
    2367             : 
    2368           0 : static int py_mdssvc_cmd_in_set_device_id(PyObject *py_obj, PyObject *value, void *closure)
    2369             : {
    2370           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2371           0 :         if (value == NULL) {
    2372           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.device_id");
    2373           0 :                 return -1;
    2374             :         }
    2375             :         {
    2376           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.device_id));
    2377           0 :                 if (PyLong_Check(value)) {
    2378             :                         unsigned long long test_var;
    2379           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2380           0 :                         if (PyErr_Occurred() != NULL) {
    2381           0 :                                 return -1;
    2382             :                         }
    2383           0 :                         if (test_var > uint_max) {
    2384           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2385             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2386           0 :                                 return -1;
    2387             :                         }
    2388           0 :                         object->in.device_id = test_var;
    2389             :                 } else {
    2390           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2391             :                           PyLong_Type.tp_name);
    2392           0 :                         return -1;
    2393             :                 }
    2394             :         }
    2395           0 :         return 0;
    2396             : }
    2397             : 
    2398           0 : static PyObject *py_mdssvc_cmd_in_get_unkn3(PyObject *obj, void *closure)
    2399             : {
    2400           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2401             :         PyObject *py_unkn3;
    2402           0 :         py_unkn3 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn3);
    2403           0 :         return py_unkn3;
    2404             : }
    2405             : 
    2406           0 : static int py_mdssvc_cmd_in_set_unkn3(PyObject *py_obj, PyObject *value, void *closure)
    2407             : {
    2408           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2409           0 :         if (value == NULL) {
    2410           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn3");
    2411           0 :                 return -1;
    2412             :         }
    2413             :         {
    2414           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn3));
    2415           0 :                 if (PyLong_Check(value)) {
    2416             :                         unsigned long long test_var;
    2417           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2418           0 :                         if (PyErr_Occurred() != NULL) {
    2419           0 :                                 return -1;
    2420             :                         }
    2421           0 :                         if (test_var > uint_max) {
    2422           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2423             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2424           0 :                                 return -1;
    2425             :                         }
    2426           0 :                         object->in.unkn3 = test_var;
    2427             :                 } else {
    2428           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2429             :                           PyLong_Type.tp_name);
    2430           0 :                         return -1;
    2431             :                 }
    2432             :         }
    2433           0 :         return 0;
    2434             : }
    2435             : 
    2436           0 : static PyObject *py_mdssvc_cmd_in_get_unkn4(PyObject *obj, void *closure)
    2437             : {
    2438           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2439             :         PyObject *py_unkn4;
    2440           0 :         py_unkn4 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn4);
    2441           0 :         return py_unkn4;
    2442             : }
    2443             : 
    2444           0 : static int py_mdssvc_cmd_in_set_unkn4(PyObject *py_obj, PyObject *value, void *closure)
    2445             : {
    2446           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2447           0 :         if (value == NULL) {
    2448           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn4");
    2449           0 :                 return -1;
    2450             :         }
    2451             :         {
    2452           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn4));
    2453           0 :                 if (PyLong_Check(value)) {
    2454             :                         unsigned long long test_var;
    2455           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2456           0 :                         if (PyErr_Occurred() != NULL) {
    2457           0 :                                 return -1;
    2458             :                         }
    2459           0 :                         if (test_var > uint_max) {
    2460           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2461             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2462           0 :                                 return -1;
    2463             :                         }
    2464           0 :                         object->in.unkn4 = test_var;
    2465             :                 } else {
    2466           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2467             :                           PyLong_Type.tp_name);
    2468           0 :                         return -1;
    2469             :                 }
    2470             :         }
    2471           0 :         return 0;
    2472             : }
    2473             : 
    2474           0 : static PyObject *py_mdssvc_cmd_in_get_flags(PyObject *obj, void *closure)
    2475             : {
    2476           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2477             :         PyObject *py_flags;
    2478           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
    2479           0 :         return py_flags;
    2480             : }
    2481             : 
    2482           0 : static int py_mdssvc_cmd_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    2483             : {
    2484           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2485           0 :         if (value == NULL) {
    2486           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
    2487           0 :                 return -1;
    2488             :         }
    2489             :         {
    2490           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
    2491           0 :                 if (PyLong_Check(value)) {
    2492             :                         unsigned long long test_var;
    2493           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2494           0 :                         if (PyErr_Occurred() != NULL) {
    2495           0 :                                 return -1;
    2496             :                         }
    2497           0 :                         if (test_var > uint_max) {
    2498           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2499             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2500           0 :                                 return -1;
    2501             :                         }
    2502           0 :                         object->in.flags = test_var;
    2503             :                 } else {
    2504           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2505             :                           PyLong_Type.tp_name);
    2506           0 :                         return -1;
    2507             :                 }
    2508             :         }
    2509           0 :         return 0;
    2510             : }
    2511             : 
    2512           0 : static PyObject *py_mdssvc_cmd_in_get_request_blob(PyObject *obj, void *closure)
    2513             : {
    2514           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2515             :         PyObject *py_request_blob;
    2516           0 :         py_request_blob = pytalloc_reference_ex(&mdssvc_blob_Type, pytalloc_get_mem_ctx(obj), &object->in.request_blob);
    2517           0 :         return py_request_blob;
    2518             : }
    2519             : 
    2520           0 : static int py_mdssvc_cmd_in_set_request_blob(PyObject *py_obj, PyObject *value, void *closure)
    2521             : {
    2522           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2523           0 :         if (value == NULL) {
    2524           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.request_blob");
    2525           0 :                 return -1;
    2526             :         }
    2527           0 :         PY_CHECK_TYPE(&mdssvc_blob_Type, value, return -1;);
    2528           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2529           0 :                 PyErr_NoMemory();
    2530           0 :                 return -1;
    2531             :         }
    2532           0 :         object->in.request_blob = *(struct mdssvc_blob *)pytalloc_get_ptr(value);
    2533           0 :         return 0;
    2534             : }
    2535             : 
    2536           0 : static PyObject *py_mdssvc_cmd_in_get_unkn5(PyObject *obj, void *closure)
    2537             : {
    2538           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2539             :         PyObject *py_unkn5;
    2540           0 :         py_unkn5 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn5);
    2541           0 :         return py_unkn5;
    2542             : }
    2543             : 
    2544           0 : static int py_mdssvc_cmd_in_set_unkn5(PyObject *py_obj, PyObject *value, void *closure)
    2545             : {
    2546           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2547           0 :         if (value == NULL) {
    2548           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn5");
    2549           0 :                 return -1;
    2550             :         }
    2551             :         {
    2552           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn5));
    2553           0 :                 if (PyLong_Check(value)) {
    2554             :                         unsigned long long test_var;
    2555           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2556           0 :                         if (PyErr_Occurred() != NULL) {
    2557           0 :                                 return -1;
    2558             :                         }
    2559           0 :                         if (test_var > uint_max) {
    2560           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2561             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2562           0 :                                 return -1;
    2563             :                         }
    2564           0 :                         object->in.unkn5 = test_var;
    2565             :                 } else {
    2566           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2567             :                           PyLong_Type.tp_name);
    2568           0 :                         return -1;
    2569             :                 }
    2570             :         }
    2571           0 :         return 0;
    2572             : }
    2573             : 
    2574           0 : static PyObject *py_mdssvc_cmd_in_get_max_fragment_size1(PyObject *obj, void *closure)
    2575             : {
    2576           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2577             :         PyObject *py_max_fragment_size1;
    2578           0 :         py_max_fragment_size1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_fragment_size1);
    2579           0 :         return py_max_fragment_size1;
    2580             : }
    2581             : 
    2582           0 : static int py_mdssvc_cmd_in_set_max_fragment_size1(PyObject *py_obj, PyObject *value, void *closure)
    2583             : {
    2584           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2585           0 :         if (value == NULL) {
    2586           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_fragment_size1");
    2587           0 :                 return -1;
    2588             :         }
    2589             :         {
    2590           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_fragment_size1));
    2591           0 :                 if (PyLong_Check(value)) {
    2592             :                         unsigned long long test_var;
    2593           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2594           0 :                         if (PyErr_Occurred() != NULL) {
    2595           0 :                                 return -1;
    2596             :                         }
    2597           0 :                         if (test_var > uint_max) {
    2598           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2599             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2600           0 :                                 return -1;
    2601             :                         }
    2602           0 :                         object->in.max_fragment_size1 = test_var;
    2603             :                 } else {
    2604           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2605             :                           PyLong_Type.tp_name);
    2606           0 :                         return -1;
    2607             :                 }
    2608             :         }
    2609           0 :         return 0;
    2610             : }
    2611             : 
    2612           0 : static PyObject *py_mdssvc_cmd_in_get_unkn6(PyObject *obj, void *closure)
    2613             : {
    2614           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2615             :         PyObject *py_unkn6;
    2616           0 :         py_unkn6 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn6);
    2617           0 :         return py_unkn6;
    2618             : }
    2619             : 
    2620           0 : static int py_mdssvc_cmd_in_set_unkn6(PyObject *py_obj, PyObject *value, void *closure)
    2621             : {
    2622           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2623           0 :         if (value == NULL) {
    2624           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn6");
    2625           0 :                 return -1;
    2626             :         }
    2627             :         {
    2628           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn6));
    2629           0 :                 if (PyLong_Check(value)) {
    2630             :                         unsigned long long test_var;
    2631           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2632           0 :                         if (PyErr_Occurred() != NULL) {
    2633           0 :                                 return -1;
    2634             :                         }
    2635           0 :                         if (test_var > uint_max) {
    2636           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2637             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2638           0 :                                 return -1;
    2639             :                         }
    2640           0 :                         object->in.unkn6 = test_var;
    2641             :                 } else {
    2642           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2643             :                           PyLong_Type.tp_name);
    2644           0 :                         return -1;
    2645             :                 }
    2646             :         }
    2647           0 :         return 0;
    2648             : }
    2649             : 
    2650           0 : static PyObject *py_mdssvc_cmd_in_get_max_fragment_size2(PyObject *obj, void *closure)
    2651             : {
    2652           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2653             :         PyObject *py_max_fragment_size2;
    2654           0 :         py_max_fragment_size2 = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_fragment_size2);
    2655           0 :         return py_max_fragment_size2;
    2656             : }
    2657             : 
    2658           0 : static int py_mdssvc_cmd_in_set_max_fragment_size2(PyObject *py_obj, PyObject *value, void *closure)
    2659             : {
    2660           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2661           0 :         if (value == NULL) {
    2662           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_fragment_size2");
    2663           0 :                 return -1;
    2664             :         }
    2665             :         {
    2666           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_fragment_size2));
    2667           0 :                 if (PyLong_Check(value)) {
    2668             :                         unsigned long long test_var;
    2669           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2670           0 :                         if (PyErr_Occurred() != NULL) {
    2671           0 :                                 return -1;
    2672             :                         }
    2673           0 :                         if (test_var > uint_max) {
    2674           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2675             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2676           0 :                                 return -1;
    2677             :                         }
    2678           0 :                         object->in.max_fragment_size2 = test_var;
    2679             :                 } else {
    2680           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2681             :                           PyLong_Type.tp_name);
    2682           0 :                         return -1;
    2683             :                 }
    2684             :         }
    2685           0 :         return 0;
    2686             : }
    2687             : 
    2688           0 : static PyObject *py_mdssvc_cmd_in_get_unkn7(PyObject *obj, void *closure)
    2689             : {
    2690           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2691             :         PyObject *py_unkn7;
    2692           0 :         py_unkn7 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn7);
    2693           0 :         return py_unkn7;
    2694             : }
    2695             : 
    2696           0 : static int py_mdssvc_cmd_in_set_unkn7(PyObject *py_obj, PyObject *value, void *closure)
    2697             : {
    2698           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2699           0 :         if (value == NULL) {
    2700           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn7");
    2701           0 :                 return -1;
    2702             :         }
    2703             :         {
    2704           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn7));
    2705           0 :                 if (PyLong_Check(value)) {
    2706             :                         unsigned long long test_var;
    2707           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2708           0 :                         if (PyErr_Occurred() != NULL) {
    2709           0 :                                 return -1;
    2710             :                         }
    2711           0 :                         if (test_var > uint_max) {
    2712           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2713             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2714           0 :                                 return -1;
    2715             :                         }
    2716           0 :                         object->in.unkn7 = test_var;
    2717             :                 } else {
    2718           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2719             :                           PyLong_Type.tp_name);
    2720           0 :                         return -1;
    2721             :                 }
    2722             :         }
    2723           0 :         return 0;
    2724             : }
    2725             : 
    2726           0 : static PyObject *py_mdssvc_cmd_in_get_unkn8(PyObject *obj, void *closure)
    2727             : {
    2728           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2729             :         PyObject *py_unkn8;
    2730           0 :         py_unkn8 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn8);
    2731           0 :         return py_unkn8;
    2732             : }
    2733             : 
    2734           0 : static int py_mdssvc_cmd_in_set_unkn8(PyObject *py_obj, PyObject *value, void *closure)
    2735             : {
    2736           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2737           0 :         if (value == NULL) {
    2738           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn8");
    2739           0 :                 return -1;
    2740             :         }
    2741             :         {
    2742           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn8));
    2743           0 :                 if (PyLong_Check(value)) {
    2744             :                         unsigned long long test_var;
    2745           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2746           0 :                         if (PyErr_Occurred() != NULL) {
    2747           0 :                                 return -1;
    2748             :                         }
    2749           0 :                         if (test_var > uint_max) {
    2750           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2751             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2752           0 :                                 return -1;
    2753             :                         }
    2754           0 :                         object->in.unkn8 = test_var;
    2755             :                 } else {
    2756           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2757             :                           PyLong_Type.tp_name);
    2758           0 :                         return -1;
    2759             :                 }
    2760             :         }
    2761           0 :         return 0;
    2762             : }
    2763             : 
    2764           0 : static PyObject *py_mdssvc_cmd_out_get_fragment(PyObject *obj, void *closure)
    2765             : {
    2766           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2767             :         PyObject *py_fragment;
    2768           0 :         if (object->out.fragment == NULL) {
    2769           0 :                 Py_RETURN_NONE;
    2770             :         }
    2771           0 :         py_fragment = PyLong_FromUnsignedLongLong((uint32_t)*object->out.fragment);
    2772           0 :         return py_fragment;
    2773             : }
    2774             : 
    2775           0 : static int py_mdssvc_cmd_out_set_fragment(PyObject *py_obj, PyObject *value, void *closure)
    2776             : {
    2777           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2778           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.fragment));
    2779           0 :         if (value == NULL) {
    2780           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.fragment");
    2781           0 :                 return -1;
    2782             :         }
    2783           0 :         object->out.fragment = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.fragment);
    2784           0 :         if (object->out.fragment == NULL) {
    2785           0 :                 PyErr_NoMemory();
    2786           0 :                 return -1;
    2787             :         }
    2788             :         {
    2789           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.fragment));
    2790           0 :                 if (PyLong_Check(value)) {
    2791             :                         unsigned long long test_var;
    2792           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2793           0 :                         if (PyErr_Occurred() != NULL) {
    2794           0 :                                 return -1;
    2795             :                         }
    2796           0 :                         if (test_var > uint_max) {
    2797           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2798             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2799           0 :                                 return -1;
    2800             :                         }
    2801           0 :                         *object->out.fragment = test_var;
    2802             :                 } else {
    2803           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2804             :                           PyLong_Type.tp_name);
    2805           0 :                         return -1;
    2806             :                 }
    2807             :         }
    2808           0 :         return 0;
    2809             : }
    2810             : 
    2811           0 : static PyObject *py_mdssvc_cmd_out_get_response_blob(PyObject *obj, void *closure)
    2812             : {
    2813           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2814             :         PyObject *py_response_blob;
    2815           0 :         if (object->out.response_blob == NULL) {
    2816           0 :                 Py_RETURN_NONE;
    2817             :         }
    2818           0 :         py_response_blob = pytalloc_reference_ex(&mdssvc_blob_Type, object->out.response_blob, object->out.response_blob);
    2819           0 :         return py_response_blob;
    2820             : }
    2821             : 
    2822           0 : static int py_mdssvc_cmd_out_set_response_blob(PyObject *py_obj, PyObject *value, void *closure)
    2823             : {
    2824           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2825           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.response_blob));
    2826           0 :         if (value == NULL) {
    2827           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.response_blob");
    2828           0 :                 return -1;
    2829             :         }
    2830           0 :         object->out.response_blob = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.response_blob);
    2831           0 :         if (object->out.response_blob == NULL) {
    2832           0 :                 PyErr_NoMemory();
    2833           0 :                 return -1;
    2834             :         }
    2835           0 :         PY_CHECK_TYPE(&mdssvc_blob_Type, value, return -1;);
    2836           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2837           0 :                 PyErr_NoMemory();
    2838           0 :                 return -1;
    2839             :         }
    2840           0 :         object->out.response_blob = (struct mdssvc_blob *)pytalloc_get_ptr(value);
    2841           0 :         return 0;
    2842             : }
    2843             : 
    2844           0 : static PyObject *py_mdssvc_cmd_out_get_unkn9(PyObject *obj, void *closure)
    2845             : {
    2846           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(obj);
    2847             :         PyObject *py_unkn9;
    2848           0 :         if (object->out.unkn9 == NULL) {
    2849           0 :                 Py_RETURN_NONE;
    2850             :         }
    2851           0 :         py_unkn9 = PyLong_FromUnsignedLongLong((uint32_t)*object->out.unkn9);
    2852           0 :         return py_unkn9;
    2853             : }
    2854             : 
    2855           0 : static int py_mdssvc_cmd_out_set_unkn9(PyObject *py_obj, PyObject *value, void *closure)
    2856             : {
    2857           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    2858           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.unkn9));
    2859           0 :         if (value == NULL) {
    2860           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.unkn9");
    2861           0 :                 return -1;
    2862             :         }
    2863           0 :         object->out.unkn9 = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.unkn9);
    2864           0 :         if (object->out.unkn9 == NULL) {
    2865           0 :                 PyErr_NoMemory();
    2866           0 :                 return -1;
    2867             :         }
    2868             :         {
    2869           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.unkn9));
    2870           0 :                 if (PyLong_Check(value)) {
    2871             :                         unsigned long long test_var;
    2872           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2873           0 :                         if (PyErr_Occurred() != NULL) {
    2874           0 :                                 return -1;
    2875             :                         }
    2876           0 :                         if (test_var > uint_max) {
    2877           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2878             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2879           0 :                                 return -1;
    2880             :                         }
    2881           0 :                         *object->out.unkn9 = test_var;
    2882             :                 } else {
    2883           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2884             :                           PyLong_Type.tp_name);
    2885           0 :                         return -1;
    2886             :                 }
    2887             :         }
    2888           0 :         return 0;
    2889             : }
    2890             : 
    2891             : static PyGetSetDef py_mdssvc_cmd_getsetters[] = {
    2892             :         {
    2893             :                 .name = discard_const_p(char, "in_handle"),
    2894             :                 .get = py_mdssvc_cmd_in_get_handle,
    2895             :                 .set = py_mdssvc_cmd_in_set_handle,
    2896             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    2897             :         },
    2898             :         {
    2899             :                 .name = discard_const_p(char, "in_unkn1"),
    2900             :                 .get = py_mdssvc_cmd_in_get_unkn1,
    2901             :                 .set = py_mdssvc_cmd_in_set_unkn1,
    2902             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2903             :         },
    2904             :         {
    2905             :                 .name = discard_const_p(char, "in_device_id"),
    2906             :                 .get = py_mdssvc_cmd_in_get_device_id,
    2907             :                 .set = py_mdssvc_cmd_in_set_device_id,
    2908             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2909             :         },
    2910             :         {
    2911             :                 .name = discard_const_p(char, "in_unkn3"),
    2912             :                 .get = py_mdssvc_cmd_in_get_unkn3,
    2913             :                 .set = py_mdssvc_cmd_in_set_unkn3,
    2914             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2915             :         },
    2916             :         {
    2917             :                 .name = discard_const_p(char, "in_unkn4"),
    2918             :                 .get = py_mdssvc_cmd_in_get_unkn4,
    2919             :                 .set = py_mdssvc_cmd_in_set_unkn4,
    2920             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2921             :         },
    2922             :         {
    2923             :                 .name = discard_const_p(char, "in_flags"),
    2924             :                 .get = py_mdssvc_cmd_in_get_flags,
    2925             :                 .set = py_mdssvc_cmd_in_set_flags,
    2926             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2927             :         },
    2928             :         {
    2929             :                 .name = discard_const_p(char, "in_request_blob"),
    2930             :                 .get = py_mdssvc_cmd_in_get_request_blob,
    2931             :                 .set = py_mdssvc_cmd_in_set_request_blob,
    2932             :                 .doc = discard_const_p(char, "PIDL-generated element of base type mdssvc_blob")
    2933             :         },
    2934             :         {
    2935             :                 .name = discard_const_p(char, "in_unkn5"),
    2936             :                 .get = py_mdssvc_cmd_in_get_unkn5,
    2937             :                 .set = py_mdssvc_cmd_in_set_unkn5,
    2938             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2939             :         },
    2940             :         {
    2941             :                 .name = discard_const_p(char, "in_max_fragment_size1"),
    2942             :                 .get = py_mdssvc_cmd_in_get_max_fragment_size1,
    2943             :                 .set = py_mdssvc_cmd_in_set_max_fragment_size1,
    2944             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2945             :         },
    2946             :         {
    2947             :                 .name = discard_const_p(char, "in_unkn6"),
    2948             :                 .get = py_mdssvc_cmd_in_get_unkn6,
    2949             :                 .set = py_mdssvc_cmd_in_set_unkn6,
    2950             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2951             :         },
    2952             :         {
    2953             :                 .name = discard_const_p(char, "in_max_fragment_size2"),
    2954             :                 .get = py_mdssvc_cmd_in_get_max_fragment_size2,
    2955             :                 .set = py_mdssvc_cmd_in_set_max_fragment_size2,
    2956             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2957             :         },
    2958             :         {
    2959             :                 .name = discard_const_p(char, "in_unkn7"),
    2960             :                 .get = py_mdssvc_cmd_in_get_unkn7,
    2961             :                 .set = py_mdssvc_cmd_in_set_unkn7,
    2962             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2963             :         },
    2964             :         {
    2965             :                 .name = discard_const_p(char, "in_unkn8"),
    2966             :                 .get = py_mdssvc_cmd_in_get_unkn8,
    2967             :                 .set = py_mdssvc_cmd_in_set_unkn8,
    2968             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2969             :         },
    2970             :         {
    2971             :                 .name = discard_const_p(char, "out_fragment"),
    2972             :                 .get = py_mdssvc_cmd_out_get_fragment,
    2973             :                 .set = py_mdssvc_cmd_out_set_fragment,
    2974             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2975             :         },
    2976             :         {
    2977             :                 .name = discard_const_p(char, "out_response_blob"),
    2978             :                 .get = py_mdssvc_cmd_out_get_response_blob,
    2979             :                 .set = py_mdssvc_cmd_out_set_response_blob,
    2980             :                 .doc = discard_const_p(char, "PIDL-generated element of base type mdssvc_blob")
    2981             :         },
    2982             :         {
    2983             :                 .name = discard_const_p(char, "out_unkn9"),
    2984             :                 .get = py_mdssvc_cmd_out_get_unkn9,
    2985             :                 .set = py_mdssvc_cmd_out_set_unkn9,
    2986             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2987             :         },
    2988             :         { .name = NULL }
    2989             : };
    2990             : 
    2991           0 : static PyObject *py_mdssvc_cmd_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2992             : {
    2993           0 :         PyObject *self = pytalloc_new(struct mdssvc_cmd, type);
    2994           0 :         struct mdssvc_cmd *_self = (struct mdssvc_cmd *)pytalloc_get_ptr(self);
    2995           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    2996           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    2997           0 :         _self->out.fragment = talloc_zero(mem_ctx, uint32_t);
    2998           0 :         _self->out.response_blob = talloc_zero(mem_ctx, struct mdssvc_blob);
    2999           0 :         _self->out.unkn9 = talloc_zero(mem_ctx, uint32_t);
    3000           0 :         return self;
    3001             : }
    3002             : 
    3003           0 : static PyObject *py_mdssvc_cmd_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3004             : {
    3005             : 
    3006             : 
    3007           0 :         return PyLong_FromLong(2);
    3008             : }
    3009             : 
    3010           0 : static PyObject *py_mdssvc_cmd_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3011             : {
    3012           0 :         const struct ndr_interface_call *call = NULL;
    3013           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    3014           0 :         PyObject *ret = NULL;
    3015           0 :         struct ndr_push *push = NULL;
    3016             :         DATA_BLOB blob;
    3017             :         enum ndr_err_code err;
    3018             : 
    3019           0 :         if (ndr_table_mdssvc.num_calls < 3) {
    3020           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_cmd_ndr_pack");
    3021           0 :                 return NULL;
    3022             :         }
    3023           0 :         call = &ndr_table_mdssvc.calls[2];
    3024             : 
    3025           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3026           0 :         if (push == NULL) {
    3027           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3028           0 :                 return NULL;
    3029             :         }
    3030             : 
    3031           0 :         push->flags |= ndr_push_flags;
    3032             : 
    3033           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3034           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3035           0 :                 TALLOC_FREE(push);
    3036           0 :                 PyErr_SetNdrError(err);
    3037           0 :                 return NULL;
    3038             :         }
    3039           0 :         blob = ndr_push_blob(push);
    3040           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3041           0 :         TALLOC_FREE(push);
    3042           0 :         return ret;
    3043             : }
    3044             : 
    3045           0 : static PyObject *py_mdssvc_cmd_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3046             : {
    3047           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3048           0 :         PyObject *bigendian_obj = NULL;
    3049           0 :         PyObject *ndr64_obj = NULL;
    3050           0 :         uint32_t ndr_push_flags = 0;
    3051             : 
    3052           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3053             :                 discard_const_p(char *, kwnames),
    3054             :                 &bigendian_obj,
    3055             :                 &ndr64_obj)) {
    3056           0 :                 return NULL;
    3057             :         }
    3058             : 
    3059           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3060           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3061             :         }
    3062           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3063           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3064             :         }
    3065             : 
    3066           0 :         return py_mdssvc_cmd_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3067             : }
    3068             : 
    3069           0 : static PyObject *py_mdssvc_cmd_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3070             : {
    3071           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3072           0 :         PyObject *bigendian_obj = NULL;
    3073           0 :         PyObject *ndr64_obj = NULL;
    3074           0 :         uint32_t ndr_push_flags = 0;
    3075             : 
    3076           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3077             :                 discard_const_p(char *, kwnames),
    3078             :                 &bigendian_obj,
    3079             :                 &ndr64_obj)) {
    3080           0 :                 return NULL;
    3081             :         }
    3082             : 
    3083           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3084           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3085             :         }
    3086           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3087           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3088             :         }
    3089             : 
    3090           0 :         return py_mdssvc_cmd_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3091             : }
    3092             : 
    3093           0 : static PyObject *py_mdssvc_cmd_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    3094             : {
    3095           0 :         const struct ndr_interface_call *call = NULL;
    3096           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    3097           0 :         struct ndr_pull *pull = NULL;
    3098             :         enum ndr_err_code err;
    3099             : 
    3100           0 :         if (ndr_table_mdssvc.num_calls < 3) {
    3101           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_cmd_ndr_unpack");
    3102           0 :                 return NULL;
    3103             :         }
    3104           0 :         call = &ndr_table_mdssvc.calls[2];
    3105             : 
    3106           0 :         pull = ndr_pull_init_blob(blob, object);
    3107           0 :         if (pull == NULL) {
    3108           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3109           0 :                 return NULL;
    3110             :         }
    3111             : 
    3112           0 :         pull->flags |= ndr_pull_flags;
    3113             : 
    3114           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3115           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3116           0 :                 TALLOC_FREE(pull);
    3117           0 :                 PyErr_SetNdrError(err);
    3118           0 :                 return NULL;
    3119             :         }
    3120           0 :         if (!allow_remaining) {
    3121             :                 uint32_t highest_ofs;
    3122             : 
    3123           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3124           0 :                         highest_ofs = pull->offset;
    3125             :                 } else {
    3126           0 :                         highest_ofs = pull->relative_highest_offset;
    3127             :                 }
    3128           0 :                 if (highest_ofs < pull->data_size) {
    3129           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3130             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3131             :                                 highest_ofs, pull->data_size);
    3132           0 :                         TALLOC_FREE(pull);
    3133           0 :                         PyErr_SetNdrError(err);
    3134           0 :                         return NULL;
    3135             :                 }
    3136             :         }
    3137             : 
    3138           0 :         TALLOC_FREE(pull);
    3139           0 :         Py_RETURN_NONE;
    3140             : }
    3141             : 
    3142           0 : static PyObject *py_mdssvc_cmd_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3143             : {
    3144             :         DATA_BLOB blob;
    3145           0 :         Py_ssize_t blob_length = 0;
    3146           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3147           0 :         PyObject *bigendian_obj = NULL;
    3148           0 :         PyObject *ndr64_obj = NULL;
    3149           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3150           0 :         PyObject *allow_remaining_obj = NULL;
    3151           0 :         bool allow_remaining = false;
    3152             : 
    3153           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3154             :                 discard_const_p(char *, kwnames),
    3155             :                 &blob.data, &blob_length,
    3156             :                 &bigendian_obj,
    3157             :                 &ndr64_obj,
    3158             :                 &allow_remaining_obj)) {
    3159           0 :                 return NULL;
    3160             :         }
    3161           0 :         blob.length = blob_length;
    3162             : 
    3163           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3164           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3165             :         }
    3166           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3167           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3168             :         }
    3169             : 
    3170           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3171           0 :                 allow_remaining = true;
    3172             :         }
    3173             : 
    3174           0 :         return py_mdssvc_cmd_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3175             : }
    3176             : 
    3177           0 : static PyObject *py_mdssvc_cmd_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3178             : {
    3179             :         DATA_BLOB blob;
    3180           0 :         Py_ssize_t blob_length = 0;
    3181           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3182           0 :         PyObject *bigendian_obj = NULL;
    3183           0 :         PyObject *ndr64_obj = NULL;
    3184           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3185           0 :         PyObject *allow_remaining_obj = NULL;
    3186           0 :         bool allow_remaining = false;
    3187             : 
    3188           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3189             :                 discard_const_p(char *, kwnames),
    3190             :                 &blob.data, &blob_length,
    3191             :                 &bigendian_obj,
    3192             :                 &ndr64_obj,
    3193             :                 &allow_remaining_obj)) {
    3194           0 :                 return NULL;
    3195             :         }
    3196           0 :         blob.length = blob_length;
    3197             : 
    3198           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3199           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3200             :         }
    3201           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3202           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3203             :         }
    3204             : 
    3205           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3206           0 :                 allow_remaining = true;
    3207             :         }
    3208             : 
    3209           0 :         return py_mdssvc_cmd_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3210             : }
    3211             : 
    3212           0 : static PyObject *py_mdssvc_cmd_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3213             : {
    3214           0 :         const struct ndr_interface_call *call = NULL;
    3215           0 :         struct mdssvc_cmd *object = (struct mdssvc_cmd *)pytalloc_get_ptr(py_obj);
    3216             :         PyObject *ret;
    3217             :         char *retstr;
    3218             : 
    3219           0 :         if (ndr_table_mdssvc.num_calls < 3) {
    3220           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_cmd_ndr_print");
    3221           0 :                 return NULL;
    3222             :         }
    3223           0 :         call = &ndr_table_mdssvc.calls[2];
    3224             : 
    3225           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3226           0 :         ret = PyUnicode_FromString(retstr);
    3227           0 :         TALLOC_FREE(retstr);
    3228             : 
    3229           0 :         return ret;
    3230             : }
    3231             : 
    3232           0 : static PyObject *py_mdssvc_cmd_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3233             : {
    3234           0 :         return py_mdssvc_cmd_ndr_print(py_obj, "mdssvc_cmd_in", NDR_IN);
    3235             : }
    3236             : 
    3237           0 : static PyObject *py_mdssvc_cmd_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3238             : {
    3239           0 :         return py_mdssvc_cmd_ndr_print(py_obj, "mdssvc_cmd_out", NDR_OUT);
    3240             : }
    3241             : 
    3242             : static PyMethodDef py_mdssvc_cmd_methods[] = {
    3243             :         { "opnum", (PyCFunction)py_mdssvc_cmd_ndr_opnum, METH_NOARGS|METH_CLASS,
    3244             :                 "mdssvc.cmd.opnum() -> 2 (0x02) " },
    3245             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_cmd_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3246             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3247             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_cmd_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3248             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3249             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_cmd_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3250             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3251             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_cmd_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3252             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3253             :         { "__ndr_print_in__", (PyCFunction)py_mdssvc_cmd_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3254             :         { "__ndr_print_out__", (PyCFunction)py_mdssvc_cmd_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3255             :         { NULL, NULL, 0, NULL }
    3256             : };
    3257             : 
    3258             : 
    3259             : static PyTypeObject mdssvc_cmd_Type = {
    3260             :         PyVarObject_HEAD_INIT(NULL, 0)
    3261             :         .tp_name = "mdssvc.cmd",
    3262             :         .tp_getset = py_mdssvc_cmd_getsetters,
    3263             :         .tp_methods = py_mdssvc_cmd_methods,
    3264             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3265             :         .tp_new = py_mdssvc_cmd_new,
    3266             : };
    3267             : 
    3268           0 : static bool pack_py_mdssvc_cmd_args_in(PyObject *args, PyObject *kwargs, struct mdssvc_cmd *r)
    3269             : {
    3270             :         PyObject *py_handle;
    3271             :         PyObject *py_unkn1;
    3272             :         PyObject *py_device_id;
    3273             :         PyObject *py_unkn3;
    3274             :         PyObject *py_unkn4;
    3275             :         PyObject *py_flags;
    3276             :         PyObject *py_request_blob;
    3277             :         PyObject *py_unkn5;
    3278             :         PyObject *py_max_fragment_size1;
    3279             :         PyObject *py_unkn6;
    3280             :         PyObject *py_max_fragment_size2;
    3281             :         PyObject *py_unkn7;
    3282             :         PyObject *py_unkn8;
    3283           0 :         const char *kwnames[] = {
    3284             :                 "handle", "unkn1", "device_id", "unkn3", "unkn4", "flags", "request_blob", "unkn5", "max_fragment_size1", "unkn6", "max_fragment_size2", "unkn7", "unkn8", NULL
    3285             :         };
    3286             : 
    3287           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOOOO:mdssvc_cmd", discard_const_p(char *, kwnames), &py_handle, &py_unkn1, &py_device_id, &py_unkn3, &py_unkn4, &py_flags, &py_request_blob, &py_unkn5, &py_max_fragment_size1, &py_unkn6, &py_max_fragment_size2, &py_unkn7, &py_unkn8)) {
    3288           0 :                 return false;
    3289             :         }
    3290             : 
    3291           0 :         if (py_handle == NULL) {
    3292           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    3293           0 :                 return false;
    3294             :         }
    3295           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    3296           0 :         if (r->in.handle == NULL) {
    3297           0 :                 PyErr_NoMemory();
    3298           0 :                 return false;
    3299             :         }
    3300           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    3301           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    3302           0 :                 PyErr_NoMemory();
    3303           0 :                 return false;
    3304             :         }
    3305           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    3306           0 :         if (py_unkn1 == NULL) {
    3307           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn1");
    3308           0 :                 return false;
    3309             :         }
    3310             :         {
    3311           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn1));
    3312           0 :                 if (PyLong_Check(py_unkn1)) {
    3313             :                         unsigned long long test_var;
    3314           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn1);
    3315           0 :                         if (PyErr_Occurred() != NULL) {
    3316           0 :                                 return false;
    3317             :                         }
    3318           0 :                         if (test_var > uint_max) {
    3319           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3320             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3321           0 :                                 return false;
    3322             :                         }
    3323           0 :                         r->in.unkn1 = test_var;
    3324             :                 } else {
    3325           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3326             :                           PyLong_Type.tp_name);
    3327           0 :                         return false;
    3328             :                 }
    3329             :         }
    3330           0 :         if (py_device_id == NULL) {
    3331           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.device_id");
    3332           0 :                 return false;
    3333             :         }
    3334             :         {
    3335           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.device_id));
    3336           0 :                 if (PyLong_Check(py_device_id)) {
    3337             :                         unsigned long long test_var;
    3338           0 :                         test_var = PyLong_AsUnsignedLongLong(py_device_id);
    3339           0 :                         if (PyErr_Occurred() != NULL) {
    3340           0 :                                 return false;
    3341             :                         }
    3342           0 :                         if (test_var > uint_max) {
    3343           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3344             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3345           0 :                                 return false;
    3346             :                         }
    3347           0 :                         r->in.device_id = test_var;
    3348             :                 } else {
    3349           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3350             :                           PyLong_Type.tp_name);
    3351           0 :                         return false;
    3352             :                 }
    3353             :         }
    3354           0 :         if (py_unkn3 == NULL) {
    3355           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn3");
    3356           0 :                 return false;
    3357             :         }
    3358             :         {
    3359           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn3));
    3360           0 :                 if (PyLong_Check(py_unkn3)) {
    3361             :                         unsigned long long test_var;
    3362           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn3);
    3363           0 :                         if (PyErr_Occurred() != NULL) {
    3364           0 :                                 return false;
    3365             :                         }
    3366           0 :                         if (test_var > uint_max) {
    3367           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3368             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3369           0 :                                 return false;
    3370             :                         }
    3371           0 :                         r->in.unkn3 = test_var;
    3372             :                 } else {
    3373           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3374             :                           PyLong_Type.tp_name);
    3375           0 :                         return false;
    3376             :                 }
    3377             :         }
    3378           0 :         if (py_unkn4 == NULL) {
    3379           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn4");
    3380           0 :                 return false;
    3381             :         }
    3382             :         {
    3383           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn4));
    3384           0 :                 if (PyLong_Check(py_unkn4)) {
    3385             :                         unsigned long long test_var;
    3386           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn4);
    3387           0 :                         if (PyErr_Occurred() != NULL) {
    3388           0 :                                 return false;
    3389             :                         }
    3390           0 :                         if (test_var > uint_max) {
    3391           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3392             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3393           0 :                                 return false;
    3394             :                         }
    3395           0 :                         r->in.unkn4 = test_var;
    3396             :                 } else {
    3397           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3398             :                           PyLong_Type.tp_name);
    3399           0 :                         return false;
    3400             :                 }
    3401             :         }
    3402           0 :         if (py_flags == NULL) {
    3403           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
    3404           0 :                 return false;
    3405             :         }
    3406             :         {
    3407           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
    3408           0 :                 if (PyLong_Check(py_flags)) {
    3409             :                         unsigned long long test_var;
    3410           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
    3411           0 :                         if (PyErr_Occurred() != NULL) {
    3412           0 :                                 return false;
    3413             :                         }
    3414           0 :                         if (test_var > uint_max) {
    3415           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3416             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3417           0 :                                 return false;
    3418             :                         }
    3419           0 :                         r->in.flags = test_var;
    3420             :                 } else {
    3421           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3422             :                           PyLong_Type.tp_name);
    3423           0 :                         return false;
    3424             :                 }
    3425             :         }
    3426           0 :         if (py_request_blob == NULL) {
    3427           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.request_blob");
    3428           0 :                 return false;
    3429             :         }
    3430           0 :         PY_CHECK_TYPE(&mdssvc_blob_Type, py_request_blob, return false;);
    3431           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_request_blob)) == NULL) {
    3432           0 :                 PyErr_NoMemory();
    3433           0 :                 return false;
    3434             :         }
    3435           0 :         r->in.request_blob = *(struct mdssvc_blob *)pytalloc_get_ptr(py_request_blob);
    3436           0 :         if (py_unkn5 == NULL) {
    3437           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn5");
    3438           0 :                 return false;
    3439             :         }
    3440             :         {
    3441           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn5));
    3442           0 :                 if (PyLong_Check(py_unkn5)) {
    3443             :                         unsigned long long test_var;
    3444           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn5);
    3445           0 :                         if (PyErr_Occurred() != NULL) {
    3446           0 :                                 return false;
    3447             :                         }
    3448           0 :                         if (test_var > uint_max) {
    3449           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3450             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3451           0 :                                 return false;
    3452             :                         }
    3453           0 :                         r->in.unkn5 = test_var;
    3454             :                 } else {
    3455           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3456             :                           PyLong_Type.tp_name);
    3457           0 :                         return false;
    3458             :                 }
    3459             :         }
    3460           0 :         if (py_max_fragment_size1 == NULL) {
    3461           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_fragment_size1");
    3462           0 :                 return false;
    3463             :         }
    3464             :         {
    3465           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_fragment_size1));
    3466           0 :                 if (PyLong_Check(py_max_fragment_size1)) {
    3467             :                         unsigned long long test_var;
    3468           0 :                         test_var = PyLong_AsUnsignedLongLong(py_max_fragment_size1);
    3469           0 :                         if (PyErr_Occurred() != NULL) {
    3470           0 :                                 return false;
    3471             :                         }
    3472           0 :                         if (test_var > uint_max) {
    3473           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3474             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3475           0 :                                 return false;
    3476             :                         }
    3477           0 :                         r->in.max_fragment_size1 = test_var;
    3478             :                 } else {
    3479           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3480             :                           PyLong_Type.tp_name);
    3481           0 :                         return false;
    3482             :                 }
    3483             :         }
    3484           0 :         if (py_unkn6 == NULL) {
    3485           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn6");
    3486           0 :                 return false;
    3487             :         }
    3488             :         {
    3489           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn6));
    3490           0 :                 if (PyLong_Check(py_unkn6)) {
    3491             :                         unsigned long long test_var;
    3492           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn6);
    3493           0 :                         if (PyErr_Occurred() != NULL) {
    3494           0 :                                 return false;
    3495             :                         }
    3496           0 :                         if (test_var > uint_max) {
    3497           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3498             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3499           0 :                                 return false;
    3500             :                         }
    3501           0 :                         r->in.unkn6 = test_var;
    3502             :                 } else {
    3503           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3504             :                           PyLong_Type.tp_name);
    3505           0 :                         return false;
    3506             :                 }
    3507             :         }
    3508           0 :         if (py_max_fragment_size2 == NULL) {
    3509           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_fragment_size2");
    3510           0 :                 return false;
    3511             :         }
    3512             :         {
    3513           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_fragment_size2));
    3514           0 :                 if (PyLong_Check(py_max_fragment_size2)) {
    3515             :                         unsigned long long test_var;
    3516           0 :                         test_var = PyLong_AsUnsignedLongLong(py_max_fragment_size2);
    3517           0 :                         if (PyErr_Occurred() != NULL) {
    3518           0 :                                 return false;
    3519             :                         }
    3520           0 :                         if (test_var > uint_max) {
    3521           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3522             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3523           0 :                                 return false;
    3524             :                         }
    3525           0 :                         r->in.max_fragment_size2 = test_var;
    3526             :                 } else {
    3527           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3528             :                           PyLong_Type.tp_name);
    3529           0 :                         return false;
    3530             :                 }
    3531             :         }
    3532           0 :         if (py_unkn7 == NULL) {
    3533           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn7");
    3534           0 :                 return false;
    3535             :         }
    3536             :         {
    3537           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn7));
    3538           0 :                 if (PyLong_Check(py_unkn7)) {
    3539             :                         unsigned long long test_var;
    3540           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn7);
    3541           0 :                         if (PyErr_Occurred() != NULL) {
    3542           0 :                                 return false;
    3543             :                         }
    3544           0 :                         if (test_var > uint_max) {
    3545           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3546             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3547           0 :                                 return false;
    3548             :                         }
    3549           0 :                         r->in.unkn7 = test_var;
    3550             :                 } else {
    3551           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3552             :                           PyLong_Type.tp_name);
    3553           0 :                         return false;
    3554             :                 }
    3555             :         }
    3556           0 :         if (py_unkn8 == NULL) {
    3557           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn8");
    3558           0 :                 return false;
    3559             :         }
    3560             :         {
    3561           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn8));
    3562           0 :                 if (PyLong_Check(py_unkn8)) {
    3563             :                         unsigned long long test_var;
    3564           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn8);
    3565           0 :                         if (PyErr_Occurred() != NULL) {
    3566           0 :                                 return false;
    3567             :                         }
    3568           0 :                         if (test_var > uint_max) {
    3569           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3570             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3571           0 :                                 return false;
    3572             :                         }
    3573           0 :                         r->in.unkn8 = test_var;
    3574             :                 } else {
    3575           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3576             :                           PyLong_Type.tp_name);
    3577           0 :                         return false;
    3578             :                 }
    3579             :         }
    3580           0 :         return true;
    3581             : }
    3582             : 
    3583           0 : static PyObject *unpack_py_mdssvc_cmd_args_out(struct mdssvc_cmd *r)
    3584             : {
    3585             :         PyObject *result;
    3586             :         PyObject *py_fragment;
    3587             :         PyObject *py_response_blob;
    3588             :         PyObject *py_unkn9;
    3589           0 :         result = PyTuple_New(3);
    3590           0 :         py_fragment = PyLong_FromUnsignedLongLong((uint32_t)*r->out.fragment);
    3591           0 :         PyTuple_SetItem(result, 0, py_fragment);
    3592           0 :         py_response_blob = pytalloc_reference_ex(&mdssvc_blob_Type, r->out.response_blob, r->out.response_blob);
    3593           0 :         PyTuple_SetItem(result, 1, py_response_blob);
    3594           0 :         py_unkn9 = PyLong_FromUnsignedLongLong((uint32_t)*r->out.unkn9);
    3595           0 :         PyTuple_SetItem(result, 2, py_unkn9);
    3596           0 :         return result;
    3597             : }
    3598             : 
    3599             : 
    3600           0 : static PyObject *py_mdssvc_close_in_get_in_handle(PyObject *obj, void *closure)
    3601             : {
    3602           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(obj);
    3603             :         PyObject *py_in_handle;
    3604           0 :         if (object->in.in_handle == NULL) {
    3605           0 :                 Py_RETURN_NONE;
    3606             :         }
    3607           0 :         py_in_handle = pytalloc_reference_ex(policy_handle_Type, object->in.in_handle, object->in.in_handle);
    3608           0 :         return py_in_handle;
    3609             : }
    3610             : 
    3611           0 : static int py_mdssvc_close_in_set_in_handle(PyObject *py_obj, PyObject *value, void *closure)
    3612             : {
    3613           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3614           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.in_handle));
    3615           0 :         if (value == NULL) {
    3616           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.in_handle");
    3617           0 :                 return -1;
    3618             :         }
    3619           0 :         object->in.in_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.in_handle);
    3620           0 :         if (object->in.in_handle == NULL) {
    3621           0 :                 PyErr_NoMemory();
    3622           0 :                 return -1;
    3623             :         }
    3624           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    3625           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3626           0 :                 PyErr_NoMemory();
    3627           0 :                 return -1;
    3628             :         }
    3629           0 :         object->in.in_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    3630           0 :         return 0;
    3631             : }
    3632             : 
    3633           0 : static PyObject *py_mdssvc_close_in_get_unkn1(PyObject *obj, void *closure)
    3634             : {
    3635           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(obj);
    3636             :         PyObject *py_unkn1;
    3637           0 :         py_unkn1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn1);
    3638           0 :         return py_unkn1;
    3639             : }
    3640             : 
    3641           0 : static int py_mdssvc_close_in_set_unkn1(PyObject *py_obj, PyObject *value, void *closure)
    3642             : {
    3643           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3644           0 :         if (value == NULL) {
    3645           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn1");
    3646           0 :                 return -1;
    3647             :         }
    3648             :         {
    3649           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn1));
    3650           0 :                 if (PyLong_Check(value)) {
    3651             :                         unsigned long long test_var;
    3652           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3653           0 :                         if (PyErr_Occurred() != NULL) {
    3654           0 :                                 return -1;
    3655             :                         }
    3656           0 :                         if (test_var > uint_max) {
    3657           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3658             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3659           0 :                                 return -1;
    3660             :                         }
    3661           0 :                         object->in.unkn1 = test_var;
    3662             :                 } else {
    3663           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3664             :                           PyLong_Type.tp_name);
    3665           0 :                         return -1;
    3666             :                 }
    3667             :         }
    3668           0 :         return 0;
    3669             : }
    3670             : 
    3671           0 : static PyObject *py_mdssvc_close_in_get_device_id(PyObject *obj, void *closure)
    3672             : {
    3673           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(obj);
    3674             :         PyObject *py_device_id;
    3675           0 :         py_device_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.device_id);
    3676           0 :         return py_device_id;
    3677             : }
    3678             : 
    3679           0 : static int py_mdssvc_close_in_set_device_id(PyObject *py_obj, PyObject *value, void *closure)
    3680             : {
    3681           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3682           0 :         if (value == NULL) {
    3683           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.device_id");
    3684           0 :                 return -1;
    3685             :         }
    3686             :         {
    3687           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.device_id));
    3688           0 :                 if (PyLong_Check(value)) {
    3689             :                         unsigned long long test_var;
    3690           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3691           0 :                         if (PyErr_Occurred() != NULL) {
    3692           0 :                                 return -1;
    3693             :                         }
    3694           0 :                         if (test_var > uint_max) {
    3695           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3696             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3697           0 :                                 return -1;
    3698             :                         }
    3699           0 :                         object->in.device_id = test_var;
    3700             :                 } else {
    3701           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3702             :                           PyLong_Type.tp_name);
    3703           0 :                         return -1;
    3704             :                 }
    3705             :         }
    3706           0 :         return 0;
    3707             : }
    3708             : 
    3709           0 : static PyObject *py_mdssvc_close_in_get_unkn2(PyObject *obj, void *closure)
    3710             : {
    3711           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(obj);
    3712             :         PyObject *py_unkn2;
    3713           0 :         py_unkn2 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn2);
    3714           0 :         return py_unkn2;
    3715             : }
    3716             : 
    3717           0 : static int py_mdssvc_close_in_set_unkn2(PyObject *py_obj, PyObject *value, void *closure)
    3718             : {
    3719           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3720           0 :         if (value == NULL) {
    3721           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn2");
    3722           0 :                 return -1;
    3723             :         }
    3724             :         {
    3725           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn2));
    3726           0 :                 if (PyLong_Check(value)) {
    3727             :                         unsigned long long test_var;
    3728           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3729           0 :                         if (PyErr_Occurred() != NULL) {
    3730           0 :                                 return -1;
    3731             :                         }
    3732           0 :                         if (test_var > uint_max) {
    3733           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3734             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3735           0 :                                 return -1;
    3736             :                         }
    3737           0 :                         object->in.unkn2 = test_var;
    3738             :                 } else {
    3739           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3740             :                           PyLong_Type.tp_name);
    3741           0 :                         return -1;
    3742             :                 }
    3743             :         }
    3744           0 :         return 0;
    3745             : }
    3746             : 
    3747           0 : static PyObject *py_mdssvc_close_in_get_unkn3(PyObject *obj, void *closure)
    3748             : {
    3749           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(obj);
    3750             :         PyObject *py_unkn3;
    3751           0 :         py_unkn3 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unkn3);
    3752           0 :         return py_unkn3;
    3753             : }
    3754             : 
    3755           0 : static int py_mdssvc_close_in_set_unkn3(PyObject *py_obj, PyObject *value, void *closure)
    3756             : {
    3757           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3758           0 :         if (value == NULL) {
    3759           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unkn3");
    3760           0 :                 return -1;
    3761             :         }
    3762             :         {
    3763           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unkn3));
    3764           0 :                 if (PyLong_Check(value)) {
    3765             :                         unsigned long long test_var;
    3766           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3767           0 :                         if (PyErr_Occurred() != NULL) {
    3768           0 :                                 return -1;
    3769             :                         }
    3770           0 :                         if (test_var > uint_max) {
    3771           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3772             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3773           0 :                                 return -1;
    3774             :                         }
    3775           0 :                         object->in.unkn3 = test_var;
    3776             :                 } else {
    3777           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3778             :                           PyLong_Type.tp_name);
    3779           0 :                         return -1;
    3780             :                 }
    3781             :         }
    3782           0 :         return 0;
    3783             : }
    3784             : 
    3785           0 : static PyObject *py_mdssvc_close_out_get_out_handle(PyObject *obj, void *closure)
    3786             : {
    3787           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(obj);
    3788             :         PyObject *py_out_handle;
    3789           0 :         if (object->out.out_handle == NULL) {
    3790           0 :                 Py_RETURN_NONE;
    3791             :         }
    3792           0 :         py_out_handle = pytalloc_reference_ex(policy_handle_Type, object->out.out_handle, object->out.out_handle);
    3793           0 :         return py_out_handle;
    3794             : }
    3795             : 
    3796           0 : static int py_mdssvc_close_out_set_out_handle(PyObject *py_obj, PyObject *value, void *closure)
    3797             : {
    3798           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3799           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_handle));
    3800           0 :         if (value == NULL) {
    3801           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.out_handle");
    3802           0 :                 return -1;
    3803             :         }
    3804           0 :         object->out.out_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_handle);
    3805           0 :         if (object->out.out_handle == NULL) {
    3806           0 :                 PyErr_NoMemory();
    3807           0 :                 return -1;
    3808             :         }
    3809           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    3810           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3811           0 :                 PyErr_NoMemory();
    3812           0 :                 return -1;
    3813             :         }
    3814           0 :         object->out.out_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    3815           0 :         return 0;
    3816             : }
    3817             : 
    3818           0 : static PyObject *py_mdssvc_close_out_get_status(PyObject *obj, void *closure)
    3819             : {
    3820           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(obj);
    3821             :         PyObject *py_status;
    3822           0 :         if (object->out.status == NULL) {
    3823           0 :                 Py_RETURN_NONE;
    3824             :         }
    3825           0 :         py_status = PyLong_FromUnsignedLongLong((uint32_t)*object->out.status);
    3826           0 :         return py_status;
    3827             : }
    3828             : 
    3829           0 : static int py_mdssvc_close_out_set_status(PyObject *py_obj, PyObject *value, void *closure)
    3830             : {
    3831           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3832           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.status));
    3833           0 :         if (value == NULL) {
    3834           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.status");
    3835           0 :                 return -1;
    3836             :         }
    3837           0 :         object->out.status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.status);
    3838           0 :         if (object->out.status == NULL) {
    3839           0 :                 PyErr_NoMemory();
    3840           0 :                 return -1;
    3841             :         }
    3842             :         {
    3843           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.status));
    3844           0 :                 if (PyLong_Check(value)) {
    3845             :                         unsigned long long test_var;
    3846           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3847           0 :                         if (PyErr_Occurred() != NULL) {
    3848           0 :                                 return -1;
    3849             :                         }
    3850           0 :                         if (test_var > uint_max) {
    3851           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3852             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3853           0 :                                 return -1;
    3854             :                         }
    3855           0 :                         *object->out.status = test_var;
    3856             :                 } else {
    3857           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3858             :                           PyLong_Type.tp_name);
    3859           0 :                         return -1;
    3860             :                 }
    3861             :         }
    3862           0 :         return 0;
    3863             : }
    3864             : 
    3865             : static PyGetSetDef py_mdssvc_close_getsetters[] = {
    3866             :         {
    3867             :                 .name = discard_const_p(char, "in_in_handle"),
    3868             :                 .get = py_mdssvc_close_in_get_in_handle,
    3869             :                 .set = py_mdssvc_close_in_set_in_handle,
    3870             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    3871             :         },
    3872             :         {
    3873             :                 .name = discard_const_p(char, "in_unkn1"),
    3874             :                 .get = py_mdssvc_close_in_get_unkn1,
    3875             :                 .set = py_mdssvc_close_in_set_unkn1,
    3876             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3877             :         },
    3878             :         {
    3879             :                 .name = discard_const_p(char, "in_device_id"),
    3880             :                 .get = py_mdssvc_close_in_get_device_id,
    3881             :                 .set = py_mdssvc_close_in_set_device_id,
    3882             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3883             :         },
    3884             :         {
    3885             :                 .name = discard_const_p(char, "in_unkn2"),
    3886             :                 .get = py_mdssvc_close_in_get_unkn2,
    3887             :                 .set = py_mdssvc_close_in_set_unkn2,
    3888             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3889             :         },
    3890             :         {
    3891             :                 .name = discard_const_p(char, "in_unkn3"),
    3892             :                 .get = py_mdssvc_close_in_get_unkn3,
    3893             :                 .set = py_mdssvc_close_in_set_unkn3,
    3894             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3895             :         },
    3896             :         {
    3897             :                 .name = discard_const_p(char, "out_out_handle"),
    3898             :                 .get = py_mdssvc_close_out_get_out_handle,
    3899             :                 .set = py_mdssvc_close_out_set_out_handle,
    3900             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    3901             :         },
    3902             :         {
    3903             :                 .name = discard_const_p(char, "out_status"),
    3904             :                 .get = py_mdssvc_close_out_get_status,
    3905             :                 .set = py_mdssvc_close_out_set_status,
    3906             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3907             :         },
    3908             :         { .name = NULL }
    3909             : };
    3910             : 
    3911           0 : static PyObject *py_mdssvc_close_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3912             : {
    3913           0 :         PyObject *self = pytalloc_new(struct mdssvc_close, type);
    3914           0 :         struct mdssvc_close *_self = (struct mdssvc_close *)pytalloc_get_ptr(self);
    3915           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    3916           0 :         _self->in.in_handle = talloc_zero(mem_ctx, struct policy_handle);
    3917           0 :         _self->out.out_handle = talloc_zero(mem_ctx, struct policy_handle);
    3918           0 :         _self->out.status = talloc_zero(mem_ctx, uint32_t);
    3919           0 :         return self;
    3920             : }
    3921             : 
    3922           0 : static PyObject *py_mdssvc_close_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3923             : {
    3924             : 
    3925             : 
    3926           0 :         return PyLong_FromLong(3);
    3927             : }
    3928             : 
    3929           0 : static PyObject *py_mdssvc_close_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3930             : {
    3931           0 :         const struct ndr_interface_call *call = NULL;
    3932           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    3933           0 :         PyObject *ret = NULL;
    3934           0 :         struct ndr_push *push = NULL;
    3935             :         DATA_BLOB blob;
    3936             :         enum ndr_err_code err;
    3937             : 
    3938           0 :         if (ndr_table_mdssvc.num_calls < 4) {
    3939           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_close_ndr_pack");
    3940           0 :                 return NULL;
    3941             :         }
    3942           0 :         call = &ndr_table_mdssvc.calls[3];
    3943             : 
    3944           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3945           0 :         if (push == NULL) {
    3946           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3947           0 :                 return NULL;
    3948             :         }
    3949             : 
    3950           0 :         push->flags |= ndr_push_flags;
    3951             : 
    3952           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3953           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3954           0 :                 TALLOC_FREE(push);
    3955           0 :                 PyErr_SetNdrError(err);
    3956           0 :                 return NULL;
    3957             :         }
    3958           0 :         blob = ndr_push_blob(push);
    3959           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3960           0 :         TALLOC_FREE(push);
    3961           0 :         return ret;
    3962             : }
    3963             : 
    3964           0 : static PyObject *py_mdssvc_close_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3965             : {
    3966           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3967           0 :         PyObject *bigendian_obj = NULL;
    3968           0 :         PyObject *ndr64_obj = NULL;
    3969           0 :         uint32_t ndr_push_flags = 0;
    3970             : 
    3971           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3972             :                 discard_const_p(char *, kwnames),
    3973             :                 &bigendian_obj,
    3974             :                 &ndr64_obj)) {
    3975           0 :                 return NULL;
    3976             :         }
    3977             : 
    3978           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3979           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3980             :         }
    3981           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3982           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3983             :         }
    3984             : 
    3985           0 :         return py_mdssvc_close_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3986             : }
    3987             : 
    3988           0 : static PyObject *py_mdssvc_close_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3989             : {
    3990           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3991           0 :         PyObject *bigendian_obj = NULL;
    3992           0 :         PyObject *ndr64_obj = NULL;
    3993           0 :         uint32_t ndr_push_flags = 0;
    3994             : 
    3995           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3996             :                 discard_const_p(char *, kwnames),
    3997             :                 &bigendian_obj,
    3998             :                 &ndr64_obj)) {
    3999           0 :                 return NULL;
    4000             :         }
    4001             : 
    4002           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4003           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4004             :         }
    4005           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4006           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4007             :         }
    4008             : 
    4009           0 :         return py_mdssvc_close_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4010             : }
    4011             : 
    4012           0 : static PyObject *py_mdssvc_close_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    4013             : {
    4014           0 :         const struct ndr_interface_call *call = NULL;
    4015           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    4016           0 :         struct ndr_pull *pull = NULL;
    4017             :         enum ndr_err_code err;
    4018             : 
    4019           0 :         if (ndr_table_mdssvc.num_calls < 4) {
    4020           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_close_ndr_unpack");
    4021           0 :                 return NULL;
    4022             :         }
    4023           0 :         call = &ndr_table_mdssvc.calls[3];
    4024             : 
    4025           0 :         pull = ndr_pull_init_blob(blob, object);
    4026           0 :         if (pull == NULL) {
    4027           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4028           0 :                 return NULL;
    4029             :         }
    4030             : 
    4031           0 :         pull->flags |= ndr_pull_flags;
    4032             : 
    4033           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4034           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4035           0 :                 TALLOC_FREE(pull);
    4036           0 :                 PyErr_SetNdrError(err);
    4037           0 :                 return NULL;
    4038             :         }
    4039           0 :         if (!allow_remaining) {
    4040             :                 uint32_t highest_ofs;
    4041             : 
    4042           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4043           0 :                         highest_ofs = pull->offset;
    4044             :                 } else {
    4045           0 :                         highest_ofs = pull->relative_highest_offset;
    4046             :                 }
    4047           0 :                 if (highest_ofs < pull->data_size) {
    4048           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4049             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4050             :                                 highest_ofs, pull->data_size);
    4051           0 :                         TALLOC_FREE(pull);
    4052           0 :                         PyErr_SetNdrError(err);
    4053           0 :                         return NULL;
    4054             :                 }
    4055             :         }
    4056             : 
    4057           0 :         TALLOC_FREE(pull);
    4058           0 :         Py_RETURN_NONE;
    4059             : }
    4060             : 
    4061           0 : static PyObject *py_mdssvc_close_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4062             : {
    4063             :         DATA_BLOB blob;
    4064           0 :         Py_ssize_t blob_length = 0;
    4065           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4066           0 :         PyObject *bigendian_obj = NULL;
    4067           0 :         PyObject *ndr64_obj = NULL;
    4068           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4069           0 :         PyObject *allow_remaining_obj = NULL;
    4070           0 :         bool allow_remaining = false;
    4071             : 
    4072           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4073             :                 discard_const_p(char *, kwnames),
    4074             :                 &blob.data, &blob_length,
    4075             :                 &bigendian_obj,
    4076             :                 &ndr64_obj,
    4077             :                 &allow_remaining_obj)) {
    4078           0 :                 return NULL;
    4079             :         }
    4080           0 :         blob.length = blob_length;
    4081             : 
    4082           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4083           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4084             :         }
    4085           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4086           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4087             :         }
    4088             : 
    4089           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4090           0 :                 allow_remaining = true;
    4091             :         }
    4092             : 
    4093           0 :         return py_mdssvc_close_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4094             : }
    4095             : 
    4096           0 : static PyObject *py_mdssvc_close_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4097             : {
    4098             :         DATA_BLOB blob;
    4099           0 :         Py_ssize_t blob_length = 0;
    4100           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4101           0 :         PyObject *bigendian_obj = NULL;
    4102           0 :         PyObject *ndr64_obj = NULL;
    4103           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4104           0 :         PyObject *allow_remaining_obj = NULL;
    4105           0 :         bool allow_remaining = false;
    4106             : 
    4107           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4108             :                 discard_const_p(char *, kwnames),
    4109             :                 &blob.data, &blob_length,
    4110             :                 &bigendian_obj,
    4111             :                 &ndr64_obj,
    4112             :                 &allow_remaining_obj)) {
    4113           0 :                 return NULL;
    4114             :         }
    4115           0 :         blob.length = blob_length;
    4116             : 
    4117           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4118           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4119             :         }
    4120           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4121           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4122             :         }
    4123             : 
    4124           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4125           0 :                 allow_remaining = true;
    4126             :         }
    4127             : 
    4128           0 :         return py_mdssvc_close_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4129             : }
    4130             : 
    4131           0 : static PyObject *py_mdssvc_close_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    4132             : {
    4133           0 :         const struct ndr_interface_call *call = NULL;
    4134           0 :         struct mdssvc_close *object = (struct mdssvc_close *)pytalloc_get_ptr(py_obj);
    4135             :         PyObject *ret;
    4136             :         char *retstr;
    4137             : 
    4138           0 :         if (ndr_table_mdssvc.num_calls < 4) {
    4139           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_mdssvc_close_ndr_print");
    4140           0 :                 return NULL;
    4141             :         }
    4142           0 :         call = &ndr_table_mdssvc.calls[3];
    4143             : 
    4144           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    4145           0 :         ret = PyUnicode_FromString(retstr);
    4146           0 :         TALLOC_FREE(retstr);
    4147             : 
    4148           0 :         return ret;
    4149             : }
    4150             : 
    4151           0 : static PyObject *py_mdssvc_close_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4152             : {
    4153           0 :         return py_mdssvc_close_ndr_print(py_obj, "mdssvc_close_in", NDR_IN);
    4154             : }
    4155             : 
    4156           0 : static PyObject *py_mdssvc_close_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4157             : {
    4158           0 :         return py_mdssvc_close_ndr_print(py_obj, "mdssvc_close_out", NDR_OUT);
    4159             : }
    4160             : 
    4161             : static PyMethodDef py_mdssvc_close_methods[] = {
    4162             :         { "opnum", (PyCFunction)py_mdssvc_close_ndr_opnum, METH_NOARGS|METH_CLASS,
    4163             :                 "mdssvc.close.opnum() -> 3 (0x03) " },
    4164             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_close_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    4165             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    4166             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_close_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    4167             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    4168             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_close_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    4169             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    4170             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_mdssvc_close_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    4171             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    4172             :         { "__ndr_print_in__", (PyCFunction)py_mdssvc_close_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    4173             :         { "__ndr_print_out__", (PyCFunction)py_mdssvc_close_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    4174             :         { NULL, NULL, 0, NULL }
    4175             : };
    4176             : 
    4177             : 
    4178             : static PyTypeObject mdssvc_close_Type = {
    4179             :         PyVarObject_HEAD_INIT(NULL, 0)
    4180             :         .tp_name = "mdssvc.close",
    4181             :         .tp_getset = py_mdssvc_close_getsetters,
    4182             :         .tp_methods = py_mdssvc_close_methods,
    4183             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4184             :         .tp_new = py_mdssvc_close_new,
    4185             : };
    4186             : 
    4187           0 : static bool pack_py_mdssvc_close_args_in(PyObject *args, PyObject *kwargs, struct mdssvc_close *r)
    4188             : {
    4189             :         PyObject *py_in_handle;
    4190             :         PyObject *py_unkn1;
    4191             :         PyObject *py_device_id;
    4192             :         PyObject *py_unkn2;
    4193             :         PyObject *py_unkn3;
    4194           0 :         const char *kwnames[] = {
    4195             :                 "in_handle", "unkn1", "device_id", "unkn2", "unkn3", NULL
    4196             :         };
    4197             : 
    4198           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:mdssvc_close", discard_const_p(char *, kwnames), &py_in_handle, &py_unkn1, &py_device_id, &py_unkn2, &py_unkn3)) {
    4199           0 :                 return false;
    4200             :         }
    4201             : 
    4202           0 :         if (py_in_handle == NULL) {
    4203           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.in_handle");
    4204           0 :                 return false;
    4205             :         }
    4206           0 :         r->in.in_handle = talloc_ptrtype(r, r->in.in_handle);
    4207           0 :         if (r->in.in_handle == NULL) {
    4208           0 :                 PyErr_NoMemory();
    4209           0 :                 return false;
    4210             :         }
    4211           0 :         PY_CHECK_TYPE(policy_handle_Type, py_in_handle, return false;);
    4212           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_in_handle)) == NULL) {
    4213           0 :                 PyErr_NoMemory();
    4214           0 :                 return false;
    4215             :         }
    4216           0 :         r->in.in_handle = (struct policy_handle *)pytalloc_get_ptr(py_in_handle);
    4217           0 :         if (py_unkn1 == NULL) {
    4218           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn1");
    4219           0 :                 return false;
    4220             :         }
    4221             :         {
    4222           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn1));
    4223           0 :                 if (PyLong_Check(py_unkn1)) {
    4224             :                         unsigned long long test_var;
    4225           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn1);
    4226           0 :                         if (PyErr_Occurred() != NULL) {
    4227           0 :                                 return false;
    4228             :                         }
    4229           0 :                         if (test_var > uint_max) {
    4230           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4231             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4232           0 :                                 return false;
    4233             :                         }
    4234           0 :                         r->in.unkn1 = test_var;
    4235             :                 } else {
    4236           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4237             :                           PyLong_Type.tp_name);
    4238           0 :                         return false;
    4239             :                 }
    4240             :         }
    4241           0 :         if (py_device_id == NULL) {
    4242           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.device_id");
    4243           0 :                 return false;
    4244             :         }
    4245             :         {
    4246           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.device_id));
    4247           0 :                 if (PyLong_Check(py_device_id)) {
    4248             :                         unsigned long long test_var;
    4249           0 :                         test_var = PyLong_AsUnsignedLongLong(py_device_id);
    4250           0 :                         if (PyErr_Occurred() != NULL) {
    4251           0 :                                 return false;
    4252             :                         }
    4253           0 :                         if (test_var > uint_max) {
    4254           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4255             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4256           0 :                                 return false;
    4257             :                         }
    4258           0 :                         r->in.device_id = test_var;
    4259             :                 } else {
    4260           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4261             :                           PyLong_Type.tp_name);
    4262           0 :                         return false;
    4263             :                 }
    4264             :         }
    4265           0 :         if (py_unkn2 == NULL) {
    4266           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn2");
    4267           0 :                 return false;
    4268             :         }
    4269             :         {
    4270           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn2));
    4271           0 :                 if (PyLong_Check(py_unkn2)) {
    4272             :                         unsigned long long test_var;
    4273           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn2);
    4274           0 :                         if (PyErr_Occurred() != NULL) {
    4275           0 :                                 return false;
    4276             :                         }
    4277           0 :                         if (test_var > uint_max) {
    4278           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4279             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4280           0 :                                 return false;
    4281             :                         }
    4282           0 :                         r->in.unkn2 = test_var;
    4283             :                 } else {
    4284           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4285             :                           PyLong_Type.tp_name);
    4286           0 :                         return false;
    4287             :                 }
    4288             :         }
    4289           0 :         if (py_unkn3 == NULL) {
    4290           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unkn3");
    4291           0 :                 return false;
    4292             :         }
    4293             :         {
    4294           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unkn3));
    4295           0 :                 if (PyLong_Check(py_unkn3)) {
    4296             :                         unsigned long long test_var;
    4297           0 :                         test_var = PyLong_AsUnsignedLongLong(py_unkn3);
    4298           0 :                         if (PyErr_Occurred() != NULL) {
    4299           0 :                                 return false;
    4300             :                         }
    4301           0 :                         if (test_var > uint_max) {
    4302           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4303             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4304           0 :                                 return false;
    4305             :                         }
    4306           0 :                         r->in.unkn3 = test_var;
    4307             :                 } else {
    4308           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4309             :                           PyLong_Type.tp_name);
    4310           0 :                         return false;
    4311             :                 }
    4312             :         }
    4313           0 :         return true;
    4314             : }
    4315             : 
    4316           0 : static PyObject *unpack_py_mdssvc_close_args_out(struct mdssvc_close *r)
    4317             : {
    4318             :         PyObject *result;
    4319             :         PyObject *py_out_handle;
    4320             :         PyObject *py_status;
    4321           0 :         result = PyTuple_New(2);
    4322           0 :         py_out_handle = pytalloc_reference_ex(policy_handle_Type, r->out.out_handle, r->out.out_handle);
    4323           0 :         PyTuple_SetItem(result, 0, py_out_handle);
    4324           0 :         py_status = PyLong_FromUnsignedLongLong((uint32_t)*r->out.status);
    4325           0 :         PyTuple_SetItem(result, 1, py_status);
    4326           0 :         return result;
    4327             : }
    4328             : 
    4329             : const struct PyNdrRpcMethodDef py_ndr_mdssvc_methods[] = {
    4330             :         { "open", "S.open(device_id, unkn2, unkn3, share_mount_path, share_name) -> (device_id, unkn2, unkn3, share_path, handle)", (py_dcerpc_call_fn)dcerpc_mdssvc_open_r, (py_data_pack_fn)pack_py_mdssvc_open_args_in, (py_data_unpack_fn)unpack_py_mdssvc_open_args_out, 0, &ndr_table_mdssvc },
    4331             :         { "unknown1", "S.unknown1(handle, unkn1, device_id, unkn3, unkn4, uid, gid) -> (status, flags, unkn7)", (py_dcerpc_call_fn)dcerpc_mdssvc_unknown1_r, (py_data_pack_fn)pack_py_mdssvc_unknown1_args_in, (py_data_unpack_fn)unpack_py_mdssvc_unknown1_args_out, 1, &ndr_table_mdssvc },
    4332             :         { "cmd", "S.cmd(handle, unkn1, device_id, unkn3, unkn4, flags, request_blob, unkn5, max_fragment_size1, unkn6, max_fragment_size2, unkn7, unkn8) -> (fragment, response_blob, unkn9)", (py_dcerpc_call_fn)dcerpc_mdssvc_cmd_r, (py_data_pack_fn)pack_py_mdssvc_cmd_args_in, (py_data_unpack_fn)unpack_py_mdssvc_cmd_args_out, 2, &ndr_table_mdssvc },
    4333             :         { "close", "S.close(in_handle, unkn1, device_id, unkn2, unkn3) -> (out_handle, status)", (py_dcerpc_call_fn)dcerpc_mdssvc_close_r, (py_data_pack_fn)pack_py_mdssvc_close_args_in, (py_data_unpack_fn)unpack_py_mdssvc_close_args_out, 3, &ndr_table_mdssvc },
    4334             :         {0}
    4335             : };
    4336             : 
    4337           6 : static PyObject *interface_mdssvc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4338             : {
    4339           6 :         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_mdssvc);
    4340             : }
    4341             : 
    4342             : #define PY_DOC_MDSSVC "Spotlight metadata search service"
    4343             : static PyTypeObject mdssvc_InterfaceType = {
    4344             :         PyVarObject_HEAD_INIT(NULL, 0)
    4345             :         .tp_name = "mdssvc.mdssvc",
    4346             :         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
    4347             :         .tp_doc = "mdssvc(binding, lp_ctx=None, credentials=None) -> connection\n"
    4348             : "\n"
    4349             : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
    4350             : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
    4351             : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_MDSSVC,
    4352             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4353             :         .tp_new = interface_mdssvc_new,
    4354             : };
    4355             : 
    4356           0 : static PyObject *syntax_mdssvc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4357             : {
    4358           0 :         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_mdssvc.syntax_id);
    4359             : }
    4360             : 
    4361             : #define PY_DOC_MDSSVC_SYNTAX "Spotlight metadata search service"
    4362             : static PyTypeObject mdssvc_SyntaxType = {
    4363             :         PyVarObject_HEAD_INIT(NULL, 0)
    4364             :         .tp_name = "mdssvc.mdssvc_abstract_syntax",
    4365             :         .tp_doc = "mdssvc_abstract_syntax()\n"PY_DOC_MDSSVC_SYNTAX,
    4366             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4367             :         .tp_new = syntax_mdssvc_new,
    4368             : };
    4369             : 
    4370             : static PyMethodDef mdssvc_methods[] = {
    4371             :         { NULL, NULL, 0, NULL }
    4372             : };
    4373             : 
    4374             : static struct PyModuleDef moduledef = {
    4375             :         PyModuleDef_HEAD_INIT,
    4376             :         .m_name = "mdssvc",
    4377             :         .m_doc = "mdssvc DCE/RPC",
    4378             :         .m_size = -1,
    4379             :         .m_methods = mdssvc_methods,
    4380             : };
    4381           4 : MODULE_INIT_FUNC(mdssvc)
    4382             : {
    4383           4 :         PyObject *m = NULL;
    4384           4 :         PyObject *dep_samba_dcerpc_misc = NULL;
    4385           4 :         PyObject *dep_talloc = NULL;
    4386           4 :         PyObject *dep_samba_dcerpc_base = NULL;
    4387             : 
    4388           4 :         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
    4389           4 :         if (dep_samba_dcerpc_misc == NULL)
    4390           0 :                 goto out;
    4391             : 
    4392           4 :         dep_talloc = PyImport_ImportModule("talloc");
    4393           4 :         if (dep_talloc == NULL)
    4394           0 :                 goto out;
    4395             : 
    4396           4 :         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
    4397           4 :         if (dep_samba_dcerpc_base == NULL)
    4398           0 :                 goto out;
    4399             : 
    4400           4 :         BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
    4401           4 :         if (BaseObject_Type == NULL)
    4402           0 :                 goto out;
    4403             : 
    4404           4 :         policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
    4405           4 :         if (policy_handle_Type == NULL)
    4406           0 :                 goto out;
    4407             : 
    4408           4 :         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
    4409           4 :         if (ClientConnection_Type == NULL)
    4410           0 :                 goto out;
    4411             : 
    4412           4 :         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
    4413           4 :         if (ndr_syntax_id_Type == NULL)
    4414           0 :                 goto out;
    4415             : 
    4416           4 :         mdssvc_blob_Type.tp_base = BaseObject_Type;
    4417           4 :         mdssvc_blob_Type.tp_basicsize = pytalloc_BaseObject_size();
    4418             : 
    4419           4 :         mdssvc_open_Type.tp_base = BaseObject_Type;
    4420           4 :         mdssvc_open_Type.tp_basicsize = pytalloc_BaseObject_size();
    4421             : 
    4422           4 :         mdssvc_unknown1_Type.tp_base = BaseObject_Type;
    4423           4 :         mdssvc_unknown1_Type.tp_basicsize = pytalloc_BaseObject_size();
    4424             : 
    4425           4 :         mdssvc_cmd_Type.tp_base = BaseObject_Type;
    4426           4 :         mdssvc_cmd_Type.tp_basicsize = pytalloc_BaseObject_size();
    4427             : 
    4428           4 :         mdssvc_close_Type.tp_base = BaseObject_Type;
    4429           4 :         mdssvc_close_Type.tp_basicsize = pytalloc_BaseObject_size();
    4430             : 
    4431           4 :         mdssvc_InterfaceType.tp_base = ClientConnection_Type;
    4432             : 
    4433           4 :         mdssvc_SyntaxType.tp_base = ndr_syntax_id_Type;
    4434           4 :         mdssvc_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
    4435             : 
    4436           4 :         if (PyType_Ready(&mdssvc_blob_Type) < 0)
    4437           0 :                 goto out;
    4438           4 :         if (PyType_Ready(&mdssvc_open_Type) < 0)
    4439           0 :                 goto out;
    4440           4 :         if (PyType_Ready(&mdssvc_unknown1_Type) < 0)
    4441           0 :                 goto out;
    4442           4 :         if (PyType_Ready(&mdssvc_cmd_Type) < 0)
    4443           0 :                 goto out;
    4444           4 :         if (PyType_Ready(&mdssvc_close_Type) < 0)
    4445           0 :                 goto out;
    4446           4 :         if (PyType_Ready(&mdssvc_InterfaceType) < 0)
    4447           0 :                 goto out;
    4448           4 :         if (PyType_Ready(&mdssvc_SyntaxType) < 0)
    4449           0 :                 goto out;
    4450           4 :         if (!PyInterface_AddNdrRpcMethods(&mdssvc_InterfaceType, py_ndr_mdssvc_methods))
    4451           0 :                 return NULL;
    4452             : 
    4453             : #ifdef PY_BLOB_PATCH
    4454             :         PY_BLOB_PATCH(&mdssvc_blob_Type);
    4455             : #endif
    4456             : #ifdef PY_OPEN_PATCH
    4457             :         PY_OPEN_PATCH(&mdssvc_open_Type);
    4458             : #endif
    4459             : #ifdef PY_UNKNOWN1_PATCH
    4460             :         PY_UNKNOWN1_PATCH(&mdssvc_unknown1_Type);
    4461             : #endif
    4462             : #ifdef PY_CMD_PATCH
    4463             :         PY_CMD_PATCH(&mdssvc_cmd_Type);
    4464             : #endif
    4465             : #ifdef PY_CLOSE_PATCH
    4466             :         PY_CLOSE_PATCH(&mdssvc_close_Type);
    4467             : #endif
    4468             : #ifdef PY_MDSSVC_PATCH
    4469             :         PY_MDSSVC_PATCH(&mdssvc_InterfaceType);
    4470             : #endif
    4471             : #ifdef PY_MDSSVC_ABSTRACT_SYNTAX_PATCH
    4472             :         PY_MDSSVC_ABSTRACT_SYNTAX_PATCH(&mdssvc_SyntaxType);
    4473             : #endif
    4474             : #ifdef PY_ABSTRACT_SYNTAX_PATCH
    4475             :         PY_ABSTRACT_SYNTAX_PATCH(&mdssvc_SyntaxType);
    4476             : #endif
    4477             : 
    4478           4 :         m = PyModule_Create(&moduledef);
    4479           4 :         if (m == NULL)
    4480           0 :                 goto out;
    4481             : 
    4482           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_blob_Type);
    4483           4 :         PyModule_AddObject(m, "blob", (PyObject *)(void *)&mdssvc_blob_Type);
    4484           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_open_Type);
    4485           4 :         PyModule_AddObject(m, "open", (PyObject *)(void *)&mdssvc_open_Type);
    4486           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_unknown1_Type);
    4487           4 :         PyModule_AddObject(m, "unknown1", (PyObject *)(void *)&mdssvc_unknown1_Type);
    4488           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_cmd_Type);
    4489           4 :         PyModule_AddObject(m, "cmd", (PyObject *)(void *)&mdssvc_cmd_Type);
    4490           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_close_Type);
    4491           4 :         PyModule_AddObject(m, "close", (PyObject *)(void *)&mdssvc_close_Type);
    4492           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_InterfaceType);
    4493           4 :         PyModule_AddObject(m, "mdssvc", (PyObject *)(void *)&mdssvc_InterfaceType);
    4494           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_SyntaxType);
    4495           4 :         PyModule_AddObject(m, "mdssvc_abstract_syntax", (PyObject *)(void *)&mdssvc_SyntaxType);
    4496           4 :         Py_INCREF((PyObject *)(void *)&mdssvc_SyntaxType);
    4497           4 :         PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&mdssvc_SyntaxType);
    4498             : #ifdef PY_MOD_MDSSVC_PATCH
    4499             :         PY_MOD_MDSSVC_PATCH(m);
    4500             : #endif
    4501           4 :         out:
    4502           4 :         Py_XDECREF(dep_samba_dcerpc_misc);
    4503           4 :         Py_XDECREF(dep_talloc);
    4504           4 :         Py_XDECREF(dep_samba_dcerpc_base);
    4505           4 :         return m;
    4506             : 
    4507             : }

Generated by: LCOV version 1.13