LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_svcctl.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 369 16551 2.2 %
Date: 2021-09-23 10:06:22 Functions: 1 1121 0.1 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include <Python.h>
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_svcctl.h"
      12             : #include "bin/default/librpc/gen_ndr/ndr_svcctl_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             : #include "librpc/gen_ndr/security.h"
      66             : static PyTypeObject SERVICE_LOCK_STATUS_Type;
      67             : static PyTypeObject SERVICE_STATUS_Type;
      68             : static PyTypeObject SERVICE_STATUS_PROCESS_Type;
      69             : static PyTypeObject ENUM_SERVICE_STATUSW_Type;
      70             : static PyTypeObject ENUM_SERVICE_STATUSA_Type;
      71             : static PyTypeObject QUERY_SERVICE_CONFIG_Type;
      72             : static PyTypeObject svcctl_ArgumentString_Type;
      73             : static PyTypeObject SERVICE_DESCRIPTION_Type;
      74             : static PyTypeObject SC_ACTION_Type;
      75             : static PyTypeObject SERVICE_FAILURE_ACTIONS_Type;
      76             : static PyTypeObject svcctl_InterfaceType;
      77             : static PyTypeObject svcctl_CloseServiceHandle_Type;
      78             : static PyTypeObject svcctl_ControlService_Type;
      79             : static PyTypeObject svcctl_DeleteService_Type;
      80             : static PyTypeObject svcctl_LockServiceDatabase_Type;
      81             : static PyTypeObject svcctl_QueryServiceObjectSecurity_Type;
      82             : static PyTypeObject svcctl_SetServiceObjectSecurity_Type;
      83             : static PyTypeObject svcctl_QueryServiceStatus_Type;
      84             : static PyTypeObject svcctl_UnlockServiceDatabase_Type;
      85             : static PyTypeObject svcctl_SCSetServiceBitsW_Type;
      86             : static PyTypeObject svcctl_ChangeServiceConfigW_Type;
      87             : static PyTypeObject svcctl_CreateServiceW_Type;
      88             : static PyTypeObject svcctl_EnumDependentServicesW_Type;
      89             : static PyTypeObject svcctl_EnumServicesStatusW_Type;
      90             : static PyTypeObject svcctl_OpenSCManagerW_Type;
      91             : static PyTypeObject svcctl_OpenServiceW_Type;
      92             : static PyTypeObject svcctl_QueryServiceConfigW_Type;
      93             : static PyTypeObject svcctl_QueryServiceLockStatusW_Type;
      94             : static PyTypeObject svcctl_StartServiceW_Type;
      95             : static PyTypeObject svcctl_GetServiceDisplayNameW_Type;
      96             : static PyTypeObject svcctl_GetServiceKeyNameW_Type;
      97             : static PyTypeObject svcctl_SCSetServiceBitsA_Type;
      98             : static PyTypeObject svcctl_ChangeServiceConfigA_Type;
      99             : static PyTypeObject svcctl_CreateServiceA_Type;
     100             : static PyTypeObject svcctl_EnumDependentServicesA_Type;
     101             : static PyTypeObject svcctl_EnumServicesStatusA_Type;
     102             : static PyTypeObject svcctl_OpenSCManagerA_Type;
     103             : static PyTypeObject svcctl_OpenServiceA_Type;
     104             : static PyTypeObject svcctl_QueryServiceConfigA_Type;
     105             : static PyTypeObject svcctl_QueryServiceLockStatusA_Type;
     106             : static PyTypeObject svcctl_StartServiceA_Type;
     107             : static PyTypeObject svcctl_GetServiceDisplayNameA_Type;
     108             : static PyTypeObject svcctl_GetServiceKeyNameA_Type;
     109             : static PyTypeObject svcctl_ChangeServiceConfig2A_Type;
     110             : static PyTypeObject svcctl_ChangeServiceConfig2W_Type;
     111             : static PyTypeObject svcctl_QueryServiceConfig2A_Type;
     112             : static PyTypeObject svcctl_QueryServiceConfig2W_Type;
     113             : static PyTypeObject svcctl_QueryServiceStatusEx_Type;
     114             : static PyTypeObject EnumServicesStatusExA_Type;
     115             : static PyTypeObject EnumServicesStatusExW_Type;
     116             : 
     117             : static PyTypeObject *BaseObject_Type;
     118             : static PyTypeObject *policy_handle_Type;
     119             : static PyTypeObject *ClientConnection_Type;
     120             : static PyTypeObject *ndr_syntax_id_Type;
     121             : 
     122           0 : static PyObject *py_SERVICE_LOCK_STATUS_get_is_locked(PyObject *obj, void *closure)
     123             : {
     124           0 :         struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
     125             :         PyObject *py_is_locked;
     126           0 :         py_is_locked = PyLong_FromUnsignedLongLong((uint32_t)object->is_locked);
     127           0 :         return py_is_locked;
     128             : }
     129             : 
     130           0 : static int py_SERVICE_LOCK_STATUS_set_is_locked(PyObject *py_obj, PyObject *value, void *closure)
     131             : {
     132           0 :         struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
     133           0 :         if (value == NULL) {
     134           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->is_locked");
     135           0 :                 return -1;
     136             :         }
     137             :         {
     138           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->is_locked));
     139           0 :                 if (PyLong_Check(value)) {
     140             :                         unsigned long long test_var;
     141           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     142           0 :                         if (PyErr_Occurred() != NULL) {
     143           0 :                                 return -1;
     144             :                         }
     145           0 :                         if (test_var > uint_max) {
     146           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     147             :                                   PyLong_Type.tp_name, uint_max, test_var);
     148           0 :                                 return -1;
     149             :                         }
     150           0 :                         object->is_locked = test_var;
     151             :                 } else {
     152           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     153             :                           PyLong_Type.tp_name);
     154           0 :                         return -1;
     155             :                 }
     156             :         }
     157           0 :         return 0;
     158             : }
     159             : 
     160           0 : static PyObject *py_SERVICE_LOCK_STATUS_get_lock_owner(PyObject *obj, void *closure)
     161             : {
     162           0 :         struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
     163             :         PyObject *py_lock_owner;
     164           0 :         if (object->lock_owner == NULL) {
     165           0 :                 Py_RETURN_NONE;
     166             :         }
     167           0 :         if (object->lock_owner == NULL) {
     168           0 :                 py_lock_owner = Py_None;
     169           0 :                 Py_INCREF(py_lock_owner);
     170             :         } else {
     171           0 :                 if (object->lock_owner == NULL) {
     172           0 :                         py_lock_owner = Py_None;
     173           0 :                         Py_INCREF(py_lock_owner);
     174             :                 } else {
     175           0 :                         py_lock_owner = PyUnicode_Decode(object->lock_owner, strlen(object->lock_owner), "utf-8", "ignore");
     176             :                 }
     177             :         }
     178           0 :         return py_lock_owner;
     179             : }
     180             : 
     181           0 : static int py_SERVICE_LOCK_STATUS_set_lock_owner(PyObject *py_obj, PyObject *value, void *closure)
     182             : {
     183           0 :         struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
     184           0 :         if (value == NULL) {
     185           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lock_owner");
     186           0 :                 return -1;
     187             :         }
     188           0 :         if (value == Py_None) {
     189           0 :                 object->lock_owner = NULL;
     190             :         } else {
     191           0 :                 object->lock_owner = NULL;
     192             :                 {
     193             :                         const char *test_str;
     194             :                         const char *talloc_str;
     195           0 :                         PyObject *unicode = NULL;
     196           0 :                         if (PyUnicode_Check(value)) {
     197           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     198           0 :                                 if (unicode == NULL) {
     199           0 :                                         PyErr_NoMemory();
     200           0 :                                         return -1;
     201             :                                 }
     202           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     203           0 :                         } else if (PyBytes_Check(value)) {
     204           0 :                                 test_str = PyBytes_AS_STRING(value);
     205             :                         } else {
     206           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     207           0 :                                 return -1;
     208             :                         }
     209           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     210           0 :                         if (unicode != NULL) {
     211           0 :                                 Py_DECREF(unicode);
     212             :                         }
     213           0 :                         if (talloc_str == NULL) {
     214           0 :                                 PyErr_NoMemory();
     215           0 :                                 return -1;
     216             :                         }
     217           0 :                         object->lock_owner = talloc_str;
     218             :                 }
     219             :         }
     220           0 :         return 0;
     221             : }
     222             : 
     223           0 : static PyObject *py_SERVICE_LOCK_STATUS_get_lock_duration(PyObject *obj, void *closure)
     224             : {
     225           0 :         struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
     226             :         PyObject *py_lock_duration;
     227           0 :         py_lock_duration = PyLong_FromUnsignedLongLong((uint32_t)object->lock_duration);
     228           0 :         return py_lock_duration;
     229             : }
     230             : 
     231           0 : static int py_SERVICE_LOCK_STATUS_set_lock_duration(PyObject *py_obj, PyObject *value, void *closure)
     232             : {
     233           0 :         struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
     234           0 :         if (value == NULL) {
     235           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lock_duration");
     236           0 :                 return -1;
     237             :         }
     238             :         {
     239           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lock_duration));
     240           0 :                 if (PyLong_Check(value)) {
     241             :                         unsigned long long test_var;
     242           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     243           0 :                         if (PyErr_Occurred() != NULL) {
     244           0 :                                 return -1;
     245             :                         }
     246           0 :                         if (test_var > uint_max) {
     247           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     248             :                                   PyLong_Type.tp_name, uint_max, test_var);
     249           0 :                                 return -1;
     250             :                         }
     251           0 :                         object->lock_duration = test_var;
     252             :                 } else {
     253           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     254             :                           PyLong_Type.tp_name);
     255           0 :                         return -1;
     256             :                 }
     257             :         }
     258           0 :         return 0;
     259             : }
     260             : 
     261             : static PyGetSetDef py_SERVICE_LOCK_STATUS_getsetters[] = {
     262             :         {
     263             :                 .name = discard_const_p(char, "is_locked"),
     264             :                 .get = py_SERVICE_LOCK_STATUS_get_is_locked,
     265             :                 .set = py_SERVICE_LOCK_STATUS_set_is_locked,
     266             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     267             :         },
     268             :         {
     269             :                 .name = discard_const_p(char, "lock_owner"),
     270             :                 .get = py_SERVICE_LOCK_STATUS_get_lock_owner,
     271             :                 .set = py_SERVICE_LOCK_STATUS_set_lock_owner,
     272             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     273             :         },
     274             :         {
     275             :                 .name = discard_const_p(char, "lock_duration"),
     276             :                 .get = py_SERVICE_LOCK_STATUS_get_lock_duration,
     277             :                 .set = py_SERVICE_LOCK_STATUS_set_lock_duration,
     278             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     279             :         },
     280             :         { .name = NULL }
     281             : };
     282             : 
     283           0 : static PyObject *py_SERVICE_LOCK_STATUS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     284             : {
     285           0 :         return pytalloc_new(struct SERVICE_LOCK_STATUS, type);
     286             : }
     287             : 
     288             : 
     289             : static PyTypeObject SERVICE_LOCK_STATUS_Type = {
     290             :         PyVarObject_HEAD_INIT(NULL, 0)
     291             :         .tp_name = "svcctl.SERVICE_LOCK_STATUS",
     292             :         .tp_getset = py_SERVICE_LOCK_STATUS_getsetters,
     293             :         .tp_methods = NULL,
     294             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     295             :         .tp_new = py_SERVICE_LOCK_STATUS_new,
     296             : };
     297             : 
     298             : 
     299           0 : static PyObject *py_SERVICE_STATUS_get_type(PyObject *obj, void *closure)
     300             : {
     301           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
     302             :         PyObject *py_type;
     303           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
     304           0 :         return py_type;
     305             : }
     306             : 
     307           0 : static int py_SERVICE_STATUS_set_type(PyObject *py_obj, PyObject *value, void *closure)
     308             : {
     309           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
     310           0 :         if (value == NULL) {
     311           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
     312           0 :                 return -1;
     313             :         }
     314             :         {
     315           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
     316           0 :                 if (PyLong_Check(value)) {
     317             :                         unsigned long long test_var;
     318           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     319           0 :                         if (PyErr_Occurred() != NULL) {
     320           0 :                                 return -1;
     321             :                         }
     322           0 :                         if (test_var > uint_max) {
     323           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     324             :                                   PyLong_Type.tp_name, uint_max, test_var);
     325           0 :                                 return -1;
     326             :                         }
     327           0 :                         object->type = test_var;
     328             :                 } else {
     329           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     330             :                           PyLong_Type.tp_name);
     331           0 :                         return -1;
     332             :                 }
     333             :         }
     334           0 :         return 0;
     335             : }
     336             : 
     337           0 : static PyObject *py_SERVICE_STATUS_get_state(PyObject *obj, void *closure)
     338             : {
     339           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
     340             :         PyObject *py_state;
     341           0 :         py_state = PyLong_FromUnsignedLongLong((uint32_t)object->state);
     342           0 :         return py_state;
     343             : }
     344             : 
     345           0 : static int py_SERVICE_STATUS_set_state(PyObject *py_obj, PyObject *value, void *closure)
     346             : {
     347           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
     348           0 :         if (value == NULL) {
     349           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->state");
     350           0 :                 return -1;
     351             :         }
     352             :         {
     353           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->state));
     354           0 :                 if (PyLong_Check(value)) {
     355             :                         unsigned long long test_var;
     356           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     357           0 :                         if (PyErr_Occurred() != NULL) {
     358           0 :                                 return -1;
     359             :                         }
     360           0 :                         if (test_var > uint_max) {
     361           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     362             :                                   PyLong_Type.tp_name, uint_max, test_var);
     363           0 :                                 return -1;
     364             :                         }
     365           0 :                         object->state = test_var;
     366             :                 } else {
     367           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     368             :                           PyLong_Type.tp_name);
     369           0 :                         return -1;
     370             :                 }
     371             :         }
     372           0 :         return 0;
     373             : }
     374             : 
     375           0 : static PyObject *py_SERVICE_STATUS_get_controls_accepted(PyObject *obj, void *closure)
     376             : {
     377           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
     378             :         PyObject *py_controls_accepted;
     379           0 :         py_controls_accepted = PyLong_FromUnsignedLongLong((uint32_t)object->controls_accepted);
     380           0 :         return py_controls_accepted;
     381             : }
     382             : 
     383           0 : static int py_SERVICE_STATUS_set_controls_accepted(PyObject *py_obj, PyObject *value, void *closure)
     384             : {
     385           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
     386           0 :         if (value == NULL) {
     387           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->controls_accepted");
     388           0 :                 return -1;
     389             :         }
     390             :         {
     391           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->controls_accepted));
     392           0 :                 if (PyLong_Check(value)) {
     393             :                         unsigned long long test_var;
     394           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     395           0 :                         if (PyErr_Occurred() != NULL) {
     396           0 :                                 return -1;
     397             :                         }
     398           0 :                         if (test_var > uint_max) {
     399           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     400             :                                   PyLong_Type.tp_name, uint_max, test_var);
     401           0 :                                 return -1;
     402             :                         }
     403           0 :                         object->controls_accepted = test_var;
     404             :                 } else {
     405           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     406             :                           PyLong_Type.tp_name);
     407           0 :                         return -1;
     408             :                 }
     409             :         }
     410           0 :         return 0;
     411             : }
     412             : 
     413           0 : static PyObject *py_SERVICE_STATUS_get_win32_exit_code(PyObject *obj, void *closure)
     414             : {
     415           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
     416             :         PyObject *py_win32_exit_code;
     417           0 :         py_win32_exit_code = PyErr_FromWERROR(object->win32_exit_code);
     418           0 :         return py_win32_exit_code;
     419             : }
     420             : 
     421           0 : static int py_SERVICE_STATUS_set_win32_exit_code(PyObject *py_obj, PyObject *value, void *closure)
     422             : {
     423           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
     424           0 :         if (value == NULL) {
     425           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->win32_exit_code");
     426           0 :                 return -1;
     427             :         }
     428           0 :         object->win32_exit_code = W_ERROR(PyLong_AsLong(value));
     429           0 :         return 0;
     430             : }
     431             : 
     432           0 : static PyObject *py_SERVICE_STATUS_get_service_exit_code(PyObject *obj, void *closure)
     433             : {
     434           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
     435             :         PyObject *py_service_exit_code;
     436           0 :         py_service_exit_code = PyLong_FromUnsignedLongLong((uint32_t)object->service_exit_code);
     437           0 :         return py_service_exit_code;
     438             : }
     439             : 
     440           0 : static int py_SERVICE_STATUS_set_service_exit_code(PyObject *py_obj, PyObject *value, void *closure)
     441             : {
     442           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
     443           0 :         if (value == NULL) {
     444           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_exit_code");
     445           0 :                 return -1;
     446             :         }
     447             :         {
     448           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_exit_code));
     449           0 :                 if (PyLong_Check(value)) {
     450             :                         unsigned long long test_var;
     451           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     452           0 :                         if (PyErr_Occurred() != NULL) {
     453           0 :                                 return -1;
     454             :                         }
     455           0 :                         if (test_var > uint_max) {
     456           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     457             :                                   PyLong_Type.tp_name, uint_max, test_var);
     458           0 :                                 return -1;
     459             :                         }
     460           0 :                         object->service_exit_code = test_var;
     461             :                 } else {
     462           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     463             :                           PyLong_Type.tp_name);
     464           0 :                         return -1;
     465             :                 }
     466             :         }
     467           0 :         return 0;
     468             : }
     469             : 
     470           0 : static PyObject *py_SERVICE_STATUS_get_check_point(PyObject *obj, void *closure)
     471             : {
     472           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
     473             :         PyObject *py_check_point;
     474           0 :         py_check_point = PyLong_FromUnsignedLongLong((uint32_t)object->check_point);
     475           0 :         return py_check_point;
     476             : }
     477             : 
     478           0 : static int py_SERVICE_STATUS_set_check_point(PyObject *py_obj, PyObject *value, void *closure)
     479             : {
     480           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
     481           0 :         if (value == NULL) {
     482           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->check_point");
     483           0 :                 return -1;
     484             :         }
     485             :         {
     486           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->check_point));
     487           0 :                 if (PyLong_Check(value)) {
     488             :                         unsigned long long test_var;
     489           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     490           0 :                         if (PyErr_Occurred() != NULL) {
     491           0 :                                 return -1;
     492             :                         }
     493           0 :                         if (test_var > uint_max) {
     494           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     495             :                                   PyLong_Type.tp_name, uint_max, test_var);
     496           0 :                                 return -1;
     497             :                         }
     498           0 :                         object->check_point = test_var;
     499             :                 } else {
     500           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     501             :                           PyLong_Type.tp_name);
     502           0 :                         return -1;
     503             :                 }
     504             :         }
     505           0 :         return 0;
     506             : }
     507             : 
     508           0 : static PyObject *py_SERVICE_STATUS_get_wait_hint(PyObject *obj, void *closure)
     509             : {
     510           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
     511             :         PyObject *py_wait_hint;
     512           0 :         py_wait_hint = PyLong_FromUnsignedLongLong((uint32_t)object->wait_hint);
     513           0 :         return py_wait_hint;
     514             : }
     515             : 
     516           0 : static int py_SERVICE_STATUS_set_wait_hint(PyObject *py_obj, PyObject *value, void *closure)
     517             : {
     518           0 :         struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
     519           0 :         if (value == NULL) {
     520           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->wait_hint");
     521           0 :                 return -1;
     522             :         }
     523             :         {
     524           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wait_hint));
     525           0 :                 if (PyLong_Check(value)) {
     526             :                         unsigned long long test_var;
     527           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     528           0 :                         if (PyErr_Occurred() != NULL) {
     529           0 :                                 return -1;
     530             :                         }
     531           0 :                         if (test_var > uint_max) {
     532           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     533             :                                   PyLong_Type.tp_name, uint_max, test_var);
     534           0 :                                 return -1;
     535             :                         }
     536           0 :                         object->wait_hint = test_var;
     537             :                 } else {
     538           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     539             :                           PyLong_Type.tp_name);
     540           0 :                         return -1;
     541             :                 }
     542             :         }
     543           0 :         return 0;
     544             : }
     545             : 
     546             : static PyGetSetDef py_SERVICE_STATUS_getsetters[] = {
     547             :         {
     548             :                 .name = discard_const_p(char, "type"),
     549             :                 .get = py_SERVICE_STATUS_get_type,
     550             :                 .set = py_SERVICE_STATUS_set_type,
     551             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     552             :         },
     553             :         {
     554             :                 .name = discard_const_p(char, "state"),
     555             :                 .get = py_SERVICE_STATUS_get_state,
     556             :                 .set = py_SERVICE_STATUS_set_state,
     557             :                 .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceStatus")
     558             :         },
     559             :         {
     560             :                 .name = discard_const_p(char, "controls_accepted"),
     561             :                 .get = py_SERVICE_STATUS_get_controls_accepted,
     562             :                 .set = py_SERVICE_STATUS_set_controls_accepted,
     563             :                 .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ControlsAccepted")
     564             :         },
     565             :         {
     566             :                 .name = discard_const_p(char, "win32_exit_code"),
     567             :                 .get = py_SERVICE_STATUS_get_win32_exit_code,
     568             :                 .set = py_SERVICE_STATUS_set_win32_exit_code,
     569             :                 .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
     570             :         },
     571             :         {
     572             :                 .name = discard_const_p(char, "service_exit_code"),
     573             :                 .get = py_SERVICE_STATUS_get_service_exit_code,
     574             :                 .set = py_SERVICE_STATUS_set_service_exit_code,
     575             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     576             :         },
     577             :         {
     578             :                 .name = discard_const_p(char, "check_point"),
     579             :                 .get = py_SERVICE_STATUS_get_check_point,
     580             :                 .set = py_SERVICE_STATUS_set_check_point,
     581             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     582             :         },
     583             :         {
     584             :                 .name = discard_const_p(char, "wait_hint"),
     585             :                 .get = py_SERVICE_STATUS_get_wait_hint,
     586             :                 .set = py_SERVICE_STATUS_set_wait_hint,
     587             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     588             :         },
     589             :         { .name = NULL }
     590             : };
     591             : 
     592           0 : static PyObject *py_SERVICE_STATUS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     593             : {
     594           0 :         return pytalloc_new(struct SERVICE_STATUS, type);
     595             : }
     596             : 
     597             : 
     598             : static PyTypeObject SERVICE_STATUS_Type = {
     599             :         PyVarObject_HEAD_INIT(NULL, 0)
     600             :         .tp_name = "svcctl.SERVICE_STATUS",
     601             :         .tp_getset = py_SERVICE_STATUS_getsetters,
     602             :         .tp_methods = NULL,
     603             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     604             :         .tp_new = py_SERVICE_STATUS_new,
     605             : };
     606             : 
     607             : 
     608           0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_status(PyObject *obj, void *closure)
     609             : {
     610           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
     611             :         PyObject *py_status;
     612           0 :         py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
     613           0 :         return py_status;
     614             : }
     615             : 
     616           0 : static int py_SERVICE_STATUS_PROCESS_set_status(PyObject *py_obj, PyObject *value, void *closure)
     617             : {
     618           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
     619           0 :         if (value == NULL) {
     620           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
     621           0 :                 return -1;
     622             :         }
     623           0 :         PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
     624           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     625           0 :                 PyErr_NoMemory();
     626           0 :                 return -1;
     627             :         }
     628           0 :         object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
     629           0 :         return 0;
     630             : }
     631             : 
     632           0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_process_id(PyObject *obj, void *closure)
     633             : {
     634           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
     635             :         PyObject *py_process_id;
     636           0 :         py_process_id = PyLong_FromUnsignedLongLong((uint32_t)object->process_id);
     637           0 :         return py_process_id;
     638             : }
     639             : 
     640           0 : static int py_SERVICE_STATUS_PROCESS_set_process_id(PyObject *py_obj, PyObject *value, void *closure)
     641             : {
     642           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
     643           0 :         if (value == NULL) {
     644           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->process_id");
     645           0 :                 return -1;
     646             :         }
     647             :         {
     648           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->process_id));
     649           0 :                 if (PyLong_Check(value)) {
     650             :                         unsigned long long test_var;
     651           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     652           0 :                         if (PyErr_Occurred() != NULL) {
     653           0 :                                 return -1;
     654             :                         }
     655           0 :                         if (test_var > uint_max) {
     656           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     657             :                                   PyLong_Type.tp_name, uint_max, test_var);
     658           0 :                                 return -1;
     659             :                         }
     660           0 :                         object->process_id = test_var;
     661             :                 } else {
     662           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     663             :                           PyLong_Type.tp_name);
     664           0 :                         return -1;
     665             :                 }
     666             :         }
     667           0 :         return 0;
     668             : }
     669             : 
     670           0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_service_flags(PyObject *obj, void *closure)
     671             : {
     672           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
     673             :         PyObject *py_service_flags;
     674           0 :         py_service_flags = PyLong_FromUnsignedLongLong((uint32_t)object->service_flags);
     675           0 :         return py_service_flags;
     676             : }
     677             : 
     678           0 : static int py_SERVICE_STATUS_PROCESS_set_service_flags(PyObject *py_obj, PyObject *value, void *closure)
     679             : {
     680           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
     681           0 :         if (value == NULL) {
     682           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_flags");
     683           0 :                 return -1;
     684             :         }
     685             :         {
     686           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_flags));
     687           0 :                 if (PyLong_Check(value)) {
     688             :                         unsigned long long test_var;
     689           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     690           0 :                         if (PyErr_Occurred() != NULL) {
     691           0 :                                 return -1;
     692             :                         }
     693           0 :                         if (test_var > uint_max) {
     694           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     695             :                                   PyLong_Type.tp_name, uint_max, test_var);
     696           0 :                                 return -1;
     697             :                         }
     698           0 :                         object->service_flags = test_var;
     699             :                 } else {
     700           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     701             :                           PyLong_Type.tp_name);
     702           0 :                         return -1;
     703             :                 }
     704             :         }
     705           0 :         return 0;
     706             : }
     707             : 
     708             : static PyGetSetDef py_SERVICE_STATUS_PROCESS_getsetters[] = {
     709             :         {
     710             :                 .name = discard_const_p(char, "status"),
     711             :                 .get = py_SERVICE_STATUS_PROCESS_get_status,
     712             :                 .set = py_SERVICE_STATUS_PROCESS_set_status,
     713             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
     714             :         },
     715             :         {
     716             :                 .name = discard_const_p(char, "process_id"),
     717             :                 .get = py_SERVICE_STATUS_PROCESS_get_process_id,
     718             :                 .set = py_SERVICE_STATUS_PROCESS_set_process_id,
     719             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     720             :         },
     721             :         {
     722             :                 .name = discard_const_p(char, "service_flags"),
     723             :                 .get = py_SERVICE_STATUS_PROCESS_get_service_flags,
     724             :                 .set = py_SERVICE_STATUS_PROCESS_set_service_flags,
     725             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     726             :         },
     727             :         { .name = NULL }
     728             : };
     729             : 
     730           0 : static PyObject *py_SERVICE_STATUS_PROCESS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     731             : {
     732           0 :         return pytalloc_new(struct SERVICE_STATUS_PROCESS, type);
     733             : }
     734             : 
     735           0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     736             : {
     737           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
     738           0 :         PyObject *ret = NULL;
     739             :         DATA_BLOB blob;
     740             :         enum ndr_err_code err;
     741           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     742           0 :         if (tmp_ctx == NULL) {
     743           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     744           0 :                 return NULL;
     745             :         }
     746           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_STATUS_PROCESS);
     747           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     748           0 :                 TALLOC_FREE(tmp_ctx);
     749           0 :                 PyErr_SetNdrError(err);
     750           0 :                 return NULL;
     751             :         }
     752             : 
     753           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     754           0 :         TALLOC_FREE(tmp_ctx);
     755           0 :         return ret;
     756             : }
     757             : 
     758           0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     759             : {
     760           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
     761           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     762           0 :         Py_ssize_t blob_length = 0;
     763             :         enum ndr_err_code err;
     764           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     765           0 :         PyObject *allow_remaining_obj = NULL;
     766           0 :         bool allow_remaining = false;
     767             : 
     768           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     769             :                 discard_const_p(char *, kwnames),
     770             :                 &blob.data, &blob_length,
     771             :                 &allow_remaining_obj)) {
     772           0 :                 return NULL;
     773             :         }
     774           0 :         blob.length = blob_length;
     775             : 
     776           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     777           0 :                 allow_remaining = true;
     778             :         }
     779             : 
     780           0 :         if (allow_remaining) {
     781           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_STATUS_PROCESS);
     782             :         } else {
     783           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_STATUS_PROCESS);
     784             :         }
     785           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     786           0 :                 PyErr_SetNdrError(err);
     787           0 :                 return NULL;
     788             :         }
     789             : 
     790           0 :         Py_RETURN_NONE;
     791             : }
     792             : 
     793           0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     794             : {
     795           0 :         struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
     796             :         PyObject *ret;
     797             :         char *retstr;
     798             : 
     799           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_STATUS_PROCESS, "SERVICE_STATUS_PROCESS", object);
     800           0 :         ret = PyUnicode_FromString(retstr);
     801           0 :         talloc_free(retstr);
     802             : 
     803           0 :         return ret;
     804             : }
     805             : 
     806             : static PyMethodDef py_SERVICE_STATUS_PROCESS_methods[] = {
     807             :         { "__ndr_pack__", (PyCFunction)py_SERVICE_STATUS_PROCESS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     808             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SERVICE_STATUS_PROCESS_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     809             :         { "__ndr_print__", (PyCFunction)py_SERVICE_STATUS_PROCESS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     810             :         { NULL, NULL, 0, NULL }
     811             : };
     812             : 
     813             : 
     814             : static PyTypeObject SERVICE_STATUS_PROCESS_Type = {
     815             :         PyVarObject_HEAD_INIT(NULL, 0)
     816             :         .tp_name = "svcctl.SERVICE_STATUS_PROCESS",
     817             :         .tp_getset = py_SERVICE_STATUS_PROCESS_getsetters,
     818             :         .tp_methods = py_SERVICE_STATUS_PROCESS_methods,
     819             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     820             :         .tp_new = py_SERVICE_STATUS_PROCESS_new,
     821             : };
     822             : 
     823             : 
     824           0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_service_name(PyObject *obj, void *closure)
     825             : {
     826           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
     827             :         PyObject *py_service_name;
     828           0 :         if (object->service_name == NULL) {
     829           0 :                 Py_RETURN_NONE;
     830             :         }
     831           0 :         if (object->service_name == NULL) {
     832           0 :                 py_service_name = Py_None;
     833           0 :                 Py_INCREF(py_service_name);
     834             :         } else {
     835           0 :                 py_service_name = PyString_FromStringOrNULL(object->service_name);
     836             :         }
     837           0 :         return py_service_name;
     838             : }
     839             : 
     840           0 : static int py_ENUM_SERVICE_STATUSW_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
     841             : {
     842           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
     843           0 :         if (value == NULL) {
     844           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_name");
     845           0 :                 return -1;
     846             :         }
     847           0 :         if (value == Py_None) {
     848           0 :                 object->service_name = NULL;
     849             :         } else {
     850           0 :                 object->service_name = NULL;
     851             :                 {
     852             :                         const char *test_str;
     853             :                         const char *talloc_str;
     854           0 :                         PyObject *unicode = NULL;
     855           0 :                         if (PyUnicode_Check(value)) {
     856           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     857           0 :                                 if (unicode == NULL) {
     858           0 :                                         PyErr_NoMemory();
     859           0 :                                         return -1;
     860             :                                 }
     861           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     862           0 :                         } else if (PyBytes_Check(value)) {
     863           0 :                                 test_str = PyBytes_AS_STRING(value);
     864             :                         } else {
     865           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     866           0 :                                 return -1;
     867             :                         }
     868           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     869           0 :                         if (unicode != NULL) {
     870           0 :                                 Py_DECREF(unicode);
     871             :                         }
     872           0 :                         if (talloc_str == NULL) {
     873           0 :                                 PyErr_NoMemory();
     874           0 :                                 return -1;
     875             :                         }
     876           0 :                         object->service_name = talloc_str;
     877             :                 }
     878             :         }
     879           0 :         return 0;
     880             : }
     881             : 
     882           0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_display_name(PyObject *obj, void *closure)
     883             : {
     884           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
     885             :         PyObject *py_display_name;
     886           0 :         if (object->display_name == NULL) {
     887           0 :                 Py_RETURN_NONE;
     888             :         }
     889           0 :         if (object->display_name == NULL) {
     890           0 :                 py_display_name = Py_None;
     891           0 :                 Py_INCREF(py_display_name);
     892             :         } else {
     893           0 :                 py_display_name = PyString_FromStringOrNULL(object->display_name);
     894             :         }
     895           0 :         return py_display_name;
     896             : }
     897             : 
     898           0 : static int py_ENUM_SERVICE_STATUSW_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
     899             : {
     900           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
     901           0 :         if (value == NULL) {
     902           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->display_name");
     903           0 :                 return -1;
     904             :         }
     905           0 :         if (value == Py_None) {
     906           0 :                 object->display_name = NULL;
     907             :         } else {
     908           0 :                 object->display_name = NULL;
     909             :                 {
     910             :                         const char *test_str;
     911             :                         const char *talloc_str;
     912           0 :                         PyObject *unicode = NULL;
     913           0 :                         if (PyUnicode_Check(value)) {
     914           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     915           0 :                                 if (unicode == NULL) {
     916           0 :                                         PyErr_NoMemory();
     917           0 :                                         return -1;
     918             :                                 }
     919           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     920           0 :                         } else if (PyBytes_Check(value)) {
     921           0 :                                 test_str = PyBytes_AS_STRING(value);
     922             :                         } else {
     923           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     924           0 :                                 return -1;
     925             :                         }
     926           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     927           0 :                         if (unicode != NULL) {
     928           0 :                                 Py_DECREF(unicode);
     929             :                         }
     930           0 :                         if (talloc_str == NULL) {
     931           0 :                                 PyErr_NoMemory();
     932           0 :                                 return -1;
     933             :                         }
     934           0 :                         object->display_name = talloc_str;
     935             :                 }
     936             :         }
     937           0 :         return 0;
     938             : }
     939             : 
     940           0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_status(PyObject *obj, void *closure)
     941             : {
     942           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
     943             :         PyObject *py_status;
     944           0 :         py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
     945           0 :         return py_status;
     946             : }
     947             : 
     948           0 : static int py_ENUM_SERVICE_STATUSW_set_status(PyObject *py_obj, PyObject *value, void *closure)
     949             : {
     950           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
     951           0 :         if (value == NULL) {
     952           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
     953           0 :                 return -1;
     954             :         }
     955           0 :         PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
     956           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     957           0 :                 PyErr_NoMemory();
     958           0 :                 return -1;
     959             :         }
     960           0 :         object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
     961           0 :         return 0;
     962             : }
     963             : 
     964             : static PyGetSetDef py_ENUM_SERVICE_STATUSW_getsetters[] = {
     965             :         {
     966             :                 .name = discard_const_p(char, "service_name"),
     967             :                 .get = py_ENUM_SERVICE_STATUSW_get_service_name,
     968             :                 .set = py_ENUM_SERVICE_STATUSW_set_service_name,
     969             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     970             :         },
     971             :         {
     972             :                 .name = discard_const_p(char, "display_name"),
     973             :                 .get = py_ENUM_SERVICE_STATUSW_get_display_name,
     974             :                 .set = py_ENUM_SERVICE_STATUSW_set_display_name,
     975             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
     976             :         },
     977             :         {
     978             :                 .name = discard_const_p(char, "status"),
     979             :                 .get = py_ENUM_SERVICE_STATUSW_get_status,
     980             :                 .set = py_ENUM_SERVICE_STATUSW_set_status,
     981             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
     982             :         },
     983             :         { .name = NULL }
     984             : };
     985             : 
     986           0 : static PyObject *py_ENUM_SERVICE_STATUSW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     987             : {
     988           0 :         return pytalloc_new(struct ENUM_SERVICE_STATUSW, type);
     989             : }
     990             : 
     991           0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     992             : {
     993           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
     994           0 :         PyObject *ret = NULL;
     995             :         DATA_BLOB blob;
     996             :         enum ndr_err_code err;
     997           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     998           0 :         if (tmp_ctx == NULL) {
     999           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1000           0 :                 return NULL;
    1001             :         }
    1002           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSW);
    1003           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1004           0 :                 TALLOC_FREE(tmp_ctx);
    1005           0 :                 PyErr_SetNdrError(err);
    1006           0 :                 return NULL;
    1007             :         }
    1008             : 
    1009           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1010           0 :         TALLOC_FREE(tmp_ctx);
    1011           0 :         return ret;
    1012             : }
    1013             : 
    1014           0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1015             : {
    1016           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
    1017           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1018           0 :         Py_ssize_t blob_length = 0;
    1019             :         enum ndr_err_code err;
    1020           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1021           0 :         PyObject *allow_remaining_obj = NULL;
    1022           0 :         bool allow_remaining = false;
    1023             : 
    1024           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1025             :                 discard_const_p(char *, kwnames),
    1026             :                 &blob.data, &blob_length,
    1027             :                 &allow_remaining_obj)) {
    1028           0 :                 return NULL;
    1029             :         }
    1030           0 :         blob.length = blob_length;
    1031             : 
    1032           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1033           0 :                 allow_remaining = true;
    1034             :         }
    1035             : 
    1036           0 :         if (allow_remaining) {
    1037           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSW);
    1038             :         } else {
    1039           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSW);
    1040             :         }
    1041           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1042           0 :                 PyErr_SetNdrError(err);
    1043           0 :                 return NULL;
    1044             :         }
    1045             : 
    1046           0 :         Py_RETURN_NONE;
    1047             : }
    1048             : 
    1049           0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1050             : {
    1051           0 :         struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
    1052             :         PyObject *ret;
    1053             :         char *retstr;
    1054             : 
    1055           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ENUM_SERVICE_STATUSW, "ENUM_SERVICE_STATUSW", object);
    1056           0 :         ret = PyUnicode_FromString(retstr);
    1057           0 :         talloc_free(retstr);
    1058             : 
    1059           0 :         return ret;
    1060             : }
    1061             : 
    1062             : static PyMethodDef py_ENUM_SERVICE_STATUSW_methods[] = {
    1063             :         { "__ndr_pack__", (PyCFunction)py_ENUM_SERVICE_STATUSW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1064             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ENUM_SERVICE_STATUSW_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1065             :         { "__ndr_print__", (PyCFunction)py_ENUM_SERVICE_STATUSW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1066             :         { NULL, NULL, 0, NULL }
    1067             : };
    1068             : 
    1069             : 
    1070             : static PyTypeObject ENUM_SERVICE_STATUSW_Type = {
    1071             :         PyVarObject_HEAD_INIT(NULL, 0)
    1072             :         .tp_name = "svcctl.ENUM_SERVICE_STATUSW",
    1073             :         .tp_getset = py_ENUM_SERVICE_STATUSW_getsetters,
    1074             :         .tp_methods = py_ENUM_SERVICE_STATUSW_methods,
    1075             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1076             :         .tp_new = py_ENUM_SERVICE_STATUSW_new,
    1077             : };
    1078             : 
    1079             : 
    1080           0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_service_name(PyObject *obj, void *closure)
    1081             : {
    1082           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
    1083             :         PyObject *py_service_name;
    1084           0 :         if (object->service_name == NULL) {
    1085           0 :                 Py_RETURN_NONE;
    1086             :         }
    1087           0 :         if (object->service_name == NULL) {
    1088           0 :                 py_service_name = Py_None;
    1089           0 :                 Py_INCREF(py_service_name);
    1090             :         } else {
    1091           0 :                 py_service_name = PyString_FromStringOrNULL(object->service_name);
    1092             :         }
    1093           0 :         return py_service_name;
    1094             : }
    1095             : 
    1096           0 : static int py_ENUM_SERVICE_STATUSA_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
    1097             : {
    1098           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
    1099           0 :         if (value == NULL) {
    1100           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_name");
    1101           0 :                 return -1;
    1102             :         }
    1103           0 :         if (value == Py_None) {
    1104           0 :                 object->service_name = NULL;
    1105             :         } else {
    1106           0 :                 object->service_name = NULL;
    1107             :                 {
    1108             :                         const char *test_str;
    1109             :                         const char *talloc_str;
    1110           0 :                         PyObject *unicode = NULL;
    1111           0 :                         if (PyUnicode_Check(value)) {
    1112           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1113           0 :                                 if (unicode == NULL) {
    1114           0 :                                         PyErr_NoMemory();
    1115           0 :                                         return -1;
    1116             :                                 }
    1117           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1118           0 :                         } else if (PyBytes_Check(value)) {
    1119           0 :                                 test_str = PyBytes_AS_STRING(value);
    1120             :                         } else {
    1121           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1122           0 :                                 return -1;
    1123             :                         }
    1124           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1125           0 :                         if (unicode != NULL) {
    1126           0 :                                 Py_DECREF(unicode);
    1127             :                         }
    1128           0 :                         if (talloc_str == NULL) {
    1129           0 :                                 PyErr_NoMemory();
    1130           0 :                                 return -1;
    1131             :                         }
    1132           0 :                         object->service_name = talloc_str;
    1133             :                 }
    1134             :         }
    1135           0 :         return 0;
    1136             : }
    1137             : 
    1138           0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_display_name(PyObject *obj, void *closure)
    1139             : {
    1140           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
    1141             :         PyObject *py_display_name;
    1142           0 :         if (object->display_name == NULL) {
    1143           0 :                 Py_RETURN_NONE;
    1144             :         }
    1145           0 :         if (object->display_name == NULL) {
    1146           0 :                 py_display_name = Py_None;
    1147           0 :                 Py_INCREF(py_display_name);
    1148             :         } else {
    1149           0 :                 py_display_name = PyString_FromStringOrNULL(object->display_name);
    1150             :         }
    1151           0 :         return py_display_name;
    1152             : }
    1153             : 
    1154           0 : static int py_ENUM_SERVICE_STATUSA_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
    1155             : {
    1156           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
    1157           0 :         if (value == NULL) {
    1158           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->display_name");
    1159           0 :                 return -1;
    1160             :         }
    1161           0 :         if (value == Py_None) {
    1162           0 :                 object->display_name = NULL;
    1163             :         } else {
    1164           0 :                 object->display_name = NULL;
    1165             :                 {
    1166             :                         const char *test_str;
    1167             :                         const char *talloc_str;
    1168           0 :                         PyObject *unicode = NULL;
    1169           0 :                         if (PyUnicode_Check(value)) {
    1170           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1171           0 :                                 if (unicode == NULL) {
    1172           0 :                                         PyErr_NoMemory();
    1173           0 :                                         return -1;
    1174             :                                 }
    1175           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1176           0 :                         } else if (PyBytes_Check(value)) {
    1177           0 :                                 test_str = PyBytes_AS_STRING(value);
    1178             :                         } else {
    1179           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1180           0 :                                 return -1;
    1181             :                         }
    1182           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1183           0 :                         if (unicode != NULL) {
    1184           0 :                                 Py_DECREF(unicode);
    1185             :                         }
    1186           0 :                         if (talloc_str == NULL) {
    1187           0 :                                 PyErr_NoMemory();
    1188           0 :                                 return -1;
    1189             :                         }
    1190           0 :                         object->display_name = talloc_str;
    1191             :                 }
    1192             :         }
    1193           0 :         return 0;
    1194             : }
    1195             : 
    1196           0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_status(PyObject *obj, void *closure)
    1197             : {
    1198           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
    1199             :         PyObject *py_status;
    1200           0 :         py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
    1201           0 :         return py_status;
    1202             : }
    1203             : 
    1204           0 : static int py_ENUM_SERVICE_STATUSA_set_status(PyObject *py_obj, PyObject *value, void *closure)
    1205             : {
    1206           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
    1207           0 :         if (value == NULL) {
    1208           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
    1209           0 :                 return -1;
    1210             :         }
    1211           0 :         PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
    1212           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1213           0 :                 PyErr_NoMemory();
    1214           0 :                 return -1;
    1215             :         }
    1216           0 :         object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
    1217           0 :         return 0;
    1218             : }
    1219             : 
    1220             : static PyGetSetDef py_ENUM_SERVICE_STATUSA_getsetters[] = {
    1221             :         {
    1222             :                 .name = discard_const_p(char, "service_name"),
    1223             :                 .get = py_ENUM_SERVICE_STATUSA_get_service_name,
    1224             :                 .set = py_ENUM_SERVICE_STATUSA_set_service_name,
    1225             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    1226             :         },
    1227             :         {
    1228             :                 .name = discard_const_p(char, "display_name"),
    1229             :                 .get = py_ENUM_SERVICE_STATUSA_get_display_name,
    1230             :                 .set = py_ENUM_SERVICE_STATUSA_set_display_name,
    1231             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    1232             :         },
    1233             :         {
    1234             :                 .name = discard_const_p(char, "status"),
    1235             :                 .get = py_ENUM_SERVICE_STATUSA_get_status,
    1236             :                 .set = py_ENUM_SERVICE_STATUSA_set_status,
    1237             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
    1238             :         },
    1239             :         { .name = NULL }
    1240             : };
    1241             : 
    1242           0 : static PyObject *py_ENUM_SERVICE_STATUSA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1243             : {
    1244           0 :         return pytalloc_new(struct ENUM_SERVICE_STATUSA, type);
    1245             : }
    1246             : 
    1247           0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1248             : {
    1249           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
    1250           0 :         PyObject *ret = NULL;
    1251             :         DATA_BLOB blob;
    1252             :         enum ndr_err_code err;
    1253           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1254           0 :         if (tmp_ctx == NULL) {
    1255           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1256           0 :                 return NULL;
    1257             :         }
    1258           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSA);
    1259           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1260           0 :                 TALLOC_FREE(tmp_ctx);
    1261           0 :                 PyErr_SetNdrError(err);
    1262           0 :                 return NULL;
    1263             :         }
    1264             : 
    1265           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1266           0 :         TALLOC_FREE(tmp_ctx);
    1267           0 :         return ret;
    1268             : }
    1269             : 
    1270           0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1271             : {
    1272           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
    1273           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1274           0 :         Py_ssize_t blob_length = 0;
    1275             :         enum ndr_err_code err;
    1276           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1277           0 :         PyObject *allow_remaining_obj = NULL;
    1278           0 :         bool allow_remaining = false;
    1279             : 
    1280           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1281             :                 discard_const_p(char *, kwnames),
    1282             :                 &blob.data, &blob_length,
    1283             :                 &allow_remaining_obj)) {
    1284           0 :                 return NULL;
    1285             :         }
    1286           0 :         blob.length = blob_length;
    1287             : 
    1288           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1289           0 :                 allow_remaining = true;
    1290             :         }
    1291             : 
    1292           0 :         if (allow_remaining) {
    1293           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSA);
    1294             :         } else {
    1295           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSA);
    1296             :         }
    1297           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1298           0 :                 PyErr_SetNdrError(err);
    1299           0 :                 return NULL;
    1300             :         }
    1301             : 
    1302           0 :         Py_RETURN_NONE;
    1303             : }
    1304             : 
    1305           0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1306             : {
    1307           0 :         struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
    1308             :         PyObject *ret;
    1309             :         char *retstr;
    1310             : 
    1311           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ENUM_SERVICE_STATUSA, "ENUM_SERVICE_STATUSA", object);
    1312           0 :         ret = PyUnicode_FromString(retstr);
    1313           0 :         talloc_free(retstr);
    1314             : 
    1315           0 :         return ret;
    1316             : }
    1317             : 
    1318             : static PyMethodDef py_ENUM_SERVICE_STATUSA_methods[] = {
    1319             :         { "__ndr_pack__", (PyCFunction)py_ENUM_SERVICE_STATUSA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1320             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ENUM_SERVICE_STATUSA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1321             :         { "__ndr_print__", (PyCFunction)py_ENUM_SERVICE_STATUSA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1322             :         { NULL, NULL, 0, NULL }
    1323             : };
    1324             : 
    1325             : 
    1326             : static PyTypeObject ENUM_SERVICE_STATUSA_Type = {
    1327             :         PyVarObject_HEAD_INIT(NULL, 0)
    1328             :         .tp_name = "svcctl.ENUM_SERVICE_STATUSA",
    1329             :         .tp_getset = py_ENUM_SERVICE_STATUSA_getsetters,
    1330             :         .tp_methods = py_ENUM_SERVICE_STATUSA_methods,
    1331             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1332             :         .tp_new = py_ENUM_SERVICE_STATUSA_new,
    1333             : };
    1334             : 
    1335             : 
    1336           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_service_type(PyObject *obj, void *closure)
    1337             : {
    1338           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1339             :         PyObject *py_service_type;
    1340           0 :         py_service_type = PyLong_FromUnsignedLongLong((uint32_t)object->service_type);
    1341           0 :         return py_service_type;
    1342             : }
    1343             : 
    1344           0 : static int py_QUERY_SERVICE_CONFIG_set_service_type(PyObject *py_obj, PyObject *value, void *closure)
    1345             : {
    1346           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1347           0 :         if (value == NULL) {
    1348           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_type");
    1349           0 :                 return -1;
    1350             :         }
    1351             :         {
    1352           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_type));
    1353           0 :                 if (PyLong_Check(value)) {
    1354             :                         unsigned long long test_var;
    1355           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1356           0 :                         if (PyErr_Occurred() != NULL) {
    1357           0 :                                 return -1;
    1358             :                         }
    1359           0 :                         if (test_var > uint_max) {
    1360           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1361             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1362           0 :                                 return -1;
    1363             :                         }
    1364           0 :                         object->service_type = test_var;
    1365             :                 } else {
    1366           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1367             :                           PyLong_Type.tp_name);
    1368           0 :                         return -1;
    1369             :                 }
    1370             :         }
    1371           0 :         return 0;
    1372             : }
    1373             : 
    1374           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_start_type(PyObject *obj, void *closure)
    1375             : {
    1376           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1377             :         PyObject *py_start_type;
    1378           0 :         py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->start_type);
    1379           0 :         return py_start_type;
    1380             : }
    1381             : 
    1382           0 : static int py_QUERY_SERVICE_CONFIG_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
    1383             : {
    1384           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1385           0 :         if (value == NULL) {
    1386           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->start_type");
    1387           0 :                 return -1;
    1388             :         }
    1389             :         {
    1390           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start_type));
    1391           0 :                 if (PyLong_Check(value)) {
    1392             :                         unsigned long long test_var;
    1393           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1394           0 :                         if (PyErr_Occurred() != NULL) {
    1395           0 :                                 return -1;
    1396             :                         }
    1397           0 :                         if (test_var > uint_max) {
    1398           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1399             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1400           0 :                                 return -1;
    1401             :                         }
    1402           0 :                         object->start_type = test_var;
    1403             :                 } else {
    1404           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1405             :                           PyLong_Type.tp_name);
    1406           0 :                         return -1;
    1407             :                 }
    1408             :         }
    1409           0 :         return 0;
    1410             : }
    1411             : 
    1412           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_error_control(PyObject *obj, void *closure)
    1413             : {
    1414           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1415             :         PyObject *py_error_control;
    1416           0 :         py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->error_control);
    1417           0 :         return py_error_control;
    1418             : }
    1419             : 
    1420           0 : static int py_QUERY_SERVICE_CONFIG_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
    1421             : {
    1422           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1423           0 :         if (value == NULL) {
    1424           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->error_control");
    1425           0 :                 return -1;
    1426             :         }
    1427             :         {
    1428           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->error_control));
    1429           0 :                 if (PyLong_Check(value)) {
    1430             :                         unsigned long long test_var;
    1431           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1432           0 :                         if (PyErr_Occurred() != NULL) {
    1433           0 :                                 return -1;
    1434             :                         }
    1435           0 :                         if (test_var > uint_max) {
    1436           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1437             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1438           0 :                                 return -1;
    1439             :                         }
    1440           0 :                         object->error_control = test_var;
    1441             :                 } else {
    1442           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1443             :                           PyLong_Type.tp_name);
    1444           0 :                         return -1;
    1445             :                 }
    1446             :         }
    1447           0 :         return 0;
    1448             : }
    1449             : 
    1450           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_executablepath(PyObject *obj, void *closure)
    1451             : {
    1452           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1453             :         PyObject *py_executablepath;
    1454           0 :         if (object->executablepath == NULL) {
    1455           0 :                 Py_RETURN_NONE;
    1456             :         }
    1457           0 :         if (object->executablepath == NULL) {
    1458           0 :                 py_executablepath = Py_None;
    1459           0 :                 Py_INCREF(py_executablepath);
    1460             :         } else {
    1461           0 :                 if (object->executablepath == NULL) {
    1462           0 :                         py_executablepath = Py_None;
    1463           0 :                         Py_INCREF(py_executablepath);
    1464             :                 } else {
    1465           0 :                         py_executablepath = PyUnicode_Decode(object->executablepath, strlen(object->executablepath), "utf-8", "ignore");
    1466             :                 }
    1467             :         }
    1468           0 :         return py_executablepath;
    1469             : }
    1470             : 
    1471           0 : static int py_QUERY_SERVICE_CONFIG_set_executablepath(PyObject *py_obj, PyObject *value, void *closure)
    1472             : {
    1473           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1474           0 :         if (value == NULL) {
    1475           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->executablepath");
    1476           0 :                 return -1;
    1477             :         }
    1478           0 :         if (value == Py_None) {
    1479           0 :                 object->executablepath = NULL;
    1480             :         } else {
    1481           0 :                 object->executablepath = NULL;
    1482             :                 {
    1483             :                         const char *test_str;
    1484             :                         const char *talloc_str;
    1485           0 :                         PyObject *unicode = NULL;
    1486           0 :                         if (PyUnicode_Check(value)) {
    1487           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1488           0 :                                 if (unicode == NULL) {
    1489           0 :                                         PyErr_NoMemory();
    1490           0 :                                         return -1;
    1491             :                                 }
    1492           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1493           0 :                         } else if (PyBytes_Check(value)) {
    1494           0 :                                 test_str = PyBytes_AS_STRING(value);
    1495             :                         } else {
    1496           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1497           0 :                                 return -1;
    1498             :                         }
    1499           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1500           0 :                         if (unicode != NULL) {
    1501           0 :                                 Py_DECREF(unicode);
    1502             :                         }
    1503           0 :                         if (talloc_str == NULL) {
    1504           0 :                                 PyErr_NoMemory();
    1505           0 :                                 return -1;
    1506             :                         }
    1507           0 :                         object->executablepath = talloc_str;
    1508             :                 }
    1509             :         }
    1510           0 :         return 0;
    1511             : }
    1512             : 
    1513           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_loadordergroup(PyObject *obj, void *closure)
    1514             : {
    1515           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1516             :         PyObject *py_loadordergroup;
    1517           0 :         if (object->loadordergroup == NULL) {
    1518           0 :                 Py_RETURN_NONE;
    1519             :         }
    1520           0 :         if (object->loadordergroup == NULL) {
    1521           0 :                 py_loadordergroup = Py_None;
    1522           0 :                 Py_INCREF(py_loadordergroup);
    1523             :         } else {
    1524           0 :                 if (object->loadordergroup == NULL) {
    1525           0 :                         py_loadordergroup = Py_None;
    1526           0 :                         Py_INCREF(py_loadordergroup);
    1527             :                 } else {
    1528           0 :                         py_loadordergroup = PyUnicode_Decode(object->loadordergroup, strlen(object->loadordergroup), "utf-8", "ignore");
    1529             :                 }
    1530             :         }
    1531           0 :         return py_loadordergroup;
    1532             : }
    1533             : 
    1534           0 : static int py_QUERY_SERVICE_CONFIG_set_loadordergroup(PyObject *py_obj, PyObject *value, void *closure)
    1535             : {
    1536           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1537           0 :         if (value == NULL) {
    1538           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->loadordergroup");
    1539           0 :                 return -1;
    1540             :         }
    1541           0 :         if (value == Py_None) {
    1542           0 :                 object->loadordergroup = NULL;
    1543             :         } else {
    1544           0 :                 object->loadordergroup = NULL;
    1545             :                 {
    1546             :                         const char *test_str;
    1547             :                         const char *talloc_str;
    1548           0 :                         PyObject *unicode = NULL;
    1549           0 :                         if (PyUnicode_Check(value)) {
    1550           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1551           0 :                                 if (unicode == NULL) {
    1552           0 :                                         PyErr_NoMemory();
    1553           0 :                                         return -1;
    1554             :                                 }
    1555           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1556           0 :                         } else if (PyBytes_Check(value)) {
    1557           0 :                                 test_str = PyBytes_AS_STRING(value);
    1558             :                         } else {
    1559           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1560           0 :                                 return -1;
    1561             :                         }
    1562           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1563           0 :                         if (unicode != NULL) {
    1564           0 :                                 Py_DECREF(unicode);
    1565             :                         }
    1566           0 :                         if (talloc_str == NULL) {
    1567           0 :                                 PyErr_NoMemory();
    1568           0 :                                 return -1;
    1569             :                         }
    1570           0 :                         object->loadordergroup = talloc_str;
    1571             :                 }
    1572             :         }
    1573           0 :         return 0;
    1574             : }
    1575             : 
    1576           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_tag_id(PyObject *obj, void *closure)
    1577             : {
    1578           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1579             :         PyObject *py_tag_id;
    1580           0 :         py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)object->tag_id);
    1581           0 :         return py_tag_id;
    1582             : }
    1583             : 
    1584           0 : static int py_QUERY_SERVICE_CONFIG_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
    1585             : {
    1586           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1587           0 :         if (value == NULL) {
    1588           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tag_id");
    1589           0 :                 return -1;
    1590             :         }
    1591             :         {
    1592           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tag_id));
    1593           0 :                 if (PyLong_Check(value)) {
    1594             :                         unsigned long long test_var;
    1595           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1596           0 :                         if (PyErr_Occurred() != NULL) {
    1597           0 :                                 return -1;
    1598             :                         }
    1599           0 :                         if (test_var > uint_max) {
    1600           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1601             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1602           0 :                                 return -1;
    1603             :                         }
    1604           0 :                         object->tag_id = test_var;
    1605             :                 } else {
    1606           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1607             :                           PyLong_Type.tp_name);
    1608           0 :                         return -1;
    1609             :                 }
    1610             :         }
    1611           0 :         return 0;
    1612             : }
    1613             : 
    1614           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_dependencies(PyObject *obj, void *closure)
    1615             : {
    1616           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1617             :         PyObject *py_dependencies;
    1618           0 :         if (object->dependencies == NULL) {
    1619           0 :                 Py_RETURN_NONE;
    1620             :         }
    1621           0 :         if (object->dependencies == NULL) {
    1622           0 :                 py_dependencies = Py_None;
    1623           0 :                 Py_INCREF(py_dependencies);
    1624             :         } else {
    1625           0 :                 if (object->dependencies == NULL) {
    1626           0 :                         py_dependencies = Py_None;
    1627           0 :                         Py_INCREF(py_dependencies);
    1628             :                 } else {
    1629           0 :                         py_dependencies = PyUnicode_Decode(object->dependencies, strlen(object->dependencies), "utf-8", "ignore");
    1630             :                 }
    1631             :         }
    1632           0 :         return py_dependencies;
    1633             : }
    1634             : 
    1635           0 : static int py_QUERY_SERVICE_CONFIG_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
    1636             : {
    1637           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1638           0 :         if (value == NULL) {
    1639           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dependencies");
    1640           0 :                 return -1;
    1641             :         }
    1642           0 :         if (value == Py_None) {
    1643           0 :                 object->dependencies = NULL;
    1644             :         } else {
    1645           0 :                 object->dependencies = NULL;
    1646             :                 {
    1647             :                         const char *test_str;
    1648             :                         const char *talloc_str;
    1649           0 :                         PyObject *unicode = NULL;
    1650           0 :                         if (PyUnicode_Check(value)) {
    1651           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1652           0 :                                 if (unicode == NULL) {
    1653           0 :                                         PyErr_NoMemory();
    1654           0 :                                         return -1;
    1655             :                                 }
    1656           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1657           0 :                         } else if (PyBytes_Check(value)) {
    1658           0 :                                 test_str = PyBytes_AS_STRING(value);
    1659             :                         } else {
    1660           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1661           0 :                                 return -1;
    1662             :                         }
    1663           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1664           0 :                         if (unicode != NULL) {
    1665           0 :                                 Py_DECREF(unicode);
    1666             :                         }
    1667           0 :                         if (talloc_str == NULL) {
    1668           0 :                                 PyErr_NoMemory();
    1669           0 :                                 return -1;
    1670             :                         }
    1671           0 :                         object->dependencies = talloc_str;
    1672             :                 }
    1673             :         }
    1674           0 :         return 0;
    1675             : }
    1676             : 
    1677           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_startname(PyObject *obj, void *closure)
    1678             : {
    1679           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1680             :         PyObject *py_startname;
    1681           0 :         if (object->startname == NULL) {
    1682           0 :                 Py_RETURN_NONE;
    1683             :         }
    1684           0 :         if (object->startname == NULL) {
    1685           0 :                 py_startname = Py_None;
    1686           0 :                 Py_INCREF(py_startname);
    1687             :         } else {
    1688           0 :                 if (object->startname == NULL) {
    1689           0 :                         py_startname = Py_None;
    1690           0 :                         Py_INCREF(py_startname);
    1691             :                 } else {
    1692           0 :                         py_startname = PyUnicode_Decode(object->startname, strlen(object->startname), "utf-8", "ignore");
    1693             :                 }
    1694             :         }
    1695           0 :         return py_startname;
    1696             : }
    1697             : 
    1698           0 : static int py_QUERY_SERVICE_CONFIG_set_startname(PyObject *py_obj, PyObject *value, void *closure)
    1699             : {
    1700           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1701           0 :         if (value == NULL) {
    1702           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->startname");
    1703           0 :                 return -1;
    1704             :         }
    1705           0 :         if (value == Py_None) {
    1706           0 :                 object->startname = NULL;
    1707             :         } else {
    1708           0 :                 object->startname = NULL;
    1709             :                 {
    1710             :                         const char *test_str;
    1711             :                         const char *talloc_str;
    1712           0 :                         PyObject *unicode = NULL;
    1713           0 :                         if (PyUnicode_Check(value)) {
    1714           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1715           0 :                                 if (unicode == NULL) {
    1716           0 :                                         PyErr_NoMemory();
    1717           0 :                                         return -1;
    1718             :                                 }
    1719           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1720           0 :                         } else if (PyBytes_Check(value)) {
    1721           0 :                                 test_str = PyBytes_AS_STRING(value);
    1722             :                         } else {
    1723           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1724           0 :                                 return -1;
    1725             :                         }
    1726           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1727           0 :                         if (unicode != NULL) {
    1728           0 :                                 Py_DECREF(unicode);
    1729             :                         }
    1730           0 :                         if (talloc_str == NULL) {
    1731           0 :                                 PyErr_NoMemory();
    1732           0 :                                 return -1;
    1733             :                         }
    1734           0 :                         object->startname = talloc_str;
    1735             :                 }
    1736             :         }
    1737           0 :         return 0;
    1738             : }
    1739             : 
    1740           0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_displayname(PyObject *obj, void *closure)
    1741             : {
    1742           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
    1743             :         PyObject *py_displayname;
    1744           0 :         if (object->displayname == NULL) {
    1745           0 :                 Py_RETURN_NONE;
    1746             :         }
    1747           0 :         if (object->displayname == NULL) {
    1748           0 :                 py_displayname = Py_None;
    1749           0 :                 Py_INCREF(py_displayname);
    1750             :         } else {
    1751           0 :                 if (object->displayname == NULL) {
    1752           0 :                         py_displayname = Py_None;
    1753           0 :                         Py_INCREF(py_displayname);
    1754             :                 } else {
    1755           0 :                         py_displayname = PyUnicode_Decode(object->displayname, strlen(object->displayname), "utf-8", "ignore");
    1756             :                 }
    1757             :         }
    1758           0 :         return py_displayname;
    1759             : }
    1760             : 
    1761           0 : static int py_QUERY_SERVICE_CONFIG_set_displayname(PyObject *py_obj, PyObject *value, void *closure)
    1762             : {
    1763           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1764           0 :         if (value == NULL) {
    1765           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->displayname");
    1766           0 :                 return -1;
    1767             :         }
    1768           0 :         if (value == Py_None) {
    1769           0 :                 object->displayname = NULL;
    1770             :         } else {
    1771           0 :                 object->displayname = NULL;
    1772             :                 {
    1773             :                         const char *test_str;
    1774             :                         const char *talloc_str;
    1775           0 :                         PyObject *unicode = NULL;
    1776           0 :                         if (PyUnicode_Check(value)) {
    1777           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1778           0 :                                 if (unicode == NULL) {
    1779           0 :                                         PyErr_NoMemory();
    1780           0 :                                         return -1;
    1781             :                                 }
    1782           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1783           0 :                         } else if (PyBytes_Check(value)) {
    1784           0 :                                 test_str = PyBytes_AS_STRING(value);
    1785             :                         } else {
    1786           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1787           0 :                                 return -1;
    1788             :                         }
    1789           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1790           0 :                         if (unicode != NULL) {
    1791           0 :                                 Py_DECREF(unicode);
    1792             :                         }
    1793           0 :                         if (talloc_str == NULL) {
    1794           0 :                                 PyErr_NoMemory();
    1795           0 :                                 return -1;
    1796             :                         }
    1797           0 :                         object->displayname = talloc_str;
    1798             :                 }
    1799             :         }
    1800           0 :         return 0;
    1801             : }
    1802             : 
    1803             : static PyGetSetDef py_QUERY_SERVICE_CONFIG_getsetters[] = {
    1804             :         {
    1805             :                 .name = discard_const_p(char, "service_type"),
    1806             :                 .get = py_QUERY_SERVICE_CONFIG_get_service_type,
    1807             :                 .set = py_QUERY_SERVICE_CONFIG_set_service_type,
    1808             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1809             :         },
    1810             :         {
    1811             :                 .name = discard_const_p(char, "start_type"),
    1812             :                 .get = py_QUERY_SERVICE_CONFIG_get_start_type,
    1813             :                 .set = py_QUERY_SERVICE_CONFIG_set_start_type,
    1814             :                 .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
    1815             :         },
    1816             :         {
    1817             :                 .name = discard_const_p(char, "error_control"),
    1818             :                 .get = py_QUERY_SERVICE_CONFIG_get_error_control,
    1819             :                 .set = py_QUERY_SERVICE_CONFIG_set_error_control,
    1820             :                 .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
    1821             :         },
    1822             :         {
    1823             :                 .name = discard_const_p(char, "executablepath"),
    1824             :                 .get = py_QUERY_SERVICE_CONFIG_get_executablepath,
    1825             :                 .set = py_QUERY_SERVICE_CONFIG_set_executablepath,
    1826             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1827             :         },
    1828             :         {
    1829             :                 .name = discard_const_p(char, "loadordergroup"),
    1830             :                 .get = py_QUERY_SERVICE_CONFIG_get_loadordergroup,
    1831             :                 .set = py_QUERY_SERVICE_CONFIG_set_loadordergroup,
    1832             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1833             :         },
    1834             :         {
    1835             :                 .name = discard_const_p(char, "tag_id"),
    1836             :                 .get = py_QUERY_SERVICE_CONFIG_get_tag_id,
    1837             :                 .set = py_QUERY_SERVICE_CONFIG_set_tag_id,
    1838             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1839             :         },
    1840             :         {
    1841             :                 .name = discard_const_p(char, "dependencies"),
    1842             :                 .get = py_QUERY_SERVICE_CONFIG_get_dependencies,
    1843             :                 .set = py_QUERY_SERVICE_CONFIG_set_dependencies,
    1844             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1845             :         },
    1846             :         {
    1847             :                 .name = discard_const_p(char, "startname"),
    1848             :                 .get = py_QUERY_SERVICE_CONFIG_get_startname,
    1849             :                 .set = py_QUERY_SERVICE_CONFIG_set_startname,
    1850             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1851             :         },
    1852             :         {
    1853             :                 .name = discard_const_p(char, "displayname"),
    1854             :                 .get = py_QUERY_SERVICE_CONFIG_get_displayname,
    1855             :                 .set = py_QUERY_SERVICE_CONFIG_set_displayname,
    1856             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1857             :         },
    1858             :         { .name = NULL }
    1859             : };
    1860             : 
    1861           0 : static PyObject *py_QUERY_SERVICE_CONFIG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1862             : {
    1863           0 :         return pytalloc_new(struct QUERY_SERVICE_CONFIG, type);
    1864             : }
    1865             : 
    1866           0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1867             : {
    1868           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1869           0 :         PyObject *ret = NULL;
    1870             :         DATA_BLOB blob;
    1871             :         enum ndr_err_code err;
    1872           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1873           0 :         if (tmp_ctx == NULL) {
    1874           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1875           0 :                 return NULL;
    1876             :         }
    1877           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG);
    1878           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1879           0 :                 TALLOC_FREE(tmp_ctx);
    1880           0 :                 PyErr_SetNdrError(err);
    1881           0 :                 return NULL;
    1882             :         }
    1883             : 
    1884           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1885           0 :         TALLOC_FREE(tmp_ctx);
    1886           0 :         return ret;
    1887             : }
    1888             : 
    1889           0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1890             : {
    1891           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1892           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1893           0 :         Py_ssize_t blob_length = 0;
    1894             :         enum ndr_err_code err;
    1895           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1896           0 :         PyObject *allow_remaining_obj = NULL;
    1897           0 :         bool allow_remaining = false;
    1898             : 
    1899           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1900             :                 discard_const_p(char *, kwnames),
    1901             :                 &blob.data, &blob_length,
    1902             :                 &allow_remaining_obj)) {
    1903           0 :                 return NULL;
    1904             :         }
    1905           0 :         blob.length = blob_length;
    1906             : 
    1907           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1908           0 :                 allow_remaining = true;
    1909             :         }
    1910             : 
    1911           0 :         if (allow_remaining) {
    1912           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_QUERY_SERVICE_CONFIG);
    1913             :         } else {
    1914           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_QUERY_SERVICE_CONFIG);
    1915             :         }
    1916           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1917           0 :                 PyErr_SetNdrError(err);
    1918           0 :                 return NULL;
    1919             :         }
    1920             : 
    1921           0 :         Py_RETURN_NONE;
    1922             : }
    1923             : 
    1924           0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1925             : {
    1926           0 :         struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
    1927             :         PyObject *ret;
    1928             :         char *retstr;
    1929             : 
    1930           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_QUERY_SERVICE_CONFIG, "QUERY_SERVICE_CONFIG", object);
    1931           0 :         ret = PyUnicode_FromString(retstr);
    1932           0 :         talloc_free(retstr);
    1933             : 
    1934           0 :         return ret;
    1935             : }
    1936             : 
    1937             : static PyMethodDef py_QUERY_SERVICE_CONFIG_methods[] = {
    1938             :         { "__ndr_pack__", (PyCFunction)py_QUERY_SERVICE_CONFIG_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1939             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_QUERY_SERVICE_CONFIG_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1940             :         { "__ndr_print__", (PyCFunction)py_QUERY_SERVICE_CONFIG_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1941             :         { NULL, NULL, 0, NULL }
    1942             : };
    1943             : 
    1944             : 
    1945             : static PyTypeObject QUERY_SERVICE_CONFIG_Type = {
    1946             :         PyVarObject_HEAD_INIT(NULL, 0)
    1947             :         .tp_name = "svcctl.QUERY_SERVICE_CONFIG",
    1948             :         .tp_getset = py_QUERY_SERVICE_CONFIG_getsetters,
    1949             :         .tp_methods = py_QUERY_SERVICE_CONFIG_methods,
    1950             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1951             :         .tp_new = py_QUERY_SERVICE_CONFIG_new,
    1952             : };
    1953             : 
    1954             : 
    1955           0 : static PyObject *py_svcctl_ArgumentString_get_string(PyObject *obj, void *closure)
    1956             : {
    1957           0 :         struct svcctl_ArgumentString *object = (struct svcctl_ArgumentString *)pytalloc_get_ptr(obj);
    1958             :         PyObject *py_string;
    1959           0 :         if (object->string == NULL) {
    1960           0 :                 Py_RETURN_NONE;
    1961             :         }
    1962           0 :         if (object->string == NULL) {
    1963           0 :                 py_string = Py_None;
    1964           0 :                 Py_INCREF(py_string);
    1965             :         } else {
    1966           0 :                 if (object->string == NULL) {
    1967           0 :                         py_string = Py_None;
    1968           0 :                         Py_INCREF(py_string);
    1969             :                 } else {
    1970           0 :                         py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
    1971             :                 }
    1972             :         }
    1973           0 :         return py_string;
    1974             : }
    1975             : 
    1976           0 : static int py_svcctl_ArgumentString_set_string(PyObject *py_obj, PyObject *value, void *closure)
    1977             : {
    1978           0 :         struct svcctl_ArgumentString *object = (struct svcctl_ArgumentString *)pytalloc_get_ptr(py_obj);
    1979           0 :         if (value == NULL) {
    1980           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
    1981           0 :                 return -1;
    1982             :         }
    1983           0 :         if (value == Py_None) {
    1984           0 :                 object->string = NULL;
    1985             :         } else {
    1986           0 :                 object->string = NULL;
    1987             :                 {
    1988             :                         const char *test_str;
    1989             :                         const char *talloc_str;
    1990           0 :                         PyObject *unicode = NULL;
    1991           0 :                         if (PyUnicode_Check(value)) {
    1992           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1993           0 :                                 if (unicode == NULL) {
    1994           0 :                                         PyErr_NoMemory();
    1995           0 :                                         return -1;
    1996             :                                 }
    1997           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1998           0 :                         } else if (PyBytes_Check(value)) {
    1999           0 :                                 test_str = PyBytes_AS_STRING(value);
    2000             :                         } else {
    2001           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2002           0 :                                 return -1;
    2003             :                         }
    2004           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2005           0 :                         if (unicode != NULL) {
    2006           0 :                                 Py_DECREF(unicode);
    2007             :                         }
    2008           0 :                         if (talloc_str == NULL) {
    2009           0 :                                 PyErr_NoMemory();
    2010           0 :                                 return -1;
    2011             :                         }
    2012           0 :                         object->string = talloc_str;
    2013             :                 }
    2014             :         }
    2015           0 :         return 0;
    2016             : }
    2017             : 
    2018             : static PyGetSetDef py_svcctl_ArgumentString_getsetters[] = {
    2019             :         {
    2020             :                 .name = discard_const_p(char, "string"),
    2021             :                 .get = py_svcctl_ArgumentString_get_string,
    2022             :                 .set = py_svcctl_ArgumentString_set_string,
    2023             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2024             :         },
    2025             :         { .name = NULL }
    2026             : };
    2027             : 
    2028           0 : static PyObject *py_svcctl_ArgumentString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2029             : {
    2030           0 :         return pytalloc_new(struct svcctl_ArgumentString, type);
    2031             : }
    2032             : 
    2033             : 
    2034             : static PyTypeObject svcctl_ArgumentString_Type = {
    2035             :         PyVarObject_HEAD_INIT(NULL, 0)
    2036             :         .tp_name = "svcctl.ArgumentString",
    2037             :         .tp_getset = py_svcctl_ArgumentString_getsetters,
    2038             :         .tp_methods = NULL,
    2039             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2040             :         .tp_new = py_svcctl_ArgumentString_new,
    2041             : };
    2042             : 
    2043             : 
    2044           0 : static PyObject *py_SERVICE_DESCRIPTION_get_description(PyObject *obj, void *closure)
    2045             : {
    2046           0 :         struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(obj);
    2047             :         PyObject *py_description;
    2048           0 :         if (object->description == NULL) {
    2049           0 :                 Py_RETURN_NONE;
    2050             :         }
    2051           0 :         if (object->description == NULL) {
    2052           0 :                 py_description = Py_None;
    2053           0 :                 Py_INCREF(py_description);
    2054             :         } else {
    2055           0 :                 py_description = PyString_FromStringOrNULL(object->description);
    2056             :         }
    2057           0 :         return py_description;
    2058             : }
    2059             : 
    2060           0 : static int py_SERVICE_DESCRIPTION_set_description(PyObject *py_obj, PyObject *value, void *closure)
    2061             : {
    2062           0 :         struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
    2063           0 :         if (value == NULL) {
    2064           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
    2065           0 :                 return -1;
    2066             :         }
    2067           0 :         if (value == Py_None) {
    2068           0 :                 object->description = NULL;
    2069             :         } else {
    2070           0 :                 object->description = NULL;
    2071             :                 {
    2072             :                         const char *test_str;
    2073             :                         const char *talloc_str;
    2074           0 :                         PyObject *unicode = NULL;
    2075           0 :                         if (PyUnicode_Check(value)) {
    2076           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2077           0 :                                 if (unicode == NULL) {
    2078           0 :                                         PyErr_NoMemory();
    2079           0 :                                         return -1;
    2080             :                                 }
    2081           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2082           0 :                         } else if (PyBytes_Check(value)) {
    2083           0 :                                 test_str = PyBytes_AS_STRING(value);
    2084             :                         } else {
    2085           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2086           0 :                                 return -1;
    2087             :                         }
    2088           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2089           0 :                         if (unicode != NULL) {
    2090           0 :                                 Py_DECREF(unicode);
    2091             :                         }
    2092           0 :                         if (talloc_str == NULL) {
    2093           0 :                                 PyErr_NoMemory();
    2094           0 :                                 return -1;
    2095             :                         }
    2096           0 :                         object->description = talloc_str;
    2097             :                 }
    2098             :         }
    2099           0 :         return 0;
    2100             : }
    2101             : 
    2102             : static PyGetSetDef py_SERVICE_DESCRIPTION_getsetters[] = {
    2103             :         {
    2104             :                 .name = discard_const_p(char, "description"),
    2105             :                 .get = py_SERVICE_DESCRIPTION_get_description,
    2106             :                 .set = py_SERVICE_DESCRIPTION_set_description,
    2107             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2108             :         },
    2109             :         { .name = NULL }
    2110             : };
    2111             : 
    2112           0 : static PyObject *py_SERVICE_DESCRIPTION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2113             : {
    2114           0 :         return pytalloc_new(struct SERVICE_DESCRIPTION, type);
    2115             : }
    2116             : 
    2117           0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2118             : {
    2119           0 :         struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
    2120           0 :         PyObject *ret = NULL;
    2121             :         DATA_BLOB blob;
    2122             :         enum ndr_err_code err;
    2123           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2124           0 :         if (tmp_ctx == NULL) {
    2125           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2126           0 :                 return NULL;
    2127             :         }
    2128           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_DESCRIPTION);
    2129           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2130           0 :                 TALLOC_FREE(tmp_ctx);
    2131           0 :                 PyErr_SetNdrError(err);
    2132           0 :                 return NULL;
    2133             :         }
    2134             : 
    2135           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2136           0 :         TALLOC_FREE(tmp_ctx);
    2137           0 :         return ret;
    2138             : }
    2139             : 
    2140           0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2141             : {
    2142           0 :         struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
    2143           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2144           0 :         Py_ssize_t blob_length = 0;
    2145             :         enum ndr_err_code err;
    2146           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2147           0 :         PyObject *allow_remaining_obj = NULL;
    2148           0 :         bool allow_remaining = false;
    2149             : 
    2150           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2151             :                 discard_const_p(char *, kwnames),
    2152             :                 &blob.data, &blob_length,
    2153             :                 &allow_remaining_obj)) {
    2154           0 :                 return NULL;
    2155             :         }
    2156           0 :         blob.length = blob_length;
    2157             : 
    2158           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2159           0 :                 allow_remaining = true;
    2160             :         }
    2161             : 
    2162           0 :         if (allow_remaining) {
    2163           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_DESCRIPTION);
    2164             :         } else {
    2165           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_DESCRIPTION);
    2166             :         }
    2167           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2168           0 :                 PyErr_SetNdrError(err);
    2169           0 :                 return NULL;
    2170             :         }
    2171             : 
    2172           0 :         Py_RETURN_NONE;
    2173             : }
    2174             : 
    2175           0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2176             : {
    2177           0 :         struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
    2178             :         PyObject *ret;
    2179             :         char *retstr;
    2180             : 
    2181           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_DESCRIPTION, "SERVICE_DESCRIPTION", object);
    2182           0 :         ret = PyUnicode_FromString(retstr);
    2183           0 :         talloc_free(retstr);
    2184             : 
    2185           0 :         return ret;
    2186             : }
    2187             : 
    2188             : static PyMethodDef py_SERVICE_DESCRIPTION_methods[] = {
    2189             :         { "__ndr_pack__", (PyCFunction)py_SERVICE_DESCRIPTION_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2190             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SERVICE_DESCRIPTION_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2191             :         { "__ndr_print__", (PyCFunction)py_SERVICE_DESCRIPTION_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2192             :         { NULL, NULL, 0, NULL }
    2193             : };
    2194             : 
    2195             : 
    2196             : static PyTypeObject SERVICE_DESCRIPTION_Type = {
    2197             :         PyVarObject_HEAD_INIT(NULL, 0)
    2198             :         .tp_name = "svcctl.SERVICE_DESCRIPTION",
    2199             :         .tp_getset = py_SERVICE_DESCRIPTION_getsetters,
    2200             :         .tp_methods = py_SERVICE_DESCRIPTION_methods,
    2201             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2202             :         .tp_new = py_SERVICE_DESCRIPTION_new,
    2203             : };
    2204             : 
    2205             : 
    2206           0 : static PyObject *py_SC_ACTION_get_type(PyObject *obj, void *closure)
    2207             : {
    2208           0 :         struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(obj);
    2209             :         PyObject *py_type;
    2210           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    2211           0 :         return py_type;
    2212             : }
    2213             : 
    2214           0 : static int py_SC_ACTION_set_type(PyObject *py_obj, PyObject *value, void *closure)
    2215             : {
    2216           0 :         struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(py_obj);
    2217           0 :         if (value == NULL) {
    2218           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    2219           0 :                 return -1;
    2220             :         }
    2221             :         {
    2222           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    2223           0 :                 if (PyLong_Check(value)) {
    2224             :                         unsigned long long test_var;
    2225           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2226           0 :                         if (PyErr_Occurred() != NULL) {
    2227           0 :                                 return -1;
    2228             :                         }
    2229           0 :                         if (test_var > uint_max) {
    2230           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2231             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2232           0 :                                 return -1;
    2233             :                         }
    2234           0 :                         object->type = test_var;
    2235             :                 } else {
    2236           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2237             :                           PyLong_Type.tp_name);
    2238           0 :                         return -1;
    2239             :                 }
    2240             :         }
    2241           0 :         return 0;
    2242             : }
    2243             : 
    2244           0 : static PyObject *py_SC_ACTION_get_delay(PyObject *obj, void *closure)
    2245             : {
    2246           0 :         struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(obj);
    2247             :         PyObject *py_delay;
    2248           0 :         py_delay = PyLong_FromUnsignedLongLong((uint32_t)object->delay);
    2249           0 :         return py_delay;
    2250             : }
    2251             : 
    2252           0 : static int py_SC_ACTION_set_delay(PyObject *py_obj, PyObject *value, void *closure)
    2253             : {
    2254           0 :         struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(py_obj);
    2255           0 :         if (value == NULL) {
    2256           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delay");
    2257           0 :                 return -1;
    2258             :         }
    2259             :         {
    2260           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->delay));
    2261           0 :                 if (PyLong_Check(value)) {
    2262             :                         unsigned long long test_var;
    2263           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2264           0 :                         if (PyErr_Occurred() != NULL) {
    2265           0 :                                 return -1;
    2266             :                         }
    2267           0 :                         if (test_var > uint_max) {
    2268           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2269             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2270           0 :                                 return -1;
    2271             :                         }
    2272           0 :                         object->delay = test_var;
    2273             :                 } else {
    2274           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2275             :                           PyLong_Type.tp_name);
    2276           0 :                         return -1;
    2277             :                 }
    2278             :         }
    2279           0 :         return 0;
    2280             : }
    2281             : 
    2282             : static PyGetSetDef py_SC_ACTION_getsetters[] = {
    2283             :         {
    2284             :                 .name = discard_const_p(char, "type"),
    2285             :                 .get = py_SC_ACTION_get_type,
    2286             :                 .set = py_SC_ACTION_set_type,
    2287             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SC_ACTION_TYPE")
    2288             :         },
    2289             :         {
    2290             :                 .name = discard_const_p(char, "delay"),
    2291             :                 .get = py_SC_ACTION_get_delay,
    2292             :                 .set = py_SC_ACTION_set_delay,
    2293             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2294             :         },
    2295             :         { .name = NULL }
    2296             : };
    2297             : 
    2298           0 : static PyObject *py_SC_ACTION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2299             : {
    2300           0 :         return pytalloc_new(struct SC_ACTION, type);
    2301             : }
    2302             : 
    2303             : 
    2304             : static PyTypeObject SC_ACTION_Type = {
    2305             :         PyVarObject_HEAD_INIT(NULL, 0)
    2306             :         .tp_name = "svcctl.SC_ACTION",
    2307             :         .tp_getset = py_SC_ACTION_getsetters,
    2308             :         .tp_methods = NULL,
    2309             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2310             :         .tp_new = py_SC_ACTION_new,
    2311             : };
    2312             : 
    2313             : 
    2314           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_reset_period(PyObject *obj, void *closure)
    2315             : {
    2316           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
    2317             :         PyObject *py_reset_period;
    2318           0 :         py_reset_period = PyLong_FromUnsignedLongLong((uint32_t)object->reset_period);
    2319           0 :         return py_reset_period;
    2320             : }
    2321             : 
    2322           0 : static int py_SERVICE_FAILURE_ACTIONS_set_reset_period(PyObject *py_obj, PyObject *value, void *closure)
    2323             : {
    2324           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2325           0 :         if (value == NULL) {
    2326           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reset_period");
    2327           0 :                 return -1;
    2328             :         }
    2329             :         {
    2330           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reset_period));
    2331           0 :                 if (PyLong_Check(value)) {
    2332             :                         unsigned long long test_var;
    2333           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2334           0 :                         if (PyErr_Occurred() != NULL) {
    2335           0 :                                 return -1;
    2336             :                         }
    2337           0 :                         if (test_var > uint_max) {
    2338           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2339             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2340           0 :                                 return -1;
    2341             :                         }
    2342           0 :                         object->reset_period = test_var;
    2343             :                 } else {
    2344           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2345             :                           PyLong_Type.tp_name);
    2346           0 :                         return -1;
    2347             :                 }
    2348             :         }
    2349           0 :         return 0;
    2350             : }
    2351             : 
    2352           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_rebootmsg(PyObject *obj, void *closure)
    2353             : {
    2354           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
    2355             :         PyObject *py_rebootmsg;
    2356           0 :         if (object->rebootmsg == NULL) {
    2357           0 :                 Py_RETURN_NONE;
    2358             :         }
    2359           0 :         if (object->rebootmsg == NULL) {
    2360           0 :                 py_rebootmsg = Py_None;
    2361           0 :                 Py_INCREF(py_rebootmsg);
    2362             :         } else {
    2363           0 :                 py_rebootmsg = PyString_FromStringOrNULL(object->rebootmsg);
    2364             :         }
    2365           0 :         return py_rebootmsg;
    2366             : }
    2367             : 
    2368           0 : static int py_SERVICE_FAILURE_ACTIONS_set_rebootmsg(PyObject *py_obj, PyObject *value, void *closure)
    2369             : {
    2370           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2371           0 :         if (value == NULL) {
    2372           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rebootmsg");
    2373           0 :                 return -1;
    2374             :         }
    2375           0 :         if (value == Py_None) {
    2376           0 :                 object->rebootmsg = NULL;
    2377             :         } else {
    2378           0 :                 object->rebootmsg = NULL;
    2379             :                 {
    2380             :                         const char *test_str;
    2381             :                         const char *talloc_str;
    2382           0 :                         PyObject *unicode = NULL;
    2383           0 :                         if (PyUnicode_Check(value)) {
    2384           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2385           0 :                                 if (unicode == NULL) {
    2386           0 :                                         PyErr_NoMemory();
    2387           0 :                                         return -1;
    2388             :                                 }
    2389           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2390           0 :                         } else if (PyBytes_Check(value)) {
    2391           0 :                                 test_str = PyBytes_AS_STRING(value);
    2392             :                         } else {
    2393           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2394           0 :                                 return -1;
    2395             :                         }
    2396           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2397           0 :                         if (unicode != NULL) {
    2398           0 :                                 Py_DECREF(unicode);
    2399             :                         }
    2400           0 :                         if (talloc_str == NULL) {
    2401           0 :                                 PyErr_NoMemory();
    2402           0 :                                 return -1;
    2403             :                         }
    2404           0 :                         object->rebootmsg = talloc_str;
    2405             :                 }
    2406             :         }
    2407           0 :         return 0;
    2408             : }
    2409             : 
    2410           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_command(PyObject *obj, void *closure)
    2411             : {
    2412           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
    2413             :         PyObject *py_command;
    2414           0 :         if (object->command == NULL) {
    2415           0 :                 Py_RETURN_NONE;
    2416             :         }
    2417           0 :         if (object->command == NULL) {
    2418           0 :                 py_command = Py_None;
    2419           0 :                 Py_INCREF(py_command);
    2420             :         } else {
    2421           0 :                 py_command = PyString_FromStringOrNULL(object->command);
    2422             :         }
    2423           0 :         return py_command;
    2424             : }
    2425             : 
    2426           0 : static int py_SERVICE_FAILURE_ACTIONS_set_command(PyObject *py_obj, PyObject *value, void *closure)
    2427             : {
    2428           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2429           0 :         if (value == NULL) {
    2430           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
    2431           0 :                 return -1;
    2432             :         }
    2433           0 :         if (value == Py_None) {
    2434           0 :                 object->command = NULL;
    2435             :         } else {
    2436           0 :                 object->command = NULL;
    2437             :                 {
    2438             :                         const char *test_str;
    2439             :                         const char *talloc_str;
    2440           0 :                         PyObject *unicode = NULL;
    2441           0 :                         if (PyUnicode_Check(value)) {
    2442           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2443           0 :                                 if (unicode == NULL) {
    2444           0 :                                         PyErr_NoMemory();
    2445           0 :                                         return -1;
    2446             :                                 }
    2447           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2448           0 :                         } else if (PyBytes_Check(value)) {
    2449           0 :                                 test_str = PyBytes_AS_STRING(value);
    2450             :                         } else {
    2451           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2452           0 :                                 return -1;
    2453             :                         }
    2454           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2455           0 :                         if (unicode != NULL) {
    2456           0 :                                 Py_DECREF(unicode);
    2457             :                         }
    2458           0 :                         if (talloc_str == NULL) {
    2459           0 :                                 PyErr_NoMemory();
    2460           0 :                                 return -1;
    2461             :                         }
    2462           0 :                         object->command = talloc_str;
    2463             :                 }
    2464             :         }
    2465           0 :         return 0;
    2466             : }
    2467             : 
    2468           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_num_actions(PyObject *obj, void *closure)
    2469             : {
    2470           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
    2471             :         PyObject *py_num_actions;
    2472           0 :         py_num_actions = PyLong_FromUnsignedLongLong((uint32_t)object->num_actions);
    2473           0 :         return py_num_actions;
    2474             : }
    2475             : 
    2476           0 : static int py_SERVICE_FAILURE_ACTIONS_set_num_actions(PyObject *py_obj, PyObject *value, void *closure)
    2477             : {
    2478           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2479           0 :         if (value == NULL) {
    2480           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_actions");
    2481           0 :                 return -1;
    2482             :         }
    2483             :         {
    2484           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_actions));
    2485           0 :                 if (PyLong_Check(value)) {
    2486             :                         unsigned long long test_var;
    2487           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2488           0 :                         if (PyErr_Occurred() != NULL) {
    2489           0 :                                 return -1;
    2490             :                         }
    2491           0 :                         if (test_var > uint_max) {
    2492           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2493             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2494           0 :                                 return -1;
    2495             :                         }
    2496           0 :                         object->num_actions = test_var;
    2497             :                 } else {
    2498           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2499             :                           PyLong_Type.tp_name);
    2500           0 :                         return -1;
    2501             :                 }
    2502             :         }
    2503           0 :         return 0;
    2504             : }
    2505             : 
    2506           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_actions(PyObject *obj, void *closure)
    2507             : {
    2508           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
    2509             :         PyObject *py_actions;
    2510           0 :         if (object->actions == NULL) {
    2511           0 :                 Py_RETURN_NONE;
    2512             :         }
    2513           0 :         if (object->actions == NULL) {
    2514           0 :                 py_actions = Py_None;
    2515           0 :                 Py_INCREF(py_actions);
    2516             :         } else {
    2517           0 :                 py_actions = PyList_New(object->num_actions);
    2518           0 :                 if (py_actions == NULL) {
    2519           0 :                         return NULL;
    2520             :                 }
    2521             :                 {
    2522             :                         int actions_cntr_1;
    2523           0 :                         for (actions_cntr_1 = 0; actions_cntr_1 < (object->num_actions); actions_cntr_1++) {
    2524             :                                 PyObject *py_actions_1;
    2525           0 :                                 py_actions_1 = pytalloc_reference_ex(&SC_ACTION_Type, object->actions, &object->actions[actions_cntr_1]);
    2526           0 :                                 PyList_SetItem(py_actions, actions_cntr_1, py_actions_1);
    2527             :                         }
    2528             :                 }
    2529             :         }
    2530           0 :         return py_actions;
    2531             : }
    2532             : 
    2533           0 : static int py_SERVICE_FAILURE_ACTIONS_set_actions(PyObject *py_obj, PyObject *value, void *closure)
    2534             : {
    2535           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2536           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->actions));
    2537           0 :         if (value == NULL) {
    2538           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->actions");
    2539           0 :                 return -1;
    2540             :         }
    2541           0 :         if (value == Py_None) {
    2542           0 :                 object->actions = NULL;
    2543             :         } else {
    2544           0 :                 object->actions = NULL;
    2545           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2546             :                 {
    2547             :                         int actions_cntr_1;
    2548           0 :                         object->actions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->actions, PyList_GET_SIZE(value));
    2549           0 :                         if (!object->actions) { return -1;; }
    2550           0 :                         talloc_set_name_const(object->actions, "ARRAY: object->actions");
    2551           0 :                         for (actions_cntr_1 = 0; actions_cntr_1 < PyList_GET_SIZE(value); actions_cntr_1++) {
    2552           0 :                                 if (PyList_GET_ITEM(value, actions_cntr_1) == NULL) {
    2553           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->actions[actions_cntr_1]");
    2554           0 :                                         return -1;
    2555             :                                 }
    2556           0 :                                 PY_CHECK_TYPE(&SC_ACTION_Type, PyList_GET_ITEM(value, actions_cntr_1), return -1;);
    2557           0 :                                 if (talloc_reference(object->actions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, actions_cntr_1))) == NULL) {
    2558           0 :                                         PyErr_NoMemory();
    2559           0 :                                         return -1;
    2560             :                                 }
    2561           0 :                                 object->actions[actions_cntr_1] = *(struct SC_ACTION *)pytalloc_get_ptr(PyList_GET_ITEM(value, actions_cntr_1));
    2562             :                         }
    2563             :                 }
    2564             :         }
    2565           0 :         return 0;
    2566             : }
    2567             : 
    2568             : static PyGetSetDef py_SERVICE_FAILURE_ACTIONS_getsetters[] = {
    2569             :         {
    2570             :                 .name = discard_const_p(char, "reset_period"),
    2571             :                 .get = py_SERVICE_FAILURE_ACTIONS_get_reset_period,
    2572             :                 .set = py_SERVICE_FAILURE_ACTIONS_set_reset_period,
    2573             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2574             :         },
    2575             :         {
    2576             :                 .name = discard_const_p(char, "rebootmsg"),
    2577             :                 .get = py_SERVICE_FAILURE_ACTIONS_get_rebootmsg,
    2578             :                 .set = py_SERVICE_FAILURE_ACTIONS_set_rebootmsg,
    2579             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2580             :         },
    2581             :         {
    2582             :                 .name = discard_const_p(char, "command"),
    2583             :                 .get = py_SERVICE_FAILURE_ACTIONS_get_command,
    2584             :                 .set = py_SERVICE_FAILURE_ACTIONS_set_command,
    2585             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2586             :         },
    2587             :         {
    2588             :                 .name = discard_const_p(char, "num_actions"),
    2589             :                 .get = py_SERVICE_FAILURE_ACTIONS_get_num_actions,
    2590             :                 .set = py_SERVICE_FAILURE_ACTIONS_set_num_actions,
    2591             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2592             :         },
    2593             :         {
    2594             :                 .name = discard_const_p(char, "actions"),
    2595             :                 .get = py_SERVICE_FAILURE_ACTIONS_get_actions,
    2596             :                 .set = py_SERVICE_FAILURE_ACTIONS_set_actions,
    2597             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SC_ACTION")
    2598             :         },
    2599             :         { .name = NULL }
    2600             : };
    2601             : 
    2602           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2603             : {
    2604           0 :         return pytalloc_new(struct SERVICE_FAILURE_ACTIONS, type);
    2605             : }
    2606             : 
    2607           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2608             : {
    2609           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2610           0 :         PyObject *ret = NULL;
    2611             :         DATA_BLOB blob;
    2612             :         enum ndr_err_code err;
    2613           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2614           0 :         if (tmp_ctx == NULL) {
    2615           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2616           0 :                 return NULL;
    2617             :         }
    2618           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_FAILURE_ACTIONS);
    2619           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2620           0 :                 TALLOC_FREE(tmp_ctx);
    2621           0 :                 PyErr_SetNdrError(err);
    2622           0 :                 return NULL;
    2623             :         }
    2624             : 
    2625           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2626           0 :         TALLOC_FREE(tmp_ctx);
    2627           0 :         return ret;
    2628             : }
    2629             : 
    2630           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2631             : {
    2632           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2633           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2634           0 :         Py_ssize_t blob_length = 0;
    2635             :         enum ndr_err_code err;
    2636           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2637           0 :         PyObject *allow_remaining_obj = NULL;
    2638           0 :         bool allow_remaining = false;
    2639             : 
    2640           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2641             :                 discard_const_p(char *, kwnames),
    2642             :                 &blob.data, &blob_length,
    2643             :                 &allow_remaining_obj)) {
    2644           0 :                 return NULL;
    2645             :         }
    2646           0 :         blob.length = blob_length;
    2647             : 
    2648           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2649           0 :                 allow_remaining = true;
    2650             :         }
    2651             : 
    2652           0 :         if (allow_remaining) {
    2653           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_FAILURE_ACTIONS);
    2654             :         } else {
    2655           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_FAILURE_ACTIONS);
    2656             :         }
    2657           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2658           0 :                 PyErr_SetNdrError(err);
    2659           0 :                 return NULL;
    2660             :         }
    2661             : 
    2662           0 :         Py_RETURN_NONE;
    2663             : }
    2664             : 
    2665           0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2666             : {
    2667           0 :         struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
    2668             :         PyObject *ret;
    2669             :         char *retstr;
    2670             : 
    2671           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_FAILURE_ACTIONS, "SERVICE_FAILURE_ACTIONS", object);
    2672           0 :         ret = PyUnicode_FromString(retstr);
    2673           0 :         talloc_free(retstr);
    2674             : 
    2675           0 :         return ret;
    2676             : }
    2677             : 
    2678             : static PyMethodDef py_SERVICE_FAILURE_ACTIONS_methods[] = {
    2679             :         { "__ndr_pack__", (PyCFunction)py_SERVICE_FAILURE_ACTIONS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2680             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SERVICE_FAILURE_ACTIONS_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2681             :         { "__ndr_print__", (PyCFunction)py_SERVICE_FAILURE_ACTIONS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2682             :         { NULL, NULL, 0, NULL }
    2683             : };
    2684             : 
    2685             : 
    2686             : static PyTypeObject SERVICE_FAILURE_ACTIONS_Type = {
    2687             :         PyVarObject_HEAD_INIT(NULL, 0)
    2688             :         .tp_name = "svcctl.SERVICE_FAILURE_ACTIONS",
    2689             :         .tp_getset = py_SERVICE_FAILURE_ACTIONS_getsetters,
    2690             :         .tp_methods = py_SERVICE_FAILURE_ACTIONS_methods,
    2691             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2692             :         .tp_new = py_SERVICE_FAILURE_ACTIONS_new,
    2693             : };
    2694             : 
    2695             : 
    2696             : 
    2697           0 : static PyObject *py_svcctl_CloseServiceHandle_in_get_handle(PyObject *obj, void *closure)
    2698             : {
    2699           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
    2700             :         PyObject *py_handle;
    2701           0 :         if (object->in.handle == NULL) {
    2702           0 :                 Py_RETURN_NONE;
    2703             :         }
    2704           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    2705           0 :         return py_handle;
    2706             : }
    2707             : 
    2708           0 : static int py_svcctl_CloseServiceHandle_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    2709             : {
    2710           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
    2711           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    2712           0 :         if (value == NULL) {
    2713           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    2714           0 :                 return -1;
    2715             :         }
    2716           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    2717           0 :         if (object->in.handle == NULL) {
    2718           0 :                 PyErr_NoMemory();
    2719           0 :                 return -1;
    2720             :         }
    2721           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    2722           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2723           0 :                 PyErr_NoMemory();
    2724           0 :                 return -1;
    2725             :         }
    2726           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    2727           0 :         return 0;
    2728             : }
    2729             : 
    2730           0 : static PyObject *py_svcctl_CloseServiceHandle_out_get_handle(PyObject *obj, void *closure)
    2731             : {
    2732           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
    2733             :         PyObject *py_handle;
    2734           0 :         if (object->out.handle == NULL) {
    2735           0 :                 Py_RETURN_NONE;
    2736             :         }
    2737           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
    2738           0 :         return py_handle;
    2739             : }
    2740             : 
    2741           0 : static int py_svcctl_CloseServiceHandle_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    2742             : {
    2743           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
    2744           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
    2745           0 :         if (value == NULL) {
    2746           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
    2747           0 :                 return -1;
    2748             :         }
    2749           0 :         object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
    2750           0 :         if (object->out.handle == NULL) {
    2751           0 :                 PyErr_NoMemory();
    2752           0 :                 return -1;
    2753             :         }
    2754           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    2755           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2756           0 :                 PyErr_NoMemory();
    2757           0 :                 return -1;
    2758             :         }
    2759           0 :         object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    2760           0 :         return 0;
    2761             : }
    2762             : 
    2763           0 : static PyObject *py_svcctl_CloseServiceHandle_get_result(PyObject *obj, void *closure)
    2764             : {
    2765           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
    2766             :         PyObject *py_result;
    2767           0 :         py_result = PyErr_FromWERROR(object->out.result);
    2768           0 :         return py_result;
    2769             : }
    2770             : 
    2771           0 : static int py_svcctl_CloseServiceHandle_set_result(PyObject *py_obj, PyObject *value, void *closure)
    2772             : {
    2773           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
    2774           0 :         if (value == NULL) {
    2775           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    2776           0 :                 return -1;
    2777             :         }
    2778           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    2779           0 :         return 0;
    2780             : }
    2781             : 
    2782             : static PyGetSetDef py_svcctl_CloseServiceHandle_getsetters[] = {
    2783             :         {
    2784             :                 .name = discard_const_p(char, "in_handle"),
    2785             :                 .get = py_svcctl_CloseServiceHandle_in_get_handle,
    2786             :                 .set = py_svcctl_CloseServiceHandle_in_set_handle,
    2787             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    2788             :         },
    2789             :         {
    2790             :                 .name = discard_const_p(char, "out_handle"),
    2791             :                 .get = py_svcctl_CloseServiceHandle_out_get_handle,
    2792             :                 .set = py_svcctl_CloseServiceHandle_out_set_handle,
    2793             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    2794             :         },
    2795             :         {
    2796             :                 .name = discard_const_p(char, "result"),
    2797             :                 .get = py_svcctl_CloseServiceHandle_get_result,
    2798             :                 .set = py_svcctl_CloseServiceHandle_set_result,
    2799             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    2800             :         },
    2801             :         { .name = NULL }
    2802             : };
    2803             : 
    2804           0 : static PyObject *py_svcctl_CloseServiceHandle_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2805             : {
    2806           0 :         PyObject *self = pytalloc_new(struct svcctl_CloseServiceHandle, type);
    2807           0 :         struct svcctl_CloseServiceHandle *_self = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(self);
    2808           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    2809           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    2810           0 :         _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
    2811           0 :         return self;
    2812             : }
    2813             : 
    2814           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    2815             : {
    2816             : 
    2817             : 
    2818           0 :         return PyLong_FromLong(0);
    2819             : }
    2820             : 
    2821           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    2822             : {
    2823           0 :         const struct ndr_interface_call *call = NULL;
    2824           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
    2825           0 :         PyObject *ret = NULL;
    2826           0 :         struct ndr_push *push = NULL;
    2827             :         DATA_BLOB blob;
    2828             :         enum ndr_err_code err;
    2829             : 
    2830           0 :         if (ndr_table_svcctl.num_calls < 1) {
    2831           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_pack");
    2832           0 :                 return NULL;
    2833             :         }
    2834           0 :         call = &ndr_table_svcctl.calls[0];
    2835             : 
    2836           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    2837           0 :         if (push == NULL) {
    2838           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2839           0 :                 return NULL;
    2840             :         }
    2841             : 
    2842           0 :         push->flags |= ndr_push_flags;
    2843             : 
    2844           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    2845           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2846           0 :                 TALLOC_FREE(push);
    2847           0 :                 PyErr_SetNdrError(err);
    2848           0 :                 return NULL;
    2849             :         }
    2850           0 :         blob = ndr_push_blob(push);
    2851           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2852           0 :         TALLOC_FREE(push);
    2853           0 :         return ret;
    2854             : }
    2855             : 
    2856           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2857             : {
    2858           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2859           0 :         PyObject *bigendian_obj = NULL;
    2860           0 :         PyObject *ndr64_obj = NULL;
    2861           0 :         uint32_t ndr_push_flags = 0;
    2862             : 
    2863           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    2864             :                 discard_const_p(char *, kwnames),
    2865             :                 &bigendian_obj,
    2866             :                 &ndr64_obj)) {
    2867           0 :                 return NULL;
    2868             :         }
    2869             : 
    2870           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2871           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    2872             :         }
    2873           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2874           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    2875             :         }
    2876             : 
    2877           0 :         return py_svcctl_CloseServiceHandle_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    2878             : }
    2879             : 
    2880           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2881             : {
    2882           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2883           0 :         PyObject *bigendian_obj = NULL;
    2884           0 :         PyObject *ndr64_obj = NULL;
    2885           0 :         uint32_t ndr_push_flags = 0;
    2886             : 
    2887           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    2888             :                 discard_const_p(char *, kwnames),
    2889             :                 &bigendian_obj,
    2890             :                 &ndr64_obj)) {
    2891           0 :                 return NULL;
    2892             :         }
    2893             : 
    2894           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2895           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    2896             :         }
    2897           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2898           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    2899             :         }
    2900             : 
    2901           0 :         return py_svcctl_CloseServiceHandle_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    2902             : }
    2903             : 
    2904           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    2905             : {
    2906           0 :         const struct ndr_interface_call *call = NULL;
    2907           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
    2908           0 :         struct ndr_pull *pull = NULL;
    2909             :         enum ndr_err_code err;
    2910             : 
    2911           0 :         if (ndr_table_svcctl.num_calls < 1) {
    2912           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_unpack");
    2913           0 :                 return NULL;
    2914             :         }
    2915           0 :         call = &ndr_table_svcctl.calls[0];
    2916             : 
    2917           0 :         pull = ndr_pull_init_blob(blob, object);
    2918           0 :         if (pull == NULL) {
    2919           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2920           0 :                 return NULL;
    2921             :         }
    2922             : 
    2923           0 :         pull->flags |= ndr_pull_flags;
    2924             : 
    2925           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    2926           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2927           0 :                 TALLOC_FREE(pull);
    2928           0 :                 PyErr_SetNdrError(err);
    2929           0 :                 return NULL;
    2930             :         }
    2931           0 :         if (!allow_remaining) {
    2932             :                 uint32_t highest_ofs;
    2933             : 
    2934           0 :                 if (pull->offset > pull->relative_highest_offset) {
    2935           0 :                         highest_ofs = pull->offset;
    2936             :                 } else {
    2937           0 :                         highest_ofs = pull->relative_highest_offset;
    2938             :                 }
    2939           0 :                 if (highest_ofs < pull->data_size) {
    2940           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    2941             :                                 "not all bytes consumed ofs[%u] size[%u]",
    2942             :                                 highest_ofs, pull->data_size);
    2943           0 :                         TALLOC_FREE(pull);
    2944           0 :                         PyErr_SetNdrError(err);
    2945           0 :                         return NULL;
    2946             :                 }
    2947             :         }
    2948             : 
    2949           0 :         TALLOC_FREE(pull);
    2950           0 :         Py_RETURN_NONE;
    2951             : }
    2952             : 
    2953           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2954             : {
    2955             :         DATA_BLOB blob;
    2956           0 :         Py_ssize_t blob_length = 0;
    2957           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    2958           0 :         PyObject *bigendian_obj = NULL;
    2959           0 :         PyObject *ndr64_obj = NULL;
    2960           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    2961           0 :         PyObject *allow_remaining_obj = NULL;
    2962           0 :         bool allow_remaining = false;
    2963             : 
    2964           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    2965             :                 discard_const_p(char *, kwnames),
    2966             :                 &blob.data, &blob_length,
    2967             :                 &bigendian_obj,
    2968             :                 &ndr64_obj,
    2969             :                 &allow_remaining_obj)) {
    2970           0 :                 return NULL;
    2971             :         }
    2972           0 :         blob.length = blob_length;
    2973             : 
    2974           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2975           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    2976             :         }
    2977           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2978           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    2979             :         }
    2980             : 
    2981           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2982           0 :                 allow_remaining = true;
    2983             :         }
    2984             : 
    2985           0 :         return py_svcctl_CloseServiceHandle_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    2986             : }
    2987             : 
    2988           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2989             : {
    2990             :         DATA_BLOB blob;
    2991           0 :         Py_ssize_t blob_length = 0;
    2992           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    2993           0 :         PyObject *bigendian_obj = NULL;
    2994           0 :         PyObject *ndr64_obj = NULL;
    2995           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    2996           0 :         PyObject *allow_remaining_obj = NULL;
    2997           0 :         bool allow_remaining = false;
    2998             : 
    2999           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3000             :                 discard_const_p(char *, kwnames),
    3001             :                 &blob.data, &blob_length,
    3002             :                 &bigendian_obj,
    3003             :                 &ndr64_obj,
    3004             :                 &allow_remaining_obj)) {
    3005           0 :                 return NULL;
    3006             :         }
    3007           0 :         blob.length = blob_length;
    3008             : 
    3009           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3010           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3011             :         }
    3012           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3013           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3014             :         }
    3015             : 
    3016           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3017           0 :                 allow_remaining = true;
    3018             :         }
    3019             : 
    3020           0 :         return py_svcctl_CloseServiceHandle_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3021             : }
    3022             : 
    3023           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3024             : {
    3025           0 :         const struct ndr_interface_call *call = NULL;
    3026           0 :         struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
    3027             :         PyObject *ret;
    3028             :         char *retstr;
    3029             : 
    3030           0 :         if (ndr_table_svcctl.num_calls < 1) {
    3031           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_print");
    3032           0 :                 return NULL;
    3033             :         }
    3034           0 :         call = &ndr_table_svcctl.calls[0];
    3035             : 
    3036           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3037           0 :         ret = PyUnicode_FromString(retstr);
    3038           0 :         TALLOC_FREE(retstr);
    3039             : 
    3040           0 :         return ret;
    3041             : }
    3042             : 
    3043           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3044             : {
    3045           0 :         return py_svcctl_CloseServiceHandle_ndr_print(py_obj, "svcctl_CloseServiceHandle_in", NDR_IN);
    3046             : }
    3047             : 
    3048           0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3049             : {
    3050           0 :         return py_svcctl_CloseServiceHandle_ndr_print(py_obj, "svcctl_CloseServiceHandle_out", NDR_OUT);
    3051             : }
    3052             : 
    3053             : static PyMethodDef py_svcctl_CloseServiceHandle_methods[] = {
    3054             :         { "opnum", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_opnum, METH_NOARGS|METH_CLASS,
    3055             :                 "svcctl.CloseServiceHandle.opnum() -> 0 (0x00) " },
    3056             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3057             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3058             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3059             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3060             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3061             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3062             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3063             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3064             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3065             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3066             :         { NULL, NULL, 0, NULL }
    3067             : };
    3068             : 
    3069             : 
    3070             : static PyTypeObject svcctl_CloseServiceHandle_Type = {
    3071             :         PyVarObject_HEAD_INIT(NULL, 0)
    3072             :         .tp_name = "svcctl.CloseServiceHandle",
    3073             :         .tp_getset = py_svcctl_CloseServiceHandle_getsetters,
    3074             :         .tp_methods = py_svcctl_CloseServiceHandle_methods,
    3075             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3076             :         .tp_new = py_svcctl_CloseServiceHandle_new,
    3077             : };
    3078             : 
    3079           0 : static bool pack_py_svcctl_CloseServiceHandle_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CloseServiceHandle *r)
    3080             : {
    3081             :         PyObject *py_handle;
    3082           0 :         const char *kwnames[] = {
    3083             :                 "handle", NULL
    3084             :         };
    3085             : 
    3086           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_CloseServiceHandle", discard_const_p(char *, kwnames), &py_handle)) {
    3087           0 :                 return false;
    3088             :         }
    3089             : 
    3090           0 :         if (py_handle == NULL) {
    3091           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    3092           0 :                 return false;
    3093             :         }
    3094           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    3095           0 :         if (r->in.handle == NULL) {
    3096           0 :                 PyErr_NoMemory();
    3097           0 :                 return false;
    3098             :         }
    3099           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    3100           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    3101           0 :                 PyErr_NoMemory();
    3102           0 :                 return false;
    3103             :         }
    3104           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    3105           0 :         return true;
    3106             : }
    3107             : 
    3108           0 : static PyObject *unpack_py_svcctl_CloseServiceHandle_args_out(struct svcctl_CloseServiceHandle *r)
    3109             : {
    3110             :         PyObject *result;
    3111             :         PyObject *py_handle;
    3112           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
    3113           0 :         result = py_handle;
    3114           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    3115           0 :                 PyErr_SetWERROR(r->out.result);
    3116           0 :                 return NULL;
    3117             :         }
    3118             : 
    3119           0 :         return result;
    3120             : }
    3121             : 
    3122             : 
    3123           0 : static PyObject *py_svcctl_ControlService_in_get_handle(PyObject *obj, void *closure)
    3124             : {
    3125           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
    3126             :         PyObject *py_handle;
    3127           0 :         if (object->in.handle == NULL) {
    3128           0 :                 Py_RETURN_NONE;
    3129             :         }
    3130           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    3131           0 :         return py_handle;
    3132             : }
    3133             : 
    3134           0 : static int py_svcctl_ControlService_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    3135             : {
    3136           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
    3137           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    3138           0 :         if (value == NULL) {
    3139           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    3140           0 :                 return -1;
    3141             :         }
    3142           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    3143           0 :         if (object->in.handle == NULL) {
    3144           0 :                 PyErr_NoMemory();
    3145           0 :                 return -1;
    3146             :         }
    3147           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    3148           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3149           0 :                 PyErr_NoMemory();
    3150           0 :                 return -1;
    3151             :         }
    3152           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    3153           0 :         return 0;
    3154             : }
    3155             : 
    3156           0 : static PyObject *py_svcctl_ControlService_in_get_control(PyObject *obj, void *closure)
    3157             : {
    3158           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
    3159             :         PyObject *py_control;
    3160           0 :         py_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.control);
    3161           0 :         return py_control;
    3162             : }
    3163             : 
    3164           0 : static int py_svcctl_ControlService_in_set_control(PyObject *py_obj, PyObject *value, void *closure)
    3165             : {
    3166           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
    3167           0 :         if (value == NULL) {
    3168           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.control");
    3169           0 :                 return -1;
    3170             :         }
    3171             :         {
    3172           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.control));
    3173           0 :                 if (PyLong_Check(value)) {
    3174             :                         unsigned long long test_var;
    3175           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3176           0 :                         if (PyErr_Occurred() != NULL) {
    3177           0 :                                 return -1;
    3178             :                         }
    3179           0 :                         if (test_var > uint_max) {
    3180           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3181             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3182           0 :                                 return -1;
    3183             :                         }
    3184           0 :                         object->in.control = test_var;
    3185             :                 } else {
    3186           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3187             :                           PyLong_Type.tp_name);
    3188           0 :                         return -1;
    3189             :                 }
    3190             :         }
    3191           0 :         return 0;
    3192             : }
    3193             : 
    3194           0 : static PyObject *py_svcctl_ControlService_out_get_service_status(PyObject *obj, void *closure)
    3195             : {
    3196           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
    3197             :         PyObject *py_service_status;
    3198           0 :         if (object->out.service_status == NULL) {
    3199           0 :                 Py_RETURN_NONE;
    3200             :         }
    3201           0 :         py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, object->out.service_status, object->out.service_status);
    3202           0 :         return py_service_status;
    3203             : }
    3204             : 
    3205           0 : static int py_svcctl_ControlService_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
    3206             : {
    3207           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
    3208           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
    3209           0 :         if (value == NULL) {
    3210           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
    3211           0 :                 return -1;
    3212             :         }
    3213           0 :         object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
    3214           0 :         if (object->out.service_status == NULL) {
    3215           0 :                 PyErr_NoMemory();
    3216           0 :                 return -1;
    3217             :         }
    3218           0 :         PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
    3219           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3220           0 :                 PyErr_NoMemory();
    3221           0 :                 return -1;
    3222             :         }
    3223           0 :         object->out.service_status = (struct SERVICE_STATUS *)pytalloc_get_ptr(value);
    3224           0 :         return 0;
    3225             : }
    3226             : 
    3227           0 : static PyObject *py_svcctl_ControlService_get_result(PyObject *obj, void *closure)
    3228             : {
    3229           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
    3230             :         PyObject *py_result;
    3231           0 :         py_result = PyErr_FromWERROR(object->out.result);
    3232           0 :         return py_result;
    3233             : }
    3234             : 
    3235           0 : static int py_svcctl_ControlService_set_result(PyObject *py_obj, PyObject *value, void *closure)
    3236             : {
    3237           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
    3238           0 :         if (value == NULL) {
    3239           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    3240           0 :                 return -1;
    3241             :         }
    3242           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    3243           0 :         return 0;
    3244             : }
    3245             : 
    3246             : static PyGetSetDef py_svcctl_ControlService_getsetters[] = {
    3247             :         {
    3248             :                 .name = discard_const_p(char, "in_handle"),
    3249             :                 .get = py_svcctl_ControlService_in_get_handle,
    3250             :                 .set = py_svcctl_ControlService_in_set_handle,
    3251             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    3252             :         },
    3253             :         {
    3254             :                 .name = discard_const_p(char, "in_control"),
    3255             :                 .get = py_svcctl_ControlService_in_get_control,
    3256             :                 .set = py_svcctl_ControlService_in_set_control,
    3257             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_CONTROL")
    3258             :         },
    3259             :         {
    3260             :                 .name = discard_const_p(char, "out_service_status"),
    3261             :                 .get = py_svcctl_ControlService_out_get_service_status,
    3262             :                 .set = py_svcctl_ControlService_out_set_service_status,
    3263             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
    3264             :         },
    3265             :         {
    3266             :                 .name = discard_const_p(char, "result"),
    3267             :                 .get = py_svcctl_ControlService_get_result,
    3268             :                 .set = py_svcctl_ControlService_set_result,
    3269             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    3270             :         },
    3271             :         { .name = NULL }
    3272             : };
    3273             : 
    3274           0 : static PyObject *py_svcctl_ControlService_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3275             : {
    3276           0 :         PyObject *self = pytalloc_new(struct svcctl_ControlService, type);
    3277           0 :         struct svcctl_ControlService *_self = (struct svcctl_ControlService *)pytalloc_get_ptr(self);
    3278           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    3279           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    3280           0 :         _self->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
    3281           0 :         return self;
    3282             : }
    3283             : 
    3284           0 : static PyObject *py_svcctl_ControlService_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3285             : {
    3286             : 
    3287             : 
    3288           0 :         return PyLong_FromLong(1);
    3289             : }
    3290             : 
    3291           0 : static PyObject *py_svcctl_ControlService_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3292             : {
    3293           0 :         const struct ndr_interface_call *call = NULL;
    3294           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
    3295           0 :         PyObject *ret = NULL;
    3296           0 :         struct ndr_push *push = NULL;
    3297             :         DATA_BLOB blob;
    3298             :         enum ndr_err_code err;
    3299             : 
    3300           0 :         if (ndr_table_svcctl.num_calls < 2) {
    3301           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_pack");
    3302           0 :                 return NULL;
    3303             :         }
    3304           0 :         call = &ndr_table_svcctl.calls[1];
    3305             : 
    3306           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3307           0 :         if (push == NULL) {
    3308           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3309           0 :                 return NULL;
    3310             :         }
    3311             : 
    3312           0 :         push->flags |= ndr_push_flags;
    3313             : 
    3314           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3315           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3316           0 :                 TALLOC_FREE(push);
    3317           0 :                 PyErr_SetNdrError(err);
    3318           0 :                 return NULL;
    3319             :         }
    3320           0 :         blob = ndr_push_blob(push);
    3321           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3322           0 :         TALLOC_FREE(push);
    3323           0 :         return ret;
    3324             : }
    3325             : 
    3326           0 : static PyObject *py_svcctl_ControlService_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3327             : {
    3328           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3329           0 :         PyObject *bigendian_obj = NULL;
    3330           0 :         PyObject *ndr64_obj = NULL;
    3331           0 :         uint32_t ndr_push_flags = 0;
    3332             : 
    3333           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3334             :                 discard_const_p(char *, kwnames),
    3335             :                 &bigendian_obj,
    3336             :                 &ndr64_obj)) {
    3337           0 :                 return NULL;
    3338             :         }
    3339             : 
    3340           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3341           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3342             :         }
    3343           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3344           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3345             :         }
    3346             : 
    3347           0 :         return py_svcctl_ControlService_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3348             : }
    3349             : 
    3350           0 : static PyObject *py_svcctl_ControlService_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3351             : {
    3352           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3353           0 :         PyObject *bigendian_obj = NULL;
    3354           0 :         PyObject *ndr64_obj = NULL;
    3355           0 :         uint32_t ndr_push_flags = 0;
    3356             : 
    3357           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3358             :                 discard_const_p(char *, kwnames),
    3359             :                 &bigendian_obj,
    3360             :                 &ndr64_obj)) {
    3361           0 :                 return NULL;
    3362             :         }
    3363             : 
    3364           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3365           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3366             :         }
    3367           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3368           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3369             :         }
    3370             : 
    3371           0 :         return py_svcctl_ControlService_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3372             : }
    3373             : 
    3374           0 : static PyObject *py_svcctl_ControlService_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    3375             : {
    3376           0 :         const struct ndr_interface_call *call = NULL;
    3377           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
    3378           0 :         struct ndr_pull *pull = NULL;
    3379             :         enum ndr_err_code err;
    3380             : 
    3381           0 :         if (ndr_table_svcctl.num_calls < 2) {
    3382           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_unpack");
    3383           0 :                 return NULL;
    3384             :         }
    3385           0 :         call = &ndr_table_svcctl.calls[1];
    3386             : 
    3387           0 :         pull = ndr_pull_init_blob(blob, object);
    3388           0 :         if (pull == NULL) {
    3389           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3390           0 :                 return NULL;
    3391             :         }
    3392             : 
    3393           0 :         pull->flags |= ndr_pull_flags;
    3394             : 
    3395           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3396           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3397           0 :                 TALLOC_FREE(pull);
    3398           0 :                 PyErr_SetNdrError(err);
    3399           0 :                 return NULL;
    3400             :         }
    3401           0 :         if (!allow_remaining) {
    3402             :                 uint32_t highest_ofs;
    3403             : 
    3404           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3405           0 :                         highest_ofs = pull->offset;
    3406             :                 } else {
    3407           0 :                         highest_ofs = pull->relative_highest_offset;
    3408             :                 }
    3409           0 :                 if (highest_ofs < pull->data_size) {
    3410           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3411             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3412             :                                 highest_ofs, pull->data_size);
    3413           0 :                         TALLOC_FREE(pull);
    3414           0 :                         PyErr_SetNdrError(err);
    3415           0 :                         return NULL;
    3416             :                 }
    3417             :         }
    3418             : 
    3419           0 :         TALLOC_FREE(pull);
    3420           0 :         Py_RETURN_NONE;
    3421             : }
    3422             : 
    3423           0 : static PyObject *py_svcctl_ControlService_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3424             : {
    3425             :         DATA_BLOB blob;
    3426           0 :         Py_ssize_t blob_length = 0;
    3427           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3428           0 :         PyObject *bigendian_obj = NULL;
    3429           0 :         PyObject *ndr64_obj = NULL;
    3430           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3431           0 :         PyObject *allow_remaining_obj = NULL;
    3432           0 :         bool allow_remaining = false;
    3433             : 
    3434           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3435             :                 discard_const_p(char *, kwnames),
    3436             :                 &blob.data, &blob_length,
    3437             :                 &bigendian_obj,
    3438             :                 &ndr64_obj,
    3439             :                 &allow_remaining_obj)) {
    3440           0 :                 return NULL;
    3441             :         }
    3442           0 :         blob.length = blob_length;
    3443             : 
    3444           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3445           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3446             :         }
    3447           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3448           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3449             :         }
    3450             : 
    3451           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3452           0 :                 allow_remaining = true;
    3453             :         }
    3454             : 
    3455           0 :         return py_svcctl_ControlService_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3456             : }
    3457             : 
    3458           0 : static PyObject *py_svcctl_ControlService_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3459             : {
    3460             :         DATA_BLOB blob;
    3461           0 :         Py_ssize_t blob_length = 0;
    3462           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3463           0 :         PyObject *bigendian_obj = NULL;
    3464           0 :         PyObject *ndr64_obj = NULL;
    3465           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3466           0 :         PyObject *allow_remaining_obj = NULL;
    3467           0 :         bool allow_remaining = false;
    3468             : 
    3469           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3470             :                 discard_const_p(char *, kwnames),
    3471             :                 &blob.data, &blob_length,
    3472             :                 &bigendian_obj,
    3473             :                 &ndr64_obj,
    3474             :                 &allow_remaining_obj)) {
    3475           0 :                 return NULL;
    3476             :         }
    3477           0 :         blob.length = blob_length;
    3478             : 
    3479           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3480           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3481             :         }
    3482           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3483           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3484             :         }
    3485             : 
    3486           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3487           0 :                 allow_remaining = true;
    3488             :         }
    3489             : 
    3490           0 :         return py_svcctl_ControlService_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3491             : }
    3492             : 
    3493           0 : static PyObject *py_svcctl_ControlService_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3494             : {
    3495           0 :         const struct ndr_interface_call *call = NULL;
    3496           0 :         struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
    3497             :         PyObject *ret;
    3498             :         char *retstr;
    3499             : 
    3500           0 :         if (ndr_table_svcctl.num_calls < 2) {
    3501           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_print");
    3502           0 :                 return NULL;
    3503             :         }
    3504           0 :         call = &ndr_table_svcctl.calls[1];
    3505             : 
    3506           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3507           0 :         ret = PyUnicode_FromString(retstr);
    3508           0 :         TALLOC_FREE(retstr);
    3509             : 
    3510           0 :         return ret;
    3511             : }
    3512             : 
    3513           0 : static PyObject *py_svcctl_ControlService_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3514             : {
    3515           0 :         return py_svcctl_ControlService_ndr_print(py_obj, "svcctl_ControlService_in", NDR_IN);
    3516             : }
    3517             : 
    3518           0 : static PyObject *py_svcctl_ControlService_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3519             : {
    3520           0 :         return py_svcctl_ControlService_ndr_print(py_obj, "svcctl_ControlService_out", NDR_OUT);
    3521             : }
    3522             : 
    3523             : static PyMethodDef py_svcctl_ControlService_methods[] = {
    3524             :         { "opnum", (PyCFunction)py_svcctl_ControlService_ndr_opnum, METH_NOARGS|METH_CLASS,
    3525             :                 "svcctl.ControlService.opnum() -> 1 (0x01) " },
    3526             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3527             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3528             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3529             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3530             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3531             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3532             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3533             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3534             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_ControlService_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3535             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_ControlService_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3536             :         { NULL, NULL, 0, NULL }
    3537             : };
    3538             : 
    3539             : 
    3540             : static PyTypeObject svcctl_ControlService_Type = {
    3541             :         PyVarObject_HEAD_INIT(NULL, 0)
    3542             :         .tp_name = "svcctl.ControlService",
    3543             :         .tp_getset = py_svcctl_ControlService_getsetters,
    3544             :         .tp_methods = py_svcctl_ControlService_methods,
    3545             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3546             :         .tp_new = py_svcctl_ControlService_new,
    3547             : };
    3548             : 
    3549           0 : static bool pack_py_svcctl_ControlService_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ControlService *r)
    3550             : {
    3551             :         PyObject *py_handle;
    3552             :         PyObject *py_control;
    3553           0 :         const char *kwnames[] = {
    3554             :                 "handle", "control", NULL
    3555             :         };
    3556             : 
    3557           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_ControlService", discard_const_p(char *, kwnames), &py_handle, &py_control)) {
    3558           0 :                 return false;
    3559             :         }
    3560             : 
    3561           0 :         if (py_handle == NULL) {
    3562           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    3563           0 :                 return false;
    3564             :         }
    3565           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    3566           0 :         if (r->in.handle == NULL) {
    3567           0 :                 PyErr_NoMemory();
    3568           0 :                 return false;
    3569             :         }
    3570           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    3571           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    3572           0 :                 PyErr_NoMemory();
    3573           0 :                 return false;
    3574             :         }
    3575           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    3576           0 :         if (py_control == NULL) {
    3577           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.control");
    3578           0 :                 return false;
    3579             :         }
    3580             :         {
    3581           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.control));
    3582           0 :                 if (PyLong_Check(py_control)) {
    3583             :                         unsigned long long test_var;
    3584           0 :                         test_var = PyLong_AsUnsignedLongLong(py_control);
    3585           0 :                         if (PyErr_Occurred() != NULL) {
    3586           0 :                                 return false;
    3587             :                         }
    3588           0 :                         if (test_var > uint_max) {
    3589           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3590             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3591           0 :                                 return false;
    3592             :                         }
    3593           0 :                         r->in.control = test_var;
    3594             :                 } else {
    3595           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3596             :                           PyLong_Type.tp_name);
    3597           0 :                         return false;
    3598             :                 }
    3599             :         }
    3600           0 :         return true;
    3601             : }
    3602             : 
    3603           0 : static PyObject *unpack_py_svcctl_ControlService_args_out(struct svcctl_ControlService *r)
    3604             : {
    3605             :         PyObject *result;
    3606             :         PyObject *py_service_status;
    3607           0 :         py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, r->out.service_status, r->out.service_status);
    3608           0 :         result = py_service_status;
    3609           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    3610           0 :                 PyErr_SetWERROR(r->out.result);
    3611           0 :                 return NULL;
    3612             :         }
    3613             : 
    3614           0 :         return result;
    3615             : }
    3616             : 
    3617             : 
    3618           0 : static PyObject *py_svcctl_DeleteService_in_get_handle(PyObject *obj, void *closure)
    3619             : {
    3620           0 :         struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(obj);
    3621             :         PyObject *py_handle;
    3622           0 :         if (object->in.handle == NULL) {
    3623           0 :                 Py_RETURN_NONE;
    3624             :         }
    3625           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    3626           0 :         return py_handle;
    3627             : }
    3628             : 
    3629           0 : static int py_svcctl_DeleteService_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    3630             : {
    3631           0 :         struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
    3632           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    3633           0 :         if (value == NULL) {
    3634           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    3635           0 :                 return -1;
    3636             :         }
    3637           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    3638           0 :         if (object->in.handle == NULL) {
    3639           0 :                 PyErr_NoMemory();
    3640           0 :                 return -1;
    3641             :         }
    3642           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    3643           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3644           0 :                 PyErr_NoMemory();
    3645           0 :                 return -1;
    3646             :         }
    3647           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    3648           0 :         return 0;
    3649             : }
    3650             : 
    3651           0 : static PyObject *py_svcctl_DeleteService_get_result(PyObject *obj, void *closure)
    3652             : {
    3653           0 :         struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(obj);
    3654             :         PyObject *py_result;
    3655           0 :         py_result = PyErr_FromWERROR(object->out.result);
    3656           0 :         return py_result;
    3657             : }
    3658             : 
    3659           0 : static int py_svcctl_DeleteService_set_result(PyObject *py_obj, PyObject *value, void *closure)
    3660             : {
    3661           0 :         struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
    3662           0 :         if (value == NULL) {
    3663           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    3664           0 :                 return -1;
    3665             :         }
    3666           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    3667           0 :         return 0;
    3668             : }
    3669             : 
    3670             : static PyGetSetDef py_svcctl_DeleteService_getsetters[] = {
    3671             :         {
    3672             :                 .name = discard_const_p(char, "in_handle"),
    3673             :                 .get = py_svcctl_DeleteService_in_get_handle,
    3674             :                 .set = py_svcctl_DeleteService_in_set_handle,
    3675             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    3676             :         },
    3677             :         {
    3678             :                 .name = discard_const_p(char, "result"),
    3679             :                 .get = py_svcctl_DeleteService_get_result,
    3680             :                 .set = py_svcctl_DeleteService_set_result,
    3681             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    3682             :         },
    3683             :         { .name = NULL }
    3684             : };
    3685             : 
    3686           0 : static PyObject *py_svcctl_DeleteService_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3687             : {
    3688           0 :         PyObject *self = pytalloc_new(struct svcctl_DeleteService, type);
    3689           0 :         struct svcctl_DeleteService *_self = (struct svcctl_DeleteService *)pytalloc_get_ptr(self);
    3690           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    3691           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    3692           0 :         return self;
    3693             : }
    3694             : 
    3695           0 : static PyObject *py_svcctl_DeleteService_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3696             : {
    3697             : 
    3698             : 
    3699           0 :         return PyLong_FromLong(2);
    3700             : }
    3701             : 
    3702           0 : static PyObject *py_svcctl_DeleteService_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3703             : {
    3704           0 :         const struct ndr_interface_call *call = NULL;
    3705           0 :         struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
    3706           0 :         PyObject *ret = NULL;
    3707           0 :         struct ndr_push *push = NULL;
    3708             :         DATA_BLOB blob;
    3709             :         enum ndr_err_code err;
    3710             : 
    3711           0 :         if (ndr_table_svcctl.num_calls < 3) {
    3712           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_pack");
    3713           0 :                 return NULL;
    3714             :         }
    3715           0 :         call = &ndr_table_svcctl.calls[2];
    3716             : 
    3717           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3718           0 :         if (push == NULL) {
    3719           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3720           0 :                 return NULL;
    3721             :         }
    3722             : 
    3723           0 :         push->flags |= ndr_push_flags;
    3724             : 
    3725           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3726           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3727           0 :                 TALLOC_FREE(push);
    3728           0 :                 PyErr_SetNdrError(err);
    3729           0 :                 return NULL;
    3730             :         }
    3731           0 :         blob = ndr_push_blob(push);
    3732           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3733           0 :         TALLOC_FREE(push);
    3734           0 :         return ret;
    3735             : }
    3736             : 
    3737           0 : static PyObject *py_svcctl_DeleteService_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3738             : {
    3739           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3740           0 :         PyObject *bigendian_obj = NULL;
    3741           0 :         PyObject *ndr64_obj = NULL;
    3742           0 :         uint32_t ndr_push_flags = 0;
    3743             : 
    3744           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3745             :                 discard_const_p(char *, kwnames),
    3746             :                 &bigendian_obj,
    3747             :                 &ndr64_obj)) {
    3748           0 :                 return NULL;
    3749             :         }
    3750             : 
    3751           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3752           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3753             :         }
    3754           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3755           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3756             :         }
    3757             : 
    3758           0 :         return py_svcctl_DeleteService_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3759             : }
    3760             : 
    3761           0 : static PyObject *py_svcctl_DeleteService_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3762             : {
    3763           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3764           0 :         PyObject *bigendian_obj = NULL;
    3765           0 :         PyObject *ndr64_obj = NULL;
    3766           0 :         uint32_t ndr_push_flags = 0;
    3767             : 
    3768           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3769             :                 discard_const_p(char *, kwnames),
    3770             :                 &bigendian_obj,
    3771             :                 &ndr64_obj)) {
    3772           0 :                 return NULL;
    3773             :         }
    3774             : 
    3775           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3776           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3777             :         }
    3778           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3779           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3780             :         }
    3781             : 
    3782           0 :         return py_svcctl_DeleteService_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3783             : }
    3784             : 
    3785           0 : static PyObject *py_svcctl_DeleteService_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    3786             : {
    3787           0 :         const struct ndr_interface_call *call = NULL;
    3788           0 :         struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
    3789           0 :         struct ndr_pull *pull = NULL;
    3790             :         enum ndr_err_code err;
    3791             : 
    3792           0 :         if (ndr_table_svcctl.num_calls < 3) {
    3793           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_unpack");
    3794           0 :                 return NULL;
    3795             :         }
    3796           0 :         call = &ndr_table_svcctl.calls[2];
    3797             : 
    3798           0 :         pull = ndr_pull_init_blob(blob, object);
    3799           0 :         if (pull == NULL) {
    3800           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3801           0 :                 return NULL;
    3802             :         }
    3803             : 
    3804           0 :         pull->flags |= ndr_pull_flags;
    3805             : 
    3806           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3807           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3808           0 :                 TALLOC_FREE(pull);
    3809           0 :                 PyErr_SetNdrError(err);
    3810           0 :                 return NULL;
    3811             :         }
    3812           0 :         if (!allow_remaining) {
    3813             :                 uint32_t highest_ofs;
    3814             : 
    3815           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3816           0 :                         highest_ofs = pull->offset;
    3817             :                 } else {
    3818           0 :                         highest_ofs = pull->relative_highest_offset;
    3819             :                 }
    3820           0 :                 if (highest_ofs < pull->data_size) {
    3821           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3822             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3823             :                                 highest_ofs, pull->data_size);
    3824           0 :                         TALLOC_FREE(pull);
    3825           0 :                         PyErr_SetNdrError(err);
    3826           0 :                         return NULL;
    3827             :                 }
    3828             :         }
    3829             : 
    3830           0 :         TALLOC_FREE(pull);
    3831           0 :         Py_RETURN_NONE;
    3832             : }
    3833             : 
    3834           0 : static PyObject *py_svcctl_DeleteService_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3835             : {
    3836             :         DATA_BLOB blob;
    3837           0 :         Py_ssize_t blob_length = 0;
    3838           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3839           0 :         PyObject *bigendian_obj = NULL;
    3840           0 :         PyObject *ndr64_obj = NULL;
    3841           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3842           0 :         PyObject *allow_remaining_obj = NULL;
    3843           0 :         bool allow_remaining = false;
    3844             : 
    3845           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3846             :                 discard_const_p(char *, kwnames),
    3847             :                 &blob.data, &blob_length,
    3848             :                 &bigendian_obj,
    3849             :                 &ndr64_obj,
    3850             :                 &allow_remaining_obj)) {
    3851           0 :                 return NULL;
    3852             :         }
    3853           0 :         blob.length = blob_length;
    3854             : 
    3855           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3856           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3857             :         }
    3858           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3859           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3860             :         }
    3861             : 
    3862           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3863           0 :                 allow_remaining = true;
    3864             :         }
    3865             : 
    3866           0 :         return py_svcctl_DeleteService_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3867             : }
    3868             : 
    3869           0 : static PyObject *py_svcctl_DeleteService_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3870             : {
    3871             :         DATA_BLOB blob;
    3872           0 :         Py_ssize_t blob_length = 0;
    3873           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3874           0 :         PyObject *bigendian_obj = NULL;
    3875           0 :         PyObject *ndr64_obj = NULL;
    3876           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3877           0 :         PyObject *allow_remaining_obj = NULL;
    3878           0 :         bool allow_remaining = false;
    3879             : 
    3880           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3881             :                 discard_const_p(char *, kwnames),
    3882             :                 &blob.data, &blob_length,
    3883             :                 &bigendian_obj,
    3884             :                 &ndr64_obj,
    3885             :                 &allow_remaining_obj)) {
    3886           0 :                 return NULL;
    3887             :         }
    3888           0 :         blob.length = blob_length;
    3889             : 
    3890           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3891           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3892             :         }
    3893           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3894           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3895             :         }
    3896             : 
    3897           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3898           0 :                 allow_remaining = true;
    3899             :         }
    3900             : 
    3901           0 :         return py_svcctl_DeleteService_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3902             : }
    3903             : 
    3904           0 : static PyObject *py_svcctl_DeleteService_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3905             : {
    3906           0 :         const struct ndr_interface_call *call = NULL;
    3907           0 :         struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
    3908             :         PyObject *ret;
    3909             :         char *retstr;
    3910             : 
    3911           0 :         if (ndr_table_svcctl.num_calls < 3) {
    3912           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_print");
    3913           0 :                 return NULL;
    3914             :         }
    3915           0 :         call = &ndr_table_svcctl.calls[2];
    3916             : 
    3917           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3918           0 :         ret = PyUnicode_FromString(retstr);
    3919           0 :         TALLOC_FREE(retstr);
    3920             : 
    3921           0 :         return ret;
    3922             : }
    3923             : 
    3924           0 : static PyObject *py_svcctl_DeleteService_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3925             : {
    3926           0 :         return py_svcctl_DeleteService_ndr_print(py_obj, "svcctl_DeleteService_in", NDR_IN);
    3927             : }
    3928             : 
    3929           0 : static PyObject *py_svcctl_DeleteService_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3930             : {
    3931           0 :         return py_svcctl_DeleteService_ndr_print(py_obj, "svcctl_DeleteService_out", NDR_OUT);
    3932             : }
    3933             : 
    3934             : static PyMethodDef py_svcctl_DeleteService_methods[] = {
    3935             :         { "opnum", (PyCFunction)py_svcctl_DeleteService_ndr_opnum, METH_NOARGS|METH_CLASS,
    3936             :                 "svcctl.DeleteService.opnum() -> 2 (0x02) " },
    3937             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3938             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3939             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3940             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3941             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3942             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3943             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3944             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3945             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_DeleteService_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3946             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_DeleteService_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3947             :         { NULL, NULL, 0, NULL }
    3948             : };
    3949             : 
    3950             : 
    3951             : static PyTypeObject svcctl_DeleteService_Type = {
    3952             :         PyVarObject_HEAD_INIT(NULL, 0)
    3953             :         .tp_name = "svcctl.DeleteService",
    3954             :         .tp_getset = py_svcctl_DeleteService_getsetters,
    3955             :         .tp_methods = py_svcctl_DeleteService_methods,
    3956             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3957             :         .tp_new = py_svcctl_DeleteService_new,
    3958             : };
    3959             : 
    3960           0 : static bool pack_py_svcctl_DeleteService_args_in(PyObject *args, PyObject *kwargs, struct svcctl_DeleteService *r)
    3961             : {
    3962             :         PyObject *py_handle;
    3963           0 :         const char *kwnames[] = {
    3964             :                 "handle", NULL
    3965             :         };
    3966             : 
    3967           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_DeleteService", discard_const_p(char *, kwnames), &py_handle)) {
    3968           0 :                 return false;
    3969             :         }
    3970             : 
    3971           0 :         if (py_handle == NULL) {
    3972           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    3973           0 :                 return false;
    3974             :         }
    3975           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    3976           0 :         if (r->in.handle == NULL) {
    3977           0 :                 PyErr_NoMemory();
    3978           0 :                 return false;
    3979             :         }
    3980           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    3981           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    3982           0 :                 PyErr_NoMemory();
    3983           0 :                 return false;
    3984             :         }
    3985           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    3986           0 :         return true;
    3987             : }
    3988             : 
    3989           0 : static PyObject *unpack_py_svcctl_DeleteService_args_out(struct svcctl_DeleteService *r)
    3990             : {
    3991             :         PyObject *result;
    3992           0 :         result = Py_None;
    3993           0 :         Py_INCREF(result);
    3994           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    3995           0 :                 PyErr_SetWERROR(r->out.result);
    3996           0 :                 return NULL;
    3997             :         }
    3998             : 
    3999           0 :         return result;
    4000             : }
    4001             : 
    4002             : 
    4003           0 : static PyObject *py_svcctl_LockServiceDatabase_in_get_handle(PyObject *obj, void *closure)
    4004             : {
    4005           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
    4006             :         PyObject *py_handle;
    4007           0 :         if (object->in.handle == NULL) {
    4008           0 :                 Py_RETURN_NONE;
    4009             :         }
    4010           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    4011           0 :         return py_handle;
    4012             : }
    4013             : 
    4014           0 : static int py_svcctl_LockServiceDatabase_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    4015             : {
    4016           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
    4017           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    4018           0 :         if (value == NULL) {
    4019           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    4020           0 :                 return -1;
    4021             :         }
    4022           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    4023           0 :         if (object->in.handle == NULL) {
    4024           0 :                 PyErr_NoMemory();
    4025           0 :                 return -1;
    4026             :         }
    4027           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    4028           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4029           0 :                 PyErr_NoMemory();
    4030           0 :                 return -1;
    4031             :         }
    4032           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    4033           0 :         return 0;
    4034             : }
    4035             : 
    4036           0 : static PyObject *py_svcctl_LockServiceDatabase_out_get_lock(PyObject *obj, void *closure)
    4037             : {
    4038           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
    4039             :         PyObject *py_lock;
    4040           0 :         if (object->out.lock == NULL) {
    4041           0 :                 Py_RETURN_NONE;
    4042             :         }
    4043           0 :         py_lock = pytalloc_reference_ex(policy_handle_Type, object->out.lock, object->out.lock);
    4044           0 :         return py_lock;
    4045             : }
    4046             : 
    4047           0 : static int py_svcctl_LockServiceDatabase_out_set_lock(PyObject *py_obj, PyObject *value, void *closure)
    4048             : {
    4049           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
    4050           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock));
    4051           0 :         if (value == NULL) {
    4052           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock");
    4053           0 :                 return -1;
    4054             :         }
    4055           0 :         object->out.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock);
    4056           0 :         if (object->out.lock == NULL) {
    4057           0 :                 PyErr_NoMemory();
    4058           0 :                 return -1;
    4059             :         }
    4060           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    4061           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4062           0 :                 PyErr_NoMemory();
    4063           0 :                 return -1;
    4064             :         }
    4065           0 :         object->out.lock = (struct policy_handle *)pytalloc_get_ptr(value);
    4066           0 :         return 0;
    4067             : }
    4068             : 
    4069           0 : static PyObject *py_svcctl_LockServiceDatabase_get_result(PyObject *obj, void *closure)
    4070             : {
    4071           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
    4072             :         PyObject *py_result;
    4073           0 :         py_result = PyErr_FromWERROR(object->out.result);
    4074           0 :         return py_result;
    4075             : }
    4076             : 
    4077           0 : static int py_svcctl_LockServiceDatabase_set_result(PyObject *py_obj, PyObject *value, void *closure)
    4078             : {
    4079           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
    4080           0 :         if (value == NULL) {
    4081           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    4082           0 :                 return -1;
    4083             :         }
    4084           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    4085           0 :         return 0;
    4086             : }
    4087             : 
    4088             : static PyGetSetDef py_svcctl_LockServiceDatabase_getsetters[] = {
    4089             :         {
    4090             :                 .name = discard_const_p(char, "in_handle"),
    4091             :                 .get = py_svcctl_LockServiceDatabase_in_get_handle,
    4092             :                 .set = py_svcctl_LockServiceDatabase_in_set_handle,
    4093             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    4094             :         },
    4095             :         {
    4096             :                 .name = discard_const_p(char, "out_lock"),
    4097             :                 .get = py_svcctl_LockServiceDatabase_out_get_lock,
    4098             :                 .set = py_svcctl_LockServiceDatabase_out_set_lock,
    4099             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    4100             :         },
    4101             :         {
    4102             :                 .name = discard_const_p(char, "result"),
    4103             :                 .get = py_svcctl_LockServiceDatabase_get_result,
    4104             :                 .set = py_svcctl_LockServiceDatabase_set_result,
    4105             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    4106             :         },
    4107             :         { .name = NULL }
    4108             : };
    4109             : 
    4110           0 : static PyObject *py_svcctl_LockServiceDatabase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4111             : {
    4112           0 :         PyObject *self = pytalloc_new(struct svcctl_LockServiceDatabase, type);
    4113           0 :         struct svcctl_LockServiceDatabase *_self = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(self);
    4114           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    4115           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    4116           0 :         _self->out.lock = talloc_zero(mem_ctx, struct policy_handle);
    4117           0 :         return self;
    4118             : }
    4119             : 
    4120           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    4121             : {
    4122             : 
    4123             : 
    4124           0 :         return PyLong_FromLong(3);
    4125             : }
    4126             : 
    4127           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    4128             : {
    4129           0 :         const struct ndr_interface_call *call = NULL;
    4130           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
    4131           0 :         PyObject *ret = NULL;
    4132           0 :         struct ndr_push *push = NULL;
    4133             :         DATA_BLOB blob;
    4134             :         enum ndr_err_code err;
    4135             : 
    4136           0 :         if (ndr_table_svcctl.num_calls < 4) {
    4137           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_pack");
    4138           0 :                 return NULL;
    4139             :         }
    4140           0 :         call = &ndr_table_svcctl.calls[3];
    4141             : 
    4142           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    4143           0 :         if (push == NULL) {
    4144           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4145           0 :                 return NULL;
    4146             :         }
    4147             : 
    4148           0 :         push->flags |= ndr_push_flags;
    4149             : 
    4150           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    4151           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4152           0 :                 TALLOC_FREE(push);
    4153           0 :                 PyErr_SetNdrError(err);
    4154           0 :                 return NULL;
    4155             :         }
    4156           0 :         blob = ndr_push_blob(push);
    4157           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4158           0 :         TALLOC_FREE(push);
    4159           0 :         return ret;
    4160             : }
    4161             : 
    4162           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4163             : {
    4164           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4165           0 :         PyObject *bigendian_obj = NULL;
    4166           0 :         PyObject *ndr64_obj = NULL;
    4167           0 :         uint32_t ndr_push_flags = 0;
    4168             : 
    4169           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    4170             :                 discard_const_p(char *, kwnames),
    4171             :                 &bigendian_obj,
    4172             :                 &ndr64_obj)) {
    4173           0 :                 return NULL;
    4174             :         }
    4175             : 
    4176           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4177           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4178             :         }
    4179           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4180           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4181             :         }
    4182             : 
    4183           0 :         return py_svcctl_LockServiceDatabase_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    4184             : }
    4185             : 
    4186           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4187             : {
    4188           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4189           0 :         PyObject *bigendian_obj = NULL;
    4190           0 :         PyObject *ndr64_obj = NULL;
    4191           0 :         uint32_t ndr_push_flags = 0;
    4192             : 
    4193           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    4194             :                 discard_const_p(char *, kwnames),
    4195             :                 &bigendian_obj,
    4196             :                 &ndr64_obj)) {
    4197           0 :                 return NULL;
    4198             :         }
    4199             : 
    4200           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4201           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4202             :         }
    4203           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4204           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4205             :         }
    4206             : 
    4207           0 :         return py_svcctl_LockServiceDatabase_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4208             : }
    4209             : 
    4210           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    4211             : {
    4212           0 :         const struct ndr_interface_call *call = NULL;
    4213           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
    4214           0 :         struct ndr_pull *pull = NULL;
    4215             :         enum ndr_err_code err;
    4216             : 
    4217           0 :         if (ndr_table_svcctl.num_calls < 4) {
    4218           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_unpack");
    4219           0 :                 return NULL;
    4220             :         }
    4221           0 :         call = &ndr_table_svcctl.calls[3];
    4222             : 
    4223           0 :         pull = ndr_pull_init_blob(blob, object);
    4224           0 :         if (pull == NULL) {
    4225           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4226           0 :                 return NULL;
    4227             :         }
    4228             : 
    4229           0 :         pull->flags |= ndr_pull_flags;
    4230             : 
    4231           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4232           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4233           0 :                 TALLOC_FREE(pull);
    4234           0 :                 PyErr_SetNdrError(err);
    4235           0 :                 return NULL;
    4236             :         }
    4237           0 :         if (!allow_remaining) {
    4238             :                 uint32_t highest_ofs;
    4239             : 
    4240           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4241           0 :                         highest_ofs = pull->offset;
    4242             :                 } else {
    4243           0 :                         highest_ofs = pull->relative_highest_offset;
    4244             :                 }
    4245           0 :                 if (highest_ofs < pull->data_size) {
    4246           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4247             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4248             :                                 highest_ofs, pull->data_size);
    4249           0 :                         TALLOC_FREE(pull);
    4250           0 :                         PyErr_SetNdrError(err);
    4251           0 :                         return NULL;
    4252             :                 }
    4253             :         }
    4254             : 
    4255           0 :         TALLOC_FREE(pull);
    4256           0 :         Py_RETURN_NONE;
    4257             : }
    4258             : 
    4259           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4260             : {
    4261             :         DATA_BLOB blob;
    4262           0 :         Py_ssize_t blob_length = 0;
    4263           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4264           0 :         PyObject *bigendian_obj = NULL;
    4265           0 :         PyObject *ndr64_obj = NULL;
    4266           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4267           0 :         PyObject *allow_remaining_obj = NULL;
    4268           0 :         bool allow_remaining = false;
    4269             : 
    4270           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4271             :                 discard_const_p(char *, kwnames),
    4272             :                 &blob.data, &blob_length,
    4273             :                 &bigendian_obj,
    4274             :                 &ndr64_obj,
    4275             :                 &allow_remaining_obj)) {
    4276           0 :                 return NULL;
    4277             :         }
    4278           0 :         blob.length = blob_length;
    4279             : 
    4280           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4281           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4282             :         }
    4283           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4284           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4285             :         }
    4286             : 
    4287           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4288           0 :                 allow_remaining = true;
    4289             :         }
    4290             : 
    4291           0 :         return py_svcctl_LockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4292             : }
    4293             : 
    4294           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4295             : {
    4296             :         DATA_BLOB blob;
    4297           0 :         Py_ssize_t blob_length = 0;
    4298           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4299           0 :         PyObject *bigendian_obj = NULL;
    4300           0 :         PyObject *ndr64_obj = NULL;
    4301           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4302           0 :         PyObject *allow_remaining_obj = NULL;
    4303           0 :         bool allow_remaining = false;
    4304             : 
    4305           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4306             :                 discard_const_p(char *, kwnames),
    4307             :                 &blob.data, &blob_length,
    4308             :                 &bigendian_obj,
    4309             :                 &ndr64_obj,
    4310             :                 &allow_remaining_obj)) {
    4311           0 :                 return NULL;
    4312             :         }
    4313           0 :         blob.length = blob_length;
    4314             : 
    4315           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4316           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4317             :         }
    4318           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4319           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4320             :         }
    4321             : 
    4322           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4323           0 :                 allow_remaining = true;
    4324             :         }
    4325             : 
    4326           0 :         return py_svcctl_LockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4327             : }
    4328             : 
    4329           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    4330             : {
    4331           0 :         const struct ndr_interface_call *call = NULL;
    4332           0 :         struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
    4333             :         PyObject *ret;
    4334             :         char *retstr;
    4335             : 
    4336           0 :         if (ndr_table_svcctl.num_calls < 4) {
    4337           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_print");
    4338           0 :                 return NULL;
    4339             :         }
    4340           0 :         call = &ndr_table_svcctl.calls[3];
    4341             : 
    4342           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    4343           0 :         ret = PyUnicode_FromString(retstr);
    4344           0 :         TALLOC_FREE(retstr);
    4345             : 
    4346           0 :         return ret;
    4347             : }
    4348             : 
    4349           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4350             : {
    4351           0 :         return py_svcctl_LockServiceDatabase_ndr_print(py_obj, "svcctl_LockServiceDatabase_in", NDR_IN);
    4352             : }
    4353             : 
    4354           0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4355             : {
    4356           0 :         return py_svcctl_LockServiceDatabase_ndr_print(py_obj, "svcctl_LockServiceDatabase_out", NDR_OUT);
    4357             : }
    4358             : 
    4359             : static PyMethodDef py_svcctl_LockServiceDatabase_methods[] = {
    4360             :         { "opnum", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_opnum, METH_NOARGS|METH_CLASS,
    4361             :                 "svcctl.LockServiceDatabase.opnum() -> 3 (0x03) " },
    4362             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    4363             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    4364             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    4365             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    4366             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    4367             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    4368             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    4369             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    4370             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    4371             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    4372             :         { NULL, NULL, 0, NULL }
    4373             : };
    4374             : 
    4375             : 
    4376             : static PyTypeObject svcctl_LockServiceDatabase_Type = {
    4377             :         PyVarObject_HEAD_INIT(NULL, 0)
    4378             :         .tp_name = "svcctl.LockServiceDatabase",
    4379             :         .tp_getset = py_svcctl_LockServiceDatabase_getsetters,
    4380             :         .tp_methods = py_svcctl_LockServiceDatabase_methods,
    4381             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4382             :         .tp_new = py_svcctl_LockServiceDatabase_new,
    4383             : };
    4384             : 
    4385           0 : static bool pack_py_svcctl_LockServiceDatabase_args_in(PyObject *args, PyObject *kwargs, struct svcctl_LockServiceDatabase *r)
    4386             : {
    4387             :         PyObject *py_handle;
    4388           0 :         const char *kwnames[] = {
    4389             :                 "handle", NULL
    4390             :         };
    4391             : 
    4392           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_LockServiceDatabase", discard_const_p(char *, kwnames), &py_handle)) {
    4393           0 :                 return false;
    4394             :         }
    4395             : 
    4396           0 :         if (py_handle == NULL) {
    4397           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    4398           0 :                 return false;
    4399             :         }
    4400           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    4401           0 :         if (r->in.handle == NULL) {
    4402           0 :                 PyErr_NoMemory();
    4403           0 :                 return false;
    4404             :         }
    4405           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    4406           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    4407           0 :                 PyErr_NoMemory();
    4408           0 :                 return false;
    4409             :         }
    4410           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    4411           0 :         return true;
    4412             : }
    4413             : 
    4414           0 : static PyObject *unpack_py_svcctl_LockServiceDatabase_args_out(struct svcctl_LockServiceDatabase *r)
    4415             : {
    4416             :         PyObject *result;
    4417             :         PyObject *py_lock;
    4418           0 :         py_lock = pytalloc_reference_ex(policy_handle_Type, r->out.lock, r->out.lock);
    4419           0 :         result = py_lock;
    4420           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    4421           0 :                 PyErr_SetWERROR(r->out.result);
    4422           0 :                 return NULL;
    4423             :         }
    4424             : 
    4425           0 :         return result;
    4426             : }
    4427             : 
    4428             : 
    4429           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_handle(PyObject *obj, void *closure)
    4430             : {
    4431           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
    4432             :         PyObject *py_handle;
    4433           0 :         if (object->in.handle == NULL) {
    4434           0 :                 Py_RETURN_NONE;
    4435             :         }
    4436           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    4437           0 :         return py_handle;
    4438             : }
    4439             : 
    4440           0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    4441             : {
    4442           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4443           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    4444           0 :         if (value == NULL) {
    4445           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    4446           0 :                 return -1;
    4447             :         }
    4448           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    4449           0 :         if (object->in.handle == NULL) {
    4450           0 :                 PyErr_NoMemory();
    4451           0 :                 return -1;
    4452             :         }
    4453           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    4454           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4455           0 :                 PyErr_NoMemory();
    4456           0 :                 return -1;
    4457             :         }
    4458           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    4459           0 :         return 0;
    4460             : }
    4461             : 
    4462           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_security_flags(PyObject *obj, void *closure)
    4463             : {
    4464           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
    4465             :         PyObject *py_security_flags;
    4466           0 :         py_security_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.security_flags);
    4467           0 :         return py_security_flags;
    4468             : }
    4469             : 
    4470           0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_security_flags(PyObject *py_obj, PyObject *value, void *closure)
    4471             : {
    4472           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4473           0 :         if (value == NULL) {
    4474           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.security_flags");
    4475           0 :                 return -1;
    4476             :         }
    4477             :         {
    4478           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.security_flags));
    4479           0 :                 if (PyLong_Check(value)) {
    4480             :                         unsigned long long test_var;
    4481           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4482           0 :                         if (PyErr_Occurred() != NULL) {
    4483           0 :                                 return -1;
    4484             :                         }
    4485           0 :                         if (test_var > uint_max) {
    4486           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4487             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4488           0 :                                 return -1;
    4489             :                         }
    4490           0 :                         object->in.security_flags = test_var;
    4491             :                 } else {
    4492           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4493             :                           PyLong_Type.tp_name);
    4494           0 :                         return -1;
    4495             :                 }
    4496             :         }
    4497           0 :         return 0;
    4498             : }
    4499             : 
    4500           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_out_get_buffer(PyObject *obj, void *closure)
    4501             : {
    4502           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
    4503             :         PyObject *py_buffer;
    4504           0 :         if (object->out.buffer == NULL) {
    4505           0 :                 Py_RETURN_NONE;
    4506             :         }
    4507           0 :         py_buffer = PyList_New(object->in.offered);
    4508           0 :         if (py_buffer == NULL) {
    4509           0 :                 return NULL;
    4510             :         }
    4511             :         {
    4512             :                 int buffer_cntr_1;
    4513           0 :                 for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
    4514             :                         PyObject *py_buffer_1;
    4515           0 :                         py_buffer_1 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_1]);
    4516           0 :                         PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
    4517             :                 }
    4518             :         }
    4519           0 :         return py_buffer;
    4520             : }
    4521             : 
    4522           0 : static int py_svcctl_QueryServiceObjectSecurity_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
    4523             : {
    4524           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4525           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
    4526           0 :         if (value == NULL) {
    4527           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
    4528           0 :                 return -1;
    4529             :         }
    4530           0 :         object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
    4531           0 :         if (object->out.buffer == NULL) {
    4532           0 :                 PyErr_NoMemory();
    4533           0 :                 return -1;
    4534             :         }
    4535           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4536             :         {
    4537             :                 int buffer_cntr_1;
    4538           0 :                 object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
    4539           0 :                 if (!object->out.buffer) { return -1;; }
    4540           0 :                 talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
    4541           0 :                 for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
    4542           0 :                         if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
    4543           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_1]");
    4544           0 :                                 return -1;
    4545             :                         }
    4546             :                         {
    4547           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_1]));
    4548           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
    4549             :                                         unsigned long long test_var;
    4550           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
    4551           0 :                                         if (PyErr_Occurred() != NULL) {
    4552           0 :                                                 return -1;
    4553             :                                         }
    4554           0 :                                         if (test_var > uint_max) {
    4555           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4556             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    4557           0 :                                                 return -1;
    4558             :                                         }
    4559           0 :                                         object->out.buffer[buffer_cntr_1] = test_var;
    4560             :                                 } else {
    4561           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4562             :                                           PyLong_Type.tp_name);
    4563           0 :                                         return -1;
    4564             :                                 }
    4565             :                         }
    4566             :                 }
    4567             :         }
    4568           0 :         return 0;
    4569             : }
    4570             : 
    4571           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_offered(PyObject *obj, void *closure)
    4572             : {
    4573           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
    4574             :         PyObject *py_offered;
    4575           0 :         py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
    4576           0 :         return py_offered;
    4577             : }
    4578             : 
    4579           0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
    4580             : {
    4581           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4582           0 :         if (value == NULL) {
    4583           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
    4584           0 :                 return -1;
    4585             :         }
    4586             :         {
    4587           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
    4588           0 :                 if (PyLong_Check(value)) {
    4589             :                         unsigned long long test_var;
    4590           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4591           0 :                         if (PyErr_Occurred() != NULL) {
    4592           0 :                                 return -1;
    4593             :                         }
    4594           0 :                         if (test_var > uint_max) {
    4595           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4596             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4597           0 :                                 return -1;
    4598             :                         }
    4599           0 :                         object->in.offered = test_var;
    4600             :                 } else {
    4601           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4602             :                           PyLong_Type.tp_name);
    4603           0 :                         return -1;
    4604             :                 }
    4605             :         }
    4606           0 :         return 0;
    4607             : }
    4608             : 
    4609           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_out_get_needed(PyObject *obj, void *closure)
    4610             : {
    4611           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
    4612             :         PyObject *py_needed;
    4613           0 :         if (object->out.needed == NULL) {
    4614           0 :                 Py_RETURN_NONE;
    4615             :         }
    4616           0 :         py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
    4617           0 :         return py_needed;
    4618             : }
    4619             : 
    4620           0 : static int py_svcctl_QueryServiceObjectSecurity_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
    4621             : {
    4622           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4623           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
    4624           0 :         if (value == NULL) {
    4625           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
    4626           0 :                 return -1;
    4627             :         }
    4628           0 :         object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
    4629           0 :         if (object->out.needed == NULL) {
    4630           0 :                 PyErr_NoMemory();
    4631           0 :                 return -1;
    4632             :         }
    4633             :         {
    4634           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
    4635           0 :                 if (PyLong_Check(value)) {
    4636             :                         unsigned long long test_var;
    4637           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4638           0 :                         if (PyErr_Occurred() != NULL) {
    4639           0 :                                 return -1;
    4640             :                         }
    4641           0 :                         if (test_var > uint_max) {
    4642           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4643             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4644           0 :                                 return -1;
    4645             :                         }
    4646           0 :                         *object->out.needed = test_var;
    4647             :                 } else {
    4648           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4649             :                           PyLong_Type.tp_name);
    4650           0 :                         return -1;
    4651             :                 }
    4652             :         }
    4653           0 :         return 0;
    4654             : }
    4655             : 
    4656           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_get_result(PyObject *obj, void *closure)
    4657             : {
    4658           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
    4659             :         PyObject *py_result;
    4660           0 :         py_result = PyErr_FromWERROR(object->out.result);
    4661           0 :         return py_result;
    4662             : }
    4663             : 
    4664           0 : static int py_svcctl_QueryServiceObjectSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
    4665             : {
    4666           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4667           0 :         if (value == NULL) {
    4668           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    4669           0 :                 return -1;
    4670             :         }
    4671           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    4672           0 :         return 0;
    4673             : }
    4674             : 
    4675             : static PyGetSetDef py_svcctl_QueryServiceObjectSecurity_getsetters[] = {
    4676             :         {
    4677             :                 .name = discard_const_p(char, "in_handle"),
    4678             :                 .get = py_svcctl_QueryServiceObjectSecurity_in_get_handle,
    4679             :                 .set = py_svcctl_QueryServiceObjectSecurity_in_set_handle,
    4680             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    4681             :         },
    4682             :         {
    4683             :                 .name = discard_const_p(char, "in_security_flags"),
    4684             :                 .get = py_svcctl_QueryServiceObjectSecurity_in_get_security_flags,
    4685             :                 .set = py_svcctl_QueryServiceObjectSecurity_in_set_security_flags,
    4686             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
    4687             :         },
    4688             :         {
    4689             :                 .name = discard_const_p(char, "out_buffer"),
    4690             :                 .get = py_svcctl_QueryServiceObjectSecurity_out_get_buffer,
    4691             :                 .set = py_svcctl_QueryServiceObjectSecurity_out_set_buffer,
    4692             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4693             :         },
    4694             :         {
    4695             :                 .name = discard_const_p(char, "in_offered"),
    4696             :                 .get = py_svcctl_QueryServiceObjectSecurity_in_get_offered,
    4697             :                 .set = py_svcctl_QueryServiceObjectSecurity_in_set_offered,
    4698             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4699             :         },
    4700             :         {
    4701             :                 .name = discard_const_p(char, "out_needed"),
    4702             :                 .get = py_svcctl_QueryServiceObjectSecurity_out_get_needed,
    4703             :                 .set = py_svcctl_QueryServiceObjectSecurity_out_set_needed,
    4704             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4705             :         },
    4706             :         {
    4707             :                 .name = discard_const_p(char, "result"),
    4708             :                 .get = py_svcctl_QueryServiceObjectSecurity_get_result,
    4709             :                 .set = py_svcctl_QueryServiceObjectSecurity_set_result,
    4710             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    4711             :         },
    4712             :         { .name = NULL }
    4713             : };
    4714             : 
    4715           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4716             : {
    4717           0 :         PyObject *self = pytalloc_new(struct svcctl_QueryServiceObjectSecurity, type);
    4718           0 :         struct svcctl_QueryServiceObjectSecurity *_self = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(self);
    4719           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    4720           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    4721           0 :         _self->out.buffer = talloc_zero(mem_ctx, uint8_t);
    4722           0 :         _self->out.needed = talloc_zero(mem_ctx, uint32_t);
    4723           0 :         return self;
    4724             : }
    4725             : 
    4726           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    4727             : {
    4728             : 
    4729             : 
    4730           0 :         return PyLong_FromLong(4);
    4731             : }
    4732             : 
    4733           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    4734             : {
    4735           0 :         const struct ndr_interface_call *call = NULL;
    4736           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4737           0 :         PyObject *ret = NULL;
    4738           0 :         struct ndr_push *push = NULL;
    4739             :         DATA_BLOB blob;
    4740             :         enum ndr_err_code err;
    4741             : 
    4742           0 :         if (ndr_table_svcctl.num_calls < 5) {
    4743           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_pack");
    4744           0 :                 return NULL;
    4745             :         }
    4746           0 :         call = &ndr_table_svcctl.calls[4];
    4747             : 
    4748           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    4749           0 :         if (push == NULL) {
    4750           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4751           0 :                 return NULL;
    4752             :         }
    4753             : 
    4754           0 :         push->flags |= ndr_push_flags;
    4755             : 
    4756           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    4757           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4758           0 :                 TALLOC_FREE(push);
    4759           0 :                 PyErr_SetNdrError(err);
    4760           0 :                 return NULL;
    4761             :         }
    4762           0 :         blob = ndr_push_blob(push);
    4763           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4764           0 :         TALLOC_FREE(push);
    4765           0 :         return ret;
    4766             : }
    4767             : 
    4768           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4769             : {
    4770           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4771           0 :         PyObject *bigendian_obj = NULL;
    4772           0 :         PyObject *ndr64_obj = NULL;
    4773           0 :         uint32_t ndr_push_flags = 0;
    4774             : 
    4775           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    4776             :                 discard_const_p(char *, kwnames),
    4777             :                 &bigendian_obj,
    4778             :                 &ndr64_obj)) {
    4779           0 :                 return NULL;
    4780             :         }
    4781             : 
    4782           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4783           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4784             :         }
    4785           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4786           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4787             :         }
    4788             : 
    4789           0 :         return py_svcctl_QueryServiceObjectSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    4790             : }
    4791             : 
    4792           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4793             : {
    4794           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4795           0 :         PyObject *bigendian_obj = NULL;
    4796           0 :         PyObject *ndr64_obj = NULL;
    4797           0 :         uint32_t ndr_push_flags = 0;
    4798             : 
    4799           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    4800             :                 discard_const_p(char *, kwnames),
    4801             :                 &bigendian_obj,
    4802             :                 &ndr64_obj)) {
    4803           0 :                 return NULL;
    4804             :         }
    4805             : 
    4806           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4807           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4808             :         }
    4809           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4810           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4811             :         }
    4812             : 
    4813           0 :         return py_svcctl_QueryServiceObjectSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4814             : }
    4815             : 
    4816           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    4817             : {
    4818           0 :         const struct ndr_interface_call *call = NULL;
    4819           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4820           0 :         struct ndr_pull *pull = NULL;
    4821             :         enum ndr_err_code err;
    4822             : 
    4823           0 :         if (ndr_table_svcctl.num_calls < 5) {
    4824           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_unpack");
    4825           0 :                 return NULL;
    4826             :         }
    4827           0 :         call = &ndr_table_svcctl.calls[4];
    4828             : 
    4829           0 :         pull = ndr_pull_init_blob(blob, object);
    4830           0 :         if (pull == NULL) {
    4831           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4832           0 :                 return NULL;
    4833             :         }
    4834             : 
    4835           0 :         pull->flags |= ndr_pull_flags;
    4836             : 
    4837           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4838           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4839           0 :                 TALLOC_FREE(pull);
    4840           0 :                 PyErr_SetNdrError(err);
    4841           0 :                 return NULL;
    4842             :         }
    4843           0 :         if (!allow_remaining) {
    4844             :                 uint32_t highest_ofs;
    4845             : 
    4846           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4847           0 :                         highest_ofs = pull->offset;
    4848             :                 } else {
    4849           0 :                         highest_ofs = pull->relative_highest_offset;
    4850             :                 }
    4851           0 :                 if (highest_ofs < pull->data_size) {
    4852           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4853             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4854             :                                 highest_ofs, pull->data_size);
    4855           0 :                         TALLOC_FREE(pull);
    4856           0 :                         PyErr_SetNdrError(err);
    4857           0 :                         return NULL;
    4858             :                 }
    4859             :         }
    4860             : 
    4861           0 :         TALLOC_FREE(pull);
    4862           0 :         Py_RETURN_NONE;
    4863             : }
    4864             : 
    4865           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4866             : {
    4867             :         DATA_BLOB blob;
    4868           0 :         Py_ssize_t blob_length = 0;
    4869           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4870           0 :         PyObject *bigendian_obj = NULL;
    4871           0 :         PyObject *ndr64_obj = NULL;
    4872           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4873           0 :         PyObject *allow_remaining_obj = NULL;
    4874           0 :         bool allow_remaining = false;
    4875             : 
    4876           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4877             :                 discard_const_p(char *, kwnames),
    4878             :                 &blob.data, &blob_length,
    4879             :                 &bigendian_obj,
    4880             :                 &ndr64_obj,
    4881             :                 &allow_remaining_obj)) {
    4882           0 :                 return NULL;
    4883             :         }
    4884           0 :         blob.length = blob_length;
    4885             : 
    4886           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4887           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4888             :         }
    4889           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4890           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4891             :         }
    4892             : 
    4893           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4894           0 :                 allow_remaining = true;
    4895             :         }
    4896             : 
    4897           0 :         return py_svcctl_QueryServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4898             : }
    4899             : 
    4900           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4901             : {
    4902             :         DATA_BLOB blob;
    4903           0 :         Py_ssize_t blob_length = 0;
    4904           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4905           0 :         PyObject *bigendian_obj = NULL;
    4906           0 :         PyObject *ndr64_obj = NULL;
    4907           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4908           0 :         PyObject *allow_remaining_obj = NULL;
    4909           0 :         bool allow_remaining = false;
    4910             : 
    4911           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4912             :                 discard_const_p(char *, kwnames),
    4913             :                 &blob.data, &blob_length,
    4914             :                 &bigendian_obj,
    4915             :                 &ndr64_obj,
    4916             :                 &allow_remaining_obj)) {
    4917           0 :                 return NULL;
    4918             :         }
    4919           0 :         blob.length = blob_length;
    4920             : 
    4921           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4922           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4923             :         }
    4924           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4925           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4926             :         }
    4927             : 
    4928           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4929           0 :                 allow_remaining = true;
    4930             :         }
    4931             : 
    4932           0 :         return py_svcctl_QueryServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4933             : }
    4934             : 
    4935           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    4936             : {
    4937           0 :         const struct ndr_interface_call *call = NULL;
    4938           0 :         struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    4939             :         PyObject *ret;
    4940             :         char *retstr;
    4941             : 
    4942           0 :         if (ndr_table_svcctl.num_calls < 5) {
    4943           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_print");
    4944           0 :                 return NULL;
    4945             :         }
    4946           0 :         call = &ndr_table_svcctl.calls[4];
    4947             : 
    4948           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    4949           0 :         ret = PyUnicode_FromString(retstr);
    4950           0 :         TALLOC_FREE(retstr);
    4951             : 
    4952           0 :         return ret;
    4953             : }
    4954             : 
    4955           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4956             : {
    4957           0 :         return py_svcctl_QueryServiceObjectSecurity_ndr_print(py_obj, "svcctl_QueryServiceObjectSecurity_in", NDR_IN);
    4958             : }
    4959             : 
    4960           0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4961             : {
    4962           0 :         return py_svcctl_QueryServiceObjectSecurity_ndr_print(py_obj, "svcctl_QueryServiceObjectSecurity_out", NDR_OUT);
    4963             : }
    4964             : 
    4965             : static PyMethodDef py_svcctl_QueryServiceObjectSecurity_methods[] = {
    4966             :         { "opnum", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
    4967             :                 "svcctl.QueryServiceObjectSecurity.opnum() -> 4 (0x04) " },
    4968             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    4969             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    4970             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    4971             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    4972             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    4973             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    4974             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    4975             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    4976             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    4977             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    4978             :         { NULL, NULL, 0, NULL }
    4979             : };
    4980             : 
    4981             : 
    4982             : static PyTypeObject svcctl_QueryServiceObjectSecurity_Type = {
    4983             :         PyVarObject_HEAD_INIT(NULL, 0)
    4984             :         .tp_name = "svcctl.QueryServiceObjectSecurity",
    4985             :         .tp_getset = py_svcctl_QueryServiceObjectSecurity_getsetters,
    4986             :         .tp_methods = py_svcctl_QueryServiceObjectSecurity_methods,
    4987             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4988             :         .tp_new = py_svcctl_QueryServiceObjectSecurity_new,
    4989             : };
    4990             : 
    4991           0 : static bool pack_py_svcctl_QueryServiceObjectSecurity_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceObjectSecurity *r)
    4992             : {
    4993             :         PyObject *py_handle;
    4994             :         PyObject *py_security_flags;
    4995             :         PyObject *py_offered;
    4996           0 :         const char *kwnames[] = {
    4997             :                 "handle", "security_flags", "offered", NULL
    4998             :         };
    4999             : 
    5000           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceObjectSecurity", discard_const_p(char *, kwnames), &py_handle, &py_security_flags, &py_offered)) {
    5001           0 :                 return false;
    5002             :         }
    5003             : 
    5004           0 :         if (py_handle == NULL) {
    5005           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    5006           0 :                 return false;
    5007             :         }
    5008           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    5009           0 :         if (r->in.handle == NULL) {
    5010           0 :                 PyErr_NoMemory();
    5011           0 :                 return false;
    5012             :         }
    5013           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    5014           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    5015           0 :                 PyErr_NoMemory();
    5016           0 :                 return false;
    5017             :         }
    5018           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    5019           0 :         if (py_security_flags == NULL) {
    5020           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.security_flags");
    5021           0 :                 return false;
    5022             :         }
    5023             :         {
    5024           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.security_flags));
    5025           0 :                 if (PyLong_Check(py_security_flags)) {
    5026             :                         unsigned long long test_var;
    5027           0 :                         test_var = PyLong_AsUnsignedLongLong(py_security_flags);
    5028           0 :                         if (PyErr_Occurred() != NULL) {
    5029           0 :                                 return false;
    5030             :                         }
    5031           0 :                         if (test_var > uint_max) {
    5032           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5033             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5034           0 :                                 return false;
    5035             :                         }
    5036           0 :                         r->in.security_flags = test_var;
    5037             :                 } else {
    5038           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5039             :                           PyLong_Type.tp_name);
    5040           0 :                         return false;
    5041             :                 }
    5042             :         }
    5043           0 :         if (py_offered == NULL) {
    5044           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
    5045           0 :                 return false;
    5046             :         }
    5047             :         {
    5048           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
    5049           0 :                 if (PyLong_Check(py_offered)) {
    5050             :                         unsigned long long test_var;
    5051           0 :                         test_var = PyLong_AsUnsignedLongLong(py_offered);
    5052           0 :                         if (PyErr_Occurred() != NULL) {
    5053           0 :                                 return false;
    5054             :                         }
    5055           0 :                         if (test_var > uint_max) {
    5056           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5057             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5058           0 :                                 return false;
    5059             :                         }
    5060           0 :                         r->in.offered = test_var;
    5061             :                 } else {
    5062           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5063             :                           PyLong_Type.tp_name);
    5064           0 :                         return false;
    5065             :                 }
    5066             :         }
    5067           0 :         return true;
    5068             : }
    5069             : 
    5070           0 : static PyObject *unpack_py_svcctl_QueryServiceObjectSecurity_args_out(struct svcctl_QueryServiceObjectSecurity *r)
    5071             : {
    5072             :         PyObject *result;
    5073             :         PyObject *py_buffer;
    5074             :         PyObject *py_needed;
    5075           0 :         result = PyTuple_New(2);
    5076           0 :         py_buffer = PyList_New(r->in.offered);
    5077           0 :         if (py_buffer == NULL) {
    5078           0 :                 return NULL;
    5079             :         }
    5080             :         {
    5081             :                 int buffer_cntr_1;
    5082           0 :                 for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
    5083             :                         PyObject *py_buffer_1;
    5084           0 :                         py_buffer_1 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_1]);
    5085           0 :                         PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
    5086             :                 }
    5087             :         }
    5088           0 :         PyTuple_SetItem(result, 0, py_buffer);
    5089           0 :         py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
    5090           0 :         PyTuple_SetItem(result, 1, py_needed);
    5091           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    5092           0 :                 PyErr_SetWERROR(r->out.result);
    5093           0 :                 return NULL;
    5094             :         }
    5095             : 
    5096           0 :         return result;
    5097             : }
    5098             : 
    5099             : 
    5100           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_handle(PyObject *obj, void *closure)
    5101             : {
    5102           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
    5103             :         PyObject *py_handle;
    5104           0 :         if (object->in.handle == NULL) {
    5105           0 :                 Py_RETURN_NONE;
    5106             :         }
    5107           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    5108           0 :         return py_handle;
    5109             : }
    5110             : 
    5111           0 : static int py_svcctl_SetServiceObjectSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    5112             : {
    5113           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5114           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    5115           0 :         if (value == NULL) {
    5116           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    5117           0 :                 return -1;
    5118             :         }
    5119           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    5120           0 :         if (object->in.handle == NULL) {
    5121           0 :                 PyErr_NoMemory();
    5122           0 :                 return -1;
    5123             :         }
    5124           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    5125           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5126           0 :                 PyErr_NoMemory();
    5127           0 :                 return -1;
    5128             :         }
    5129           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    5130           0 :         return 0;
    5131             : }
    5132             : 
    5133           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_security_flags(PyObject *obj, void *closure)
    5134             : {
    5135           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
    5136             :         PyObject *py_security_flags;
    5137           0 :         py_security_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.security_flags);
    5138           0 :         return py_security_flags;
    5139             : }
    5140             : 
    5141           0 : static int py_svcctl_SetServiceObjectSecurity_in_set_security_flags(PyObject *py_obj, PyObject *value, void *closure)
    5142             : {
    5143           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5144           0 :         if (value == NULL) {
    5145           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.security_flags");
    5146           0 :                 return -1;
    5147             :         }
    5148             :         {
    5149           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.security_flags));
    5150           0 :                 if (PyLong_Check(value)) {
    5151             :                         unsigned long long test_var;
    5152           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5153           0 :                         if (PyErr_Occurred() != NULL) {
    5154           0 :                                 return -1;
    5155             :                         }
    5156           0 :                         if (test_var > uint_max) {
    5157           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5158             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5159           0 :                                 return -1;
    5160             :                         }
    5161           0 :                         object->in.security_flags = test_var;
    5162             :                 } else {
    5163           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5164             :                           PyLong_Type.tp_name);
    5165           0 :                         return -1;
    5166             :                 }
    5167             :         }
    5168           0 :         return 0;
    5169             : }
    5170             : 
    5171           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_buffer(PyObject *obj, void *closure)
    5172             : {
    5173           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
    5174             :         PyObject *py_buffer;
    5175           0 :         if (object->in.buffer == NULL) {
    5176           0 :                 Py_RETURN_NONE;
    5177             :         }
    5178           0 :         py_buffer = PyList_New(object->in.offered);
    5179           0 :         if (py_buffer == NULL) {
    5180           0 :                 return NULL;
    5181             :         }
    5182             :         {
    5183             :                 int buffer_cntr_1;
    5184           0 :                 for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
    5185             :                         PyObject *py_buffer_1;
    5186           0 :                         py_buffer_1 = PyLong_FromLong((uint16_t)object->in.buffer[buffer_cntr_1]);
    5187           0 :                         PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
    5188             :                 }
    5189             :         }
    5190           0 :         return py_buffer;
    5191             : }
    5192             : 
    5193           0 : static int py_svcctl_SetServiceObjectSecurity_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
    5194             : {
    5195           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5196           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
    5197           0 :         if (value == NULL) {
    5198           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer");
    5199           0 :                 return -1;
    5200             :         }
    5201           0 :         object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
    5202           0 :         if (object->in.buffer == NULL) {
    5203           0 :                 PyErr_NoMemory();
    5204           0 :                 return -1;
    5205             :         }
    5206           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5207             :         {
    5208             :                 int buffer_cntr_1;
    5209           0 :                 object->in.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer, PyList_GET_SIZE(value));
    5210           0 :                 if (!object->in.buffer) { return -1;; }
    5211           0 :                 talloc_set_name_const(object->in.buffer, "ARRAY: object->in.buffer");
    5212           0 :                 for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
    5213           0 :                         if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
    5214           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer[buffer_cntr_1]");
    5215           0 :                                 return -1;
    5216             :                         }
    5217             :                         {
    5218           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffer[buffer_cntr_1]));
    5219           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
    5220             :                                         unsigned long long test_var;
    5221           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
    5222           0 :                                         if (PyErr_Occurred() != NULL) {
    5223           0 :                                                 return -1;
    5224             :                                         }
    5225           0 :                                         if (test_var > uint_max) {
    5226           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5227             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    5228           0 :                                                 return -1;
    5229             :                                         }
    5230           0 :                                         object->in.buffer[buffer_cntr_1] = test_var;
    5231             :                                 } else {
    5232           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5233             :                                           PyLong_Type.tp_name);
    5234           0 :                                         return -1;
    5235             :                                 }
    5236             :                         }
    5237             :                 }
    5238             :         }
    5239           0 :         return 0;
    5240             : }
    5241             : 
    5242           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_offered(PyObject *obj, void *closure)
    5243             : {
    5244           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
    5245             :         PyObject *py_offered;
    5246           0 :         py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
    5247           0 :         return py_offered;
    5248             : }
    5249             : 
    5250           0 : static int py_svcctl_SetServiceObjectSecurity_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
    5251             : {
    5252           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5253           0 :         if (value == NULL) {
    5254           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
    5255           0 :                 return -1;
    5256             :         }
    5257             :         {
    5258           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
    5259           0 :                 if (PyLong_Check(value)) {
    5260             :                         unsigned long long test_var;
    5261           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5262           0 :                         if (PyErr_Occurred() != NULL) {
    5263           0 :                                 return -1;
    5264             :                         }
    5265           0 :                         if (test_var > uint_max) {
    5266           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5267             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5268           0 :                                 return -1;
    5269             :                         }
    5270           0 :                         object->in.offered = test_var;
    5271             :                 } else {
    5272           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5273             :                           PyLong_Type.tp_name);
    5274           0 :                         return -1;
    5275             :                 }
    5276             :         }
    5277           0 :         return 0;
    5278             : }
    5279             : 
    5280           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_get_result(PyObject *obj, void *closure)
    5281             : {
    5282           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
    5283             :         PyObject *py_result;
    5284           0 :         py_result = PyErr_FromWERROR(object->out.result);
    5285           0 :         return py_result;
    5286             : }
    5287             : 
    5288           0 : static int py_svcctl_SetServiceObjectSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5289             : {
    5290           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5291           0 :         if (value == NULL) {
    5292           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    5293           0 :                 return -1;
    5294             :         }
    5295           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    5296           0 :         return 0;
    5297             : }
    5298             : 
    5299             : static PyGetSetDef py_svcctl_SetServiceObjectSecurity_getsetters[] = {
    5300             :         {
    5301             :                 .name = discard_const_p(char, "in_handle"),
    5302             :                 .get = py_svcctl_SetServiceObjectSecurity_in_get_handle,
    5303             :                 .set = py_svcctl_SetServiceObjectSecurity_in_set_handle,
    5304             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    5305             :         },
    5306             :         {
    5307             :                 .name = discard_const_p(char, "in_security_flags"),
    5308             :                 .get = py_svcctl_SetServiceObjectSecurity_in_get_security_flags,
    5309             :                 .set = py_svcctl_SetServiceObjectSecurity_in_set_security_flags,
    5310             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
    5311             :         },
    5312             :         {
    5313             :                 .name = discard_const_p(char, "in_buffer"),
    5314             :                 .get = py_svcctl_SetServiceObjectSecurity_in_get_buffer,
    5315             :                 .set = py_svcctl_SetServiceObjectSecurity_in_set_buffer,
    5316             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    5317             :         },
    5318             :         {
    5319             :                 .name = discard_const_p(char, "in_offered"),
    5320             :                 .get = py_svcctl_SetServiceObjectSecurity_in_get_offered,
    5321             :                 .set = py_svcctl_SetServiceObjectSecurity_in_set_offered,
    5322             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5323             :         },
    5324             :         {
    5325             :                 .name = discard_const_p(char, "result"),
    5326             :                 .get = py_svcctl_SetServiceObjectSecurity_get_result,
    5327             :                 .set = py_svcctl_SetServiceObjectSecurity_set_result,
    5328             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    5329             :         },
    5330             :         { .name = NULL }
    5331             : };
    5332             : 
    5333           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5334             : {
    5335           0 :         PyObject *self = pytalloc_new(struct svcctl_SetServiceObjectSecurity, type);
    5336           0 :         struct svcctl_SetServiceObjectSecurity *_self = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(self);
    5337           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    5338           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    5339           0 :         _self->in.buffer = talloc_zero(mem_ctx, uint8_t);
    5340           0 :         return self;
    5341             : }
    5342             : 
    5343           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5344             : {
    5345             : 
    5346             : 
    5347           0 :         return PyLong_FromLong(5);
    5348             : }
    5349             : 
    5350           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    5351             : {
    5352           0 :         const struct ndr_interface_call *call = NULL;
    5353           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5354           0 :         PyObject *ret = NULL;
    5355           0 :         struct ndr_push *push = NULL;
    5356             :         DATA_BLOB blob;
    5357             :         enum ndr_err_code err;
    5358             : 
    5359           0 :         if (ndr_table_svcctl.num_calls < 6) {
    5360           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_pack");
    5361           0 :                 return NULL;
    5362             :         }
    5363           0 :         call = &ndr_table_svcctl.calls[5];
    5364             : 
    5365           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5366           0 :         if (push == NULL) {
    5367           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5368           0 :                 return NULL;
    5369             :         }
    5370             : 
    5371           0 :         push->flags |= ndr_push_flags;
    5372             : 
    5373           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5374           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5375           0 :                 TALLOC_FREE(push);
    5376           0 :                 PyErr_SetNdrError(err);
    5377           0 :                 return NULL;
    5378             :         }
    5379           0 :         blob = ndr_push_blob(push);
    5380           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5381           0 :         TALLOC_FREE(push);
    5382           0 :         return ret;
    5383             : }
    5384             : 
    5385           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5386             : {
    5387           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5388           0 :         PyObject *bigendian_obj = NULL;
    5389           0 :         PyObject *ndr64_obj = NULL;
    5390           0 :         uint32_t ndr_push_flags = 0;
    5391             : 
    5392           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5393             :                 discard_const_p(char *, kwnames),
    5394             :                 &bigendian_obj,
    5395             :                 &ndr64_obj)) {
    5396           0 :                 return NULL;
    5397             :         }
    5398             : 
    5399           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5400           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5401             :         }
    5402           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5403           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5404             :         }
    5405             : 
    5406           0 :         return py_svcctl_SetServiceObjectSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5407             : }
    5408             : 
    5409           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5410             : {
    5411           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5412           0 :         PyObject *bigendian_obj = NULL;
    5413           0 :         PyObject *ndr64_obj = NULL;
    5414           0 :         uint32_t ndr_push_flags = 0;
    5415             : 
    5416           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5417             :                 discard_const_p(char *, kwnames),
    5418             :                 &bigendian_obj,
    5419             :                 &ndr64_obj)) {
    5420           0 :                 return NULL;
    5421             :         }
    5422             : 
    5423           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5424           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5425             :         }
    5426           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5427           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5428             :         }
    5429             : 
    5430           0 :         return py_svcctl_SetServiceObjectSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5431             : }
    5432             : 
    5433           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    5434             : {
    5435           0 :         const struct ndr_interface_call *call = NULL;
    5436           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5437           0 :         struct ndr_pull *pull = NULL;
    5438             :         enum ndr_err_code err;
    5439             : 
    5440           0 :         if (ndr_table_svcctl.num_calls < 6) {
    5441           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_unpack");
    5442           0 :                 return NULL;
    5443             :         }
    5444           0 :         call = &ndr_table_svcctl.calls[5];
    5445             : 
    5446           0 :         pull = ndr_pull_init_blob(blob, object);
    5447           0 :         if (pull == NULL) {
    5448           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5449           0 :                 return NULL;
    5450             :         }
    5451             : 
    5452           0 :         pull->flags |= ndr_pull_flags;
    5453             : 
    5454           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    5455           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5456           0 :                 TALLOC_FREE(pull);
    5457           0 :                 PyErr_SetNdrError(err);
    5458           0 :                 return NULL;
    5459             :         }
    5460           0 :         if (!allow_remaining) {
    5461             :                 uint32_t highest_ofs;
    5462             : 
    5463           0 :                 if (pull->offset > pull->relative_highest_offset) {
    5464           0 :                         highest_ofs = pull->offset;
    5465             :                 } else {
    5466           0 :                         highest_ofs = pull->relative_highest_offset;
    5467             :                 }
    5468           0 :                 if (highest_ofs < pull->data_size) {
    5469           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    5470             :                                 "not all bytes consumed ofs[%u] size[%u]",
    5471             :                                 highest_ofs, pull->data_size);
    5472           0 :                         TALLOC_FREE(pull);
    5473           0 :                         PyErr_SetNdrError(err);
    5474           0 :                         return NULL;
    5475             :                 }
    5476             :         }
    5477             : 
    5478           0 :         TALLOC_FREE(pull);
    5479           0 :         Py_RETURN_NONE;
    5480             : }
    5481             : 
    5482           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5483             : {
    5484             :         DATA_BLOB blob;
    5485           0 :         Py_ssize_t blob_length = 0;
    5486           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5487           0 :         PyObject *bigendian_obj = NULL;
    5488           0 :         PyObject *ndr64_obj = NULL;
    5489           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5490           0 :         PyObject *allow_remaining_obj = NULL;
    5491           0 :         bool allow_remaining = false;
    5492             : 
    5493           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    5494             :                 discard_const_p(char *, kwnames),
    5495             :                 &blob.data, &blob_length,
    5496             :                 &bigendian_obj,
    5497             :                 &ndr64_obj,
    5498             :                 &allow_remaining_obj)) {
    5499           0 :                 return NULL;
    5500             :         }
    5501           0 :         blob.length = blob_length;
    5502             : 
    5503           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5504           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5505             :         }
    5506           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5507           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5508             :         }
    5509             : 
    5510           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5511           0 :                 allow_remaining = true;
    5512             :         }
    5513             : 
    5514           0 :         return py_svcctl_SetServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    5515             : }
    5516             : 
    5517           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5518             : {
    5519             :         DATA_BLOB blob;
    5520           0 :         Py_ssize_t blob_length = 0;
    5521           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5522           0 :         PyObject *bigendian_obj = NULL;
    5523           0 :         PyObject *ndr64_obj = NULL;
    5524           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5525           0 :         PyObject *allow_remaining_obj = NULL;
    5526           0 :         bool allow_remaining = false;
    5527             : 
    5528           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    5529             :                 discard_const_p(char *, kwnames),
    5530             :                 &blob.data, &blob_length,
    5531             :                 &bigendian_obj,
    5532             :                 &ndr64_obj,
    5533             :                 &allow_remaining_obj)) {
    5534           0 :                 return NULL;
    5535             :         }
    5536           0 :         blob.length = blob_length;
    5537             : 
    5538           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5539           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5540             :         }
    5541           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5542           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5543             :         }
    5544             : 
    5545           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5546           0 :                 allow_remaining = true;
    5547             :         }
    5548             : 
    5549           0 :         return py_svcctl_SetServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    5550             : }
    5551             : 
    5552           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    5553             : {
    5554           0 :         const struct ndr_interface_call *call = NULL;
    5555           0 :         struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
    5556             :         PyObject *ret;
    5557             :         char *retstr;
    5558             : 
    5559           0 :         if (ndr_table_svcctl.num_calls < 6) {
    5560           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_print");
    5561           0 :                 return NULL;
    5562             :         }
    5563           0 :         call = &ndr_table_svcctl.calls[5];
    5564             : 
    5565           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    5566           0 :         ret = PyUnicode_FromString(retstr);
    5567           0 :         TALLOC_FREE(retstr);
    5568             : 
    5569           0 :         return ret;
    5570             : }
    5571             : 
    5572           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5573             : {
    5574           0 :         return py_svcctl_SetServiceObjectSecurity_ndr_print(py_obj, "svcctl_SetServiceObjectSecurity_in", NDR_IN);
    5575             : }
    5576             : 
    5577           0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5578             : {
    5579           0 :         return py_svcctl_SetServiceObjectSecurity_ndr_print(py_obj, "svcctl_SetServiceObjectSecurity_out", NDR_OUT);
    5580             : }
    5581             : 
    5582             : static PyMethodDef py_svcctl_SetServiceObjectSecurity_methods[] = {
    5583             :         { "opnum", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
    5584             :                 "svcctl.SetServiceObjectSecurity.opnum() -> 5 (0x05) " },
    5585             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    5586             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    5587             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    5588             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    5589             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    5590             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    5591             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    5592             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    5593             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    5594             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    5595             :         { NULL, NULL, 0, NULL }
    5596             : };
    5597             : 
    5598             : 
    5599             : static PyTypeObject svcctl_SetServiceObjectSecurity_Type = {
    5600             :         PyVarObject_HEAD_INIT(NULL, 0)
    5601             :         .tp_name = "svcctl.SetServiceObjectSecurity",
    5602             :         .tp_getset = py_svcctl_SetServiceObjectSecurity_getsetters,
    5603             :         .tp_methods = py_svcctl_SetServiceObjectSecurity_methods,
    5604             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5605             :         .tp_new = py_svcctl_SetServiceObjectSecurity_new,
    5606             : };
    5607             : 
    5608           0 : static bool pack_py_svcctl_SetServiceObjectSecurity_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SetServiceObjectSecurity *r)
    5609             : {
    5610             :         PyObject *py_handle;
    5611             :         PyObject *py_security_flags;
    5612             :         PyObject *py_buffer;
    5613           0 :         const char *kwnames[] = {
    5614             :                 "handle", "security_flags", "buffer", NULL
    5615             :         };
    5616             : 
    5617           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_SetServiceObjectSecurity", discard_const_p(char *, kwnames), &py_handle, &py_security_flags, &py_buffer)) {
    5618           0 :                 return false;
    5619             :         }
    5620             : 
    5621           0 :         if (py_handle == NULL) {
    5622           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    5623           0 :                 return false;
    5624             :         }
    5625           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    5626           0 :         if (r->in.handle == NULL) {
    5627           0 :                 PyErr_NoMemory();
    5628           0 :                 return false;
    5629             :         }
    5630           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    5631           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    5632           0 :                 PyErr_NoMemory();
    5633           0 :                 return false;
    5634             :         }
    5635           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    5636           0 :         if (py_security_flags == NULL) {
    5637           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.security_flags");
    5638           0 :                 return false;
    5639             :         }
    5640             :         {
    5641           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.security_flags));
    5642           0 :                 if (PyLong_Check(py_security_flags)) {
    5643             :                         unsigned long long test_var;
    5644           0 :                         test_var = PyLong_AsUnsignedLongLong(py_security_flags);
    5645           0 :                         if (PyErr_Occurred() != NULL) {
    5646           0 :                                 return false;
    5647             :                         }
    5648           0 :                         if (test_var > uint_max) {
    5649           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5650             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5651           0 :                                 return false;
    5652             :                         }
    5653           0 :                         r->in.security_flags = test_var;
    5654             :                 } else {
    5655           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5656             :                           PyLong_Type.tp_name);
    5657           0 :                         return false;
    5658             :                 }
    5659             :         }
    5660           0 :         if (py_buffer == NULL) {
    5661           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffer");
    5662           0 :                 return false;
    5663             :         }
    5664           0 :         r->in.buffer = talloc_ptrtype(r, r->in.buffer);
    5665           0 :         if (r->in.buffer == NULL) {
    5666           0 :                 PyErr_NoMemory();
    5667           0 :                 return false;
    5668             :         }
    5669           0 :         PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
    5670             :         {
    5671             :                 int buffer_cntr_1;
    5672           0 :                 r->in.buffer = talloc_array_ptrtype(r, r->in.buffer, PyList_GET_SIZE(py_buffer));
    5673           0 :                 if (!r->in.buffer) { return false;; }
    5674           0 :                 talloc_set_name_const(r->in.buffer, "ARRAY: r->in.buffer");
    5675           0 :                 for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(py_buffer); buffer_cntr_1++) {
    5676           0 :                         if (PyList_GET_ITEM(py_buffer, buffer_cntr_1) == NULL) {
    5677           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffer[buffer_cntr_1]");
    5678           0 :                                 return false;
    5679             :                         }
    5680             :                         {
    5681           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buffer[buffer_cntr_1]));
    5682           0 :                                 if (PyLong_Check(PyList_GET_ITEM(py_buffer, buffer_cntr_1))) {
    5683             :                                         unsigned long long test_var;
    5684           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_buffer, buffer_cntr_1));
    5685           0 :                                         if (PyErr_Occurred() != NULL) {
    5686           0 :                                                 return false;
    5687             :                                         }
    5688           0 :                                         if (test_var > uint_max) {
    5689           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5690             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    5691           0 :                                                 return false;
    5692             :                                         }
    5693           0 :                                         r->in.buffer[buffer_cntr_1] = test_var;
    5694             :                                 } else {
    5695           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5696             :                                           PyLong_Type.tp_name);
    5697           0 :                                         return false;
    5698             :                                 }
    5699             :                         }
    5700             :                 }
    5701             :         }
    5702           0 :         PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
    5703           0 :         r->in.offered = PyList_GET_SIZE(py_buffer);
    5704           0 :         return true;
    5705             : }
    5706             : 
    5707           0 : static PyObject *unpack_py_svcctl_SetServiceObjectSecurity_args_out(struct svcctl_SetServiceObjectSecurity *r)
    5708             : {
    5709             :         PyObject *result;
    5710           0 :         result = Py_None;
    5711           0 :         Py_INCREF(result);
    5712           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    5713           0 :                 PyErr_SetWERROR(r->out.result);
    5714           0 :                 return NULL;
    5715             :         }
    5716             : 
    5717           0 :         return result;
    5718             : }
    5719             : 
    5720             : 
    5721           0 : static PyObject *py_svcctl_QueryServiceStatus_in_get_handle(PyObject *obj, void *closure)
    5722             : {
    5723           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
    5724             :         PyObject *py_handle;
    5725           0 :         if (object->in.handle == NULL) {
    5726           0 :                 Py_RETURN_NONE;
    5727             :         }
    5728           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    5729           0 :         return py_handle;
    5730             : }
    5731             : 
    5732           0 : static int py_svcctl_QueryServiceStatus_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    5733             : {
    5734           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
    5735           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    5736           0 :         if (value == NULL) {
    5737           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    5738           0 :                 return -1;
    5739             :         }
    5740           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    5741           0 :         if (object->in.handle == NULL) {
    5742           0 :                 PyErr_NoMemory();
    5743           0 :                 return -1;
    5744             :         }
    5745           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    5746           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5747           0 :                 PyErr_NoMemory();
    5748           0 :                 return -1;
    5749             :         }
    5750           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    5751           0 :         return 0;
    5752             : }
    5753             : 
    5754           0 : static PyObject *py_svcctl_QueryServiceStatus_out_get_service_status(PyObject *obj, void *closure)
    5755             : {
    5756           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
    5757             :         PyObject *py_service_status;
    5758           0 :         if (object->out.service_status == NULL) {
    5759           0 :                 Py_RETURN_NONE;
    5760             :         }
    5761           0 :         py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, object->out.service_status, object->out.service_status);
    5762           0 :         return py_service_status;
    5763             : }
    5764             : 
    5765           0 : static int py_svcctl_QueryServiceStatus_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
    5766             : {
    5767           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
    5768           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
    5769           0 :         if (value == NULL) {
    5770           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
    5771           0 :                 return -1;
    5772             :         }
    5773           0 :         object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
    5774           0 :         if (object->out.service_status == NULL) {
    5775           0 :                 PyErr_NoMemory();
    5776           0 :                 return -1;
    5777             :         }
    5778           0 :         PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
    5779           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5780           0 :                 PyErr_NoMemory();
    5781           0 :                 return -1;
    5782             :         }
    5783           0 :         object->out.service_status = (struct SERVICE_STATUS *)pytalloc_get_ptr(value);
    5784           0 :         return 0;
    5785             : }
    5786             : 
    5787           0 : static PyObject *py_svcctl_QueryServiceStatus_get_result(PyObject *obj, void *closure)
    5788             : {
    5789           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
    5790             :         PyObject *py_result;
    5791           0 :         py_result = PyErr_FromWERROR(object->out.result);
    5792           0 :         return py_result;
    5793             : }
    5794             : 
    5795           0 : static int py_svcctl_QueryServiceStatus_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5796             : {
    5797           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
    5798           0 :         if (value == NULL) {
    5799           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    5800           0 :                 return -1;
    5801             :         }
    5802           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    5803           0 :         return 0;
    5804             : }
    5805             : 
    5806             : static PyGetSetDef py_svcctl_QueryServiceStatus_getsetters[] = {
    5807             :         {
    5808             :                 .name = discard_const_p(char, "in_handle"),
    5809             :                 .get = py_svcctl_QueryServiceStatus_in_get_handle,
    5810             :                 .set = py_svcctl_QueryServiceStatus_in_set_handle,
    5811             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    5812             :         },
    5813             :         {
    5814             :                 .name = discard_const_p(char, "out_service_status"),
    5815             :                 .get = py_svcctl_QueryServiceStatus_out_get_service_status,
    5816             :                 .set = py_svcctl_QueryServiceStatus_out_set_service_status,
    5817             :                 .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
    5818             :         },
    5819             :         {
    5820             :                 .name = discard_const_p(char, "result"),
    5821             :                 .get = py_svcctl_QueryServiceStatus_get_result,
    5822             :                 .set = py_svcctl_QueryServiceStatus_set_result,
    5823             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    5824             :         },
    5825             :         { .name = NULL }
    5826             : };
    5827             : 
    5828           0 : static PyObject *py_svcctl_QueryServiceStatus_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5829             : {
    5830           0 :         PyObject *self = pytalloc_new(struct svcctl_QueryServiceStatus, type);
    5831           0 :         struct svcctl_QueryServiceStatus *_self = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(self);
    5832           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    5833           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    5834           0 :         _self->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
    5835           0 :         return self;
    5836             : }
    5837             : 
    5838           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5839             : {
    5840             : 
    5841             : 
    5842           0 :         return PyLong_FromLong(6);
    5843             : }
    5844             : 
    5845           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    5846             : {
    5847           0 :         const struct ndr_interface_call *call = NULL;
    5848           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
    5849           0 :         PyObject *ret = NULL;
    5850           0 :         struct ndr_push *push = NULL;
    5851             :         DATA_BLOB blob;
    5852             :         enum ndr_err_code err;
    5853             : 
    5854           0 :         if (ndr_table_svcctl.num_calls < 7) {
    5855           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_pack");
    5856           0 :                 return NULL;
    5857             :         }
    5858           0 :         call = &ndr_table_svcctl.calls[6];
    5859             : 
    5860           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5861           0 :         if (push == NULL) {
    5862           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5863           0 :                 return NULL;
    5864             :         }
    5865             : 
    5866           0 :         push->flags |= ndr_push_flags;
    5867             : 
    5868           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5869           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5870           0 :                 TALLOC_FREE(push);
    5871           0 :                 PyErr_SetNdrError(err);
    5872           0 :                 return NULL;
    5873             :         }
    5874           0 :         blob = ndr_push_blob(push);
    5875           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5876           0 :         TALLOC_FREE(push);
    5877           0 :         return ret;
    5878             : }
    5879             : 
    5880           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5881             : {
    5882           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5883           0 :         PyObject *bigendian_obj = NULL;
    5884           0 :         PyObject *ndr64_obj = NULL;
    5885           0 :         uint32_t ndr_push_flags = 0;
    5886             : 
    5887           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5888             :                 discard_const_p(char *, kwnames),
    5889             :                 &bigendian_obj,
    5890             :                 &ndr64_obj)) {
    5891           0 :                 return NULL;
    5892             :         }
    5893             : 
    5894           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5895           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5896             :         }
    5897           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5898           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5899             :         }
    5900             : 
    5901           0 :         return py_svcctl_QueryServiceStatus_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5902             : }
    5903             : 
    5904           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5905             : {
    5906           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5907           0 :         PyObject *bigendian_obj = NULL;
    5908           0 :         PyObject *ndr64_obj = NULL;
    5909           0 :         uint32_t ndr_push_flags = 0;
    5910             : 
    5911           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5912             :                 discard_const_p(char *, kwnames),
    5913             :                 &bigendian_obj,
    5914             :                 &ndr64_obj)) {
    5915           0 :                 return NULL;
    5916             :         }
    5917             : 
    5918           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5919           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5920             :         }
    5921           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5922           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5923             :         }
    5924             : 
    5925           0 :         return py_svcctl_QueryServiceStatus_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5926             : }
    5927             : 
    5928           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    5929             : {
    5930           0 :         const struct ndr_interface_call *call = NULL;
    5931           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
    5932           0 :         struct ndr_pull *pull = NULL;
    5933             :         enum ndr_err_code err;
    5934             : 
    5935           0 :         if (ndr_table_svcctl.num_calls < 7) {
    5936           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_unpack");
    5937           0 :                 return NULL;
    5938             :         }
    5939           0 :         call = &ndr_table_svcctl.calls[6];
    5940             : 
    5941           0 :         pull = ndr_pull_init_blob(blob, object);
    5942           0 :         if (pull == NULL) {
    5943           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5944           0 :                 return NULL;
    5945             :         }
    5946             : 
    5947           0 :         pull->flags |= ndr_pull_flags;
    5948             : 
    5949           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    5950           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5951           0 :                 TALLOC_FREE(pull);
    5952           0 :                 PyErr_SetNdrError(err);
    5953           0 :                 return NULL;
    5954             :         }
    5955           0 :         if (!allow_remaining) {
    5956             :                 uint32_t highest_ofs;
    5957             : 
    5958           0 :                 if (pull->offset > pull->relative_highest_offset) {
    5959           0 :                         highest_ofs = pull->offset;
    5960             :                 } else {
    5961           0 :                         highest_ofs = pull->relative_highest_offset;
    5962             :                 }
    5963           0 :                 if (highest_ofs < pull->data_size) {
    5964           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    5965             :                                 "not all bytes consumed ofs[%u] size[%u]",
    5966             :                                 highest_ofs, pull->data_size);
    5967           0 :                         TALLOC_FREE(pull);
    5968           0 :                         PyErr_SetNdrError(err);
    5969           0 :                         return NULL;
    5970             :                 }
    5971             :         }
    5972             : 
    5973           0 :         TALLOC_FREE(pull);
    5974           0 :         Py_RETURN_NONE;
    5975             : }
    5976             : 
    5977           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5978             : {
    5979             :         DATA_BLOB blob;
    5980           0 :         Py_ssize_t blob_length = 0;
    5981           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5982           0 :         PyObject *bigendian_obj = NULL;
    5983           0 :         PyObject *ndr64_obj = NULL;
    5984           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5985           0 :         PyObject *allow_remaining_obj = NULL;
    5986           0 :         bool allow_remaining = false;
    5987             : 
    5988           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    5989             :                 discard_const_p(char *, kwnames),
    5990             :                 &blob.data, &blob_length,
    5991             :                 &bigendian_obj,
    5992             :                 &ndr64_obj,
    5993             :                 &allow_remaining_obj)) {
    5994           0 :                 return NULL;
    5995             :         }
    5996           0 :         blob.length = blob_length;
    5997             : 
    5998           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5999           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6000             :         }
    6001           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6002           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6003             :         }
    6004             : 
    6005           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6006           0 :                 allow_remaining = true;
    6007             :         }
    6008             : 
    6009           0 :         return py_svcctl_QueryServiceStatus_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6010             : }
    6011             : 
    6012           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6013             : {
    6014             :         DATA_BLOB blob;
    6015           0 :         Py_ssize_t blob_length = 0;
    6016           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6017           0 :         PyObject *bigendian_obj = NULL;
    6018           0 :         PyObject *ndr64_obj = NULL;
    6019           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6020           0 :         PyObject *allow_remaining_obj = NULL;
    6021           0 :         bool allow_remaining = false;
    6022             : 
    6023           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6024             :                 discard_const_p(char *, kwnames),
    6025             :                 &blob.data, &blob_length,
    6026             :                 &bigendian_obj,
    6027             :                 &ndr64_obj,
    6028             :                 &allow_remaining_obj)) {
    6029           0 :                 return NULL;
    6030             :         }
    6031           0 :         blob.length = blob_length;
    6032             : 
    6033           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6034           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6035             :         }
    6036           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6037           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6038             :         }
    6039             : 
    6040           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6041           0 :                 allow_remaining = true;
    6042             :         }
    6043             : 
    6044           0 :         return py_svcctl_QueryServiceStatus_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6045             : }
    6046             : 
    6047           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    6048             : {
    6049           0 :         const struct ndr_interface_call *call = NULL;
    6050           0 :         struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
    6051             :         PyObject *ret;
    6052             :         char *retstr;
    6053             : 
    6054           0 :         if (ndr_table_svcctl.num_calls < 7) {
    6055           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_print");
    6056           0 :                 return NULL;
    6057             :         }
    6058           0 :         call = &ndr_table_svcctl.calls[6];
    6059             : 
    6060           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6061           0 :         ret = PyUnicode_FromString(retstr);
    6062           0 :         TALLOC_FREE(retstr);
    6063             : 
    6064           0 :         return ret;
    6065             : }
    6066             : 
    6067           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6068             : {
    6069           0 :         return py_svcctl_QueryServiceStatus_ndr_print(py_obj, "svcctl_QueryServiceStatus_in", NDR_IN);
    6070             : }
    6071             : 
    6072           0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6073             : {
    6074           0 :         return py_svcctl_QueryServiceStatus_ndr_print(py_obj, "svcctl_QueryServiceStatus_out", NDR_OUT);
    6075             : }
    6076             : 
    6077             : static PyMethodDef py_svcctl_QueryServiceStatus_methods[] = {
    6078             :         { "opnum", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_opnum, METH_NOARGS|METH_CLASS,
    6079             :                 "svcctl.QueryServiceStatus.opnum() -> 6 (0x06) " },
    6080             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6081             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6082             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6083             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6084             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6085             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6086             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6087             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6088             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6089             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6090             :         { NULL, NULL, 0, NULL }
    6091             : };
    6092             : 
    6093             : 
    6094             : static PyTypeObject svcctl_QueryServiceStatus_Type = {
    6095             :         PyVarObject_HEAD_INIT(NULL, 0)
    6096             :         .tp_name = "svcctl.QueryServiceStatus",
    6097             :         .tp_getset = py_svcctl_QueryServiceStatus_getsetters,
    6098             :         .tp_methods = py_svcctl_QueryServiceStatus_methods,
    6099             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6100             :         .tp_new = py_svcctl_QueryServiceStatus_new,
    6101             : };
    6102             : 
    6103           0 : static bool pack_py_svcctl_QueryServiceStatus_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceStatus *r)
    6104             : {
    6105             :         PyObject *py_handle;
    6106           0 :         const char *kwnames[] = {
    6107             :                 "handle", NULL
    6108             :         };
    6109             : 
    6110           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_QueryServiceStatus", discard_const_p(char *, kwnames), &py_handle)) {
    6111           0 :                 return false;
    6112             :         }
    6113             : 
    6114           0 :         if (py_handle == NULL) {
    6115           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    6116           0 :                 return false;
    6117             :         }
    6118           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    6119           0 :         if (r->in.handle == NULL) {
    6120           0 :                 PyErr_NoMemory();
    6121           0 :                 return false;
    6122             :         }
    6123           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    6124           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    6125           0 :                 PyErr_NoMemory();
    6126           0 :                 return false;
    6127             :         }
    6128           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    6129           0 :         return true;
    6130             : }
    6131             : 
    6132           0 : static PyObject *unpack_py_svcctl_QueryServiceStatus_args_out(struct svcctl_QueryServiceStatus *r)
    6133             : {
    6134             :         PyObject *result;
    6135             :         PyObject *py_service_status;
    6136           0 :         py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, r->out.service_status, r->out.service_status);
    6137           0 :         result = py_service_status;
    6138           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    6139           0 :                 PyErr_SetWERROR(r->out.result);
    6140           0 :                 return NULL;
    6141             :         }
    6142             : 
    6143           0 :         return result;
    6144             : }
    6145             : 
    6146             : 
    6147           0 : static PyObject *py_svcctl_UnlockServiceDatabase_in_get_lock(PyObject *obj, void *closure)
    6148             : {
    6149           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
    6150             :         PyObject *py_lock;
    6151           0 :         if (object->in.lock == NULL) {
    6152           0 :                 Py_RETURN_NONE;
    6153             :         }
    6154           0 :         py_lock = pytalloc_reference_ex(policy_handle_Type, object->in.lock, object->in.lock);
    6155           0 :         return py_lock;
    6156             : }
    6157             : 
    6158           0 : static int py_svcctl_UnlockServiceDatabase_in_set_lock(PyObject *py_obj, PyObject *value, void *closure)
    6159             : {
    6160           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
    6161           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lock));
    6162           0 :         if (value == NULL) {
    6163           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lock");
    6164           0 :                 return -1;
    6165             :         }
    6166           0 :         object->in.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lock);
    6167           0 :         if (object->in.lock == NULL) {
    6168           0 :                 PyErr_NoMemory();
    6169           0 :                 return -1;
    6170             :         }
    6171           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    6172           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6173           0 :                 PyErr_NoMemory();
    6174           0 :                 return -1;
    6175             :         }
    6176           0 :         object->in.lock = (struct policy_handle *)pytalloc_get_ptr(value);
    6177           0 :         return 0;
    6178             : }
    6179             : 
    6180           0 : static PyObject *py_svcctl_UnlockServiceDatabase_out_get_lock(PyObject *obj, void *closure)
    6181             : {
    6182           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
    6183             :         PyObject *py_lock;
    6184           0 :         if (object->out.lock == NULL) {
    6185           0 :                 Py_RETURN_NONE;
    6186             :         }
    6187           0 :         py_lock = pytalloc_reference_ex(policy_handle_Type, object->out.lock, object->out.lock);
    6188           0 :         return py_lock;
    6189             : }
    6190             : 
    6191           0 : static int py_svcctl_UnlockServiceDatabase_out_set_lock(PyObject *py_obj, PyObject *value, void *closure)
    6192             : {
    6193           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
    6194           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock));
    6195           0 :         if (value == NULL) {
    6196           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock");
    6197           0 :                 return -1;
    6198             :         }
    6199           0 :         object->out.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock);
    6200           0 :         if (object->out.lock == NULL) {
    6201           0 :                 PyErr_NoMemory();
    6202           0 :                 return -1;
    6203             :         }
    6204           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    6205           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6206           0 :                 PyErr_NoMemory();
    6207           0 :                 return -1;
    6208             :         }
    6209           0 :         object->out.lock = (struct policy_handle *)pytalloc_get_ptr(value);
    6210           0 :         return 0;
    6211             : }
    6212             : 
    6213           0 : static PyObject *py_svcctl_UnlockServiceDatabase_get_result(PyObject *obj, void *closure)
    6214             : {
    6215           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
    6216             :         PyObject *py_result;
    6217           0 :         py_result = PyErr_FromWERROR(object->out.result);
    6218           0 :         return py_result;
    6219             : }
    6220             : 
    6221           0 : static int py_svcctl_UnlockServiceDatabase_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6222             : {
    6223           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
    6224           0 :         if (value == NULL) {
    6225           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    6226           0 :                 return -1;
    6227             :         }
    6228           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    6229           0 :         return 0;
    6230             : }
    6231             : 
    6232             : static PyGetSetDef py_svcctl_UnlockServiceDatabase_getsetters[] = {
    6233             :         {
    6234             :                 .name = discard_const_p(char, "in_lock"),
    6235             :                 .get = py_svcctl_UnlockServiceDatabase_in_get_lock,
    6236             :                 .set = py_svcctl_UnlockServiceDatabase_in_set_lock,
    6237             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    6238             :         },
    6239             :         {
    6240             :                 .name = discard_const_p(char, "out_lock"),
    6241             :                 .get = py_svcctl_UnlockServiceDatabase_out_get_lock,
    6242             :                 .set = py_svcctl_UnlockServiceDatabase_out_set_lock,
    6243             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    6244             :         },
    6245             :         {
    6246             :                 .name = discard_const_p(char, "result"),
    6247             :                 .get = py_svcctl_UnlockServiceDatabase_get_result,
    6248             :                 .set = py_svcctl_UnlockServiceDatabase_set_result,
    6249             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    6250             :         },
    6251             :         { .name = NULL }
    6252             : };
    6253             : 
    6254           0 : static PyObject *py_svcctl_UnlockServiceDatabase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6255             : {
    6256           0 :         PyObject *self = pytalloc_new(struct svcctl_UnlockServiceDatabase, type);
    6257           0 :         struct svcctl_UnlockServiceDatabase *_self = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(self);
    6258           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    6259           0 :         _self->in.lock = talloc_zero(mem_ctx, struct policy_handle);
    6260           0 :         _self->out.lock = talloc_zero(mem_ctx, struct policy_handle);
    6261           0 :         return self;
    6262             : }
    6263             : 
    6264           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6265             : {
    6266             : 
    6267             : 
    6268           0 :         return PyLong_FromLong(8);
    6269             : }
    6270             : 
    6271           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    6272             : {
    6273           0 :         const struct ndr_interface_call *call = NULL;
    6274           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
    6275           0 :         PyObject *ret = NULL;
    6276           0 :         struct ndr_push *push = NULL;
    6277             :         DATA_BLOB blob;
    6278             :         enum ndr_err_code err;
    6279             : 
    6280           0 :         if (ndr_table_svcctl.num_calls < 9) {
    6281           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_pack");
    6282           0 :                 return NULL;
    6283             :         }
    6284           0 :         call = &ndr_table_svcctl.calls[8];
    6285             : 
    6286           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6287           0 :         if (push == NULL) {
    6288           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6289           0 :                 return NULL;
    6290             :         }
    6291             : 
    6292           0 :         push->flags |= ndr_push_flags;
    6293             : 
    6294           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6295           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6296           0 :                 TALLOC_FREE(push);
    6297           0 :                 PyErr_SetNdrError(err);
    6298           0 :                 return NULL;
    6299             :         }
    6300           0 :         blob = ndr_push_blob(push);
    6301           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6302           0 :         TALLOC_FREE(push);
    6303           0 :         return ret;
    6304             : }
    6305             : 
    6306           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6307             : {
    6308           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6309           0 :         PyObject *bigendian_obj = NULL;
    6310           0 :         PyObject *ndr64_obj = NULL;
    6311           0 :         uint32_t ndr_push_flags = 0;
    6312             : 
    6313           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6314             :                 discard_const_p(char *, kwnames),
    6315             :                 &bigendian_obj,
    6316             :                 &ndr64_obj)) {
    6317           0 :                 return NULL;
    6318             :         }
    6319             : 
    6320           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6321           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6322             :         }
    6323           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6324           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6325             :         }
    6326             : 
    6327           0 :         return py_svcctl_UnlockServiceDatabase_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6328             : }
    6329             : 
    6330           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6331             : {
    6332           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6333           0 :         PyObject *bigendian_obj = NULL;
    6334           0 :         PyObject *ndr64_obj = NULL;
    6335           0 :         uint32_t ndr_push_flags = 0;
    6336             : 
    6337           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6338             :                 discard_const_p(char *, kwnames),
    6339             :                 &bigendian_obj,
    6340             :                 &ndr64_obj)) {
    6341           0 :                 return NULL;
    6342             :         }
    6343             : 
    6344           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6345           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6346             :         }
    6347           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6348           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6349             :         }
    6350             : 
    6351           0 :         return py_svcctl_UnlockServiceDatabase_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6352             : }
    6353             : 
    6354           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    6355             : {
    6356           0 :         const struct ndr_interface_call *call = NULL;
    6357           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
    6358           0 :         struct ndr_pull *pull = NULL;
    6359             :         enum ndr_err_code err;
    6360             : 
    6361           0 :         if (ndr_table_svcctl.num_calls < 9) {
    6362           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_unpack");
    6363           0 :                 return NULL;
    6364             :         }
    6365           0 :         call = &ndr_table_svcctl.calls[8];
    6366             : 
    6367           0 :         pull = ndr_pull_init_blob(blob, object);
    6368           0 :         if (pull == NULL) {
    6369           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6370           0 :                 return NULL;
    6371             :         }
    6372             : 
    6373           0 :         pull->flags |= ndr_pull_flags;
    6374             : 
    6375           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6376           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6377           0 :                 TALLOC_FREE(pull);
    6378           0 :                 PyErr_SetNdrError(err);
    6379           0 :                 return NULL;
    6380             :         }
    6381           0 :         if (!allow_remaining) {
    6382             :                 uint32_t highest_ofs;
    6383             : 
    6384           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6385           0 :                         highest_ofs = pull->offset;
    6386             :                 } else {
    6387           0 :                         highest_ofs = pull->relative_highest_offset;
    6388             :                 }
    6389           0 :                 if (highest_ofs < pull->data_size) {
    6390           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6391             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6392             :                                 highest_ofs, pull->data_size);
    6393           0 :                         TALLOC_FREE(pull);
    6394           0 :                         PyErr_SetNdrError(err);
    6395           0 :                         return NULL;
    6396             :                 }
    6397             :         }
    6398             : 
    6399           0 :         TALLOC_FREE(pull);
    6400           0 :         Py_RETURN_NONE;
    6401             : }
    6402             : 
    6403           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6404             : {
    6405             :         DATA_BLOB blob;
    6406           0 :         Py_ssize_t blob_length = 0;
    6407           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6408           0 :         PyObject *bigendian_obj = NULL;
    6409           0 :         PyObject *ndr64_obj = NULL;
    6410           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6411           0 :         PyObject *allow_remaining_obj = NULL;
    6412           0 :         bool allow_remaining = false;
    6413             : 
    6414           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6415             :                 discard_const_p(char *, kwnames),
    6416             :                 &blob.data, &blob_length,
    6417             :                 &bigendian_obj,
    6418             :                 &ndr64_obj,
    6419             :                 &allow_remaining_obj)) {
    6420           0 :                 return NULL;
    6421             :         }
    6422           0 :         blob.length = blob_length;
    6423             : 
    6424           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6425           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6426             :         }
    6427           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6428           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6429             :         }
    6430             : 
    6431           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6432           0 :                 allow_remaining = true;
    6433             :         }
    6434             : 
    6435           0 :         return py_svcctl_UnlockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6436             : }
    6437             : 
    6438           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6439             : {
    6440             :         DATA_BLOB blob;
    6441           0 :         Py_ssize_t blob_length = 0;
    6442           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6443           0 :         PyObject *bigendian_obj = NULL;
    6444           0 :         PyObject *ndr64_obj = NULL;
    6445           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6446           0 :         PyObject *allow_remaining_obj = NULL;
    6447           0 :         bool allow_remaining = false;
    6448             : 
    6449           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6450             :                 discard_const_p(char *, kwnames),
    6451             :                 &blob.data, &blob_length,
    6452             :                 &bigendian_obj,
    6453             :                 &ndr64_obj,
    6454             :                 &allow_remaining_obj)) {
    6455           0 :                 return NULL;
    6456             :         }
    6457           0 :         blob.length = blob_length;
    6458             : 
    6459           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6460           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6461             :         }
    6462           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6463           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6464             :         }
    6465             : 
    6466           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6467           0 :                 allow_remaining = true;
    6468             :         }
    6469             : 
    6470           0 :         return py_svcctl_UnlockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6471             : }
    6472             : 
    6473           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    6474             : {
    6475           0 :         const struct ndr_interface_call *call = NULL;
    6476           0 :         struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
    6477             :         PyObject *ret;
    6478             :         char *retstr;
    6479             : 
    6480           0 :         if (ndr_table_svcctl.num_calls < 9) {
    6481           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_print");
    6482           0 :                 return NULL;
    6483             :         }
    6484           0 :         call = &ndr_table_svcctl.calls[8];
    6485             : 
    6486           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6487           0 :         ret = PyUnicode_FromString(retstr);
    6488           0 :         TALLOC_FREE(retstr);
    6489             : 
    6490           0 :         return ret;
    6491             : }
    6492             : 
    6493           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6494             : {
    6495           0 :         return py_svcctl_UnlockServiceDatabase_ndr_print(py_obj, "svcctl_UnlockServiceDatabase_in", NDR_IN);
    6496             : }
    6497             : 
    6498           0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6499             : {
    6500           0 :         return py_svcctl_UnlockServiceDatabase_ndr_print(py_obj, "svcctl_UnlockServiceDatabase_out", NDR_OUT);
    6501             : }
    6502             : 
    6503             : static PyMethodDef py_svcctl_UnlockServiceDatabase_methods[] = {
    6504             :         { "opnum", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_opnum, METH_NOARGS|METH_CLASS,
    6505             :                 "svcctl.UnlockServiceDatabase.opnum() -> 8 (0x08) " },
    6506             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6507             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6508             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6509             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6510             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6511             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6512             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6513             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6514             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6515             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6516             :         { NULL, NULL, 0, NULL }
    6517             : };
    6518             : 
    6519             : 
    6520             : static PyTypeObject svcctl_UnlockServiceDatabase_Type = {
    6521             :         PyVarObject_HEAD_INIT(NULL, 0)
    6522             :         .tp_name = "svcctl.UnlockServiceDatabase",
    6523             :         .tp_getset = py_svcctl_UnlockServiceDatabase_getsetters,
    6524             :         .tp_methods = py_svcctl_UnlockServiceDatabase_methods,
    6525             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6526             :         .tp_new = py_svcctl_UnlockServiceDatabase_new,
    6527             : };
    6528             : 
    6529           0 : static bool pack_py_svcctl_UnlockServiceDatabase_args_in(PyObject *args, PyObject *kwargs, struct svcctl_UnlockServiceDatabase *r)
    6530             : {
    6531             :         PyObject *py_lock;
    6532           0 :         const char *kwnames[] = {
    6533             :                 "lock", NULL
    6534             :         };
    6535             : 
    6536           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_UnlockServiceDatabase", discard_const_p(char *, kwnames), &py_lock)) {
    6537           0 :                 return false;
    6538             :         }
    6539             : 
    6540           0 :         if (py_lock == NULL) {
    6541           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lock");
    6542           0 :                 return false;
    6543             :         }
    6544           0 :         r->in.lock = talloc_ptrtype(r, r->in.lock);
    6545           0 :         if (r->in.lock == NULL) {
    6546           0 :                 PyErr_NoMemory();
    6547           0 :                 return false;
    6548             :         }
    6549           0 :         PY_CHECK_TYPE(policy_handle_Type, py_lock, return false;);
    6550           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_lock)) == NULL) {
    6551           0 :                 PyErr_NoMemory();
    6552           0 :                 return false;
    6553             :         }
    6554           0 :         r->in.lock = (struct policy_handle *)pytalloc_get_ptr(py_lock);
    6555           0 :         return true;
    6556             : }
    6557             : 
    6558           0 : static PyObject *unpack_py_svcctl_UnlockServiceDatabase_args_out(struct svcctl_UnlockServiceDatabase *r)
    6559             : {
    6560             :         PyObject *result;
    6561             :         PyObject *py_lock;
    6562           0 :         py_lock = pytalloc_reference_ex(policy_handle_Type, r->out.lock, r->out.lock);
    6563           0 :         result = py_lock;
    6564           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    6565           0 :                 PyErr_SetWERROR(r->out.result);
    6566           0 :                 return NULL;
    6567             :         }
    6568             : 
    6569           0 :         return result;
    6570             : }
    6571             : 
    6572             : 
    6573           0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_handle(PyObject *obj, void *closure)
    6574             : {
    6575           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
    6576             :         PyObject *py_handle;
    6577           0 :         if (object->in.handle == NULL) {
    6578           0 :                 Py_RETURN_NONE;
    6579             :         }
    6580           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    6581           0 :         return py_handle;
    6582             : }
    6583             : 
    6584           0 : static int py_svcctl_SCSetServiceBitsW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    6585             : {
    6586           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6587           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    6588           0 :         if (value == NULL) {
    6589           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    6590           0 :                 return -1;
    6591             :         }
    6592           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    6593           0 :         if (object->in.handle == NULL) {
    6594           0 :                 PyErr_NoMemory();
    6595           0 :                 return -1;
    6596             :         }
    6597           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    6598           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6599           0 :                 PyErr_NoMemory();
    6600           0 :                 return -1;
    6601             :         }
    6602           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    6603           0 :         return 0;
    6604             : }
    6605             : 
    6606           0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_bits(PyObject *obj, void *closure)
    6607             : {
    6608           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
    6609             :         PyObject *py_bits;
    6610           0 :         py_bits = PyLong_FromUnsignedLongLong((uint32_t)object->in.bits);
    6611           0 :         return py_bits;
    6612             : }
    6613             : 
    6614           0 : static int py_svcctl_SCSetServiceBitsW_in_set_bits(PyObject *py_obj, PyObject *value, void *closure)
    6615             : {
    6616           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6617           0 :         if (value == NULL) {
    6618           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bits");
    6619           0 :                 return -1;
    6620             :         }
    6621             :         {
    6622           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bits));
    6623           0 :                 if (PyLong_Check(value)) {
    6624             :                         unsigned long long test_var;
    6625           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6626           0 :                         if (PyErr_Occurred() != NULL) {
    6627           0 :                                 return -1;
    6628             :                         }
    6629           0 :                         if (test_var > uint_max) {
    6630           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6631             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6632           0 :                                 return -1;
    6633             :                         }
    6634           0 :                         object->in.bits = test_var;
    6635             :                 } else {
    6636           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6637             :                           PyLong_Type.tp_name);
    6638           0 :                         return -1;
    6639             :                 }
    6640             :         }
    6641           0 :         return 0;
    6642             : }
    6643             : 
    6644           0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_bitson(PyObject *obj, void *closure)
    6645             : {
    6646           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
    6647             :         PyObject *py_bitson;
    6648           0 :         py_bitson = PyLong_FromUnsignedLongLong((uint32_t)object->in.bitson);
    6649           0 :         return py_bitson;
    6650             : }
    6651             : 
    6652           0 : static int py_svcctl_SCSetServiceBitsW_in_set_bitson(PyObject *py_obj, PyObject *value, void *closure)
    6653             : {
    6654           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6655           0 :         if (value == NULL) {
    6656           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bitson");
    6657           0 :                 return -1;
    6658             :         }
    6659             :         {
    6660           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bitson));
    6661           0 :                 if (PyLong_Check(value)) {
    6662             :                         unsigned long long test_var;
    6663           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6664           0 :                         if (PyErr_Occurred() != NULL) {
    6665           0 :                                 return -1;
    6666             :                         }
    6667           0 :                         if (test_var > uint_max) {
    6668           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6669             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6670           0 :                                 return -1;
    6671             :                         }
    6672           0 :                         object->in.bitson = test_var;
    6673             :                 } else {
    6674           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6675             :                           PyLong_Type.tp_name);
    6676           0 :                         return -1;
    6677             :                 }
    6678             :         }
    6679           0 :         return 0;
    6680             : }
    6681             : 
    6682           0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_immediate(PyObject *obj, void *closure)
    6683             : {
    6684           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
    6685             :         PyObject *py_immediate;
    6686           0 :         py_immediate = PyLong_FromUnsignedLongLong((uint32_t)object->in.immediate);
    6687           0 :         return py_immediate;
    6688             : }
    6689             : 
    6690           0 : static int py_svcctl_SCSetServiceBitsW_in_set_immediate(PyObject *py_obj, PyObject *value, void *closure)
    6691             : {
    6692           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6693           0 :         if (value == NULL) {
    6694           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.immediate");
    6695           0 :                 return -1;
    6696             :         }
    6697             :         {
    6698           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.immediate));
    6699           0 :                 if (PyLong_Check(value)) {
    6700             :                         unsigned long long test_var;
    6701           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6702           0 :                         if (PyErr_Occurred() != NULL) {
    6703           0 :                                 return -1;
    6704             :                         }
    6705           0 :                         if (test_var > uint_max) {
    6706           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6707             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6708           0 :                                 return -1;
    6709             :                         }
    6710           0 :                         object->in.immediate = test_var;
    6711             :                 } else {
    6712           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6713             :                           PyLong_Type.tp_name);
    6714           0 :                         return -1;
    6715             :                 }
    6716             :         }
    6717           0 :         return 0;
    6718             : }
    6719             : 
    6720           0 : static PyObject *py_svcctl_SCSetServiceBitsW_get_result(PyObject *obj, void *closure)
    6721             : {
    6722           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
    6723             :         PyObject *py_result;
    6724           0 :         py_result = PyErr_FromWERROR(object->out.result);
    6725           0 :         return py_result;
    6726             : }
    6727             : 
    6728           0 : static int py_svcctl_SCSetServiceBitsW_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6729             : {
    6730           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6731           0 :         if (value == NULL) {
    6732           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    6733           0 :                 return -1;
    6734             :         }
    6735           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    6736           0 :         return 0;
    6737             : }
    6738             : 
    6739             : static PyGetSetDef py_svcctl_SCSetServiceBitsW_getsetters[] = {
    6740             :         {
    6741             :                 .name = discard_const_p(char, "in_handle"),
    6742             :                 .get = py_svcctl_SCSetServiceBitsW_in_get_handle,
    6743             :                 .set = py_svcctl_SCSetServiceBitsW_in_set_handle,
    6744             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    6745             :         },
    6746             :         {
    6747             :                 .name = discard_const_p(char, "in_bits"),
    6748             :                 .get = py_svcctl_SCSetServiceBitsW_in_get_bits,
    6749             :                 .set = py_svcctl_SCSetServiceBitsW_in_set_bits,
    6750             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6751             :         },
    6752             :         {
    6753             :                 .name = discard_const_p(char, "in_bitson"),
    6754             :                 .get = py_svcctl_SCSetServiceBitsW_in_get_bitson,
    6755             :                 .set = py_svcctl_SCSetServiceBitsW_in_set_bitson,
    6756             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6757             :         },
    6758             :         {
    6759             :                 .name = discard_const_p(char, "in_immediate"),
    6760             :                 .get = py_svcctl_SCSetServiceBitsW_in_get_immediate,
    6761             :                 .set = py_svcctl_SCSetServiceBitsW_in_set_immediate,
    6762             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6763             :         },
    6764             :         {
    6765             :                 .name = discard_const_p(char, "result"),
    6766             :                 .get = py_svcctl_SCSetServiceBitsW_get_result,
    6767             :                 .set = py_svcctl_SCSetServiceBitsW_set_result,
    6768             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    6769             :         },
    6770             :         { .name = NULL }
    6771             : };
    6772             : 
    6773           0 : static PyObject *py_svcctl_SCSetServiceBitsW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6774             : {
    6775           0 :         PyObject *self = pytalloc_new(struct svcctl_SCSetServiceBitsW, type);
    6776           0 :         struct svcctl_SCSetServiceBitsW *_self = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(self);
    6777           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    6778           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    6779           0 :         return self;
    6780             : }
    6781             : 
    6782           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6783             : {
    6784             : 
    6785             : 
    6786           0 :         return PyLong_FromLong(10);
    6787             : }
    6788             : 
    6789           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    6790             : {
    6791           0 :         const struct ndr_interface_call *call = NULL;
    6792           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6793           0 :         PyObject *ret = NULL;
    6794           0 :         struct ndr_push *push = NULL;
    6795             :         DATA_BLOB blob;
    6796             :         enum ndr_err_code err;
    6797             : 
    6798           0 :         if (ndr_table_svcctl.num_calls < 11) {
    6799           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_pack");
    6800           0 :                 return NULL;
    6801             :         }
    6802           0 :         call = &ndr_table_svcctl.calls[10];
    6803             : 
    6804           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6805           0 :         if (push == NULL) {
    6806           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6807           0 :                 return NULL;
    6808             :         }
    6809             : 
    6810           0 :         push->flags |= ndr_push_flags;
    6811             : 
    6812           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6813           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6814           0 :                 TALLOC_FREE(push);
    6815           0 :                 PyErr_SetNdrError(err);
    6816           0 :                 return NULL;
    6817             :         }
    6818           0 :         blob = ndr_push_blob(push);
    6819           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6820           0 :         TALLOC_FREE(push);
    6821           0 :         return ret;
    6822             : }
    6823             : 
    6824           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6825             : {
    6826           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6827           0 :         PyObject *bigendian_obj = NULL;
    6828           0 :         PyObject *ndr64_obj = NULL;
    6829           0 :         uint32_t ndr_push_flags = 0;
    6830             : 
    6831           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6832             :                 discard_const_p(char *, kwnames),
    6833             :                 &bigendian_obj,
    6834             :                 &ndr64_obj)) {
    6835           0 :                 return NULL;
    6836             :         }
    6837             : 
    6838           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6839           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6840             :         }
    6841           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6842           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6843             :         }
    6844             : 
    6845           0 :         return py_svcctl_SCSetServiceBitsW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6846             : }
    6847             : 
    6848           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6849             : {
    6850           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6851           0 :         PyObject *bigendian_obj = NULL;
    6852           0 :         PyObject *ndr64_obj = NULL;
    6853           0 :         uint32_t ndr_push_flags = 0;
    6854             : 
    6855           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6856             :                 discard_const_p(char *, kwnames),
    6857             :                 &bigendian_obj,
    6858             :                 &ndr64_obj)) {
    6859           0 :                 return NULL;
    6860             :         }
    6861             : 
    6862           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6863           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6864             :         }
    6865           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6866           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6867             :         }
    6868             : 
    6869           0 :         return py_svcctl_SCSetServiceBitsW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6870             : }
    6871             : 
    6872           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    6873             : {
    6874           0 :         const struct ndr_interface_call *call = NULL;
    6875           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6876           0 :         struct ndr_pull *pull = NULL;
    6877             :         enum ndr_err_code err;
    6878             : 
    6879           0 :         if (ndr_table_svcctl.num_calls < 11) {
    6880           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_unpack");
    6881           0 :                 return NULL;
    6882             :         }
    6883           0 :         call = &ndr_table_svcctl.calls[10];
    6884             : 
    6885           0 :         pull = ndr_pull_init_blob(blob, object);
    6886           0 :         if (pull == NULL) {
    6887           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6888           0 :                 return NULL;
    6889             :         }
    6890             : 
    6891           0 :         pull->flags |= ndr_pull_flags;
    6892             : 
    6893           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6894           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6895           0 :                 TALLOC_FREE(pull);
    6896           0 :                 PyErr_SetNdrError(err);
    6897           0 :                 return NULL;
    6898             :         }
    6899           0 :         if (!allow_remaining) {
    6900             :                 uint32_t highest_ofs;
    6901             : 
    6902           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6903           0 :                         highest_ofs = pull->offset;
    6904             :                 } else {
    6905           0 :                         highest_ofs = pull->relative_highest_offset;
    6906             :                 }
    6907           0 :                 if (highest_ofs < pull->data_size) {
    6908           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6909             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6910             :                                 highest_ofs, pull->data_size);
    6911           0 :                         TALLOC_FREE(pull);
    6912           0 :                         PyErr_SetNdrError(err);
    6913           0 :                         return NULL;
    6914             :                 }
    6915             :         }
    6916             : 
    6917           0 :         TALLOC_FREE(pull);
    6918           0 :         Py_RETURN_NONE;
    6919             : }
    6920             : 
    6921           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6922             : {
    6923             :         DATA_BLOB blob;
    6924           0 :         Py_ssize_t blob_length = 0;
    6925           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6926           0 :         PyObject *bigendian_obj = NULL;
    6927           0 :         PyObject *ndr64_obj = NULL;
    6928           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6929           0 :         PyObject *allow_remaining_obj = NULL;
    6930           0 :         bool allow_remaining = false;
    6931             : 
    6932           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6933             :                 discard_const_p(char *, kwnames),
    6934             :                 &blob.data, &blob_length,
    6935             :                 &bigendian_obj,
    6936             :                 &ndr64_obj,
    6937             :                 &allow_remaining_obj)) {
    6938           0 :                 return NULL;
    6939             :         }
    6940           0 :         blob.length = blob_length;
    6941             : 
    6942           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6943           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6944             :         }
    6945           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6946           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6947             :         }
    6948             : 
    6949           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6950           0 :                 allow_remaining = true;
    6951             :         }
    6952             : 
    6953           0 :         return py_svcctl_SCSetServiceBitsW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6954             : }
    6955             : 
    6956           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6957             : {
    6958             :         DATA_BLOB blob;
    6959           0 :         Py_ssize_t blob_length = 0;
    6960           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6961           0 :         PyObject *bigendian_obj = NULL;
    6962           0 :         PyObject *ndr64_obj = NULL;
    6963           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6964           0 :         PyObject *allow_remaining_obj = NULL;
    6965           0 :         bool allow_remaining = false;
    6966             : 
    6967           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6968             :                 discard_const_p(char *, kwnames),
    6969             :                 &blob.data, &blob_length,
    6970             :                 &bigendian_obj,
    6971             :                 &ndr64_obj,
    6972             :                 &allow_remaining_obj)) {
    6973           0 :                 return NULL;
    6974             :         }
    6975           0 :         blob.length = blob_length;
    6976             : 
    6977           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6978           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6979             :         }
    6980           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6981           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6982             :         }
    6983             : 
    6984           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6985           0 :                 allow_remaining = true;
    6986             :         }
    6987             : 
    6988           0 :         return py_svcctl_SCSetServiceBitsW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6989             : }
    6990             : 
    6991           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    6992             : {
    6993           0 :         const struct ndr_interface_call *call = NULL;
    6994           0 :         struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
    6995             :         PyObject *ret;
    6996             :         char *retstr;
    6997             : 
    6998           0 :         if (ndr_table_svcctl.num_calls < 11) {
    6999           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_print");
    7000           0 :                 return NULL;
    7001             :         }
    7002           0 :         call = &ndr_table_svcctl.calls[10];
    7003             : 
    7004           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    7005           0 :         ret = PyUnicode_FromString(retstr);
    7006           0 :         TALLOC_FREE(retstr);
    7007             : 
    7008           0 :         return ret;
    7009             : }
    7010             : 
    7011           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7012             : {
    7013           0 :         return py_svcctl_SCSetServiceBitsW_ndr_print(py_obj, "svcctl_SCSetServiceBitsW_in", NDR_IN);
    7014             : }
    7015             : 
    7016           0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7017             : {
    7018           0 :         return py_svcctl_SCSetServiceBitsW_ndr_print(py_obj, "svcctl_SCSetServiceBitsW_out", NDR_OUT);
    7019             : }
    7020             : 
    7021             : static PyMethodDef py_svcctl_SCSetServiceBitsW_methods[] = {
    7022             :         { "opnum", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_opnum, METH_NOARGS|METH_CLASS,
    7023             :                 "svcctl.SCSetServiceBitsW.opnum() -> 10 (0x0a) " },
    7024             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    7025             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    7026             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    7027             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    7028             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    7029             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    7030             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    7031             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    7032             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    7033             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    7034             :         { NULL, NULL, 0, NULL }
    7035             : };
    7036             : 
    7037             : 
    7038             : static PyTypeObject svcctl_SCSetServiceBitsW_Type = {
    7039             :         PyVarObject_HEAD_INIT(NULL, 0)
    7040             :         .tp_name = "svcctl.SCSetServiceBitsW",
    7041             :         .tp_getset = py_svcctl_SCSetServiceBitsW_getsetters,
    7042             :         .tp_methods = py_svcctl_SCSetServiceBitsW_methods,
    7043             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7044             :         .tp_new = py_svcctl_SCSetServiceBitsW_new,
    7045             : };
    7046             : 
    7047           0 : static bool pack_py_svcctl_SCSetServiceBitsW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SCSetServiceBitsW *r)
    7048             : {
    7049             :         PyObject *py_handle;
    7050             :         PyObject *py_bits;
    7051             :         PyObject *py_bitson;
    7052             :         PyObject *py_immediate;
    7053           0 :         const char *kwnames[] = {
    7054             :                 "handle", "bits", "bitson", "immediate", NULL
    7055             :         };
    7056             : 
    7057           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:svcctl_SCSetServiceBitsW", discard_const_p(char *, kwnames), &py_handle, &py_bits, &py_bitson, &py_immediate)) {
    7058           0 :                 return false;
    7059             :         }
    7060             : 
    7061           0 :         if (py_handle == NULL) {
    7062           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    7063           0 :                 return false;
    7064             :         }
    7065           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    7066           0 :         if (r->in.handle == NULL) {
    7067           0 :                 PyErr_NoMemory();
    7068           0 :                 return false;
    7069             :         }
    7070           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    7071           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    7072           0 :                 PyErr_NoMemory();
    7073           0 :                 return false;
    7074             :         }
    7075           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    7076           0 :         if (py_bits == NULL) {
    7077           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bits");
    7078           0 :                 return false;
    7079             :         }
    7080             :         {
    7081           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bits));
    7082           0 :                 if (PyLong_Check(py_bits)) {
    7083             :                         unsigned long long test_var;
    7084           0 :                         test_var = PyLong_AsUnsignedLongLong(py_bits);
    7085           0 :                         if (PyErr_Occurred() != NULL) {
    7086           0 :                                 return false;
    7087             :                         }
    7088           0 :                         if (test_var > uint_max) {
    7089           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7090             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7091           0 :                                 return false;
    7092             :                         }
    7093           0 :                         r->in.bits = test_var;
    7094             :                 } else {
    7095           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7096             :                           PyLong_Type.tp_name);
    7097           0 :                         return false;
    7098             :                 }
    7099             :         }
    7100           0 :         if (py_bitson == NULL) {
    7101           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bitson");
    7102           0 :                 return false;
    7103             :         }
    7104             :         {
    7105           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bitson));
    7106           0 :                 if (PyLong_Check(py_bitson)) {
    7107             :                         unsigned long long test_var;
    7108           0 :                         test_var = PyLong_AsUnsignedLongLong(py_bitson);
    7109           0 :                         if (PyErr_Occurred() != NULL) {
    7110           0 :                                 return false;
    7111             :                         }
    7112           0 :                         if (test_var > uint_max) {
    7113           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7114             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7115           0 :                                 return false;
    7116             :                         }
    7117           0 :                         r->in.bitson = test_var;
    7118             :                 } else {
    7119           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7120             :                           PyLong_Type.tp_name);
    7121           0 :                         return false;
    7122             :                 }
    7123             :         }
    7124           0 :         if (py_immediate == NULL) {
    7125           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.immediate");
    7126           0 :                 return false;
    7127             :         }
    7128             :         {
    7129           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.immediate));
    7130           0 :                 if (PyLong_Check(py_immediate)) {
    7131             :                         unsigned long long test_var;
    7132           0 :                         test_var = PyLong_AsUnsignedLongLong(py_immediate);
    7133           0 :                         if (PyErr_Occurred() != NULL) {
    7134           0 :                                 return false;
    7135             :                         }
    7136           0 :                         if (test_var > uint_max) {
    7137           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7138             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7139           0 :                                 return false;
    7140             :                         }
    7141           0 :                         r->in.immediate = test_var;
    7142             :                 } else {
    7143           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7144             :                           PyLong_Type.tp_name);
    7145           0 :                         return false;
    7146             :                 }
    7147             :         }
    7148           0 :         return true;
    7149             : }
    7150             : 
    7151           0 : static PyObject *unpack_py_svcctl_SCSetServiceBitsW_args_out(struct svcctl_SCSetServiceBitsW *r)
    7152             : {
    7153             :         PyObject *result;
    7154           0 :         result = Py_None;
    7155           0 :         Py_INCREF(result);
    7156           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    7157           0 :                 PyErr_SetWERROR(r->out.result);
    7158           0 :                 return NULL;
    7159             :         }
    7160             : 
    7161           0 :         return result;
    7162             : }
    7163             : 
    7164             : 
    7165           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_handle(PyObject *obj, void *closure)
    7166             : {
    7167           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7168             :         PyObject *py_handle;
    7169           0 :         if (object->in.handle == NULL) {
    7170           0 :                 Py_RETURN_NONE;
    7171             :         }
    7172           0 :         py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
    7173           0 :         return py_handle;
    7174             : }
    7175             : 
    7176           0 : static int py_svcctl_ChangeServiceConfigW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
    7177             : {
    7178           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7179           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
    7180           0 :         if (value == NULL) {
    7181           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
    7182           0 :                 return -1;
    7183             :         }
    7184           0 :         object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
    7185           0 :         if (object->in.handle == NULL) {
    7186           0 :                 PyErr_NoMemory();
    7187           0 :                 return -1;
    7188             :         }
    7189           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    7190           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7191           0 :                 PyErr_NoMemory();
    7192           0 :                 return -1;
    7193             :         }
    7194           0 :         object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
    7195           0 :         return 0;
    7196             : }
    7197             : 
    7198           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_type(PyObject *obj, void *closure)
    7199             : {
    7200           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7201             :         PyObject *py_type;
    7202           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
    7203           0 :         return py_type;
    7204             : }
    7205             : 
    7206           0 : static int py_svcctl_ChangeServiceConfigW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
    7207             : {
    7208           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7209           0 :         if (value == NULL) {
    7210           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
    7211           0 :                 return -1;
    7212             :         }
    7213             :         {
    7214           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
    7215           0 :                 if (PyLong_Check(value)) {
    7216             :                         unsigned long long test_var;
    7217           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7218           0 :                         if (PyErr_Occurred() != NULL) {
    7219           0 :                                 return -1;
    7220             :                         }
    7221           0 :                         if (test_var > uint_max) {
    7222           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7223             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7224           0 :                                 return -1;
    7225             :                         }
    7226           0 :                         object->in.type = test_var;
    7227             :                 } else {
    7228           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7229             :                           PyLong_Type.tp_name);
    7230           0 :                         return -1;
    7231             :                 }
    7232             :         }
    7233           0 :         return 0;
    7234             : }
    7235             : 
    7236           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_start_type(PyObject *obj, void *closure)
    7237             : {
    7238           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7239             :         PyObject *py_start_type;
    7240           0 :         py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
    7241           0 :         return py_start_type;
    7242             : }
    7243             : 
    7244           0 : static int py_svcctl_ChangeServiceConfigW_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
    7245             : {
    7246           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7247           0 :         if (value == NULL) {
    7248           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
    7249           0 :                 return -1;
    7250             :         }
    7251             :         {
    7252           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
    7253           0 :                 if (PyLong_Check(value)) {
    7254             :                         unsigned long long test_var;
    7255           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7256           0 :                         if (PyErr_Occurred() != NULL) {
    7257           0 :                                 return -1;
    7258             :                         }
    7259           0 :                         if (test_var > uint_max) {
    7260           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7261             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7262           0 :                                 return -1;
    7263             :                         }
    7264           0 :                         object->in.start_type = test_var;
    7265             :                 } else {
    7266           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7267             :                           PyLong_Type.tp_name);
    7268           0 :                         return -1;
    7269             :                 }
    7270             :         }
    7271           0 :         return 0;
    7272             : }
    7273             : 
    7274           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_error_control(PyObject *obj, void *closure)
    7275             : {
    7276           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7277             :         PyObject *py_error_control;
    7278           0 :         py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
    7279           0 :         return py_error_control;
    7280             : }
    7281             : 
    7282           0 : static int py_svcctl_ChangeServiceConfigW_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
    7283             : {
    7284           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7285           0 :         if (value == NULL) {
    7286           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
    7287           0 :                 return -1;
    7288             :         }
    7289             :         {
    7290           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
    7291           0 :                 if (PyLong_Check(value)) {
    7292             :                         unsigned long long test_var;
    7293           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7294           0 :                         if (PyErr_Occurred() != NULL) {
    7295           0 :                                 return -1;
    7296             :                         }
    7297           0 :                         if (test_var > uint_max) {
    7298           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7299             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7300           0 :                                 return -1;
    7301             :                         }
    7302           0 :                         object->in.error_control = test_var;
    7303             :                 } else {
    7304           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7305             :                           PyLong_Type.tp_name);
    7306           0 :                         return -1;
    7307             :                 }
    7308             :         }
    7309           0 :         return 0;
    7310             : }
    7311             : 
    7312           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_binary_path(PyObject *obj, void *closure)
    7313             : {
    7314           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7315             :         PyObject *py_binary_path;
    7316           0 :         if (object->in.binary_path == NULL) {
    7317           0 :                 Py_RETURN_NONE;
    7318             :         }
    7319           0 :         if (object->in.binary_path == NULL) {
    7320           0 :                 py_binary_path = Py_None;
    7321           0 :                 Py_INCREF(py_binary_path);
    7322             :         } else {
    7323           0 :                 if (object->in.binary_path == NULL) {
    7324           0 :                         py_binary_path = Py_None;
    7325           0 :                         Py_INCREF(py_binary_path);
    7326             :                 } else {
    7327           0 :                         py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
    7328             :                 }
    7329             :         }
    7330           0 :         return py_binary_path;
    7331             : }
    7332             : 
    7333           0 : static int py_svcctl_ChangeServiceConfigW_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
    7334             : {
    7335           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7336           0 :         if (value == NULL) {
    7337           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
    7338           0 :                 return -1;
    7339             :         }
    7340           0 :         if (value == Py_None) {
    7341           0 :                 object->in.binary_path = NULL;
    7342             :         } else {
    7343           0 :                 object->in.binary_path = NULL;
    7344             :                 {
    7345             :                         const char *test_str;
    7346             :                         const char *talloc_str;
    7347           0 :                         PyObject *unicode = NULL;
    7348           0 :                         if (PyUnicode_Check(value)) {
    7349           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7350           0 :                                 if (unicode == NULL) {
    7351           0 :                                         PyErr_NoMemory();
    7352           0 :                                         return -1;
    7353             :                                 }
    7354           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7355           0 :                         } else if (PyBytes_Check(value)) {
    7356           0 :                                 test_str = PyBytes_AS_STRING(value);
    7357             :                         } else {
    7358           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7359           0 :                                 return -1;
    7360             :                         }
    7361           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7362           0 :                         if (unicode != NULL) {
    7363           0 :                                 Py_DECREF(unicode);
    7364             :                         }
    7365           0 :                         if (talloc_str == NULL) {
    7366           0 :                                 PyErr_NoMemory();
    7367           0 :                                 return -1;
    7368             :                         }
    7369           0 :                         object->in.binary_path = talloc_str;
    7370             :                 }
    7371             :         }
    7372           0 :         return 0;
    7373             : }
    7374             : 
    7375           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_load_order_group(PyObject *obj, void *closure)
    7376             : {
    7377           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7378             :         PyObject *py_load_order_group;
    7379           0 :         if (object->in.load_order_group == NULL) {
    7380           0 :                 Py_RETURN_NONE;
    7381             :         }
    7382           0 :         if (object->in.load_order_group == NULL) {
    7383           0 :                 py_load_order_group = Py_None;
    7384           0 :                 Py_INCREF(py_load_order_group);
    7385             :         } else {
    7386           0 :                 if (object->in.load_order_group == NULL) {
    7387           0 :                         py_load_order_group = Py_None;
    7388           0 :                         Py_INCREF(py_load_order_group);
    7389             :                 } else {
    7390           0 :                         py_load_order_group = PyUnicode_Decode(object->in.load_order_group, strlen(object->in.load_order_group), "utf-8", "ignore");
    7391             :                 }
    7392             :         }
    7393           0 :         return py_load_order_group;
    7394             : }
    7395             : 
    7396           0 : static int py_svcctl_ChangeServiceConfigW_in_set_load_order_group(PyObject *py_obj, PyObject *value, void *closure)
    7397             : {
    7398           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7399           0 :         if (value == NULL) {
    7400           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.load_order_group");
    7401           0 :                 return -1;
    7402             :         }
    7403           0 :         if (value == Py_None) {
    7404           0 :                 object->in.load_order_group = NULL;
    7405             :         } else {
    7406           0 :                 object->in.load_order_group = NULL;
    7407             :                 {
    7408             :                         const char *test_str;
    7409             :                         const char *talloc_str;
    7410           0 :                         PyObject *unicode = NULL;
    7411           0 :                         if (PyUnicode_Check(value)) {
    7412           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7413           0 :                                 if (unicode == NULL) {
    7414           0 :                                         PyErr_NoMemory();
    7415           0 :                                         return -1;
    7416             :                                 }
    7417           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7418           0 :                         } else if (PyBytes_Check(value)) {
    7419           0 :                                 test_str = PyBytes_AS_STRING(value);
    7420             :                         } else {
    7421           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7422           0 :                                 return -1;
    7423             :                         }
    7424           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7425           0 :                         if (unicode != NULL) {
    7426           0 :                                 Py_DECREF(unicode);
    7427             :                         }
    7428           0 :                         if (talloc_str == NULL) {
    7429           0 :                                 PyErr_NoMemory();
    7430           0 :                                 return -1;
    7431             :                         }
    7432           0 :                         object->in.load_order_group = talloc_str;
    7433             :                 }
    7434             :         }
    7435           0 :         return 0;
    7436             : }
    7437             : 
    7438           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_tag_id(PyObject *obj, void *closure)
    7439             : {
    7440           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7441             :         PyObject *py_tag_id;
    7442           0 :         if (object->in.tag_id == NULL) {
    7443           0 :                 Py_RETURN_NONE;
    7444             :         }
    7445           0 :         if (object->in.tag_id == NULL) {
    7446           0 :                 py_tag_id = Py_None;
    7447           0 :                 Py_INCREF(py_tag_id);
    7448             :         } else {
    7449           0 :                 py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->in.tag_id);
    7450             :         }
    7451           0 :         return py_tag_id;
    7452             : }
    7453             : 
    7454           0 : static int py_svcctl_ChangeServiceConfigW_in_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
    7455             : {
    7456           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7457           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.tag_id));
    7458           0 :         if (value == NULL) {
    7459           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.tag_id");
    7460           0 :                 return -1;
    7461             :         }
    7462           0 :         if (value == Py_None) {
    7463           0 :                 object->in.tag_id = NULL;
    7464             :         } else {
    7465           0 :                 object->in.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.tag_id);
    7466           0 :                 if (object->in.tag_id == NULL) {
    7467           0 :                         PyErr_NoMemory();
    7468           0 :                         return -1;
    7469             :                 }
    7470             :                 {
    7471           0 :                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.tag_id));
    7472           0 :                         if (PyLong_Check(value)) {
    7473             :                                 unsigned long long test_var;
    7474           0 :                                 test_var = PyLong_AsUnsignedLongLong(value);
    7475           0 :                                 if (PyErr_Occurred() != NULL) {
    7476           0 :                                         return -1;
    7477             :                                 }
    7478           0 :                                 if (test_var > uint_max) {
    7479           0 :                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7480             :                                           PyLong_Type.tp_name, uint_max, test_var);
    7481           0 :                                         return -1;
    7482             :                                 }
    7483           0 :                                 *object->in.tag_id = test_var;
    7484             :                         } else {
    7485           0 :                                 PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7486             :                                   PyLong_Type.tp_name);
    7487           0 :                                 return -1;
    7488             :                         }
    7489             :                 }
    7490             :         }
    7491           0 :         return 0;
    7492             : }
    7493             : 
    7494           0 : static PyObject *py_svcctl_ChangeServiceConfigW_out_get_tag_id(PyObject *obj, void *closure)
    7495             : {
    7496           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7497             :         PyObject *py_tag_id;
    7498           0 :         if (object->out.tag_id == NULL) {
    7499           0 :                 Py_RETURN_NONE;
    7500             :         }
    7501           0 :         if (object->out.tag_id == NULL) {
    7502           0 :                 py_tag_id = Py_None;
    7503           0 :                 Py_INCREF(py_tag_id);
    7504             :         } else {
    7505           0 :                 py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->out.tag_id);
    7506             :         }
    7507           0 :         return py_tag_id;
    7508             : }
    7509             : 
    7510           0 : static int py_svcctl_ChangeServiceConfigW_out_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
    7511             : {
    7512           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7513           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.tag_id));
    7514           0 :         if (value == NULL) {
    7515           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.tag_id");
    7516           0 :                 return -1;
    7517             :         }
    7518           0 :         if (value == Py_None) {
    7519           0 :                 object->out.tag_id = NULL;
    7520             :         } else {
    7521           0 :                 object->out.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.tag_id);
    7522           0 :                 if (object->out.tag_id == NULL) {
    7523           0 :                         PyErr_NoMemory();
    7524           0 :                         return -1;
    7525             :                 }
    7526             :                 {
    7527           0 :                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.tag_id));
    7528           0 :                         if (PyLong_Check(value)) {
    7529             :                                 unsigned long long test_var;
    7530           0 :                                 test_var = PyLong_AsUnsignedLongLong(value);
    7531           0 :                                 if (PyErr_Occurred() != NULL) {
    7532           0 :                                         return -1;
    7533             :                                 }
    7534           0 :                                 if (test_var > uint_max) {
    7535           0 :                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7536             :                                           PyLong_Type.tp_name, uint_max, test_var);
    7537           0 :                                         return -1;
    7538             :                                 }
    7539           0 :                                 *object->out.tag_id = test_var;
    7540             :                         } else {
    7541           0 :                                 PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7542             :                                   PyLong_Type.tp_name);
    7543           0 :                                 return -1;
    7544             :                         }
    7545             :                 }
    7546             :         }
    7547           0 :         return 0;
    7548             : }
    7549             : 
    7550           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dependencies(PyObject *obj, void *closure)
    7551             : {
    7552           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7553             :         PyObject *py_dependencies;
    7554           0 :         if (object->in.dependencies == NULL) {
    7555           0 :                 Py_RETURN_NONE;
    7556             :         }
    7557           0 :         if (object->in.dependencies == NULL) {
    7558           0 :                 py_dependencies = Py_None;
    7559           0 :                 Py_INCREF(py_dependencies);
    7560             :         } else {
    7561           0 :                 if (object->in.dependencies == NULL) {
    7562           0 :                         py_dependencies = Py_None;
    7563           0 :                         Py_INCREF(py_dependencies);
    7564             :                 } else {
    7565           0 :                         py_dependencies = PyUnicode_Decode(object->in.dependencies, strlen(object->in.dependencies), "utf-8", "ignore");
    7566             :                 }
    7567             :         }
    7568           0 :         return py_dependencies;
    7569             : }
    7570             : 
    7571           0 : static int py_svcctl_ChangeServiceConfigW_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
    7572             : {
    7573           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7574           0 :         if (value == NULL) {
    7575           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
    7576           0 :                 return -1;
    7577             :         }
    7578           0 :         if (value == Py_None) {
    7579           0 :                 object->in.dependencies = NULL;
    7580             :         } else {
    7581           0 :                 object->in.dependencies = NULL;
    7582             :                 {
    7583             :                         const char *test_str;
    7584             :                         const char *talloc_str;
    7585           0 :                         PyObject *unicode = NULL;
    7586           0 :                         if (PyUnicode_Check(value)) {
    7587           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7588           0 :                                 if (unicode == NULL) {
    7589           0 :                                         PyErr_NoMemory();
    7590           0 :                                         return -1;
    7591             :                                 }
    7592           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7593           0 :                         } else if (PyBytes_Check(value)) {
    7594           0 :                                 test_str = PyBytes_AS_STRING(value);
    7595             :                         } else {
    7596           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7597           0 :                                 return -1;
    7598             :                         }
    7599           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7600           0 :                         if (unicode != NULL) {
    7601           0 :                                 Py_DECREF(unicode);
    7602             :                         }
    7603           0 :                         if (talloc_str == NULL) {
    7604           0 :                                 PyErr_NoMemory();
    7605           0 :                                 return -1;
    7606             :                         }
    7607           0 :                         object->in.dependencies = talloc_str;
    7608             :                 }
    7609             :         }
    7610           0 :         return 0;
    7611             : }
    7612             : 
    7613           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dwDependSize(PyObject *obj, void *closure)
    7614             : {
    7615           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7616             :         PyObject *py_dwDependSize;
    7617           0 :         py_dwDependSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDependSize);
    7618           0 :         return py_dwDependSize;
    7619             : }
    7620             : 
    7621           0 : static int py_svcctl_ChangeServiceConfigW_in_set_dwDependSize(PyObject *py_obj, PyObject *value, void *closure)
    7622             : {
    7623           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7624           0 :         if (value == NULL) {
    7625           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDependSize");
    7626           0 :                 return -1;
    7627             :         }
    7628             :         {
    7629           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDependSize));
    7630           0 :                 if (PyLong_Check(value)) {
    7631             :                         unsigned long long test_var;
    7632           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7633           0 :                         if (PyErr_Occurred() != NULL) {
    7634           0 :                                 return -1;
    7635             :                         }
    7636           0 :                         if (test_var > uint_max) {
    7637           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7638             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7639           0 :                                 return -1;
    7640             :                         }
    7641           0 :                         object->in.dwDependSize = test_var;
    7642             :                 } else {
    7643           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7644             :                           PyLong_Type.tp_name);
    7645           0 :                         return -1;
    7646             :                 }
    7647             :         }
    7648           0 :         return 0;
    7649             : }
    7650             : 
    7651           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_service_start_name(PyObject *obj, void *closure)
    7652             : {
    7653           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7654             :         PyObject *py_service_start_name;
    7655           0 :         if (object->in.service_start_name == NULL) {
    7656           0 :                 Py_RETURN_NONE;
    7657             :         }
    7658           0 :         if (object->in.service_start_name == NULL) {
    7659           0 :                 py_service_start_name = Py_None;
    7660           0 :                 Py_INCREF(py_service_start_name);
    7661             :         } else {
    7662           0 :                 if (object->in.service_start_name == NULL) {
    7663           0 :                         py_service_start_name = Py_None;
    7664           0 :                         Py_INCREF(py_service_start_name);
    7665             :                 } else {
    7666           0 :                         py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
    7667             :                 }
    7668             :         }
    7669           0 :         return py_service_start_name;
    7670             : }
    7671             : 
    7672           0 : static int py_svcctl_ChangeServiceConfigW_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
    7673             : {
    7674           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7675           0 :         if (value == NULL) {
    7676           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
    7677           0 :                 return -1;
    7678             :         }
    7679           0 :         if (value == Py_None) {
    7680           0 :                 object->in.service_start_name = NULL;
    7681             :         } else {
    7682           0 :                 object->in.service_start_name = NULL;
    7683             :                 {
    7684             :                         const char *test_str;
    7685             :                         const char *talloc_str;
    7686           0 :                         PyObject *unicode = NULL;
    7687           0 :                         if (PyUnicode_Check(value)) {
    7688           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7689           0 :                                 if (unicode == NULL) {
    7690           0 :                                         PyErr_NoMemory();
    7691           0 :                                         return -1;
    7692             :                                 }
    7693           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7694           0 :                         } else if (PyBytes_Check(value)) {
    7695           0 :                                 test_str = PyBytes_AS_STRING(value);
    7696             :                         } else {
    7697           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7698           0 :                                 return -1;
    7699             :                         }
    7700           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7701           0 :                         if (unicode != NULL) {
    7702           0 :                                 Py_DECREF(unicode);
    7703             :                         }
    7704           0 :                         if (talloc_str == NULL) {
    7705           0 :                                 PyErr_NoMemory();
    7706           0 :                                 return -1;
    7707             :                         }
    7708           0 :                         object->in.service_start_name = talloc_str;
    7709             :                 }
    7710             :         }
    7711           0 :         return 0;
    7712             : }
    7713             : 
    7714           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_password(PyObject *obj, void *closure)
    7715             : {
    7716           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7717             :         PyObject *py_password;
    7718           0 :         if (object->in.password == NULL) {
    7719           0 :                 Py_RETURN_NONE;
    7720             :         }
    7721           0 :         if (object->in.password == NULL) {
    7722           0 :                 py_password = Py_None;
    7723           0 :                 Py_INCREF(py_password);
    7724             :         } else {
    7725           0 :                 if (object->in.password == NULL) {
    7726           0 :                         py_password = Py_None;
    7727           0 :                         Py_INCREF(py_password);
    7728             :                 } else {
    7729           0 :                         py_password = PyUnicode_Decode(object->in.password, strlen(object->in.password), "utf-8", "ignore");
    7730             :                 }
    7731             :         }
    7732           0 :         return py_password;
    7733             : }
    7734             : 
    7735           0 : static int py_svcctl_ChangeServiceConfigW_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
    7736             : {
    7737           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7738           0 :         if (value == NULL) {
    7739           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
    7740           0 :                 return -1;
    7741             :         }
    7742           0 :         if (value == Py_None) {
    7743           0 :                 object->in.password = NULL;
    7744             :         } else {
    7745           0 :                 object->in.password = NULL;
    7746             :                 {
    7747             :                         const char *test_str;
    7748             :                         const char *talloc_str;
    7749           0 :                         PyObject *unicode = NULL;
    7750           0 :                         if (PyUnicode_Check(value)) {
    7751           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7752           0 :                                 if (unicode == NULL) {
    7753           0 :                                         PyErr_NoMemory();
    7754           0 :                                         return -1;
    7755             :                                 }
    7756           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7757           0 :                         } else if (PyBytes_Check(value)) {
    7758           0 :                                 test_str = PyBytes_AS_STRING(value);
    7759             :                         } else {
    7760           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7761           0 :                                 return -1;
    7762             :                         }
    7763           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7764           0 :                         if (unicode != NULL) {
    7765           0 :                                 Py_DECREF(unicode);
    7766             :                         }
    7767           0 :                         if (talloc_str == NULL) {
    7768           0 :                                 PyErr_NoMemory();
    7769           0 :                                 return -1;
    7770             :                         }
    7771           0 :                         object->in.password = talloc_str;
    7772             :                 }
    7773             :         }
    7774           0 :         return 0;
    7775             : }
    7776             : 
    7777           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dwPwSize(PyObject *obj, void *closure)
    7778             : {
    7779           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7780             :         PyObject *py_dwPwSize;
    7781           0 :         py_dwPwSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwPwSize);
    7782           0 :         return py_dwPwSize;
    7783             : }
    7784             : 
    7785           0 : static int py_svcctl_ChangeServiceConfigW_in_set_dwPwSize(PyObject *py_obj, PyObject *value, void *closure)
    7786             : {
    7787           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7788           0 :         if (value == NULL) {
    7789           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwPwSize");
    7790           0 :                 return -1;
    7791             :         }
    7792             :         {
    7793           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwPwSize));
    7794           0 :                 if (PyLong_Check(value)) {
    7795             :                         unsigned long long test_var;
    7796           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7797           0 :                         if (PyErr_Occurred() != NULL) {
    7798           0 :                                 return -1;
    7799             :                         }
    7800           0 :                         if (test_var > uint_max) {
    7801           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7802             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7803           0 :                                 return -1;
    7804             :                         }
    7805           0 :                         object->in.dwPwSize = test_var;
    7806             :                 } else {
    7807           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7808             :                           PyLong_Type.tp_name);
    7809           0 :                         return -1;
    7810             :                 }
    7811             :         }
    7812           0 :         return 0;
    7813             : }
    7814             : 
    7815           0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_display_name(PyObject *obj, void *closure)
    7816             : {
    7817           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7818             :         PyObject *py_display_name;
    7819           0 :         if (object->in.display_name == NULL) {
    7820           0 :                 Py_RETURN_NONE;
    7821             :         }
    7822           0 :         if (object->in.display_name == NULL) {
    7823           0 :                 py_display_name = Py_None;
    7824           0 :                 Py_INCREF(py_display_name);
    7825             :         } else {
    7826           0 :                 if (object->in.display_name == NULL) {
    7827           0 :                         py_display_name = Py_None;
    7828           0 :                         Py_INCREF(py_display_name);
    7829             :                 } else {
    7830           0 :                         py_display_name = PyUnicode_Decode(object->in.display_name, strlen(object->in.display_name), "utf-8", "ignore");
    7831             :                 }
    7832             :         }
    7833           0 :         return py_display_name;
    7834             : }
    7835             : 
    7836           0 : static int py_svcctl_ChangeServiceConfigW_in_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
    7837             : {
    7838           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7839           0 :         if (value == NULL) {
    7840           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name");
    7841           0 :                 return -1;
    7842             :         }
    7843           0 :         if (value == Py_None) {
    7844           0 :                 object->in.display_name = NULL;
    7845             :         } else {
    7846           0 :                 object->in.display_name = NULL;
    7847             :                 {
    7848             :                         const char *test_str;
    7849             :                         const char *talloc_str;
    7850           0 :                         PyObject *unicode = NULL;
    7851           0 :                         if (PyUnicode_Check(value)) {
    7852           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7853           0 :                                 if (unicode == NULL) {
    7854           0 :                                         PyErr_NoMemory();
    7855           0 :                                         return -1;
    7856             :                                 }
    7857           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7858           0 :                         } else if (PyBytes_Check(value)) {
    7859           0 :                                 test_str = PyBytes_AS_STRING(value);
    7860             :                         } else {
    7861           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7862           0 :                                 return -1;
    7863             :                         }
    7864           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7865           0 :                         if (unicode != NULL) {
    7866           0 :                                 Py_DECREF(unicode);
    7867             :                         }
    7868           0 :                         if (talloc_str == NULL) {
    7869           0 :                                 PyErr_NoMemory();
    7870           0 :                                 return -1;
    7871             :                         }
    7872           0 :                         object->in.display_name = talloc_str;
    7873             :                 }
    7874             :         }
    7875           0 :         return 0;
    7876             : }
    7877             : 
    7878           0 : static PyObject *py_svcctl_ChangeServiceConfigW_get_result(PyObject *obj, void *closure)
    7879             : {
    7880           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
    7881             :         PyObject *py_result;
    7882           0 :         py_result = PyErr_FromWERROR(object->out.result);
    7883           0 :         return py_result;
    7884             : }
    7885             : 
    7886           0 : static int py_svcctl_ChangeServiceConfigW_set_result(PyObject *py_obj, PyObject *value, void *closure)
    7887             : {
    7888           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    7889           0 :         if (value == NULL) {
    7890           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    7891           0 :                 return -1;
    7892             :         }
    7893           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
    7894           0 :         return 0;
    7895             : }
    7896             : 
    7897             : static PyGetSetDef py_svcctl_ChangeServiceConfigW_getsetters[] = {
    7898             :         {
    7899             :                 .name = discard_const_p(char, "in_handle"),
    7900             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_handle,
    7901             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_handle,
    7902             :                 .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
    7903             :         },
    7904             :         {
    7905             :                 .name = discard_const_p(char, "in_type"),
    7906             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_type,
    7907             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_type,
    7908             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7909             :         },
    7910             :         {
    7911             :                 .name = discard_const_p(char, "in_start_type"),
    7912             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_start_type,
    7913             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_start_type,
    7914             :                 .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
    7915             :         },
    7916             :         {
    7917             :                 .name = discard_const_p(char, "in_error_control"),
    7918             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_error_control,
    7919             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_error_control,
    7920             :                 .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
    7921             :         },
    7922             :         {
    7923             :                 .name = discard_const_p(char, "in_binary_path"),
    7924             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_binary_path,
    7925             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_binary_path,
    7926             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7927             :         },
    7928             :         {
    7929             :                 .name = discard_const_p(char, "in_load_order_group"),
    7930             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_load_order_group,
    7931             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_load_order_group,
    7932             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7933             :         },
    7934             :         {
    7935             :                 .name = discard_const_p(char, "in_tag_id"),
    7936             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_tag_id,
    7937             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_tag_id,
    7938             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7939             :         },
    7940             :         {
    7941             :                 .name = discard_const_p(char, "out_tag_id"),
    7942             :                 .get = py_svcctl_ChangeServiceConfigW_out_get_tag_id,
    7943             :                 .set = py_svcctl_ChangeServiceConfigW_out_set_tag_id,
    7944             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7945             :         },
    7946             :         {
    7947             :                 .name = discard_const_p(char, "in_dependencies"),
    7948             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_dependencies,
    7949             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_dependencies,
    7950             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7951             :         },
    7952             :         {
    7953             :                 .name = discard_const_p(char, "in_dwDependSize"),
    7954             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_dwDependSize,
    7955             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_dwDependSize,
    7956             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7957             :         },
    7958             :         {
    7959             :                 .name = discard_const_p(char, "in_service_start_name"),
    7960             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_service_start_name,
    7961             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_service_start_name,
    7962             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7963             :         },
    7964             :         {
    7965             :                 .name = discard_const_p(char, "in_password"),
    7966             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_password,
    7967             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_password,
    7968             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7969             :         },
    7970             :         {
    7971             :                 .name = discard_const_p(char, "in_dwPwSize"),
    7972             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_dwPwSize,
    7973             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_dwPwSize,
    7974             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7975             :         },
    7976             :         {
    7977             :                 .name = discard_const_p(char, "in_display_name"),
    7978             :                 .get = py_svcctl_ChangeServiceConfigW_in_get_display_name,
    7979             :                 .set = py_svcctl_ChangeServiceConfigW_in_set_display_name,
    7980             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7981             :         },
    7982             :         {
    7983             :                 .name = discard_const_p(char, "result"),
    7984             :                 .get = py_svcctl_ChangeServiceConfigW_get_result,
    7985             :                 .set = py_svcctl_ChangeServiceConfigW_set_result,
    7986             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
    7987             :         },
    7988             :         { .name = NULL }
    7989             : };
    7990             : 
    7991           0 : static PyObject *py_svcctl_ChangeServiceConfigW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7992             : {
    7993           0 :         PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfigW, type);
    7994           0 :         struct svcctl_ChangeServiceConfigW *_self = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(self);
    7995           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    7996           0 :         _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
    7997           0 :         return self;
    7998             : }
    7999             : 
    8000           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    8001             : {
    8002             : 
    8003             : 
    8004           0 :         return PyLong_FromLong(11);
    8005             : }
    8006             : 
    8007           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    8008             : {
    8009           0 :         const struct ndr_interface_call *call = NULL;
    8010           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    8011           0 :         PyObject *ret = NULL;
    8012           0 :         struct ndr_push *push = NULL;
    8013             :         DATA_BLOB blob;
    8014             :         enum ndr_err_code err;
    8015             : 
    8016           0 :         if (ndr_table_svcctl.num_calls < 12) {
    8017           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_pack");
    8018           0 :                 return NULL;
    8019             :         }
    8020           0 :         call = &ndr_table_svcctl.calls[11];
    8021             : 
    8022           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    8023           0 :         if (push == NULL) {
    8024           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8025           0 :                 return NULL;
    8026             :         }
    8027             : 
    8028           0 :         push->flags |= ndr_push_flags;
    8029             : 
    8030           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    8031           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8032           0 :                 TALLOC_FREE(push);
    8033           0 :                 PyErr_SetNdrError(err);
    8034           0 :                 return NULL;
    8035             :         }
    8036           0 :         blob = ndr_push_blob(push);
    8037           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8038           0 :         TALLOC_FREE(push);
    8039           0 :         return ret;
    8040             : }
    8041             : 
    8042           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8043             : {
    8044           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8045           0 :         PyObject *bigendian_obj = NULL;
    8046           0 :         PyObject *ndr64_obj = NULL;
    8047           0 :         uint32_t ndr_push_flags = 0;
    8048             : 
    8049           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    8050             :                 discard_const_p(char *, kwnames),
    8051             :                 &bigendian_obj,
    8052             :                 &ndr64_obj)) {
    8053           0 :                 return NULL;
    8054             :         }
    8055             : 
    8056           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8057           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8058             :         }
    8059           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8060           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8061             :         }
    8062             : 
    8063           0 :         return py_svcctl_ChangeServiceConfigW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    8064             : }
    8065             : 
    8066           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8067             : {
    8068           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8069           0 :         PyObject *bigendian_obj = NULL;
    8070           0 :         PyObject *ndr64_obj = NULL;
    8071           0 :         uint32_t ndr_push_flags = 0;
    8072             : 
    8073           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    8074             :                 discard_const_p(char *, kwnames),
    8075             :                 &bigendian_obj,
    8076             :                 &ndr64_obj)) {
    8077           0 :                 return NULL;
    8078             :         }
    8079             : 
    8080           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8081           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8082             :         }
    8083           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8084           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8085             :         }
    8086             : 
    8087           0 :         return py_svcctl_ChangeServiceConfigW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    8088             : }
    8089             : 
    8090           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    8091             : {
    8092           0 :         const struct ndr_interface_call *call = NULL;
    8093           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    8094           0 :         struct ndr_pull *pull = NULL;
    8095             :         enum ndr_err_code err;
    8096             : 
    8097           0 :         if (ndr_table_svcctl.num_calls < 12) {
    8098           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_unpack");
    8099           0 :                 return NULL;
    8100             :         }
    8101           0 :         call = &ndr_table_svcctl.calls[11];
    8102             : 
    8103           0 :         pull = ndr_pull_init_blob(blob, object);
    8104           0 :         if (pull == NULL) {
    8105           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8106           0 :                 return NULL;
    8107             :         }
    8108             : 
    8109           0 :         pull->flags |= ndr_pull_flags;
    8110             : 
    8111           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    8112           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8113           0 :                 TALLOC_FREE(pull);
    8114           0 :                 PyErr_SetNdrError(err);
    8115           0 :                 return NULL;
    8116             :         }
    8117           0 :         if (!allow_remaining) {
    8118             :                 uint32_t highest_ofs;
    8119             : 
    8120           0 :                 if (pull->offset > pull->relative_highest_offset) {
    8121           0 :                         highest_ofs = pull->offset;
    8122             :                 } else {
    8123           0 :                         highest_ofs = pull->relative_highest_offset;
    8124             :                 }
    8125           0 :                 if (highest_ofs < pull->data_size) {
    8126           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    8127             :                                 "not all bytes consumed ofs[%u] size[%u]",
    8128             :                                 highest_ofs, pull->data_size);
    8129           0 :                         TALLOC_FREE(pull);
    8130           0 :                         PyErr_SetNdrError(err);
    8131           0 :                         return NULL;
    8132             :                 }
    8133             :         }
    8134             : 
    8135           0 :         TALLOC_FREE(pull);
    8136           0 :         Py_RETURN_NONE;
    8137             : }
    8138             : 
    8139           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8140             : {
    8141             :         DATA_BLOB blob;
    8142           0 :         Py_ssize_t blob_length = 0;
    8143           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8144           0 :         PyObject *bigendian_obj = NULL;
    8145           0 :         PyObject *ndr64_obj = NULL;
    8146           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8147           0 :         PyObject *allow_remaining_obj = NULL;
    8148           0 :         bool allow_remaining = false;
    8149             : 
    8150           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    8151             :                 discard_const_p(char *, kwnames),
    8152             :                 &blob.data, &blob_length,
    8153             :                 &bigendian_obj,
    8154             :                 &ndr64_obj,
    8155             :                 &allow_remaining_obj)) {
    8156           0 :                 return NULL;
    8157             :         }
    8158           0 :         blob.length = blob_length;
    8159             : 
    8160           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8161           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8162             :         }
    8163           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8164           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8165             :         }
    8166             : 
    8167           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8168           0 :                 allow_remaining = true;
    8169             :         }
    8170             : 
    8171           0 :         return py_svcctl_ChangeServiceConfigW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    8172             : }
    8173             : 
    8174           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8175             : {
    8176             :         DATA_BLOB blob;
    8177           0 :         Py_ssize_t blob_length = 0;
    8178           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8179           0 :         PyObject *bigendian_obj = NULL;
    8180           0 :         PyObject *ndr64_obj = NULL;
    8181           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8182           0 :         PyObject *allow_remaining_obj = NULL;
    8183           0 :         bool allow_remaining = false;
    8184             : 
    8185           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    8186             :                 discard_const_p(char *, kwnames),
    8187             :                 &blob.data, &blob_length,
    8188             :                 &bigendian_obj,
    8189             :                 &ndr64_obj,
    8190             :                 &allow_remaining_obj)) {
    8191           0 :                 return NULL;
    8192             :         }
    8193           0 :         blob.length = blob_length;
    8194             : 
    8195           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8196           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8197             :         }
    8198           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8199           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8200             :         }
    8201             : 
    8202           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8203           0 :                 allow_remaining = true;
    8204             :         }
    8205             : 
    8206           0 :         return py_svcctl_ChangeServiceConfigW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    8207             : }
    8208             : 
    8209           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    8210             : {
    8211           0 :         const struct ndr_interface_call *call = NULL;
    8212           0 :         struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
    8213             :         PyObject *ret;
    8214             :         char *retstr;
    8215             : 
    8216           0 :         if (ndr_table_svcctl.num_calls < 12) {
    8217           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_print");
    8218           0 :                 return NULL;
    8219             :         }
    8220           0 :         call = &ndr_table_svcctl.calls[11];
    8221             : 
    8222           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    8223           0 :         ret = PyUnicode_FromString(retstr);
    8224           0 :         TALLOC_FREE(retstr);
    8225             : 
    8226           0 :         return ret;
    8227             : }
    8228             : 
    8229           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8230             : {
    8231           0 :         return py_svcctl_ChangeServiceConfigW_ndr_print(py_obj, "svcctl_ChangeServiceConfigW_in", NDR_IN);
    8232             : }
    8233             : 
    8234           0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8235             : {
    8236           0 :         return py_svcctl_ChangeServiceConfigW_ndr_print(py_obj, "svcctl_ChangeServiceConfigW_out", NDR_OUT);
    8237             : }
    8238             : 
    8239             : static PyMethodDef py_svcctl_ChangeServiceConfigW_methods[] = {
    8240             :         { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_opnum, METH_NOARGS|METH_CLASS,
    8241             :                 "svcctl.ChangeServiceConfigW.opnum() -> 11 (0x0b) " },
    8242             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    8243             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    8244             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    8245             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    8246             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    8247             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    8248             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    8249             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    8250             :         { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    8251             :         { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    8252             :         { NULL, NULL, 0, NULL }
    8253             : };
    8254             : 
    8255             : 
    8256             : static PyTypeObject svcctl_ChangeServiceConfigW_Type = {
    8257             :         PyVarObject_HEAD_INIT(NULL, 0)
    8258             :         .tp_name = "svcctl.ChangeServiceConfigW",
    8259             :         .tp_getset = py_svcctl_ChangeServiceConfigW_getsetters,
    8260             :         .tp_methods = py_svcctl_ChangeServiceConfigW_methods,
    8261             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8262             :         .tp_new = py_svcctl_ChangeServiceConfigW_new,
    8263             : };
    8264             : 
    8265           0 : static bool pack_py_svcctl_ChangeServiceConfigW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfigW *r)
    8266             : {
    8267             :         PyObject *py_handle;
    8268             :         PyObject *py_type;
    8269             :         PyObject *py_start_type;
    8270             :         PyObject *py_error_control;
    8271             :         PyObject *py_binary_path;
    8272             :         PyObject *py_load_order_group;
    8273             :         PyObject *py_tag_id;
    8274             :         PyObject *py_dependencies;
    8275             :         PyObject *py_service_start_name;
    8276             :         PyObject *py_password;
    8277             :         PyObject *py_display_name;
    8278           0 :         const char *kwnames[] = {
    8279             :                 "handle", "type", "start_type", "error_control", "binary_path", "load_order_group", "tag_id", "dependencies", "service_start_name", "password", "display_name", NULL
    8280             :         };
    8281             : 
    8282           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOO:svcctl_ChangeServiceConfigW", discard_const_p(char *, kwnames), &py_handle, &py_type, &py_start_type, &py_error_control, &py_binary_path, &py_load_order_group, &py_tag_id, &py_dependencies, &py_service_start_name, &py_password, &py_display_name)) {
    8283           0 :                 return false;
    8284             :         }
    8285             : 
    8286           0 :         if (py_handle == NULL) {
    8287           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
    8288           0 :                 return false;
    8289             :         }
    8290           0 :         r->in.handle = talloc_ptrtype(r, r->in.handle);
    8291           0 :         if (r->in.handle == NULL) {
    8292           0 :                 PyErr_NoMemory();
    8293           0 :                 return false;
    8294             :         }
    8295           0 :         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
    8296           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
    8297           0 :                 PyErr_NoMemory();
    8298           0 :                 return false;
    8299             :         }
    8300           0 :         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
    8301           0 :         if (py_type == NULL) {
    8302           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
    8303           0 :                 return false;
    8304             :         }
    8305             :         {
    8306           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
    8307           0 :                 if (PyLong_Check(py_type)) {
    8308             :                         unsigned long long test_var;
    8309           0 :                         test_var = PyLong_AsUnsignedLongLong(py_type);
    8310           0 :                         if (PyErr_Occurred() != NULL) {
    8311           0 :                                 return false;
    8312             :                         }
    8313           0 :                         if (test_var > uint_max) {
    8314           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8315             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8316           0 :                                 return false;
    8317             :                         }
    8318           0 :                         r->in.type = test_var;
    8319             :                 } else {
    8320           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8321             :                           PyLong_Type.tp_name);
    8322           0 :                         return false;
    8323             :                 }
    8324             :         }
    8325           0 :         if (py_start_type == NULL) {
    8326           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
    8327           0 :                 return false;
    8328             :         }
    8329             :         {
    8330           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
    8331           0 :                 if (PyLong_Check(py_start_type)) {
    8332             :                         unsigned long long test_var;
    8333           0 :                         test_var = PyLong_AsUnsignedLongLong(py_start_type);
    8334           0 :                         if (PyErr_Occurred() != NULL) {
    8335           0 :                                 return false;
    8336             :                         }
    8337           0 :                         if (test_var > uint_max) {
    8338           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8339             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8340           0 :                                 return false;
    8341             :                         }
    8342           0 :                         r->in.start_type = test_var;
    8343             :                 } else {
    8344           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8345             :                           PyLong_Type.tp_name);
    8346           0 :                         return false;
    8347             :                 }
    8348             :         }
    8349           0 :         if (py_error_control == NULL) {
    8350           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
    8351           0 :                 return false;
    8352             :         }
    8353             :         {
    8354           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
    8355           0 :                 if (PyLong_Check(py_error_control)) {
    8356             :                         unsigned long long test_var;
    8357           0 :                         test_var = PyLong_AsUnsignedLongLong(py_error_control);
    8358           0 :                         if (PyErr_Occurred() != NULL) {
    8359           0 :                                 return false;
    8360             :                         }
    8361           0 :                         if (test_var > uint_max) {
    8362           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8363             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8364           0 :                                 return false;
    8365             :                         }
    8366           0 :                         r->in.error_control = test_var;
    8367             :                 } else {
    8368           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8369             :                           PyLong_Type.tp_name);
    8370           0 :                         return false;
    8371             :                 }
    8372             :         }
    8373           0 :         if (py_binary_path == NULL) {
    8374           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
    8375           0 :                 return false;
    8376             :         }
    8377           0 :         if (py_binary_path == Py_None) {
    8378           0 :                 r->in.binary_path = NULL;
    8379             :         } else {
    8380           0 :                 r->in.binary_path = NULL;
    8381             :                 {
    8382             :                         const char *test_str;
    8383             :                         const char *talloc_str;
    8384           0 :                         PyObject *unicode = NULL;
    8385           0 :                         if (PyUnicode_Check(py_binary_path)) {
    8386           0 :                                 unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
    8387           0 :                                 if (unicode == NULL) {
    8388           0 :                                         PyErr_NoMemory();
    8389           0 :                                         return false;
    8390             :                                 }
    8391           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8392           0 :                         } else if (PyBytes_Check(py_binary_path)) {
    8393           0 :                                 test_str = PyBytes_AS_STRING(py_binary_path);
    8394             :                         } else {
    8395           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
    8396           0 :                                 return false;
    8397             :                         }
    8398           0 :                         talloc_str = talloc_strdup(r, test_str);
    8399           0 :                         if (unicode != NULL) {
    8400           0 :                                 Py_DECREF(unicode);
    8401             :                         }
    8402           0 :                         if (talloc_str == NULL) {
    8403           0 :                                 PyErr_NoMemory();
    8404           0 :                                 return false;
    8405             :                         }
    8406           0 :                         r->in.binary_path = talloc_str;
    8407             :                 }
    8408             :         }
    8409           0 :         if (py_load_order_group == NULL) {
    8410           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.load_order_group");
    8411           0 :                 return false;
    8412             :         }
    8413           0 :         if (py_load_order_group == Py_None) {
    8414           0 :                 r->in.load_order_group = NULL;
    8415             :         } else {
    8416           0 :                 r->in.load_order_group = NULL;
    8417             :                 {
    8418             :                         const char *test_str;
    8419             :                         const char *talloc_str;
    8420           0 :                         PyObject *unicode = NULL;
    8421           0 :                         if (PyUnicode_Check(py_load_order_group)) {
    8422           0 :                                 unicode = PyUnicode_AsEncodedString(py_load_order_group, "utf-8", "ignore");
    8423           0 :                                 if (unicode == NULL) {
    8424           0 :                                         PyErr_NoMemory();
    8425           0 :                                         return false;
    8426             :                                 }
    8427           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8428           0 :                         } else if (PyBytes_Check(py_load_order_group)) {
    8429           0 :                                 test_str = PyBytes_AS_STRING(py_load_order_group);
    8430             :                         } else {
    8431           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_load_order_group)->tp_name);
    8432           0 :                                 return false;
    8433             :                         }
    8434           0 :                         talloc_str = talloc_strdup(r, test_str);
    8435           0 :                         if (unicode != NULL) {
    8436           0 :                                 Py_DECREF(unicode);
    8437             :                         }
    8438           0 :                         if (talloc_str == NULL) {
    8439           0 :                                 PyErr_NoMemory();
    8440           0 :                                 return false;
    8441             :                         }
    8442           0 :                         r->in.load_order_group = talloc_str;
    8443             :                 }
    8444             :         }
    8445           0 :         if (py_tag_id == NULL) {
    8446           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.tag_id");
    8447           0 :                 return false;
    8448             :         }
    8449           0 :         if (py_tag_id == Py_None) {
    8450           0 :                 r->in.tag_id = NULL;
    8451             :         } else {
    8452           0 :                 r->in.tag_id = talloc_ptrtype(r, r->in.tag_id);
    8453           0 :                 if (r->in.tag_id == NULL) {
    8454           0 :                         PyErr_NoMemory();
    8455           0 :                         return false;
    8456             :                 }
    8457             :                 {
    8458           0 :                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.tag_id));
    8459           0 :                         if (PyLong_Check(py_tag_id)) {
    8460             :                                 unsigned long long test_var;
    8461           0 :                                 test_var = PyLong_AsUnsignedLongLong(py_tag_id);
    8462           0 :                                 if (PyErr_Occurred() != NULL) {
    8463           0 :                                         return false;
    8464             :                                 }
    8465           0 :                                 if (test_var > uint_max) {
    8466           0 :                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8467             :                                           PyLong_Type.tp_name, uint_max, test_var);
    8468           0 :                                         return false;
    8469             :                                 }
    8470           0 :                                 *r->in.tag_id = test_var;
    8471             :                         } else {
    8472           0 :                                 PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8473             :                                   PyLong_Type.tp_name);
    8474           0 :                                 return false;
    8475             :                         }
    8476             :                 }
    8477             :         }
    8478           0 :         if (py_dependencies == NULL) {
    8479           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
    8480           0 :                 return false;
    8481             :         }
    8482           0 :         if (py_dependencies == Py_None) {
    8483           0 :                 r->in.dependencies = NULL;
    8484             :         } else {
    8485           0 :                 r->in.dependencies = NULL;
    8486             :                 {
    8487             :                         const char *test_str;
    8488             :                         const char *talloc_str;
    8489           0 :                         PyObject *unicode = NULL;
    8490           0 :                         if (PyUnicode_Check(py_dependencies)) {
    8491           0 :                                 unicode = PyUnicode_AsEncodedString(py_dependencies, "utf-8", "ignore");
    8492           0 :                                 if (unicode == NULL) {
    8493           0 :                                         PyErr_NoMemory();
    8494           0 :                                         return false;
    8495             :                                 }
    8496           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8497           0 :                         } else if (PyBytes_Check(py_dependencies)) {
    8498           0 :                                 test_str = PyBytes_AS_STRING(py_dependencies);
    8499             :                         } else {
    8500           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dependencies)->tp_name);
    8501           0 :                                 return false;
    8502             :                         }
    8503           0 :                         talloc_str = talloc_strdup(r, test_str);
    8504           0 :                         if (unicode != NULL) {
    8505           0 :                                 Py_DECREF(unicode);
    8506             :                         }
    8507           0 :                         if (talloc_str == NULL) {
    8508           0 :                                 PyErr_NoMemory();
    8509           0 :                                 return false;
    8510             :                         }
    8511           0 :                         r->in.dependencies = talloc_str;
    8512             :                 }
    8513             :         }
    8514           0 :         PY_CHECK_TYPE(&PyList_Type, py_dependencies, return false;);
    8515           0 :         r->in.dwDependSize = PyList_GET_SIZE(py_dependencies);
    8516           0 :         if (py_service_start_name == NULL) {
    8517           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
    8518           0 :                 return false;
    8519             :         }
    8520           0 :         if (py_service_start_name == Py_None) {
    8521           0 :                 r->in.service_start_name = NULL;
    8522             :         } else {
    8523           0 :                 r->in.service_start_name = NULL;
    8524             :                 {
    8525             :                         const char *test_str;
    8526             :                         const char *talloc_str;
    8527           0 :                         PyObject *unicode = NULL;
    8528           0 :                         if (PyUnicode_Check(py_service_start_name)) {
    8529           0 :                                 unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
    8530           0 :                                 if (unicode == NULL) {
    8531           0 :                                         PyErr_NoMemory();
    8532           0 :                                         return false;
    8533             :                                 }
    8534           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8535           0 :                         } else if (PyBytes_Check(py_service_start_name)) {
    8536           0 :                                 test_str = PyBytes_AS_STRING(py_service_start_name);
    8537             :                         } else {
    8538           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
    8539           0 :                                 return false;
    8540             :                         }
    8541           0 :                         talloc_str = talloc_strdup(r, test_str);
    8542           0 :                         if (unicode != NULL) {
    8543           0 :                                 Py_DECREF(unicode);
    8544             :                         }
    8545           0 :                         if (talloc_str == NULL) {
    8546           0 :                                 PyErr_NoMemory();
    8547           0 :                                 return false;
    8548             :                         }
    8549           0 :                         r->in.service_start_name = talloc_str;
    8550             :                 }
    8551             :         }
    8552           0 :         if (py_password == NULL) {
    8553           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
    8554           0 :                 return false;
    8555             :         }
    8556           0 :         if (py_password == Py_None) {
    8557           0 :                 r->in.password = NULL;
    8558             :         } else {
    8559           0 :                 r->in.password = NULL;
    8560             :                 {
    8561             :                         const char *test_str;
    8562             :                         const char *talloc_str;
    8563           0 :                         PyObject *unicode = NULL;
    8564           0 :                         if (PyUnicode_Check(py_password)) {
    8565           0 :                                 unicode = PyUnicode_AsEncodedString(py_password, "utf-8", "ignore");
    8566           0 :                                 if (unicode == NULL) {
    8567           0 :                                         PyErr_NoMemory();
    8568           0 :                                         return false;
    8569             :                                 }
    8570           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8571           0 :                         } else if (PyBytes_Check(py_password)) {
    8572           0 :                                 test_str = PyBytes_AS_STRING(py_password);
    8573             :                         } else {
    8574           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_password)->tp_name);
    8575           0 :                                 return false;
    8576             :                         }
    8577           0 :                         talloc_str = talloc_strdup(r, test_str);
    8578           0 :                         if (unicode != NULL) {
    8579           0 :                                 Py_DECREF(unicode);
    8580             :                         }
    8581           0 :                         if (talloc_str == NULL) {
    8582           0 :                                 PyErr_NoMemory();
    8583           0 :                                 return false;
    8584             :                         }
    8585           0 :                         r->in.password = talloc_str;
    8586             :                 }
    8587             :         }
    8588           0 :         PY_CHECK_TYPE(&PyList_Type, py_password, return false;);
    8589           0 :         r->in.dwPwSize = PyList_GET_SIZE(py_password);
    8590           0 :         if (py_display_name == NULL) {
    8591           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name");
    8592           0 :                 return false;
    8593             :         }
    8594           0 :         if (py_display_name == Py_None) {
    8595           0 :                 r->in.display_name = NULL;
    8596             :         } else {
    8597           0 :                 r->in.display_name = NULL;
    8598             :                 {
    8599             :                         const char *test_str;
    8600             :                         const char *talloc_str;
    8601           0 :                         PyObject *unicode = NULL;
    8602           0 :                         if (PyUnicode_Check(py_display_name)) {
    8603           0 :                                 unicode = PyUnicode_AsEncodedString(py_display_name, "utf-8", "ignore");
    8604           0 :                                 if (unicode == NULL) {
    8605           0 :                                         PyErr_NoMemory();
    8606           0 :                                         return false;
    8607             :                                 }
    8608           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8609           0 :                         } else if (PyBytes_Check(py_display_name)) {
    8610           0 :                                 test_str = PyBytes_AS_STRING(py_display_name);
    8611             :                         } else {
    8612           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_display_name)->tp_name);
    8613           0 :                                 return false;
    8614             :                         }
    8615           0 :                         talloc_str = talloc_strdup(r, test_str);
    8616           0 :                         if (unicode != NULL) {
    8617           0 :                                 Py_DECREF(unicode);
    8618             :                         }
    8619           0 :                         if (talloc_str == NULL) {
    8620           0 :                                 PyErr_NoMemory();
    8621           0 :                                 return false;
    8622             :                         }
    8623           0 :                         r->in.display_name = talloc_str;
    8624             :                 }
    8625             :         }
    8626           0 :         return true;
    8627             : }
    8628             : 
    8629           0 : static PyObject *unpack_py_svcctl_ChangeServiceConfigW_args_out(struct svcctl_ChangeServiceConfigW *r)
    8630             : {
    8631             :         PyObject *result;
    8632             :         PyObject *py_tag_id;
    8633           0 :         if (r->out.tag_id == NULL) {
    8634           0 :                 py_tag_id = Py_None;
    8635           0 :                 Py_INCREF(py_tag_id);
    8636             :         } else {
    8637           0 :                 py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*r->out.tag_id);
    8638             :         }
    8639           0 :         result = py_tag_id;
    8640           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
    8641           0 :                 PyErr_SetWERROR(r->out.result);
    8642           0 :                 return NULL;
    8643             :         }
    8644             : 
    8645           0 :         return result;
    8646             : }
    8647             : 
    8648             : 
    8649           0 : static PyObject *py_svcctl_CreateServiceW_in_get_scmanager_handle(PyObject *obj, void *closure)
    8650             : {
    8651           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8652             :         PyObject *py_scmanager_handle;
    8653           0 :         if (object->in.scmanager_handle == NULL) {
    8654           0 :                 Py_RETURN_NONE;
    8655             :         }
    8656           0 :         py_scmanager_handle = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager_handle, object->in.scmanager_handle);
    8657           0 :         return py_scmanager_handle;
    8658             : }
    8659             : 
    8660           0 : static int py_svcctl_CreateServiceW_in_set_scmanager_handle(PyObject *py_obj, PyObject *value, void *closure)
    8661             : {
    8662           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8663           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager_handle));
    8664           0 :         if (value == NULL) {
    8665           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager_handle");
    8666           0 :                 return -1;
    8667             :         }
    8668           0 :         object->in.scmanager_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager_handle);
    8669           0 :         if (object->in.scmanager_handle == NULL) {
    8670           0 :                 PyErr_NoMemory();
    8671           0 :                 return -1;
    8672             :         }
    8673           0 :         PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
    8674           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8675           0 :                 PyErr_NoMemory();
    8676           0 :                 return -1;
    8677             :         }
    8678           0 :         object->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(value);
    8679           0 :         return 0;
    8680             : }
    8681             : 
    8682           0 : static PyObject *py_svcctl_CreateServiceW_in_get_ServiceName(PyObject *obj, void *closure)
    8683             : {
    8684           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8685             :         PyObject *py_ServiceName;
    8686           0 :         if (object->in.ServiceName == NULL) {
    8687           0 :                 py_ServiceName = Py_None;
    8688           0 :                 Py_INCREF(py_ServiceName);
    8689             :         } else {
    8690           0 :                 py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
    8691             :         }
    8692           0 :         return py_ServiceName;
    8693             : }
    8694             : 
    8695           0 : static int py_svcctl_CreateServiceW_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
    8696             : {
    8697           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8698           0 :         if (value == NULL) {
    8699           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
    8700           0 :                 return -1;
    8701             :         }
    8702             :         {
    8703             :                 const char *test_str;
    8704             :                 const char *talloc_str;
    8705           0 :                 PyObject *unicode = NULL;
    8706           0 :                 if (PyUnicode_Check(value)) {
    8707           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8708           0 :                         if (unicode == NULL) {
    8709           0 :                                 PyErr_NoMemory();
    8710           0 :                                 return -1;
    8711             :                         }
    8712           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8713           0 :                 } else if (PyBytes_Check(value)) {
    8714           0 :                         test_str = PyBytes_AS_STRING(value);
    8715             :                 } else {
    8716           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8717           0 :                         return -1;
    8718             :                 }
    8719           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8720           0 :                 if (unicode != NULL) {
    8721           0 :                         Py_DECREF(unicode);
    8722             :                 }
    8723           0 :                 if (talloc_str == NULL) {
    8724           0 :                         PyErr_NoMemory();
    8725           0 :                         return -1;
    8726             :                 }
    8727           0 :                 object->in.ServiceName = talloc_str;
    8728             :         }
    8729           0 :         return 0;
    8730             : }
    8731             : 
    8732           0 : static PyObject *py_svcctl_CreateServiceW_in_get_DisplayName(PyObject *obj, void *closure)
    8733             : {
    8734           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8735             :         PyObject *py_DisplayName;
    8736           0 :         if (object->in.DisplayName == NULL) {
    8737           0 :                 Py_RETURN_NONE;
    8738             :         }
    8739           0 :         if (object->in.DisplayName == NULL) {
    8740           0 :                 py_DisplayName = Py_None;
    8741           0 :                 Py_INCREF(py_DisplayName);
    8742             :         } else {
    8743           0 :                 if (object->in.DisplayName == NULL) {
    8744           0 :                         py_DisplayName = Py_None;
    8745           0 :                         Py_INCREF(py_DisplayName);
    8746             :                 } else {
    8747           0 :                         py_DisplayName = PyUnicode_Decode(object->in.DisplayName, strlen(object->in.DisplayName), "utf-8", "ignore");
    8748             :                 }
    8749             :         }
    8750           0 :         return py_DisplayName;
    8751             : }
    8752             : 
    8753           0 : static int py_svcctl_CreateServiceW_in_set_DisplayName(PyObject *py_obj, PyObject *value, void *closure)
    8754             : {
    8755           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8756           0 :         if (value == NULL) {
    8757           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DisplayName");
    8758           0 :                 return -1;
    8759             :         }
    8760           0 :         if (value == Py_None) {
    8761           0 :                 object->in.DisplayName = NULL;
    8762             :         } else {
    8763           0 :                 object->in.DisplayName = NULL;
    8764             :                 {
    8765             :                         const char *test_str;
    8766             :                         const char *talloc_str;
    8767           0 :                         PyObject *unicode = NULL;
    8768           0 :                         if (PyUnicode_Check(value)) {
    8769           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8770           0 :                                 if (unicode == NULL) {
    8771           0 :                                         PyErr_NoMemory();
    8772           0 :                                         return -1;
    8773             :                                 }
    8774           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8775           0 :                         } else if (PyBytes_Check(value)) {
    8776           0 :                                 test_str = PyBytes_AS_STRING(value);
    8777             :                         } else {
    8778           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8779           0 :                                 return -1;
    8780             :                         }
    8781           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8782           0 :                         if (unicode != NULL) {
    8783           0 :                                 Py_DECREF(unicode);
    8784             :                         }
    8785           0 :                         if (talloc_str == NULL) {
    8786           0 :                                 PyErr_NoMemory();
    8787           0 :                                 return -1;
    8788             :                         }
    8789           0 :                         object->in.DisplayName = talloc_str;
    8790             :                 }
    8791             :         }
    8792           0 :         return 0;
    8793             : }
    8794             : 
    8795           0 : static PyObject *py_svcctl_CreateServiceW_in_get_desired_access(PyObject *obj, void *closure)
    8796             : {
    8797           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8798             :         PyObject *py_desired_access;
    8799           0 :         py_desired_access = PyLong_FromUnsignedLongLong((uint32_t)object->in.desired_access);
    8800           0 :         return py_desired_access;
    8801             : }
    8802             : 
    8803           0 : static int py_svcctl_CreateServiceW_in_set_desired_access(PyObject *py_obj, PyObject *value, void *closure)
    8804             : {
    8805           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8806           0 :         if (value == NULL) {
    8807           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.desired_access");
    8808           0 :                 return -1;
    8809             :         }
    8810             :         {
    8811           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.desired_access));
    8812           0 :                 if (PyLong_Check(value)) {
    8813             :                         unsigned long long test_var;
    8814           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8815           0 :                         if (PyErr_Occurred() != NULL) {
    8816           0 :                                 return -1;
    8817             :                         }
    8818           0 :                         if (test_var > uint_max) {
    8819           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8820             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8821           0 :                                 return -1;
    8822             :                         }
    8823           0 :                         object->in.desired_access = test_var;
    8824             :                 } else {
    8825           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8826             :                           PyLong_Type.tp_name);
    8827           0 :                         return -1;
    8828             :                 }
    8829             :         }
    8830           0 :         return 0;
    8831             : }
    8832             : 
    8833           0 : static PyObject *py_svcctl_CreateServiceW_in_get_type(PyObject *obj, void *closure)
    8834             : {
    8835           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8836             :         PyObject *py_type;
    8837           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
    8838           0 :         return py_type;
    8839             : }
    8840             : 
    8841           0 : static int py_svcctl_CreateServiceW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
    8842             : {
    8843           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8844           0 :         if (value == NULL) {
    8845           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
    8846           0 :                 return -1;
    8847             :         }
    8848             :         {
    8849           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
    8850           0 :                 if (PyLong_Check(value)) {
    8851             :                         unsigned long long test_var;
    8852           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8853           0 :                         if (PyErr_Occurred() != NULL) {
    8854           0 :                                 return -1;
    8855             :                         }
    8856           0 :                         if (test_var > uint_max) {
    8857           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8858             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8859           0 :                                 return -1;
    8860             :                         }
    8861           0 :                         object->in.type = test_var;
    8862             :                 } else {
    8863           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8864             :                           PyLong_Type.tp_name);
    8865           0 :                         return -1;
    8866             :                 }
    8867             :         }
    8868           0 :         return 0;
    8869             : }
    8870             : 
    8871           0 : static PyObject *py_svcctl_CreateServiceW_in_get_start_type(PyObject *obj, void *closure)
    8872             : {
    8873           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8874             :         PyObject *py_start_type;
    8875           0 :         py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
    8876           0 :         return py_start_type;
    8877             : }
    8878             : 
    8879           0 : static int py_svcctl_CreateServiceW_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
    8880             : {
    8881           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8882           0 :         if (value == NULL) {
    8883           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
    8884           0 :                 return -1;
    8885             :         }
    8886             :         {
    8887           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
    8888           0 :                 if (PyLong_Check(value)) {
    8889             :                         unsigned long long test_var;
    8890           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8891           0 :                         if (PyErr_Occurred() != NULL) {
    8892           0 :                                 return -1;
    8893             :                         }
    8894           0 :                         if (test_var > uint_max) {
    8895           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8896             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8897           0 :                                 return -1;
    8898             :                         }
    8899           0 :                         object->in.start_type = test_var;
    8900             :                 } else {
    8901           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8902             :                           PyLong_Type.tp_name);
    8903           0 :                         return -1;
    8904             :                 }
    8905             :         }
    8906           0 :         return 0;
    8907             : }
    8908             : 
    8909           0 : static PyObject *py_svcctl_CreateServiceW_in_get_error_control(PyObject *obj, void *closure)
    8910             : {
    8911           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8912             :         PyObject *py_error_control;
    8913           0 :         py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
    8914           0 :         return py_error_control;
    8915             : }
    8916             : 
    8917           0 : static int py_svcctl_CreateServiceW_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
    8918             : {
    8919           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8920           0 :         if (value == NULL) {
    8921           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
    8922           0 :                 return -1;
    8923             :         }
    8924             :         {
    8925           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
    8926           0 :                 if (PyLong_Check(value)) {
    8927             :                         unsigned long long test_var;
    8928           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8929           0 :                         if (PyErr_Occurred() != NULL) {
    8930           0 :                                 return -1;
    8931             :                         }
    8932           0 :                         if (test_var > uint_max) {
    8933           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8934             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8935           0 :                                 return -1;
    8936             :                         }
    8937           0 :                         object->in.error_control = test_var;
    8938             :                 } else {
    8939           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8940             :                           PyLong_Type.tp_name);
    8941           0 :                         return -1;
    8942             :                 }
    8943             :         }
    8944           0 :         return 0;
    8945             : }
    8946             : 
    8947           0 : static PyObject *py_svcctl_CreateServiceW_in_get_binary_path(PyObject *obj, void *closure)
    8948             : {
    8949           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    8950             :         PyObject *py_binary_path;
    8951           0 :         if (object->in.binary_path == NULL) {
    8952           0 :                 py_binary_path = Py_None;
    8953           0 :                 Py_INCREF(py_binary_path);
    8954             :         } else {
    8955           0 :                 py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
    8956             :         }
    8957           0 :         return py_binary_path;
    8958             : }
    8959             : 
    8960           0 : static int py_svcctl_CreateServiceW_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
    8961             : {
    8962           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    8963           0 :         if (value == NULL) {
    8964           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
    8965           0 :                 return -1;
    8966             :         }
    8967             :         {
    8968             :                 const char *test_str;
    8969             :                 const char *talloc_str;
    8970           0 :                 PyObject *unicode = NULL;
    8971           0 :                 if (PyUnicode_Check(value)) {
    8972           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8973           0 :                         if (unicode == NULL) {
    8974           0 :                                 PyErr_NoMemory();
    8975           0 :                                 return -1;
    8976             :                         }
    8977           0 :                         test_str = PyBytes_AS_STRING(unicode);
    8978           0 :                 } else if (PyBytes_Check(value)) {
    8979           0 :                         test_str = PyBytes_AS_STRING(value);
    8980             :                 } else {
    8981           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8982           0 :                         return -1;
    8983             :                 }
    8984           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8985           0 :                 if (unicode != NULL) {
    8986           0 :                         Py_DECREF(unicode);
    8987             :                 }
    8988           0 :                 if (talloc_str == NULL) {
    8989           0 :                         PyErr_NoMemory();
    8990           0 :                         return -1;
    8991             :                 }
    8992           0 :                 object->in.binary_path = talloc_str;
    8993             :         }
    8994           0 :         return 0;
    8995             : }
    8996             : 
    8997           0 : static PyObject *py_svcctl_CreateServiceW_in_get_LoadOrderGroupKey(PyObject *obj, void *closure)
    8998             : {
    8999           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    9000             :         PyObject *py_LoadOrderGroupKey;
    9001           0 :         if (object->in.LoadOrderGroupKey == NULL) {
    9002           0 :                 Py_RETURN_NONE;
    9003             :         }
    9004           0 :         if (object->in.LoadOrderGroupKey == NULL) {
    9005           0 :                 py_LoadOrderGroupKey = Py_None;
    9006           0 :                 Py_INCREF(py_LoadOrderGroupKey);
    9007             :         } else {
    9008           0 :                 if (object->in.LoadOrderGroupKey == NULL) {
    9009           0 :                         py_LoadOrderGroupKey = Py_None;
    9010           0 :                         Py_INCREF(py_LoadOrderGroupKey);
    9011             :                 } else {
    9012           0 :                         py_LoadOrderGroupKey = PyUnicode_Decode(object->in.LoadOrderGroupKey, strlen(object->in.LoadOrderGroupKey), "utf-8", "ignore");
    9013             :                 }
    9014             :         }
    9015           0 :         return py_LoadOrderGroupKey;
    9016             : }
    9017             : 
    9018           0 : static int py_svcctl_CreateServiceW_in_set_LoadOrderGroupKey(PyObject *py_obj, PyObject *value, void *closure)
    9019             : {
    9020           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    9021           0 :         if (value == NULL) {
    9022           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.LoadOrderGroupKey");
    9023           0 :                 return -1;
    9024             :         }
    9025           0 :         if (value == Py_None) {
    9026           0 :                 object->in.LoadOrderGroupKey = NULL;
    9027             :         } else {
    9028           0 :                 object->in.LoadOrderGroupKey = NULL;
    9029             :                 {
    9030             :                         const char *test_str;
    9031             :                         const char *talloc_str;
    9032           0 :                         PyObject *unicode = NULL;
    9033           0 :                         if (PyUnicode_Check(value)) {
    9034           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    9035           0 :                                 if (unicode == NULL) {
    9036           0 :                                         PyErr_NoMemory();
    9037           0 :                                         return -1;
    9038             :                                 }
    9039           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    9040           0 :                         } else if (PyBytes_Check(value)) {
    9041           0 :                                 test_str = PyBytes_AS_STRING(value);
    9042             :                         } else {
    9043           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    9044           0 :                                 return -1;
    9045             :                         }
    9046           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    9047           0 :                         if (unicode != NULL) {
    9048           0 :                                 Py_DECREF(unicode);
    9049             :                         }
    9050           0 :                         if (talloc_str == NULL) {
    9051           0 :                                 PyErr_NoMemory();
    9052           0 :                                 return -1;
    9053             :                         }
    9054           0 :                         object->in.LoadOrderGroupKey = talloc_str;
    9055             :                 }
    9056             :         }
    9057           0 :         return 0;
    9058             : }
    9059             : 
    9060           0 : static PyObject *py_svcctl_CreateServiceW_in_get_TagId(PyObject *obj, void *closure)
    9061             : {
    9062           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    9063             :         PyObject *py_TagId;
    9064           0 :         if (object->in.TagId == NULL) {
    9065           0 :                 Py_RETURN_NONE;
    9066             :         }
    9067           0 :         if (object->in.TagId == NULL) {
    9068           0 :                 py_TagId = Py_None;
    9069           0 :                 Py_INCREF(py_TagId);
    9070             :         } else {
    9071           0 :                 py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->in.TagId);
    9072             :         }
    9073           0 :         return py_TagId;
    9074             : }
    9075             : 
    9076           0 : static int py_svcctl_CreateServiceW_in_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
    9077             : {
    9078           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    9079           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.TagId));
    9080           0 :         if (value == NULL) {
    9081           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.TagId");
    9082           0 :                 return -1;
    9083             :         }
    9084           0 :         if (value == Py_None) {
    9085           0 :                 object->in.TagId = NULL;
    9086             :         } else {
    9087           0 :                 object->in.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.TagId);
    9088           0 :                 if (object->in.TagId == NULL) {
    9089           0 :                         PyErr_NoMemory();
    9090           0 :                         return -1;
    9091             :                 }
    9092             :                 {
    9093           0 :                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.TagId));
    9094           0 :                         if (PyLong_Check(value)) {
    9095             :                                 unsigned long long test_var;
    9096           0 :                                 test_var = PyLong_AsUnsignedLongLong(value);
    9097           0 :                                 if (PyErr_Occurred() != NULL) {
    9098           0 :                                         return -1;
    9099             :                                 }
    9100           0 :                                 if (test_var > uint_max) {
    9101           0 :                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    9102             :                                           PyLong_Type.tp_name, uint_max, test_var);
    9103           0 :                                         return -1;
    9104             :                                 }
    9105           0 :                                 *object->in.TagId = test_var;
    9106             :                         } else {
    9107           0 :                                 PyErr_Format(PyExc_TypeError, "Expected type %s",\
    9108             :                                   PyLong_Type.tp_name);
    9109           0 :                                 return -1;
    9110             :                         }
    9111             :                 }
    9112             :         }
    9113           0 :         return 0;
    9114             : }
    9115             : 
    9116           0 : static PyObject *py_svcctl_CreateServiceW_out_get_TagId(PyObject *obj, void *closure)
    9117             : {
    9118           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    9119             :         PyObject *py_TagId;
    9120           0 :         if (object->out.TagId == NULL) {
    9121           0 :                 Py_RETURN_NONE;
    9122             :         }
    9123           0 :         if (object->out.TagId == NULL) {
    9124           0 :                 py_TagId = Py_None;
    9125           0 :                 Py_INCREF(py_TagId);
    9126             :         } else {
    9127           0 :                 py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.TagId);
    9128             :         }
    9129           0 :         return py_TagId;
    9130             : }
    9131             : 
    9132           0 : static int py_svcctl_CreateServiceW_out_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
    9133             : {
    9134           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
    9135           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.TagId));
    9136           0 :         if (value == NULL) {
    9137           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.TagId");
    9138           0 :                 return -1;
    9139             :         }
    9140           0 :         if (value == Py_None) {
    9141           0 :                 object->out.TagId = NULL;
    9142             :         } else {
    9143           0 :                 object->out.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.TagId);
    9144           0 :                 if (object->out.TagId == NULL) {
    9145           0 :                         PyErr_NoMemory();
    9146           0 :                         return -1;
    9147             :                 }
    9148             :                 {
    9149           0 :                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.TagId));
    9150           0 :                         if (PyLong_Check(value)) {
    9151             :                                 unsigned long long test_var;
    9152           0 :                                 test_var = PyLong_AsUnsignedLongLong(value);
    9153           0 :                                 if (PyErr_Occurred() != NULL) {
    9154           0 :                                         return -1;
    9155             :                                 }
    9156           0 :                                 if (test_var > uint_max) {
    9157           0 :                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    9158             :                                           PyLong_Type.tp_name, uint_max, test_var);
    9159           0 :                                         return -1;
    9160             :                                 }
    9161           0 :                                 *object->out.TagId = test_var;
    9162             :                         } else {
    9163           0 :                                 PyErr_Format(PyExc_TypeError, "Expected type %s",\
    9164             :                                   PyLong_Type.tp_name);
    9165           0 :                                 return -1;
    9166             :                         }
    9167             :                 }
    9168             :         }
    9169           0 :         return 0;
    9170             : }
    9171             : 
    9172           0 : static PyObject *py_svcctl_CreateServiceW_in_get_dependencies(PyObject *obj, void *closure)
    9173             : {
    9174           0 :         struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
    9175             :         PyObject *py_dependencies;
    9176           0 :         if (object->in.dependencies == NULL) {
    9177           0 :                 Py_RETURN_NONE;
    9178             :         }
    9179           0 :         if (object->in.dependencies == NULL) {
    9180           0 :                 py_dependencies = Py_None;
    9181           0 :                 Py_INCREF(py_dependencies);
    9182             :         } else {
    9183           0 :                 py_dependencies = PyList_New(object->in.dependencies_size);
    9184           0 :                 if (py_dependencies == NULL) {
    9185           0 :                         return NULL;
    9186             :                 }
    9187             :                 {
    9188             :                         int dependencies_cntr_1;
    9189           0 :                         for (dependencies_cntr_1 = 0; dependencies_cntr_1 < (object->in.dependencies_size); dependencies_cntr_1++) {
    9190             :                                 PyObject *py_dependencies_1;
    9191           0 :                                 py_dependencies_1 = PyLong_FromLong((uint16_t)object->in.dependencies[dependencies_cntr_1]);