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

Generated by: LCOV version 1.14