Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include "lib/replace/system/python.h"
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_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_ACTIONSW_Type;
76 : static PyTypeObject SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type;
77 : static PyTypeObject SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type;
78 : static PyTypeObject SC_RPC_NOTIFY_PARAMS_u_Type;
79 : static PyTypeObject SC_RPC_NOTIFY_PARAMS_Type;
80 : static PyTypeObject SC_RPC_NOTIFY_PARAMS_LIST_Type;
81 : static PyTypeObject SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type;
82 : static PyTypeObject SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type;
83 : static PyTypeObject SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type;
84 : static PyTypeObject SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type;
85 : static PyTypeObject SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type;
86 : static PyTypeObject SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type;
87 : static PyTypeObject SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type;
88 : static PyTypeObject SERVICE_DESCRIPTIONW_Type;
89 : static PyTypeObject SERVICE_DELAYED_AUTO_START_INFO_Type;
90 : static PyTypeObject SERVICE_FAILURE_ACTIONS_FLAG_Type;
91 : static PyTypeObject SERVICE_SID_INFO_Type;
92 : static PyTypeObject SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type;
93 : static PyTypeObject SERVICE_PRESHUTDOWN_INFO_Type;
94 : static PyTypeObject SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type;
95 : static PyTypeObject SERVICE_TRIGGER_Type;
96 : static PyTypeObject SERVICE_TRIGGER_INFO_Type;
97 : static PyTypeObject SERVICE_PREFERRED_NODE_INFO_Type;
98 : static PyTypeObject SC_RPC_CONFIG_INFOW_u_Type;
99 : static PyTypeObject SC_RPC_CONFIG_INFOW_Type;
100 : static PyTypeObject svcctl_InterfaceType;
101 : static PyTypeObject svcctl_CloseServiceHandle_Type;
102 : static PyTypeObject svcctl_ControlService_Type;
103 : static PyTypeObject svcctl_DeleteService_Type;
104 : static PyTypeObject svcctl_LockServiceDatabase_Type;
105 : static PyTypeObject svcctl_QueryServiceObjectSecurity_Type;
106 : static PyTypeObject svcctl_SetServiceObjectSecurity_Type;
107 : static PyTypeObject svcctl_QueryServiceStatus_Type;
108 : static PyTypeObject svcctl_UnlockServiceDatabase_Type;
109 : static PyTypeObject svcctl_SCSetServiceBitsW_Type;
110 : static PyTypeObject svcctl_ChangeServiceConfigW_Type;
111 : static PyTypeObject svcctl_CreateServiceW_Type;
112 : static PyTypeObject svcctl_EnumDependentServicesW_Type;
113 : static PyTypeObject svcctl_EnumServicesStatusW_Type;
114 : static PyTypeObject svcctl_OpenSCManagerW_Type;
115 : static PyTypeObject svcctl_OpenServiceW_Type;
116 : static PyTypeObject svcctl_QueryServiceConfigW_Type;
117 : static PyTypeObject svcctl_QueryServiceLockStatusW_Type;
118 : static PyTypeObject svcctl_StartServiceW_Type;
119 : static PyTypeObject svcctl_GetServiceDisplayNameW_Type;
120 : static PyTypeObject svcctl_GetServiceKeyNameW_Type;
121 : static PyTypeObject svcctl_SCSetServiceBitsA_Type;
122 : static PyTypeObject svcctl_ChangeServiceConfigA_Type;
123 : static PyTypeObject svcctl_CreateServiceA_Type;
124 : static PyTypeObject svcctl_EnumDependentServicesA_Type;
125 : static PyTypeObject svcctl_EnumServicesStatusA_Type;
126 : static PyTypeObject svcctl_OpenSCManagerA_Type;
127 : static PyTypeObject svcctl_OpenServiceA_Type;
128 : static PyTypeObject svcctl_QueryServiceConfigA_Type;
129 : static PyTypeObject svcctl_QueryServiceLockStatusA_Type;
130 : static PyTypeObject svcctl_StartServiceA_Type;
131 : static PyTypeObject svcctl_GetServiceDisplayNameA_Type;
132 : static PyTypeObject svcctl_GetServiceKeyNameA_Type;
133 : static PyTypeObject svcctl_ChangeServiceConfig2A_Type;
134 : static PyTypeObject svcctl_ChangeServiceConfig2W_Type;
135 : static PyTypeObject svcctl_QueryServiceConfig2A_Type;
136 : static PyTypeObject svcctl_QueryServiceConfig2W_Type;
137 : static PyTypeObject svcctl_QueryServiceStatusEx_Type;
138 : static PyTypeObject svcctl_EnumServicesStatusExA_Type;
139 : static PyTypeObject svcctl_EnumServicesStatusExW_Type;
140 : static PyTypeObject svcctl_CreateServiceWOW64A_Type;
141 : static PyTypeObject svcctl_CreateServiceWOW64W_Type;
142 : static PyTypeObject Opnum46NotUsedOnWire_Type;
143 : static PyTypeObject svcctl_NotifyServiceStatusChange_Type;
144 : static PyTypeObject svcctl_GetNotifyResults_Type;
145 : static PyTypeObject svcctl_CloseNotifyHandle_Type;
146 : static PyTypeObject svcctl_ControlServiceExA_Type;
147 : static PyTypeObject svcctl_ControlServiceExW_Type;
148 : static PyTypeObject Opnum52NotUsedOnWire_Type;
149 : static PyTypeObject Opnum53NotUsedOnWire_Type;
150 : static PyTypeObject Opnum54NotUsedOnWire_Type;
151 : static PyTypeObject Opnum55NotUsedOnWire_Type;
152 : static PyTypeObject svcctl_QueryServiceConfigEx_Type;
153 : static PyTypeObject Opnum57NotUsedOnWire_Type;
154 : static PyTypeObject Opnum58NotUsedOnWire_Type;
155 : static PyTypeObject Opnum59NotUsedOnWire_Type;
156 : static PyTypeObject svcctl_CreateWowService_Type;
157 : static PyTypeObject svcctl_OpenSCManager2_Type;
158 :
159 : static PyTypeObject *BaseObject_Type;
160 : static PyTypeObject *GUID_Type;
161 : static PyTypeObject *policy_handle_Type;
162 : static PyTypeObject *ClientConnection_Type;
163 : static PyTypeObject *ndr_syntax_id_Type;
164 :
165 0 : static PyObject *py_SERVICE_LOCK_STATUS_get_is_locked(PyObject *obj, void *closure)
166 : {
167 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
168 0 : PyObject *py_is_locked;
169 0 : py_is_locked = PyLong_FromUnsignedLongLong((uint32_t)object->is_locked);
170 0 : return py_is_locked;
171 : }
172 :
173 0 : static int py_SERVICE_LOCK_STATUS_set_is_locked(PyObject *py_obj, PyObject *value, void *closure)
174 : {
175 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
176 0 : if (value == NULL) {
177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->is_locked");
178 0 : return -1;
179 : }
180 : {
181 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->is_locked));
182 0 : if (PyLong_Check(value)) {
183 0 : unsigned long long test_var;
184 0 : test_var = PyLong_AsUnsignedLongLong(value);
185 0 : if (PyErr_Occurred() != NULL) {
186 0 : return -1;
187 : }
188 0 : if (test_var > uint_max) {
189 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
190 : PyLong_Type.tp_name, uint_max, test_var);
191 0 : return -1;
192 : }
193 0 : object->is_locked = test_var;
194 : } else {
195 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
196 : PyLong_Type.tp_name);
197 0 : return -1;
198 : }
199 : }
200 0 : return 0;
201 : }
202 :
203 0 : static PyObject *py_SERVICE_LOCK_STATUS_get_lock_owner(PyObject *obj, void *closure)
204 : {
205 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
206 0 : PyObject *py_lock_owner;
207 0 : if (object->lock_owner == NULL) {
208 0 : Py_RETURN_NONE;
209 : }
210 0 : if (object->lock_owner == NULL) {
211 0 : py_lock_owner = Py_None;
212 0 : Py_INCREF(py_lock_owner);
213 : } else {
214 0 : if (object->lock_owner == NULL) {
215 0 : py_lock_owner = Py_None;
216 0 : Py_INCREF(py_lock_owner);
217 : } else {
218 0 : py_lock_owner = PyUnicode_Decode(object->lock_owner, strlen(object->lock_owner), "utf-8", "ignore");
219 : }
220 : }
221 0 : return py_lock_owner;
222 : }
223 :
224 0 : static int py_SERVICE_LOCK_STATUS_set_lock_owner(PyObject *py_obj, PyObject *value, void *closure)
225 : {
226 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
227 0 : if (value == NULL) {
228 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lock_owner");
229 0 : return -1;
230 : }
231 0 : if (value == Py_None) {
232 0 : object->lock_owner = NULL;
233 : } else {
234 0 : object->lock_owner = NULL;
235 : {
236 0 : const char *test_str;
237 0 : const char *talloc_str;
238 0 : PyObject *unicode = NULL;
239 0 : if (PyUnicode_Check(value)) {
240 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
241 0 : if (unicode == NULL) {
242 0 : return -1;
243 : }
244 0 : test_str = PyBytes_AS_STRING(unicode);
245 0 : } else if (PyBytes_Check(value)) {
246 0 : test_str = PyBytes_AS_STRING(value);
247 : } else {
248 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
249 0 : return -1;
250 : }
251 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
252 0 : if (unicode != NULL) {
253 0 : Py_DECREF(unicode);
254 : }
255 0 : if (talloc_str == NULL) {
256 0 : PyErr_NoMemory();
257 0 : return -1;
258 : }
259 0 : object->lock_owner = talloc_str;
260 : }
261 : }
262 0 : return 0;
263 : }
264 :
265 0 : static PyObject *py_SERVICE_LOCK_STATUS_get_lock_duration(PyObject *obj, void *closure)
266 : {
267 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
268 0 : PyObject *py_lock_duration;
269 0 : py_lock_duration = PyLong_FromUnsignedLongLong((uint32_t)object->lock_duration);
270 0 : return py_lock_duration;
271 : }
272 :
273 0 : static int py_SERVICE_LOCK_STATUS_set_lock_duration(PyObject *py_obj, PyObject *value, void *closure)
274 : {
275 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
276 0 : if (value == NULL) {
277 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lock_duration");
278 0 : return -1;
279 : }
280 : {
281 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lock_duration));
282 0 : if (PyLong_Check(value)) {
283 0 : unsigned long long test_var;
284 0 : test_var = PyLong_AsUnsignedLongLong(value);
285 0 : if (PyErr_Occurred() != NULL) {
286 0 : return -1;
287 : }
288 0 : if (test_var > uint_max) {
289 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
290 : PyLong_Type.tp_name, uint_max, test_var);
291 0 : return -1;
292 : }
293 0 : object->lock_duration = test_var;
294 : } else {
295 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
296 : PyLong_Type.tp_name);
297 0 : return -1;
298 : }
299 : }
300 0 : return 0;
301 : }
302 :
303 : static PyGetSetDef py_SERVICE_LOCK_STATUS_getsetters[] = {
304 : {
305 : .name = discard_const_p(char, "is_locked"),
306 : .get = py_SERVICE_LOCK_STATUS_get_is_locked,
307 : .set = py_SERVICE_LOCK_STATUS_set_is_locked,
308 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
309 : },
310 : {
311 : .name = discard_const_p(char, "lock_owner"),
312 : .get = py_SERVICE_LOCK_STATUS_get_lock_owner,
313 : .set = py_SERVICE_LOCK_STATUS_set_lock_owner,
314 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
315 : },
316 : {
317 : .name = discard_const_p(char, "lock_duration"),
318 : .get = py_SERVICE_LOCK_STATUS_get_lock_duration,
319 : .set = py_SERVICE_LOCK_STATUS_set_lock_duration,
320 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
321 : },
322 : { .name = NULL }
323 : };
324 :
325 0 : static PyObject *py_SERVICE_LOCK_STATUS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
326 : {
327 0 : return pytalloc_new(struct SERVICE_LOCK_STATUS, type);
328 : }
329 :
330 :
331 : static PyTypeObject SERVICE_LOCK_STATUS_Type = {
332 : PyVarObject_HEAD_INIT(NULL, 0)
333 : .tp_name = "svcctl.SERVICE_LOCK_STATUS",
334 : .tp_getset = py_SERVICE_LOCK_STATUS_getsetters,
335 : .tp_methods = NULL,
336 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
337 : .tp_new = py_SERVICE_LOCK_STATUS_new,
338 : };
339 :
340 :
341 0 : static PyObject *py_SERVICE_STATUS_get_type(PyObject *obj, void *closure)
342 : {
343 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
344 0 : PyObject *py_type;
345 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
346 0 : return py_type;
347 : }
348 :
349 0 : static int py_SERVICE_STATUS_set_type(PyObject *py_obj, PyObject *value, void *closure)
350 : {
351 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
352 0 : if (value == NULL) {
353 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
354 0 : return -1;
355 : }
356 : {
357 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
358 0 : if (PyLong_Check(value)) {
359 0 : unsigned long long test_var;
360 0 : test_var = PyLong_AsUnsignedLongLong(value);
361 0 : if (PyErr_Occurred() != NULL) {
362 0 : return -1;
363 : }
364 0 : if (test_var > uint_max) {
365 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
366 : PyLong_Type.tp_name, uint_max, test_var);
367 0 : return -1;
368 : }
369 0 : object->type = test_var;
370 : } else {
371 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
372 : PyLong_Type.tp_name);
373 0 : return -1;
374 : }
375 : }
376 0 : return 0;
377 : }
378 :
379 0 : static PyObject *py_SERVICE_STATUS_get_state(PyObject *obj, void *closure)
380 : {
381 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
382 0 : PyObject *py_state;
383 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->state);
384 0 : return py_state;
385 : }
386 :
387 0 : static int py_SERVICE_STATUS_set_state(PyObject *py_obj, PyObject *value, void *closure)
388 : {
389 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
390 0 : if (value == NULL) {
391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->state");
392 0 : return -1;
393 : }
394 : {
395 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->state));
396 0 : if (PyLong_Check(value)) {
397 0 : unsigned long long test_var;
398 0 : test_var = PyLong_AsUnsignedLongLong(value);
399 0 : if (PyErr_Occurred() != NULL) {
400 0 : return -1;
401 : }
402 0 : if (test_var > uint_max) {
403 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
404 : PyLong_Type.tp_name, uint_max, test_var);
405 0 : return -1;
406 : }
407 0 : object->state = test_var;
408 : } else {
409 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
410 : PyLong_Type.tp_name);
411 0 : return -1;
412 : }
413 : }
414 0 : return 0;
415 : }
416 :
417 0 : static PyObject *py_SERVICE_STATUS_get_controls_accepted(PyObject *obj, void *closure)
418 : {
419 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
420 0 : PyObject *py_controls_accepted;
421 0 : py_controls_accepted = PyLong_FromUnsignedLongLong((uint32_t)object->controls_accepted);
422 0 : return py_controls_accepted;
423 : }
424 :
425 0 : static int py_SERVICE_STATUS_set_controls_accepted(PyObject *py_obj, PyObject *value, void *closure)
426 : {
427 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
428 0 : if (value == NULL) {
429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->controls_accepted");
430 0 : return -1;
431 : }
432 : {
433 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->controls_accepted));
434 0 : if (PyLong_Check(value)) {
435 0 : unsigned long long test_var;
436 0 : test_var = PyLong_AsUnsignedLongLong(value);
437 0 : if (PyErr_Occurred() != NULL) {
438 0 : return -1;
439 : }
440 0 : if (test_var > uint_max) {
441 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
442 : PyLong_Type.tp_name, uint_max, test_var);
443 0 : return -1;
444 : }
445 0 : object->controls_accepted = test_var;
446 : } else {
447 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
448 : PyLong_Type.tp_name);
449 0 : return -1;
450 : }
451 : }
452 0 : return 0;
453 : }
454 :
455 0 : static PyObject *py_SERVICE_STATUS_get_win32_exit_code(PyObject *obj, void *closure)
456 : {
457 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
458 0 : PyObject *py_win32_exit_code;
459 0 : py_win32_exit_code = PyErr_FromWERROR(object->win32_exit_code);
460 0 : return py_win32_exit_code;
461 : }
462 :
463 0 : static int py_SERVICE_STATUS_set_win32_exit_code(PyObject *py_obj, PyObject *value, void *closure)
464 : {
465 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
466 0 : if (value == NULL) {
467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->win32_exit_code");
468 0 : return -1;
469 : }
470 0 : object->win32_exit_code = W_ERROR(PyLong_AsLong(value));
471 0 : return 0;
472 : }
473 :
474 0 : static PyObject *py_SERVICE_STATUS_get_service_exit_code(PyObject *obj, void *closure)
475 : {
476 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
477 0 : PyObject *py_service_exit_code;
478 0 : py_service_exit_code = PyLong_FromUnsignedLongLong((uint32_t)object->service_exit_code);
479 0 : return py_service_exit_code;
480 : }
481 :
482 0 : static int py_SERVICE_STATUS_set_service_exit_code(PyObject *py_obj, PyObject *value, void *closure)
483 : {
484 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
485 0 : if (value == NULL) {
486 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_exit_code");
487 0 : return -1;
488 : }
489 : {
490 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_exit_code));
491 0 : if (PyLong_Check(value)) {
492 0 : unsigned long long test_var;
493 0 : test_var = PyLong_AsUnsignedLongLong(value);
494 0 : if (PyErr_Occurred() != NULL) {
495 0 : return -1;
496 : }
497 0 : if (test_var > uint_max) {
498 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
499 : PyLong_Type.tp_name, uint_max, test_var);
500 0 : return -1;
501 : }
502 0 : object->service_exit_code = test_var;
503 : } else {
504 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
505 : PyLong_Type.tp_name);
506 0 : return -1;
507 : }
508 : }
509 0 : return 0;
510 : }
511 :
512 0 : static PyObject *py_SERVICE_STATUS_get_check_point(PyObject *obj, void *closure)
513 : {
514 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
515 0 : PyObject *py_check_point;
516 0 : py_check_point = PyLong_FromUnsignedLongLong((uint32_t)object->check_point);
517 0 : return py_check_point;
518 : }
519 :
520 0 : static int py_SERVICE_STATUS_set_check_point(PyObject *py_obj, PyObject *value, void *closure)
521 : {
522 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
523 0 : if (value == NULL) {
524 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->check_point");
525 0 : return -1;
526 : }
527 : {
528 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->check_point));
529 0 : if (PyLong_Check(value)) {
530 0 : unsigned long long test_var;
531 0 : test_var = PyLong_AsUnsignedLongLong(value);
532 0 : if (PyErr_Occurred() != NULL) {
533 0 : return -1;
534 : }
535 0 : if (test_var > uint_max) {
536 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
537 : PyLong_Type.tp_name, uint_max, test_var);
538 0 : return -1;
539 : }
540 0 : object->check_point = test_var;
541 : } else {
542 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
543 : PyLong_Type.tp_name);
544 0 : return -1;
545 : }
546 : }
547 0 : return 0;
548 : }
549 :
550 0 : static PyObject *py_SERVICE_STATUS_get_wait_hint(PyObject *obj, void *closure)
551 : {
552 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
553 0 : PyObject *py_wait_hint;
554 0 : py_wait_hint = PyLong_FromUnsignedLongLong((uint32_t)object->wait_hint);
555 0 : return py_wait_hint;
556 : }
557 :
558 0 : static int py_SERVICE_STATUS_set_wait_hint(PyObject *py_obj, PyObject *value, void *closure)
559 : {
560 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
561 0 : if (value == NULL) {
562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->wait_hint");
563 0 : return -1;
564 : }
565 : {
566 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wait_hint));
567 0 : if (PyLong_Check(value)) {
568 0 : unsigned long long test_var;
569 0 : test_var = PyLong_AsUnsignedLongLong(value);
570 0 : if (PyErr_Occurred() != NULL) {
571 0 : return -1;
572 : }
573 0 : if (test_var > uint_max) {
574 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
575 : PyLong_Type.tp_name, uint_max, test_var);
576 0 : return -1;
577 : }
578 0 : object->wait_hint = test_var;
579 : } else {
580 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
581 : PyLong_Type.tp_name);
582 0 : return -1;
583 : }
584 : }
585 0 : return 0;
586 : }
587 :
588 : static PyGetSetDef py_SERVICE_STATUS_getsetters[] = {
589 : {
590 : .name = discard_const_p(char, "type"),
591 : .get = py_SERVICE_STATUS_get_type,
592 : .set = py_SERVICE_STATUS_set_type,
593 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
594 : },
595 : {
596 : .name = discard_const_p(char, "state"),
597 : .get = py_SERVICE_STATUS_get_state,
598 : .set = py_SERVICE_STATUS_set_state,
599 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceStatus")
600 : },
601 : {
602 : .name = discard_const_p(char, "controls_accepted"),
603 : .get = py_SERVICE_STATUS_get_controls_accepted,
604 : .set = py_SERVICE_STATUS_set_controls_accepted,
605 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ControlsAccepted")
606 : },
607 : {
608 : .name = discard_const_p(char, "win32_exit_code"),
609 : .get = py_SERVICE_STATUS_get_win32_exit_code,
610 : .set = py_SERVICE_STATUS_set_win32_exit_code,
611 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
612 : },
613 : {
614 : .name = discard_const_p(char, "service_exit_code"),
615 : .get = py_SERVICE_STATUS_get_service_exit_code,
616 : .set = py_SERVICE_STATUS_set_service_exit_code,
617 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
618 : },
619 : {
620 : .name = discard_const_p(char, "check_point"),
621 : .get = py_SERVICE_STATUS_get_check_point,
622 : .set = py_SERVICE_STATUS_set_check_point,
623 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
624 : },
625 : {
626 : .name = discard_const_p(char, "wait_hint"),
627 : .get = py_SERVICE_STATUS_get_wait_hint,
628 : .set = py_SERVICE_STATUS_set_wait_hint,
629 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
630 : },
631 : { .name = NULL }
632 : };
633 :
634 0 : static PyObject *py_SERVICE_STATUS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
635 : {
636 0 : return pytalloc_new(struct SERVICE_STATUS, type);
637 : }
638 :
639 :
640 : static PyTypeObject SERVICE_STATUS_Type = {
641 : PyVarObject_HEAD_INIT(NULL, 0)
642 : .tp_name = "svcctl.SERVICE_STATUS",
643 : .tp_getset = py_SERVICE_STATUS_getsetters,
644 : .tp_methods = NULL,
645 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
646 : .tp_new = py_SERVICE_STATUS_new,
647 : };
648 :
649 :
650 0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_status(PyObject *obj, void *closure)
651 : {
652 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
653 0 : PyObject *py_status;
654 0 : py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
655 0 : return py_status;
656 : }
657 :
658 0 : static int py_SERVICE_STATUS_PROCESS_set_status(PyObject *py_obj, PyObject *value, void *closure)
659 : {
660 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
661 0 : if (value == NULL) {
662 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
663 0 : return -1;
664 : }
665 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
666 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
667 0 : PyErr_NoMemory();
668 0 : return -1;
669 : }
670 0 : object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
671 0 : return 0;
672 : }
673 :
674 0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_process_id(PyObject *obj, void *closure)
675 : {
676 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
677 0 : PyObject *py_process_id;
678 0 : py_process_id = PyLong_FromUnsignedLongLong((uint32_t)object->process_id);
679 0 : return py_process_id;
680 : }
681 :
682 0 : static int py_SERVICE_STATUS_PROCESS_set_process_id(PyObject *py_obj, PyObject *value, void *closure)
683 : {
684 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
685 0 : if (value == NULL) {
686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->process_id");
687 0 : return -1;
688 : }
689 : {
690 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->process_id));
691 0 : if (PyLong_Check(value)) {
692 0 : unsigned long long test_var;
693 0 : test_var = PyLong_AsUnsignedLongLong(value);
694 0 : if (PyErr_Occurred() != NULL) {
695 0 : return -1;
696 : }
697 0 : if (test_var > uint_max) {
698 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
699 : PyLong_Type.tp_name, uint_max, test_var);
700 0 : return -1;
701 : }
702 0 : object->process_id = test_var;
703 : } else {
704 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
705 : PyLong_Type.tp_name);
706 0 : return -1;
707 : }
708 : }
709 0 : return 0;
710 : }
711 :
712 0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_service_flags(PyObject *obj, void *closure)
713 : {
714 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
715 0 : PyObject *py_service_flags;
716 0 : py_service_flags = PyLong_FromUnsignedLongLong((uint32_t)object->service_flags);
717 0 : return py_service_flags;
718 : }
719 :
720 0 : static int py_SERVICE_STATUS_PROCESS_set_service_flags(PyObject *py_obj, PyObject *value, void *closure)
721 : {
722 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
723 0 : if (value == NULL) {
724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_flags");
725 0 : return -1;
726 : }
727 : {
728 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_flags));
729 0 : if (PyLong_Check(value)) {
730 0 : unsigned long long test_var;
731 0 : test_var = PyLong_AsUnsignedLongLong(value);
732 0 : if (PyErr_Occurred() != NULL) {
733 0 : return -1;
734 : }
735 0 : if (test_var > uint_max) {
736 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
737 : PyLong_Type.tp_name, uint_max, test_var);
738 0 : return -1;
739 : }
740 0 : object->service_flags = test_var;
741 : } else {
742 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
743 : PyLong_Type.tp_name);
744 0 : return -1;
745 : }
746 : }
747 0 : return 0;
748 : }
749 :
750 : static PyGetSetDef py_SERVICE_STATUS_PROCESS_getsetters[] = {
751 : {
752 : .name = discard_const_p(char, "status"),
753 : .get = py_SERVICE_STATUS_PROCESS_get_status,
754 : .set = py_SERVICE_STATUS_PROCESS_set_status,
755 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
756 : },
757 : {
758 : .name = discard_const_p(char, "process_id"),
759 : .get = py_SERVICE_STATUS_PROCESS_get_process_id,
760 : .set = py_SERVICE_STATUS_PROCESS_set_process_id,
761 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
762 : },
763 : {
764 : .name = discard_const_p(char, "service_flags"),
765 : .get = py_SERVICE_STATUS_PROCESS_get_service_flags,
766 : .set = py_SERVICE_STATUS_PROCESS_set_service_flags,
767 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
768 : },
769 : { .name = NULL }
770 : };
771 :
772 0 : static PyObject *py_SERVICE_STATUS_PROCESS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
773 : {
774 0 : return pytalloc_new(struct SERVICE_STATUS_PROCESS, type);
775 : }
776 :
777 0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
778 : {
779 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
780 0 : PyObject *ret = NULL;
781 0 : DATA_BLOB blob;
782 0 : enum ndr_err_code err;
783 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
784 0 : if (tmp_ctx == NULL) {
785 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
786 0 : return NULL;
787 : }
788 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_STATUS_PROCESS);
789 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
790 0 : TALLOC_FREE(tmp_ctx);
791 0 : PyErr_SetNdrError(err);
792 0 : return NULL;
793 : }
794 :
795 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
796 0 : TALLOC_FREE(tmp_ctx);
797 0 : return ret;
798 : }
799 :
800 0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
801 : {
802 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
803 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
804 0 : Py_ssize_t blob_length = 0;
805 0 : enum ndr_err_code err;
806 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
807 0 : PyObject *allow_remaining_obj = NULL;
808 0 : bool allow_remaining = false;
809 :
810 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
811 : discard_const_p(char *, kwnames),
812 : &blob.data, &blob_length,
813 : &allow_remaining_obj)) {
814 0 : return NULL;
815 : }
816 0 : blob.length = blob_length;
817 :
818 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
819 0 : allow_remaining = true;
820 : }
821 :
822 0 : if (allow_remaining) {
823 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_STATUS_PROCESS);
824 : } else {
825 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);
826 : }
827 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
828 0 : PyErr_SetNdrError(err);
829 0 : return NULL;
830 : }
831 :
832 0 : Py_RETURN_NONE;
833 : }
834 :
835 0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
836 : {
837 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
838 0 : PyObject *ret;
839 0 : char *retstr;
840 :
841 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);
842 0 : ret = PyUnicode_FromString(retstr);
843 0 : talloc_free(retstr);
844 :
845 0 : return ret;
846 : }
847 :
848 : static PyMethodDef py_SERVICE_STATUS_PROCESS_methods[] = {
849 : { "__ndr_pack__", (PyCFunction)py_SERVICE_STATUS_PROCESS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
850 : { "__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" },
851 : { "__ndr_print__", (PyCFunction)py_SERVICE_STATUS_PROCESS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
852 : { NULL, NULL, 0, NULL }
853 : };
854 :
855 :
856 : static PyTypeObject SERVICE_STATUS_PROCESS_Type = {
857 : PyVarObject_HEAD_INIT(NULL, 0)
858 : .tp_name = "svcctl.SERVICE_STATUS_PROCESS",
859 : .tp_getset = py_SERVICE_STATUS_PROCESS_getsetters,
860 : .tp_methods = py_SERVICE_STATUS_PROCESS_methods,
861 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
862 : .tp_new = py_SERVICE_STATUS_PROCESS_new,
863 : };
864 :
865 :
866 0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_service_name(PyObject *obj, void *closure)
867 : {
868 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
869 0 : PyObject *py_service_name;
870 0 : if (object->service_name == NULL) {
871 0 : Py_RETURN_NONE;
872 : }
873 0 : if (object->service_name == NULL) {
874 0 : py_service_name = Py_None;
875 0 : Py_INCREF(py_service_name);
876 : } else {
877 0 : py_service_name = PyString_FromStringOrNULL(object->service_name);
878 : }
879 0 : return py_service_name;
880 : }
881 :
882 0 : static int py_ENUM_SERVICE_STATUSW_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
883 : {
884 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
885 0 : if (value == NULL) {
886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_name");
887 0 : return -1;
888 : }
889 0 : if (value == Py_None) {
890 0 : object->service_name = NULL;
891 : } else {
892 0 : object->service_name = NULL;
893 : {
894 0 : const char *test_str;
895 0 : const char *talloc_str;
896 0 : PyObject *unicode = NULL;
897 0 : if (PyUnicode_Check(value)) {
898 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
899 0 : if (unicode == NULL) {
900 0 : return -1;
901 : }
902 0 : test_str = PyBytes_AS_STRING(unicode);
903 0 : } else if (PyBytes_Check(value)) {
904 0 : test_str = PyBytes_AS_STRING(value);
905 : } else {
906 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
907 0 : return -1;
908 : }
909 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
910 0 : if (unicode != NULL) {
911 0 : Py_DECREF(unicode);
912 : }
913 0 : if (talloc_str == NULL) {
914 0 : PyErr_NoMemory();
915 0 : return -1;
916 : }
917 0 : object->service_name = talloc_str;
918 : }
919 : }
920 0 : return 0;
921 : }
922 :
923 0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_display_name(PyObject *obj, void *closure)
924 : {
925 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
926 0 : PyObject *py_display_name;
927 0 : if (object->display_name == NULL) {
928 0 : Py_RETURN_NONE;
929 : }
930 0 : if (object->display_name == NULL) {
931 0 : py_display_name = Py_None;
932 0 : Py_INCREF(py_display_name);
933 : } else {
934 0 : py_display_name = PyString_FromStringOrNULL(object->display_name);
935 : }
936 0 : return py_display_name;
937 : }
938 :
939 0 : static int py_ENUM_SERVICE_STATUSW_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
940 : {
941 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
942 0 : if (value == NULL) {
943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->display_name");
944 0 : return -1;
945 : }
946 0 : if (value == Py_None) {
947 0 : object->display_name = NULL;
948 : } else {
949 0 : object->display_name = NULL;
950 : {
951 0 : const char *test_str;
952 0 : const char *talloc_str;
953 0 : PyObject *unicode = NULL;
954 0 : if (PyUnicode_Check(value)) {
955 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
956 0 : if (unicode == NULL) {
957 0 : return -1;
958 : }
959 0 : test_str = PyBytes_AS_STRING(unicode);
960 0 : } else if (PyBytes_Check(value)) {
961 0 : test_str = PyBytes_AS_STRING(value);
962 : } else {
963 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
964 0 : return -1;
965 : }
966 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
967 0 : if (unicode != NULL) {
968 0 : Py_DECREF(unicode);
969 : }
970 0 : if (talloc_str == NULL) {
971 0 : PyErr_NoMemory();
972 0 : return -1;
973 : }
974 0 : object->display_name = talloc_str;
975 : }
976 : }
977 0 : return 0;
978 : }
979 :
980 0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_status(PyObject *obj, void *closure)
981 : {
982 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
983 0 : PyObject *py_status;
984 0 : py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
985 0 : return py_status;
986 : }
987 :
988 0 : static int py_ENUM_SERVICE_STATUSW_set_status(PyObject *py_obj, PyObject *value, void *closure)
989 : {
990 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
991 0 : if (value == NULL) {
992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
993 0 : return -1;
994 : }
995 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
996 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
997 0 : PyErr_NoMemory();
998 0 : return -1;
999 : }
1000 0 : object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
1001 0 : return 0;
1002 : }
1003 :
1004 : static PyGetSetDef py_ENUM_SERVICE_STATUSW_getsetters[] = {
1005 : {
1006 : .name = discard_const_p(char, "service_name"),
1007 : .get = py_ENUM_SERVICE_STATUSW_get_service_name,
1008 : .set = py_ENUM_SERVICE_STATUSW_set_service_name,
1009 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1010 : },
1011 : {
1012 : .name = discard_const_p(char, "display_name"),
1013 : .get = py_ENUM_SERVICE_STATUSW_get_display_name,
1014 : .set = py_ENUM_SERVICE_STATUSW_set_display_name,
1015 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1016 : },
1017 : {
1018 : .name = discard_const_p(char, "status"),
1019 : .get = py_ENUM_SERVICE_STATUSW_get_status,
1020 : .set = py_ENUM_SERVICE_STATUSW_set_status,
1021 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
1022 : },
1023 : { .name = NULL }
1024 : };
1025 :
1026 0 : static PyObject *py_ENUM_SERVICE_STATUSW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1027 : {
1028 0 : return pytalloc_new(struct ENUM_SERVICE_STATUSW, type);
1029 : }
1030 :
1031 0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1032 : {
1033 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
1034 0 : PyObject *ret = NULL;
1035 0 : DATA_BLOB blob;
1036 0 : enum ndr_err_code err;
1037 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1038 0 : if (tmp_ctx == NULL) {
1039 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1040 0 : return NULL;
1041 : }
1042 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSW);
1043 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1044 0 : TALLOC_FREE(tmp_ctx);
1045 0 : PyErr_SetNdrError(err);
1046 0 : return NULL;
1047 : }
1048 :
1049 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1050 0 : TALLOC_FREE(tmp_ctx);
1051 0 : return ret;
1052 : }
1053 :
1054 0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1055 : {
1056 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
1057 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1058 0 : Py_ssize_t blob_length = 0;
1059 0 : enum ndr_err_code err;
1060 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1061 0 : PyObject *allow_remaining_obj = NULL;
1062 0 : bool allow_remaining = false;
1063 :
1064 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1065 : discard_const_p(char *, kwnames),
1066 : &blob.data, &blob_length,
1067 : &allow_remaining_obj)) {
1068 0 : return NULL;
1069 : }
1070 0 : blob.length = blob_length;
1071 :
1072 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1073 0 : allow_remaining = true;
1074 : }
1075 :
1076 0 : if (allow_remaining) {
1077 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSW);
1078 : } else {
1079 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);
1080 : }
1081 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1082 0 : PyErr_SetNdrError(err);
1083 0 : return NULL;
1084 : }
1085 :
1086 0 : Py_RETURN_NONE;
1087 : }
1088 :
1089 0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1090 : {
1091 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
1092 0 : PyObject *ret;
1093 0 : char *retstr;
1094 :
1095 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);
1096 0 : ret = PyUnicode_FromString(retstr);
1097 0 : talloc_free(retstr);
1098 :
1099 0 : return ret;
1100 : }
1101 :
1102 : static PyMethodDef py_ENUM_SERVICE_STATUSW_methods[] = {
1103 : { "__ndr_pack__", (PyCFunction)py_ENUM_SERVICE_STATUSW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1104 : { "__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" },
1105 : { "__ndr_print__", (PyCFunction)py_ENUM_SERVICE_STATUSW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1106 : { NULL, NULL, 0, NULL }
1107 : };
1108 :
1109 :
1110 : static PyTypeObject ENUM_SERVICE_STATUSW_Type = {
1111 : PyVarObject_HEAD_INIT(NULL, 0)
1112 : .tp_name = "svcctl.ENUM_SERVICE_STATUSW",
1113 : .tp_getset = py_ENUM_SERVICE_STATUSW_getsetters,
1114 : .tp_methods = py_ENUM_SERVICE_STATUSW_methods,
1115 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1116 : .tp_new = py_ENUM_SERVICE_STATUSW_new,
1117 : };
1118 :
1119 :
1120 0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_service_name(PyObject *obj, void *closure)
1121 : {
1122 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
1123 0 : PyObject *py_service_name;
1124 0 : if (object->service_name == NULL) {
1125 0 : Py_RETURN_NONE;
1126 : }
1127 0 : if (object->service_name == NULL) {
1128 0 : py_service_name = Py_None;
1129 0 : Py_INCREF(py_service_name);
1130 : } else {
1131 0 : py_service_name = PyString_FromStringOrNULL(object->service_name);
1132 : }
1133 0 : return py_service_name;
1134 : }
1135 :
1136 0 : static int py_ENUM_SERVICE_STATUSA_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
1137 : {
1138 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1139 0 : if (value == NULL) {
1140 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_name");
1141 0 : return -1;
1142 : }
1143 0 : if (value == Py_None) {
1144 0 : object->service_name = NULL;
1145 : } else {
1146 0 : object->service_name = NULL;
1147 : {
1148 0 : const char *test_str;
1149 0 : const char *talloc_str;
1150 0 : PyObject *unicode = NULL;
1151 0 : if (PyUnicode_Check(value)) {
1152 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1153 0 : if (unicode == NULL) {
1154 0 : return -1;
1155 : }
1156 0 : test_str = PyBytes_AS_STRING(unicode);
1157 0 : } else if (PyBytes_Check(value)) {
1158 0 : test_str = PyBytes_AS_STRING(value);
1159 : } else {
1160 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1161 0 : return -1;
1162 : }
1163 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1164 0 : if (unicode != NULL) {
1165 0 : Py_DECREF(unicode);
1166 : }
1167 0 : if (talloc_str == NULL) {
1168 0 : PyErr_NoMemory();
1169 0 : return -1;
1170 : }
1171 0 : object->service_name = talloc_str;
1172 : }
1173 : }
1174 0 : return 0;
1175 : }
1176 :
1177 0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_display_name(PyObject *obj, void *closure)
1178 : {
1179 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
1180 0 : PyObject *py_display_name;
1181 0 : if (object->display_name == NULL) {
1182 0 : Py_RETURN_NONE;
1183 : }
1184 0 : if (object->display_name == NULL) {
1185 0 : py_display_name = Py_None;
1186 0 : Py_INCREF(py_display_name);
1187 : } else {
1188 0 : py_display_name = PyString_FromStringOrNULL(object->display_name);
1189 : }
1190 0 : return py_display_name;
1191 : }
1192 :
1193 0 : static int py_ENUM_SERVICE_STATUSA_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
1194 : {
1195 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1196 0 : if (value == NULL) {
1197 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->display_name");
1198 0 : return -1;
1199 : }
1200 0 : if (value == Py_None) {
1201 0 : object->display_name = NULL;
1202 : } else {
1203 0 : object->display_name = NULL;
1204 : {
1205 0 : const char *test_str;
1206 0 : const char *talloc_str;
1207 0 : PyObject *unicode = NULL;
1208 0 : if (PyUnicode_Check(value)) {
1209 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1210 0 : if (unicode == NULL) {
1211 0 : return -1;
1212 : }
1213 0 : test_str = PyBytes_AS_STRING(unicode);
1214 0 : } else if (PyBytes_Check(value)) {
1215 0 : test_str = PyBytes_AS_STRING(value);
1216 : } else {
1217 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1218 0 : return -1;
1219 : }
1220 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1221 0 : if (unicode != NULL) {
1222 0 : Py_DECREF(unicode);
1223 : }
1224 0 : if (talloc_str == NULL) {
1225 0 : PyErr_NoMemory();
1226 0 : return -1;
1227 : }
1228 0 : object->display_name = talloc_str;
1229 : }
1230 : }
1231 0 : return 0;
1232 : }
1233 :
1234 0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_status(PyObject *obj, void *closure)
1235 : {
1236 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
1237 0 : PyObject *py_status;
1238 0 : py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
1239 0 : return py_status;
1240 : }
1241 :
1242 0 : static int py_ENUM_SERVICE_STATUSA_set_status(PyObject *py_obj, PyObject *value, void *closure)
1243 : {
1244 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1245 0 : if (value == NULL) {
1246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
1247 0 : return -1;
1248 : }
1249 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
1250 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1251 0 : PyErr_NoMemory();
1252 0 : return -1;
1253 : }
1254 0 : object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
1255 0 : return 0;
1256 : }
1257 :
1258 : static PyGetSetDef py_ENUM_SERVICE_STATUSA_getsetters[] = {
1259 : {
1260 : .name = discard_const_p(char, "service_name"),
1261 : .get = py_ENUM_SERVICE_STATUSA_get_service_name,
1262 : .set = py_ENUM_SERVICE_STATUSA_set_service_name,
1263 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1264 : },
1265 : {
1266 : .name = discard_const_p(char, "display_name"),
1267 : .get = py_ENUM_SERVICE_STATUSA_get_display_name,
1268 : .set = py_ENUM_SERVICE_STATUSA_set_display_name,
1269 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1270 : },
1271 : {
1272 : .name = discard_const_p(char, "status"),
1273 : .get = py_ENUM_SERVICE_STATUSA_get_status,
1274 : .set = py_ENUM_SERVICE_STATUSA_set_status,
1275 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
1276 : },
1277 : { .name = NULL }
1278 : };
1279 :
1280 0 : static PyObject *py_ENUM_SERVICE_STATUSA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1281 : {
1282 0 : return pytalloc_new(struct ENUM_SERVICE_STATUSA, type);
1283 : }
1284 :
1285 0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1286 : {
1287 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1288 0 : PyObject *ret = NULL;
1289 0 : DATA_BLOB blob;
1290 0 : enum ndr_err_code err;
1291 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1292 0 : if (tmp_ctx == NULL) {
1293 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1294 0 : return NULL;
1295 : }
1296 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSA);
1297 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1298 0 : TALLOC_FREE(tmp_ctx);
1299 0 : PyErr_SetNdrError(err);
1300 0 : return NULL;
1301 : }
1302 :
1303 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1304 0 : TALLOC_FREE(tmp_ctx);
1305 0 : return ret;
1306 : }
1307 :
1308 0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1309 : {
1310 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1311 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1312 0 : Py_ssize_t blob_length = 0;
1313 0 : enum ndr_err_code err;
1314 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1315 0 : PyObject *allow_remaining_obj = NULL;
1316 0 : bool allow_remaining = false;
1317 :
1318 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1319 : discard_const_p(char *, kwnames),
1320 : &blob.data, &blob_length,
1321 : &allow_remaining_obj)) {
1322 0 : return NULL;
1323 : }
1324 0 : blob.length = blob_length;
1325 :
1326 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1327 0 : allow_remaining = true;
1328 : }
1329 :
1330 0 : if (allow_remaining) {
1331 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSA);
1332 : } else {
1333 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);
1334 : }
1335 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1336 0 : PyErr_SetNdrError(err);
1337 0 : return NULL;
1338 : }
1339 :
1340 0 : Py_RETURN_NONE;
1341 : }
1342 :
1343 0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1344 : {
1345 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1346 0 : PyObject *ret;
1347 0 : char *retstr;
1348 :
1349 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);
1350 0 : ret = PyUnicode_FromString(retstr);
1351 0 : talloc_free(retstr);
1352 :
1353 0 : return ret;
1354 : }
1355 :
1356 : static PyMethodDef py_ENUM_SERVICE_STATUSA_methods[] = {
1357 : { "__ndr_pack__", (PyCFunction)py_ENUM_SERVICE_STATUSA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1358 : { "__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" },
1359 : { "__ndr_print__", (PyCFunction)py_ENUM_SERVICE_STATUSA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1360 : { NULL, NULL, 0, NULL }
1361 : };
1362 :
1363 :
1364 : static PyTypeObject ENUM_SERVICE_STATUSA_Type = {
1365 : PyVarObject_HEAD_INIT(NULL, 0)
1366 : .tp_name = "svcctl.ENUM_SERVICE_STATUSA",
1367 : .tp_getset = py_ENUM_SERVICE_STATUSA_getsetters,
1368 : .tp_methods = py_ENUM_SERVICE_STATUSA_methods,
1369 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1370 : .tp_new = py_ENUM_SERVICE_STATUSA_new,
1371 : };
1372 :
1373 :
1374 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_service_type(PyObject *obj, void *closure)
1375 : {
1376 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1377 0 : PyObject *py_service_type;
1378 0 : py_service_type = PyLong_FromUnsignedLongLong((uint32_t)object->service_type);
1379 0 : return py_service_type;
1380 : }
1381 :
1382 0 : static int py_QUERY_SERVICE_CONFIG_set_service_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->service_type");
1387 0 : return -1;
1388 : }
1389 : {
1390 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_type));
1391 0 : if (PyLong_Check(value)) {
1392 0 : 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->service_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_start_type(PyObject *obj, void *closure)
1413 : {
1414 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1415 0 : PyObject *py_start_type;
1416 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->start_type);
1417 0 : return py_start_type;
1418 : }
1419 :
1420 0 : static int py_QUERY_SERVICE_CONFIG_set_start_type(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->start_type");
1425 0 : return -1;
1426 : }
1427 : {
1428 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start_type));
1429 0 : if (PyLong_Check(value)) {
1430 0 : 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->start_type = 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_error_control(PyObject *obj, void *closure)
1451 : {
1452 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1453 0 : PyObject *py_error_control;
1454 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->error_control);
1455 0 : return py_error_control;
1456 : }
1457 :
1458 0 : static int py_QUERY_SERVICE_CONFIG_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
1459 : {
1460 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1461 0 : if (value == NULL) {
1462 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->error_control");
1463 0 : return -1;
1464 : }
1465 : {
1466 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->error_control));
1467 0 : if (PyLong_Check(value)) {
1468 0 : unsigned long long test_var;
1469 0 : test_var = PyLong_AsUnsignedLongLong(value);
1470 0 : if (PyErr_Occurred() != NULL) {
1471 0 : return -1;
1472 : }
1473 0 : if (test_var > uint_max) {
1474 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1475 : PyLong_Type.tp_name, uint_max, test_var);
1476 0 : return -1;
1477 : }
1478 0 : object->error_control = test_var;
1479 : } else {
1480 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1481 : PyLong_Type.tp_name);
1482 0 : return -1;
1483 : }
1484 : }
1485 0 : return 0;
1486 : }
1487 :
1488 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_executablepath(PyObject *obj, void *closure)
1489 : {
1490 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1491 0 : PyObject *py_executablepath;
1492 0 : if (object->executablepath == NULL) {
1493 0 : Py_RETURN_NONE;
1494 : }
1495 0 : if (object->executablepath == NULL) {
1496 0 : py_executablepath = Py_None;
1497 0 : Py_INCREF(py_executablepath);
1498 : } else {
1499 0 : if (object->executablepath == NULL) {
1500 0 : py_executablepath = Py_None;
1501 0 : Py_INCREF(py_executablepath);
1502 : } else {
1503 0 : py_executablepath = PyUnicode_Decode(object->executablepath, strlen(object->executablepath), "utf-8", "ignore");
1504 : }
1505 : }
1506 0 : return py_executablepath;
1507 : }
1508 :
1509 0 : static int py_QUERY_SERVICE_CONFIG_set_executablepath(PyObject *py_obj, PyObject *value, void *closure)
1510 : {
1511 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1512 0 : if (value == NULL) {
1513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->executablepath");
1514 0 : return -1;
1515 : }
1516 0 : if (value == Py_None) {
1517 0 : object->executablepath = NULL;
1518 : } else {
1519 0 : object->executablepath = NULL;
1520 : {
1521 0 : const char *test_str;
1522 0 : const char *talloc_str;
1523 0 : PyObject *unicode = NULL;
1524 0 : if (PyUnicode_Check(value)) {
1525 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1526 0 : if (unicode == NULL) {
1527 0 : return -1;
1528 : }
1529 0 : test_str = PyBytes_AS_STRING(unicode);
1530 0 : } else if (PyBytes_Check(value)) {
1531 0 : test_str = PyBytes_AS_STRING(value);
1532 : } else {
1533 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1534 0 : return -1;
1535 : }
1536 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1537 0 : if (unicode != NULL) {
1538 0 : Py_DECREF(unicode);
1539 : }
1540 0 : if (talloc_str == NULL) {
1541 0 : PyErr_NoMemory();
1542 0 : return -1;
1543 : }
1544 0 : object->executablepath = talloc_str;
1545 : }
1546 : }
1547 0 : return 0;
1548 : }
1549 :
1550 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_loadordergroup(PyObject *obj, void *closure)
1551 : {
1552 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1553 0 : PyObject *py_loadordergroup;
1554 0 : if (object->loadordergroup == NULL) {
1555 0 : Py_RETURN_NONE;
1556 : }
1557 0 : if (object->loadordergroup == NULL) {
1558 0 : py_loadordergroup = Py_None;
1559 0 : Py_INCREF(py_loadordergroup);
1560 : } else {
1561 0 : if (object->loadordergroup == NULL) {
1562 0 : py_loadordergroup = Py_None;
1563 0 : Py_INCREF(py_loadordergroup);
1564 : } else {
1565 0 : py_loadordergroup = PyUnicode_Decode(object->loadordergroup, strlen(object->loadordergroup), "utf-8", "ignore");
1566 : }
1567 : }
1568 0 : return py_loadordergroup;
1569 : }
1570 :
1571 0 : static int py_QUERY_SERVICE_CONFIG_set_loadordergroup(PyObject *py_obj, PyObject *value, void *closure)
1572 : {
1573 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1574 0 : if (value == NULL) {
1575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->loadordergroup");
1576 0 : return -1;
1577 : }
1578 0 : if (value == Py_None) {
1579 0 : object->loadordergroup = NULL;
1580 : } else {
1581 0 : object->loadordergroup = NULL;
1582 : {
1583 0 : const char *test_str;
1584 0 : const char *talloc_str;
1585 0 : PyObject *unicode = NULL;
1586 0 : if (PyUnicode_Check(value)) {
1587 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1588 0 : if (unicode == NULL) {
1589 0 : return -1;
1590 : }
1591 0 : test_str = PyBytes_AS_STRING(unicode);
1592 0 : } else if (PyBytes_Check(value)) {
1593 0 : test_str = PyBytes_AS_STRING(value);
1594 : } else {
1595 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1596 0 : return -1;
1597 : }
1598 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1599 0 : if (unicode != NULL) {
1600 0 : Py_DECREF(unicode);
1601 : }
1602 0 : if (talloc_str == NULL) {
1603 0 : PyErr_NoMemory();
1604 0 : return -1;
1605 : }
1606 0 : object->loadordergroup = talloc_str;
1607 : }
1608 : }
1609 0 : return 0;
1610 : }
1611 :
1612 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_tag_id(PyObject *obj, void *closure)
1613 : {
1614 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1615 0 : PyObject *py_tag_id;
1616 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)object->tag_id);
1617 0 : return py_tag_id;
1618 : }
1619 :
1620 0 : static int py_QUERY_SERVICE_CONFIG_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
1621 : {
1622 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1623 0 : if (value == NULL) {
1624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tag_id");
1625 0 : return -1;
1626 : }
1627 : {
1628 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tag_id));
1629 0 : if (PyLong_Check(value)) {
1630 0 : unsigned long long test_var;
1631 0 : test_var = PyLong_AsUnsignedLongLong(value);
1632 0 : if (PyErr_Occurred() != NULL) {
1633 0 : return -1;
1634 : }
1635 0 : if (test_var > uint_max) {
1636 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1637 : PyLong_Type.tp_name, uint_max, test_var);
1638 0 : return -1;
1639 : }
1640 0 : object->tag_id = test_var;
1641 : } else {
1642 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1643 : PyLong_Type.tp_name);
1644 0 : return -1;
1645 : }
1646 : }
1647 0 : return 0;
1648 : }
1649 :
1650 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_dependencies(PyObject *obj, void *closure)
1651 : {
1652 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1653 0 : PyObject *py_dependencies;
1654 0 : if (object->dependencies == NULL) {
1655 0 : Py_RETURN_NONE;
1656 : }
1657 0 : if (object->dependencies == NULL) {
1658 0 : py_dependencies = Py_None;
1659 0 : Py_INCREF(py_dependencies);
1660 : } else {
1661 0 : if (object->dependencies == NULL) {
1662 0 : py_dependencies = Py_None;
1663 0 : Py_INCREF(py_dependencies);
1664 : } else {
1665 0 : py_dependencies = PyUnicode_Decode(object->dependencies, strlen(object->dependencies), "utf-8", "ignore");
1666 : }
1667 : }
1668 0 : return py_dependencies;
1669 : }
1670 :
1671 0 : static int py_QUERY_SERVICE_CONFIG_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
1672 : {
1673 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1674 0 : if (value == NULL) {
1675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dependencies");
1676 0 : return -1;
1677 : }
1678 0 : if (value == Py_None) {
1679 0 : object->dependencies = NULL;
1680 : } else {
1681 0 : object->dependencies = NULL;
1682 : {
1683 0 : const char *test_str;
1684 0 : const char *talloc_str;
1685 0 : PyObject *unicode = NULL;
1686 0 : if (PyUnicode_Check(value)) {
1687 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1688 0 : if (unicode == NULL) {
1689 0 : return -1;
1690 : }
1691 0 : test_str = PyBytes_AS_STRING(unicode);
1692 0 : } else if (PyBytes_Check(value)) {
1693 0 : test_str = PyBytes_AS_STRING(value);
1694 : } else {
1695 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1696 0 : return -1;
1697 : }
1698 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1699 0 : if (unicode != NULL) {
1700 0 : Py_DECREF(unicode);
1701 : }
1702 0 : if (talloc_str == NULL) {
1703 0 : PyErr_NoMemory();
1704 0 : return -1;
1705 : }
1706 0 : object->dependencies = talloc_str;
1707 : }
1708 : }
1709 0 : return 0;
1710 : }
1711 :
1712 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_startname(PyObject *obj, void *closure)
1713 : {
1714 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1715 0 : PyObject *py_startname;
1716 0 : if (object->startname == NULL) {
1717 0 : Py_RETURN_NONE;
1718 : }
1719 0 : if (object->startname == NULL) {
1720 0 : py_startname = Py_None;
1721 0 : Py_INCREF(py_startname);
1722 : } else {
1723 0 : if (object->startname == NULL) {
1724 0 : py_startname = Py_None;
1725 0 : Py_INCREF(py_startname);
1726 : } else {
1727 0 : py_startname = PyUnicode_Decode(object->startname, strlen(object->startname), "utf-8", "ignore");
1728 : }
1729 : }
1730 0 : return py_startname;
1731 : }
1732 :
1733 0 : static int py_QUERY_SERVICE_CONFIG_set_startname(PyObject *py_obj, PyObject *value, void *closure)
1734 : {
1735 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1736 0 : if (value == NULL) {
1737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->startname");
1738 0 : return -1;
1739 : }
1740 0 : if (value == Py_None) {
1741 0 : object->startname = NULL;
1742 : } else {
1743 0 : object->startname = NULL;
1744 : {
1745 0 : const char *test_str;
1746 0 : const char *talloc_str;
1747 0 : PyObject *unicode = NULL;
1748 0 : if (PyUnicode_Check(value)) {
1749 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1750 0 : if (unicode == NULL) {
1751 0 : return -1;
1752 : }
1753 0 : test_str = PyBytes_AS_STRING(unicode);
1754 0 : } else if (PyBytes_Check(value)) {
1755 0 : test_str = PyBytes_AS_STRING(value);
1756 : } else {
1757 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1758 0 : return -1;
1759 : }
1760 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1761 0 : if (unicode != NULL) {
1762 0 : Py_DECREF(unicode);
1763 : }
1764 0 : if (talloc_str == NULL) {
1765 0 : PyErr_NoMemory();
1766 0 : return -1;
1767 : }
1768 0 : object->startname = talloc_str;
1769 : }
1770 : }
1771 0 : return 0;
1772 : }
1773 :
1774 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_displayname(PyObject *obj, void *closure)
1775 : {
1776 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1777 0 : PyObject *py_displayname;
1778 0 : if (object->displayname == NULL) {
1779 0 : Py_RETURN_NONE;
1780 : }
1781 0 : if (object->displayname == NULL) {
1782 0 : py_displayname = Py_None;
1783 0 : Py_INCREF(py_displayname);
1784 : } else {
1785 0 : if (object->displayname == NULL) {
1786 0 : py_displayname = Py_None;
1787 0 : Py_INCREF(py_displayname);
1788 : } else {
1789 0 : py_displayname = PyUnicode_Decode(object->displayname, strlen(object->displayname), "utf-8", "ignore");
1790 : }
1791 : }
1792 0 : return py_displayname;
1793 : }
1794 :
1795 0 : static int py_QUERY_SERVICE_CONFIG_set_displayname(PyObject *py_obj, PyObject *value, void *closure)
1796 : {
1797 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1798 0 : if (value == NULL) {
1799 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->displayname");
1800 0 : return -1;
1801 : }
1802 0 : if (value == Py_None) {
1803 0 : object->displayname = NULL;
1804 : } else {
1805 0 : object->displayname = NULL;
1806 : {
1807 0 : const char *test_str;
1808 0 : const char *talloc_str;
1809 0 : PyObject *unicode = NULL;
1810 0 : if (PyUnicode_Check(value)) {
1811 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1812 0 : if (unicode == NULL) {
1813 0 : return -1;
1814 : }
1815 0 : test_str = PyBytes_AS_STRING(unicode);
1816 0 : } else if (PyBytes_Check(value)) {
1817 0 : test_str = PyBytes_AS_STRING(value);
1818 : } else {
1819 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1820 0 : return -1;
1821 : }
1822 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1823 0 : if (unicode != NULL) {
1824 0 : Py_DECREF(unicode);
1825 : }
1826 0 : if (talloc_str == NULL) {
1827 0 : PyErr_NoMemory();
1828 0 : return -1;
1829 : }
1830 0 : object->displayname = talloc_str;
1831 : }
1832 : }
1833 0 : return 0;
1834 : }
1835 :
1836 : static PyGetSetDef py_QUERY_SERVICE_CONFIG_getsetters[] = {
1837 : {
1838 : .name = discard_const_p(char, "service_type"),
1839 : .get = py_QUERY_SERVICE_CONFIG_get_service_type,
1840 : .set = py_QUERY_SERVICE_CONFIG_set_service_type,
1841 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1842 : },
1843 : {
1844 : .name = discard_const_p(char, "start_type"),
1845 : .get = py_QUERY_SERVICE_CONFIG_get_start_type,
1846 : .set = py_QUERY_SERVICE_CONFIG_set_start_type,
1847 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
1848 : },
1849 : {
1850 : .name = discard_const_p(char, "error_control"),
1851 : .get = py_QUERY_SERVICE_CONFIG_get_error_control,
1852 : .set = py_QUERY_SERVICE_CONFIG_set_error_control,
1853 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
1854 : },
1855 : {
1856 : .name = discard_const_p(char, "executablepath"),
1857 : .get = py_QUERY_SERVICE_CONFIG_get_executablepath,
1858 : .set = py_QUERY_SERVICE_CONFIG_set_executablepath,
1859 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1860 : },
1861 : {
1862 : .name = discard_const_p(char, "loadordergroup"),
1863 : .get = py_QUERY_SERVICE_CONFIG_get_loadordergroup,
1864 : .set = py_QUERY_SERVICE_CONFIG_set_loadordergroup,
1865 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1866 : },
1867 : {
1868 : .name = discard_const_p(char, "tag_id"),
1869 : .get = py_QUERY_SERVICE_CONFIG_get_tag_id,
1870 : .set = py_QUERY_SERVICE_CONFIG_set_tag_id,
1871 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1872 : },
1873 : {
1874 : .name = discard_const_p(char, "dependencies"),
1875 : .get = py_QUERY_SERVICE_CONFIG_get_dependencies,
1876 : .set = py_QUERY_SERVICE_CONFIG_set_dependencies,
1877 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1878 : },
1879 : {
1880 : .name = discard_const_p(char, "startname"),
1881 : .get = py_QUERY_SERVICE_CONFIG_get_startname,
1882 : .set = py_QUERY_SERVICE_CONFIG_set_startname,
1883 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1884 : },
1885 : {
1886 : .name = discard_const_p(char, "displayname"),
1887 : .get = py_QUERY_SERVICE_CONFIG_get_displayname,
1888 : .set = py_QUERY_SERVICE_CONFIG_set_displayname,
1889 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1890 : },
1891 : { .name = NULL }
1892 : };
1893 :
1894 0 : static PyObject *py_QUERY_SERVICE_CONFIG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1895 : {
1896 0 : return pytalloc_new(struct QUERY_SERVICE_CONFIG, type);
1897 : }
1898 :
1899 0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1900 : {
1901 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1902 0 : PyObject *ret = NULL;
1903 0 : DATA_BLOB blob;
1904 0 : enum ndr_err_code err;
1905 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1906 0 : if (tmp_ctx == NULL) {
1907 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1908 0 : return NULL;
1909 : }
1910 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG);
1911 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1912 0 : TALLOC_FREE(tmp_ctx);
1913 0 : PyErr_SetNdrError(err);
1914 0 : return NULL;
1915 : }
1916 :
1917 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1918 0 : TALLOC_FREE(tmp_ctx);
1919 0 : return ret;
1920 : }
1921 :
1922 0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1923 : {
1924 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1925 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1926 0 : Py_ssize_t blob_length = 0;
1927 0 : enum ndr_err_code err;
1928 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1929 0 : PyObject *allow_remaining_obj = NULL;
1930 0 : bool allow_remaining = false;
1931 :
1932 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1933 : discard_const_p(char *, kwnames),
1934 : &blob.data, &blob_length,
1935 : &allow_remaining_obj)) {
1936 0 : return NULL;
1937 : }
1938 0 : blob.length = blob_length;
1939 :
1940 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1941 0 : allow_remaining = true;
1942 : }
1943 :
1944 0 : if (allow_remaining) {
1945 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_QUERY_SERVICE_CONFIG);
1946 : } else {
1947 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);
1948 : }
1949 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1950 0 : PyErr_SetNdrError(err);
1951 0 : return NULL;
1952 : }
1953 :
1954 0 : Py_RETURN_NONE;
1955 : }
1956 :
1957 0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1958 : {
1959 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1960 0 : PyObject *ret;
1961 0 : char *retstr;
1962 :
1963 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);
1964 0 : ret = PyUnicode_FromString(retstr);
1965 0 : talloc_free(retstr);
1966 :
1967 0 : return ret;
1968 : }
1969 :
1970 : static PyMethodDef py_QUERY_SERVICE_CONFIG_methods[] = {
1971 : { "__ndr_pack__", (PyCFunction)py_QUERY_SERVICE_CONFIG_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1972 : { "__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" },
1973 : { "__ndr_print__", (PyCFunction)py_QUERY_SERVICE_CONFIG_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1974 : { NULL, NULL, 0, NULL }
1975 : };
1976 :
1977 :
1978 : static PyTypeObject QUERY_SERVICE_CONFIG_Type = {
1979 : PyVarObject_HEAD_INIT(NULL, 0)
1980 : .tp_name = "svcctl.QUERY_SERVICE_CONFIG",
1981 : .tp_getset = py_QUERY_SERVICE_CONFIG_getsetters,
1982 : .tp_methods = py_QUERY_SERVICE_CONFIG_methods,
1983 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1984 : .tp_new = py_QUERY_SERVICE_CONFIG_new,
1985 : };
1986 :
1987 :
1988 0 : static PyObject *py_svcctl_ArgumentString_get_string(PyObject *obj, void *closure)
1989 : {
1990 0 : struct svcctl_ArgumentString *object = (struct svcctl_ArgumentString *)pytalloc_get_ptr(obj);
1991 0 : PyObject *py_string;
1992 0 : if (object->string == NULL) {
1993 0 : Py_RETURN_NONE;
1994 : }
1995 0 : if (object->string == NULL) {
1996 0 : py_string = Py_None;
1997 0 : Py_INCREF(py_string);
1998 : } else {
1999 0 : if (object->string == NULL) {
2000 0 : py_string = Py_None;
2001 0 : Py_INCREF(py_string);
2002 : } else {
2003 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
2004 : }
2005 : }
2006 0 : return py_string;
2007 : }
2008 :
2009 0 : static int py_svcctl_ArgumentString_set_string(PyObject *py_obj, PyObject *value, void *closure)
2010 : {
2011 0 : struct svcctl_ArgumentString *object = (struct svcctl_ArgumentString *)pytalloc_get_ptr(py_obj);
2012 0 : if (value == NULL) {
2013 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
2014 0 : return -1;
2015 : }
2016 0 : if (value == Py_None) {
2017 0 : object->string = NULL;
2018 : } else {
2019 0 : object->string = NULL;
2020 : {
2021 0 : const char *test_str;
2022 0 : const char *talloc_str;
2023 0 : PyObject *unicode = NULL;
2024 0 : if (PyUnicode_Check(value)) {
2025 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2026 0 : if (unicode == NULL) {
2027 0 : return -1;
2028 : }
2029 0 : test_str = PyBytes_AS_STRING(unicode);
2030 0 : } else if (PyBytes_Check(value)) {
2031 0 : test_str = PyBytes_AS_STRING(value);
2032 : } else {
2033 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2034 0 : return -1;
2035 : }
2036 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2037 0 : if (unicode != NULL) {
2038 0 : Py_DECREF(unicode);
2039 : }
2040 0 : if (talloc_str == NULL) {
2041 0 : PyErr_NoMemory();
2042 0 : return -1;
2043 : }
2044 0 : object->string = talloc_str;
2045 : }
2046 : }
2047 0 : return 0;
2048 : }
2049 :
2050 : static PyGetSetDef py_svcctl_ArgumentString_getsetters[] = {
2051 : {
2052 : .name = discard_const_p(char, "string"),
2053 : .get = py_svcctl_ArgumentString_get_string,
2054 : .set = py_svcctl_ArgumentString_set_string,
2055 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2056 : },
2057 : { .name = NULL }
2058 : };
2059 :
2060 0 : static PyObject *py_svcctl_ArgumentString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2061 : {
2062 0 : return pytalloc_new(struct svcctl_ArgumentString, type);
2063 : }
2064 :
2065 :
2066 : static PyTypeObject svcctl_ArgumentString_Type = {
2067 : PyVarObject_HEAD_INIT(NULL, 0)
2068 : .tp_name = "svcctl.ArgumentString",
2069 : .tp_getset = py_svcctl_ArgumentString_getsetters,
2070 : .tp_methods = NULL,
2071 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2072 : .tp_new = py_svcctl_ArgumentString_new,
2073 : };
2074 :
2075 :
2076 0 : static PyObject *py_SERVICE_DESCRIPTION_get_description(PyObject *obj, void *closure)
2077 : {
2078 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(obj);
2079 0 : PyObject *py_description;
2080 0 : if (object->description == NULL) {
2081 0 : Py_RETURN_NONE;
2082 : }
2083 0 : if (object->description == NULL) {
2084 0 : py_description = Py_None;
2085 0 : Py_INCREF(py_description);
2086 : } else {
2087 0 : py_description = PyString_FromStringOrNULL(object->description);
2088 : }
2089 0 : return py_description;
2090 : }
2091 :
2092 0 : static int py_SERVICE_DESCRIPTION_set_description(PyObject *py_obj, PyObject *value, void *closure)
2093 : {
2094 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2095 0 : if (value == NULL) {
2096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
2097 0 : return -1;
2098 : }
2099 0 : if (value == Py_None) {
2100 0 : object->description = NULL;
2101 : } else {
2102 0 : object->description = NULL;
2103 : {
2104 0 : const char *test_str;
2105 0 : const char *talloc_str;
2106 0 : PyObject *unicode = NULL;
2107 0 : if (PyUnicode_Check(value)) {
2108 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2109 0 : if (unicode == NULL) {
2110 0 : return -1;
2111 : }
2112 0 : test_str = PyBytes_AS_STRING(unicode);
2113 0 : } else if (PyBytes_Check(value)) {
2114 0 : test_str = PyBytes_AS_STRING(value);
2115 : } else {
2116 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2117 0 : return -1;
2118 : }
2119 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2120 0 : if (unicode != NULL) {
2121 0 : Py_DECREF(unicode);
2122 : }
2123 0 : if (talloc_str == NULL) {
2124 0 : PyErr_NoMemory();
2125 0 : return -1;
2126 : }
2127 0 : object->description = talloc_str;
2128 : }
2129 : }
2130 0 : return 0;
2131 : }
2132 :
2133 : static PyGetSetDef py_SERVICE_DESCRIPTION_getsetters[] = {
2134 : {
2135 : .name = discard_const_p(char, "description"),
2136 : .get = py_SERVICE_DESCRIPTION_get_description,
2137 : .set = py_SERVICE_DESCRIPTION_set_description,
2138 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2139 : },
2140 : { .name = NULL }
2141 : };
2142 :
2143 0 : static PyObject *py_SERVICE_DESCRIPTION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2144 : {
2145 0 : return pytalloc_new(struct SERVICE_DESCRIPTION, type);
2146 : }
2147 :
2148 0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2149 : {
2150 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2151 0 : PyObject *ret = NULL;
2152 0 : DATA_BLOB blob;
2153 0 : enum ndr_err_code err;
2154 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2155 0 : if (tmp_ctx == NULL) {
2156 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2157 0 : return NULL;
2158 : }
2159 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_DESCRIPTION);
2160 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2161 0 : TALLOC_FREE(tmp_ctx);
2162 0 : PyErr_SetNdrError(err);
2163 0 : return NULL;
2164 : }
2165 :
2166 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2167 0 : TALLOC_FREE(tmp_ctx);
2168 0 : return ret;
2169 : }
2170 :
2171 0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2172 : {
2173 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2174 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2175 0 : Py_ssize_t blob_length = 0;
2176 0 : enum ndr_err_code err;
2177 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2178 0 : PyObject *allow_remaining_obj = NULL;
2179 0 : bool allow_remaining = false;
2180 :
2181 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2182 : discard_const_p(char *, kwnames),
2183 : &blob.data, &blob_length,
2184 : &allow_remaining_obj)) {
2185 0 : return NULL;
2186 : }
2187 0 : blob.length = blob_length;
2188 :
2189 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2190 0 : allow_remaining = true;
2191 : }
2192 :
2193 0 : if (allow_remaining) {
2194 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_DESCRIPTION);
2195 : } else {
2196 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_DESCRIPTION);
2197 : }
2198 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2199 0 : PyErr_SetNdrError(err);
2200 0 : return NULL;
2201 : }
2202 :
2203 0 : Py_RETURN_NONE;
2204 : }
2205 :
2206 0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2207 : {
2208 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2209 0 : PyObject *ret;
2210 0 : char *retstr;
2211 :
2212 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_DESCRIPTION, "SERVICE_DESCRIPTION", object);
2213 0 : ret = PyUnicode_FromString(retstr);
2214 0 : talloc_free(retstr);
2215 :
2216 0 : return ret;
2217 : }
2218 :
2219 : static PyMethodDef py_SERVICE_DESCRIPTION_methods[] = {
2220 : { "__ndr_pack__", (PyCFunction)py_SERVICE_DESCRIPTION_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2221 : { "__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" },
2222 : { "__ndr_print__", (PyCFunction)py_SERVICE_DESCRIPTION_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2223 : { NULL, NULL, 0, NULL }
2224 : };
2225 :
2226 :
2227 : static PyTypeObject SERVICE_DESCRIPTION_Type = {
2228 : PyVarObject_HEAD_INIT(NULL, 0)
2229 : .tp_name = "svcctl.SERVICE_DESCRIPTION",
2230 : .tp_getset = py_SERVICE_DESCRIPTION_getsetters,
2231 : .tp_methods = py_SERVICE_DESCRIPTION_methods,
2232 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2233 : .tp_new = py_SERVICE_DESCRIPTION_new,
2234 : };
2235 :
2236 :
2237 0 : static PyObject *py_SC_ACTION_get_type(PyObject *obj, void *closure)
2238 : {
2239 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(obj);
2240 0 : PyObject *py_type;
2241 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
2242 0 : return py_type;
2243 : }
2244 :
2245 0 : static int py_SC_ACTION_set_type(PyObject *py_obj, PyObject *value, void *closure)
2246 : {
2247 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(py_obj);
2248 0 : if (value == NULL) {
2249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
2250 0 : return -1;
2251 : }
2252 : {
2253 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
2254 0 : if (PyLong_Check(value)) {
2255 0 : unsigned long long test_var;
2256 0 : test_var = PyLong_AsUnsignedLongLong(value);
2257 0 : if (PyErr_Occurred() != NULL) {
2258 0 : return -1;
2259 : }
2260 0 : if (test_var > uint_max) {
2261 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2262 : PyLong_Type.tp_name, uint_max, test_var);
2263 0 : return -1;
2264 : }
2265 0 : object->type = test_var;
2266 : } else {
2267 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2268 : PyLong_Type.tp_name);
2269 0 : return -1;
2270 : }
2271 : }
2272 0 : return 0;
2273 : }
2274 :
2275 0 : static PyObject *py_SC_ACTION_get_delay(PyObject *obj, void *closure)
2276 : {
2277 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(obj);
2278 0 : PyObject *py_delay;
2279 0 : py_delay = PyLong_FromUnsignedLongLong((uint32_t)object->delay);
2280 0 : return py_delay;
2281 : }
2282 :
2283 0 : static int py_SC_ACTION_set_delay(PyObject *py_obj, PyObject *value, void *closure)
2284 : {
2285 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(py_obj);
2286 0 : if (value == NULL) {
2287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delay");
2288 0 : return -1;
2289 : }
2290 : {
2291 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->delay));
2292 0 : if (PyLong_Check(value)) {
2293 0 : unsigned long long test_var;
2294 0 : test_var = PyLong_AsUnsignedLongLong(value);
2295 0 : if (PyErr_Occurred() != NULL) {
2296 0 : return -1;
2297 : }
2298 0 : if (test_var > uint_max) {
2299 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2300 : PyLong_Type.tp_name, uint_max, test_var);
2301 0 : return -1;
2302 : }
2303 0 : object->delay = test_var;
2304 : } else {
2305 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2306 : PyLong_Type.tp_name);
2307 0 : return -1;
2308 : }
2309 : }
2310 0 : return 0;
2311 : }
2312 :
2313 : static PyGetSetDef py_SC_ACTION_getsetters[] = {
2314 : {
2315 : .name = discard_const_p(char, "type"),
2316 : .get = py_SC_ACTION_get_type,
2317 : .set = py_SC_ACTION_set_type,
2318 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_ACTION_TYPE")
2319 : },
2320 : {
2321 : .name = discard_const_p(char, "delay"),
2322 : .get = py_SC_ACTION_get_delay,
2323 : .set = py_SC_ACTION_set_delay,
2324 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2325 : },
2326 : { .name = NULL }
2327 : };
2328 :
2329 0 : static PyObject *py_SC_ACTION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2330 : {
2331 0 : return pytalloc_new(struct SC_ACTION, type);
2332 : }
2333 :
2334 :
2335 : static PyTypeObject SC_ACTION_Type = {
2336 : PyVarObject_HEAD_INIT(NULL, 0)
2337 : .tp_name = "svcctl.SC_ACTION",
2338 : .tp_getset = py_SC_ACTION_getsetters,
2339 : .tp_methods = NULL,
2340 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2341 : .tp_new = py_SC_ACTION_new,
2342 : };
2343 :
2344 :
2345 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_get_reset_period(PyObject *obj, void *closure)
2346 : {
2347 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(obj);
2348 0 : PyObject *py_reset_period;
2349 0 : py_reset_period = PyLong_FromUnsignedLongLong((uint32_t)object->reset_period);
2350 0 : return py_reset_period;
2351 : }
2352 :
2353 0 : static int py_SERVICE_FAILURE_ACTIONSW_set_reset_period(PyObject *py_obj, PyObject *value, void *closure)
2354 : {
2355 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2356 0 : if (value == NULL) {
2357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reset_period");
2358 0 : return -1;
2359 : }
2360 : {
2361 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reset_period));
2362 0 : if (PyLong_Check(value)) {
2363 0 : unsigned long long test_var;
2364 0 : test_var = PyLong_AsUnsignedLongLong(value);
2365 0 : if (PyErr_Occurred() != NULL) {
2366 0 : return -1;
2367 : }
2368 0 : if (test_var > uint_max) {
2369 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2370 : PyLong_Type.tp_name, uint_max, test_var);
2371 0 : return -1;
2372 : }
2373 0 : object->reset_period = test_var;
2374 : } else {
2375 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2376 : PyLong_Type.tp_name);
2377 0 : return -1;
2378 : }
2379 : }
2380 0 : return 0;
2381 : }
2382 :
2383 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_get_rebootmsg(PyObject *obj, void *closure)
2384 : {
2385 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(obj);
2386 0 : PyObject *py_rebootmsg;
2387 0 : if (object->rebootmsg == NULL) {
2388 0 : Py_RETURN_NONE;
2389 : }
2390 0 : if (object->rebootmsg == NULL) {
2391 0 : py_rebootmsg = Py_None;
2392 0 : Py_INCREF(py_rebootmsg);
2393 : } else {
2394 0 : py_rebootmsg = PyString_FromStringOrNULL(object->rebootmsg);
2395 : }
2396 0 : return py_rebootmsg;
2397 : }
2398 :
2399 0 : static int py_SERVICE_FAILURE_ACTIONSW_set_rebootmsg(PyObject *py_obj, PyObject *value, void *closure)
2400 : {
2401 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2402 0 : if (value == NULL) {
2403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rebootmsg");
2404 0 : return -1;
2405 : }
2406 0 : if (value == Py_None) {
2407 0 : object->rebootmsg = NULL;
2408 : } else {
2409 0 : object->rebootmsg = NULL;
2410 : {
2411 0 : const char *test_str;
2412 0 : const char *talloc_str;
2413 0 : PyObject *unicode = NULL;
2414 0 : if (PyUnicode_Check(value)) {
2415 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2416 0 : if (unicode == NULL) {
2417 0 : return -1;
2418 : }
2419 0 : test_str = PyBytes_AS_STRING(unicode);
2420 0 : } else if (PyBytes_Check(value)) {
2421 0 : test_str = PyBytes_AS_STRING(value);
2422 : } else {
2423 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2424 0 : return -1;
2425 : }
2426 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2427 0 : if (unicode != NULL) {
2428 0 : Py_DECREF(unicode);
2429 : }
2430 0 : if (talloc_str == NULL) {
2431 0 : PyErr_NoMemory();
2432 0 : return -1;
2433 : }
2434 0 : object->rebootmsg = talloc_str;
2435 : }
2436 : }
2437 0 : return 0;
2438 : }
2439 :
2440 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_get_command(PyObject *obj, void *closure)
2441 : {
2442 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(obj);
2443 0 : PyObject *py_command;
2444 0 : if (object->command == NULL) {
2445 0 : Py_RETURN_NONE;
2446 : }
2447 0 : if (object->command == NULL) {
2448 0 : py_command = Py_None;
2449 0 : Py_INCREF(py_command);
2450 : } else {
2451 0 : py_command = PyString_FromStringOrNULL(object->command);
2452 : }
2453 0 : return py_command;
2454 : }
2455 :
2456 0 : static int py_SERVICE_FAILURE_ACTIONSW_set_command(PyObject *py_obj, PyObject *value, void *closure)
2457 : {
2458 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2459 0 : if (value == NULL) {
2460 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
2461 0 : return -1;
2462 : }
2463 0 : if (value == Py_None) {
2464 0 : object->command = NULL;
2465 : } else {
2466 0 : object->command = NULL;
2467 : {
2468 0 : const char *test_str;
2469 0 : const char *talloc_str;
2470 0 : PyObject *unicode = NULL;
2471 0 : if (PyUnicode_Check(value)) {
2472 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2473 0 : if (unicode == NULL) {
2474 0 : return -1;
2475 : }
2476 0 : test_str = PyBytes_AS_STRING(unicode);
2477 0 : } else if (PyBytes_Check(value)) {
2478 0 : test_str = PyBytes_AS_STRING(value);
2479 : } else {
2480 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2481 0 : return -1;
2482 : }
2483 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2484 0 : if (unicode != NULL) {
2485 0 : Py_DECREF(unicode);
2486 : }
2487 0 : if (talloc_str == NULL) {
2488 0 : PyErr_NoMemory();
2489 0 : return -1;
2490 : }
2491 0 : object->command = talloc_str;
2492 : }
2493 : }
2494 0 : return 0;
2495 : }
2496 :
2497 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_get_num_actions(PyObject *obj, void *closure)
2498 : {
2499 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(obj);
2500 0 : PyObject *py_num_actions;
2501 0 : py_num_actions = PyLong_FromUnsignedLongLong((uint32_t)object->num_actions);
2502 0 : return py_num_actions;
2503 : }
2504 :
2505 0 : static int py_SERVICE_FAILURE_ACTIONSW_set_num_actions(PyObject *py_obj, PyObject *value, void *closure)
2506 : {
2507 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2508 0 : if (value == NULL) {
2509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_actions");
2510 0 : return -1;
2511 : }
2512 : {
2513 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_actions));
2514 0 : if (PyLong_Check(value)) {
2515 0 : unsigned long long test_var;
2516 0 : test_var = PyLong_AsUnsignedLongLong(value);
2517 0 : if (PyErr_Occurred() != NULL) {
2518 0 : return -1;
2519 : }
2520 0 : if (test_var > uint_max) {
2521 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2522 : PyLong_Type.tp_name, uint_max, test_var);
2523 0 : return -1;
2524 : }
2525 0 : object->num_actions = test_var;
2526 : } else {
2527 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2528 : PyLong_Type.tp_name);
2529 0 : return -1;
2530 : }
2531 : }
2532 0 : return 0;
2533 : }
2534 :
2535 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_get_actions(PyObject *obj, void *closure)
2536 : {
2537 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(obj);
2538 0 : PyObject *py_actions;
2539 0 : if (object->actions == NULL) {
2540 0 : Py_RETURN_NONE;
2541 : }
2542 0 : if (object->actions == NULL) {
2543 0 : py_actions = Py_None;
2544 0 : Py_INCREF(py_actions);
2545 : } else {
2546 0 : py_actions = PyList_New(object->num_actions);
2547 0 : if (py_actions == NULL) {
2548 0 : return NULL;
2549 : }
2550 : {
2551 : int actions_cntr_1;
2552 0 : for (actions_cntr_1 = 0; actions_cntr_1 < (object->num_actions); actions_cntr_1++) {
2553 0 : PyObject *py_actions_1;
2554 0 : py_actions_1 = pytalloc_reference_ex(&SC_ACTION_Type, object->actions, &object->actions[actions_cntr_1]);
2555 0 : PyList_SetItem(py_actions, actions_cntr_1, py_actions_1);
2556 : }
2557 : }
2558 : }
2559 0 : return py_actions;
2560 : }
2561 :
2562 0 : static int py_SERVICE_FAILURE_ACTIONSW_set_actions(PyObject *py_obj, PyObject *value, void *closure)
2563 : {
2564 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2565 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->actions));
2566 0 : if (value == NULL) {
2567 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->actions");
2568 0 : return -1;
2569 : }
2570 0 : if (value == Py_None) {
2571 0 : object->actions = NULL;
2572 : } else {
2573 0 : object->actions = NULL;
2574 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2575 : {
2576 0 : int actions_cntr_1;
2577 0 : object->actions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->actions, PyList_GET_SIZE(value));
2578 0 : if (!object->actions) { return -1; }
2579 0 : talloc_set_name_const(object->actions, "ARRAY: object->actions");
2580 0 : for (actions_cntr_1 = 0; actions_cntr_1 < PyList_GET_SIZE(value); actions_cntr_1++) {
2581 0 : if (PyList_GET_ITEM(value, actions_cntr_1) == NULL) {
2582 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->actions[actions_cntr_1]");
2583 0 : return -1;
2584 : }
2585 0 : PY_CHECK_TYPE(&SC_ACTION_Type, PyList_GET_ITEM(value, actions_cntr_1), return -1;);
2586 0 : if (talloc_reference(object->actions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, actions_cntr_1))) == NULL) {
2587 0 : PyErr_NoMemory();
2588 0 : return -1;
2589 : }
2590 0 : object->actions[actions_cntr_1] = *(struct SC_ACTION *)pytalloc_get_ptr(PyList_GET_ITEM(value, actions_cntr_1));
2591 : }
2592 : }
2593 : }
2594 0 : return 0;
2595 : }
2596 :
2597 : static PyGetSetDef py_SERVICE_FAILURE_ACTIONSW_getsetters[] = {
2598 : {
2599 : .name = discard_const_p(char, "reset_period"),
2600 : .get = py_SERVICE_FAILURE_ACTIONSW_get_reset_period,
2601 : .set = py_SERVICE_FAILURE_ACTIONSW_set_reset_period,
2602 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2603 : },
2604 : {
2605 : .name = discard_const_p(char, "rebootmsg"),
2606 : .get = py_SERVICE_FAILURE_ACTIONSW_get_rebootmsg,
2607 : .set = py_SERVICE_FAILURE_ACTIONSW_set_rebootmsg,
2608 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2609 : },
2610 : {
2611 : .name = discard_const_p(char, "command"),
2612 : .get = py_SERVICE_FAILURE_ACTIONSW_get_command,
2613 : .set = py_SERVICE_FAILURE_ACTIONSW_set_command,
2614 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2615 : },
2616 : {
2617 : .name = discard_const_p(char, "num_actions"),
2618 : .get = py_SERVICE_FAILURE_ACTIONSW_get_num_actions,
2619 : .set = py_SERVICE_FAILURE_ACTIONSW_set_num_actions,
2620 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2621 : },
2622 : {
2623 : .name = discard_const_p(char, "actions"),
2624 : .get = py_SERVICE_FAILURE_ACTIONSW_get_actions,
2625 : .set = py_SERVICE_FAILURE_ACTIONSW_set_actions,
2626 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_ACTION")
2627 : },
2628 : { .name = NULL }
2629 : };
2630 :
2631 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2632 : {
2633 0 : return pytalloc_new(struct SERVICE_FAILURE_ACTIONSW, type);
2634 : }
2635 :
2636 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2637 : {
2638 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2639 0 : PyObject *ret = NULL;
2640 0 : DATA_BLOB blob;
2641 0 : enum ndr_err_code err;
2642 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2643 0 : if (tmp_ctx == NULL) {
2644 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2645 0 : return NULL;
2646 : }
2647 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_FAILURE_ACTIONSW);
2648 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2649 0 : TALLOC_FREE(tmp_ctx);
2650 0 : PyErr_SetNdrError(err);
2651 0 : return NULL;
2652 : }
2653 :
2654 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2655 0 : TALLOC_FREE(tmp_ctx);
2656 0 : return ret;
2657 : }
2658 :
2659 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2660 : {
2661 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2662 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2663 0 : Py_ssize_t blob_length = 0;
2664 0 : enum ndr_err_code err;
2665 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2666 0 : PyObject *allow_remaining_obj = NULL;
2667 0 : bool allow_remaining = false;
2668 :
2669 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2670 : discard_const_p(char *, kwnames),
2671 : &blob.data, &blob_length,
2672 : &allow_remaining_obj)) {
2673 0 : return NULL;
2674 : }
2675 0 : blob.length = blob_length;
2676 :
2677 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2678 0 : allow_remaining = true;
2679 : }
2680 :
2681 0 : if (allow_remaining) {
2682 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_FAILURE_ACTIONSW);
2683 : } else {
2684 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_FAILURE_ACTIONSW);
2685 : }
2686 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2687 0 : PyErr_SetNdrError(err);
2688 0 : return NULL;
2689 : }
2690 :
2691 0 : Py_RETURN_NONE;
2692 : }
2693 :
2694 0 : static PyObject *py_SERVICE_FAILURE_ACTIONSW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2695 : {
2696 0 : struct SERVICE_FAILURE_ACTIONSW *object = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(py_obj);
2697 0 : PyObject *ret;
2698 0 : char *retstr;
2699 :
2700 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_FAILURE_ACTIONSW, "SERVICE_FAILURE_ACTIONSW", object);
2701 0 : ret = PyUnicode_FromString(retstr);
2702 0 : talloc_free(retstr);
2703 :
2704 0 : return ret;
2705 : }
2706 :
2707 : static PyMethodDef py_SERVICE_FAILURE_ACTIONSW_methods[] = {
2708 : { "__ndr_pack__", (PyCFunction)py_SERVICE_FAILURE_ACTIONSW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2709 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SERVICE_FAILURE_ACTIONSW_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2710 : { "__ndr_print__", (PyCFunction)py_SERVICE_FAILURE_ACTIONSW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2711 : { NULL, NULL, 0, NULL }
2712 : };
2713 :
2714 :
2715 : static PyTypeObject SERVICE_FAILURE_ACTIONSW_Type = {
2716 : PyVarObject_HEAD_INIT(NULL, 0)
2717 : .tp_name = "svcctl.SERVICE_FAILURE_ACTIONSW",
2718 : .tp_getset = py_SERVICE_FAILURE_ACTIONSW_getsetters,
2719 : .tp_methods = py_SERVICE_FAILURE_ACTIONSW_methods,
2720 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2721 : .tp_new = py_SERVICE_FAILURE_ACTIONSW_new,
2722 : };
2723 :
2724 :
2725 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_ullThreadId(PyObject *obj, void *closure)
2726 : {
2727 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(obj);
2728 0 : PyObject *py_ullThreadId;
2729 0 : py_ullThreadId = PyLong_FromUnsignedLongLong(object->ullThreadId);
2730 0 : return py_ullThreadId;
2731 : }
2732 :
2733 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_ullThreadId(PyObject *py_obj, PyObject *value, void *closure)
2734 : {
2735 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(py_obj);
2736 0 : if (value == NULL) {
2737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ullThreadId");
2738 0 : return -1;
2739 : }
2740 : {
2741 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ullThreadId));
2742 0 : if (PyLong_Check(value)) {
2743 0 : unsigned long long test_var;
2744 0 : test_var = PyLong_AsUnsignedLongLong(value);
2745 0 : if (PyErr_Occurred() != NULL) {
2746 0 : return -1;
2747 : }
2748 0 : if (test_var > uint_max) {
2749 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2750 : PyLong_Type.tp_name, uint_max, test_var);
2751 0 : return -1;
2752 : }
2753 0 : object->ullThreadId = test_var;
2754 : } else {
2755 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2756 : PyLong_Type.tp_name);
2757 0 : return -1;
2758 : }
2759 : }
2760 0 : return 0;
2761 : }
2762 :
2763 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_dwNotifyMask(PyObject *obj, void *closure)
2764 : {
2765 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(obj);
2766 0 : PyObject *py_dwNotifyMask;
2767 0 : py_dwNotifyMask = PyLong_FromUnsignedLongLong((uint32_t)object->dwNotifyMask);
2768 0 : return py_dwNotifyMask;
2769 : }
2770 :
2771 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_dwNotifyMask(PyObject *py_obj, PyObject *value, void *closure)
2772 : {
2773 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(py_obj);
2774 0 : if (value == NULL) {
2775 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwNotifyMask");
2776 0 : return -1;
2777 : }
2778 : {
2779 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNotifyMask));
2780 0 : if (PyLong_Check(value)) {
2781 0 : unsigned long long test_var;
2782 0 : test_var = PyLong_AsUnsignedLongLong(value);
2783 0 : if (PyErr_Occurred() != NULL) {
2784 0 : return -1;
2785 : }
2786 0 : if (test_var > uint_max) {
2787 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2788 : PyLong_Type.tp_name, uint_max, test_var);
2789 0 : return -1;
2790 : }
2791 0 : object->dwNotifyMask = test_var;
2792 : } else {
2793 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2794 : PyLong_Type.tp_name);
2795 0 : return -1;
2796 : }
2797 : }
2798 0 : return 0;
2799 : }
2800 :
2801 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_CallbackAddressArray(PyObject *obj, void *closure)
2802 : {
2803 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(obj);
2804 0 : PyObject *py_CallbackAddressArray;
2805 0 : py_CallbackAddressArray = PyList_New(16);
2806 0 : if (py_CallbackAddressArray == NULL) {
2807 0 : return NULL;
2808 : }
2809 : {
2810 : int CallbackAddressArray_cntr_0;
2811 0 : for (CallbackAddressArray_cntr_0 = 0; CallbackAddressArray_cntr_0 < (16); CallbackAddressArray_cntr_0++) {
2812 0 : PyObject *py_CallbackAddressArray_0;
2813 0 : py_CallbackAddressArray_0 = PyLong_FromLong((uint16_t)object->CallbackAddressArray[CallbackAddressArray_cntr_0]);
2814 0 : PyList_SetItem(py_CallbackAddressArray, CallbackAddressArray_cntr_0, py_CallbackAddressArray_0);
2815 : }
2816 : }
2817 0 : return py_CallbackAddressArray;
2818 : }
2819 :
2820 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_CallbackAddressArray(PyObject *py_obj, PyObject *value, void *closure)
2821 : {
2822 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(py_obj);
2823 0 : if (value == NULL) {
2824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackAddressArray");
2825 0 : return -1;
2826 : }
2827 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2828 : {
2829 0 : int CallbackAddressArray_cntr_0;
2830 0 : if (ARRAY_SIZE(object->CallbackAddressArray) != PyList_GET_SIZE(value)) {
2831 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->CallbackAddressArray), PyList_GET_SIZE(value));
2832 0 : return -1;
2833 : }
2834 0 : for (CallbackAddressArray_cntr_0 = 0; CallbackAddressArray_cntr_0 < PyList_GET_SIZE(value); CallbackAddressArray_cntr_0++) {
2835 0 : if (PyList_GET_ITEM(value, CallbackAddressArray_cntr_0) == NULL) {
2836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackAddressArray[CallbackAddressArray_cntr_0]");
2837 0 : return -1;
2838 : }
2839 : {
2840 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->CallbackAddressArray[CallbackAddressArray_cntr_0]));
2841 0 : if (PyLong_Check(PyList_GET_ITEM(value, CallbackAddressArray_cntr_0))) {
2842 0 : unsigned long long test_var;
2843 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, CallbackAddressArray_cntr_0));
2844 0 : if (PyErr_Occurred() != NULL) {
2845 0 : return -1;
2846 : }
2847 0 : if (test_var > uint_max) {
2848 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2849 : PyLong_Type.tp_name, uint_max, test_var);
2850 0 : return -1;
2851 : }
2852 0 : object->CallbackAddressArray[CallbackAddressArray_cntr_0] = test_var;
2853 : } else {
2854 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2855 : PyLong_Type.tp_name);
2856 0 : return -1;
2857 : }
2858 : }
2859 : }
2860 : }
2861 0 : return 0;
2862 : }
2863 :
2864 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_CallbackParamAddressArray(PyObject *obj, void *closure)
2865 : {
2866 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(obj);
2867 0 : PyObject *py_CallbackParamAddressArray;
2868 0 : py_CallbackParamAddressArray = PyList_New(16);
2869 0 : if (py_CallbackParamAddressArray == NULL) {
2870 0 : return NULL;
2871 : }
2872 : {
2873 : int CallbackParamAddressArray_cntr_0;
2874 0 : for (CallbackParamAddressArray_cntr_0 = 0; CallbackParamAddressArray_cntr_0 < (16); CallbackParamAddressArray_cntr_0++) {
2875 0 : PyObject *py_CallbackParamAddressArray_0;
2876 0 : py_CallbackParamAddressArray_0 = PyLong_FromLong((uint16_t)object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0]);
2877 0 : PyList_SetItem(py_CallbackParamAddressArray, CallbackParamAddressArray_cntr_0, py_CallbackParamAddressArray_0);
2878 : }
2879 : }
2880 0 : return py_CallbackParamAddressArray;
2881 : }
2882 :
2883 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_CallbackParamAddressArray(PyObject *py_obj, PyObject *value, void *closure)
2884 : {
2885 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(py_obj);
2886 0 : if (value == NULL) {
2887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackParamAddressArray");
2888 0 : return -1;
2889 : }
2890 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2891 : {
2892 0 : int CallbackParamAddressArray_cntr_0;
2893 0 : if (ARRAY_SIZE(object->CallbackParamAddressArray) != PyList_GET_SIZE(value)) {
2894 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->CallbackParamAddressArray), PyList_GET_SIZE(value));
2895 0 : return -1;
2896 : }
2897 0 : for (CallbackParamAddressArray_cntr_0 = 0; CallbackParamAddressArray_cntr_0 < PyList_GET_SIZE(value); CallbackParamAddressArray_cntr_0++) {
2898 0 : if (PyList_GET_ITEM(value, CallbackParamAddressArray_cntr_0) == NULL) {
2899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0]");
2900 0 : return -1;
2901 : }
2902 : {
2903 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0]));
2904 0 : if (PyLong_Check(PyList_GET_ITEM(value, CallbackParamAddressArray_cntr_0))) {
2905 0 : unsigned long long test_var;
2906 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, CallbackParamAddressArray_cntr_0));
2907 0 : if (PyErr_Occurred() != NULL) {
2908 0 : return -1;
2909 : }
2910 0 : if (test_var > uint_max) {
2911 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2912 : PyLong_Type.tp_name, uint_max, test_var);
2913 0 : return -1;
2914 : }
2915 0 : object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0] = test_var;
2916 : } else {
2917 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2918 : PyLong_Type.tp_name);
2919 0 : return -1;
2920 : }
2921 : }
2922 : }
2923 : }
2924 0 : return 0;
2925 : }
2926 :
2927 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_ServiceStatus(PyObject *obj, void *closure)
2928 : {
2929 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(obj);
2930 0 : PyObject *py_ServiceStatus;
2931 0 : py_ServiceStatus = pytalloc_reference_ex(&SERVICE_STATUS_PROCESS_Type, pytalloc_get_mem_ctx(obj), &object->ServiceStatus);
2932 0 : return py_ServiceStatus;
2933 : }
2934 :
2935 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_ServiceStatus(PyObject *py_obj, PyObject *value, void *closure)
2936 : {
2937 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(py_obj);
2938 0 : if (value == NULL) {
2939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServiceStatus");
2940 0 : return -1;
2941 : }
2942 0 : PY_CHECK_TYPE(&SERVICE_STATUS_PROCESS_Type, value, return -1;);
2943 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2944 0 : PyErr_NoMemory();
2945 0 : return -1;
2946 : }
2947 0 : object->ServiceStatus = *(struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(value);
2948 0 : return 0;
2949 : }
2950 :
2951 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_dwNotificationStatus(PyObject *obj, void *closure)
2952 : {
2953 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(obj);
2954 0 : PyObject *py_dwNotificationStatus;
2955 0 : py_dwNotificationStatus = PyLong_FromUnsignedLongLong((uint32_t)object->dwNotificationStatus);
2956 0 : return py_dwNotificationStatus;
2957 : }
2958 :
2959 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_dwNotificationStatus(PyObject *py_obj, PyObject *value, void *closure)
2960 : {
2961 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(py_obj);
2962 0 : if (value == NULL) {
2963 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwNotificationStatus");
2964 0 : return -1;
2965 : }
2966 : {
2967 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNotificationStatus));
2968 0 : if (PyLong_Check(value)) {
2969 0 : unsigned long long test_var;
2970 0 : test_var = PyLong_AsUnsignedLongLong(value);
2971 0 : if (PyErr_Occurred() != NULL) {
2972 0 : return -1;
2973 : }
2974 0 : if (test_var > uint_max) {
2975 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2976 : PyLong_Type.tp_name, uint_max, test_var);
2977 0 : return -1;
2978 : }
2979 0 : object->dwNotificationStatus = test_var;
2980 : } else {
2981 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2982 : PyLong_Type.tp_name);
2983 0 : return -1;
2984 : }
2985 : }
2986 0 : return 0;
2987 : }
2988 :
2989 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_dwSequence(PyObject *obj, void *closure)
2990 : {
2991 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(obj);
2992 0 : PyObject *py_dwSequence;
2993 0 : py_dwSequence = PyLong_FromUnsignedLongLong((uint32_t)object->dwSequence);
2994 0 : return py_dwSequence;
2995 : }
2996 :
2997 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_dwSequence(PyObject *py_obj, PyObject *value, void *closure)
2998 : {
2999 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(py_obj);
3000 0 : if (value == NULL) {
3001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwSequence");
3002 0 : return -1;
3003 : }
3004 : {
3005 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSequence));
3006 0 : if (PyLong_Check(value)) {
3007 0 : unsigned long long test_var;
3008 0 : test_var = PyLong_AsUnsignedLongLong(value);
3009 0 : if (PyErr_Occurred() != NULL) {
3010 0 : return -1;
3011 : }
3012 0 : if (test_var > uint_max) {
3013 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3014 : PyLong_Type.tp_name, uint_max, test_var);
3015 0 : return -1;
3016 : }
3017 0 : object->dwSequence = test_var;
3018 : } else {
3019 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3020 : PyLong_Type.tp_name);
3021 0 : return -1;
3022 : }
3023 : }
3024 0 : return 0;
3025 : }
3026 :
3027 : static PyGetSetDef py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_getsetters[] = {
3028 : {
3029 : .name = discard_const_p(char, "ullThreadId"),
3030 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_ullThreadId,
3031 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_ullThreadId,
3032 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3033 : },
3034 : {
3035 : .name = discard_const_p(char, "dwNotifyMask"),
3036 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_dwNotifyMask,
3037 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_dwNotifyMask,
3038 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3039 : },
3040 : {
3041 : .name = discard_const_p(char, "CallbackAddressArray"),
3042 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_CallbackAddressArray,
3043 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_CallbackAddressArray,
3044 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3045 : },
3046 : {
3047 : .name = discard_const_p(char, "CallbackParamAddressArray"),
3048 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_CallbackParamAddressArray,
3049 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_CallbackParamAddressArray,
3050 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3051 : },
3052 : {
3053 : .name = discard_const_p(char, "ServiceStatus"),
3054 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_ServiceStatus,
3055 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_ServiceStatus,
3056 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS_PROCESS")
3057 : },
3058 : {
3059 : .name = discard_const_p(char, "dwNotificationStatus"),
3060 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_dwNotificationStatus,
3061 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_dwNotificationStatus,
3062 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3063 : },
3064 : {
3065 : .name = discard_const_p(char, "dwSequence"),
3066 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_get_dwSequence,
3067 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_set_dwSequence,
3068 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3069 : },
3070 : { .name = NULL }
3071 : };
3072 :
3073 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3074 : {
3075 0 : return pytalloc_new(struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1, type);
3076 : }
3077 :
3078 :
3079 : static PyTypeObject SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type = {
3080 : PyVarObject_HEAD_INIT(NULL, 0)
3081 : .tp_name = "svcctl.SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1",
3082 : .tp_getset = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_getsetters,
3083 : .tp_methods = NULL,
3084 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3085 : .tp_new = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_new,
3086 : };
3087 :
3088 :
3089 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_ullThreadId(PyObject *obj, void *closure)
3090 : {
3091 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3092 0 : PyObject *py_ullThreadId;
3093 0 : py_ullThreadId = PyLong_FromUnsignedLongLong(object->ullThreadId);
3094 0 : return py_ullThreadId;
3095 : }
3096 :
3097 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_ullThreadId(PyObject *py_obj, PyObject *value, void *closure)
3098 : {
3099 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3100 0 : if (value == NULL) {
3101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ullThreadId");
3102 0 : return -1;
3103 : }
3104 : {
3105 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ullThreadId));
3106 0 : if (PyLong_Check(value)) {
3107 0 : unsigned long long test_var;
3108 0 : test_var = PyLong_AsUnsignedLongLong(value);
3109 0 : if (PyErr_Occurred() != NULL) {
3110 0 : return -1;
3111 : }
3112 0 : if (test_var > uint_max) {
3113 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3114 : PyLong_Type.tp_name, uint_max, test_var);
3115 0 : return -1;
3116 : }
3117 0 : object->ullThreadId = test_var;
3118 : } else {
3119 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3120 : PyLong_Type.tp_name);
3121 0 : return -1;
3122 : }
3123 : }
3124 0 : return 0;
3125 : }
3126 :
3127 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwNotifyMask(PyObject *obj, void *closure)
3128 : {
3129 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3130 0 : PyObject *py_dwNotifyMask;
3131 0 : py_dwNotifyMask = PyLong_FromUnsignedLongLong((uint32_t)object->dwNotifyMask);
3132 0 : return py_dwNotifyMask;
3133 : }
3134 :
3135 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwNotifyMask(PyObject *py_obj, PyObject *value, void *closure)
3136 : {
3137 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3138 0 : if (value == NULL) {
3139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwNotifyMask");
3140 0 : return -1;
3141 : }
3142 : {
3143 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNotifyMask));
3144 0 : if (PyLong_Check(value)) {
3145 0 : unsigned long long test_var;
3146 0 : test_var = PyLong_AsUnsignedLongLong(value);
3147 0 : if (PyErr_Occurred() != NULL) {
3148 0 : return -1;
3149 : }
3150 0 : if (test_var > uint_max) {
3151 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3152 : PyLong_Type.tp_name, uint_max, test_var);
3153 0 : return -1;
3154 : }
3155 0 : object->dwNotifyMask = test_var;
3156 : } else {
3157 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3158 : PyLong_Type.tp_name);
3159 0 : return -1;
3160 : }
3161 : }
3162 0 : return 0;
3163 : }
3164 :
3165 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_CallbackAddressArray(PyObject *obj, void *closure)
3166 : {
3167 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3168 0 : PyObject *py_CallbackAddressArray;
3169 0 : py_CallbackAddressArray = PyList_New(16);
3170 0 : if (py_CallbackAddressArray == NULL) {
3171 0 : return NULL;
3172 : }
3173 : {
3174 : int CallbackAddressArray_cntr_0;
3175 0 : for (CallbackAddressArray_cntr_0 = 0; CallbackAddressArray_cntr_0 < (16); CallbackAddressArray_cntr_0++) {
3176 0 : PyObject *py_CallbackAddressArray_0;
3177 0 : py_CallbackAddressArray_0 = PyLong_FromLong((uint16_t)object->CallbackAddressArray[CallbackAddressArray_cntr_0]);
3178 0 : PyList_SetItem(py_CallbackAddressArray, CallbackAddressArray_cntr_0, py_CallbackAddressArray_0);
3179 : }
3180 : }
3181 0 : return py_CallbackAddressArray;
3182 : }
3183 :
3184 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_CallbackAddressArray(PyObject *py_obj, PyObject *value, void *closure)
3185 : {
3186 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3187 0 : if (value == NULL) {
3188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackAddressArray");
3189 0 : return -1;
3190 : }
3191 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3192 : {
3193 0 : int CallbackAddressArray_cntr_0;
3194 0 : if (ARRAY_SIZE(object->CallbackAddressArray) != PyList_GET_SIZE(value)) {
3195 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->CallbackAddressArray), PyList_GET_SIZE(value));
3196 0 : return -1;
3197 : }
3198 0 : for (CallbackAddressArray_cntr_0 = 0; CallbackAddressArray_cntr_0 < PyList_GET_SIZE(value); CallbackAddressArray_cntr_0++) {
3199 0 : if (PyList_GET_ITEM(value, CallbackAddressArray_cntr_0) == NULL) {
3200 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackAddressArray[CallbackAddressArray_cntr_0]");
3201 0 : return -1;
3202 : }
3203 : {
3204 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->CallbackAddressArray[CallbackAddressArray_cntr_0]));
3205 0 : if (PyLong_Check(PyList_GET_ITEM(value, CallbackAddressArray_cntr_0))) {
3206 0 : unsigned long long test_var;
3207 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, CallbackAddressArray_cntr_0));
3208 0 : if (PyErr_Occurred() != NULL) {
3209 0 : return -1;
3210 : }
3211 0 : if (test_var > uint_max) {
3212 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3213 : PyLong_Type.tp_name, uint_max, test_var);
3214 0 : return -1;
3215 : }
3216 0 : object->CallbackAddressArray[CallbackAddressArray_cntr_0] = test_var;
3217 : } else {
3218 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3219 : PyLong_Type.tp_name);
3220 0 : return -1;
3221 : }
3222 : }
3223 : }
3224 : }
3225 0 : return 0;
3226 : }
3227 :
3228 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_CallbackParamAddressArray(PyObject *obj, void *closure)
3229 : {
3230 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3231 0 : PyObject *py_CallbackParamAddressArray;
3232 0 : py_CallbackParamAddressArray = PyList_New(16);
3233 0 : if (py_CallbackParamAddressArray == NULL) {
3234 0 : return NULL;
3235 : }
3236 : {
3237 : int CallbackParamAddressArray_cntr_0;
3238 0 : for (CallbackParamAddressArray_cntr_0 = 0; CallbackParamAddressArray_cntr_0 < (16); CallbackParamAddressArray_cntr_0++) {
3239 0 : PyObject *py_CallbackParamAddressArray_0;
3240 0 : py_CallbackParamAddressArray_0 = PyLong_FromLong((uint16_t)object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0]);
3241 0 : PyList_SetItem(py_CallbackParamAddressArray, CallbackParamAddressArray_cntr_0, py_CallbackParamAddressArray_0);
3242 : }
3243 : }
3244 0 : return py_CallbackParamAddressArray;
3245 : }
3246 :
3247 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_CallbackParamAddressArray(PyObject *py_obj, PyObject *value, void *closure)
3248 : {
3249 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3250 0 : if (value == NULL) {
3251 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackParamAddressArray");
3252 0 : return -1;
3253 : }
3254 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3255 : {
3256 0 : int CallbackParamAddressArray_cntr_0;
3257 0 : if (ARRAY_SIZE(object->CallbackParamAddressArray) != PyList_GET_SIZE(value)) {
3258 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->CallbackParamAddressArray), PyList_GET_SIZE(value));
3259 0 : return -1;
3260 : }
3261 0 : for (CallbackParamAddressArray_cntr_0 = 0; CallbackParamAddressArray_cntr_0 < PyList_GET_SIZE(value); CallbackParamAddressArray_cntr_0++) {
3262 0 : if (PyList_GET_ITEM(value, CallbackParamAddressArray_cntr_0) == NULL) {
3263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0]");
3264 0 : return -1;
3265 : }
3266 : {
3267 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0]));
3268 0 : if (PyLong_Check(PyList_GET_ITEM(value, CallbackParamAddressArray_cntr_0))) {
3269 0 : unsigned long long test_var;
3270 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, CallbackParamAddressArray_cntr_0));
3271 0 : if (PyErr_Occurred() != NULL) {
3272 0 : return -1;
3273 : }
3274 0 : if (test_var > uint_max) {
3275 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3276 : PyLong_Type.tp_name, uint_max, test_var);
3277 0 : return -1;
3278 : }
3279 0 : object->CallbackParamAddressArray[CallbackParamAddressArray_cntr_0] = test_var;
3280 : } else {
3281 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3282 : PyLong_Type.tp_name);
3283 0 : return -1;
3284 : }
3285 : }
3286 : }
3287 : }
3288 0 : return 0;
3289 : }
3290 :
3291 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_ServiceStatus(PyObject *obj, void *closure)
3292 : {
3293 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3294 0 : PyObject *py_ServiceStatus;
3295 0 : py_ServiceStatus = pytalloc_reference_ex(&SERVICE_STATUS_PROCESS_Type, pytalloc_get_mem_ctx(obj), &object->ServiceStatus);
3296 0 : return py_ServiceStatus;
3297 : }
3298 :
3299 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_ServiceStatus(PyObject *py_obj, PyObject *value, void *closure)
3300 : {
3301 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3302 0 : if (value == NULL) {
3303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServiceStatus");
3304 0 : return -1;
3305 : }
3306 0 : PY_CHECK_TYPE(&SERVICE_STATUS_PROCESS_Type, value, return -1;);
3307 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3308 0 : PyErr_NoMemory();
3309 0 : return -1;
3310 : }
3311 0 : object->ServiceStatus = *(struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(value);
3312 0 : return 0;
3313 : }
3314 :
3315 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwNotificationStatus(PyObject *obj, void *closure)
3316 : {
3317 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3318 0 : PyObject *py_dwNotificationStatus;
3319 0 : py_dwNotificationStatus = PyLong_FromUnsignedLongLong((uint32_t)object->dwNotificationStatus);
3320 0 : return py_dwNotificationStatus;
3321 : }
3322 :
3323 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwNotificationStatus(PyObject *py_obj, PyObject *value, void *closure)
3324 : {
3325 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3326 0 : if (value == NULL) {
3327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwNotificationStatus");
3328 0 : return -1;
3329 : }
3330 : {
3331 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNotificationStatus));
3332 0 : if (PyLong_Check(value)) {
3333 0 : unsigned long long test_var;
3334 0 : test_var = PyLong_AsUnsignedLongLong(value);
3335 0 : if (PyErr_Occurred() != NULL) {
3336 0 : return -1;
3337 : }
3338 0 : if (test_var > uint_max) {
3339 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3340 : PyLong_Type.tp_name, uint_max, test_var);
3341 0 : return -1;
3342 : }
3343 0 : object->dwNotificationStatus = test_var;
3344 : } else {
3345 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3346 : PyLong_Type.tp_name);
3347 0 : return -1;
3348 : }
3349 : }
3350 0 : return 0;
3351 : }
3352 :
3353 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwSequence(PyObject *obj, void *closure)
3354 : {
3355 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3356 0 : PyObject *py_dwSequence;
3357 0 : py_dwSequence = PyLong_FromUnsignedLongLong((uint32_t)object->dwSequence);
3358 0 : return py_dwSequence;
3359 : }
3360 :
3361 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwSequence(PyObject *py_obj, PyObject *value, void *closure)
3362 : {
3363 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3364 0 : if (value == NULL) {
3365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwSequence");
3366 0 : return -1;
3367 : }
3368 : {
3369 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSequence));
3370 0 : if (PyLong_Check(value)) {
3371 0 : unsigned long long test_var;
3372 0 : test_var = PyLong_AsUnsignedLongLong(value);
3373 0 : if (PyErr_Occurred() != NULL) {
3374 0 : return -1;
3375 : }
3376 0 : if (test_var > uint_max) {
3377 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3378 : PyLong_Type.tp_name, uint_max, test_var);
3379 0 : return -1;
3380 : }
3381 0 : object->dwSequence = test_var;
3382 : } else {
3383 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3384 : PyLong_Type.tp_name);
3385 0 : return -1;
3386 : }
3387 : }
3388 0 : return 0;
3389 : }
3390 :
3391 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwNotificationTriggered(PyObject *obj, void *closure)
3392 : {
3393 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3394 0 : PyObject *py_dwNotificationTriggered;
3395 0 : py_dwNotificationTriggered = PyLong_FromUnsignedLongLong((uint32_t)object->dwNotificationTriggered);
3396 0 : return py_dwNotificationTriggered;
3397 : }
3398 :
3399 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwNotificationTriggered(PyObject *py_obj, PyObject *value, void *closure)
3400 : {
3401 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3402 0 : if (value == NULL) {
3403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwNotificationTriggered");
3404 0 : return -1;
3405 : }
3406 : {
3407 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNotificationTriggered));
3408 0 : if (PyLong_Check(value)) {
3409 0 : unsigned long long test_var;
3410 0 : test_var = PyLong_AsUnsignedLongLong(value);
3411 0 : if (PyErr_Occurred() != NULL) {
3412 0 : return -1;
3413 : }
3414 0 : if (test_var > uint_max) {
3415 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3416 : PyLong_Type.tp_name, uint_max, test_var);
3417 0 : return -1;
3418 : }
3419 0 : object->dwNotificationTriggered = test_var;
3420 : } else {
3421 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3422 : PyLong_Type.tp_name);
3423 0 : return -1;
3424 : }
3425 : }
3426 0 : return 0;
3427 : }
3428 :
3429 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_pszServiceNames(PyObject *obj, void *closure)
3430 : {
3431 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(obj);
3432 0 : PyObject *py_pszServiceNames;
3433 0 : if (object->pszServiceNames == NULL) {
3434 0 : Py_RETURN_NONE;
3435 : }
3436 0 : if (object->pszServiceNames == NULL) {
3437 0 : py_pszServiceNames = Py_None;
3438 0 : Py_INCREF(py_pszServiceNames);
3439 : } else {
3440 0 : if (object->pszServiceNames == NULL) {
3441 0 : py_pszServiceNames = Py_None;
3442 0 : Py_INCREF(py_pszServiceNames);
3443 : } else {
3444 0 : py_pszServiceNames = PyUnicode_Decode(object->pszServiceNames, strlen(object->pszServiceNames), "utf-8", "ignore");
3445 : }
3446 : }
3447 0 : return py_pszServiceNames;
3448 : }
3449 :
3450 0 : static int py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_pszServiceNames(PyObject *py_obj, PyObject *value, void *closure)
3451 : {
3452 0 : struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *object = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(py_obj);
3453 0 : if (value == NULL) {
3454 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pszServiceNames");
3455 0 : return -1;
3456 : }
3457 0 : if (value == Py_None) {
3458 0 : object->pszServiceNames = NULL;
3459 : } else {
3460 0 : object->pszServiceNames = NULL;
3461 : {
3462 0 : const char *test_str;
3463 0 : const char *talloc_str;
3464 0 : PyObject *unicode = NULL;
3465 0 : if (PyUnicode_Check(value)) {
3466 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3467 0 : if (unicode == NULL) {
3468 0 : return -1;
3469 : }
3470 0 : test_str = PyBytes_AS_STRING(unicode);
3471 0 : } else if (PyBytes_Check(value)) {
3472 0 : test_str = PyBytes_AS_STRING(value);
3473 : } else {
3474 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3475 0 : return -1;
3476 : }
3477 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3478 0 : if (unicode != NULL) {
3479 0 : Py_DECREF(unicode);
3480 : }
3481 0 : if (talloc_str == NULL) {
3482 0 : PyErr_NoMemory();
3483 0 : return -1;
3484 : }
3485 0 : object->pszServiceNames = talloc_str;
3486 : }
3487 : }
3488 0 : return 0;
3489 : }
3490 :
3491 : static PyGetSetDef py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_getsetters[] = {
3492 : {
3493 : .name = discard_const_p(char, "ullThreadId"),
3494 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_ullThreadId,
3495 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_ullThreadId,
3496 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3497 : },
3498 : {
3499 : .name = discard_const_p(char, "dwNotifyMask"),
3500 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwNotifyMask,
3501 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwNotifyMask,
3502 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3503 : },
3504 : {
3505 : .name = discard_const_p(char, "CallbackAddressArray"),
3506 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_CallbackAddressArray,
3507 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_CallbackAddressArray,
3508 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3509 : },
3510 : {
3511 : .name = discard_const_p(char, "CallbackParamAddressArray"),
3512 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_CallbackParamAddressArray,
3513 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_CallbackParamAddressArray,
3514 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3515 : },
3516 : {
3517 : .name = discard_const_p(char, "ServiceStatus"),
3518 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_ServiceStatus,
3519 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_ServiceStatus,
3520 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS_PROCESS")
3521 : },
3522 : {
3523 : .name = discard_const_p(char, "dwNotificationStatus"),
3524 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwNotificationStatus,
3525 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwNotificationStatus,
3526 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3527 : },
3528 : {
3529 : .name = discard_const_p(char, "dwSequence"),
3530 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwSequence,
3531 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwSequence,
3532 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3533 : },
3534 : {
3535 : .name = discard_const_p(char, "dwNotificationTriggered"),
3536 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_dwNotificationTriggered,
3537 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_dwNotificationTriggered,
3538 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3539 : },
3540 : {
3541 : .name = discard_const_p(char, "pszServiceNames"),
3542 : .get = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_get_pszServiceNames,
3543 : .set = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_set_pszServiceNames,
3544 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3545 : },
3546 : { .name = NULL }
3547 : };
3548 :
3549 0 : static PyObject *py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3550 : {
3551 0 : return pytalloc_new(struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2, type);
3552 : }
3553 :
3554 :
3555 : static PyTypeObject SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type = {
3556 : PyVarObject_HEAD_INIT(NULL, 0)
3557 : .tp_name = "svcctl.SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2",
3558 : .tp_getset = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_getsetters,
3559 : .tp_methods = NULL,
3560 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3561 : .tp_new = py_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_new,
3562 : };
3563 :
3564 0 : static PyObject *py_import_SC_RPC_NOTIFY_PARAMS_u(TALLOC_CTX *mem_ctx, int level, union SC_RPC_NOTIFY_PARAMS_u *in)
3565 : {
3566 0 : PyObject *ret;
3567 :
3568 0 : switch (level) {
3569 0 : case 1:
3570 0 : if (in->pStatusChangeParam1 == NULL) {
3571 0 : ret = Py_None;
3572 0 : Py_INCREF(ret);
3573 : } else {
3574 0 : ret = pytalloc_reference_ex(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type, in->pStatusChangeParam1, in->pStatusChangeParam1);
3575 : }
3576 0 : return ret;
3577 :
3578 0 : case 2:
3579 0 : if (in->pStatusChangeParams == NULL) {
3580 0 : ret = Py_None;
3581 0 : Py_INCREF(ret);
3582 : } else {
3583 0 : ret = pytalloc_reference_ex(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type, in->pStatusChangeParams, in->pStatusChangeParams);
3584 : }
3585 0 : return ret;
3586 :
3587 : }
3588 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
3589 0 : return NULL;
3590 : }
3591 :
3592 0 : static union SC_RPC_NOTIFY_PARAMS_u *py_export_SC_RPC_NOTIFY_PARAMS_u(TALLOC_CTX *mem_ctx, int level, PyObject *in)
3593 : {
3594 0 : union SC_RPC_NOTIFY_PARAMS_u *ret = talloc_zero(mem_ctx, union SC_RPC_NOTIFY_PARAMS_u);
3595 0 : switch (level) {
3596 0 : case 1:
3597 0 : if (in == NULL) {
3598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pStatusChangeParam1");
3599 0 : talloc_free(ret); return NULL;
3600 : }
3601 0 : if (in == Py_None) {
3602 0 : ret->pStatusChangeParam1 = NULL;
3603 : } else {
3604 0 : ret->pStatusChangeParam1 = NULL;
3605 0 : PY_CHECK_TYPE(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type, in, talloc_free(ret); return NULL;);
3606 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3607 0 : PyErr_NoMemory();
3608 0 : talloc_free(ret); return NULL;
3609 : }
3610 0 : ret->pStatusChangeParam1 = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 *)pytalloc_get_ptr(in);
3611 : }
3612 0 : break;
3613 :
3614 0 : case 2:
3615 0 : if (in == NULL) {
3616 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pStatusChangeParams");
3617 0 : talloc_free(ret); return NULL;
3618 : }
3619 0 : if (in == Py_None) {
3620 0 : ret->pStatusChangeParams = NULL;
3621 : } else {
3622 0 : ret->pStatusChangeParams = NULL;
3623 0 : PY_CHECK_TYPE(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type, in, talloc_free(ret); return NULL;);
3624 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3625 0 : PyErr_NoMemory();
3626 0 : talloc_free(ret); return NULL;
3627 : }
3628 0 : ret->pStatusChangeParams = (struct SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 *)pytalloc_get_ptr(in);
3629 : }
3630 0 : break;
3631 :
3632 0 : default:
3633 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
3634 0 : talloc_free(ret);
3635 0 : ret = NULL;
3636 : }
3637 :
3638 0 : return ret;
3639 : }
3640 :
3641 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_u_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3642 : {
3643 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3644 0 : PyObject *mem_ctx_obj = NULL;
3645 0 : TALLOC_CTX *mem_ctx = NULL;
3646 0 : int level = 0;
3647 0 : PyObject *in_obj = NULL;
3648 0 : union SC_RPC_NOTIFY_PARAMS_u *in = NULL;
3649 :
3650 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
3651 : discard_const_p(char *, kwnames),
3652 : &mem_ctx_obj,
3653 : &level,
3654 : &in_obj)) {
3655 0 : return NULL;
3656 : }
3657 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3658 0 : if (mem_ctx == NULL) {
3659 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3660 0 : return NULL;
3661 : }
3662 0 : in = (union SC_RPC_NOTIFY_PARAMS_u *)pytalloc_get_ptr(in_obj);
3663 0 : if (in == NULL) {
3664 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union SC_RPC_NOTIFY_PARAMS_u!");
3665 0 : return NULL;
3666 : }
3667 :
3668 0 : return py_import_SC_RPC_NOTIFY_PARAMS_u(mem_ctx, level, in);
3669 : }
3670 :
3671 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_u_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3672 : {
3673 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3674 0 : PyObject *mem_ctx_obj = NULL;
3675 0 : TALLOC_CTX *mem_ctx = NULL;
3676 0 : int level = 0;
3677 0 : PyObject *in = NULL;
3678 0 : union SC_RPC_NOTIFY_PARAMS_u *out = NULL;
3679 :
3680 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
3681 : discard_const_p(char *, kwnames),
3682 : &mem_ctx_obj,
3683 : &level,
3684 : &in)) {
3685 0 : return NULL;
3686 : }
3687 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3688 0 : if (mem_ctx == NULL) {
3689 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3690 0 : return NULL;
3691 : }
3692 :
3693 0 : out = py_export_SC_RPC_NOTIFY_PARAMS_u(mem_ctx, level, in);
3694 0 : if (out == NULL) {
3695 0 : return NULL;
3696 : }
3697 :
3698 0 : return pytalloc_GenericObject_reference(out);
3699 : }
3700 :
3701 : static PyMethodDef py_SC_RPC_NOTIFY_PARAMS_u_methods[] = {
3702 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_NOTIFY_PARAMS_u_import),
3703 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3704 : "T.__import__(mem_ctx, level, in) => ret." },
3705 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_NOTIFY_PARAMS_u_export),
3706 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3707 : "T.__export__(mem_ctx, level, in) => ret." },
3708 : { NULL, NULL, 0, NULL }
3709 : };
3710 :
3711 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_u_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3712 : {
3713 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
3714 0 : return NULL;
3715 : }
3716 :
3717 :
3718 : static PyTypeObject SC_RPC_NOTIFY_PARAMS_u_Type = {
3719 : PyVarObject_HEAD_INIT(NULL, 0)
3720 : .tp_name = "svcctl.SC_RPC_NOTIFY_PARAMS_u",
3721 : .tp_getset = NULL,
3722 : .tp_methods = py_SC_RPC_NOTIFY_PARAMS_u_methods,
3723 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3724 : .tp_new = py_SC_RPC_NOTIFY_PARAMS_u_new,
3725 : };
3726 :
3727 :
3728 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_get_dwInfoLevel(PyObject *obj, void *closure)
3729 : {
3730 0 : struct SC_RPC_NOTIFY_PARAMS *object = (struct SC_RPC_NOTIFY_PARAMS *)pytalloc_get_ptr(obj);
3731 0 : PyObject *py_dwInfoLevel;
3732 0 : py_dwInfoLevel = PyLong_FromUnsignedLongLong((uint32_t)object->dwInfoLevel);
3733 0 : return py_dwInfoLevel;
3734 : }
3735 :
3736 0 : static int py_SC_RPC_NOTIFY_PARAMS_set_dwInfoLevel(PyObject *py_obj, PyObject *value, void *closure)
3737 : {
3738 0 : struct SC_RPC_NOTIFY_PARAMS *object = (struct SC_RPC_NOTIFY_PARAMS *)pytalloc_get_ptr(py_obj);
3739 0 : if (value == NULL) {
3740 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwInfoLevel");
3741 0 : return -1;
3742 : }
3743 : {
3744 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwInfoLevel));
3745 0 : if (PyLong_Check(value)) {
3746 0 : unsigned long long test_var;
3747 0 : test_var = PyLong_AsUnsignedLongLong(value);
3748 0 : if (PyErr_Occurred() != NULL) {
3749 0 : return -1;
3750 : }
3751 0 : if (test_var > uint_max) {
3752 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3753 : PyLong_Type.tp_name, uint_max, test_var);
3754 0 : return -1;
3755 : }
3756 0 : object->dwInfoLevel = test_var;
3757 : } else {
3758 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3759 : PyLong_Type.tp_name);
3760 0 : return -1;
3761 : }
3762 : }
3763 0 : return 0;
3764 : }
3765 :
3766 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_get_u(PyObject *obj, void *closure)
3767 : {
3768 0 : struct SC_RPC_NOTIFY_PARAMS *object = (struct SC_RPC_NOTIFY_PARAMS *)pytalloc_get_ptr(obj);
3769 0 : PyObject *py_u;
3770 0 : py_u = pyrpc_import_union(&SC_RPC_NOTIFY_PARAMS_u_Type, pytalloc_get_mem_ctx(obj), object->dwInfoLevel, &object->u, "union SC_RPC_NOTIFY_PARAMS_u");
3771 0 : if (py_u == NULL) {
3772 0 : return NULL;
3773 : }
3774 0 : return py_u;
3775 : }
3776 :
3777 0 : static int py_SC_RPC_NOTIFY_PARAMS_set_u(PyObject *py_obj, PyObject *value, void *closure)
3778 : {
3779 0 : struct SC_RPC_NOTIFY_PARAMS *object = (struct SC_RPC_NOTIFY_PARAMS *)pytalloc_get_ptr(py_obj);
3780 0 : if (value == NULL) {
3781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->u");
3782 0 : return -1;
3783 : }
3784 : {
3785 0 : union SC_RPC_NOTIFY_PARAMS_u *u_switch_0;
3786 0 : u_switch_0 = (union SC_RPC_NOTIFY_PARAMS_u *)pyrpc_export_union(&SC_RPC_NOTIFY_PARAMS_u_Type, pytalloc_get_mem_ctx(py_obj), object->dwInfoLevel, value, "union SC_RPC_NOTIFY_PARAMS_u");
3787 0 : if (u_switch_0 == NULL) {
3788 0 : return -1;
3789 : }
3790 0 : object->u = *u_switch_0;
3791 : }
3792 0 : return 0;
3793 : }
3794 :
3795 : static PyGetSetDef py_SC_RPC_NOTIFY_PARAMS_getsetters[] = {
3796 : {
3797 : .name = discard_const_p(char, "dwInfoLevel"),
3798 : .get = py_SC_RPC_NOTIFY_PARAMS_get_dwInfoLevel,
3799 : .set = py_SC_RPC_NOTIFY_PARAMS_set_dwInfoLevel,
3800 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3801 : },
3802 : {
3803 : .name = discard_const_p(char, "u"),
3804 : .get = py_SC_RPC_NOTIFY_PARAMS_get_u,
3805 : .set = py_SC_RPC_NOTIFY_PARAMS_set_u,
3806 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_NOTIFY_PARAMS_u")
3807 : },
3808 : { .name = NULL }
3809 : };
3810 :
3811 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3812 : {
3813 0 : return pytalloc_new(struct SC_RPC_NOTIFY_PARAMS, type);
3814 : }
3815 :
3816 :
3817 : static PyTypeObject SC_RPC_NOTIFY_PARAMS_Type = {
3818 : PyVarObject_HEAD_INIT(NULL, 0)
3819 : .tp_name = "svcctl.SC_RPC_NOTIFY_PARAMS",
3820 : .tp_getset = py_SC_RPC_NOTIFY_PARAMS_getsetters,
3821 : .tp_methods = NULL,
3822 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3823 : .tp_new = py_SC_RPC_NOTIFY_PARAMS_new,
3824 : };
3825 :
3826 :
3827 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_LIST_get_cElements(PyObject *obj, void *closure)
3828 : {
3829 0 : struct SC_RPC_NOTIFY_PARAMS_LIST *object = (struct SC_RPC_NOTIFY_PARAMS_LIST *)pytalloc_get_ptr(obj);
3830 0 : PyObject *py_cElements;
3831 0 : py_cElements = PyLong_FromUnsignedLongLong((uint32_t)object->cElements);
3832 0 : return py_cElements;
3833 : }
3834 :
3835 0 : static int py_SC_RPC_NOTIFY_PARAMS_LIST_set_cElements(PyObject *py_obj, PyObject *value, void *closure)
3836 : {
3837 0 : struct SC_RPC_NOTIFY_PARAMS_LIST *object = (struct SC_RPC_NOTIFY_PARAMS_LIST *)pytalloc_get_ptr(py_obj);
3838 0 : if (value == NULL) {
3839 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cElements");
3840 0 : return -1;
3841 : }
3842 : {
3843 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cElements));
3844 0 : if (PyLong_Check(value)) {
3845 0 : unsigned long long test_var;
3846 0 : test_var = PyLong_AsUnsignedLongLong(value);
3847 0 : if (PyErr_Occurred() != NULL) {
3848 0 : return -1;
3849 : }
3850 0 : if (test_var > uint_max) {
3851 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3852 : PyLong_Type.tp_name, uint_max, test_var);
3853 0 : return -1;
3854 : }
3855 0 : object->cElements = test_var;
3856 : } else {
3857 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3858 : PyLong_Type.tp_name);
3859 0 : return -1;
3860 : }
3861 : }
3862 0 : return 0;
3863 : }
3864 :
3865 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_LIST_get_NotifyParamsArray(PyObject *obj, void *closure)
3866 : {
3867 0 : struct SC_RPC_NOTIFY_PARAMS_LIST *object = (struct SC_RPC_NOTIFY_PARAMS_LIST *)pytalloc_get_ptr(obj);
3868 0 : PyObject *py_NotifyParamsArray;
3869 0 : py_NotifyParamsArray = PyList_New(object->cElements);
3870 0 : if (py_NotifyParamsArray == NULL) {
3871 0 : return NULL;
3872 : }
3873 : {
3874 : int NotifyParamsArray_cntr_0;
3875 0 : for (NotifyParamsArray_cntr_0 = 0; NotifyParamsArray_cntr_0 < (object->cElements); NotifyParamsArray_cntr_0++) {
3876 0 : PyObject *py_NotifyParamsArray_0;
3877 0 : py_NotifyParamsArray_0 = pytalloc_reference_ex(&SC_RPC_NOTIFY_PARAMS_Type, object->NotifyParamsArray, &object->NotifyParamsArray[NotifyParamsArray_cntr_0]);
3878 0 : PyList_SetItem(py_NotifyParamsArray, NotifyParamsArray_cntr_0, py_NotifyParamsArray_0);
3879 : }
3880 : }
3881 0 : return py_NotifyParamsArray;
3882 : }
3883 :
3884 0 : static int py_SC_RPC_NOTIFY_PARAMS_LIST_set_NotifyParamsArray(PyObject *py_obj, PyObject *value, void *closure)
3885 : {
3886 0 : struct SC_RPC_NOTIFY_PARAMS_LIST *object = (struct SC_RPC_NOTIFY_PARAMS_LIST *)pytalloc_get_ptr(py_obj);
3887 0 : if (value == NULL) {
3888 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->NotifyParamsArray");
3889 0 : return -1;
3890 : }
3891 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3892 : {
3893 0 : int NotifyParamsArray_cntr_0;
3894 0 : object->NotifyParamsArray = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->NotifyParamsArray, PyList_GET_SIZE(value));
3895 0 : if (!object->NotifyParamsArray) { return -1; }
3896 0 : talloc_set_name_const(object->NotifyParamsArray, "ARRAY: object->NotifyParamsArray");
3897 0 : for (NotifyParamsArray_cntr_0 = 0; NotifyParamsArray_cntr_0 < PyList_GET_SIZE(value); NotifyParamsArray_cntr_0++) {
3898 0 : if (PyList_GET_ITEM(value, NotifyParamsArray_cntr_0) == NULL) {
3899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->NotifyParamsArray[NotifyParamsArray_cntr_0]");
3900 0 : return -1;
3901 : }
3902 0 : PY_CHECK_TYPE(&SC_RPC_NOTIFY_PARAMS_Type, PyList_GET_ITEM(value, NotifyParamsArray_cntr_0), return -1;);
3903 0 : if (talloc_reference(object->NotifyParamsArray, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, NotifyParamsArray_cntr_0))) == NULL) {
3904 0 : PyErr_NoMemory();
3905 0 : return -1;
3906 : }
3907 0 : object->NotifyParamsArray[NotifyParamsArray_cntr_0] = *(struct SC_RPC_NOTIFY_PARAMS *)pytalloc_get_ptr(PyList_GET_ITEM(value, NotifyParamsArray_cntr_0));
3908 : }
3909 : }
3910 0 : return 0;
3911 : }
3912 :
3913 : static PyGetSetDef py_SC_RPC_NOTIFY_PARAMS_LIST_getsetters[] = {
3914 : {
3915 : .name = discard_const_p(char, "cElements"),
3916 : .get = py_SC_RPC_NOTIFY_PARAMS_LIST_get_cElements,
3917 : .set = py_SC_RPC_NOTIFY_PARAMS_LIST_set_cElements,
3918 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3919 : },
3920 : {
3921 : .name = discard_const_p(char, "NotifyParamsArray"),
3922 : .get = py_SC_RPC_NOTIFY_PARAMS_LIST_get_NotifyParamsArray,
3923 : .set = py_SC_RPC_NOTIFY_PARAMS_LIST_set_NotifyParamsArray,
3924 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_NOTIFY_PARAMS")
3925 : },
3926 : { .name = NULL }
3927 : };
3928 :
3929 0 : static PyObject *py_SC_RPC_NOTIFY_PARAMS_LIST_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3930 : {
3931 0 : return pytalloc_new(struct SC_RPC_NOTIFY_PARAMS_LIST, type);
3932 : }
3933 :
3934 :
3935 : static PyTypeObject SC_RPC_NOTIFY_PARAMS_LIST_Type = {
3936 : PyVarObject_HEAD_INIT(NULL, 0)
3937 : .tp_name = "svcctl.SC_RPC_NOTIFY_PARAMS_LIST",
3938 : .tp_getset = py_SC_RPC_NOTIFY_PARAMS_LIST_getsetters,
3939 : .tp_methods = NULL,
3940 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3941 : .tp_new = py_SC_RPC_NOTIFY_PARAMS_LIST_new,
3942 : };
3943 :
3944 :
3945 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_get_dwReason(PyObject *obj, void *closure)
3946 : {
3947 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *)pytalloc_get_ptr(obj);
3948 0 : PyObject *py_dwReason;
3949 0 : py_dwReason = PyLong_FromUnsignedLongLong((uint32_t)object->dwReason);
3950 0 : return py_dwReason;
3951 : }
3952 :
3953 0 : static int py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_set_dwReason(PyObject *py_obj, PyObject *value, void *closure)
3954 : {
3955 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *)pytalloc_get_ptr(py_obj);
3956 0 : if (value == NULL) {
3957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwReason");
3958 0 : return -1;
3959 : }
3960 : {
3961 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwReason));
3962 0 : if (PyLong_Check(value)) {
3963 0 : unsigned long long test_var;
3964 0 : test_var = PyLong_AsUnsignedLongLong(value);
3965 0 : if (PyErr_Occurred() != NULL) {
3966 0 : return -1;
3967 : }
3968 0 : if (test_var > uint_max) {
3969 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3970 : PyLong_Type.tp_name, uint_max, test_var);
3971 0 : return -1;
3972 : }
3973 0 : object->dwReason = test_var;
3974 : } else {
3975 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3976 : PyLong_Type.tp_name);
3977 0 : return -1;
3978 : }
3979 : }
3980 0 : return 0;
3981 : }
3982 :
3983 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_get_szComment(PyObject *obj, void *closure)
3984 : {
3985 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *)pytalloc_get_ptr(obj);
3986 0 : PyObject *py_szComment;
3987 0 : if (object->szComment == NULL) {
3988 0 : Py_RETURN_NONE;
3989 : }
3990 0 : if (object->szComment == NULL) {
3991 0 : py_szComment = Py_None;
3992 0 : Py_INCREF(py_szComment);
3993 : } else {
3994 0 : if (object->szComment == NULL) {
3995 0 : py_szComment = Py_None;
3996 0 : Py_INCREF(py_szComment);
3997 : } else {
3998 0 : py_szComment = PyUnicode_Decode(object->szComment, strlen(object->szComment), "utf-8", "ignore");
3999 : }
4000 : }
4001 0 : return py_szComment;
4002 : }
4003 :
4004 0 : static int py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_set_szComment(PyObject *py_obj, PyObject *value, void *closure)
4005 : {
4006 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *)pytalloc_get_ptr(py_obj);
4007 0 : if (value == NULL) {
4008 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->szComment");
4009 0 : return -1;
4010 : }
4011 0 : if (value == Py_None) {
4012 0 : object->szComment = NULL;
4013 : } else {
4014 0 : object->szComment = NULL;
4015 : {
4016 0 : const char *test_str;
4017 0 : const char *talloc_str;
4018 0 : PyObject *unicode = NULL;
4019 0 : if (PyUnicode_Check(value)) {
4020 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
4021 0 : if (unicode == NULL) {
4022 0 : return -1;
4023 : }
4024 0 : test_str = PyBytes_AS_STRING(unicode);
4025 0 : } else if (PyBytes_Check(value)) {
4026 0 : test_str = PyBytes_AS_STRING(value);
4027 : } else {
4028 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
4029 0 : return -1;
4030 : }
4031 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
4032 0 : if (unicode != NULL) {
4033 0 : Py_DECREF(unicode);
4034 : }
4035 0 : if (talloc_str == NULL) {
4036 0 : PyErr_NoMemory();
4037 0 : return -1;
4038 : }
4039 0 : object->szComment = talloc_str;
4040 : }
4041 : }
4042 0 : return 0;
4043 : }
4044 :
4045 : static PyGetSetDef py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_getsetters[] = {
4046 : {
4047 : .name = discard_const_p(char, "dwReason"),
4048 : .get = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_get_dwReason,
4049 : .set = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_set_dwReason,
4050 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4051 : },
4052 : {
4053 : .name = discard_const_p(char, "szComment"),
4054 : .get = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_get_szComment,
4055 : .set = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_set_szComment,
4056 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4057 : },
4058 : { .name = NULL }
4059 : };
4060 :
4061 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4062 : {
4063 0 : return pytalloc_new(struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA, type);
4064 : }
4065 :
4066 :
4067 : static PyTypeObject SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type = {
4068 : PyVarObject_HEAD_INIT(NULL, 0)
4069 : .tp_name = "svcctl.SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA",
4070 : .tp_getset = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_getsetters,
4071 : .tp_methods = NULL,
4072 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4073 : .tp_new = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_new,
4074 : };
4075 :
4076 :
4077 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_get_ServiceStatus(PyObject *obj, void *closure)
4078 : {
4079 0 : struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS *object = (struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS *)pytalloc_get_ptr(obj);
4080 0 : PyObject *py_ServiceStatus;
4081 0 : py_ServiceStatus = pytalloc_reference_ex(&SERVICE_STATUS_PROCESS_Type, pytalloc_get_mem_ctx(obj), &object->ServiceStatus);
4082 0 : return py_ServiceStatus;
4083 : }
4084 :
4085 0 : static int py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_set_ServiceStatus(PyObject *py_obj, PyObject *value, void *closure)
4086 : {
4087 0 : struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS *object = (struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS *)pytalloc_get_ptr(py_obj);
4088 0 : if (value == NULL) {
4089 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServiceStatus");
4090 0 : return -1;
4091 : }
4092 0 : PY_CHECK_TYPE(&SERVICE_STATUS_PROCESS_Type, value, return -1;);
4093 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4094 0 : PyErr_NoMemory();
4095 0 : return -1;
4096 : }
4097 0 : object->ServiceStatus = *(struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(value);
4098 0 : return 0;
4099 : }
4100 :
4101 : static PyGetSetDef py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_getsetters[] = {
4102 : {
4103 : .name = discard_const_p(char, "ServiceStatus"),
4104 : .get = py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_get_ServiceStatus,
4105 : .set = py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_set_ServiceStatus,
4106 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS_PROCESS")
4107 : },
4108 : { .name = NULL }
4109 : };
4110 :
4111 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4112 : {
4113 0 : return pytalloc_new(struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS, type);
4114 : }
4115 :
4116 :
4117 : static PyTypeObject SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type = {
4118 : PyVarObject_HEAD_INIT(NULL, 0)
4119 : .tp_name = "svcctl.SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS",
4120 : .tp_getset = py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_getsetters,
4121 : .tp_methods = NULL,
4122 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4123 : .tp_new = py_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_new,
4124 : };
4125 :
4126 0 : static PyObject *py_import_SC_RPC_SERVICE_CONTROL_IN_PARAMSA(TALLOC_CTX *mem_ctx, int level, union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *in)
4127 : {
4128 0 : PyObject *ret;
4129 :
4130 0 : switch (level) {
4131 0 : case 1:
4132 0 : if (in->psrInParams == NULL) {
4133 0 : ret = Py_None;
4134 0 : Py_INCREF(ret);
4135 : } else {
4136 0 : ret = pytalloc_reference_ex(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type, in->psrInParams, in->psrInParams);
4137 : }
4138 0 : return ret;
4139 :
4140 : }
4141 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4142 0 : return NULL;
4143 : }
4144 :
4145 0 : static union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *py_export_SC_RPC_SERVICE_CONTROL_IN_PARAMSA(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4146 : {
4147 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *ret = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_IN_PARAMSA);
4148 0 : switch (level) {
4149 0 : case 1:
4150 0 : if (in == NULL) {
4151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psrInParams");
4152 0 : talloc_free(ret); return NULL;
4153 : }
4154 0 : if (in == Py_None) {
4155 0 : ret->psrInParams = NULL;
4156 : } else {
4157 0 : ret->psrInParams = NULL;
4158 0 : PY_CHECK_TYPE(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type, in, talloc_free(ret); return NULL;);
4159 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4160 0 : PyErr_NoMemory();
4161 0 : talloc_free(ret); return NULL;
4162 : }
4163 0 : ret->psrInParams = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *)pytalloc_get_ptr(in);
4164 : }
4165 0 : break;
4166 :
4167 0 : default:
4168 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4169 0 : talloc_free(ret);
4170 0 : ret = NULL;
4171 : }
4172 :
4173 0 : return ret;
4174 : }
4175 :
4176 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4177 : {
4178 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4179 0 : PyObject *mem_ctx_obj = NULL;
4180 0 : TALLOC_CTX *mem_ctx = NULL;
4181 0 : int level = 0;
4182 0 : PyObject *in_obj = NULL;
4183 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *in = NULL;
4184 :
4185 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4186 : discard_const_p(char *, kwnames),
4187 : &mem_ctx_obj,
4188 : &level,
4189 : &in_obj)) {
4190 0 : return NULL;
4191 : }
4192 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4193 0 : if (mem_ctx == NULL) {
4194 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4195 0 : return NULL;
4196 : }
4197 0 : in = (union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *)pytalloc_get_ptr(in_obj);
4198 0 : if (in == NULL) {
4199 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union SC_RPC_SERVICE_CONTROL_IN_PARAMSA!");
4200 0 : return NULL;
4201 : }
4202 :
4203 0 : return py_import_SC_RPC_SERVICE_CONTROL_IN_PARAMSA(mem_ctx, level, in);
4204 : }
4205 :
4206 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4207 : {
4208 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4209 0 : PyObject *mem_ctx_obj = NULL;
4210 0 : TALLOC_CTX *mem_ctx = NULL;
4211 0 : int level = 0;
4212 0 : PyObject *in = NULL;
4213 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *out = NULL;
4214 :
4215 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4216 : discard_const_p(char *, kwnames),
4217 : &mem_ctx_obj,
4218 : &level,
4219 : &in)) {
4220 0 : return NULL;
4221 : }
4222 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4223 0 : if (mem_ctx == NULL) {
4224 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4225 0 : return NULL;
4226 : }
4227 :
4228 0 : out = py_export_SC_RPC_SERVICE_CONTROL_IN_PARAMSA(mem_ctx, level, in);
4229 0 : if (out == NULL) {
4230 0 : return NULL;
4231 : }
4232 :
4233 0 : return pytalloc_GenericObject_reference(out);
4234 : }
4235 :
4236 : static PyMethodDef py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_methods[] = {
4237 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_import),
4238 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4239 : "T.__import__(mem_ctx, level, in) => ret." },
4240 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_export),
4241 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4242 : "T.__export__(mem_ctx, level, in) => ret." },
4243 : { NULL, NULL, 0, NULL }
4244 : };
4245 :
4246 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4247 : {
4248 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4249 0 : return NULL;
4250 : }
4251 :
4252 :
4253 : static PyTypeObject SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type = {
4254 : PyVarObject_HEAD_INIT(NULL, 0)
4255 : .tp_name = "svcctl.SC_RPC_SERVICE_CONTROL_IN_PARAMSA",
4256 : .tp_getset = NULL,
4257 : .tp_methods = py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_methods,
4258 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4259 : .tp_new = py_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_new,
4260 : };
4261 :
4262 0 : static PyObject *py_import_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA(TALLOC_CTX *mem_ctx, int level, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *in)
4263 : {
4264 0 : PyObject *ret;
4265 :
4266 0 : switch (level) {
4267 0 : case 1:
4268 0 : if (in->psrOutParams == NULL) {
4269 0 : ret = Py_None;
4270 0 : Py_INCREF(ret);
4271 : } else {
4272 0 : ret = pytalloc_reference_ex(&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type, in->psrOutParams, in->psrOutParams);
4273 : }
4274 0 : return ret;
4275 :
4276 : }
4277 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4278 0 : return NULL;
4279 : }
4280 :
4281 0 : static union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *py_export_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4282 : {
4283 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *ret = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA);
4284 0 : switch (level) {
4285 0 : case 1:
4286 0 : if (in == NULL) {
4287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psrOutParams");
4288 0 : talloc_free(ret); return NULL;
4289 : }
4290 0 : if (in == Py_None) {
4291 0 : ret->psrOutParams = NULL;
4292 : } else {
4293 0 : ret->psrOutParams = NULL;
4294 0 : PY_CHECK_TYPE(&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type, in, talloc_free(ret); return NULL;);
4295 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4296 0 : PyErr_NoMemory();
4297 0 : talloc_free(ret); return NULL;
4298 : }
4299 0 : ret->psrOutParams = (struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS *)pytalloc_get_ptr(in);
4300 : }
4301 0 : break;
4302 :
4303 0 : default:
4304 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4305 0 : talloc_free(ret);
4306 0 : ret = NULL;
4307 : }
4308 :
4309 0 : return ret;
4310 : }
4311 :
4312 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4313 : {
4314 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4315 0 : PyObject *mem_ctx_obj = NULL;
4316 0 : TALLOC_CTX *mem_ctx = NULL;
4317 0 : int level = 0;
4318 0 : PyObject *in_obj = NULL;
4319 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *in = NULL;
4320 :
4321 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4322 : discard_const_p(char *, kwnames),
4323 : &mem_ctx_obj,
4324 : &level,
4325 : &in_obj)) {
4326 0 : return NULL;
4327 : }
4328 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4329 0 : if (mem_ctx == NULL) {
4330 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4331 0 : return NULL;
4332 : }
4333 0 : in = (union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *)pytalloc_get_ptr(in_obj);
4334 0 : if (in == NULL) {
4335 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA!");
4336 0 : return NULL;
4337 : }
4338 :
4339 0 : return py_import_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA(mem_ctx, level, in);
4340 : }
4341 :
4342 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4343 : {
4344 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4345 0 : PyObject *mem_ctx_obj = NULL;
4346 0 : TALLOC_CTX *mem_ctx = NULL;
4347 0 : int level = 0;
4348 0 : PyObject *in = NULL;
4349 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *out = NULL;
4350 :
4351 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4352 : discard_const_p(char *, kwnames),
4353 : &mem_ctx_obj,
4354 : &level,
4355 : &in)) {
4356 0 : return NULL;
4357 : }
4358 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4359 0 : if (mem_ctx == NULL) {
4360 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4361 0 : return NULL;
4362 : }
4363 :
4364 0 : out = py_export_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA(mem_ctx, level, in);
4365 0 : if (out == NULL) {
4366 0 : return NULL;
4367 : }
4368 :
4369 0 : return pytalloc_GenericObject_reference(out);
4370 : }
4371 :
4372 : static PyMethodDef py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_methods[] = {
4373 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_import),
4374 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4375 : "T.__import__(mem_ctx, level, in) => ret." },
4376 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_export),
4377 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4378 : "T.__export__(mem_ctx, level, in) => ret." },
4379 : { NULL, NULL, 0, NULL }
4380 : };
4381 :
4382 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4383 : {
4384 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4385 0 : return NULL;
4386 : }
4387 :
4388 :
4389 : static PyTypeObject SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type = {
4390 : PyVarObject_HEAD_INIT(NULL, 0)
4391 : .tp_name = "svcctl.SC_RPC_SERVICE_CONTROL_OUT_PARAMSA",
4392 : .tp_getset = NULL,
4393 : .tp_methods = py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_methods,
4394 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4395 : .tp_new = py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_new,
4396 : };
4397 :
4398 :
4399 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_get_dwReason(PyObject *obj, void *closure)
4400 : {
4401 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *)pytalloc_get_ptr(obj);
4402 0 : PyObject *py_dwReason;
4403 0 : py_dwReason = PyLong_FromUnsignedLongLong((uint32_t)object->dwReason);
4404 0 : return py_dwReason;
4405 : }
4406 :
4407 0 : static int py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_set_dwReason(PyObject *py_obj, PyObject *value, void *closure)
4408 : {
4409 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *)pytalloc_get_ptr(py_obj);
4410 0 : if (value == NULL) {
4411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwReason");
4412 0 : return -1;
4413 : }
4414 : {
4415 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwReason));
4416 0 : if (PyLong_Check(value)) {
4417 0 : unsigned long long test_var;
4418 0 : test_var = PyLong_AsUnsignedLongLong(value);
4419 0 : if (PyErr_Occurred() != NULL) {
4420 0 : return -1;
4421 : }
4422 0 : if (test_var > uint_max) {
4423 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4424 : PyLong_Type.tp_name, uint_max, test_var);
4425 0 : return -1;
4426 : }
4427 0 : object->dwReason = test_var;
4428 : } else {
4429 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4430 : PyLong_Type.tp_name);
4431 0 : return -1;
4432 : }
4433 : }
4434 0 : return 0;
4435 : }
4436 :
4437 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_get_pszComment(PyObject *obj, void *closure)
4438 : {
4439 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *)pytalloc_get_ptr(obj);
4440 0 : PyObject *py_pszComment;
4441 0 : if (object->pszComment == NULL) {
4442 0 : Py_RETURN_NONE;
4443 : }
4444 0 : if (object->pszComment == NULL) {
4445 0 : py_pszComment = Py_None;
4446 0 : Py_INCREF(py_pszComment);
4447 : } else {
4448 0 : if (object->pszComment == NULL) {
4449 0 : py_pszComment = Py_None;
4450 0 : Py_INCREF(py_pszComment);
4451 : } else {
4452 0 : py_pszComment = PyUnicode_Decode(object->pszComment, strlen(object->pszComment), "utf-8", "ignore");
4453 : }
4454 : }
4455 0 : return py_pszComment;
4456 : }
4457 :
4458 0 : static int py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_set_pszComment(PyObject *py_obj, PyObject *value, void *closure)
4459 : {
4460 0 : struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *object = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *)pytalloc_get_ptr(py_obj);
4461 0 : if (value == NULL) {
4462 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pszComment");
4463 0 : return -1;
4464 : }
4465 0 : if (value == Py_None) {
4466 0 : object->pszComment = NULL;
4467 : } else {
4468 0 : object->pszComment = NULL;
4469 : {
4470 0 : const char *test_str;
4471 0 : const char *talloc_str;
4472 0 : PyObject *unicode = NULL;
4473 0 : if (PyUnicode_Check(value)) {
4474 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
4475 0 : if (unicode == NULL) {
4476 0 : return -1;
4477 : }
4478 0 : test_str = PyBytes_AS_STRING(unicode);
4479 0 : } else if (PyBytes_Check(value)) {
4480 0 : test_str = PyBytes_AS_STRING(value);
4481 : } else {
4482 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
4483 0 : return -1;
4484 : }
4485 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
4486 0 : if (unicode != NULL) {
4487 0 : Py_DECREF(unicode);
4488 : }
4489 0 : if (talloc_str == NULL) {
4490 0 : PyErr_NoMemory();
4491 0 : return -1;
4492 : }
4493 0 : object->pszComment = talloc_str;
4494 : }
4495 : }
4496 0 : return 0;
4497 : }
4498 :
4499 : static PyGetSetDef py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_getsetters[] = {
4500 : {
4501 : .name = discard_const_p(char, "dwReason"),
4502 : .get = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_get_dwReason,
4503 : .set = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_set_dwReason,
4504 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4505 : },
4506 : {
4507 : .name = discard_const_p(char, "pszComment"),
4508 : .get = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_get_pszComment,
4509 : .set = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_set_pszComment,
4510 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4511 : },
4512 : { .name = NULL }
4513 : };
4514 :
4515 0 : static PyObject *py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4516 : {
4517 0 : return pytalloc_new(struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW, type);
4518 : }
4519 :
4520 :
4521 : static PyTypeObject SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type = {
4522 : PyVarObject_HEAD_INIT(NULL, 0)
4523 : .tp_name = "svcctl.SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW",
4524 : .tp_getset = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_getsetters,
4525 : .tp_methods = NULL,
4526 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4527 : .tp_new = py_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_new,
4528 : };
4529 :
4530 0 : static PyObject *py_import_SC_RPC_SERVICE_CONTROL_IN_PARAMSW(TALLOC_CTX *mem_ctx, int level, union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *in)
4531 : {
4532 0 : PyObject *ret;
4533 :
4534 0 : switch (level) {
4535 0 : case 1:
4536 0 : if (in->psrInParams == NULL) {
4537 0 : ret = Py_None;
4538 0 : Py_INCREF(ret);
4539 : } else {
4540 0 : ret = pytalloc_reference_ex(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type, in->psrInParams, in->psrInParams);
4541 : }
4542 0 : return ret;
4543 :
4544 : }
4545 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4546 0 : return NULL;
4547 : }
4548 :
4549 0 : static union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *py_export_SC_RPC_SERVICE_CONTROL_IN_PARAMSW(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4550 : {
4551 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *ret = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_IN_PARAMSW);
4552 0 : switch (level) {
4553 0 : case 1:
4554 0 : if (in == NULL) {
4555 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psrInParams");
4556 0 : talloc_free(ret); return NULL;
4557 : }
4558 0 : if (in == Py_None) {
4559 0 : ret->psrInParams = NULL;
4560 : } else {
4561 0 : ret->psrInParams = NULL;
4562 0 : PY_CHECK_TYPE(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type, in, talloc_free(ret); return NULL;);
4563 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4564 0 : PyErr_NoMemory();
4565 0 : talloc_free(ret); return NULL;
4566 : }
4567 0 : ret->psrInParams = (struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW *)pytalloc_get_ptr(in);
4568 : }
4569 0 : break;
4570 :
4571 0 : default:
4572 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4573 0 : talloc_free(ret);
4574 0 : ret = NULL;
4575 : }
4576 :
4577 0 : return ret;
4578 : }
4579 :
4580 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4581 : {
4582 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4583 0 : PyObject *mem_ctx_obj = NULL;
4584 0 : TALLOC_CTX *mem_ctx = NULL;
4585 0 : int level = 0;
4586 0 : PyObject *in_obj = NULL;
4587 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *in = NULL;
4588 :
4589 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4590 : discard_const_p(char *, kwnames),
4591 : &mem_ctx_obj,
4592 : &level,
4593 : &in_obj)) {
4594 0 : return NULL;
4595 : }
4596 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4597 0 : if (mem_ctx == NULL) {
4598 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4599 0 : return NULL;
4600 : }
4601 0 : in = (union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *)pytalloc_get_ptr(in_obj);
4602 0 : if (in == NULL) {
4603 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union SC_RPC_SERVICE_CONTROL_IN_PARAMSW!");
4604 0 : return NULL;
4605 : }
4606 :
4607 0 : return py_import_SC_RPC_SERVICE_CONTROL_IN_PARAMSW(mem_ctx, level, in);
4608 : }
4609 :
4610 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4611 : {
4612 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4613 0 : PyObject *mem_ctx_obj = NULL;
4614 0 : TALLOC_CTX *mem_ctx = NULL;
4615 0 : int level = 0;
4616 0 : PyObject *in = NULL;
4617 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *out = NULL;
4618 :
4619 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4620 : discard_const_p(char *, kwnames),
4621 : &mem_ctx_obj,
4622 : &level,
4623 : &in)) {
4624 0 : return NULL;
4625 : }
4626 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4627 0 : if (mem_ctx == NULL) {
4628 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4629 0 : return NULL;
4630 : }
4631 :
4632 0 : out = py_export_SC_RPC_SERVICE_CONTROL_IN_PARAMSW(mem_ctx, level, in);
4633 0 : if (out == NULL) {
4634 0 : return NULL;
4635 : }
4636 :
4637 0 : return pytalloc_GenericObject_reference(out);
4638 : }
4639 :
4640 : static PyMethodDef py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_methods[] = {
4641 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_import),
4642 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4643 : "T.__import__(mem_ctx, level, in) => ret." },
4644 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_export),
4645 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4646 : "T.__export__(mem_ctx, level, in) => ret." },
4647 : { NULL, NULL, 0, NULL }
4648 : };
4649 :
4650 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4651 : {
4652 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4653 0 : return NULL;
4654 : }
4655 :
4656 :
4657 : static PyTypeObject SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type = {
4658 : PyVarObject_HEAD_INIT(NULL, 0)
4659 : .tp_name = "svcctl.SC_RPC_SERVICE_CONTROL_IN_PARAMSW",
4660 : .tp_getset = NULL,
4661 : .tp_methods = py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_methods,
4662 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4663 : .tp_new = py_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_new,
4664 : };
4665 :
4666 0 : static PyObject *py_import_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW(TALLOC_CTX *mem_ctx, int level, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *in)
4667 : {
4668 0 : PyObject *ret;
4669 :
4670 0 : switch (level) {
4671 0 : case 1:
4672 0 : if (in->psrOutParams == NULL) {
4673 0 : ret = Py_None;
4674 0 : Py_INCREF(ret);
4675 : } else {
4676 0 : ret = pytalloc_reference_ex(&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type, in->psrOutParams, in->psrOutParams);
4677 : }
4678 0 : return ret;
4679 :
4680 : }
4681 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4682 0 : return NULL;
4683 : }
4684 :
4685 0 : static union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *py_export_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4686 : {
4687 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *ret = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW);
4688 0 : switch (level) {
4689 0 : case 1:
4690 0 : if (in == NULL) {
4691 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psrOutParams");
4692 0 : talloc_free(ret); return NULL;
4693 : }
4694 0 : if (in == Py_None) {
4695 0 : ret->psrOutParams = NULL;
4696 : } else {
4697 0 : ret->psrOutParams = NULL;
4698 0 : PY_CHECK_TYPE(&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type, in, talloc_free(ret); return NULL;);
4699 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4700 0 : PyErr_NoMemory();
4701 0 : talloc_free(ret); return NULL;
4702 : }
4703 0 : ret->psrOutParams = (struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS *)pytalloc_get_ptr(in);
4704 : }
4705 0 : break;
4706 :
4707 0 : default:
4708 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4709 0 : talloc_free(ret);
4710 0 : ret = NULL;
4711 : }
4712 :
4713 0 : return ret;
4714 : }
4715 :
4716 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4717 : {
4718 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4719 0 : PyObject *mem_ctx_obj = NULL;
4720 0 : TALLOC_CTX *mem_ctx = NULL;
4721 0 : int level = 0;
4722 0 : PyObject *in_obj = NULL;
4723 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *in = NULL;
4724 :
4725 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4726 : discard_const_p(char *, kwnames),
4727 : &mem_ctx_obj,
4728 : &level,
4729 : &in_obj)) {
4730 0 : return NULL;
4731 : }
4732 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4733 0 : if (mem_ctx == NULL) {
4734 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4735 0 : return NULL;
4736 : }
4737 0 : in = (union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *)pytalloc_get_ptr(in_obj);
4738 0 : if (in == NULL) {
4739 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW!");
4740 0 : return NULL;
4741 : }
4742 :
4743 0 : return py_import_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW(mem_ctx, level, in);
4744 : }
4745 :
4746 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4747 : {
4748 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4749 0 : PyObject *mem_ctx_obj = NULL;
4750 0 : TALLOC_CTX *mem_ctx = NULL;
4751 0 : int level = 0;
4752 0 : PyObject *in = NULL;
4753 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *out = NULL;
4754 :
4755 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4756 : discard_const_p(char *, kwnames),
4757 : &mem_ctx_obj,
4758 : &level,
4759 : &in)) {
4760 0 : return NULL;
4761 : }
4762 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4763 0 : if (mem_ctx == NULL) {
4764 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4765 0 : return NULL;
4766 : }
4767 :
4768 0 : out = py_export_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW(mem_ctx, level, in);
4769 0 : if (out == NULL) {
4770 0 : return NULL;
4771 : }
4772 :
4773 0 : return pytalloc_GenericObject_reference(out);
4774 : }
4775 :
4776 : static PyMethodDef py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_methods[] = {
4777 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_import),
4778 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4779 : "T.__import__(mem_ctx, level, in) => ret." },
4780 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_export),
4781 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4782 : "T.__export__(mem_ctx, level, in) => ret." },
4783 : { NULL, NULL, 0, NULL }
4784 : };
4785 :
4786 0 : static PyObject *py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4787 : {
4788 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4789 0 : return NULL;
4790 : }
4791 :
4792 :
4793 : static PyTypeObject SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type = {
4794 : PyVarObject_HEAD_INIT(NULL, 0)
4795 : .tp_name = "svcctl.SC_RPC_SERVICE_CONTROL_OUT_PARAMSW",
4796 : .tp_getset = NULL,
4797 : .tp_methods = py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_methods,
4798 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4799 : .tp_new = py_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_new,
4800 : };
4801 :
4802 :
4803 0 : static PyObject *py_SERVICE_DESCRIPTIONW_get_lpDescription(PyObject *obj, void *closure)
4804 : {
4805 0 : struct SERVICE_DESCRIPTIONW *object = (struct SERVICE_DESCRIPTIONW *)pytalloc_get_ptr(obj);
4806 0 : PyObject *py_lpDescription;
4807 0 : if (object->lpDescription == NULL) {
4808 0 : Py_RETURN_NONE;
4809 : }
4810 0 : if (object->lpDescription == NULL) {
4811 0 : py_lpDescription = Py_None;
4812 0 : Py_INCREF(py_lpDescription);
4813 : } else {
4814 0 : if (object->lpDescription == NULL) {
4815 0 : py_lpDescription = Py_None;
4816 0 : Py_INCREF(py_lpDescription);
4817 : } else {
4818 0 : py_lpDescription = PyUnicode_Decode(object->lpDescription, strlen(object->lpDescription), "utf-8", "ignore");
4819 : }
4820 : }
4821 0 : return py_lpDescription;
4822 : }
4823 :
4824 0 : static int py_SERVICE_DESCRIPTIONW_set_lpDescription(PyObject *py_obj, PyObject *value, void *closure)
4825 : {
4826 0 : struct SERVICE_DESCRIPTIONW *object = (struct SERVICE_DESCRIPTIONW *)pytalloc_get_ptr(py_obj);
4827 0 : if (value == NULL) {
4828 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lpDescription");
4829 0 : return -1;
4830 : }
4831 0 : if (value == Py_None) {
4832 0 : object->lpDescription = NULL;
4833 : } else {
4834 0 : object->lpDescription = NULL;
4835 : {
4836 0 : const char *test_str;
4837 0 : const char *talloc_str;
4838 0 : PyObject *unicode = NULL;
4839 0 : if (PyUnicode_Check(value)) {
4840 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
4841 0 : if (unicode == NULL) {
4842 0 : return -1;
4843 : }
4844 0 : test_str = PyBytes_AS_STRING(unicode);
4845 0 : } else if (PyBytes_Check(value)) {
4846 0 : test_str = PyBytes_AS_STRING(value);
4847 : } else {
4848 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
4849 0 : return -1;
4850 : }
4851 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
4852 0 : if (unicode != NULL) {
4853 0 : Py_DECREF(unicode);
4854 : }
4855 0 : if (talloc_str == NULL) {
4856 0 : PyErr_NoMemory();
4857 0 : return -1;
4858 : }
4859 0 : object->lpDescription = talloc_str;
4860 : }
4861 : }
4862 0 : return 0;
4863 : }
4864 :
4865 : static PyGetSetDef py_SERVICE_DESCRIPTIONW_getsetters[] = {
4866 : {
4867 : .name = discard_const_p(char, "lpDescription"),
4868 : .get = py_SERVICE_DESCRIPTIONW_get_lpDescription,
4869 : .set = py_SERVICE_DESCRIPTIONW_set_lpDescription,
4870 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4871 : },
4872 : { .name = NULL }
4873 : };
4874 :
4875 0 : static PyObject *py_SERVICE_DESCRIPTIONW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4876 : {
4877 0 : return pytalloc_new(struct SERVICE_DESCRIPTIONW, type);
4878 : }
4879 :
4880 :
4881 : static PyTypeObject SERVICE_DESCRIPTIONW_Type = {
4882 : PyVarObject_HEAD_INIT(NULL, 0)
4883 : .tp_name = "svcctl.SERVICE_DESCRIPTIONW",
4884 : .tp_getset = py_SERVICE_DESCRIPTIONW_getsetters,
4885 : .tp_methods = NULL,
4886 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4887 : .tp_new = py_SERVICE_DESCRIPTIONW_new,
4888 : };
4889 :
4890 :
4891 0 : static PyObject *py_SERVICE_DELAYED_AUTO_START_INFO_get_fDelayedAutostart(PyObject *obj, void *closure)
4892 : {
4893 0 : struct SERVICE_DELAYED_AUTO_START_INFO *object = (struct SERVICE_DELAYED_AUTO_START_INFO *)pytalloc_get_ptr(obj);
4894 0 : PyObject *py_fDelayedAutostart;
4895 0 : py_fDelayedAutostart = PyLong_FromUnsignedLongLong((uint32_t)object->fDelayedAutostart);
4896 0 : return py_fDelayedAutostart;
4897 : }
4898 :
4899 0 : static int py_SERVICE_DELAYED_AUTO_START_INFO_set_fDelayedAutostart(PyObject *py_obj, PyObject *value, void *closure)
4900 : {
4901 0 : struct SERVICE_DELAYED_AUTO_START_INFO *object = (struct SERVICE_DELAYED_AUTO_START_INFO *)pytalloc_get_ptr(py_obj);
4902 0 : if (value == NULL) {
4903 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fDelayedAutostart");
4904 0 : return -1;
4905 : }
4906 : {
4907 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fDelayedAutostart));
4908 0 : if (PyLong_Check(value)) {
4909 0 : unsigned long long test_var;
4910 0 : test_var = PyLong_AsUnsignedLongLong(value);
4911 0 : if (PyErr_Occurred() != NULL) {
4912 0 : return -1;
4913 : }
4914 0 : if (test_var > uint_max) {
4915 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4916 : PyLong_Type.tp_name, uint_max, test_var);
4917 0 : return -1;
4918 : }
4919 0 : object->fDelayedAutostart = test_var;
4920 : } else {
4921 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4922 : PyLong_Type.tp_name);
4923 0 : return -1;
4924 : }
4925 : }
4926 0 : return 0;
4927 : }
4928 :
4929 : static PyGetSetDef py_SERVICE_DELAYED_AUTO_START_INFO_getsetters[] = {
4930 : {
4931 : .name = discard_const_p(char, "fDelayedAutostart"),
4932 : .get = py_SERVICE_DELAYED_AUTO_START_INFO_get_fDelayedAutostart,
4933 : .set = py_SERVICE_DELAYED_AUTO_START_INFO_set_fDelayedAutostart,
4934 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4935 : },
4936 : { .name = NULL }
4937 : };
4938 :
4939 0 : static PyObject *py_SERVICE_DELAYED_AUTO_START_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4940 : {
4941 0 : return pytalloc_new(struct SERVICE_DELAYED_AUTO_START_INFO, type);
4942 : }
4943 :
4944 :
4945 : static PyTypeObject SERVICE_DELAYED_AUTO_START_INFO_Type = {
4946 : PyVarObject_HEAD_INIT(NULL, 0)
4947 : .tp_name = "svcctl.SERVICE_DELAYED_AUTO_START_INFO",
4948 : .tp_getset = py_SERVICE_DELAYED_AUTO_START_INFO_getsetters,
4949 : .tp_methods = NULL,
4950 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4951 : .tp_new = py_SERVICE_DELAYED_AUTO_START_INFO_new,
4952 : };
4953 :
4954 :
4955 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_FLAG_get_fFailureActionsOnNonCrashFailures(PyObject *obj, void *closure)
4956 : {
4957 0 : struct SERVICE_FAILURE_ACTIONS_FLAG *object = (struct SERVICE_FAILURE_ACTIONS_FLAG *)pytalloc_get_ptr(obj);
4958 0 : PyObject *py_fFailureActionsOnNonCrashFailures;
4959 0 : py_fFailureActionsOnNonCrashFailures = PyLong_FromUnsignedLongLong((uint32_t)object->fFailureActionsOnNonCrashFailures);
4960 0 : return py_fFailureActionsOnNonCrashFailures;
4961 : }
4962 :
4963 0 : static int py_SERVICE_FAILURE_ACTIONS_FLAG_set_fFailureActionsOnNonCrashFailures(PyObject *py_obj, PyObject *value, void *closure)
4964 : {
4965 0 : struct SERVICE_FAILURE_ACTIONS_FLAG *object = (struct SERVICE_FAILURE_ACTIONS_FLAG *)pytalloc_get_ptr(py_obj);
4966 0 : if (value == NULL) {
4967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fFailureActionsOnNonCrashFailures");
4968 0 : return -1;
4969 : }
4970 : {
4971 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fFailureActionsOnNonCrashFailures));
4972 0 : if (PyLong_Check(value)) {
4973 0 : unsigned long long test_var;
4974 0 : test_var = PyLong_AsUnsignedLongLong(value);
4975 0 : if (PyErr_Occurred() != NULL) {
4976 0 : return -1;
4977 : }
4978 0 : if (test_var > uint_max) {
4979 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4980 : PyLong_Type.tp_name, uint_max, test_var);
4981 0 : return -1;
4982 : }
4983 0 : object->fFailureActionsOnNonCrashFailures = test_var;
4984 : } else {
4985 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4986 : PyLong_Type.tp_name);
4987 0 : return -1;
4988 : }
4989 : }
4990 0 : return 0;
4991 : }
4992 :
4993 : static PyGetSetDef py_SERVICE_FAILURE_ACTIONS_FLAG_getsetters[] = {
4994 : {
4995 : .name = discard_const_p(char, "fFailureActionsOnNonCrashFailures"),
4996 : .get = py_SERVICE_FAILURE_ACTIONS_FLAG_get_fFailureActionsOnNonCrashFailures,
4997 : .set = py_SERVICE_FAILURE_ACTIONS_FLAG_set_fFailureActionsOnNonCrashFailures,
4998 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4999 : },
5000 : { .name = NULL }
5001 : };
5002 :
5003 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_FLAG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5004 : {
5005 0 : return pytalloc_new(struct SERVICE_FAILURE_ACTIONS_FLAG, type);
5006 : }
5007 :
5008 :
5009 : static PyTypeObject SERVICE_FAILURE_ACTIONS_FLAG_Type = {
5010 : PyVarObject_HEAD_INIT(NULL, 0)
5011 : .tp_name = "svcctl.SERVICE_FAILURE_ACTIONS_FLAG",
5012 : .tp_getset = py_SERVICE_FAILURE_ACTIONS_FLAG_getsetters,
5013 : .tp_methods = NULL,
5014 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5015 : .tp_new = py_SERVICE_FAILURE_ACTIONS_FLAG_new,
5016 : };
5017 :
5018 :
5019 0 : static PyObject *py_SERVICE_SID_INFO_get_dwServiceSidType(PyObject *obj, void *closure)
5020 : {
5021 0 : struct SERVICE_SID_INFO *object = (struct SERVICE_SID_INFO *)pytalloc_get_ptr(obj);
5022 0 : PyObject *py_dwServiceSidType;
5023 0 : py_dwServiceSidType = PyLong_FromUnsignedLongLong((uint32_t)object->dwServiceSidType);
5024 0 : return py_dwServiceSidType;
5025 : }
5026 :
5027 0 : static int py_SERVICE_SID_INFO_set_dwServiceSidType(PyObject *py_obj, PyObject *value, void *closure)
5028 : {
5029 0 : struct SERVICE_SID_INFO *object = (struct SERVICE_SID_INFO *)pytalloc_get_ptr(py_obj);
5030 0 : if (value == NULL) {
5031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwServiceSidType");
5032 0 : return -1;
5033 : }
5034 : {
5035 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwServiceSidType));
5036 0 : if (PyLong_Check(value)) {
5037 0 : unsigned long long test_var;
5038 0 : test_var = PyLong_AsUnsignedLongLong(value);
5039 0 : if (PyErr_Occurred() != NULL) {
5040 0 : return -1;
5041 : }
5042 0 : if (test_var > uint_max) {
5043 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5044 : PyLong_Type.tp_name, uint_max, test_var);
5045 0 : return -1;
5046 : }
5047 0 : object->dwServiceSidType = test_var;
5048 : } else {
5049 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5050 : PyLong_Type.tp_name);
5051 0 : return -1;
5052 : }
5053 : }
5054 0 : return 0;
5055 : }
5056 :
5057 : static PyGetSetDef py_SERVICE_SID_INFO_getsetters[] = {
5058 : {
5059 : .name = discard_const_p(char, "dwServiceSidType"),
5060 : .get = py_SERVICE_SID_INFO_get_dwServiceSidType,
5061 : .set = py_SERVICE_SID_INFO_set_dwServiceSidType,
5062 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5063 : },
5064 : { .name = NULL }
5065 : };
5066 :
5067 0 : static PyObject *py_SERVICE_SID_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5068 : {
5069 0 : return pytalloc_new(struct SERVICE_SID_INFO, type);
5070 : }
5071 :
5072 :
5073 : static PyTypeObject SERVICE_SID_INFO_Type = {
5074 : PyVarObject_HEAD_INIT(NULL, 0)
5075 : .tp_name = "svcctl.SERVICE_SID_INFO",
5076 : .tp_getset = py_SERVICE_SID_INFO_getsetters,
5077 : .tp_methods = NULL,
5078 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5079 : .tp_new = py_SERVICE_SID_INFO_new,
5080 : };
5081 :
5082 :
5083 0 : static PyObject *py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_get_cbRequiredPrivileges(PyObject *obj, void *closure)
5084 : {
5085 0 : struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *object = (struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *)pytalloc_get_ptr(obj);
5086 0 : PyObject *py_cbRequiredPrivileges;
5087 0 : py_cbRequiredPrivileges = PyLong_FromUnsignedLongLong((uint32_t)object->cbRequiredPrivileges);
5088 0 : return py_cbRequiredPrivileges;
5089 : }
5090 :
5091 0 : static int py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_set_cbRequiredPrivileges(PyObject *py_obj, PyObject *value, void *closure)
5092 : {
5093 0 : struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *object = (struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *)pytalloc_get_ptr(py_obj);
5094 0 : if (value == NULL) {
5095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cbRequiredPrivileges");
5096 0 : return -1;
5097 : }
5098 : {
5099 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cbRequiredPrivileges));
5100 0 : if (PyLong_Check(value)) {
5101 0 : unsigned long long test_var;
5102 0 : test_var = PyLong_AsUnsignedLongLong(value);
5103 0 : if (PyErr_Occurred() != NULL) {
5104 0 : return -1;
5105 : }
5106 0 : if (test_var > uint_max) {
5107 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5108 : PyLong_Type.tp_name, uint_max, test_var);
5109 0 : return -1;
5110 : }
5111 0 : object->cbRequiredPrivileges = test_var;
5112 : } else {
5113 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5114 : PyLong_Type.tp_name);
5115 0 : return -1;
5116 : }
5117 : }
5118 0 : return 0;
5119 : }
5120 :
5121 0 : static PyObject *py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_get_pRequiredPrivileges(PyObject *obj, void *closure)
5122 : {
5123 0 : struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *object = (struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *)pytalloc_get_ptr(obj);
5124 0 : PyObject *py_pRequiredPrivileges;
5125 0 : if (object->pRequiredPrivileges == NULL) {
5126 0 : Py_RETURN_NONE;
5127 : }
5128 0 : if (object->pRequiredPrivileges == NULL) {
5129 0 : py_pRequiredPrivileges = Py_None;
5130 0 : Py_INCREF(py_pRequiredPrivileges);
5131 : } else {
5132 0 : py_pRequiredPrivileges = PyList_New(object->cbRequiredPrivileges);
5133 0 : if (py_pRequiredPrivileges == NULL) {
5134 0 : return NULL;
5135 : }
5136 : {
5137 : int pRequiredPrivileges_cntr_1;
5138 0 : for (pRequiredPrivileges_cntr_1 = 0; pRequiredPrivileges_cntr_1 < (object->cbRequiredPrivileges); pRequiredPrivileges_cntr_1++) {
5139 0 : PyObject *py_pRequiredPrivileges_1;
5140 0 : py_pRequiredPrivileges_1 = PyLong_FromLong((uint16_t)object->pRequiredPrivileges[pRequiredPrivileges_cntr_1]);
5141 0 : PyList_SetItem(py_pRequiredPrivileges, pRequiredPrivileges_cntr_1, py_pRequiredPrivileges_1);
5142 : }
5143 : }
5144 : }
5145 0 : return py_pRequiredPrivileges;
5146 : }
5147 :
5148 0 : static int py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_set_pRequiredPrivileges(PyObject *py_obj, PyObject *value, void *closure)
5149 : {
5150 0 : struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *object = (struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *)pytalloc_get_ptr(py_obj);
5151 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pRequiredPrivileges));
5152 0 : if (value == NULL) {
5153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pRequiredPrivileges");
5154 0 : return -1;
5155 : }
5156 0 : if (value == Py_None) {
5157 0 : object->pRequiredPrivileges = NULL;
5158 : } else {
5159 0 : object->pRequiredPrivileges = NULL;
5160 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5161 : {
5162 0 : int pRequiredPrivileges_cntr_1;
5163 0 : object->pRequiredPrivileges = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pRequiredPrivileges, PyList_GET_SIZE(value));
5164 0 : if (!object->pRequiredPrivileges) { return -1; }
5165 0 : talloc_set_name_const(object->pRequiredPrivileges, "ARRAY: object->pRequiredPrivileges");
5166 0 : for (pRequiredPrivileges_cntr_1 = 0; pRequiredPrivileges_cntr_1 < PyList_GET_SIZE(value); pRequiredPrivileges_cntr_1++) {
5167 0 : if (PyList_GET_ITEM(value, pRequiredPrivileges_cntr_1) == NULL) {
5168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pRequiredPrivileges[pRequiredPrivileges_cntr_1]");
5169 0 : return -1;
5170 : }
5171 : {
5172 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pRequiredPrivileges[pRequiredPrivileges_cntr_1]));
5173 0 : if (PyLong_Check(PyList_GET_ITEM(value, pRequiredPrivileges_cntr_1))) {
5174 0 : unsigned long long test_var;
5175 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pRequiredPrivileges_cntr_1));
5176 0 : if (PyErr_Occurred() != NULL) {
5177 0 : return -1;
5178 : }
5179 0 : if (test_var > uint_max) {
5180 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5181 : PyLong_Type.tp_name, uint_max, test_var);
5182 0 : return -1;
5183 : }
5184 0 : object->pRequiredPrivileges[pRequiredPrivileges_cntr_1] = test_var;
5185 : } else {
5186 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5187 : PyLong_Type.tp_name);
5188 0 : return -1;
5189 : }
5190 : }
5191 : }
5192 : }
5193 : }
5194 0 : return 0;
5195 : }
5196 :
5197 : static PyGetSetDef py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_getsetters[] = {
5198 : {
5199 : .name = discard_const_p(char, "cbRequiredPrivileges"),
5200 : .get = py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_get_cbRequiredPrivileges,
5201 : .set = py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_set_cbRequiredPrivileges,
5202 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5203 : },
5204 : {
5205 : .name = discard_const_p(char, "pRequiredPrivileges"),
5206 : .get = py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_get_pRequiredPrivileges,
5207 : .set = py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_set_pRequiredPrivileges,
5208 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5209 : },
5210 : { .name = NULL }
5211 : };
5212 :
5213 0 : static PyObject *py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5214 : {
5215 0 : return pytalloc_new(struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO, type);
5216 : }
5217 :
5218 :
5219 : static PyTypeObject SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type = {
5220 : PyVarObject_HEAD_INIT(NULL, 0)
5221 : .tp_name = "svcctl.SERVICE_RPC_REQUIRED_PRIVILEGES_INFO",
5222 : .tp_getset = py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_getsetters,
5223 : .tp_methods = NULL,
5224 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5225 : .tp_new = py_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_new,
5226 : };
5227 :
5228 :
5229 0 : static PyObject *py_SERVICE_PRESHUTDOWN_INFO_get_dwPreshutdownTimeout(PyObject *obj, void *closure)
5230 : {
5231 0 : struct SERVICE_PRESHUTDOWN_INFO *object = (struct SERVICE_PRESHUTDOWN_INFO *)pytalloc_get_ptr(obj);
5232 0 : PyObject *py_dwPreshutdownTimeout;
5233 0 : py_dwPreshutdownTimeout = PyLong_FromUnsignedLongLong((uint32_t)object->dwPreshutdownTimeout);
5234 0 : return py_dwPreshutdownTimeout;
5235 : }
5236 :
5237 0 : static int py_SERVICE_PRESHUTDOWN_INFO_set_dwPreshutdownTimeout(PyObject *py_obj, PyObject *value, void *closure)
5238 : {
5239 0 : struct SERVICE_PRESHUTDOWN_INFO *object = (struct SERVICE_PRESHUTDOWN_INFO *)pytalloc_get_ptr(py_obj);
5240 0 : if (value == NULL) {
5241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwPreshutdownTimeout");
5242 0 : return -1;
5243 : }
5244 : {
5245 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwPreshutdownTimeout));
5246 0 : if (PyLong_Check(value)) {
5247 0 : unsigned long long test_var;
5248 0 : test_var = PyLong_AsUnsignedLongLong(value);
5249 0 : if (PyErr_Occurred() != NULL) {
5250 0 : return -1;
5251 : }
5252 0 : if (test_var > uint_max) {
5253 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5254 : PyLong_Type.tp_name, uint_max, test_var);
5255 0 : return -1;
5256 : }
5257 0 : object->dwPreshutdownTimeout = test_var;
5258 : } else {
5259 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5260 : PyLong_Type.tp_name);
5261 0 : return -1;
5262 : }
5263 : }
5264 0 : return 0;
5265 : }
5266 :
5267 : static PyGetSetDef py_SERVICE_PRESHUTDOWN_INFO_getsetters[] = {
5268 : {
5269 : .name = discard_const_p(char, "dwPreshutdownTimeout"),
5270 : .get = py_SERVICE_PRESHUTDOWN_INFO_get_dwPreshutdownTimeout,
5271 : .set = py_SERVICE_PRESHUTDOWN_INFO_set_dwPreshutdownTimeout,
5272 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5273 : },
5274 : { .name = NULL }
5275 : };
5276 :
5277 0 : static PyObject *py_SERVICE_PRESHUTDOWN_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5278 : {
5279 0 : return pytalloc_new(struct SERVICE_PRESHUTDOWN_INFO, type);
5280 : }
5281 :
5282 :
5283 : static PyTypeObject SERVICE_PRESHUTDOWN_INFO_Type = {
5284 : PyVarObject_HEAD_INIT(NULL, 0)
5285 : .tp_name = "svcctl.SERVICE_PRESHUTDOWN_INFO",
5286 : .tp_getset = py_SERVICE_PRESHUTDOWN_INFO_getsetters,
5287 : .tp_methods = NULL,
5288 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5289 : .tp_new = py_SERVICE_PRESHUTDOWN_INFO_new,
5290 : };
5291 :
5292 :
5293 0 : static PyObject *py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_get_dwDataType(PyObject *obj, void *closure)
5294 : {
5295 0 : struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *object = (struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *)pytalloc_get_ptr(obj);
5296 0 : PyObject *py_dwDataType;
5297 0 : py_dwDataType = PyLong_FromUnsignedLongLong((uint32_t)object->dwDataType);
5298 0 : return py_dwDataType;
5299 : }
5300 :
5301 0 : static int py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_set_dwDataType(PyObject *py_obj, PyObject *value, void *closure)
5302 : {
5303 0 : struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *object = (struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *)pytalloc_get_ptr(py_obj);
5304 0 : if (value == NULL) {
5305 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwDataType");
5306 0 : return -1;
5307 : }
5308 : {
5309 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwDataType));
5310 0 : if (PyLong_Check(value)) {
5311 0 : unsigned long long test_var;
5312 0 : test_var = PyLong_AsUnsignedLongLong(value);
5313 0 : if (PyErr_Occurred() != NULL) {
5314 0 : return -1;
5315 : }
5316 0 : if (test_var > uint_max) {
5317 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5318 : PyLong_Type.tp_name, uint_max, test_var);
5319 0 : return -1;
5320 : }
5321 0 : object->dwDataType = test_var;
5322 : } else {
5323 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5324 : PyLong_Type.tp_name);
5325 0 : return -1;
5326 : }
5327 : }
5328 0 : return 0;
5329 : }
5330 :
5331 0 : static PyObject *py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_get_cbData(PyObject *obj, void *closure)
5332 : {
5333 0 : struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *object = (struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *)pytalloc_get_ptr(obj);
5334 0 : PyObject *py_cbData;
5335 0 : py_cbData = PyLong_FromUnsignedLongLong((uint32_t)object->cbData);
5336 0 : return py_cbData;
5337 : }
5338 :
5339 0 : static int py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_set_cbData(PyObject *py_obj, PyObject *value, void *closure)
5340 : {
5341 0 : struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *object = (struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *)pytalloc_get_ptr(py_obj);
5342 0 : if (value == NULL) {
5343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cbData");
5344 0 : return -1;
5345 : }
5346 : {
5347 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cbData));
5348 0 : if (PyLong_Check(value)) {
5349 0 : unsigned long long test_var;
5350 0 : test_var = PyLong_AsUnsignedLongLong(value);
5351 0 : if (PyErr_Occurred() != NULL) {
5352 0 : return -1;
5353 : }
5354 0 : if (test_var > uint_max) {
5355 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5356 : PyLong_Type.tp_name, uint_max, test_var);
5357 0 : return -1;
5358 : }
5359 0 : object->cbData = test_var;
5360 : } else {
5361 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5362 : PyLong_Type.tp_name);
5363 0 : return -1;
5364 : }
5365 : }
5366 0 : return 0;
5367 : }
5368 :
5369 0 : static PyObject *py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_get_pData(PyObject *obj, void *closure)
5370 : {
5371 0 : struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *object = (struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *)pytalloc_get_ptr(obj);
5372 0 : PyObject *py_pData;
5373 0 : if (object->pData == NULL) {
5374 0 : Py_RETURN_NONE;
5375 : }
5376 0 : if (object->pData == NULL) {
5377 0 : py_pData = Py_None;
5378 0 : Py_INCREF(py_pData);
5379 : } else {
5380 0 : py_pData = PyList_New(object->cbData);
5381 0 : if (py_pData == NULL) {
5382 0 : return NULL;
5383 : }
5384 : {
5385 : int pData_cntr_1;
5386 0 : for (pData_cntr_1 = 0; pData_cntr_1 < (object->cbData); pData_cntr_1++) {
5387 0 : PyObject *py_pData_1;
5388 0 : py_pData_1 = PyLong_FromLong((uint16_t)object->pData[pData_cntr_1]);
5389 0 : PyList_SetItem(py_pData, pData_cntr_1, py_pData_1);
5390 : }
5391 : }
5392 : }
5393 0 : return py_pData;
5394 : }
5395 :
5396 0 : static int py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_set_pData(PyObject *py_obj, PyObject *value, void *closure)
5397 : {
5398 0 : struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *object = (struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *)pytalloc_get_ptr(py_obj);
5399 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pData));
5400 0 : if (value == NULL) {
5401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pData");
5402 0 : return -1;
5403 : }
5404 0 : if (value == Py_None) {
5405 0 : object->pData = NULL;
5406 : } else {
5407 0 : object->pData = NULL;
5408 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5409 : {
5410 0 : int pData_cntr_1;
5411 0 : object->pData = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pData, PyList_GET_SIZE(value));
5412 0 : if (!object->pData) { return -1; }
5413 0 : talloc_set_name_const(object->pData, "ARRAY: object->pData");
5414 0 : for (pData_cntr_1 = 0; pData_cntr_1 < PyList_GET_SIZE(value); pData_cntr_1++) {
5415 0 : if (PyList_GET_ITEM(value, pData_cntr_1) == NULL) {
5416 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pData[pData_cntr_1]");
5417 0 : return -1;
5418 : }
5419 : {
5420 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pData[pData_cntr_1]));
5421 0 : if (PyLong_Check(PyList_GET_ITEM(value, pData_cntr_1))) {
5422 0 : unsigned long long test_var;
5423 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pData_cntr_1));
5424 0 : if (PyErr_Occurred() != NULL) {
5425 0 : return -1;
5426 : }
5427 0 : if (test_var > uint_max) {
5428 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5429 : PyLong_Type.tp_name, uint_max, test_var);
5430 0 : return -1;
5431 : }
5432 0 : object->pData[pData_cntr_1] = test_var;
5433 : } else {
5434 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5435 : PyLong_Type.tp_name);
5436 0 : return -1;
5437 : }
5438 : }
5439 : }
5440 : }
5441 : }
5442 0 : return 0;
5443 : }
5444 :
5445 : static PyGetSetDef py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_getsetters[] = {
5446 : {
5447 : .name = discard_const_p(char, "dwDataType"),
5448 : .get = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_get_dwDataType,
5449 : .set = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_set_dwDataType,
5450 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5451 : },
5452 : {
5453 : .name = discard_const_p(char, "cbData"),
5454 : .get = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_get_cbData,
5455 : .set = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_set_cbData,
5456 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5457 : },
5458 : {
5459 : .name = discard_const_p(char, "pData"),
5460 : .get = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_get_pData,
5461 : .set = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_set_pData,
5462 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5463 : },
5464 : { .name = NULL }
5465 : };
5466 :
5467 0 : static PyObject *py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5468 : {
5469 0 : return pytalloc_new(struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM, type);
5470 : }
5471 :
5472 :
5473 : static PyTypeObject SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type = {
5474 : PyVarObject_HEAD_INIT(NULL, 0)
5475 : .tp_name = "svcctl.SERVICE_TRIGGER_SPECIFIC_DATA_ITEM",
5476 : .tp_getset = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_getsetters,
5477 : .tp_methods = NULL,
5478 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5479 : .tp_new = py_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_new,
5480 : };
5481 :
5482 :
5483 0 : static PyObject *py_SERVICE_TRIGGER_get_dwTriggerType(PyObject *obj, void *closure)
5484 : {
5485 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(obj);
5486 0 : PyObject *py_dwTriggerType;
5487 0 : py_dwTriggerType = PyLong_FromUnsignedLongLong((uint32_t)object->dwTriggerType);
5488 0 : return py_dwTriggerType;
5489 : }
5490 :
5491 0 : static int py_SERVICE_TRIGGER_set_dwTriggerType(PyObject *py_obj, PyObject *value, void *closure)
5492 : {
5493 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(py_obj);
5494 0 : if (value == NULL) {
5495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwTriggerType");
5496 0 : return -1;
5497 : }
5498 : {
5499 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwTriggerType));
5500 0 : if (PyLong_Check(value)) {
5501 0 : unsigned long long test_var;
5502 0 : test_var = PyLong_AsUnsignedLongLong(value);
5503 0 : if (PyErr_Occurred() != NULL) {
5504 0 : return -1;
5505 : }
5506 0 : if (test_var > uint_max) {
5507 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5508 : PyLong_Type.tp_name, uint_max, test_var);
5509 0 : return -1;
5510 : }
5511 0 : object->dwTriggerType = test_var;
5512 : } else {
5513 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5514 : PyLong_Type.tp_name);
5515 0 : return -1;
5516 : }
5517 : }
5518 0 : return 0;
5519 : }
5520 :
5521 0 : static PyObject *py_SERVICE_TRIGGER_get_dwAction(PyObject *obj, void *closure)
5522 : {
5523 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(obj);
5524 0 : PyObject *py_dwAction;
5525 0 : py_dwAction = PyLong_FromUnsignedLongLong((uint32_t)object->dwAction);
5526 0 : return py_dwAction;
5527 : }
5528 :
5529 0 : static int py_SERVICE_TRIGGER_set_dwAction(PyObject *py_obj, PyObject *value, void *closure)
5530 : {
5531 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(py_obj);
5532 0 : if (value == NULL) {
5533 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwAction");
5534 0 : return -1;
5535 : }
5536 : {
5537 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwAction));
5538 0 : if (PyLong_Check(value)) {
5539 0 : unsigned long long test_var;
5540 0 : test_var = PyLong_AsUnsignedLongLong(value);
5541 0 : if (PyErr_Occurred() != NULL) {
5542 0 : return -1;
5543 : }
5544 0 : if (test_var > uint_max) {
5545 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5546 : PyLong_Type.tp_name, uint_max, test_var);
5547 0 : return -1;
5548 : }
5549 0 : object->dwAction = test_var;
5550 : } else {
5551 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5552 : PyLong_Type.tp_name);
5553 0 : return -1;
5554 : }
5555 : }
5556 0 : return 0;
5557 : }
5558 :
5559 0 : static PyObject *py_SERVICE_TRIGGER_get_pTriggerSubtype(PyObject *obj, void *closure)
5560 : {
5561 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(obj);
5562 0 : PyObject *py_pTriggerSubtype;
5563 0 : if (object->pTriggerSubtype == NULL) {
5564 0 : Py_RETURN_NONE;
5565 : }
5566 0 : if (object->pTriggerSubtype == NULL) {
5567 0 : py_pTriggerSubtype = Py_None;
5568 0 : Py_INCREF(py_pTriggerSubtype);
5569 : } else {
5570 0 : py_pTriggerSubtype = pytalloc_reference_ex(GUID_Type, object->pTriggerSubtype, object->pTriggerSubtype);
5571 : }
5572 0 : return py_pTriggerSubtype;
5573 : }
5574 :
5575 0 : static int py_SERVICE_TRIGGER_set_pTriggerSubtype(PyObject *py_obj, PyObject *value, void *closure)
5576 : {
5577 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(py_obj);
5578 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pTriggerSubtype));
5579 0 : if (value == NULL) {
5580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pTriggerSubtype");
5581 0 : return -1;
5582 : }
5583 0 : if (value == Py_None) {
5584 0 : object->pTriggerSubtype = NULL;
5585 : } else {
5586 0 : object->pTriggerSubtype = NULL;
5587 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
5588 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5589 0 : PyErr_NoMemory();
5590 0 : return -1;
5591 : }
5592 0 : object->pTriggerSubtype = (struct GUID *)pytalloc_get_ptr(value);
5593 : }
5594 0 : return 0;
5595 : }
5596 :
5597 0 : static PyObject *py_SERVICE_TRIGGER_get_cDataItems(PyObject *obj, void *closure)
5598 : {
5599 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(obj);
5600 0 : PyObject *py_cDataItems;
5601 0 : py_cDataItems = PyLong_FromUnsignedLongLong((uint32_t)object->cDataItems);
5602 0 : return py_cDataItems;
5603 : }
5604 :
5605 0 : static int py_SERVICE_TRIGGER_set_cDataItems(PyObject *py_obj, PyObject *value, void *closure)
5606 : {
5607 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(py_obj);
5608 0 : if (value == NULL) {
5609 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cDataItems");
5610 0 : return -1;
5611 : }
5612 : {
5613 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cDataItems));
5614 0 : if (PyLong_Check(value)) {
5615 0 : unsigned long long test_var;
5616 0 : test_var = PyLong_AsUnsignedLongLong(value);
5617 0 : if (PyErr_Occurred() != NULL) {
5618 0 : return -1;
5619 : }
5620 0 : if (test_var > uint_max) {
5621 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5622 : PyLong_Type.tp_name, uint_max, test_var);
5623 0 : return -1;
5624 : }
5625 0 : object->cDataItems = test_var;
5626 : } else {
5627 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5628 : PyLong_Type.tp_name);
5629 0 : return -1;
5630 : }
5631 : }
5632 0 : return 0;
5633 : }
5634 :
5635 0 : static PyObject *py_SERVICE_TRIGGER_get_pDataItems(PyObject *obj, void *closure)
5636 : {
5637 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(obj);
5638 0 : PyObject *py_pDataItems;
5639 0 : if (object->pDataItems == NULL) {
5640 0 : Py_RETURN_NONE;
5641 : }
5642 0 : if (object->pDataItems == NULL) {
5643 0 : py_pDataItems = Py_None;
5644 0 : Py_INCREF(py_pDataItems);
5645 : } else {
5646 0 : py_pDataItems = PyList_New(object->cDataItems);
5647 0 : if (py_pDataItems == NULL) {
5648 0 : return NULL;
5649 : }
5650 : {
5651 : int pDataItems_cntr_1;
5652 0 : for (pDataItems_cntr_1 = 0; pDataItems_cntr_1 < (object->cDataItems); pDataItems_cntr_1++) {
5653 0 : PyObject *py_pDataItems_1;
5654 0 : py_pDataItems_1 = pytalloc_reference_ex(&SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type, object->pDataItems, &object->pDataItems[pDataItems_cntr_1]);
5655 0 : PyList_SetItem(py_pDataItems, pDataItems_cntr_1, py_pDataItems_1);
5656 : }
5657 : }
5658 : }
5659 0 : return py_pDataItems;
5660 : }
5661 :
5662 0 : static int py_SERVICE_TRIGGER_set_pDataItems(PyObject *py_obj, PyObject *value, void *closure)
5663 : {
5664 0 : struct SERVICE_TRIGGER *object = (struct SERVICE_TRIGGER *)pytalloc_get_ptr(py_obj);
5665 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pDataItems));
5666 0 : if (value == NULL) {
5667 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pDataItems");
5668 0 : return -1;
5669 : }
5670 0 : if (value == Py_None) {
5671 0 : object->pDataItems = NULL;
5672 : } else {
5673 0 : object->pDataItems = NULL;
5674 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5675 : {
5676 0 : int pDataItems_cntr_1;
5677 0 : object->pDataItems = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pDataItems, PyList_GET_SIZE(value));
5678 0 : if (!object->pDataItems) { return -1; }
5679 0 : talloc_set_name_const(object->pDataItems, "ARRAY: object->pDataItems");
5680 0 : for (pDataItems_cntr_1 = 0; pDataItems_cntr_1 < PyList_GET_SIZE(value); pDataItems_cntr_1++) {
5681 0 : if (PyList_GET_ITEM(value, pDataItems_cntr_1) == NULL) {
5682 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pDataItems[pDataItems_cntr_1]");
5683 0 : return -1;
5684 : }
5685 0 : PY_CHECK_TYPE(&SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type, PyList_GET_ITEM(value, pDataItems_cntr_1), return -1;);
5686 0 : if (talloc_reference(object->pDataItems, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, pDataItems_cntr_1))) == NULL) {
5687 0 : PyErr_NoMemory();
5688 0 : return -1;
5689 : }
5690 0 : object->pDataItems[pDataItems_cntr_1] = *(struct SERVICE_TRIGGER_SPECIFIC_DATA_ITEM *)pytalloc_get_ptr(PyList_GET_ITEM(value, pDataItems_cntr_1));
5691 : }
5692 : }
5693 : }
5694 0 : return 0;
5695 : }
5696 :
5697 : static PyGetSetDef py_SERVICE_TRIGGER_getsetters[] = {
5698 : {
5699 : .name = discard_const_p(char, "dwTriggerType"),
5700 : .get = py_SERVICE_TRIGGER_get_dwTriggerType,
5701 : .set = py_SERVICE_TRIGGER_set_dwTriggerType,
5702 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5703 : },
5704 : {
5705 : .name = discard_const_p(char, "dwAction"),
5706 : .get = py_SERVICE_TRIGGER_get_dwAction,
5707 : .set = py_SERVICE_TRIGGER_set_dwAction,
5708 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5709 : },
5710 : {
5711 : .name = discard_const_p(char, "pTriggerSubtype"),
5712 : .get = py_SERVICE_TRIGGER_get_pTriggerSubtype,
5713 : .set = py_SERVICE_TRIGGER_set_pTriggerSubtype,
5714 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
5715 : },
5716 : {
5717 : .name = discard_const_p(char, "cDataItems"),
5718 : .get = py_SERVICE_TRIGGER_get_cDataItems,
5719 : .set = py_SERVICE_TRIGGER_set_cDataItems,
5720 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5721 : },
5722 : {
5723 : .name = discard_const_p(char, "pDataItems"),
5724 : .get = py_SERVICE_TRIGGER_get_pDataItems,
5725 : .set = py_SERVICE_TRIGGER_set_pDataItems,
5726 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_TRIGGER_SPECIFIC_DATA_ITEM")
5727 : },
5728 : { .name = NULL }
5729 : };
5730 :
5731 0 : static PyObject *py_SERVICE_TRIGGER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5732 : {
5733 0 : return pytalloc_new(struct SERVICE_TRIGGER, type);
5734 : }
5735 :
5736 :
5737 : static PyTypeObject SERVICE_TRIGGER_Type = {
5738 : PyVarObject_HEAD_INIT(NULL, 0)
5739 : .tp_name = "svcctl.SERVICE_TRIGGER",
5740 : .tp_getset = py_SERVICE_TRIGGER_getsetters,
5741 : .tp_methods = NULL,
5742 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5743 : .tp_new = py_SERVICE_TRIGGER_new,
5744 : };
5745 :
5746 :
5747 0 : static PyObject *py_SERVICE_TRIGGER_INFO_get_cTriggers(PyObject *obj, void *closure)
5748 : {
5749 0 : struct SERVICE_TRIGGER_INFO *object = (struct SERVICE_TRIGGER_INFO *)pytalloc_get_ptr(obj);
5750 0 : PyObject *py_cTriggers;
5751 0 : py_cTriggers = PyLong_FromUnsignedLongLong((uint32_t)object->cTriggers);
5752 0 : return py_cTriggers;
5753 : }
5754 :
5755 0 : static int py_SERVICE_TRIGGER_INFO_set_cTriggers(PyObject *py_obj, PyObject *value, void *closure)
5756 : {
5757 0 : struct SERVICE_TRIGGER_INFO *object = (struct SERVICE_TRIGGER_INFO *)pytalloc_get_ptr(py_obj);
5758 0 : if (value == NULL) {
5759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cTriggers");
5760 0 : return -1;
5761 : }
5762 : {
5763 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cTriggers));
5764 0 : if (PyLong_Check(value)) {
5765 0 : unsigned long long test_var;
5766 0 : test_var = PyLong_AsUnsignedLongLong(value);
5767 0 : if (PyErr_Occurred() != NULL) {
5768 0 : return -1;
5769 : }
5770 0 : if (test_var > uint_max) {
5771 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5772 : PyLong_Type.tp_name, uint_max, test_var);
5773 0 : return -1;
5774 : }
5775 0 : object->cTriggers = test_var;
5776 : } else {
5777 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5778 : PyLong_Type.tp_name);
5779 0 : return -1;
5780 : }
5781 : }
5782 0 : return 0;
5783 : }
5784 :
5785 0 : static PyObject *py_SERVICE_TRIGGER_INFO_get_pTriggers(PyObject *obj, void *closure)
5786 : {
5787 0 : struct SERVICE_TRIGGER_INFO *object = (struct SERVICE_TRIGGER_INFO *)pytalloc_get_ptr(obj);
5788 0 : PyObject *py_pTriggers;
5789 0 : if (object->pTriggers == NULL) {
5790 0 : Py_RETURN_NONE;
5791 : }
5792 0 : if (object->pTriggers == NULL) {
5793 0 : py_pTriggers = Py_None;
5794 0 : Py_INCREF(py_pTriggers);
5795 : } else {
5796 0 : py_pTriggers = PyList_New(object->cTriggers);
5797 0 : if (py_pTriggers == NULL) {
5798 0 : return NULL;
5799 : }
5800 : {
5801 : int pTriggers_cntr_1;
5802 0 : for (pTriggers_cntr_1 = 0; pTriggers_cntr_1 < (object->cTriggers); pTriggers_cntr_1++) {
5803 0 : PyObject *py_pTriggers_1;
5804 0 : py_pTriggers_1 = pytalloc_reference_ex(&SERVICE_TRIGGER_Type, object->pTriggers, &object->pTriggers[pTriggers_cntr_1]);
5805 0 : PyList_SetItem(py_pTriggers, pTriggers_cntr_1, py_pTriggers_1);
5806 : }
5807 : }
5808 : }
5809 0 : return py_pTriggers;
5810 : }
5811 :
5812 0 : static int py_SERVICE_TRIGGER_INFO_set_pTriggers(PyObject *py_obj, PyObject *value, void *closure)
5813 : {
5814 0 : struct SERVICE_TRIGGER_INFO *object = (struct SERVICE_TRIGGER_INFO *)pytalloc_get_ptr(py_obj);
5815 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pTriggers));
5816 0 : if (value == NULL) {
5817 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pTriggers");
5818 0 : return -1;
5819 : }
5820 0 : if (value == Py_None) {
5821 0 : object->pTriggers = NULL;
5822 : } else {
5823 0 : object->pTriggers = NULL;
5824 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5825 : {
5826 0 : int pTriggers_cntr_1;
5827 0 : object->pTriggers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pTriggers, PyList_GET_SIZE(value));
5828 0 : if (!object->pTriggers) { return -1; }
5829 0 : talloc_set_name_const(object->pTriggers, "ARRAY: object->pTriggers");
5830 0 : for (pTriggers_cntr_1 = 0; pTriggers_cntr_1 < PyList_GET_SIZE(value); pTriggers_cntr_1++) {
5831 0 : if (PyList_GET_ITEM(value, pTriggers_cntr_1) == NULL) {
5832 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pTriggers[pTriggers_cntr_1]");
5833 0 : return -1;
5834 : }
5835 0 : PY_CHECK_TYPE(&SERVICE_TRIGGER_Type, PyList_GET_ITEM(value, pTriggers_cntr_1), return -1;);
5836 0 : if (talloc_reference(object->pTriggers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, pTriggers_cntr_1))) == NULL) {
5837 0 : PyErr_NoMemory();
5838 0 : return -1;
5839 : }
5840 0 : object->pTriggers[pTriggers_cntr_1] = *(struct SERVICE_TRIGGER *)pytalloc_get_ptr(PyList_GET_ITEM(value, pTriggers_cntr_1));
5841 : }
5842 : }
5843 : }
5844 0 : return 0;
5845 : }
5846 :
5847 0 : static PyObject *py_SERVICE_TRIGGER_INFO_get_pReserved(PyObject *obj, void *closure)
5848 : {
5849 0 : struct SERVICE_TRIGGER_INFO *object = (struct SERVICE_TRIGGER_INFO *)pytalloc_get_ptr(obj);
5850 0 : PyObject *py_pReserved;
5851 0 : if (object->pReserved == NULL) {
5852 0 : Py_RETURN_NONE;
5853 : }
5854 0 : if (object->pReserved == NULL) {
5855 0 : py_pReserved = Py_None;
5856 0 : Py_INCREF(py_pReserved);
5857 : } else {
5858 0 : py_pReserved = PyLong_FromLong((uint16_t)*object->pReserved);
5859 : }
5860 0 : return py_pReserved;
5861 : }
5862 :
5863 0 : static int py_SERVICE_TRIGGER_INFO_set_pReserved(PyObject *py_obj, PyObject *value, void *closure)
5864 : {
5865 0 : struct SERVICE_TRIGGER_INFO *object = (struct SERVICE_TRIGGER_INFO *)pytalloc_get_ptr(py_obj);
5866 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pReserved));
5867 0 : if (value == NULL) {
5868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pReserved");
5869 0 : return -1;
5870 : }
5871 0 : if (value == Py_None) {
5872 0 : object->pReserved = NULL;
5873 : } else {
5874 0 : object->pReserved = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pReserved);
5875 0 : if (object->pReserved == NULL) {
5876 0 : PyErr_NoMemory();
5877 0 : return -1;
5878 : }
5879 : {
5880 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->pReserved));
5881 0 : if (PyLong_Check(value)) {
5882 0 : unsigned long long test_var;
5883 0 : test_var = PyLong_AsUnsignedLongLong(value);
5884 0 : if (PyErr_Occurred() != NULL) {
5885 0 : return -1;
5886 : }
5887 0 : if (test_var > uint_max) {
5888 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5889 : PyLong_Type.tp_name, uint_max, test_var);
5890 0 : return -1;
5891 : }
5892 0 : *object->pReserved = test_var;
5893 : } else {
5894 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5895 : PyLong_Type.tp_name);
5896 0 : return -1;
5897 : }
5898 : }
5899 : }
5900 0 : return 0;
5901 : }
5902 :
5903 : static PyGetSetDef py_SERVICE_TRIGGER_INFO_getsetters[] = {
5904 : {
5905 : .name = discard_const_p(char, "cTriggers"),
5906 : .get = py_SERVICE_TRIGGER_INFO_get_cTriggers,
5907 : .set = py_SERVICE_TRIGGER_INFO_set_cTriggers,
5908 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5909 : },
5910 : {
5911 : .name = discard_const_p(char, "pTriggers"),
5912 : .get = py_SERVICE_TRIGGER_INFO_get_pTriggers,
5913 : .set = py_SERVICE_TRIGGER_INFO_set_pTriggers,
5914 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_TRIGGER")
5915 : },
5916 : {
5917 : .name = discard_const_p(char, "pReserved"),
5918 : .get = py_SERVICE_TRIGGER_INFO_get_pReserved,
5919 : .set = py_SERVICE_TRIGGER_INFO_set_pReserved,
5920 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5921 : },
5922 : { .name = NULL }
5923 : };
5924 :
5925 0 : static PyObject *py_SERVICE_TRIGGER_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5926 : {
5927 0 : return pytalloc_new(struct SERVICE_TRIGGER_INFO, type);
5928 : }
5929 :
5930 :
5931 : static PyTypeObject SERVICE_TRIGGER_INFO_Type = {
5932 : PyVarObject_HEAD_INIT(NULL, 0)
5933 : .tp_name = "svcctl.SERVICE_TRIGGER_INFO",
5934 : .tp_getset = py_SERVICE_TRIGGER_INFO_getsetters,
5935 : .tp_methods = NULL,
5936 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5937 : .tp_new = py_SERVICE_TRIGGER_INFO_new,
5938 : };
5939 :
5940 :
5941 0 : static PyObject *py_SERVICE_PREFERRED_NODE_INFO_get_usPreferredNode(PyObject *obj, void *closure)
5942 : {
5943 0 : struct SERVICE_PREFERRED_NODE_INFO *object = (struct SERVICE_PREFERRED_NODE_INFO *)pytalloc_get_ptr(obj);
5944 0 : PyObject *py_usPreferredNode;
5945 0 : py_usPreferredNode = PyLong_FromLong((uint16_t)object->usPreferredNode);
5946 0 : return py_usPreferredNode;
5947 : }
5948 :
5949 0 : static int py_SERVICE_PREFERRED_NODE_INFO_set_usPreferredNode(PyObject *py_obj, PyObject *value, void *closure)
5950 : {
5951 0 : struct SERVICE_PREFERRED_NODE_INFO *object = (struct SERVICE_PREFERRED_NODE_INFO *)pytalloc_get_ptr(py_obj);
5952 0 : if (value == NULL) {
5953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->usPreferredNode");
5954 0 : return -1;
5955 : }
5956 : {
5957 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->usPreferredNode));
5958 0 : if (PyLong_Check(value)) {
5959 0 : unsigned long long test_var;
5960 0 : test_var = PyLong_AsUnsignedLongLong(value);
5961 0 : if (PyErr_Occurred() != NULL) {
5962 0 : return -1;
5963 : }
5964 0 : if (test_var > uint_max) {
5965 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5966 : PyLong_Type.tp_name, uint_max, test_var);
5967 0 : return -1;
5968 : }
5969 0 : object->usPreferredNode = test_var;
5970 : } else {
5971 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5972 : PyLong_Type.tp_name);
5973 0 : return -1;
5974 : }
5975 : }
5976 0 : return 0;
5977 : }
5978 :
5979 0 : static PyObject *py_SERVICE_PREFERRED_NODE_INFO_get_fDelete(PyObject *obj, void *closure)
5980 : {
5981 0 : struct SERVICE_PREFERRED_NODE_INFO *object = (struct SERVICE_PREFERRED_NODE_INFO *)pytalloc_get_ptr(obj);
5982 0 : PyObject *py_fDelete;
5983 0 : py_fDelete = PyLong_FromUnsignedLongLong((uint32_t)object->fDelete);
5984 0 : return py_fDelete;
5985 : }
5986 :
5987 0 : static int py_SERVICE_PREFERRED_NODE_INFO_set_fDelete(PyObject *py_obj, PyObject *value, void *closure)
5988 : {
5989 0 : struct SERVICE_PREFERRED_NODE_INFO *object = (struct SERVICE_PREFERRED_NODE_INFO *)pytalloc_get_ptr(py_obj);
5990 0 : if (value == NULL) {
5991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fDelete");
5992 0 : return -1;
5993 : }
5994 : {
5995 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fDelete));
5996 0 : if (PyLong_Check(value)) {
5997 0 : unsigned long long test_var;
5998 0 : test_var = PyLong_AsUnsignedLongLong(value);
5999 0 : if (PyErr_Occurred() != NULL) {
6000 0 : return -1;
6001 : }
6002 0 : if (test_var > uint_max) {
6003 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6004 : PyLong_Type.tp_name, uint_max, test_var);
6005 0 : return -1;
6006 : }
6007 0 : object->fDelete = test_var;
6008 : } else {
6009 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6010 : PyLong_Type.tp_name);
6011 0 : return -1;
6012 : }
6013 : }
6014 0 : return 0;
6015 : }
6016 :
6017 : static PyGetSetDef py_SERVICE_PREFERRED_NODE_INFO_getsetters[] = {
6018 : {
6019 : .name = discard_const_p(char, "usPreferredNode"),
6020 : .get = py_SERVICE_PREFERRED_NODE_INFO_get_usPreferredNode,
6021 : .set = py_SERVICE_PREFERRED_NODE_INFO_set_usPreferredNode,
6022 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6023 : },
6024 : {
6025 : .name = discard_const_p(char, "fDelete"),
6026 : .get = py_SERVICE_PREFERRED_NODE_INFO_get_fDelete,
6027 : .set = py_SERVICE_PREFERRED_NODE_INFO_set_fDelete,
6028 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6029 : },
6030 : { .name = NULL }
6031 : };
6032 :
6033 0 : static PyObject *py_SERVICE_PREFERRED_NODE_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6034 : {
6035 0 : return pytalloc_new(struct SERVICE_PREFERRED_NODE_INFO, type);
6036 : }
6037 :
6038 :
6039 : static PyTypeObject SERVICE_PREFERRED_NODE_INFO_Type = {
6040 : PyVarObject_HEAD_INIT(NULL, 0)
6041 : .tp_name = "svcctl.SERVICE_PREFERRED_NODE_INFO",
6042 : .tp_getset = py_SERVICE_PREFERRED_NODE_INFO_getsetters,
6043 : .tp_methods = NULL,
6044 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6045 : .tp_new = py_SERVICE_PREFERRED_NODE_INFO_new,
6046 : };
6047 :
6048 0 : static PyObject *py_import_SC_RPC_CONFIG_INFOW_u(TALLOC_CTX *mem_ctx, int level, union SC_RPC_CONFIG_INFOW_u *in)
6049 : {
6050 0 : PyObject *ret;
6051 :
6052 0 : switch (level) {
6053 0 : case 1:
6054 0 : if (in->psd == NULL) {
6055 0 : ret = Py_None;
6056 0 : Py_INCREF(ret);
6057 : } else {
6058 0 : ret = pytalloc_reference_ex(&SERVICE_DESCRIPTIONW_Type, in->psd, in->psd);
6059 : }
6060 0 : return ret;
6061 :
6062 0 : case 2:
6063 0 : if (in->psfa == NULL) {
6064 0 : ret = Py_None;
6065 0 : Py_INCREF(ret);
6066 : } else {
6067 0 : ret = pytalloc_reference_ex(&SERVICE_FAILURE_ACTIONSW_Type, in->psfa, in->psfa);
6068 : }
6069 0 : return ret;
6070 :
6071 0 : case 3:
6072 0 : if (in->psda == NULL) {
6073 0 : ret = Py_None;
6074 0 : Py_INCREF(ret);
6075 : } else {
6076 0 : ret = pytalloc_reference_ex(&SERVICE_DELAYED_AUTO_START_INFO_Type, in->psda, in->psda);
6077 : }
6078 0 : return ret;
6079 :
6080 0 : case 4:
6081 0 : if (in->psfaf == NULL) {
6082 0 : ret = Py_None;
6083 0 : Py_INCREF(ret);
6084 : } else {
6085 0 : ret = pytalloc_reference_ex(&SERVICE_FAILURE_ACTIONS_FLAG_Type, in->psfaf, in->psfaf);
6086 : }
6087 0 : return ret;
6088 :
6089 0 : case 5:
6090 0 : if (in->pssid == NULL) {
6091 0 : ret = Py_None;
6092 0 : Py_INCREF(ret);
6093 : } else {
6094 0 : ret = pytalloc_reference_ex(&SERVICE_SID_INFO_Type, in->pssid, in->pssid);
6095 : }
6096 0 : return ret;
6097 :
6098 0 : case 6:
6099 0 : if (in->psrp == NULL) {
6100 0 : ret = Py_None;
6101 0 : Py_INCREF(ret);
6102 : } else {
6103 0 : ret = pytalloc_reference_ex(&SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type, in->psrp, in->psrp);
6104 : }
6105 0 : return ret;
6106 :
6107 0 : case 7:
6108 0 : if (in->psps == NULL) {
6109 0 : ret = Py_None;
6110 0 : Py_INCREF(ret);
6111 : } else {
6112 0 : ret = pytalloc_reference_ex(&SERVICE_PRESHUTDOWN_INFO_Type, in->psps, in->psps);
6113 : }
6114 0 : return ret;
6115 :
6116 0 : case 8:
6117 0 : if (in->psti == NULL) {
6118 0 : ret = Py_None;
6119 0 : Py_INCREF(ret);
6120 : } else {
6121 0 : ret = pytalloc_reference_ex(&SERVICE_TRIGGER_INFO_Type, in->psti, in->psti);
6122 : }
6123 0 : return ret;
6124 :
6125 0 : case 9:
6126 0 : if (in->pspn == NULL) {
6127 0 : ret = Py_None;
6128 0 : Py_INCREF(ret);
6129 : } else {
6130 0 : ret = pytalloc_reference_ex(&SERVICE_PREFERRED_NODE_INFO_Type, in->pspn, in->pspn);
6131 : }
6132 0 : return ret;
6133 :
6134 : }
6135 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
6136 0 : return NULL;
6137 : }
6138 :
6139 0 : static union SC_RPC_CONFIG_INFOW_u *py_export_SC_RPC_CONFIG_INFOW_u(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6140 : {
6141 0 : union SC_RPC_CONFIG_INFOW_u *ret = talloc_zero(mem_ctx, union SC_RPC_CONFIG_INFOW_u);
6142 0 : switch (level) {
6143 0 : case 1:
6144 0 : if (in == NULL) {
6145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psd");
6146 0 : talloc_free(ret); return NULL;
6147 : }
6148 0 : if (in == Py_None) {
6149 0 : ret->psd = NULL;
6150 : } else {
6151 0 : ret->psd = NULL;
6152 0 : PY_CHECK_TYPE(&SERVICE_DESCRIPTIONW_Type, in, talloc_free(ret); return NULL;);
6153 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6154 0 : PyErr_NoMemory();
6155 0 : talloc_free(ret); return NULL;
6156 : }
6157 0 : ret->psd = (struct SERVICE_DESCRIPTIONW *)pytalloc_get_ptr(in);
6158 : }
6159 0 : break;
6160 :
6161 0 : case 2:
6162 0 : if (in == NULL) {
6163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psfa");
6164 0 : talloc_free(ret); return NULL;
6165 : }
6166 0 : if (in == Py_None) {
6167 0 : ret->psfa = NULL;
6168 : } else {
6169 0 : ret->psfa = NULL;
6170 0 : PY_CHECK_TYPE(&SERVICE_FAILURE_ACTIONSW_Type, in, talloc_free(ret); return NULL;);
6171 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6172 0 : PyErr_NoMemory();
6173 0 : talloc_free(ret); return NULL;
6174 : }
6175 0 : ret->psfa = (struct SERVICE_FAILURE_ACTIONSW *)pytalloc_get_ptr(in);
6176 : }
6177 0 : break;
6178 :
6179 0 : case 3:
6180 0 : if (in == NULL) {
6181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psda");
6182 0 : talloc_free(ret); return NULL;
6183 : }
6184 0 : if (in == Py_None) {
6185 0 : ret->psda = NULL;
6186 : } else {
6187 0 : ret->psda = NULL;
6188 0 : PY_CHECK_TYPE(&SERVICE_DELAYED_AUTO_START_INFO_Type, in, talloc_free(ret); return NULL;);
6189 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6190 0 : PyErr_NoMemory();
6191 0 : talloc_free(ret); return NULL;
6192 : }
6193 0 : ret->psda = (struct SERVICE_DELAYED_AUTO_START_INFO *)pytalloc_get_ptr(in);
6194 : }
6195 0 : break;
6196 :
6197 0 : case 4:
6198 0 : if (in == NULL) {
6199 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psfaf");
6200 0 : talloc_free(ret); return NULL;
6201 : }
6202 0 : if (in == Py_None) {
6203 0 : ret->psfaf = NULL;
6204 : } else {
6205 0 : ret->psfaf = NULL;
6206 0 : PY_CHECK_TYPE(&SERVICE_FAILURE_ACTIONS_FLAG_Type, in, talloc_free(ret); return NULL;);
6207 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6208 0 : PyErr_NoMemory();
6209 0 : talloc_free(ret); return NULL;
6210 : }
6211 0 : ret->psfaf = (struct SERVICE_FAILURE_ACTIONS_FLAG *)pytalloc_get_ptr(in);
6212 : }
6213 0 : break;
6214 :
6215 0 : case 5:
6216 0 : if (in == NULL) {
6217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pssid");
6218 0 : talloc_free(ret); return NULL;
6219 : }
6220 0 : if (in == Py_None) {
6221 0 : ret->pssid = NULL;
6222 : } else {
6223 0 : ret->pssid = NULL;
6224 0 : PY_CHECK_TYPE(&SERVICE_SID_INFO_Type, in, talloc_free(ret); return NULL;);
6225 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6226 0 : PyErr_NoMemory();
6227 0 : talloc_free(ret); return NULL;
6228 : }
6229 0 : ret->pssid = (struct SERVICE_SID_INFO *)pytalloc_get_ptr(in);
6230 : }
6231 0 : break;
6232 :
6233 0 : case 6:
6234 0 : if (in == NULL) {
6235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psrp");
6236 0 : talloc_free(ret); return NULL;
6237 : }
6238 0 : if (in == Py_None) {
6239 0 : ret->psrp = NULL;
6240 : } else {
6241 0 : ret->psrp = NULL;
6242 0 : PY_CHECK_TYPE(&SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type, in, talloc_free(ret); return NULL;);
6243 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6244 0 : PyErr_NoMemory();
6245 0 : talloc_free(ret); return NULL;
6246 : }
6247 0 : ret->psrp = (struct SERVICE_RPC_REQUIRED_PRIVILEGES_INFO *)pytalloc_get_ptr(in);
6248 : }
6249 0 : break;
6250 :
6251 0 : case 7:
6252 0 : if (in == NULL) {
6253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psps");
6254 0 : talloc_free(ret); return NULL;
6255 : }
6256 0 : if (in == Py_None) {
6257 0 : ret->psps = NULL;
6258 : } else {
6259 0 : ret->psps = NULL;
6260 0 : PY_CHECK_TYPE(&SERVICE_PRESHUTDOWN_INFO_Type, in, talloc_free(ret); return NULL;);
6261 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6262 0 : PyErr_NoMemory();
6263 0 : talloc_free(ret); return NULL;
6264 : }
6265 0 : ret->psps = (struct SERVICE_PRESHUTDOWN_INFO *)pytalloc_get_ptr(in);
6266 : }
6267 0 : break;
6268 :
6269 0 : case 8:
6270 0 : if (in == NULL) {
6271 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->psti");
6272 0 : talloc_free(ret); return NULL;
6273 : }
6274 0 : if (in == Py_None) {
6275 0 : ret->psti = NULL;
6276 : } else {
6277 0 : ret->psti = NULL;
6278 0 : PY_CHECK_TYPE(&SERVICE_TRIGGER_INFO_Type, in, talloc_free(ret); return NULL;);
6279 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6280 0 : PyErr_NoMemory();
6281 0 : talloc_free(ret); return NULL;
6282 : }
6283 0 : ret->psti = (struct SERVICE_TRIGGER_INFO *)pytalloc_get_ptr(in);
6284 : }
6285 0 : break;
6286 :
6287 0 : case 9:
6288 0 : if (in == NULL) {
6289 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pspn");
6290 0 : talloc_free(ret); return NULL;
6291 : }
6292 0 : if (in == Py_None) {
6293 0 : ret->pspn = NULL;
6294 : } else {
6295 0 : ret->pspn = NULL;
6296 0 : PY_CHECK_TYPE(&SERVICE_PREFERRED_NODE_INFO_Type, in, talloc_free(ret); return NULL;);
6297 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6298 0 : PyErr_NoMemory();
6299 0 : talloc_free(ret); return NULL;
6300 : }
6301 0 : ret->pspn = (struct SERVICE_PREFERRED_NODE_INFO *)pytalloc_get_ptr(in);
6302 : }
6303 0 : break;
6304 :
6305 0 : default:
6306 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
6307 0 : talloc_free(ret);
6308 0 : ret = NULL;
6309 : }
6310 :
6311 0 : return ret;
6312 : }
6313 :
6314 0 : static PyObject *py_SC_RPC_CONFIG_INFOW_u_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6315 : {
6316 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
6317 0 : PyObject *mem_ctx_obj = NULL;
6318 0 : TALLOC_CTX *mem_ctx = NULL;
6319 0 : int level = 0;
6320 0 : PyObject *in_obj = NULL;
6321 0 : union SC_RPC_CONFIG_INFOW_u *in = NULL;
6322 :
6323 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
6324 : discard_const_p(char *, kwnames),
6325 : &mem_ctx_obj,
6326 : &level,
6327 : &in_obj)) {
6328 0 : return NULL;
6329 : }
6330 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
6331 0 : if (mem_ctx == NULL) {
6332 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
6333 0 : return NULL;
6334 : }
6335 0 : in = (union SC_RPC_CONFIG_INFOW_u *)pytalloc_get_ptr(in_obj);
6336 0 : if (in == NULL) {
6337 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union SC_RPC_CONFIG_INFOW_u!");
6338 0 : return NULL;
6339 : }
6340 :
6341 0 : return py_import_SC_RPC_CONFIG_INFOW_u(mem_ctx, level, in);
6342 : }
6343 :
6344 0 : static PyObject *py_SC_RPC_CONFIG_INFOW_u_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6345 : {
6346 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
6347 0 : PyObject *mem_ctx_obj = NULL;
6348 0 : TALLOC_CTX *mem_ctx = NULL;
6349 0 : int level = 0;
6350 0 : PyObject *in = NULL;
6351 0 : union SC_RPC_CONFIG_INFOW_u *out = NULL;
6352 :
6353 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
6354 : discard_const_p(char *, kwnames),
6355 : &mem_ctx_obj,
6356 : &level,
6357 : &in)) {
6358 0 : return NULL;
6359 : }
6360 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
6361 0 : if (mem_ctx == NULL) {
6362 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
6363 0 : return NULL;
6364 : }
6365 :
6366 0 : out = py_export_SC_RPC_CONFIG_INFOW_u(mem_ctx, level, in);
6367 0 : if (out == NULL) {
6368 0 : return NULL;
6369 : }
6370 :
6371 0 : return pytalloc_GenericObject_reference(out);
6372 : }
6373 :
6374 : static PyMethodDef py_SC_RPC_CONFIG_INFOW_u_methods[] = {
6375 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_CONFIG_INFOW_u_import),
6376 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
6377 : "T.__import__(mem_ctx, level, in) => ret." },
6378 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SC_RPC_CONFIG_INFOW_u_export),
6379 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
6380 : "T.__export__(mem_ctx, level, in) => ret." },
6381 : { NULL, NULL, 0, NULL }
6382 : };
6383 :
6384 0 : static PyObject *py_SC_RPC_CONFIG_INFOW_u_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6385 : {
6386 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
6387 0 : return NULL;
6388 : }
6389 :
6390 :
6391 : static PyTypeObject SC_RPC_CONFIG_INFOW_u_Type = {
6392 : PyVarObject_HEAD_INIT(NULL, 0)
6393 : .tp_name = "svcctl.SC_RPC_CONFIG_INFOW_u",
6394 : .tp_getset = NULL,
6395 : .tp_methods = py_SC_RPC_CONFIG_INFOW_u_methods,
6396 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6397 : .tp_new = py_SC_RPC_CONFIG_INFOW_u_new,
6398 : };
6399 :
6400 :
6401 0 : static PyObject *py_SC_RPC_CONFIG_INFOW_get_dwInfoLevel(PyObject *obj, void *closure)
6402 : {
6403 0 : struct SC_RPC_CONFIG_INFOW *object = (struct SC_RPC_CONFIG_INFOW *)pytalloc_get_ptr(obj);
6404 0 : PyObject *py_dwInfoLevel;
6405 0 : py_dwInfoLevel = PyLong_FromUnsignedLongLong((uint32_t)object->dwInfoLevel);
6406 0 : return py_dwInfoLevel;
6407 : }
6408 :
6409 0 : static int py_SC_RPC_CONFIG_INFOW_set_dwInfoLevel(PyObject *py_obj, PyObject *value, void *closure)
6410 : {
6411 0 : struct SC_RPC_CONFIG_INFOW *object = (struct SC_RPC_CONFIG_INFOW *)pytalloc_get_ptr(py_obj);
6412 0 : if (value == NULL) {
6413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dwInfoLevel");
6414 0 : return -1;
6415 : }
6416 : {
6417 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwInfoLevel));
6418 0 : if (PyLong_Check(value)) {
6419 0 : unsigned long long test_var;
6420 0 : test_var = PyLong_AsUnsignedLongLong(value);
6421 0 : if (PyErr_Occurred() != NULL) {
6422 0 : return -1;
6423 : }
6424 0 : if (test_var > uint_max) {
6425 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6426 : PyLong_Type.tp_name, uint_max, test_var);
6427 0 : return -1;
6428 : }
6429 0 : object->dwInfoLevel = test_var;
6430 : } else {
6431 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6432 : PyLong_Type.tp_name);
6433 0 : return -1;
6434 : }
6435 : }
6436 0 : return 0;
6437 : }
6438 :
6439 0 : static PyObject *py_SC_RPC_CONFIG_INFOW_get_u(PyObject *obj, void *closure)
6440 : {
6441 0 : struct SC_RPC_CONFIG_INFOW *object = (struct SC_RPC_CONFIG_INFOW *)pytalloc_get_ptr(obj);
6442 0 : PyObject *py_u;
6443 0 : py_u = pyrpc_import_union(&SC_RPC_CONFIG_INFOW_u_Type, pytalloc_get_mem_ctx(obj), object->dwInfoLevel, &object->u, "union SC_RPC_CONFIG_INFOW_u");
6444 0 : if (py_u == NULL) {
6445 0 : return NULL;
6446 : }
6447 0 : return py_u;
6448 : }
6449 :
6450 0 : static int py_SC_RPC_CONFIG_INFOW_set_u(PyObject *py_obj, PyObject *value, void *closure)
6451 : {
6452 0 : struct SC_RPC_CONFIG_INFOW *object = (struct SC_RPC_CONFIG_INFOW *)pytalloc_get_ptr(py_obj);
6453 0 : if (value == NULL) {
6454 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->u");
6455 0 : return -1;
6456 : }
6457 : {
6458 0 : union SC_RPC_CONFIG_INFOW_u *u_switch_0;
6459 0 : u_switch_0 = (union SC_RPC_CONFIG_INFOW_u *)pyrpc_export_union(&SC_RPC_CONFIG_INFOW_u_Type, pytalloc_get_mem_ctx(py_obj), object->dwInfoLevel, value, "union SC_RPC_CONFIG_INFOW_u");
6460 0 : if (u_switch_0 == NULL) {
6461 0 : return -1;
6462 : }
6463 0 : object->u = *u_switch_0;
6464 : }
6465 0 : return 0;
6466 : }
6467 :
6468 : static PyGetSetDef py_SC_RPC_CONFIG_INFOW_getsetters[] = {
6469 : {
6470 : .name = discard_const_p(char, "dwInfoLevel"),
6471 : .get = py_SC_RPC_CONFIG_INFOW_get_dwInfoLevel,
6472 : .set = py_SC_RPC_CONFIG_INFOW_set_dwInfoLevel,
6473 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6474 : },
6475 : {
6476 : .name = discard_const_p(char, "u"),
6477 : .get = py_SC_RPC_CONFIG_INFOW_get_u,
6478 : .set = py_SC_RPC_CONFIG_INFOW_set_u,
6479 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_CONFIG_INFOW_u")
6480 : },
6481 : { .name = NULL }
6482 : };
6483 :
6484 0 : static PyObject *py_SC_RPC_CONFIG_INFOW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6485 : {
6486 0 : return pytalloc_new(struct SC_RPC_CONFIG_INFOW, type);
6487 : }
6488 :
6489 :
6490 : static PyTypeObject SC_RPC_CONFIG_INFOW_Type = {
6491 : PyVarObject_HEAD_INIT(NULL, 0)
6492 : .tp_name = "svcctl.SC_RPC_CONFIG_INFOW",
6493 : .tp_getset = py_SC_RPC_CONFIG_INFOW_getsetters,
6494 : .tp_methods = NULL,
6495 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6496 : .tp_new = py_SC_RPC_CONFIG_INFOW_new,
6497 : };
6498 :
6499 :
6500 :
6501 0 : static PyObject *py_svcctl_CloseServiceHandle_in_get_handle(PyObject *obj, void *closure)
6502 : {
6503 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
6504 0 : PyObject *py_handle;
6505 0 : if (object->in.handle == NULL) {
6506 0 : Py_RETURN_NONE;
6507 : }
6508 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
6509 0 : return py_handle;
6510 : }
6511 :
6512 0 : static int py_svcctl_CloseServiceHandle_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
6513 : {
6514 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
6515 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
6516 0 : if (value == NULL) {
6517 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
6518 0 : return -1;
6519 : }
6520 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
6521 0 : if (object->in.handle == NULL) {
6522 0 : PyErr_NoMemory();
6523 0 : return -1;
6524 : }
6525 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
6526 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6527 0 : PyErr_NoMemory();
6528 0 : return -1;
6529 : }
6530 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
6531 0 : return 0;
6532 : }
6533 :
6534 0 : static PyObject *py_svcctl_CloseServiceHandle_out_get_handle(PyObject *obj, void *closure)
6535 : {
6536 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
6537 0 : PyObject *py_handle;
6538 0 : if (object->out.handle == NULL) {
6539 0 : Py_RETURN_NONE;
6540 : }
6541 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
6542 0 : return py_handle;
6543 : }
6544 :
6545 0 : static int py_svcctl_CloseServiceHandle_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
6546 : {
6547 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
6548 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
6549 0 : if (value == NULL) {
6550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
6551 0 : return -1;
6552 : }
6553 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
6554 0 : if (object->out.handle == NULL) {
6555 0 : PyErr_NoMemory();
6556 0 : return -1;
6557 : }
6558 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
6559 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6560 0 : PyErr_NoMemory();
6561 0 : return -1;
6562 : }
6563 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
6564 0 : return 0;
6565 : }
6566 :
6567 0 : static PyObject *py_svcctl_CloseServiceHandle_get_result(PyObject *obj, void *closure)
6568 : {
6569 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
6570 0 : PyObject *py_result;
6571 0 : py_result = PyErr_FromWERROR(object->out.result);
6572 0 : return py_result;
6573 : }
6574 :
6575 0 : static int py_svcctl_CloseServiceHandle_set_result(PyObject *py_obj, PyObject *value, void *closure)
6576 : {
6577 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
6578 0 : if (value == NULL) {
6579 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
6580 0 : return -1;
6581 : }
6582 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
6583 0 : return 0;
6584 : }
6585 :
6586 : static PyGetSetDef py_svcctl_CloseServiceHandle_getsetters[] = {
6587 : {
6588 : .name = discard_const_p(char, "in_handle"),
6589 : .get = py_svcctl_CloseServiceHandle_in_get_handle,
6590 : .set = py_svcctl_CloseServiceHandle_in_set_handle,
6591 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
6592 : },
6593 : {
6594 : .name = discard_const_p(char, "out_handle"),
6595 : .get = py_svcctl_CloseServiceHandle_out_get_handle,
6596 : .set = py_svcctl_CloseServiceHandle_out_set_handle,
6597 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
6598 : },
6599 : {
6600 : .name = discard_const_p(char, "result"),
6601 : .get = py_svcctl_CloseServiceHandle_get_result,
6602 : .set = py_svcctl_CloseServiceHandle_set_result,
6603 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
6604 : },
6605 : { .name = NULL }
6606 : };
6607 :
6608 0 : static PyObject *py_svcctl_CloseServiceHandle_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6609 : {
6610 0 : PyObject *self = pytalloc_new(struct svcctl_CloseServiceHandle, type);
6611 0 : struct svcctl_CloseServiceHandle *_self = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(self);
6612 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
6613 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
6614 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
6615 0 : return self;
6616 : }
6617 :
6618 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6619 : {
6620 :
6621 :
6622 0 : return PyLong_FromLong(0);
6623 : }
6624 :
6625 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
6626 : {
6627 0 : const struct ndr_interface_call *call = NULL;
6628 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
6629 0 : PyObject *ret = NULL;
6630 0 : struct ndr_push *push = NULL;
6631 0 : DATA_BLOB blob;
6632 0 : enum ndr_err_code err;
6633 :
6634 0 : if (ndr_table_svcctl.num_calls < 1) {
6635 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_pack");
6636 0 : return NULL;
6637 : }
6638 0 : call = &ndr_table_svcctl.calls[0];
6639 :
6640 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6641 0 : if (push == NULL) {
6642 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6643 0 : return NULL;
6644 : }
6645 :
6646 0 : push->flags |= ndr_push_flags;
6647 :
6648 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6649 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6650 0 : TALLOC_FREE(push);
6651 0 : PyErr_SetNdrError(err);
6652 0 : return NULL;
6653 : }
6654 0 : blob = ndr_push_blob(push);
6655 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6656 0 : TALLOC_FREE(push);
6657 0 : return ret;
6658 : }
6659 :
6660 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6661 : {
6662 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6663 0 : PyObject *bigendian_obj = NULL;
6664 0 : PyObject *ndr64_obj = NULL;
6665 0 : libndr_flags ndr_push_flags = 0;
6666 :
6667 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6668 : discard_const_p(char *, kwnames),
6669 : &bigendian_obj,
6670 : &ndr64_obj)) {
6671 0 : return NULL;
6672 : }
6673 :
6674 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6675 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6676 : }
6677 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6678 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6679 : }
6680 :
6681 0 : return py_svcctl_CloseServiceHandle_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6682 : }
6683 :
6684 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6685 : {
6686 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6687 0 : PyObject *bigendian_obj = NULL;
6688 0 : PyObject *ndr64_obj = NULL;
6689 0 : libndr_flags ndr_push_flags = 0;
6690 :
6691 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6692 : discard_const_p(char *, kwnames),
6693 : &bigendian_obj,
6694 : &ndr64_obj)) {
6695 0 : return NULL;
6696 : }
6697 :
6698 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6699 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6700 : }
6701 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6702 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6703 : }
6704 :
6705 0 : return py_svcctl_CloseServiceHandle_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6706 : }
6707 :
6708 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
6709 : {
6710 0 : const struct ndr_interface_call *call = NULL;
6711 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
6712 0 : struct ndr_pull *pull = NULL;
6713 0 : enum ndr_err_code err;
6714 :
6715 0 : if (ndr_table_svcctl.num_calls < 1) {
6716 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_unpack");
6717 0 : return NULL;
6718 : }
6719 0 : call = &ndr_table_svcctl.calls[0];
6720 :
6721 0 : pull = ndr_pull_init_blob(blob, object);
6722 0 : if (pull == NULL) {
6723 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6724 0 : return NULL;
6725 : }
6726 :
6727 0 : pull->flags |= ndr_pull_flags;
6728 :
6729 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6730 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6731 0 : TALLOC_FREE(pull);
6732 0 : PyErr_SetNdrError(err);
6733 0 : return NULL;
6734 : }
6735 0 : if (!allow_remaining) {
6736 0 : uint32_t highest_ofs;
6737 :
6738 0 : if (pull->offset > pull->relative_highest_offset) {
6739 0 : highest_ofs = pull->offset;
6740 : } else {
6741 0 : highest_ofs = pull->relative_highest_offset;
6742 : }
6743 0 : if (highest_ofs < pull->data_size) {
6744 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6745 : "not all bytes consumed ofs[%u] size[%u]",
6746 : highest_ofs, pull->data_size);
6747 0 : TALLOC_FREE(pull);
6748 0 : PyErr_SetNdrError(err);
6749 0 : return NULL;
6750 : }
6751 : }
6752 :
6753 0 : TALLOC_FREE(pull);
6754 0 : Py_RETURN_NONE;
6755 : }
6756 :
6757 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6758 : {
6759 0 : DATA_BLOB blob;
6760 0 : Py_ssize_t blob_length = 0;
6761 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6762 0 : PyObject *bigendian_obj = NULL;
6763 0 : PyObject *ndr64_obj = NULL;
6764 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6765 0 : PyObject *allow_remaining_obj = NULL;
6766 0 : bool allow_remaining = false;
6767 :
6768 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6769 : discard_const_p(char *, kwnames),
6770 : &blob.data, &blob_length,
6771 : &bigendian_obj,
6772 : &ndr64_obj,
6773 : &allow_remaining_obj)) {
6774 0 : return NULL;
6775 : }
6776 0 : blob.length = blob_length;
6777 :
6778 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6779 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6780 : }
6781 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6782 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6783 : }
6784 :
6785 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6786 0 : allow_remaining = true;
6787 : }
6788 :
6789 0 : return py_svcctl_CloseServiceHandle_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6790 : }
6791 :
6792 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6793 : {
6794 0 : DATA_BLOB blob;
6795 0 : Py_ssize_t blob_length = 0;
6796 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6797 0 : PyObject *bigendian_obj = NULL;
6798 0 : PyObject *ndr64_obj = NULL;
6799 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6800 0 : PyObject *allow_remaining_obj = NULL;
6801 0 : bool allow_remaining = false;
6802 :
6803 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6804 : discard_const_p(char *, kwnames),
6805 : &blob.data, &blob_length,
6806 : &bigendian_obj,
6807 : &ndr64_obj,
6808 : &allow_remaining_obj)) {
6809 0 : return NULL;
6810 : }
6811 0 : blob.length = blob_length;
6812 :
6813 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6814 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6815 : }
6816 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6817 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6818 : }
6819 :
6820 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6821 0 : allow_remaining = true;
6822 : }
6823 :
6824 0 : return py_svcctl_CloseServiceHandle_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6825 : }
6826 :
6827 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
6828 : {
6829 0 : const struct ndr_interface_call *call = NULL;
6830 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
6831 0 : PyObject *ret;
6832 0 : char *retstr;
6833 :
6834 0 : if (ndr_table_svcctl.num_calls < 1) {
6835 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_print");
6836 0 : return NULL;
6837 : }
6838 0 : call = &ndr_table_svcctl.calls[0];
6839 :
6840 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6841 0 : ret = PyUnicode_FromString(retstr);
6842 0 : TALLOC_FREE(retstr);
6843 :
6844 0 : return ret;
6845 : }
6846 :
6847 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6848 : {
6849 0 : return py_svcctl_CloseServiceHandle_ndr_print(py_obj, "svcctl_CloseServiceHandle_in", NDR_IN);
6850 : }
6851 :
6852 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6853 : {
6854 0 : return py_svcctl_CloseServiceHandle_ndr_print(py_obj, "svcctl_CloseServiceHandle_out", NDR_OUT);
6855 : }
6856 :
6857 : static PyMethodDef py_svcctl_CloseServiceHandle_methods[] = {
6858 : { "opnum", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_opnum, METH_NOARGS|METH_CLASS,
6859 : "svcctl.CloseServiceHandle.opnum() -> 0 (0x00) " },
6860 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6861 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6862 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6863 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6864 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6865 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6866 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6867 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6868 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6869 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6870 : { NULL, NULL, 0, NULL }
6871 : };
6872 :
6873 :
6874 : static PyTypeObject svcctl_CloseServiceHandle_Type = {
6875 : PyVarObject_HEAD_INIT(NULL, 0)
6876 : .tp_name = "svcctl.CloseServiceHandle",
6877 : .tp_getset = py_svcctl_CloseServiceHandle_getsetters,
6878 : .tp_methods = py_svcctl_CloseServiceHandle_methods,
6879 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6880 : .tp_new = py_svcctl_CloseServiceHandle_new,
6881 : };
6882 :
6883 0 : static bool pack_py_svcctl_CloseServiceHandle_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CloseServiceHandle *r)
6884 : {
6885 0 : PyObject *py_handle;
6886 0 : const char *kwnames[] = {
6887 : "handle", NULL
6888 : };
6889 :
6890 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_CloseServiceHandle", discard_const_p(char *, kwnames), &py_handle)) {
6891 0 : return false;
6892 : }
6893 :
6894 0 : if (py_handle == NULL) {
6895 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
6896 0 : return false;
6897 : }
6898 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
6899 0 : if (r->in.handle == NULL) {
6900 0 : PyErr_NoMemory();
6901 0 : return false;
6902 : }
6903 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
6904 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
6905 0 : PyErr_NoMemory();
6906 0 : return false;
6907 : }
6908 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
6909 0 : return true;
6910 : }
6911 :
6912 0 : static PyObject *unpack_py_svcctl_CloseServiceHandle_args_out(struct svcctl_CloseServiceHandle *r)
6913 : {
6914 0 : PyObject *result;
6915 0 : PyObject *py_handle;
6916 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
6917 0 : result = py_handle;
6918 0 : if (!W_ERROR_IS_OK(r->out.result)) {
6919 0 : PyErr_SetWERROR(r->out.result);
6920 0 : return NULL;
6921 : }
6922 :
6923 0 : return result;
6924 : }
6925 :
6926 :
6927 0 : static PyObject *py_svcctl_ControlService_in_get_handle(PyObject *obj, void *closure)
6928 : {
6929 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
6930 0 : PyObject *py_handle;
6931 0 : if (object->in.handle == NULL) {
6932 0 : Py_RETURN_NONE;
6933 : }
6934 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
6935 0 : return py_handle;
6936 : }
6937 :
6938 0 : static int py_svcctl_ControlService_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
6939 : {
6940 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
6941 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
6942 0 : if (value == NULL) {
6943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
6944 0 : return -1;
6945 : }
6946 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
6947 0 : if (object->in.handle == NULL) {
6948 0 : PyErr_NoMemory();
6949 0 : return -1;
6950 : }
6951 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
6952 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6953 0 : PyErr_NoMemory();
6954 0 : return -1;
6955 : }
6956 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
6957 0 : return 0;
6958 : }
6959 :
6960 0 : static PyObject *py_svcctl_ControlService_in_get_control(PyObject *obj, void *closure)
6961 : {
6962 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
6963 0 : PyObject *py_control;
6964 0 : py_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.control);
6965 0 : return py_control;
6966 : }
6967 :
6968 0 : static int py_svcctl_ControlService_in_set_control(PyObject *py_obj, PyObject *value, void *closure)
6969 : {
6970 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
6971 0 : if (value == NULL) {
6972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.control");
6973 0 : return -1;
6974 : }
6975 : {
6976 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.control));
6977 0 : if (PyLong_Check(value)) {
6978 0 : unsigned long long test_var;
6979 0 : test_var = PyLong_AsUnsignedLongLong(value);
6980 0 : if (PyErr_Occurred() != NULL) {
6981 0 : return -1;
6982 : }
6983 0 : if (test_var > uint_max) {
6984 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6985 : PyLong_Type.tp_name, uint_max, test_var);
6986 0 : return -1;
6987 : }
6988 0 : object->in.control = test_var;
6989 : } else {
6990 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6991 : PyLong_Type.tp_name);
6992 0 : return -1;
6993 : }
6994 : }
6995 0 : return 0;
6996 : }
6997 :
6998 0 : static PyObject *py_svcctl_ControlService_out_get_service_status(PyObject *obj, void *closure)
6999 : {
7000 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
7001 0 : PyObject *py_service_status;
7002 0 : if (object->out.service_status == NULL) {
7003 0 : Py_RETURN_NONE;
7004 : }
7005 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, object->out.service_status, object->out.service_status);
7006 0 : return py_service_status;
7007 : }
7008 :
7009 0 : static int py_svcctl_ControlService_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
7010 : {
7011 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
7012 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
7013 0 : if (value == NULL) {
7014 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
7015 0 : return -1;
7016 : }
7017 0 : object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
7018 0 : if (object->out.service_status == NULL) {
7019 0 : PyErr_NoMemory();
7020 0 : return -1;
7021 : }
7022 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
7023 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7024 0 : PyErr_NoMemory();
7025 0 : return -1;
7026 : }
7027 0 : object->out.service_status = (struct SERVICE_STATUS *)pytalloc_get_ptr(value);
7028 0 : return 0;
7029 : }
7030 :
7031 0 : static PyObject *py_svcctl_ControlService_get_result(PyObject *obj, void *closure)
7032 : {
7033 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
7034 0 : PyObject *py_result;
7035 0 : py_result = PyErr_FromWERROR(object->out.result);
7036 0 : return py_result;
7037 : }
7038 :
7039 0 : static int py_svcctl_ControlService_set_result(PyObject *py_obj, PyObject *value, void *closure)
7040 : {
7041 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
7042 0 : if (value == NULL) {
7043 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
7044 0 : return -1;
7045 : }
7046 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
7047 0 : return 0;
7048 : }
7049 :
7050 : static PyGetSetDef py_svcctl_ControlService_getsetters[] = {
7051 : {
7052 : .name = discard_const_p(char, "in_handle"),
7053 : .get = py_svcctl_ControlService_in_get_handle,
7054 : .set = py_svcctl_ControlService_in_set_handle,
7055 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
7056 : },
7057 : {
7058 : .name = discard_const_p(char, "in_control"),
7059 : .get = py_svcctl_ControlService_in_get_control,
7060 : .set = py_svcctl_ControlService_in_set_control,
7061 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_CONTROL")
7062 : },
7063 : {
7064 : .name = discard_const_p(char, "out_service_status"),
7065 : .get = py_svcctl_ControlService_out_get_service_status,
7066 : .set = py_svcctl_ControlService_out_set_service_status,
7067 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
7068 : },
7069 : {
7070 : .name = discard_const_p(char, "result"),
7071 : .get = py_svcctl_ControlService_get_result,
7072 : .set = py_svcctl_ControlService_set_result,
7073 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
7074 : },
7075 : { .name = NULL }
7076 : };
7077 :
7078 0 : static PyObject *py_svcctl_ControlService_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7079 : {
7080 0 : PyObject *self = pytalloc_new(struct svcctl_ControlService, type);
7081 0 : struct svcctl_ControlService *_self = (struct svcctl_ControlService *)pytalloc_get_ptr(self);
7082 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
7083 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
7084 0 : _self->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
7085 0 : return self;
7086 : }
7087 :
7088 0 : static PyObject *py_svcctl_ControlService_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
7089 : {
7090 :
7091 :
7092 0 : return PyLong_FromLong(1);
7093 : }
7094 :
7095 0 : static PyObject *py_svcctl_ControlService_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
7096 : {
7097 0 : const struct ndr_interface_call *call = NULL;
7098 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
7099 0 : PyObject *ret = NULL;
7100 0 : struct ndr_push *push = NULL;
7101 0 : DATA_BLOB blob;
7102 0 : enum ndr_err_code err;
7103 :
7104 0 : if (ndr_table_svcctl.num_calls < 2) {
7105 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_pack");
7106 0 : return NULL;
7107 : }
7108 0 : call = &ndr_table_svcctl.calls[1];
7109 :
7110 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
7111 0 : if (push == NULL) {
7112 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7113 0 : return NULL;
7114 : }
7115 :
7116 0 : push->flags |= ndr_push_flags;
7117 :
7118 0 : err = call->ndr_push(push, ndr_inout_flags, object);
7119 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7120 0 : TALLOC_FREE(push);
7121 0 : PyErr_SetNdrError(err);
7122 0 : return NULL;
7123 : }
7124 0 : blob = ndr_push_blob(push);
7125 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7126 0 : TALLOC_FREE(push);
7127 0 : return ret;
7128 : }
7129 :
7130 0 : static PyObject *py_svcctl_ControlService_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7131 : {
7132 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7133 0 : PyObject *bigendian_obj = NULL;
7134 0 : PyObject *ndr64_obj = NULL;
7135 0 : libndr_flags ndr_push_flags = 0;
7136 :
7137 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
7138 : discard_const_p(char *, kwnames),
7139 : &bigendian_obj,
7140 : &ndr64_obj)) {
7141 0 : return NULL;
7142 : }
7143 :
7144 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7145 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7146 : }
7147 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7148 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7149 : }
7150 :
7151 0 : return py_svcctl_ControlService_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
7152 : }
7153 :
7154 0 : static PyObject *py_svcctl_ControlService_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7155 : {
7156 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7157 0 : PyObject *bigendian_obj = NULL;
7158 0 : PyObject *ndr64_obj = NULL;
7159 0 : libndr_flags ndr_push_flags = 0;
7160 :
7161 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
7162 : discard_const_p(char *, kwnames),
7163 : &bigendian_obj,
7164 : &ndr64_obj)) {
7165 0 : return NULL;
7166 : }
7167 :
7168 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7169 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7170 : }
7171 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7172 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7173 : }
7174 :
7175 0 : return py_svcctl_ControlService_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
7176 : }
7177 :
7178 0 : static PyObject *py_svcctl_ControlService_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
7179 : {
7180 0 : const struct ndr_interface_call *call = NULL;
7181 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
7182 0 : struct ndr_pull *pull = NULL;
7183 0 : enum ndr_err_code err;
7184 :
7185 0 : if (ndr_table_svcctl.num_calls < 2) {
7186 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_unpack");
7187 0 : return NULL;
7188 : }
7189 0 : call = &ndr_table_svcctl.calls[1];
7190 :
7191 0 : pull = ndr_pull_init_blob(blob, object);
7192 0 : if (pull == NULL) {
7193 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7194 0 : return NULL;
7195 : }
7196 :
7197 0 : pull->flags |= ndr_pull_flags;
7198 :
7199 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
7200 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7201 0 : TALLOC_FREE(pull);
7202 0 : PyErr_SetNdrError(err);
7203 0 : return NULL;
7204 : }
7205 0 : if (!allow_remaining) {
7206 0 : uint32_t highest_ofs;
7207 :
7208 0 : if (pull->offset > pull->relative_highest_offset) {
7209 0 : highest_ofs = pull->offset;
7210 : } else {
7211 0 : highest_ofs = pull->relative_highest_offset;
7212 : }
7213 0 : if (highest_ofs < pull->data_size) {
7214 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
7215 : "not all bytes consumed ofs[%u] size[%u]",
7216 : highest_ofs, pull->data_size);
7217 0 : TALLOC_FREE(pull);
7218 0 : PyErr_SetNdrError(err);
7219 0 : return NULL;
7220 : }
7221 : }
7222 :
7223 0 : TALLOC_FREE(pull);
7224 0 : Py_RETURN_NONE;
7225 : }
7226 :
7227 0 : static PyObject *py_svcctl_ControlService_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7228 : {
7229 0 : DATA_BLOB blob;
7230 0 : Py_ssize_t blob_length = 0;
7231 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7232 0 : PyObject *bigendian_obj = NULL;
7233 0 : PyObject *ndr64_obj = NULL;
7234 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7235 0 : PyObject *allow_remaining_obj = NULL;
7236 0 : bool allow_remaining = false;
7237 :
7238 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
7239 : discard_const_p(char *, kwnames),
7240 : &blob.data, &blob_length,
7241 : &bigendian_obj,
7242 : &ndr64_obj,
7243 : &allow_remaining_obj)) {
7244 0 : return NULL;
7245 : }
7246 0 : blob.length = blob_length;
7247 :
7248 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7249 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7250 : }
7251 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7252 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7253 : }
7254 :
7255 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7256 0 : allow_remaining = true;
7257 : }
7258 :
7259 0 : return py_svcctl_ControlService_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
7260 : }
7261 :
7262 0 : static PyObject *py_svcctl_ControlService_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7263 : {
7264 0 : DATA_BLOB blob;
7265 0 : Py_ssize_t blob_length = 0;
7266 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7267 0 : PyObject *bigendian_obj = NULL;
7268 0 : PyObject *ndr64_obj = NULL;
7269 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7270 0 : PyObject *allow_remaining_obj = NULL;
7271 0 : bool allow_remaining = false;
7272 :
7273 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
7274 : discard_const_p(char *, kwnames),
7275 : &blob.data, &blob_length,
7276 : &bigendian_obj,
7277 : &ndr64_obj,
7278 : &allow_remaining_obj)) {
7279 0 : return NULL;
7280 : }
7281 0 : blob.length = blob_length;
7282 :
7283 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7284 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7285 : }
7286 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7287 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7288 : }
7289 :
7290 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7291 0 : allow_remaining = true;
7292 : }
7293 :
7294 0 : return py_svcctl_ControlService_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
7295 : }
7296 :
7297 0 : static PyObject *py_svcctl_ControlService_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
7298 : {
7299 0 : const struct ndr_interface_call *call = NULL;
7300 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
7301 0 : PyObject *ret;
7302 0 : char *retstr;
7303 :
7304 0 : if (ndr_table_svcctl.num_calls < 2) {
7305 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_print");
7306 0 : return NULL;
7307 : }
7308 0 : call = &ndr_table_svcctl.calls[1];
7309 :
7310 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7311 0 : ret = PyUnicode_FromString(retstr);
7312 0 : TALLOC_FREE(retstr);
7313 :
7314 0 : return ret;
7315 : }
7316 :
7317 0 : static PyObject *py_svcctl_ControlService_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7318 : {
7319 0 : return py_svcctl_ControlService_ndr_print(py_obj, "svcctl_ControlService_in", NDR_IN);
7320 : }
7321 :
7322 0 : static PyObject *py_svcctl_ControlService_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7323 : {
7324 0 : return py_svcctl_ControlService_ndr_print(py_obj, "svcctl_ControlService_out", NDR_OUT);
7325 : }
7326 :
7327 : static PyMethodDef py_svcctl_ControlService_methods[] = {
7328 : { "opnum", (PyCFunction)py_svcctl_ControlService_ndr_opnum, METH_NOARGS|METH_CLASS,
7329 : "svcctl.ControlService.opnum() -> 1 (0x01) " },
7330 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7331 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7332 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7333 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7334 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7335 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7336 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7337 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7338 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ControlService_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7339 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ControlService_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7340 : { NULL, NULL, 0, NULL }
7341 : };
7342 :
7343 :
7344 : static PyTypeObject svcctl_ControlService_Type = {
7345 : PyVarObject_HEAD_INIT(NULL, 0)
7346 : .tp_name = "svcctl.ControlService",
7347 : .tp_getset = py_svcctl_ControlService_getsetters,
7348 : .tp_methods = py_svcctl_ControlService_methods,
7349 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7350 : .tp_new = py_svcctl_ControlService_new,
7351 : };
7352 :
7353 0 : static bool pack_py_svcctl_ControlService_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ControlService *r)
7354 : {
7355 0 : PyObject *py_handle;
7356 0 : PyObject *py_control;
7357 0 : const char *kwnames[] = {
7358 : "handle", "control", NULL
7359 : };
7360 :
7361 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_ControlService", discard_const_p(char *, kwnames), &py_handle, &py_control)) {
7362 0 : return false;
7363 : }
7364 :
7365 0 : if (py_handle == NULL) {
7366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
7367 0 : return false;
7368 : }
7369 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
7370 0 : if (r->in.handle == NULL) {
7371 0 : PyErr_NoMemory();
7372 0 : return false;
7373 : }
7374 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
7375 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
7376 0 : PyErr_NoMemory();
7377 0 : return false;
7378 : }
7379 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
7380 0 : if (py_control == NULL) {
7381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.control");
7382 0 : return false;
7383 : }
7384 : {
7385 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.control));
7386 0 : if (PyLong_Check(py_control)) {
7387 0 : unsigned long long test_var;
7388 0 : test_var = PyLong_AsUnsignedLongLong(py_control);
7389 0 : if (PyErr_Occurred() != NULL) {
7390 0 : return false;
7391 : }
7392 0 : if (test_var > uint_max) {
7393 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7394 : PyLong_Type.tp_name, uint_max, test_var);
7395 0 : return false;
7396 : }
7397 0 : r->in.control = test_var;
7398 : } else {
7399 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7400 : PyLong_Type.tp_name);
7401 0 : return false;
7402 : }
7403 : }
7404 0 : return true;
7405 : }
7406 :
7407 0 : static PyObject *unpack_py_svcctl_ControlService_args_out(struct svcctl_ControlService *r)
7408 : {
7409 0 : PyObject *result;
7410 0 : PyObject *py_service_status;
7411 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, r->out.service_status, r->out.service_status);
7412 0 : result = py_service_status;
7413 0 : if (!W_ERROR_IS_OK(r->out.result)) {
7414 0 : PyErr_SetWERROR(r->out.result);
7415 0 : return NULL;
7416 : }
7417 :
7418 0 : return result;
7419 : }
7420 :
7421 :
7422 0 : static PyObject *py_svcctl_DeleteService_in_get_handle(PyObject *obj, void *closure)
7423 : {
7424 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(obj);
7425 0 : PyObject *py_handle;
7426 0 : if (object->in.handle == NULL) {
7427 0 : Py_RETURN_NONE;
7428 : }
7429 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
7430 0 : return py_handle;
7431 : }
7432 :
7433 0 : static int py_svcctl_DeleteService_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
7434 : {
7435 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
7436 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
7437 0 : if (value == NULL) {
7438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
7439 0 : return -1;
7440 : }
7441 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
7442 0 : if (object->in.handle == NULL) {
7443 0 : PyErr_NoMemory();
7444 0 : return -1;
7445 : }
7446 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
7447 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7448 0 : PyErr_NoMemory();
7449 0 : return -1;
7450 : }
7451 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
7452 0 : return 0;
7453 : }
7454 :
7455 0 : static PyObject *py_svcctl_DeleteService_get_result(PyObject *obj, void *closure)
7456 : {
7457 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(obj);
7458 0 : PyObject *py_result;
7459 0 : py_result = PyErr_FromWERROR(object->out.result);
7460 0 : return py_result;
7461 : }
7462 :
7463 0 : static int py_svcctl_DeleteService_set_result(PyObject *py_obj, PyObject *value, void *closure)
7464 : {
7465 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
7466 0 : if (value == NULL) {
7467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
7468 0 : return -1;
7469 : }
7470 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
7471 0 : return 0;
7472 : }
7473 :
7474 : static PyGetSetDef py_svcctl_DeleteService_getsetters[] = {
7475 : {
7476 : .name = discard_const_p(char, "in_handle"),
7477 : .get = py_svcctl_DeleteService_in_get_handle,
7478 : .set = py_svcctl_DeleteService_in_set_handle,
7479 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
7480 : },
7481 : {
7482 : .name = discard_const_p(char, "result"),
7483 : .get = py_svcctl_DeleteService_get_result,
7484 : .set = py_svcctl_DeleteService_set_result,
7485 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
7486 : },
7487 : { .name = NULL }
7488 : };
7489 :
7490 0 : static PyObject *py_svcctl_DeleteService_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7491 : {
7492 0 : PyObject *self = pytalloc_new(struct svcctl_DeleteService, type);
7493 0 : struct svcctl_DeleteService *_self = (struct svcctl_DeleteService *)pytalloc_get_ptr(self);
7494 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
7495 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
7496 0 : return self;
7497 : }
7498 :
7499 0 : static PyObject *py_svcctl_DeleteService_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
7500 : {
7501 :
7502 :
7503 0 : return PyLong_FromLong(2);
7504 : }
7505 :
7506 0 : static PyObject *py_svcctl_DeleteService_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
7507 : {
7508 0 : const struct ndr_interface_call *call = NULL;
7509 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
7510 0 : PyObject *ret = NULL;
7511 0 : struct ndr_push *push = NULL;
7512 0 : DATA_BLOB blob;
7513 0 : enum ndr_err_code err;
7514 :
7515 0 : if (ndr_table_svcctl.num_calls < 3) {
7516 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_pack");
7517 0 : return NULL;
7518 : }
7519 0 : call = &ndr_table_svcctl.calls[2];
7520 :
7521 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
7522 0 : if (push == NULL) {
7523 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7524 0 : return NULL;
7525 : }
7526 :
7527 0 : push->flags |= ndr_push_flags;
7528 :
7529 0 : err = call->ndr_push(push, ndr_inout_flags, object);
7530 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7531 0 : TALLOC_FREE(push);
7532 0 : PyErr_SetNdrError(err);
7533 0 : return NULL;
7534 : }
7535 0 : blob = ndr_push_blob(push);
7536 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7537 0 : TALLOC_FREE(push);
7538 0 : return ret;
7539 : }
7540 :
7541 0 : static PyObject *py_svcctl_DeleteService_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7542 : {
7543 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7544 0 : PyObject *bigendian_obj = NULL;
7545 0 : PyObject *ndr64_obj = NULL;
7546 0 : libndr_flags ndr_push_flags = 0;
7547 :
7548 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
7549 : discard_const_p(char *, kwnames),
7550 : &bigendian_obj,
7551 : &ndr64_obj)) {
7552 0 : return NULL;
7553 : }
7554 :
7555 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7556 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7557 : }
7558 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7559 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7560 : }
7561 :
7562 0 : return py_svcctl_DeleteService_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
7563 : }
7564 :
7565 0 : static PyObject *py_svcctl_DeleteService_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7566 : {
7567 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7568 0 : PyObject *bigendian_obj = NULL;
7569 0 : PyObject *ndr64_obj = NULL;
7570 0 : libndr_flags ndr_push_flags = 0;
7571 :
7572 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
7573 : discard_const_p(char *, kwnames),
7574 : &bigendian_obj,
7575 : &ndr64_obj)) {
7576 0 : return NULL;
7577 : }
7578 :
7579 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7580 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7581 : }
7582 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7583 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7584 : }
7585 :
7586 0 : return py_svcctl_DeleteService_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
7587 : }
7588 :
7589 0 : static PyObject *py_svcctl_DeleteService_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
7590 : {
7591 0 : const struct ndr_interface_call *call = NULL;
7592 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
7593 0 : struct ndr_pull *pull = NULL;
7594 0 : enum ndr_err_code err;
7595 :
7596 0 : if (ndr_table_svcctl.num_calls < 3) {
7597 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_unpack");
7598 0 : return NULL;
7599 : }
7600 0 : call = &ndr_table_svcctl.calls[2];
7601 :
7602 0 : pull = ndr_pull_init_blob(blob, object);
7603 0 : if (pull == NULL) {
7604 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7605 0 : return NULL;
7606 : }
7607 :
7608 0 : pull->flags |= ndr_pull_flags;
7609 :
7610 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
7611 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7612 0 : TALLOC_FREE(pull);
7613 0 : PyErr_SetNdrError(err);
7614 0 : return NULL;
7615 : }
7616 0 : if (!allow_remaining) {
7617 0 : uint32_t highest_ofs;
7618 :
7619 0 : if (pull->offset > pull->relative_highest_offset) {
7620 0 : highest_ofs = pull->offset;
7621 : } else {
7622 0 : highest_ofs = pull->relative_highest_offset;
7623 : }
7624 0 : if (highest_ofs < pull->data_size) {
7625 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
7626 : "not all bytes consumed ofs[%u] size[%u]",
7627 : highest_ofs, pull->data_size);
7628 0 : TALLOC_FREE(pull);
7629 0 : PyErr_SetNdrError(err);
7630 0 : return NULL;
7631 : }
7632 : }
7633 :
7634 0 : TALLOC_FREE(pull);
7635 0 : Py_RETURN_NONE;
7636 : }
7637 :
7638 0 : static PyObject *py_svcctl_DeleteService_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7639 : {
7640 0 : DATA_BLOB blob;
7641 0 : Py_ssize_t blob_length = 0;
7642 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7643 0 : PyObject *bigendian_obj = NULL;
7644 0 : PyObject *ndr64_obj = NULL;
7645 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7646 0 : PyObject *allow_remaining_obj = NULL;
7647 0 : bool allow_remaining = false;
7648 :
7649 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
7650 : discard_const_p(char *, kwnames),
7651 : &blob.data, &blob_length,
7652 : &bigendian_obj,
7653 : &ndr64_obj,
7654 : &allow_remaining_obj)) {
7655 0 : return NULL;
7656 : }
7657 0 : blob.length = blob_length;
7658 :
7659 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7660 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7661 : }
7662 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7663 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7664 : }
7665 :
7666 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7667 0 : allow_remaining = true;
7668 : }
7669 :
7670 0 : return py_svcctl_DeleteService_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
7671 : }
7672 :
7673 0 : static PyObject *py_svcctl_DeleteService_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7674 : {
7675 0 : DATA_BLOB blob;
7676 0 : Py_ssize_t blob_length = 0;
7677 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7678 0 : PyObject *bigendian_obj = NULL;
7679 0 : PyObject *ndr64_obj = NULL;
7680 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7681 0 : PyObject *allow_remaining_obj = NULL;
7682 0 : bool allow_remaining = false;
7683 :
7684 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
7685 : discard_const_p(char *, kwnames),
7686 : &blob.data, &blob_length,
7687 : &bigendian_obj,
7688 : &ndr64_obj,
7689 : &allow_remaining_obj)) {
7690 0 : return NULL;
7691 : }
7692 0 : blob.length = blob_length;
7693 :
7694 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7695 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7696 : }
7697 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7698 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7699 : }
7700 :
7701 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7702 0 : allow_remaining = true;
7703 : }
7704 :
7705 0 : return py_svcctl_DeleteService_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
7706 : }
7707 :
7708 0 : static PyObject *py_svcctl_DeleteService_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
7709 : {
7710 0 : const struct ndr_interface_call *call = NULL;
7711 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
7712 0 : PyObject *ret;
7713 0 : char *retstr;
7714 :
7715 0 : if (ndr_table_svcctl.num_calls < 3) {
7716 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_print");
7717 0 : return NULL;
7718 : }
7719 0 : call = &ndr_table_svcctl.calls[2];
7720 :
7721 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7722 0 : ret = PyUnicode_FromString(retstr);
7723 0 : TALLOC_FREE(retstr);
7724 :
7725 0 : return ret;
7726 : }
7727 :
7728 0 : static PyObject *py_svcctl_DeleteService_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7729 : {
7730 0 : return py_svcctl_DeleteService_ndr_print(py_obj, "svcctl_DeleteService_in", NDR_IN);
7731 : }
7732 :
7733 0 : static PyObject *py_svcctl_DeleteService_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7734 : {
7735 0 : return py_svcctl_DeleteService_ndr_print(py_obj, "svcctl_DeleteService_out", NDR_OUT);
7736 : }
7737 :
7738 : static PyMethodDef py_svcctl_DeleteService_methods[] = {
7739 : { "opnum", (PyCFunction)py_svcctl_DeleteService_ndr_opnum, METH_NOARGS|METH_CLASS,
7740 : "svcctl.DeleteService.opnum() -> 2 (0x02) " },
7741 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7742 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7743 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7744 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7745 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7746 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7747 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7748 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7749 : { "__ndr_print_in__", (PyCFunction)py_svcctl_DeleteService_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7750 : { "__ndr_print_out__", (PyCFunction)py_svcctl_DeleteService_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7751 : { NULL, NULL, 0, NULL }
7752 : };
7753 :
7754 :
7755 : static PyTypeObject svcctl_DeleteService_Type = {
7756 : PyVarObject_HEAD_INIT(NULL, 0)
7757 : .tp_name = "svcctl.DeleteService",
7758 : .tp_getset = py_svcctl_DeleteService_getsetters,
7759 : .tp_methods = py_svcctl_DeleteService_methods,
7760 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7761 : .tp_new = py_svcctl_DeleteService_new,
7762 : };
7763 :
7764 0 : static bool pack_py_svcctl_DeleteService_args_in(PyObject *args, PyObject *kwargs, struct svcctl_DeleteService *r)
7765 : {
7766 0 : PyObject *py_handle;
7767 0 : const char *kwnames[] = {
7768 : "handle", NULL
7769 : };
7770 :
7771 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_DeleteService", discard_const_p(char *, kwnames), &py_handle)) {
7772 0 : return false;
7773 : }
7774 :
7775 0 : if (py_handle == NULL) {
7776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
7777 0 : return false;
7778 : }
7779 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
7780 0 : if (r->in.handle == NULL) {
7781 0 : PyErr_NoMemory();
7782 0 : return false;
7783 : }
7784 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
7785 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
7786 0 : PyErr_NoMemory();
7787 0 : return false;
7788 : }
7789 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
7790 0 : return true;
7791 : }
7792 :
7793 0 : static PyObject *unpack_py_svcctl_DeleteService_args_out(struct svcctl_DeleteService *r)
7794 : {
7795 0 : PyObject *result;
7796 0 : result = Py_None;
7797 0 : Py_INCREF(result);
7798 0 : if (!W_ERROR_IS_OK(r->out.result)) {
7799 0 : PyErr_SetWERROR(r->out.result);
7800 0 : return NULL;
7801 : }
7802 :
7803 0 : return result;
7804 : }
7805 :
7806 :
7807 0 : static PyObject *py_svcctl_LockServiceDatabase_in_get_handle(PyObject *obj, void *closure)
7808 : {
7809 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
7810 0 : PyObject *py_handle;
7811 0 : if (object->in.handle == NULL) {
7812 0 : Py_RETURN_NONE;
7813 : }
7814 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
7815 0 : return py_handle;
7816 : }
7817 :
7818 0 : static int py_svcctl_LockServiceDatabase_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
7819 : {
7820 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
7821 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
7822 0 : if (value == NULL) {
7823 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
7824 0 : return -1;
7825 : }
7826 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
7827 0 : if (object->in.handle == NULL) {
7828 0 : PyErr_NoMemory();
7829 0 : return -1;
7830 : }
7831 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
7832 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7833 0 : PyErr_NoMemory();
7834 0 : return -1;
7835 : }
7836 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
7837 0 : return 0;
7838 : }
7839 :
7840 0 : static PyObject *py_svcctl_LockServiceDatabase_out_get_lock(PyObject *obj, void *closure)
7841 : {
7842 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
7843 0 : PyObject *py_lock;
7844 0 : if (object->out.lock == NULL) {
7845 0 : Py_RETURN_NONE;
7846 : }
7847 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, object->out.lock, object->out.lock);
7848 0 : return py_lock;
7849 : }
7850 :
7851 0 : static int py_svcctl_LockServiceDatabase_out_set_lock(PyObject *py_obj, PyObject *value, void *closure)
7852 : {
7853 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
7854 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock));
7855 0 : if (value == NULL) {
7856 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock");
7857 0 : return -1;
7858 : }
7859 0 : object->out.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock);
7860 0 : if (object->out.lock == NULL) {
7861 0 : PyErr_NoMemory();
7862 0 : return -1;
7863 : }
7864 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
7865 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7866 0 : PyErr_NoMemory();
7867 0 : return -1;
7868 : }
7869 0 : object->out.lock = (struct policy_handle *)pytalloc_get_ptr(value);
7870 0 : return 0;
7871 : }
7872 :
7873 0 : static PyObject *py_svcctl_LockServiceDatabase_get_result(PyObject *obj, void *closure)
7874 : {
7875 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
7876 0 : PyObject *py_result;
7877 0 : py_result = PyErr_FromWERROR(object->out.result);
7878 0 : return py_result;
7879 : }
7880 :
7881 0 : static int py_svcctl_LockServiceDatabase_set_result(PyObject *py_obj, PyObject *value, void *closure)
7882 : {
7883 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
7884 0 : if (value == NULL) {
7885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
7886 0 : return -1;
7887 : }
7888 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
7889 0 : return 0;
7890 : }
7891 :
7892 : static PyGetSetDef py_svcctl_LockServiceDatabase_getsetters[] = {
7893 : {
7894 : .name = discard_const_p(char, "in_handle"),
7895 : .get = py_svcctl_LockServiceDatabase_in_get_handle,
7896 : .set = py_svcctl_LockServiceDatabase_in_set_handle,
7897 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
7898 : },
7899 : {
7900 : .name = discard_const_p(char, "out_lock"),
7901 : .get = py_svcctl_LockServiceDatabase_out_get_lock,
7902 : .set = py_svcctl_LockServiceDatabase_out_set_lock,
7903 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
7904 : },
7905 : {
7906 : .name = discard_const_p(char, "result"),
7907 : .get = py_svcctl_LockServiceDatabase_get_result,
7908 : .set = py_svcctl_LockServiceDatabase_set_result,
7909 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
7910 : },
7911 : { .name = NULL }
7912 : };
7913 :
7914 0 : static PyObject *py_svcctl_LockServiceDatabase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7915 : {
7916 0 : PyObject *self = pytalloc_new(struct svcctl_LockServiceDatabase, type);
7917 0 : struct svcctl_LockServiceDatabase *_self = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(self);
7918 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
7919 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
7920 0 : _self->out.lock = talloc_zero(mem_ctx, struct policy_handle);
7921 0 : return self;
7922 : }
7923 :
7924 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
7925 : {
7926 :
7927 :
7928 0 : return PyLong_FromLong(3);
7929 : }
7930 :
7931 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
7932 : {
7933 0 : const struct ndr_interface_call *call = NULL;
7934 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
7935 0 : PyObject *ret = NULL;
7936 0 : struct ndr_push *push = NULL;
7937 0 : DATA_BLOB blob;
7938 0 : enum ndr_err_code err;
7939 :
7940 0 : if (ndr_table_svcctl.num_calls < 4) {
7941 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_pack");
7942 0 : return NULL;
7943 : }
7944 0 : call = &ndr_table_svcctl.calls[3];
7945 :
7946 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
7947 0 : if (push == NULL) {
7948 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7949 0 : return NULL;
7950 : }
7951 :
7952 0 : push->flags |= ndr_push_flags;
7953 :
7954 0 : err = call->ndr_push(push, ndr_inout_flags, object);
7955 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7956 0 : TALLOC_FREE(push);
7957 0 : PyErr_SetNdrError(err);
7958 0 : return NULL;
7959 : }
7960 0 : blob = ndr_push_blob(push);
7961 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7962 0 : TALLOC_FREE(push);
7963 0 : return ret;
7964 : }
7965 :
7966 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7967 : {
7968 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7969 0 : PyObject *bigendian_obj = NULL;
7970 0 : PyObject *ndr64_obj = NULL;
7971 0 : libndr_flags ndr_push_flags = 0;
7972 :
7973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
7974 : discard_const_p(char *, kwnames),
7975 : &bigendian_obj,
7976 : &ndr64_obj)) {
7977 0 : return NULL;
7978 : }
7979 :
7980 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7981 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7982 : }
7983 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7984 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7985 : }
7986 :
7987 0 : return py_svcctl_LockServiceDatabase_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
7988 : }
7989 :
7990 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7991 : {
7992 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7993 0 : PyObject *bigendian_obj = NULL;
7994 0 : PyObject *ndr64_obj = NULL;
7995 0 : libndr_flags ndr_push_flags = 0;
7996 :
7997 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
7998 : discard_const_p(char *, kwnames),
7999 : &bigendian_obj,
8000 : &ndr64_obj)) {
8001 0 : return NULL;
8002 : }
8003 :
8004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8005 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8006 : }
8007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8008 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8009 : }
8010 :
8011 0 : return py_svcctl_LockServiceDatabase_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
8012 : }
8013 :
8014 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
8015 : {
8016 0 : const struct ndr_interface_call *call = NULL;
8017 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
8018 0 : struct ndr_pull *pull = NULL;
8019 0 : enum ndr_err_code err;
8020 :
8021 0 : if (ndr_table_svcctl.num_calls < 4) {
8022 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_unpack");
8023 0 : return NULL;
8024 : }
8025 0 : call = &ndr_table_svcctl.calls[3];
8026 :
8027 0 : pull = ndr_pull_init_blob(blob, object);
8028 0 : if (pull == NULL) {
8029 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8030 0 : return NULL;
8031 : }
8032 :
8033 0 : pull->flags |= ndr_pull_flags;
8034 :
8035 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
8036 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8037 0 : TALLOC_FREE(pull);
8038 0 : PyErr_SetNdrError(err);
8039 0 : return NULL;
8040 : }
8041 0 : if (!allow_remaining) {
8042 0 : uint32_t highest_ofs;
8043 :
8044 0 : if (pull->offset > pull->relative_highest_offset) {
8045 0 : highest_ofs = pull->offset;
8046 : } else {
8047 0 : highest_ofs = pull->relative_highest_offset;
8048 : }
8049 0 : if (highest_ofs < pull->data_size) {
8050 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
8051 : "not all bytes consumed ofs[%u] size[%u]",
8052 : highest_ofs, pull->data_size);
8053 0 : TALLOC_FREE(pull);
8054 0 : PyErr_SetNdrError(err);
8055 0 : return NULL;
8056 : }
8057 : }
8058 :
8059 0 : TALLOC_FREE(pull);
8060 0 : Py_RETURN_NONE;
8061 : }
8062 :
8063 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8064 : {
8065 0 : DATA_BLOB blob;
8066 0 : Py_ssize_t blob_length = 0;
8067 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8068 0 : PyObject *bigendian_obj = NULL;
8069 0 : PyObject *ndr64_obj = NULL;
8070 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8071 0 : PyObject *allow_remaining_obj = NULL;
8072 0 : bool allow_remaining = false;
8073 :
8074 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
8075 : discard_const_p(char *, kwnames),
8076 : &blob.data, &blob_length,
8077 : &bigendian_obj,
8078 : &ndr64_obj,
8079 : &allow_remaining_obj)) {
8080 0 : return NULL;
8081 : }
8082 0 : blob.length = blob_length;
8083 :
8084 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8085 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8086 : }
8087 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8088 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8089 : }
8090 :
8091 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8092 0 : allow_remaining = true;
8093 : }
8094 :
8095 0 : return py_svcctl_LockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
8096 : }
8097 :
8098 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8099 : {
8100 0 : DATA_BLOB blob;
8101 0 : Py_ssize_t blob_length = 0;
8102 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8103 0 : PyObject *bigendian_obj = NULL;
8104 0 : PyObject *ndr64_obj = NULL;
8105 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8106 0 : PyObject *allow_remaining_obj = NULL;
8107 0 : bool allow_remaining = false;
8108 :
8109 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
8110 : discard_const_p(char *, kwnames),
8111 : &blob.data, &blob_length,
8112 : &bigendian_obj,
8113 : &ndr64_obj,
8114 : &allow_remaining_obj)) {
8115 0 : return NULL;
8116 : }
8117 0 : blob.length = blob_length;
8118 :
8119 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8120 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8121 : }
8122 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8123 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8124 : }
8125 :
8126 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8127 0 : allow_remaining = true;
8128 : }
8129 :
8130 0 : return py_svcctl_LockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
8131 : }
8132 :
8133 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
8134 : {
8135 0 : const struct ndr_interface_call *call = NULL;
8136 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
8137 0 : PyObject *ret;
8138 0 : char *retstr;
8139 :
8140 0 : if (ndr_table_svcctl.num_calls < 4) {
8141 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_print");
8142 0 : return NULL;
8143 : }
8144 0 : call = &ndr_table_svcctl.calls[3];
8145 :
8146 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
8147 0 : ret = PyUnicode_FromString(retstr);
8148 0 : TALLOC_FREE(retstr);
8149 :
8150 0 : return ret;
8151 : }
8152 :
8153 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8154 : {
8155 0 : return py_svcctl_LockServiceDatabase_ndr_print(py_obj, "svcctl_LockServiceDatabase_in", NDR_IN);
8156 : }
8157 :
8158 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8159 : {
8160 0 : return py_svcctl_LockServiceDatabase_ndr_print(py_obj, "svcctl_LockServiceDatabase_out", NDR_OUT);
8161 : }
8162 :
8163 : static PyMethodDef py_svcctl_LockServiceDatabase_methods[] = {
8164 : { "opnum", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_opnum, METH_NOARGS|METH_CLASS,
8165 : "svcctl.LockServiceDatabase.opnum() -> 3 (0x03) " },
8166 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
8167 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
8168 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
8169 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
8170 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
8171 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
8172 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
8173 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
8174 : { "__ndr_print_in__", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
8175 : { "__ndr_print_out__", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
8176 : { NULL, NULL, 0, NULL }
8177 : };
8178 :
8179 :
8180 : static PyTypeObject svcctl_LockServiceDatabase_Type = {
8181 : PyVarObject_HEAD_INIT(NULL, 0)
8182 : .tp_name = "svcctl.LockServiceDatabase",
8183 : .tp_getset = py_svcctl_LockServiceDatabase_getsetters,
8184 : .tp_methods = py_svcctl_LockServiceDatabase_methods,
8185 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8186 : .tp_new = py_svcctl_LockServiceDatabase_new,
8187 : };
8188 :
8189 0 : static bool pack_py_svcctl_LockServiceDatabase_args_in(PyObject *args, PyObject *kwargs, struct svcctl_LockServiceDatabase *r)
8190 : {
8191 0 : PyObject *py_handle;
8192 0 : const char *kwnames[] = {
8193 : "handle", NULL
8194 : };
8195 :
8196 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_LockServiceDatabase", discard_const_p(char *, kwnames), &py_handle)) {
8197 0 : return false;
8198 : }
8199 :
8200 0 : if (py_handle == NULL) {
8201 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
8202 0 : return false;
8203 : }
8204 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
8205 0 : if (r->in.handle == NULL) {
8206 0 : PyErr_NoMemory();
8207 0 : return false;
8208 : }
8209 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
8210 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
8211 0 : PyErr_NoMemory();
8212 0 : return false;
8213 : }
8214 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
8215 0 : return true;
8216 : }
8217 :
8218 0 : static PyObject *unpack_py_svcctl_LockServiceDatabase_args_out(struct svcctl_LockServiceDatabase *r)
8219 : {
8220 0 : PyObject *result;
8221 0 : PyObject *py_lock;
8222 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, r->out.lock, r->out.lock);
8223 0 : result = py_lock;
8224 0 : if (!W_ERROR_IS_OK(r->out.result)) {
8225 0 : PyErr_SetWERROR(r->out.result);
8226 0 : return NULL;
8227 : }
8228 :
8229 0 : return result;
8230 : }
8231 :
8232 :
8233 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_handle(PyObject *obj, void *closure)
8234 : {
8235 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
8236 0 : PyObject *py_handle;
8237 0 : if (object->in.handle == NULL) {
8238 0 : Py_RETURN_NONE;
8239 : }
8240 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
8241 0 : return py_handle;
8242 : }
8243 :
8244 0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
8245 : {
8246 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8247 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
8248 0 : if (value == NULL) {
8249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
8250 0 : return -1;
8251 : }
8252 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
8253 0 : if (object->in.handle == NULL) {
8254 0 : PyErr_NoMemory();
8255 0 : return -1;
8256 : }
8257 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
8258 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8259 0 : PyErr_NoMemory();
8260 0 : return -1;
8261 : }
8262 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
8263 0 : return 0;
8264 : }
8265 :
8266 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_security_flags(PyObject *obj, void *closure)
8267 : {
8268 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
8269 0 : PyObject *py_security_flags;
8270 0 : py_security_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.security_flags);
8271 0 : return py_security_flags;
8272 : }
8273 :
8274 0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_security_flags(PyObject *py_obj, PyObject *value, void *closure)
8275 : {
8276 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8277 0 : if (value == NULL) {
8278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.security_flags");
8279 0 : return -1;
8280 : }
8281 : {
8282 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.security_flags));
8283 0 : if (PyLong_Check(value)) {
8284 0 : unsigned long long test_var;
8285 0 : test_var = PyLong_AsUnsignedLongLong(value);
8286 0 : if (PyErr_Occurred() != NULL) {
8287 0 : return -1;
8288 : }
8289 0 : if (test_var > uint_max) {
8290 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8291 : PyLong_Type.tp_name, uint_max, test_var);
8292 0 : return -1;
8293 : }
8294 0 : object->in.security_flags = test_var;
8295 : } else {
8296 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8297 : PyLong_Type.tp_name);
8298 0 : return -1;
8299 : }
8300 : }
8301 0 : return 0;
8302 : }
8303 :
8304 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_out_get_buffer(PyObject *obj, void *closure)
8305 : {
8306 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
8307 0 : PyObject *py_buffer;
8308 0 : if (object->out.buffer == NULL) {
8309 0 : Py_RETURN_NONE;
8310 : }
8311 0 : py_buffer = PyList_New(object->in.offered);
8312 0 : if (py_buffer == NULL) {
8313 0 : return NULL;
8314 : }
8315 : {
8316 : int buffer_cntr_1;
8317 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
8318 0 : PyObject *py_buffer_1;
8319 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_1]);
8320 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
8321 : }
8322 : }
8323 0 : return py_buffer;
8324 : }
8325 :
8326 0 : static int py_svcctl_QueryServiceObjectSecurity_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
8327 : {
8328 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8329 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
8330 0 : if (value == NULL) {
8331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
8332 0 : return -1;
8333 : }
8334 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
8335 0 : if (object->out.buffer == NULL) {
8336 0 : PyErr_NoMemory();
8337 0 : return -1;
8338 : }
8339 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8340 : {
8341 0 : int buffer_cntr_1;
8342 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
8343 0 : if (!object->out.buffer) { return -1; }
8344 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
8345 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
8346 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
8347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_1]");
8348 0 : return -1;
8349 : }
8350 : {
8351 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_1]));
8352 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
8353 0 : unsigned long long test_var;
8354 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
8355 0 : if (PyErr_Occurred() != NULL) {
8356 0 : return -1;
8357 : }
8358 0 : if (test_var > uint_max) {
8359 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8360 : PyLong_Type.tp_name, uint_max, test_var);
8361 0 : return -1;
8362 : }
8363 0 : object->out.buffer[buffer_cntr_1] = test_var;
8364 : } else {
8365 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8366 : PyLong_Type.tp_name);
8367 0 : return -1;
8368 : }
8369 : }
8370 : }
8371 : }
8372 0 : return 0;
8373 : }
8374 :
8375 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_offered(PyObject *obj, void *closure)
8376 : {
8377 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
8378 0 : PyObject *py_offered;
8379 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
8380 0 : return py_offered;
8381 : }
8382 :
8383 0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
8384 : {
8385 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8386 0 : if (value == NULL) {
8387 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
8388 0 : return -1;
8389 : }
8390 : {
8391 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
8392 0 : if (PyLong_Check(value)) {
8393 0 : unsigned long long test_var;
8394 0 : test_var = PyLong_AsUnsignedLongLong(value);
8395 0 : if (PyErr_Occurred() != NULL) {
8396 0 : return -1;
8397 : }
8398 0 : if (test_var > uint_max) {
8399 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8400 : PyLong_Type.tp_name, uint_max, test_var);
8401 0 : return -1;
8402 : }
8403 0 : object->in.offered = test_var;
8404 : } else {
8405 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8406 : PyLong_Type.tp_name);
8407 0 : return -1;
8408 : }
8409 : }
8410 0 : return 0;
8411 : }
8412 :
8413 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_out_get_needed(PyObject *obj, void *closure)
8414 : {
8415 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
8416 0 : PyObject *py_needed;
8417 0 : if (object->out.needed == NULL) {
8418 0 : Py_RETURN_NONE;
8419 : }
8420 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
8421 0 : return py_needed;
8422 : }
8423 :
8424 0 : static int py_svcctl_QueryServiceObjectSecurity_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
8425 : {
8426 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8427 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
8428 0 : if (value == NULL) {
8429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
8430 0 : return -1;
8431 : }
8432 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
8433 0 : if (object->out.needed == NULL) {
8434 0 : PyErr_NoMemory();
8435 0 : return -1;
8436 : }
8437 : {
8438 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
8439 0 : if (PyLong_Check(value)) {
8440 0 : unsigned long long test_var;
8441 0 : test_var = PyLong_AsUnsignedLongLong(value);
8442 0 : if (PyErr_Occurred() != NULL) {
8443 0 : return -1;
8444 : }
8445 0 : if (test_var > uint_max) {
8446 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8447 : PyLong_Type.tp_name, uint_max, test_var);
8448 0 : return -1;
8449 : }
8450 0 : *object->out.needed = test_var;
8451 : } else {
8452 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8453 : PyLong_Type.tp_name);
8454 0 : return -1;
8455 : }
8456 : }
8457 0 : return 0;
8458 : }
8459 :
8460 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_get_result(PyObject *obj, void *closure)
8461 : {
8462 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
8463 0 : PyObject *py_result;
8464 0 : py_result = PyErr_FromWERROR(object->out.result);
8465 0 : return py_result;
8466 : }
8467 :
8468 0 : static int py_svcctl_QueryServiceObjectSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
8469 : {
8470 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8471 0 : if (value == NULL) {
8472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
8473 0 : return -1;
8474 : }
8475 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
8476 0 : return 0;
8477 : }
8478 :
8479 : static PyGetSetDef py_svcctl_QueryServiceObjectSecurity_getsetters[] = {
8480 : {
8481 : .name = discard_const_p(char, "in_handle"),
8482 : .get = py_svcctl_QueryServiceObjectSecurity_in_get_handle,
8483 : .set = py_svcctl_QueryServiceObjectSecurity_in_set_handle,
8484 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
8485 : },
8486 : {
8487 : .name = discard_const_p(char, "in_security_flags"),
8488 : .get = py_svcctl_QueryServiceObjectSecurity_in_get_security_flags,
8489 : .set = py_svcctl_QueryServiceObjectSecurity_in_set_security_flags,
8490 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
8491 : },
8492 : {
8493 : .name = discard_const_p(char, "out_buffer"),
8494 : .get = py_svcctl_QueryServiceObjectSecurity_out_get_buffer,
8495 : .set = py_svcctl_QueryServiceObjectSecurity_out_set_buffer,
8496 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8497 : },
8498 : {
8499 : .name = discard_const_p(char, "in_offered"),
8500 : .get = py_svcctl_QueryServiceObjectSecurity_in_get_offered,
8501 : .set = py_svcctl_QueryServiceObjectSecurity_in_set_offered,
8502 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8503 : },
8504 : {
8505 : .name = discard_const_p(char, "out_needed"),
8506 : .get = py_svcctl_QueryServiceObjectSecurity_out_get_needed,
8507 : .set = py_svcctl_QueryServiceObjectSecurity_out_set_needed,
8508 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8509 : },
8510 : {
8511 : .name = discard_const_p(char, "result"),
8512 : .get = py_svcctl_QueryServiceObjectSecurity_get_result,
8513 : .set = py_svcctl_QueryServiceObjectSecurity_set_result,
8514 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
8515 : },
8516 : { .name = NULL }
8517 : };
8518 :
8519 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8520 : {
8521 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceObjectSecurity, type);
8522 0 : struct svcctl_QueryServiceObjectSecurity *_self = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(self);
8523 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
8524 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
8525 0 : _self->out.buffer = talloc_zero(mem_ctx, uint8_t);
8526 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
8527 0 : return self;
8528 : }
8529 :
8530 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
8531 : {
8532 :
8533 :
8534 0 : return PyLong_FromLong(4);
8535 : }
8536 :
8537 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
8538 : {
8539 0 : const struct ndr_interface_call *call = NULL;
8540 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8541 0 : PyObject *ret = NULL;
8542 0 : struct ndr_push *push = NULL;
8543 0 : DATA_BLOB blob;
8544 0 : enum ndr_err_code err;
8545 :
8546 0 : if (ndr_table_svcctl.num_calls < 5) {
8547 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_pack");
8548 0 : return NULL;
8549 : }
8550 0 : call = &ndr_table_svcctl.calls[4];
8551 :
8552 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
8553 0 : if (push == NULL) {
8554 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8555 0 : return NULL;
8556 : }
8557 :
8558 0 : push->flags |= ndr_push_flags;
8559 :
8560 0 : err = call->ndr_push(push, ndr_inout_flags, object);
8561 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8562 0 : TALLOC_FREE(push);
8563 0 : PyErr_SetNdrError(err);
8564 0 : return NULL;
8565 : }
8566 0 : blob = ndr_push_blob(push);
8567 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8568 0 : TALLOC_FREE(push);
8569 0 : return ret;
8570 : }
8571 :
8572 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8573 : {
8574 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8575 0 : PyObject *bigendian_obj = NULL;
8576 0 : PyObject *ndr64_obj = NULL;
8577 0 : libndr_flags ndr_push_flags = 0;
8578 :
8579 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
8580 : discard_const_p(char *, kwnames),
8581 : &bigendian_obj,
8582 : &ndr64_obj)) {
8583 0 : return NULL;
8584 : }
8585 :
8586 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8587 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8588 : }
8589 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8590 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8591 : }
8592 :
8593 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
8594 : }
8595 :
8596 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8597 : {
8598 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8599 0 : PyObject *bigendian_obj = NULL;
8600 0 : PyObject *ndr64_obj = NULL;
8601 0 : libndr_flags ndr_push_flags = 0;
8602 :
8603 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
8604 : discard_const_p(char *, kwnames),
8605 : &bigendian_obj,
8606 : &ndr64_obj)) {
8607 0 : return NULL;
8608 : }
8609 :
8610 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8611 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8612 : }
8613 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8614 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8615 : }
8616 :
8617 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
8618 : }
8619 :
8620 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
8621 : {
8622 0 : const struct ndr_interface_call *call = NULL;
8623 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8624 0 : struct ndr_pull *pull = NULL;
8625 0 : enum ndr_err_code err;
8626 :
8627 0 : if (ndr_table_svcctl.num_calls < 5) {
8628 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_unpack");
8629 0 : return NULL;
8630 : }
8631 0 : call = &ndr_table_svcctl.calls[4];
8632 :
8633 0 : pull = ndr_pull_init_blob(blob, object);
8634 0 : if (pull == NULL) {
8635 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8636 0 : return NULL;
8637 : }
8638 :
8639 0 : pull->flags |= ndr_pull_flags;
8640 :
8641 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
8642 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8643 0 : TALLOC_FREE(pull);
8644 0 : PyErr_SetNdrError(err);
8645 0 : return NULL;
8646 : }
8647 0 : if (!allow_remaining) {
8648 0 : uint32_t highest_ofs;
8649 :
8650 0 : if (pull->offset > pull->relative_highest_offset) {
8651 0 : highest_ofs = pull->offset;
8652 : } else {
8653 0 : highest_ofs = pull->relative_highest_offset;
8654 : }
8655 0 : if (highest_ofs < pull->data_size) {
8656 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
8657 : "not all bytes consumed ofs[%u] size[%u]",
8658 : highest_ofs, pull->data_size);
8659 0 : TALLOC_FREE(pull);
8660 0 : PyErr_SetNdrError(err);
8661 0 : return NULL;
8662 : }
8663 : }
8664 :
8665 0 : TALLOC_FREE(pull);
8666 0 : Py_RETURN_NONE;
8667 : }
8668 :
8669 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8670 : {
8671 0 : DATA_BLOB blob;
8672 0 : Py_ssize_t blob_length = 0;
8673 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8674 0 : PyObject *bigendian_obj = NULL;
8675 0 : PyObject *ndr64_obj = NULL;
8676 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8677 0 : PyObject *allow_remaining_obj = NULL;
8678 0 : bool allow_remaining = false;
8679 :
8680 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
8681 : discard_const_p(char *, kwnames),
8682 : &blob.data, &blob_length,
8683 : &bigendian_obj,
8684 : &ndr64_obj,
8685 : &allow_remaining_obj)) {
8686 0 : return NULL;
8687 : }
8688 0 : blob.length = blob_length;
8689 :
8690 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8691 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8692 : }
8693 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8694 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8695 : }
8696 :
8697 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8698 0 : allow_remaining = true;
8699 : }
8700 :
8701 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
8702 : }
8703 :
8704 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8705 : {
8706 0 : DATA_BLOB blob;
8707 0 : Py_ssize_t blob_length = 0;
8708 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8709 0 : PyObject *bigendian_obj = NULL;
8710 0 : PyObject *ndr64_obj = NULL;
8711 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8712 0 : PyObject *allow_remaining_obj = NULL;
8713 0 : bool allow_remaining = false;
8714 :
8715 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
8716 : discard_const_p(char *, kwnames),
8717 : &blob.data, &blob_length,
8718 : &bigendian_obj,
8719 : &ndr64_obj,
8720 : &allow_remaining_obj)) {
8721 0 : return NULL;
8722 : }
8723 0 : blob.length = blob_length;
8724 :
8725 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8726 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8727 : }
8728 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8729 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8730 : }
8731 :
8732 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8733 0 : allow_remaining = true;
8734 : }
8735 :
8736 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
8737 : }
8738 :
8739 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
8740 : {
8741 0 : const struct ndr_interface_call *call = NULL;
8742 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8743 0 : PyObject *ret;
8744 0 : char *retstr;
8745 :
8746 0 : if (ndr_table_svcctl.num_calls < 5) {
8747 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_print");
8748 0 : return NULL;
8749 : }
8750 0 : call = &ndr_table_svcctl.calls[4];
8751 :
8752 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
8753 0 : ret = PyUnicode_FromString(retstr);
8754 0 : TALLOC_FREE(retstr);
8755 :
8756 0 : return ret;
8757 : }
8758 :
8759 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8760 : {
8761 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_print(py_obj, "svcctl_QueryServiceObjectSecurity_in", NDR_IN);
8762 : }
8763 :
8764 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8765 : {
8766 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_print(py_obj, "svcctl_QueryServiceObjectSecurity_out", NDR_OUT);
8767 : }
8768 :
8769 : static PyMethodDef py_svcctl_QueryServiceObjectSecurity_methods[] = {
8770 : { "opnum", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
8771 : "svcctl.QueryServiceObjectSecurity.opnum() -> 4 (0x04) " },
8772 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
8773 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
8774 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
8775 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
8776 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
8777 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
8778 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
8779 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
8780 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
8781 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
8782 : { NULL, NULL, 0, NULL }
8783 : };
8784 :
8785 :
8786 : static PyTypeObject svcctl_QueryServiceObjectSecurity_Type = {
8787 : PyVarObject_HEAD_INIT(NULL, 0)
8788 : .tp_name = "svcctl.QueryServiceObjectSecurity",
8789 : .tp_getset = py_svcctl_QueryServiceObjectSecurity_getsetters,
8790 : .tp_methods = py_svcctl_QueryServiceObjectSecurity_methods,
8791 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8792 : .tp_new = py_svcctl_QueryServiceObjectSecurity_new,
8793 : };
8794 :
8795 0 : static bool pack_py_svcctl_QueryServiceObjectSecurity_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceObjectSecurity *r)
8796 : {
8797 0 : PyObject *py_handle;
8798 0 : PyObject *py_security_flags;
8799 0 : PyObject *py_offered;
8800 0 : const char *kwnames[] = {
8801 : "handle", "security_flags", "offered", NULL
8802 : };
8803 :
8804 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceObjectSecurity", discard_const_p(char *, kwnames), &py_handle, &py_security_flags, &py_offered)) {
8805 0 : return false;
8806 : }
8807 :
8808 0 : if (py_handle == NULL) {
8809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
8810 0 : return false;
8811 : }
8812 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
8813 0 : if (r->in.handle == NULL) {
8814 0 : PyErr_NoMemory();
8815 0 : return false;
8816 : }
8817 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
8818 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
8819 0 : PyErr_NoMemory();
8820 0 : return false;
8821 : }
8822 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
8823 0 : if (py_security_flags == NULL) {
8824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.security_flags");
8825 0 : return false;
8826 : }
8827 : {
8828 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.security_flags));
8829 0 : if (PyLong_Check(py_security_flags)) {
8830 0 : unsigned long long test_var;
8831 0 : test_var = PyLong_AsUnsignedLongLong(py_security_flags);
8832 0 : if (PyErr_Occurred() != NULL) {
8833 0 : return false;
8834 : }
8835 0 : if (test_var > uint_max) {
8836 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8837 : PyLong_Type.tp_name, uint_max, test_var);
8838 0 : return false;
8839 : }
8840 0 : r->in.security_flags = test_var;
8841 : } else {
8842 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8843 : PyLong_Type.tp_name);
8844 0 : return false;
8845 : }
8846 : }
8847 0 : if (py_offered == NULL) {
8848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
8849 0 : return false;
8850 : }
8851 : {
8852 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
8853 0 : if (PyLong_Check(py_offered)) {
8854 0 : unsigned long long test_var;
8855 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
8856 0 : if (PyErr_Occurred() != NULL) {
8857 0 : return false;
8858 : }
8859 0 : if (test_var > uint_max) {
8860 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8861 : PyLong_Type.tp_name, uint_max, test_var);
8862 0 : return false;
8863 : }
8864 0 : r->in.offered = test_var;
8865 : } else {
8866 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8867 : PyLong_Type.tp_name);
8868 0 : return false;
8869 : }
8870 : }
8871 0 : return true;
8872 : }
8873 :
8874 0 : static PyObject *unpack_py_svcctl_QueryServiceObjectSecurity_args_out(struct svcctl_QueryServiceObjectSecurity *r)
8875 : {
8876 0 : PyObject *result;
8877 0 : PyObject *py_buffer;
8878 0 : PyObject *py_needed;
8879 0 : result = PyTuple_New(2);
8880 0 : py_buffer = PyList_New(r->in.offered);
8881 0 : if (py_buffer == NULL) {
8882 0 : return NULL;
8883 : }
8884 : {
8885 : int buffer_cntr_1;
8886 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
8887 0 : PyObject *py_buffer_1;
8888 0 : py_buffer_1 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_1]);
8889 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
8890 : }
8891 : }
8892 0 : PyTuple_SetItem(result, 0, py_buffer);
8893 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
8894 0 : PyTuple_SetItem(result, 1, py_needed);
8895 0 : if (!W_ERROR_IS_OK(r->out.result)) {
8896 0 : PyErr_SetWERROR(r->out.result);
8897 0 : return NULL;
8898 : }
8899 :
8900 0 : return result;
8901 : }
8902 :
8903 :
8904 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_handle(PyObject *obj, void *closure)
8905 : {
8906 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
8907 0 : PyObject *py_handle;
8908 0 : if (object->in.handle == NULL) {
8909 0 : Py_RETURN_NONE;
8910 : }
8911 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
8912 0 : return py_handle;
8913 : }
8914 :
8915 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
8916 : {
8917 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8918 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
8919 0 : if (value == NULL) {
8920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
8921 0 : return -1;
8922 : }
8923 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
8924 0 : if (object->in.handle == NULL) {
8925 0 : PyErr_NoMemory();
8926 0 : return -1;
8927 : }
8928 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
8929 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8930 0 : PyErr_NoMemory();
8931 0 : return -1;
8932 : }
8933 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
8934 0 : return 0;
8935 : }
8936 :
8937 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_security_flags(PyObject *obj, void *closure)
8938 : {
8939 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
8940 0 : PyObject *py_security_flags;
8941 0 : py_security_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.security_flags);
8942 0 : return py_security_flags;
8943 : }
8944 :
8945 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_security_flags(PyObject *py_obj, PyObject *value, void *closure)
8946 : {
8947 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
8948 0 : if (value == NULL) {
8949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.security_flags");
8950 0 : return -1;
8951 : }
8952 : {
8953 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.security_flags));
8954 0 : if (PyLong_Check(value)) {
8955 0 : unsigned long long test_var;
8956 0 : test_var = PyLong_AsUnsignedLongLong(value);
8957 0 : if (PyErr_Occurred() != NULL) {
8958 0 : return -1;
8959 : }
8960 0 : if (test_var > uint_max) {
8961 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8962 : PyLong_Type.tp_name, uint_max, test_var);
8963 0 : return -1;
8964 : }
8965 0 : object->in.security_flags = test_var;
8966 : } else {
8967 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8968 : PyLong_Type.tp_name);
8969 0 : return -1;
8970 : }
8971 : }
8972 0 : return 0;
8973 : }
8974 :
8975 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_buffer(PyObject *obj, void *closure)
8976 : {
8977 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
8978 0 : PyObject *py_buffer;
8979 0 : if (object->in.buffer == NULL) {
8980 0 : Py_RETURN_NONE;
8981 : }
8982 0 : py_buffer = PyList_New(object->in.offered);
8983 0 : if (py_buffer == NULL) {
8984 0 : return NULL;
8985 : }
8986 : {
8987 : int buffer_cntr_1;
8988 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
8989 0 : PyObject *py_buffer_1;
8990 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->in.buffer[buffer_cntr_1]);
8991 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
8992 : }
8993 : }
8994 0 : return py_buffer;
8995 : }
8996 :
8997 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
8998 : {
8999 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
9000 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
9001 0 : if (value == NULL) {
9002 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer");
9003 0 : return -1;
9004 : }
9005 0 : object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
9006 0 : if (object->in.buffer == NULL) {
9007 0 : PyErr_NoMemory();
9008 0 : return -1;
9009 : }
9010 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9011 : {
9012 0 : int buffer_cntr_1;
9013 0 : object->in.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer, PyList_GET_SIZE(value));
9014 0 : if (!object->in.buffer) { return -1; }
9015 0 : talloc_set_name_const(object->in.buffer, "ARRAY: object->in.buffer");
9016 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
9017 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
9018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer[buffer_cntr_1]");
9019 0 : return -1;
9020 : }
9021 : {
9022 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffer[buffer_cntr_1]));
9023 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
9024 0 : unsigned long long test_var;
9025 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
9026 0 : if (PyErr_Occurred() != NULL) {
9027 0 : return -1;
9028 : }
9029 0 : if (test_var > uint_max) {
9030 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9031 : PyLong_Type.tp_name, uint_max, test_var);
9032 0 : return -1;
9033 : }
9034 0 : object->in.buffer[buffer_cntr_1] = test_var;
9035 : } else {
9036 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9037 : PyLong_Type.tp_name);
9038 0 : return -1;
9039 : }
9040 : }
9041 : }
9042 : }
9043 0 : return 0;
9044 : }
9045 :
9046 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_offered(PyObject *obj, void *closure)
9047 : {
9048 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
9049 0 : PyObject *py_offered;
9050 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
9051 0 : return py_offered;
9052 : }
9053 :
9054 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
9055 : {
9056 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
9057 0 : if (value == NULL) {
9058 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
9059 0 : return -1;
9060 : }
9061 : {
9062 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
9063 0 : if (PyLong_Check(value)) {
9064 0 : unsigned long long test_var;
9065 0 : test_var = PyLong_AsUnsignedLongLong(value);
9066 0 : if (PyErr_Occurred() != NULL) {
9067 0 : return -1;
9068 : }
9069 0 : if (test_var > uint_max) {
9070 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9071 : PyLong_Type.tp_name, uint_max, test_var);
9072 0 : return -1;
9073 : }
9074 0 : object->in.offered = test_var;
9075 : } else {
9076 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9077 : PyLong_Type.tp_name);
9078 0 : return -1;
9079 : }
9080 : }
9081 0 : return 0;
9082 : }
9083 :
9084 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_get_result(PyObject *obj, void *closure)
9085 : {
9086 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
9087 0 : PyObject *py_result;
9088 0 : py_result = PyErr_FromWERROR(object->out.result);
9089 0 : return py_result;
9090 : }
9091 :
9092 0 : static int py_svcctl_SetServiceObjectSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
9093 : {
9094 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
9095 0 : if (value == NULL) {
9096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
9097 0 : return -1;
9098 : }
9099 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
9100 0 : return 0;
9101 : }
9102 :
9103 : static PyGetSetDef py_svcctl_SetServiceObjectSecurity_getsetters[] = {
9104 : {
9105 : .name = discard_const_p(char, "in_handle"),
9106 : .get = py_svcctl_SetServiceObjectSecurity_in_get_handle,
9107 : .set = py_svcctl_SetServiceObjectSecurity_in_set_handle,
9108 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
9109 : },
9110 : {
9111 : .name = discard_const_p(char, "in_security_flags"),
9112 : .get = py_svcctl_SetServiceObjectSecurity_in_get_security_flags,
9113 : .set = py_svcctl_SetServiceObjectSecurity_in_set_security_flags,
9114 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
9115 : },
9116 : {
9117 : .name = discard_const_p(char, "in_buffer"),
9118 : .get = py_svcctl_SetServiceObjectSecurity_in_get_buffer,
9119 : .set = py_svcctl_SetServiceObjectSecurity_in_set_buffer,
9120 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9121 : },
9122 : {
9123 : .name = discard_const_p(char, "in_offered"),
9124 : .get = py_svcctl_SetServiceObjectSecurity_in_get_offered,
9125 : .set = py_svcctl_SetServiceObjectSecurity_in_set_offered,
9126 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9127 : },
9128 : {
9129 : .name = discard_const_p(char, "result"),
9130 : .get = py_svcctl_SetServiceObjectSecurity_get_result,
9131 : .set = py_svcctl_SetServiceObjectSecurity_set_result,
9132 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
9133 : },
9134 : { .name = NULL }
9135 : };
9136 :
9137 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9138 : {
9139 0 : PyObject *self = pytalloc_new(struct svcctl_SetServiceObjectSecurity, type);
9140 0 : struct svcctl_SetServiceObjectSecurity *_self = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(self);
9141 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
9142 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
9143 0 : _self->in.buffer = talloc_zero(mem_ctx, uint8_t);
9144 0 : return self;
9145 : }
9146 :
9147 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
9148 : {
9149 :
9150 :
9151 0 : return PyLong_FromLong(5);
9152 : }
9153 :
9154 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
9155 : {
9156 0 : const struct ndr_interface_call *call = NULL;
9157 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
9158 0 : PyObject *ret = NULL;
9159 0 : struct ndr_push *push = NULL;
9160 0 : DATA_BLOB blob;
9161 0 : enum ndr_err_code err;
9162 :
9163 0 : if (ndr_table_svcctl.num_calls < 6) {
9164 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_pack");
9165 0 : return NULL;
9166 : }
9167 0 : call = &ndr_table_svcctl.calls[5];
9168 :
9169 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
9170 0 : if (push == NULL) {
9171 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9172 0 : return NULL;
9173 : }
9174 :
9175 0 : push->flags |= ndr_push_flags;
9176 :
9177 0 : err = call->ndr_push(push, ndr_inout_flags, object);
9178 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9179 0 : TALLOC_FREE(push);
9180 0 : PyErr_SetNdrError(err);
9181 0 : return NULL;
9182 : }
9183 0 : blob = ndr_push_blob(push);
9184 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9185 0 : TALLOC_FREE(push);
9186 0 : return ret;
9187 : }
9188 :
9189 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9190 : {
9191 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9192 0 : PyObject *bigendian_obj = NULL;
9193 0 : PyObject *ndr64_obj = NULL;
9194 0 : libndr_flags ndr_push_flags = 0;
9195 :
9196 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
9197 : discard_const_p(char *, kwnames),
9198 : &bigendian_obj,
9199 : &ndr64_obj)) {
9200 0 : return NULL;
9201 : }
9202 :
9203 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9204 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9205 : }
9206 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9207 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9208 : }
9209 :
9210 0 : return py_svcctl_SetServiceObjectSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
9211 : }
9212 :
9213 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9214 : {
9215 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9216 0 : PyObject *bigendian_obj = NULL;
9217 0 : PyObject *ndr64_obj = NULL;
9218 0 : libndr_flags ndr_push_flags = 0;
9219 :
9220 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
9221 : discard_const_p(char *, kwnames),
9222 : &bigendian_obj,
9223 : &ndr64_obj)) {
9224 0 : return NULL;
9225 : }
9226 :
9227 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9228 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9229 : }
9230 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9231 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9232 : }
9233 :
9234 0 : return py_svcctl_SetServiceObjectSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
9235 : }
9236 :
9237 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
9238 : {
9239 0 : const struct ndr_interface_call *call = NULL;
9240 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
9241 0 : struct ndr_pull *pull = NULL;
9242 0 : enum ndr_err_code err;
9243 :
9244 0 : if (ndr_table_svcctl.num_calls < 6) {
9245 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_unpack");
9246 0 : return NULL;
9247 : }
9248 0 : call = &ndr_table_svcctl.calls[5];
9249 :
9250 0 : pull = ndr_pull_init_blob(blob, object);
9251 0 : if (pull == NULL) {
9252 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9253 0 : return NULL;
9254 : }
9255 :
9256 0 : pull->flags |= ndr_pull_flags;
9257 :
9258 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
9259 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9260 0 : TALLOC_FREE(pull);
9261 0 : PyErr_SetNdrError(err);
9262 0 : return NULL;
9263 : }
9264 0 : if (!allow_remaining) {
9265 0 : uint32_t highest_ofs;
9266 :
9267 0 : if (pull->offset > pull->relative_highest_offset) {
9268 0 : highest_ofs = pull->offset;
9269 : } else {
9270 0 : highest_ofs = pull->relative_highest_offset;
9271 : }
9272 0 : if (highest_ofs < pull->data_size) {
9273 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
9274 : "not all bytes consumed ofs[%u] size[%u]",
9275 : highest_ofs, pull->data_size);
9276 0 : TALLOC_FREE(pull);
9277 0 : PyErr_SetNdrError(err);
9278 0 : return NULL;
9279 : }
9280 : }
9281 :
9282 0 : TALLOC_FREE(pull);
9283 0 : Py_RETURN_NONE;
9284 : }
9285 :
9286 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9287 : {
9288 0 : DATA_BLOB blob;
9289 0 : Py_ssize_t blob_length = 0;
9290 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9291 0 : PyObject *bigendian_obj = NULL;
9292 0 : PyObject *ndr64_obj = NULL;
9293 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9294 0 : PyObject *allow_remaining_obj = NULL;
9295 0 : bool allow_remaining = false;
9296 :
9297 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
9298 : discard_const_p(char *, kwnames),
9299 : &blob.data, &blob_length,
9300 : &bigendian_obj,
9301 : &ndr64_obj,
9302 : &allow_remaining_obj)) {
9303 0 : return NULL;
9304 : }
9305 0 : blob.length = blob_length;
9306 :
9307 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9308 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9309 : }
9310 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9311 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9312 : }
9313 :
9314 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9315 0 : allow_remaining = true;
9316 : }
9317 :
9318 0 : return py_svcctl_SetServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
9319 : }
9320 :
9321 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9322 : {
9323 0 : DATA_BLOB blob;
9324 0 : Py_ssize_t blob_length = 0;
9325 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9326 0 : PyObject *bigendian_obj = NULL;
9327 0 : PyObject *ndr64_obj = NULL;
9328 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9329 0 : PyObject *allow_remaining_obj = NULL;
9330 0 : bool allow_remaining = false;
9331 :
9332 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
9333 : discard_const_p(char *, kwnames),
9334 : &blob.data, &blob_length,
9335 : &bigendian_obj,
9336 : &ndr64_obj,
9337 : &allow_remaining_obj)) {
9338 0 : return NULL;
9339 : }
9340 0 : blob.length = blob_length;
9341 :
9342 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9343 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9344 : }
9345 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9346 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9347 : }
9348 :
9349 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9350 0 : allow_remaining = true;
9351 : }
9352 :
9353 0 : return py_svcctl_SetServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
9354 : }
9355 :
9356 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
9357 : {
9358 0 : const struct ndr_interface_call *call = NULL;
9359 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
9360 0 : PyObject *ret;
9361 0 : char *retstr;
9362 :
9363 0 : if (ndr_table_svcctl.num_calls < 6) {
9364 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_print");
9365 0 : return NULL;
9366 : }
9367 0 : call = &ndr_table_svcctl.calls[5];
9368 :
9369 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
9370 0 : ret = PyUnicode_FromString(retstr);
9371 0 : TALLOC_FREE(retstr);
9372 :
9373 0 : return ret;
9374 : }
9375 :
9376 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9377 : {
9378 0 : return py_svcctl_SetServiceObjectSecurity_ndr_print(py_obj, "svcctl_SetServiceObjectSecurity_in", NDR_IN);
9379 : }
9380 :
9381 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9382 : {
9383 0 : return py_svcctl_SetServiceObjectSecurity_ndr_print(py_obj, "svcctl_SetServiceObjectSecurity_out", NDR_OUT);
9384 : }
9385 :
9386 : static PyMethodDef py_svcctl_SetServiceObjectSecurity_methods[] = {
9387 : { "opnum", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
9388 : "svcctl.SetServiceObjectSecurity.opnum() -> 5 (0x05) " },
9389 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
9390 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
9391 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
9392 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
9393 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
9394 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
9395 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
9396 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
9397 : { "__ndr_print_in__", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
9398 : { "__ndr_print_out__", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
9399 : { NULL, NULL, 0, NULL }
9400 : };
9401 :
9402 :
9403 : static PyTypeObject svcctl_SetServiceObjectSecurity_Type = {
9404 : PyVarObject_HEAD_INIT(NULL, 0)
9405 : .tp_name = "svcctl.SetServiceObjectSecurity",
9406 : .tp_getset = py_svcctl_SetServiceObjectSecurity_getsetters,
9407 : .tp_methods = py_svcctl_SetServiceObjectSecurity_methods,
9408 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9409 : .tp_new = py_svcctl_SetServiceObjectSecurity_new,
9410 : };
9411 :
9412 0 : static bool pack_py_svcctl_SetServiceObjectSecurity_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SetServiceObjectSecurity *r)
9413 : {
9414 0 : PyObject *py_handle;
9415 0 : PyObject *py_security_flags;
9416 0 : PyObject *py_buffer;
9417 0 : const char *kwnames[] = {
9418 : "handle", "security_flags", "buffer", NULL
9419 : };
9420 :
9421 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_SetServiceObjectSecurity", discard_const_p(char *, kwnames), &py_handle, &py_security_flags, &py_buffer)) {
9422 0 : return false;
9423 : }
9424 :
9425 0 : if (py_handle == NULL) {
9426 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
9427 0 : return false;
9428 : }
9429 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
9430 0 : if (r->in.handle == NULL) {
9431 0 : PyErr_NoMemory();
9432 0 : return false;
9433 : }
9434 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
9435 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
9436 0 : PyErr_NoMemory();
9437 0 : return false;
9438 : }
9439 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
9440 0 : if (py_security_flags == NULL) {
9441 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.security_flags");
9442 0 : return false;
9443 : }
9444 : {
9445 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.security_flags));
9446 0 : if (PyLong_Check(py_security_flags)) {
9447 0 : unsigned long long test_var;
9448 0 : test_var = PyLong_AsUnsignedLongLong(py_security_flags);
9449 0 : if (PyErr_Occurred() != NULL) {
9450 0 : return false;
9451 : }
9452 0 : if (test_var > uint_max) {
9453 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9454 : PyLong_Type.tp_name, uint_max, test_var);
9455 0 : return false;
9456 : }
9457 0 : r->in.security_flags = test_var;
9458 : } else {
9459 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9460 : PyLong_Type.tp_name);
9461 0 : return false;
9462 : }
9463 : }
9464 0 : if (py_buffer == NULL) {
9465 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffer");
9466 0 : return false;
9467 : }
9468 0 : r->in.buffer = talloc_ptrtype(r, r->in.buffer);
9469 0 : if (r->in.buffer == NULL) {
9470 0 : PyErr_NoMemory();
9471 0 : return false;
9472 : }
9473 0 : PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
9474 : {
9475 0 : int buffer_cntr_1;
9476 0 : r->in.buffer = talloc_array_ptrtype(r, r->in.buffer, PyList_GET_SIZE(py_buffer));
9477 0 : if (!r->in.buffer) { return false; }
9478 0 : talloc_set_name_const(r->in.buffer, "ARRAY: r->in.buffer");
9479 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(py_buffer); buffer_cntr_1++) {
9480 0 : if (PyList_GET_ITEM(py_buffer, buffer_cntr_1) == NULL) {
9481 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffer[buffer_cntr_1]");
9482 0 : return false;
9483 : }
9484 : {
9485 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buffer[buffer_cntr_1]));
9486 0 : if (PyLong_Check(PyList_GET_ITEM(py_buffer, buffer_cntr_1))) {
9487 0 : unsigned long long test_var;
9488 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_buffer, buffer_cntr_1));
9489 0 : if (PyErr_Occurred() != NULL) {
9490 0 : return false;
9491 : }
9492 0 : if (test_var > uint_max) {
9493 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9494 : PyLong_Type.tp_name, uint_max, test_var);
9495 0 : return false;
9496 : }
9497 0 : r->in.buffer[buffer_cntr_1] = test_var;
9498 : } else {
9499 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9500 : PyLong_Type.tp_name);
9501 0 : return false;
9502 : }
9503 : }
9504 : }
9505 : }
9506 0 : PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
9507 0 : r->in.offered = PyList_GET_SIZE(py_buffer);
9508 0 : return true;
9509 : }
9510 :
9511 0 : static PyObject *unpack_py_svcctl_SetServiceObjectSecurity_args_out(struct svcctl_SetServiceObjectSecurity *r)
9512 : {
9513 0 : PyObject *result;
9514 0 : result = Py_None;
9515 0 : Py_INCREF(result);
9516 0 : if (!W_ERROR_IS_OK(r->out.result)) {
9517 0 : PyErr_SetWERROR(r->out.result);
9518 0 : return NULL;
9519 : }
9520 :
9521 0 : return result;
9522 : }
9523 :
9524 :
9525 0 : static PyObject *py_svcctl_QueryServiceStatus_in_get_handle(PyObject *obj, void *closure)
9526 : {
9527 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
9528 0 : PyObject *py_handle;
9529 0 : if (object->in.handle == NULL) {
9530 0 : Py_RETURN_NONE;
9531 : }
9532 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
9533 0 : return py_handle;
9534 : }
9535 :
9536 0 : static int py_svcctl_QueryServiceStatus_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
9537 : {
9538 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
9539 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
9540 0 : if (value == NULL) {
9541 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
9542 0 : return -1;
9543 : }
9544 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
9545 0 : if (object->in.handle == NULL) {
9546 0 : PyErr_NoMemory();
9547 0 : return -1;
9548 : }
9549 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
9550 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9551 0 : PyErr_NoMemory();
9552 0 : return -1;
9553 : }
9554 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
9555 0 : return 0;
9556 : }
9557 :
9558 0 : static PyObject *py_svcctl_QueryServiceStatus_out_get_service_status(PyObject *obj, void *closure)
9559 : {
9560 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
9561 0 : PyObject *py_service_status;
9562 0 : if (object->out.service_status == NULL) {
9563 0 : Py_RETURN_NONE;
9564 : }
9565 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, object->out.service_status, object->out.service_status);
9566 0 : return py_service_status;
9567 : }
9568 :
9569 0 : static int py_svcctl_QueryServiceStatus_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
9570 : {
9571 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
9572 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
9573 0 : if (value == NULL) {
9574 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
9575 0 : return -1;
9576 : }
9577 0 : object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
9578 0 : if (object->out.service_status == NULL) {
9579 0 : PyErr_NoMemory();
9580 0 : return -1;
9581 : }
9582 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
9583 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9584 0 : PyErr_NoMemory();
9585 0 : return -1;
9586 : }
9587 0 : object->out.service_status = (struct SERVICE_STATUS *)pytalloc_get_ptr(value);
9588 0 : return 0;
9589 : }
9590 :
9591 0 : static PyObject *py_svcctl_QueryServiceStatus_get_result(PyObject *obj, void *closure)
9592 : {
9593 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
9594 0 : PyObject *py_result;
9595 0 : py_result = PyErr_FromWERROR(object->out.result);
9596 0 : return py_result;
9597 : }
9598 :
9599 0 : static int py_svcctl_QueryServiceStatus_set_result(PyObject *py_obj, PyObject *value, void *closure)
9600 : {
9601 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
9602 0 : if (value == NULL) {
9603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
9604 0 : return -1;
9605 : }
9606 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
9607 0 : return 0;
9608 : }
9609 :
9610 : static PyGetSetDef py_svcctl_QueryServiceStatus_getsetters[] = {
9611 : {
9612 : .name = discard_const_p(char, "in_handle"),
9613 : .get = py_svcctl_QueryServiceStatus_in_get_handle,
9614 : .set = py_svcctl_QueryServiceStatus_in_set_handle,
9615 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
9616 : },
9617 : {
9618 : .name = discard_const_p(char, "out_service_status"),
9619 : .get = py_svcctl_QueryServiceStatus_out_get_service_status,
9620 : .set = py_svcctl_QueryServiceStatus_out_set_service_status,
9621 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
9622 : },
9623 : {
9624 : .name = discard_const_p(char, "result"),
9625 : .get = py_svcctl_QueryServiceStatus_get_result,
9626 : .set = py_svcctl_QueryServiceStatus_set_result,
9627 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
9628 : },
9629 : { .name = NULL }
9630 : };
9631 :
9632 0 : static PyObject *py_svcctl_QueryServiceStatus_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9633 : {
9634 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceStatus, type);
9635 0 : struct svcctl_QueryServiceStatus *_self = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(self);
9636 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
9637 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
9638 0 : _self->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
9639 0 : return self;
9640 : }
9641 :
9642 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
9643 : {
9644 :
9645 :
9646 0 : return PyLong_FromLong(6);
9647 : }
9648 :
9649 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
9650 : {
9651 0 : const struct ndr_interface_call *call = NULL;
9652 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
9653 0 : PyObject *ret = NULL;
9654 0 : struct ndr_push *push = NULL;
9655 0 : DATA_BLOB blob;
9656 0 : enum ndr_err_code err;
9657 :
9658 0 : if (ndr_table_svcctl.num_calls < 7) {
9659 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_pack");
9660 0 : return NULL;
9661 : }
9662 0 : call = &ndr_table_svcctl.calls[6];
9663 :
9664 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
9665 0 : if (push == NULL) {
9666 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9667 0 : return NULL;
9668 : }
9669 :
9670 0 : push->flags |= ndr_push_flags;
9671 :
9672 0 : err = call->ndr_push(push, ndr_inout_flags, object);
9673 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9674 0 : TALLOC_FREE(push);
9675 0 : PyErr_SetNdrError(err);
9676 0 : return NULL;
9677 : }
9678 0 : blob = ndr_push_blob(push);
9679 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9680 0 : TALLOC_FREE(push);
9681 0 : return ret;
9682 : }
9683 :
9684 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9685 : {
9686 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9687 0 : PyObject *bigendian_obj = NULL;
9688 0 : PyObject *ndr64_obj = NULL;
9689 0 : libndr_flags ndr_push_flags = 0;
9690 :
9691 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
9692 : discard_const_p(char *, kwnames),
9693 : &bigendian_obj,
9694 : &ndr64_obj)) {
9695 0 : return NULL;
9696 : }
9697 :
9698 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9699 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9700 : }
9701 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9702 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9703 : }
9704 :
9705 0 : return py_svcctl_QueryServiceStatus_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
9706 : }
9707 :
9708 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9709 : {
9710 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9711 0 : PyObject *bigendian_obj = NULL;
9712 0 : PyObject *ndr64_obj = NULL;
9713 0 : libndr_flags ndr_push_flags = 0;
9714 :
9715 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
9716 : discard_const_p(char *, kwnames),
9717 : &bigendian_obj,
9718 : &ndr64_obj)) {
9719 0 : return NULL;
9720 : }
9721 :
9722 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9723 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9724 : }
9725 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9726 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9727 : }
9728 :
9729 0 : return py_svcctl_QueryServiceStatus_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
9730 : }
9731 :
9732 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
9733 : {
9734 0 : const struct ndr_interface_call *call = NULL;
9735 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
9736 0 : struct ndr_pull *pull = NULL;
9737 0 : enum ndr_err_code err;
9738 :
9739 0 : if (ndr_table_svcctl.num_calls < 7) {
9740 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_unpack");
9741 0 : return NULL;
9742 : }
9743 0 : call = &ndr_table_svcctl.calls[6];
9744 :
9745 0 : pull = ndr_pull_init_blob(blob, object);
9746 0 : if (pull == NULL) {
9747 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9748 0 : return NULL;
9749 : }
9750 :
9751 0 : pull->flags |= ndr_pull_flags;
9752 :
9753 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
9754 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9755 0 : TALLOC_FREE(pull);
9756 0 : PyErr_SetNdrError(err);
9757 0 : return NULL;
9758 : }
9759 0 : if (!allow_remaining) {
9760 0 : uint32_t highest_ofs;
9761 :
9762 0 : if (pull->offset > pull->relative_highest_offset) {
9763 0 : highest_ofs = pull->offset;
9764 : } else {
9765 0 : highest_ofs = pull->relative_highest_offset;
9766 : }
9767 0 : if (highest_ofs < pull->data_size) {
9768 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
9769 : "not all bytes consumed ofs[%u] size[%u]",
9770 : highest_ofs, pull->data_size);
9771 0 : TALLOC_FREE(pull);
9772 0 : PyErr_SetNdrError(err);
9773 0 : return NULL;
9774 : }
9775 : }
9776 :
9777 0 : TALLOC_FREE(pull);
9778 0 : Py_RETURN_NONE;
9779 : }
9780 :
9781 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9782 : {
9783 0 : DATA_BLOB blob;
9784 0 : Py_ssize_t blob_length = 0;
9785 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9786 0 : PyObject *bigendian_obj = NULL;
9787 0 : PyObject *ndr64_obj = NULL;
9788 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9789 0 : PyObject *allow_remaining_obj = NULL;
9790 0 : bool allow_remaining = false;
9791 :
9792 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
9793 : discard_const_p(char *, kwnames),
9794 : &blob.data, &blob_length,
9795 : &bigendian_obj,
9796 : &ndr64_obj,
9797 : &allow_remaining_obj)) {
9798 0 : return NULL;
9799 : }
9800 0 : blob.length = blob_length;
9801 :
9802 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9803 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9804 : }
9805 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9806 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9807 : }
9808 :
9809 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9810 0 : allow_remaining = true;
9811 : }
9812 :
9813 0 : return py_svcctl_QueryServiceStatus_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
9814 : }
9815 :
9816 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9817 : {
9818 0 : DATA_BLOB blob;
9819 0 : Py_ssize_t blob_length = 0;
9820 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9821 0 : PyObject *bigendian_obj = NULL;
9822 0 : PyObject *ndr64_obj = NULL;
9823 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9824 0 : PyObject *allow_remaining_obj = NULL;
9825 0 : bool allow_remaining = false;
9826 :
9827 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
9828 : discard_const_p(char *, kwnames),
9829 : &blob.data, &blob_length,
9830 : &bigendian_obj,
9831 : &ndr64_obj,
9832 : &allow_remaining_obj)) {
9833 0 : return NULL;
9834 : }
9835 0 : blob.length = blob_length;
9836 :
9837 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9838 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9839 : }
9840 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9841 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9842 : }
9843 :
9844 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9845 0 : allow_remaining = true;
9846 : }
9847 :
9848 0 : return py_svcctl_QueryServiceStatus_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
9849 : }
9850 :
9851 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
9852 : {
9853 0 : const struct ndr_interface_call *call = NULL;
9854 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
9855 0 : PyObject *ret;
9856 0 : char *retstr;
9857 :
9858 0 : if (ndr_table_svcctl.num_calls < 7) {
9859 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_print");
9860 0 : return NULL;
9861 : }
9862 0 : call = &ndr_table_svcctl.calls[6];
9863 :
9864 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
9865 0 : ret = PyUnicode_FromString(retstr);
9866 0 : TALLOC_FREE(retstr);
9867 :
9868 0 : return ret;
9869 : }
9870 :
9871 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9872 : {
9873 0 : return py_svcctl_QueryServiceStatus_ndr_print(py_obj, "svcctl_QueryServiceStatus_in", NDR_IN);
9874 : }
9875 :
9876 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9877 : {
9878 0 : return py_svcctl_QueryServiceStatus_ndr_print(py_obj, "svcctl_QueryServiceStatus_out", NDR_OUT);
9879 : }
9880 :
9881 : static PyMethodDef py_svcctl_QueryServiceStatus_methods[] = {
9882 : { "opnum", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_opnum, METH_NOARGS|METH_CLASS,
9883 : "svcctl.QueryServiceStatus.opnum() -> 6 (0x06) " },
9884 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
9885 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
9886 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
9887 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
9888 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
9889 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
9890 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
9891 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
9892 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
9893 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
9894 : { NULL, NULL, 0, NULL }
9895 : };
9896 :
9897 :
9898 : static PyTypeObject svcctl_QueryServiceStatus_Type = {
9899 : PyVarObject_HEAD_INIT(NULL, 0)
9900 : .tp_name = "svcctl.QueryServiceStatus",
9901 : .tp_getset = py_svcctl_QueryServiceStatus_getsetters,
9902 : .tp_methods = py_svcctl_QueryServiceStatus_methods,
9903 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9904 : .tp_new = py_svcctl_QueryServiceStatus_new,
9905 : };
9906 :
9907 0 : static bool pack_py_svcctl_QueryServiceStatus_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceStatus *r)
9908 : {
9909 0 : PyObject *py_handle;
9910 0 : const char *kwnames[] = {
9911 : "handle", NULL
9912 : };
9913 :
9914 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_QueryServiceStatus", discard_const_p(char *, kwnames), &py_handle)) {
9915 0 : return false;
9916 : }
9917 :
9918 0 : if (py_handle == NULL) {
9919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
9920 0 : return false;
9921 : }
9922 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
9923 0 : if (r->in.handle == NULL) {
9924 0 : PyErr_NoMemory();
9925 0 : return false;
9926 : }
9927 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
9928 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
9929 0 : PyErr_NoMemory();
9930 0 : return false;
9931 : }
9932 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
9933 0 : return true;
9934 : }
9935 :
9936 0 : static PyObject *unpack_py_svcctl_QueryServiceStatus_args_out(struct svcctl_QueryServiceStatus *r)
9937 : {
9938 0 : PyObject *result;
9939 0 : PyObject *py_service_status;
9940 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, r->out.service_status, r->out.service_status);
9941 0 : result = py_service_status;
9942 0 : if (!W_ERROR_IS_OK(r->out.result)) {
9943 0 : PyErr_SetWERROR(r->out.result);
9944 0 : return NULL;
9945 : }
9946 :
9947 0 : return result;
9948 : }
9949 :
9950 :
9951 0 : static PyObject *py_svcctl_UnlockServiceDatabase_in_get_lock(PyObject *obj, void *closure)
9952 : {
9953 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
9954 0 : PyObject *py_lock;
9955 0 : if (object->in.lock == NULL) {
9956 0 : Py_RETURN_NONE;
9957 : }
9958 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, object->in.lock, object->in.lock);
9959 0 : return py_lock;
9960 : }
9961 :
9962 0 : static int py_svcctl_UnlockServiceDatabase_in_set_lock(PyObject *py_obj, PyObject *value, void *closure)
9963 : {
9964 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
9965 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lock));
9966 0 : if (value == NULL) {
9967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lock");
9968 0 : return -1;
9969 : }
9970 0 : object->in.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lock);
9971 0 : if (object->in.lock == NULL) {
9972 0 : PyErr_NoMemory();
9973 0 : return -1;
9974 : }
9975 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
9976 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9977 0 : PyErr_NoMemory();
9978 0 : return -1;
9979 : }
9980 0 : object->in.lock = (struct policy_handle *)pytalloc_get_ptr(value);
9981 0 : return 0;
9982 : }
9983 :
9984 0 : static PyObject *py_svcctl_UnlockServiceDatabase_out_get_lock(PyObject *obj, void *closure)
9985 : {
9986 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
9987 0 : PyObject *py_lock;
9988 0 : if (object->out.lock == NULL) {
9989 0 : Py_RETURN_NONE;
9990 : }
9991 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, object->out.lock, object->out.lock);
9992 0 : return py_lock;
9993 : }
9994 :
9995 0 : static int py_svcctl_UnlockServiceDatabase_out_set_lock(PyObject *py_obj, PyObject *value, void *closure)
9996 : {
9997 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
9998 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock));
9999 0 : if (value == NULL) {
10000 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock");
10001 0 : return -1;
10002 : }
10003 0 : object->out.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock);
10004 0 : if (object->out.lock == NULL) {
10005 0 : PyErr_NoMemory();
10006 0 : return -1;
10007 : }
10008 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
10009 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10010 0 : PyErr_NoMemory();
10011 0 : return -1;
10012 : }
10013 0 : object->out.lock = (struct policy_handle *)pytalloc_get_ptr(value);
10014 0 : return 0;
10015 : }
10016 :
10017 0 : static PyObject *py_svcctl_UnlockServiceDatabase_get_result(PyObject *obj, void *closure)
10018 : {
10019 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
10020 0 : PyObject *py_result;
10021 0 : py_result = PyErr_FromWERROR(object->out.result);
10022 0 : return py_result;
10023 : }
10024 :
10025 0 : static int py_svcctl_UnlockServiceDatabase_set_result(PyObject *py_obj, PyObject *value, void *closure)
10026 : {
10027 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
10028 0 : if (value == NULL) {
10029 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
10030 0 : return -1;
10031 : }
10032 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
10033 0 : return 0;
10034 : }
10035 :
10036 : static PyGetSetDef py_svcctl_UnlockServiceDatabase_getsetters[] = {
10037 : {
10038 : .name = discard_const_p(char, "in_lock"),
10039 : .get = py_svcctl_UnlockServiceDatabase_in_get_lock,
10040 : .set = py_svcctl_UnlockServiceDatabase_in_set_lock,
10041 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
10042 : },
10043 : {
10044 : .name = discard_const_p(char, "out_lock"),
10045 : .get = py_svcctl_UnlockServiceDatabase_out_get_lock,
10046 : .set = py_svcctl_UnlockServiceDatabase_out_set_lock,
10047 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
10048 : },
10049 : {
10050 : .name = discard_const_p(char, "result"),
10051 : .get = py_svcctl_UnlockServiceDatabase_get_result,
10052 : .set = py_svcctl_UnlockServiceDatabase_set_result,
10053 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
10054 : },
10055 : { .name = NULL }
10056 : };
10057 :
10058 0 : static PyObject *py_svcctl_UnlockServiceDatabase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10059 : {
10060 0 : PyObject *self = pytalloc_new(struct svcctl_UnlockServiceDatabase, type);
10061 0 : struct svcctl_UnlockServiceDatabase *_self = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(self);
10062 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
10063 0 : _self->in.lock = talloc_zero(mem_ctx, struct policy_handle);
10064 0 : _self->out.lock = talloc_zero(mem_ctx, struct policy_handle);
10065 0 : return self;
10066 : }
10067 :
10068 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
10069 : {
10070 :
10071 :
10072 0 : return PyLong_FromLong(8);
10073 : }
10074 :
10075 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
10076 : {
10077 0 : const struct ndr_interface_call *call = NULL;
10078 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
10079 0 : PyObject *ret = NULL;
10080 0 : struct ndr_push *push = NULL;
10081 0 : DATA_BLOB blob;
10082 0 : enum ndr_err_code err;
10083 :
10084 0 : if (ndr_table_svcctl.num_calls < 9) {
10085 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_pack");
10086 0 : return NULL;
10087 : }
10088 0 : call = &ndr_table_svcctl.calls[8];
10089 :
10090 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
10091 0 : if (push == NULL) {
10092 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10093 0 : return NULL;
10094 : }
10095 :
10096 0 : push->flags |= ndr_push_flags;
10097 :
10098 0 : err = call->ndr_push(push, ndr_inout_flags, object);
10099 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10100 0 : TALLOC_FREE(push);
10101 0 : PyErr_SetNdrError(err);
10102 0 : return NULL;
10103 : }
10104 0 : blob = ndr_push_blob(push);
10105 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10106 0 : TALLOC_FREE(push);
10107 0 : return ret;
10108 : }
10109 :
10110 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10111 : {
10112 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10113 0 : PyObject *bigendian_obj = NULL;
10114 0 : PyObject *ndr64_obj = NULL;
10115 0 : libndr_flags ndr_push_flags = 0;
10116 :
10117 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
10118 : discard_const_p(char *, kwnames),
10119 : &bigendian_obj,
10120 : &ndr64_obj)) {
10121 0 : return NULL;
10122 : }
10123 :
10124 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10125 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10126 : }
10127 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10128 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10129 : }
10130 :
10131 0 : return py_svcctl_UnlockServiceDatabase_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
10132 : }
10133 :
10134 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10135 : {
10136 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10137 0 : PyObject *bigendian_obj = NULL;
10138 0 : PyObject *ndr64_obj = NULL;
10139 0 : libndr_flags ndr_push_flags = 0;
10140 :
10141 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
10142 : discard_const_p(char *, kwnames),
10143 : &bigendian_obj,
10144 : &ndr64_obj)) {
10145 0 : return NULL;
10146 : }
10147 :
10148 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10149 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10150 : }
10151 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10152 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10153 : }
10154 :
10155 0 : return py_svcctl_UnlockServiceDatabase_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
10156 : }
10157 :
10158 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
10159 : {
10160 0 : const struct ndr_interface_call *call = NULL;
10161 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
10162 0 : struct ndr_pull *pull = NULL;
10163 0 : enum ndr_err_code err;
10164 :
10165 0 : if (ndr_table_svcctl.num_calls < 9) {
10166 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_unpack");
10167 0 : return NULL;
10168 : }
10169 0 : call = &ndr_table_svcctl.calls[8];
10170 :
10171 0 : pull = ndr_pull_init_blob(blob, object);
10172 0 : if (pull == NULL) {
10173 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10174 0 : return NULL;
10175 : }
10176 :
10177 0 : pull->flags |= ndr_pull_flags;
10178 :
10179 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
10180 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10181 0 : TALLOC_FREE(pull);
10182 0 : PyErr_SetNdrError(err);
10183 0 : return NULL;
10184 : }
10185 0 : if (!allow_remaining) {
10186 0 : uint32_t highest_ofs;
10187 :
10188 0 : if (pull->offset > pull->relative_highest_offset) {
10189 0 : highest_ofs = pull->offset;
10190 : } else {
10191 0 : highest_ofs = pull->relative_highest_offset;
10192 : }
10193 0 : if (highest_ofs < pull->data_size) {
10194 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
10195 : "not all bytes consumed ofs[%u] size[%u]",
10196 : highest_ofs, pull->data_size);
10197 0 : TALLOC_FREE(pull);
10198 0 : PyErr_SetNdrError(err);
10199 0 : return NULL;
10200 : }
10201 : }
10202 :
10203 0 : TALLOC_FREE(pull);
10204 0 : Py_RETURN_NONE;
10205 : }
10206 :
10207 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10208 : {
10209 0 : DATA_BLOB blob;
10210 0 : Py_ssize_t blob_length = 0;
10211 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10212 0 : PyObject *bigendian_obj = NULL;
10213 0 : PyObject *ndr64_obj = NULL;
10214 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10215 0 : PyObject *allow_remaining_obj = NULL;
10216 0 : bool allow_remaining = false;
10217 :
10218 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
10219 : discard_const_p(char *, kwnames),
10220 : &blob.data, &blob_length,
10221 : &bigendian_obj,
10222 : &ndr64_obj,
10223 : &allow_remaining_obj)) {
10224 0 : return NULL;
10225 : }
10226 0 : blob.length = blob_length;
10227 :
10228 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10229 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10230 : }
10231 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10232 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10233 : }
10234 :
10235 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10236 0 : allow_remaining = true;
10237 : }
10238 :
10239 0 : return py_svcctl_UnlockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
10240 : }
10241 :
10242 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10243 : {
10244 0 : DATA_BLOB blob;
10245 0 : Py_ssize_t blob_length = 0;
10246 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10247 0 : PyObject *bigendian_obj = NULL;
10248 0 : PyObject *ndr64_obj = NULL;
10249 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10250 0 : PyObject *allow_remaining_obj = NULL;
10251 0 : bool allow_remaining = false;
10252 :
10253 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
10254 : discard_const_p(char *, kwnames),
10255 : &blob.data, &blob_length,
10256 : &bigendian_obj,
10257 : &ndr64_obj,
10258 : &allow_remaining_obj)) {
10259 0 : return NULL;
10260 : }
10261 0 : blob.length = blob_length;
10262 :
10263 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10264 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10265 : }
10266 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10267 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10268 : }
10269 :
10270 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10271 0 : allow_remaining = true;
10272 : }
10273 :
10274 0 : return py_svcctl_UnlockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
10275 : }
10276 :
10277 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
10278 : {
10279 0 : const struct ndr_interface_call *call = NULL;
10280 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
10281 0 : PyObject *ret;
10282 0 : char *retstr;
10283 :
10284 0 : if (ndr_table_svcctl.num_calls < 9) {
10285 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_print");
10286 0 : return NULL;
10287 : }
10288 0 : call = &ndr_table_svcctl.calls[8];
10289 :
10290 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
10291 0 : ret = PyUnicode_FromString(retstr);
10292 0 : TALLOC_FREE(retstr);
10293 :
10294 0 : return ret;
10295 : }
10296 :
10297 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10298 : {
10299 0 : return py_svcctl_UnlockServiceDatabase_ndr_print(py_obj, "svcctl_UnlockServiceDatabase_in", NDR_IN);
10300 : }
10301 :
10302 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10303 : {
10304 0 : return py_svcctl_UnlockServiceDatabase_ndr_print(py_obj, "svcctl_UnlockServiceDatabase_out", NDR_OUT);
10305 : }
10306 :
10307 : static PyMethodDef py_svcctl_UnlockServiceDatabase_methods[] = {
10308 : { "opnum", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_opnum, METH_NOARGS|METH_CLASS,
10309 : "svcctl.UnlockServiceDatabase.opnum() -> 8 (0x08) " },
10310 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
10311 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
10312 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
10313 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
10314 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
10315 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
10316 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
10317 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
10318 : { "__ndr_print_in__", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
10319 : { "__ndr_print_out__", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
10320 : { NULL, NULL, 0, NULL }
10321 : };
10322 :
10323 :
10324 : static PyTypeObject svcctl_UnlockServiceDatabase_Type = {
10325 : PyVarObject_HEAD_INIT(NULL, 0)
10326 : .tp_name = "svcctl.UnlockServiceDatabase",
10327 : .tp_getset = py_svcctl_UnlockServiceDatabase_getsetters,
10328 : .tp_methods = py_svcctl_UnlockServiceDatabase_methods,
10329 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10330 : .tp_new = py_svcctl_UnlockServiceDatabase_new,
10331 : };
10332 :
10333 0 : static bool pack_py_svcctl_UnlockServiceDatabase_args_in(PyObject *args, PyObject *kwargs, struct svcctl_UnlockServiceDatabase *r)
10334 : {
10335 0 : PyObject *py_lock;
10336 0 : const char *kwnames[] = {
10337 : "lock", NULL
10338 : };
10339 :
10340 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_UnlockServiceDatabase", discard_const_p(char *, kwnames), &py_lock)) {
10341 0 : return false;
10342 : }
10343 :
10344 0 : if (py_lock == NULL) {
10345 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lock");
10346 0 : return false;
10347 : }
10348 0 : r->in.lock = talloc_ptrtype(r, r->in.lock);
10349 0 : if (r->in.lock == NULL) {
10350 0 : PyErr_NoMemory();
10351 0 : return false;
10352 : }
10353 0 : PY_CHECK_TYPE(policy_handle_Type, py_lock, return false;);
10354 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_lock)) == NULL) {
10355 0 : PyErr_NoMemory();
10356 0 : return false;
10357 : }
10358 0 : r->in.lock = (struct policy_handle *)pytalloc_get_ptr(py_lock);
10359 0 : return true;
10360 : }
10361 :
10362 0 : static PyObject *unpack_py_svcctl_UnlockServiceDatabase_args_out(struct svcctl_UnlockServiceDatabase *r)
10363 : {
10364 0 : PyObject *result;
10365 0 : PyObject *py_lock;
10366 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, r->out.lock, r->out.lock);
10367 0 : result = py_lock;
10368 0 : if (!W_ERROR_IS_OK(r->out.result)) {
10369 0 : PyErr_SetWERROR(r->out.result);
10370 0 : return NULL;
10371 : }
10372 :
10373 0 : return result;
10374 : }
10375 :
10376 :
10377 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_handle(PyObject *obj, void *closure)
10378 : {
10379 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
10380 0 : PyObject *py_handle;
10381 0 : if (object->in.handle == NULL) {
10382 0 : Py_RETURN_NONE;
10383 : }
10384 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
10385 0 : return py_handle;
10386 : }
10387 :
10388 0 : static int py_svcctl_SCSetServiceBitsW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
10389 : {
10390 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10391 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
10392 0 : if (value == NULL) {
10393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
10394 0 : return -1;
10395 : }
10396 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
10397 0 : if (object->in.handle == NULL) {
10398 0 : PyErr_NoMemory();
10399 0 : return -1;
10400 : }
10401 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
10402 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10403 0 : PyErr_NoMemory();
10404 0 : return -1;
10405 : }
10406 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
10407 0 : return 0;
10408 : }
10409 :
10410 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_bits(PyObject *obj, void *closure)
10411 : {
10412 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
10413 0 : PyObject *py_bits;
10414 0 : py_bits = PyLong_FromUnsignedLongLong((uint32_t)object->in.bits);
10415 0 : return py_bits;
10416 : }
10417 :
10418 0 : static int py_svcctl_SCSetServiceBitsW_in_set_bits(PyObject *py_obj, PyObject *value, void *closure)
10419 : {
10420 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10421 0 : if (value == NULL) {
10422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bits");
10423 0 : return -1;
10424 : }
10425 : {
10426 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bits));
10427 0 : if (PyLong_Check(value)) {
10428 0 : unsigned long long test_var;
10429 0 : test_var = PyLong_AsUnsignedLongLong(value);
10430 0 : if (PyErr_Occurred() != NULL) {
10431 0 : return -1;
10432 : }
10433 0 : if (test_var > uint_max) {
10434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10435 : PyLong_Type.tp_name, uint_max, test_var);
10436 0 : return -1;
10437 : }
10438 0 : object->in.bits = test_var;
10439 : } else {
10440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10441 : PyLong_Type.tp_name);
10442 0 : return -1;
10443 : }
10444 : }
10445 0 : return 0;
10446 : }
10447 :
10448 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_bitson(PyObject *obj, void *closure)
10449 : {
10450 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
10451 0 : PyObject *py_bitson;
10452 0 : py_bitson = PyLong_FromUnsignedLongLong((uint32_t)object->in.bitson);
10453 0 : return py_bitson;
10454 : }
10455 :
10456 0 : static int py_svcctl_SCSetServiceBitsW_in_set_bitson(PyObject *py_obj, PyObject *value, void *closure)
10457 : {
10458 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10459 0 : if (value == NULL) {
10460 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bitson");
10461 0 : return -1;
10462 : }
10463 : {
10464 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bitson));
10465 0 : if (PyLong_Check(value)) {
10466 0 : unsigned long long test_var;
10467 0 : test_var = PyLong_AsUnsignedLongLong(value);
10468 0 : if (PyErr_Occurred() != NULL) {
10469 0 : return -1;
10470 : }
10471 0 : if (test_var > uint_max) {
10472 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10473 : PyLong_Type.tp_name, uint_max, test_var);
10474 0 : return -1;
10475 : }
10476 0 : object->in.bitson = test_var;
10477 : } else {
10478 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10479 : PyLong_Type.tp_name);
10480 0 : return -1;
10481 : }
10482 : }
10483 0 : return 0;
10484 : }
10485 :
10486 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_immediate(PyObject *obj, void *closure)
10487 : {
10488 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
10489 0 : PyObject *py_immediate;
10490 0 : py_immediate = PyLong_FromUnsignedLongLong((uint32_t)object->in.immediate);
10491 0 : return py_immediate;
10492 : }
10493 :
10494 0 : static int py_svcctl_SCSetServiceBitsW_in_set_immediate(PyObject *py_obj, PyObject *value, void *closure)
10495 : {
10496 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10497 0 : if (value == NULL) {
10498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.immediate");
10499 0 : return -1;
10500 : }
10501 : {
10502 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.immediate));
10503 0 : if (PyLong_Check(value)) {
10504 0 : unsigned long long test_var;
10505 0 : test_var = PyLong_AsUnsignedLongLong(value);
10506 0 : if (PyErr_Occurred() != NULL) {
10507 0 : return -1;
10508 : }
10509 0 : if (test_var > uint_max) {
10510 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10511 : PyLong_Type.tp_name, uint_max, test_var);
10512 0 : return -1;
10513 : }
10514 0 : object->in.immediate = test_var;
10515 : } else {
10516 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10517 : PyLong_Type.tp_name);
10518 0 : return -1;
10519 : }
10520 : }
10521 0 : return 0;
10522 : }
10523 :
10524 0 : static PyObject *py_svcctl_SCSetServiceBitsW_get_result(PyObject *obj, void *closure)
10525 : {
10526 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
10527 0 : PyObject *py_result;
10528 0 : py_result = PyErr_FromWERROR(object->out.result);
10529 0 : return py_result;
10530 : }
10531 :
10532 0 : static int py_svcctl_SCSetServiceBitsW_set_result(PyObject *py_obj, PyObject *value, void *closure)
10533 : {
10534 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10535 0 : if (value == NULL) {
10536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
10537 0 : return -1;
10538 : }
10539 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
10540 0 : return 0;
10541 : }
10542 :
10543 : static PyGetSetDef py_svcctl_SCSetServiceBitsW_getsetters[] = {
10544 : {
10545 : .name = discard_const_p(char, "in_handle"),
10546 : .get = py_svcctl_SCSetServiceBitsW_in_get_handle,
10547 : .set = py_svcctl_SCSetServiceBitsW_in_set_handle,
10548 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
10549 : },
10550 : {
10551 : .name = discard_const_p(char, "in_bits"),
10552 : .get = py_svcctl_SCSetServiceBitsW_in_get_bits,
10553 : .set = py_svcctl_SCSetServiceBitsW_in_set_bits,
10554 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10555 : },
10556 : {
10557 : .name = discard_const_p(char, "in_bitson"),
10558 : .get = py_svcctl_SCSetServiceBitsW_in_get_bitson,
10559 : .set = py_svcctl_SCSetServiceBitsW_in_set_bitson,
10560 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10561 : },
10562 : {
10563 : .name = discard_const_p(char, "in_immediate"),
10564 : .get = py_svcctl_SCSetServiceBitsW_in_get_immediate,
10565 : .set = py_svcctl_SCSetServiceBitsW_in_set_immediate,
10566 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10567 : },
10568 : {
10569 : .name = discard_const_p(char, "result"),
10570 : .get = py_svcctl_SCSetServiceBitsW_get_result,
10571 : .set = py_svcctl_SCSetServiceBitsW_set_result,
10572 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
10573 : },
10574 : { .name = NULL }
10575 : };
10576 :
10577 0 : static PyObject *py_svcctl_SCSetServiceBitsW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10578 : {
10579 0 : PyObject *self = pytalloc_new(struct svcctl_SCSetServiceBitsW, type);
10580 0 : struct svcctl_SCSetServiceBitsW *_self = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(self);
10581 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
10582 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
10583 0 : return self;
10584 : }
10585 :
10586 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
10587 : {
10588 :
10589 :
10590 0 : return PyLong_FromLong(10);
10591 : }
10592 :
10593 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
10594 : {
10595 0 : const struct ndr_interface_call *call = NULL;
10596 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10597 0 : PyObject *ret = NULL;
10598 0 : struct ndr_push *push = NULL;
10599 0 : DATA_BLOB blob;
10600 0 : enum ndr_err_code err;
10601 :
10602 0 : if (ndr_table_svcctl.num_calls < 11) {
10603 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_pack");
10604 0 : return NULL;
10605 : }
10606 0 : call = &ndr_table_svcctl.calls[10];
10607 :
10608 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
10609 0 : if (push == NULL) {
10610 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10611 0 : return NULL;
10612 : }
10613 :
10614 0 : push->flags |= ndr_push_flags;
10615 :
10616 0 : err = call->ndr_push(push, ndr_inout_flags, object);
10617 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10618 0 : TALLOC_FREE(push);
10619 0 : PyErr_SetNdrError(err);
10620 0 : return NULL;
10621 : }
10622 0 : blob = ndr_push_blob(push);
10623 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10624 0 : TALLOC_FREE(push);
10625 0 : return ret;
10626 : }
10627 :
10628 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10629 : {
10630 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10631 0 : PyObject *bigendian_obj = NULL;
10632 0 : PyObject *ndr64_obj = NULL;
10633 0 : libndr_flags ndr_push_flags = 0;
10634 :
10635 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
10636 : discard_const_p(char *, kwnames),
10637 : &bigendian_obj,
10638 : &ndr64_obj)) {
10639 0 : return NULL;
10640 : }
10641 :
10642 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10643 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10644 : }
10645 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10646 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10647 : }
10648 :
10649 0 : return py_svcctl_SCSetServiceBitsW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
10650 : }
10651 :
10652 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10653 : {
10654 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10655 0 : PyObject *bigendian_obj = NULL;
10656 0 : PyObject *ndr64_obj = NULL;
10657 0 : libndr_flags ndr_push_flags = 0;
10658 :
10659 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
10660 : discard_const_p(char *, kwnames),
10661 : &bigendian_obj,
10662 : &ndr64_obj)) {
10663 0 : return NULL;
10664 : }
10665 :
10666 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10667 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10668 : }
10669 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10670 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10671 : }
10672 :
10673 0 : return py_svcctl_SCSetServiceBitsW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
10674 : }
10675 :
10676 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
10677 : {
10678 0 : const struct ndr_interface_call *call = NULL;
10679 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10680 0 : struct ndr_pull *pull = NULL;
10681 0 : enum ndr_err_code err;
10682 :
10683 0 : if (ndr_table_svcctl.num_calls < 11) {
10684 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_unpack");
10685 0 : return NULL;
10686 : }
10687 0 : call = &ndr_table_svcctl.calls[10];
10688 :
10689 0 : pull = ndr_pull_init_blob(blob, object);
10690 0 : if (pull == NULL) {
10691 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10692 0 : return NULL;
10693 : }
10694 :
10695 0 : pull->flags |= ndr_pull_flags;
10696 :
10697 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
10698 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10699 0 : TALLOC_FREE(pull);
10700 0 : PyErr_SetNdrError(err);
10701 0 : return NULL;
10702 : }
10703 0 : if (!allow_remaining) {
10704 0 : uint32_t highest_ofs;
10705 :
10706 0 : if (pull->offset > pull->relative_highest_offset) {
10707 0 : highest_ofs = pull->offset;
10708 : } else {
10709 0 : highest_ofs = pull->relative_highest_offset;
10710 : }
10711 0 : if (highest_ofs < pull->data_size) {
10712 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
10713 : "not all bytes consumed ofs[%u] size[%u]",
10714 : highest_ofs, pull->data_size);
10715 0 : TALLOC_FREE(pull);
10716 0 : PyErr_SetNdrError(err);
10717 0 : return NULL;
10718 : }
10719 : }
10720 :
10721 0 : TALLOC_FREE(pull);
10722 0 : Py_RETURN_NONE;
10723 : }
10724 :
10725 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10726 : {
10727 0 : DATA_BLOB blob;
10728 0 : Py_ssize_t blob_length = 0;
10729 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10730 0 : PyObject *bigendian_obj = NULL;
10731 0 : PyObject *ndr64_obj = NULL;
10732 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10733 0 : PyObject *allow_remaining_obj = NULL;
10734 0 : bool allow_remaining = false;
10735 :
10736 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
10737 : discard_const_p(char *, kwnames),
10738 : &blob.data, &blob_length,
10739 : &bigendian_obj,
10740 : &ndr64_obj,
10741 : &allow_remaining_obj)) {
10742 0 : return NULL;
10743 : }
10744 0 : blob.length = blob_length;
10745 :
10746 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10747 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10748 : }
10749 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10750 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10751 : }
10752 :
10753 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10754 0 : allow_remaining = true;
10755 : }
10756 :
10757 0 : return py_svcctl_SCSetServiceBitsW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
10758 : }
10759 :
10760 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10761 : {
10762 0 : DATA_BLOB blob;
10763 0 : Py_ssize_t blob_length = 0;
10764 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10765 0 : PyObject *bigendian_obj = NULL;
10766 0 : PyObject *ndr64_obj = NULL;
10767 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10768 0 : PyObject *allow_remaining_obj = NULL;
10769 0 : bool allow_remaining = false;
10770 :
10771 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
10772 : discard_const_p(char *, kwnames),
10773 : &blob.data, &blob_length,
10774 : &bigendian_obj,
10775 : &ndr64_obj,
10776 : &allow_remaining_obj)) {
10777 0 : return NULL;
10778 : }
10779 0 : blob.length = blob_length;
10780 :
10781 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10782 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10783 : }
10784 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10785 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10786 : }
10787 :
10788 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10789 0 : allow_remaining = true;
10790 : }
10791 :
10792 0 : return py_svcctl_SCSetServiceBitsW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
10793 : }
10794 :
10795 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
10796 : {
10797 0 : const struct ndr_interface_call *call = NULL;
10798 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
10799 0 : PyObject *ret;
10800 0 : char *retstr;
10801 :
10802 0 : if (ndr_table_svcctl.num_calls < 11) {
10803 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_print");
10804 0 : return NULL;
10805 : }
10806 0 : call = &ndr_table_svcctl.calls[10];
10807 :
10808 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
10809 0 : ret = PyUnicode_FromString(retstr);
10810 0 : TALLOC_FREE(retstr);
10811 :
10812 0 : return ret;
10813 : }
10814 :
10815 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10816 : {
10817 0 : return py_svcctl_SCSetServiceBitsW_ndr_print(py_obj, "svcctl_SCSetServiceBitsW_in", NDR_IN);
10818 : }
10819 :
10820 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10821 : {
10822 0 : return py_svcctl_SCSetServiceBitsW_ndr_print(py_obj, "svcctl_SCSetServiceBitsW_out", NDR_OUT);
10823 : }
10824 :
10825 : static PyMethodDef py_svcctl_SCSetServiceBitsW_methods[] = {
10826 : { "opnum", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_opnum, METH_NOARGS|METH_CLASS,
10827 : "svcctl.SCSetServiceBitsW.opnum() -> 10 (0x0a) " },
10828 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
10829 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
10830 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
10831 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
10832 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
10833 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
10834 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
10835 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
10836 : { "__ndr_print_in__", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
10837 : { "__ndr_print_out__", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
10838 : { NULL, NULL, 0, NULL }
10839 : };
10840 :
10841 :
10842 : static PyTypeObject svcctl_SCSetServiceBitsW_Type = {
10843 : PyVarObject_HEAD_INIT(NULL, 0)
10844 : .tp_name = "svcctl.SCSetServiceBitsW",
10845 : .tp_getset = py_svcctl_SCSetServiceBitsW_getsetters,
10846 : .tp_methods = py_svcctl_SCSetServiceBitsW_methods,
10847 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10848 : .tp_new = py_svcctl_SCSetServiceBitsW_new,
10849 : };
10850 :
10851 0 : static bool pack_py_svcctl_SCSetServiceBitsW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SCSetServiceBitsW *r)
10852 : {
10853 0 : PyObject *py_handle;
10854 0 : PyObject *py_bits;
10855 0 : PyObject *py_bitson;
10856 0 : PyObject *py_immediate;
10857 0 : const char *kwnames[] = {
10858 : "handle", "bits", "bitson", "immediate", NULL
10859 : };
10860 :
10861 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:svcctl_SCSetServiceBitsW", discard_const_p(char *, kwnames), &py_handle, &py_bits, &py_bitson, &py_immediate)) {
10862 0 : return false;
10863 : }
10864 :
10865 0 : if (py_handle == NULL) {
10866 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
10867 0 : return false;
10868 : }
10869 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
10870 0 : if (r->in.handle == NULL) {
10871 0 : PyErr_NoMemory();
10872 0 : return false;
10873 : }
10874 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10875 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10876 0 : PyErr_NoMemory();
10877 0 : return false;
10878 : }
10879 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10880 0 : if (py_bits == NULL) {
10881 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bits");
10882 0 : return false;
10883 : }
10884 : {
10885 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bits));
10886 0 : if (PyLong_Check(py_bits)) {
10887 0 : unsigned long long test_var;
10888 0 : test_var = PyLong_AsUnsignedLongLong(py_bits);
10889 0 : if (PyErr_Occurred() != NULL) {
10890 0 : return false;
10891 : }
10892 0 : if (test_var > uint_max) {
10893 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10894 : PyLong_Type.tp_name, uint_max, test_var);
10895 0 : return false;
10896 : }
10897 0 : r->in.bits = test_var;
10898 : } else {
10899 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10900 : PyLong_Type.tp_name);
10901 0 : return false;
10902 : }
10903 : }
10904 0 : if (py_bitson == NULL) {
10905 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bitson");
10906 0 : return false;
10907 : }
10908 : {
10909 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bitson));
10910 0 : if (PyLong_Check(py_bitson)) {
10911 0 : unsigned long long test_var;
10912 0 : test_var = PyLong_AsUnsignedLongLong(py_bitson);
10913 0 : if (PyErr_Occurred() != NULL) {
10914 0 : return false;
10915 : }
10916 0 : if (test_var > uint_max) {
10917 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10918 : PyLong_Type.tp_name, uint_max, test_var);
10919 0 : return false;
10920 : }
10921 0 : r->in.bitson = test_var;
10922 : } else {
10923 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10924 : PyLong_Type.tp_name);
10925 0 : return false;
10926 : }
10927 : }
10928 0 : if (py_immediate == NULL) {
10929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.immediate");
10930 0 : return false;
10931 : }
10932 : {
10933 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.immediate));
10934 0 : if (PyLong_Check(py_immediate)) {
10935 0 : unsigned long long test_var;
10936 0 : test_var = PyLong_AsUnsignedLongLong(py_immediate);
10937 0 : if (PyErr_Occurred() != NULL) {
10938 0 : return false;
10939 : }
10940 0 : if (test_var > uint_max) {
10941 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10942 : PyLong_Type.tp_name, uint_max, test_var);
10943 0 : return false;
10944 : }
10945 0 : r->in.immediate = test_var;
10946 : } else {
10947 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10948 : PyLong_Type.tp_name);
10949 0 : return false;
10950 : }
10951 : }
10952 0 : return true;
10953 : }
10954 :
10955 0 : static PyObject *unpack_py_svcctl_SCSetServiceBitsW_args_out(struct svcctl_SCSetServiceBitsW *r)
10956 : {
10957 0 : PyObject *result;
10958 0 : result = Py_None;
10959 0 : Py_INCREF(result);
10960 0 : if (!W_ERROR_IS_OK(r->out.result)) {
10961 0 : PyErr_SetWERROR(r->out.result);
10962 0 : return NULL;
10963 : }
10964 :
10965 0 : return result;
10966 : }
10967 :
10968 :
10969 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_handle(PyObject *obj, void *closure)
10970 : {
10971 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
10972 0 : PyObject *py_handle;
10973 0 : if (object->in.handle == NULL) {
10974 0 : Py_RETURN_NONE;
10975 : }
10976 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
10977 0 : return py_handle;
10978 : }
10979 :
10980 0 : static int py_svcctl_ChangeServiceConfigW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
10981 : {
10982 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
10983 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
10984 0 : if (value == NULL) {
10985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
10986 0 : return -1;
10987 : }
10988 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
10989 0 : if (object->in.handle == NULL) {
10990 0 : PyErr_NoMemory();
10991 0 : return -1;
10992 : }
10993 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
10994 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10995 0 : PyErr_NoMemory();
10996 0 : return -1;
10997 : }
10998 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
10999 0 : return 0;
11000 : }
11001 :
11002 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_type(PyObject *obj, void *closure)
11003 : {
11004 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11005 0 : PyObject *py_type;
11006 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
11007 0 : return py_type;
11008 : }
11009 :
11010 0 : static int py_svcctl_ChangeServiceConfigW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
11011 : {
11012 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11013 0 : if (value == NULL) {
11014 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
11015 0 : return -1;
11016 : }
11017 : {
11018 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
11019 0 : if (PyLong_Check(value)) {
11020 0 : unsigned long long test_var;
11021 0 : test_var = PyLong_AsUnsignedLongLong(value);
11022 0 : if (PyErr_Occurred() != NULL) {
11023 0 : return -1;
11024 : }
11025 0 : if (test_var > uint_max) {
11026 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11027 : PyLong_Type.tp_name, uint_max, test_var);
11028 0 : return -1;
11029 : }
11030 0 : object->in.type = test_var;
11031 : } else {
11032 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11033 : PyLong_Type.tp_name);
11034 0 : return -1;
11035 : }
11036 : }
11037 0 : return 0;
11038 : }
11039 :
11040 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_start_type(PyObject *obj, void *closure)
11041 : {
11042 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11043 0 : PyObject *py_start_type;
11044 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
11045 0 : return py_start_type;
11046 : }
11047 :
11048 0 : static int py_svcctl_ChangeServiceConfigW_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
11049 : {
11050 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11051 0 : if (value == NULL) {
11052 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
11053 0 : return -1;
11054 : }
11055 : {
11056 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
11057 0 : if (PyLong_Check(value)) {
11058 0 : unsigned long long test_var;
11059 0 : test_var = PyLong_AsUnsignedLongLong(value);
11060 0 : if (PyErr_Occurred() != NULL) {
11061 0 : return -1;
11062 : }
11063 0 : if (test_var > uint_max) {
11064 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11065 : PyLong_Type.tp_name, uint_max, test_var);
11066 0 : return -1;
11067 : }
11068 0 : object->in.start_type = test_var;
11069 : } else {
11070 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11071 : PyLong_Type.tp_name);
11072 0 : return -1;
11073 : }
11074 : }
11075 0 : return 0;
11076 : }
11077 :
11078 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_error_control(PyObject *obj, void *closure)
11079 : {
11080 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11081 0 : PyObject *py_error_control;
11082 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
11083 0 : return py_error_control;
11084 : }
11085 :
11086 0 : static int py_svcctl_ChangeServiceConfigW_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
11087 : {
11088 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11089 0 : if (value == NULL) {
11090 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
11091 0 : return -1;
11092 : }
11093 : {
11094 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
11095 0 : if (PyLong_Check(value)) {
11096 0 : unsigned long long test_var;
11097 0 : test_var = PyLong_AsUnsignedLongLong(value);
11098 0 : if (PyErr_Occurred() != NULL) {
11099 0 : return -1;
11100 : }
11101 0 : if (test_var > uint_max) {
11102 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11103 : PyLong_Type.tp_name, uint_max, test_var);
11104 0 : return -1;
11105 : }
11106 0 : object->in.error_control = test_var;
11107 : } else {
11108 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11109 : PyLong_Type.tp_name);
11110 0 : return -1;
11111 : }
11112 : }
11113 0 : return 0;
11114 : }
11115 :
11116 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_binary_path(PyObject *obj, void *closure)
11117 : {
11118 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11119 0 : PyObject *py_binary_path;
11120 0 : if (object->in.binary_path == NULL) {
11121 0 : Py_RETURN_NONE;
11122 : }
11123 0 : if (object->in.binary_path == NULL) {
11124 0 : py_binary_path = Py_None;
11125 0 : Py_INCREF(py_binary_path);
11126 : } else {
11127 0 : if (object->in.binary_path == NULL) {
11128 0 : py_binary_path = Py_None;
11129 0 : Py_INCREF(py_binary_path);
11130 : } else {
11131 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
11132 : }
11133 : }
11134 0 : return py_binary_path;
11135 : }
11136 :
11137 0 : static int py_svcctl_ChangeServiceConfigW_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
11138 : {
11139 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11140 0 : if (value == NULL) {
11141 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
11142 0 : return -1;
11143 : }
11144 0 : if (value == Py_None) {
11145 0 : object->in.binary_path = NULL;
11146 : } else {
11147 0 : object->in.binary_path = NULL;
11148 : {
11149 0 : const char *test_str;
11150 0 : const char *talloc_str;
11151 0 : PyObject *unicode = NULL;
11152 0 : if (PyUnicode_Check(value)) {
11153 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11154 0 : if (unicode == NULL) {
11155 0 : return -1;
11156 : }
11157 0 : test_str = PyBytes_AS_STRING(unicode);
11158 0 : } else if (PyBytes_Check(value)) {
11159 0 : test_str = PyBytes_AS_STRING(value);
11160 : } else {
11161 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11162 0 : return -1;
11163 : }
11164 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11165 0 : if (unicode != NULL) {
11166 0 : Py_DECREF(unicode);
11167 : }
11168 0 : if (talloc_str == NULL) {
11169 0 : PyErr_NoMemory();
11170 0 : return -1;
11171 : }
11172 0 : object->in.binary_path = talloc_str;
11173 : }
11174 : }
11175 0 : return 0;
11176 : }
11177 :
11178 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_load_order_group(PyObject *obj, void *closure)
11179 : {
11180 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11181 0 : PyObject *py_load_order_group;
11182 0 : if (object->in.load_order_group == NULL) {
11183 0 : Py_RETURN_NONE;
11184 : }
11185 0 : if (object->in.load_order_group == NULL) {
11186 0 : py_load_order_group = Py_None;
11187 0 : Py_INCREF(py_load_order_group);
11188 : } else {
11189 0 : if (object->in.load_order_group == NULL) {
11190 0 : py_load_order_group = Py_None;
11191 0 : Py_INCREF(py_load_order_group);
11192 : } else {
11193 0 : py_load_order_group = PyUnicode_Decode(object->in.load_order_group, strlen(object->in.load_order_group), "utf-8", "ignore");
11194 : }
11195 : }
11196 0 : return py_load_order_group;
11197 : }
11198 :
11199 0 : static int py_svcctl_ChangeServiceConfigW_in_set_load_order_group(PyObject *py_obj, PyObject *value, void *closure)
11200 : {
11201 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11202 0 : if (value == NULL) {
11203 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.load_order_group");
11204 0 : return -1;
11205 : }
11206 0 : if (value == Py_None) {
11207 0 : object->in.load_order_group = NULL;
11208 : } else {
11209 0 : object->in.load_order_group = NULL;
11210 : {
11211 0 : const char *test_str;
11212 0 : const char *talloc_str;
11213 0 : PyObject *unicode = NULL;
11214 0 : if (PyUnicode_Check(value)) {
11215 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11216 0 : if (unicode == NULL) {
11217 0 : return -1;
11218 : }
11219 0 : test_str = PyBytes_AS_STRING(unicode);
11220 0 : } else if (PyBytes_Check(value)) {
11221 0 : test_str = PyBytes_AS_STRING(value);
11222 : } else {
11223 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11224 0 : return -1;
11225 : }
11226 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11227 0 : if (unicode != NULL) {
11228 0 : Py_DECREF(unicode);
11229 : }
11230 0 : if (talloc_str == NULL) {
11231 0 : PyErr_NoMemory();
11232 0 : return -1;
11233 : }
11234 0 : object->in.load_order_group = talloc_str;
11235 : }
11236 : }
11237 0 : return 0;
11238 : }
11239 :
11240 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_tag_id(PyObject *obj, void *closure)
11241 : {
11242 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11243 0 : PyObject *py_tag_id;
11244 0 : if (object->in.tag_id == NULL) {
11245 0 : Py_RETURN_NONE;
11246 : }
11247 0 : if (object->in.tag_id == NULL) {
11248 0 : py_tag_id = Py_None;
11249 0 : Py_INCREF(py_tag_id);
11250 : } else {
11251 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->in.tag_id);
11252 : }
11253 0 : return py_tag_id;
11254 : }
11255 :
11256 0 : static int py_svcctl_ChangeServiceConfigW_in_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
11257 : {
11258 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11259 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.tag_id));
11260 0 : if (value == NULL) {
11261 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.tag_id");
11262 0 : return -1;
11263 : }
11264 0 : if (value == Py_None) {
11265 0 : object->in.tag_id = NULL;
11266 : } else {
11267 0 : object->in.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.tag_id);
11268 0 : if (object->in.tag_id == NULL) {
11269 0 : PyErr_NoMemory();
11270 0 : return -1;
11271 : }
11272 : {
11273 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.tag_id));
11274 0 : if (PyLong_Check(value)) {
11275 0 : unsigned long long test_var;
11276 0 : test_var = PyLong_AsUnsignedLongLong(value);
11277 0 : if (PyErr_Occurred() != NULL) {
11278 0 : return -1;
11279 : }
11280 0 : if (test_var > uint_max) {
11281 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11282 : PyLong_Type.tp_name, uint_max, test_var);
11283 0 : return -1;
11284 : }
11285 0 : *object->in.tag_id = test_var;
11286 : } else {
11287 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11288 : PyLong_Type.tp_name);
11289 0 : return -1;
11290 : }
11291 : }
11292 : }
11293 0 : return 0;
11294 : }
11295 :
11296 0 : static PyObject *py_svcctl_ChangeServiceConfigW_out_get_tag_id(PyObject *obj, void *closure)
11297 : {
11298 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11299 0 : PyObject *py_tag_id;
11300 0 : if (object->out.tag_id == NULL) {
11301 0 : Py_RETURN_NONE;
11302 : }
11303 0 : if (object->out.tag_id == NULL) {
11304 0 : py_tag_id = Py_None;
11305 0 : Py_INCREF(py_tag_id);
11306 : } else {
11307 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->out.tag_id);
11308 : }
11309 0 : return py_tag_id;
11310 : }
11311 :
11312 0 : static int py_svcctl_ChangeServiceConfigW_out_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
11313 : {
11314 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11315 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.tag_id));
11316 0 : if (value == NULL) {
11317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.tag_id");
11318 0 : return -1;
11319 : }
11320 0 : if (value == Py_None) {
11321 0 : object->out.tag_id = NULL;
11322 : } else {
11323 0 : object->out.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.tag_id);
11324 0 : if (object->out.tag_id == NULL) {
11325 0 : PyErr_NoMemory();
11326 0 : return -1;
11327 : }
11328 : {
11329 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.tag_id));
11330 0 : if (PyLong_Check(value)) {
11331 0 : unsigned long long test_var;
11332 0 : test_var = PyLong_AsUnsignedLongLong(value);
11333 0 : if (PyErr_Occurred() != NULL) {
11334 0 : return -1;
11335 : }
11336 0 : if (test_var > uint_max) {
11337 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11338 : PyLong_Type.tp_name, uint_max, test_var);
11339 0 : return -1;
11340 : }
11341 0 : *object->out.tag_id = test_var;
11342 : } else {
11343 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11344 : PyLong_Type.tp_name);
11345 0 : return -1;
11346 : }
11347 : }
11348 : }
11349 0 : return 0;
11350 : }
11351 :
11352 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dependencies(PyObject *obj, void *closure)
11353 : {
11354 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11355 0 : PyObject *py_dependencies;
11356 0 : if (object->in.dependencies == NULL) {
11357 0 : Py_RETURN_NONE;
11358 : }
11359 0 : if (object->in.dependencies == NULL) {
11360 0 : py_dependencies = Py_None;
11361 0 : Py_INCREF(py_dependencies);
11362 : } else {
11363 0 : if (object->in.dependencies == NULL) {
11364 0 : py_dependencies = Py_None;
11365 0 : Py_INCREF(py_dependencies);
11366 : } else {
11367 0 : py_dependencies = PyUnicode_Decode(object->in.dependencies, strlen(object->in.dependencies), "utf-8", "ignore");
11368 : }
11369 : }
11370 0 : return py_dependencies;
11371 : }
11372 :
11373 0 : static int py_svcctl_ChangeServiceConfigW_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
11374 : {
11375 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11376 0 : if (value == NULL) {
11377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
11378 0 : return -1;
11379 : }
11380 0 : if (value == Py_None) {
11381 0 : object->in.dependencies = NULL;
11382 : } else {
11383 0 : object->in.dependencies = NULL;
11384 : {
11385 0 : const char *test_str;
11386 0 : const char *talloc_str;
11387 0 : PyObject *unicode = NULL;
11388 0 : if (PyUnicode_Check(value)) {
11389 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11390 0 : if (unicode == NULL) {
11391 0 : return -1;
11392 : }
11393 0 : test_str = PyBytes_AS_STRING(unicode);
11394 0 : } else if (PyBytes_Check(value)) {
11395 0 : test_str = PyBytes_AS_STRING(value);
11396 : } else {
11397 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11398 0 : return -1;
11399 : }
11400 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11401 0 : if (unicode != NULL) {
11402 0 : Py_DECREF(unicode);
11403 : }
11404 0 : if (talloc_str == NULL) {
11405 0 : PyErr_NoMemory();
11406 0 : return -1;
11407 : }
11408 0 : object->in.dependencies = talloc_str;
11409 : }
11410 : }
11411 0 : return 0;
11412 : }
11413 :
11414 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dwDependSize(PyObject *obj, void *closure)
11415 : {
11416 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11417 0 : PyObject *py_dwDependSize;
11418 0 : py_dwDependSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDependSize);
11419 0 : return py_dwDependSize;
11420 : }
11421 :
11422 0 : static int py_svcctl_ChangeServiceConfigW_in_set_dwDependSize(PyObject *py_obj, PyObject *value, void *closure)
11423 : {
11424 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11425 0 : if (value == NULL) {
11426 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDependSize");
11427 0 : return -1;
11428 : }
11429 : {
11430 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDependSize));
11431 0 : if (PyLong_Check(value)) {
11432 0 : unsigned long long test_var;
11433 0 : test_var = PyLong_AsUnsignedLongLong(value);
11434 0 : if (PyErr_Occurred() != NULL) {
11435 0 : return -1;
11436 : }
11437 0 : if (test_var > uint_max) {
11438 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11439 : PyLong_Type.tp_name, uint_max, test_var);
11440 0 : return -1;
11441 : }
11442 0 : object->in.dwDependSize = test_var;
11443 : } else {
11444 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11445 : PyLong_Type.tp_name);
11446 0 : return -1;
11447 : }
11448 : }
11449 0 : return 0;
11450 : }
11451 :
11452 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_service_start_name(PyObject *obj, void *closure)
11453 : {
11454 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11455 0 : PyObject *py_service_start_name;
11456 0 : if (object->in.service_start_name == NULL) {
11457 0 : Py_RETURN_NONE;
11458 : }
11459 0 : if (object->in.service_start_name == NULL) {
11460 0 : py_service_start_name = Py_None;
11461 0 : Py_INCREF(py_service_start_name);
11462 : } else {
11463 0 : if (object->in.service_start_name == NULL) {
11464 0 : py_service_start_name = Py_None;
11465 0 : Py_INCREF(py_service_start_name);
11466 : } else {
11467 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
11468 : }
11469 : }
11470 0 : return py_service_start_name;
11471 : }
11472 :
11473 0 : static int py_svcctl_ChangeServiceConfigW_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
11474 : {
11475 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11476 0 : if (value == NULL) {
11477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
11478 0 : return -1;
11479 : }
11480 0 : if (value == Py_None) {
11481 0 : object->in.service_start_name = NULL;
11482 : } else {
11483 0 : object->in.service_start_name = NULL;
11484 : {
11485 0 : const char *test_str;
11486 0 : const char *talloc_str;
11487 0 : PyObject *unicode = NULL;
11488 0 : if (PyUnicode_Check(value)) {
11489 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11490 0 : if (unicode == NULL) {
11491 0 : return -1;
11492 : }
11493 0 : test_str = PyBytes_AS_STRING(unicode);
11494 0 : } else if (PyBytes_Check(value)) {
11495 0 : test_str = PyBytes_AS_STRING(value);
11496 : } else {
11497 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11498 0 : return -1;
11499 : }
11500 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11501 0 : if (unicode != NULL) {
11502 0 : Py_DECREF(unicode);
11503 : }
11504 0 : if (talloc_str == NULL) {
11505 0 : PyErr_NoMemory();
11506 0 : return -1;
11507 : }
11508 0 : object->in.service_start_name = talloc_str;
11509 : }
11510 : }
11511 0 : return 0;
11512 : }
11513 :
11514 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_password(PyObject *obj, void *closure)
11515 : {
11516 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11517 0 : PyObject *py_password;
11518 0 : if (object->in.password == NULL) {
11519 0 : Py_RETURN_NONE;
11520 : }
11521 0 : if (object->in.password == NULL) {
11522 0 : py_password = Py_None;
11523 0 : Py_INCREF(py_password);
11524 : } else {
11525 0 : if (object->in.password == NULL) {
11526 0 : py_password = Py_None;
11527 0 : Py_INCREF(py_password);
11528 : } else {
11529 0 : py_password = PyUnicode_Decode(object->in.password, strlen(object->in.password), "utf-8", "ignore");
11530 : }
11531 : }
11532 0 : return py_password;
11533 : }
11534 :
11535 0 : static int py_svcctl_ChangeServiceConfigW_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
11536 : {
11537 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11538 0 : if (value == NULL) {
11539 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
11540 0 : return -1;
11541 : }
11542 0 : if (value == Py_None) {
11543 0 : object->in.password = NULL;
11544 : } else {
11545 0 : object->in.password = NULL;
11546 : {
11547 0 : const char *test_str;
11548 0 : const char *talloc_str;
11549 0 : PyObject *unicode = NULL;
11550 0 : if (PyUnicode_Check(value)) {
11551 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11552 0 : if (unicode == NULL) {
11553 0 : return -1;
11554 : }
11555 0 : test_str = PyBytes_AS_STRING(unicode);
11556 0 : } else if (PyBytes_Check(value)) {
11557 0 : test_str = PyBytes_AS_STRING(value);
11558 : } else {
11559 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11560 0 : return -1;
11561 : }
11562 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11563 0 : if (unicode != NULL) {
11564 0 : Py_DECREF(unicode);
11565 : }
11566 0 : if (talloc_str == NULL) {
11567 0 : PyErr_NoMemory();
11568 0 : return -1;
11569 : }
11570 0 : object->in.password = talloc_str;
11571 : }
11572 : }
11573 0 : return 0;
11574 : }
11575 :
11576 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dwPwSize(PyObject *obj, void *closure)
11577 : {
11578 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11579 0 : PyObject *py_dwPwSize;
11580 0 : py_dwPwSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwPwSize);
11581 0 : return py_dwPwSize;
11582 : }
11583 :
11584 0 : static int py_svcctl_ChangeServiceConfigW_in_set_dwPwSize(PyObject *py_obj, PyObject *value, void *closure)
11585 : {
11586 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11587 0 : if (value == NULL) {
11588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwPwSize");
11589 0 : return -1;
11590 : }
11591 : {
11592 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwPwSize));
11593 0 : if (PyLong_Check(value)) {
11594 0 : unsigned long long test_var;
11595 0 : test_var = PyLong_AsUnsignedLongLong(value);
11596 0 : if (PyErr_Occurred() != NULL) {
11597 0 : return -1;
11598 : }
11599 0 : if (test_var > uint_max) {
11600 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11601 : PyLong_Type.tp_name, uint_max, test_var);
11602 0 : return -1;
11603 : }
11604 0 : object->in.dwPwSize = test_var;
11605 : } else {
11606 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11607 : PyLong_Type.tp_name);
11608 0 : return -1;
11609 : }
11610 : }
11611 0 : return 0;
11612 : }
11613 :
11614 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_display_name(PyObject *obj, void *closure)
11615 : {
11616 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11617 0 : PyObject *py_display_name;
11618 0 : if (object->in.display_name == NULL) {
11619 0 : Py_RETURN_NONE;
11620 : }
11621 0 : if (object->in.display_name == NULL) {
11622 0 : py_display_name = Py_None;
11623 0 : Py_INCREF(py_display_name);
11624 : } else {
11625 0 : if (object->in.display_name == NULL) {
11626 0 : py_display_name = Py_None;
11627 0 : Py_INCREF(py_display_name);
11628 : } else {
11629 0 : py_display_name = PyUnicode_Decode(object->in.display_name, strlen(object->in.display_name), "utf-8", "ignore");
11630 : }
11631 : }
11632 0 : return py_display_name;
11633 : }
11634 :
11635 0 : static int py_svcctl_ChangeServiceConfigW_in_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
11636 : {
11637 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11638 0 : if (value == NULL) {
11639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name");
11640 0 : return -1;
11641 : }
11642 0 : if (value == Py_None) {
11643 0 : object->in.display_name = NULL;
11644 : } else {
11645 0 : object->in.display_name = NULL;
11646 : {
11647 0 : const char *test_str;
11648 0 : const char *talloc_str;
11649 0 : PyObject *unicode = NULL;
11650 0 : if (PyUnicode_Check(value)) {
11651 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11652 0 : if (unicode == NULL) {
11653 0 : return -1;
11654 : }
11655 0 : test_str = PyBytes_AS_STRING(unicode);
11656 0 : } else if (PyBytes_Check(value)) {
11657 0 : test_str = PyBytes_AS_STRING(value);
11658 : } else {
11659 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11660 0 : return -1;
11661 : }
11662 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11663 0 : if (unicode != NULL) {
11664 0 : Py_DECREF(unicode);
11665 : }
11666 0 : if (talloc_str == NULL) {
11667 0 : PyErr_NoMemory();
11668 0 : return -1;
11669 : }
11670 0 : object->in.display_name = talloc_str;
11671 : }
11672 : }
11673 0 : return 0;
11674 : }
11675 :
11676 0 : static PyObject *py_svcctl_ChangeServiceConfigW_get_result(PyObject *obj, void *closure)
11677 : {
11678 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
11679 0 : PyObject *py_result;
11680 0 : py_result = PyErr_FromWERROR(object->out.result);
11681 0 : return py_result;
11682 : }
11683 :
11684 0 : static int py_svcctl_ChangeServiceConfigW_set_result(PyObject *py_obj, PyObject *value, void *closure)
11685 : {
11686 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11687 0 : if (value == NULL) {
11688 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
11689 0 : return -1;
11690 : }
11691 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
11692 0 : return 0;
11693 : }
11694 :
11695 : static PyGetSetDef py_svcctl_ChangeServiceConfigW_getsetters[] = {
11696 : {
11697 : .name = discard_const_p(char, "in_handle"),
11698 : .get = py_svcctl_ChangeServiceConfigW_in_get_handle,
11699 : .set = py_svcctl_ChangeServiceConfigW_in_set_handle,
11700 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
11701 : },
11702 : {
11703 : .name = discard_const_p(char, "in_type"),
11704 : .get = py_svcctl_ChangeServiceConfigW_in_get_type,
11705 : .set = py_svcctl_ChangeServiceConfigW_in_set_type,
11706 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11707 : },
11708 : {
11709 : .name = discard_const_p(char, "in_start_type"),
11710 : .get = py_svcctl_ChangeServiceConfigW_in_get_start_type,
11711 : .set = py_svcctl_ChangeServiceConfigW_in_set_start_type,
11712 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
11713 : },
11714 : {
11715 : .name = discard_const_p(char, "in_error_control"),
11716 : .get = py_svcctl_ChangeServiceConfigW_in_get_error_control,
11717 : .set = py_svcctl_ChangeServiceConfigW_in_set_error_control,
11718 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
11719 : },
11720 : {
11721 : .name = discard_const_p(char, "in_binary_path"),
11722 : .get = py_svcctl_ChangeServiceConfigW_in_get_binary_path,
11723 : .set = py_svcctl_ChangeServiceConfigW_in_set_binary_path,
11724 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11725 : },
11726 : {
11727 : .name = discard_const_p(char, "in_load_order_group"),
11728 : .get = py_svcctl_ChangeServiceConfigW_in_get_load_order_group,
11729 : .set = py_svcctl_ChangeServiceConfigW_in_set_load_order_group,
11730 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11731 : },
11732 : {
11733 : .name = discard_const_p(char, "in_tag_id"),
11734 : .get = py_svcctl_ChangeServiceConfigW_in_get_tag_id,
11735 : .set = py_svcctl_ChangeServiceConfigW_in_set_tag_id,
11736 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11737 : },
11738 : {
11739 : .name = discard_const_p(char, "out_tag_id"),
11740 : .get = py_svcctl_ChangeServiceConfigW_out_get_tag_id,
11741 : .set = py_svcctl_ChangeServiceConfigW_out_set_tag_id,
11742 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11743 : },
11744 : {
11745 : .name = discard_const_p(char, "in_dependencies"),
11746 : .get = py_svcctl_ChangeServiceConfigW_in_get_dependencies,
11747 : .set = py_svcctl_ChangeServiceConfigW_in_set_dependencies,
11748 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11749 : },
11750 : {
11751 : .name = discard_const_p(char, "in_dwDependSize"),
11752 : .get = py_svcctl_ChangeServiceConfigW_in_get_dwDependSize,
11753 : .set = py_svcctl_ChangeServiceConfigW_in_set_dwDependSize,
11754 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11755 : },
11756 : {
11757 : .name = discard_const_p(char, "in_service_start_name"),
11758 : .get = py_svcctl_ChangeServiceConfigW_in_get_service_start_name,
11759 : .set = py_svcctl_ChangeServiceConfigW_in_set_service_start_name,
11760 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11761 : },
11762 : {
11763 : .name = discard_const_p(char, "in_password"),
11764 : .get = py_svcctl_ChangeServiceConfigW_in_get_password,
11765 : .set = py_svcctl_ChangeServiceConfigW_in_set_password,
11766 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11767 : },
11768 : {
11769 : .name = discard_const_p(char, "in_dwPwSize"),
11770 : .get = py_svcctl_ChangeServiceConfigW_in_get_dwPwSize,
11771 : .set = py_svcctl_ChangeServiceConfigW_in_set_dwPwSize,
11772 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11773 : },
11774 : {
11775 : .name = discard_const_p(char, "in_display_name"),
11776 : .get = py_svcctl_ChangeServiceConfigW_in_get_display_name,
11777 : .set = py_svcctl_ChangeServiceConfigW_in_set_display_name,
11778 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11779 : },
11780 : {
11781 : .name = discard_const_p(char, "result"),
11782 : .get = py_svcctl_ChangeServiceConfigW_get_result,
11783 : .set = py_svcctl_ChangeServiceConfigW_set_result,
11784 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
11785 : },
11786 : { .name = NULL }
11787 : };
11788 :
11789 0 : static PyObject *py_svcctl_ChangeServiceConfigW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11790 : {
11791 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfigW, type);
11792 0 : struct svcctl_ChangeServiceConfigW *_self = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(self);
11793 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
11794 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
11795 0 : return self;
11796 : }
11797 :
11798 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
11799 : {
11800 :
11801 :
11802 0 : return PyLong_FromLong(11);
11803 : }
11804 :
11805 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
11806 : {
11807 0 : const struct ndr_interface_call *call = NULL;
11808 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11809 0 : PyObject *ret = NULL;
11810 0 : struct ndr_push *push = NULL;
11811 0 : DATA_BLOB blob;
11812 0 : enum ndr_err_code err;
11813 :
11814 0 : if (ndr_table_svcctl.num_calls < 12) {
11815 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_pack");
11816 0 : return NULL;
11817 : }
11818 0 : call = &ndr_table_svcctl.calls[11];
11819 :
11820 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
11821 0 : if (push == NULL) {
11822 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11823 0 : return NULL;
11824 : }
11825 :
11826 0 : push->flags |= ndr_push_flags;
11827 :
11828 0 : err = call->ndr_push(push, ndr_inout_flags, object);
11829 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11830 0 : TALLOC_FREE(push);
11831 0 : PyErr_SetNdrError(err);
11832 0 : return NULL;
11833 : }
11834 0 : blob = ndr_push_blob(push);
11835 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11836 0 : TALLOC_FREE(push);
11837 0 : return ret;
11838 : }
11839 :
11840 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11841 : {
11842 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11843 0 : PyObject *bigendian_obj = NULL;
11844 0 : PyObject *ndr64_obj = NULL;
11845 0 : libndr_flags ndr_push_flags = 0;
11846 :
11847 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
11848 : discard_const_p(char *, kwnames),
11849 : &bigendian_obj,
11850 : &ndr64_obj)) {
11851 0 : return NULL;
11852 : }
11853 :
11854 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11855 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11856 : }
11857 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11858 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11859 : }
11860 :
11861 0 : return py_svcctl_ChangeServiceConfigW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
11862 : }
11863 :
11864 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11865 : {
11866 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11867 0 : PyObject *bigendian_obj = NULL;
11868 0 : PyObject *ndr64_obj = NULL;
11869 0 : libndr_flags ndr_push_flags = 0;
11870 :
11871 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
11872 : discard_const_p(char *, kwnames),
11873 : &bigendian_obj,
11874 : &ndr64_obj)) {
11875 0 : return NULL;
11876 : }
11877 :
11878 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11879 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11880 : }
11881 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11882 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11883 : }
11884 :
11885 0 : return py_svcctl_ChangeServiceConfigW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
11886 : }
11887 :
11888 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
11889 : {
11890 0 : const struct ndr_interface_call *call = NULL;
11891 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
11892 0 : struct ndr_pull *pull = NULL;
11893 0 : enum ndr_err_code err;
11894 :
11895 0 : if (ndr_table_svcctl.num_calls < 12) {
11896 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_unpack");
11897 0 : return NULL;
11898 : }
11899 0 : call = &ndr_table_svcctl.calls[11];
11900 :
11901 0 : pull = ndr_pull_init_blob(blob, object);
11902 0 : if (pull == NULL) {
11903 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11904 0 : return NULL;
11905 : }
11906 :
11907 0 : pull->flags |= ndr_pull_flags;
11908 :
11909 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
11910 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11911 0 : TALLOC_FREE(pull);
11912 0 : PyErr_SetNdrError(err);
11913 0 : return NULL;
11914 : }
11915 0 : if (!allow_remaining) {
11916 0 : uint32_t highest_ofs;
11917 :
11918 0 : if (pull->offset > pull->relative_highest_offset) {
11919 0 : highest_ofs = pull->offset;
11920 : } else {
11921 0 : highest_ofs = pull->relative_highest_offset;
11922 : }
11923 0 : if (highest_ofs < pull->data_size) {
11924 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
11925 : "not all bytes consumed ofs[%u] size[%u]",
11926 : highest_ofs, pull->data_size);
11927 0 : TALLOC_FREE(pull);
11928 0 : PyErr_SetNdrError(err);
11929 0 : return NULL;
11930 : }
11931 : }
11932 :
11933 0 : TALLOC_FREE(pull);
11934 0 : Py_RETURN_NONE;
11935 : }
11936 :
11937 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11938 : {
11939 0 : DATA_BLOB blob;
11940 0 : Py_ssize_t blob_length = 0;
11941 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11942 0 : PyObject *bigendian_obj = NULL;
11943 0 : PyObject *ndr64_obj = NULL;
11944 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11945 0 : PyObject *allow_remaining_obj = NULL;
11946 0 : bool allow_remaining = false;
11947 :
11948 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
11949 : discard_const_p(char *, kwnames),
11950 : &blob.data, &blob_length,
11951 : &bigendian_obj,
11952 : &ndr64_obj,
11953 : &allow_remaining_obj)) {
11954 0 : return NULL;
11955 : }
11956 0 : blob.length = blob_length;
11957 :
11958 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11959 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11960 : }
11961 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11962 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11963 : }
11964 :
11965 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11966 0 : allow_remaining = true;
11967 : }
11968 :
11969 0 : return py_svcctl_ChangeServiceConfigW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
11970 : }
11971 :
11972 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11973 : {
11974 0 : DATA_BLOB blob;
11975 0 : Py_ssize_t blob_length = 0;
11976 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11977 0 : PyObject *bigendian_obj = NULL;
11978 0 : PyObject *ndr64_obj = NULL;
11979 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11980 0 : PyObject *allow_remaining_obj = NULL;
11981 0 : bool allow_remaining = false;
11982 :
11983 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
11984 : discard_const_p(char *, kwnames),
11985 : &blob.data, &blob_length,
11986 : &bigendian_obj,
11987 : &ndr64_obj,
11988 : &allow_remaining_obj)) {
11989 0 : return NULL;
11990 : }
11991 0 : blob.length = blob_length;
11992 :
11993 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11994 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11995 : }
11996 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11997 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11998 : }
11999 :
12000 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12001 0 : allow_remaining = true;
12002 : }
12003 :
12004 0 : return py_svcctl_ChangeServiceConfigW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12005 : }
12006 :
12007 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
12008 : {
12009 0 : const struct ndr_interface_call *call = NULL;
12010 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
12011 0 : PyObject *ret;
12012 0 : char *retstr;
12013 :
12014 0 : if (ndr_table_svcctl.num_calls < 12) {
12015 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_print");
12016 0 : return NULL;
12017 : }
12018 0 : call = &ndr_table_svcctl.calls[11];
12019 :
12020 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12021 0 : ret = PyUnicode_FromString(retstr);
12022 0 : TALLOC_FREE(retstr);
12023 :
12024 0 : return ret;
12025 : }
12026 :
12027 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12028 : {
12029 0 : return py_svcctl_ChangeServiceConfigW_ndr_print(py_obj, "svcctl_ChangeServiceConfigW_in", NDR_IN);
12030 : }
12031 :
12032 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12033 : {
12034 0 : return py_svcctl_ChangeServiceConfigW_ndr_print(py_obj, "svcctl_ChangeServiceConfigW_out", NDR_OUT);
12035 : }
12036 :
12037 : static PyMethodDef py_svcctl_ChangeServiceConfigW_methods[] = {
12038 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_opnum, METH_NOARGS|METH_CLASS,
12039 : "svcctl.ChangeServiceConfigW.opnum() -> 11 (0x0b) " },
12040 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12041 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12042 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12043 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12044 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12045 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12046 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12047 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12048 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12049 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12050 : { NULL, NULL, 0, NULL }
12051 : };
12052 :
12053 :
12054 : static PyTypeObject svcctl_ChangeServiceConfigW_Type = {
12055 : PyVarObject_HEAD_INIT(NULL, 0)
12056 : .tp_name = "svcctl.ChangeServiceConfigW",
12057 : .tp_getset = py_svcctl_ChangeServiceConfigW_getsetters,
12058 : .tp_methods = py_svcctl_ChangeServiceConfigW_methods,
12059 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12060 : .tp_new = py_svcctl_ChangeServiceConfigW_new,
12061 : };
12062 :
12063 0 : static bool pack_py_svcctl_ChangeServiceConfigW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfigW *r)
12064 : {
12065 0 : PyObject *py_handle;
12066 0 : PyObject *py_type;
12067 0 : PyObject *py_start_type;
12068 0 : PyObject *py_error_control;
12069 0 : PyObject *py_binary_path;
12070 0 : PyObject *py_load_order_group;
12071 0 : PyObject *py_tag_id;
12072 0 : PyObject *py_dependencies;
12073 0 : PyObject *py_service_start_name;
12074 0 : PyObject *py_password;
12075 0 : PyObject *py_display_name;
12076 0 : const char *kwnames[] = {
12077 : "handle", "type", "start_type", "error_control", "binary_path", "load_order_group", "tag_id", "dependencies", "service_start_name", "password", "display_name", NULL
12078 : };
12079 :
12080 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)) {
12081 0 : return false;
12082 : }
12083 :
12084 0 : if (py_handle == NULL) {
12085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
12086 0 : return false;
12087 : }
12088 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
12089 0 : if (r->in.handle == NULL) {
12090 0 : PyErr_NoMemory();
12091 0 : return false;
12092 : }
12093 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12094 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12095 0 : PyErr_NoMemory();
12096 0 : return false;
12097 : }
12098 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12099 0 : if (py_type == NULL) {
12100 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
12101 0 : return false;
12102 : }
12103 : {
12104 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
12105 0 : if (PyLong_Check(py_type)) {
12106 0 : unsigned long long test_var;
12107 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
12108 0 : if (PyErr_Occurred() != NULL) {
12109 0 : return false;
12110 : }
12111 0 : if (test_var > uint_max) {
12112 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12113 : PyLong_Type.tp_name, uint_max, test_var);
12114 0 : return false;
12115 : }
12116 0 : r->in.type = test_var;
12117 : } else {
12118 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12119 : PyLong_Type.tp_name);
12120 0 : return false;
12121 : }
12122 : }
12123 0 : if (py_start_type == NULL) {
12124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
12125 0 : return false;
12126 : }
12127 : {
12128 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
12129 0 : if (PyLong_Check(py_start_type)) {
12130 0 : unsigned long long test_var;
12131 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
12132 0 : if (PyErr_Occurred() != NULL) {
12133 0 : return false;
12134 : }
12135 0 : if (test_var > uint_max) {
12136 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12137 : PyLong_Type.tp_name, uint_max, test_var);
12138 0 : return false;
12139 : }
12140 0 : r->in.start_type = test_var;
12141 : } else {
12142 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12143 : PyLong_Type.tp_name);
12144 0 : return false;
12145 : }
12146 : }
12147 0 : if (py_error_control == NULL) {
12148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
12149 0 : return false;
12150 : }
12151 : {
12152 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
12153 0 : if (PyLong_Check(py_error_control)) {
12154 0 : unsigned long long test_var;
12155 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
12156 0 : if (PyErr_Occurred() != NULL) {
12157 0 : return false;
12158 : }
12159 0 : if (test_var > uint_max) {
12160 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12161 : PyLong_Type.tp_name, uint_max, test_var);
12162 0 : return false;
12163 : }
12164 0 : r->in.error_control = test_var;
12165 : } else {
12166 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12167 : PyLong_Type.tp_name);
12168 0 : return false;
12169 : }
12170 : }
12171 0 : if (py_binary_path == NULL) {
12172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
12173 0 : return false;
12174 : }
12175 0 : if (py_binary_path == Py_None) {
12176 0 : r->in.binary_path = NULL;
12177 : } else {
12178 0 : r->in.binary_path = NULL;
12179 : {
12180 0 : const char *test_str;
12181 0 : const char *talloc_str;
12182 0 : PyObject *unicode = NULL;
12183 0 : if (PyUnicode_Check(py_binary_path)) {
12184 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
12185 0 : if (unicode == NULL) {
12186 0 : return false;
12187 : }
12188 0 : test_str = PyBytes_AS_STRING(unicode);
12189 0 : } else if (PyBytes_Check(py_binary_path)) {
12190 0 : test_str = PyBytes_AS_STRING(py_binary_path);
12191 : } else {
12192 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
12193 0 : return false;
12194 : }
12195 0 : talloc_str = talloc_strdup(r, test_str);
12196 0 : if (unicode != NULL) {
12197 0 : Py_DECREF(unicode);
12198 : }
12199 0 : if (talloc_str == NULL) {
12200 0 : PyErr_NoMemory();
12201 0 : return false;
12202 : }
12203 0 : r->in.binary_path = talloc_str;
12204 : }
12205 : }
12206 0 : if (py_load_order_group == NULL) {
12207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.load_order_group");
12208 0 : return false;
12209 : }
12210 0 : if (py_load_order_group == Py_None) {
12211 0 : r->in.load_order_group = NULL;
12212 : } else {
12213 0 : r->in.load_order_group = NULL;
12214 : {
12215 0 : const char *test_str;
12216 0 : const char *talloc_str;
12217 0 : PyObject *unicode = NULL;
12218 0 : if (PyUnicode_Check(py_load_order_group)) {
12219 0 : unicode = PyUnicode_AsEncodedString(py_load_order_group, "utf-8", "ignore");
12220 0 : if (unicode == NULL) {
12221 0 : return false;
12222 : }
12223 0 : test_str = PyBytes_AS_STRING(unicode);
12224 0 : } else if (PyBytes_Check(py_load_order_group)) {
12225 0 : test_str = PyBytes_AS_STRING(py_load_order_group);
12226 : } else {
12227 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_load_order_group)->tp_name);
12228 0 : return false;
12229 : }
12230 0 : talloc_str = talloc_strdup(r, test_str);
12231 0 : if (unicode != NULL) {
12232 0 : Py_DECREF(unicode);
12233 : }
12234 0 : if (talloc_str == NULL) {
12235 0 : PyErr_NoMemory();
12236 0 : return false;
12237 : }
12238 0 : r->in.load_order_group = talloc_str;
12239 : }
12240 : }
12241 0 : if (py_tag_id == NULL) {
12242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.tag_id");
12243 0 : return false;
12244 : }
12245 0 : if (py_tag_id == Py_None) {
12246 0 : r->in.tag_id = NULL;
12247 : } else {
12248 0 : r->in.tag_id = talloc_ptrtype(r, r->in.tag_id);
12249 0 : if (r->in.tag_id == NULL) {
12250 0 : PyErr_NoMemory();
12251 0 : return false;
12252 : }
12253 : {
12254 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.tag_id));
12255 0 : if (PyLong_Check(py_tag_id)) {
12256 0 : unsigned long long test_var;
12257 0 : test_var = PyLong_AsUnsignedLongLong(py_tag_id);
12258 0 : if (PyErr_Occurred() != NULL) {
12259 0 : return false;
12260 : }
12261 0 : if (test_var > uint_max) {
12262 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12263 : PyLong_Type.tp_name, uint_max, test_var);
12264 0 : return false;
12265 : }
12266 0 : *r->in.tag_id = test_var;
12267 : } else {
12268 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12269 : PyLong_Type.tp_name);
12270 0 : return false;
12271 : }
12272 : }
12273 : }
12274 0 : if (py_dependencies == NULL) {
12275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
12276 0 : return false;
12277 : }
12278 0 : if (py_dependencies == Py_None) {
12279 0 : r->in.dependencies = NULL;
12280 : } else {
12281 0 : r->in.dependencies = NULL;
12282 : {
12283 0 : const char *test_str;
12284 0 : const char *talloc_str;
12285 0 : PyObject *unicode = NULL;
12286 0 : if (PyUnicode_Check(py_dependencies)) {
12287 0 : unicode = PyUnicode_AsEncodedString(py_dependencies, "utf-8", "ignore");
12288 0 : if (unicode == NULL) {
12289 0 : return false;
12290 : }
12291 0 : test_str = PyBytes_AS_STRING(unicode);
12292 0 : } else if (PyBytes_Check(py_dependencies)) {
12293 0 : test_str = PyBytes_AS_STRING(py_dependencies);
12294 : } else {
12295 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dependencies)->tp_name);
12296 0 : return false;
12297 : }
12298 0 : talloc_str = talloc_strdup(r, test_str);
12299 0 : if (unicode != NULL) {
12300 0 : Py_DECREF(unicode);
12301 : }
12302 0 : if (talloc_str == NULL) {
12303 0 : PyErr_NoMemory();
12304 0 : return false;
12305 : }
12306 0 : r->in.dependencies = talloc_str;
12307 : }
12308 : }
12309 0 : PY_CHECK_TYPE(&PyList_Type, py_dependencies, return false;);
12310 0 : r->in.dwDependSize = PyList_GET_SIZE(py_dependencies);
12311 0 : if (py_service_start_name == NULL) {
12312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
12313 0 : return false;
12314 : }
12315 0 : if (py_service_start_name == Py_None) {
12316 0 : r->in.service_start_name = NULL;
12317 : } else {
12318 0 : r->in.service_start_name = NULL;
12319 : {
12320 0 : const char *test_str;
12321 0 : const char *talloc_str;
12322 0 : PyObject *unicode = NULL;
12323 0 : if (PyUnicode_Check(py_service_start_name)) {
12324 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
12325 0 : if (unicode == NULL) {
12326 0 : return false;
12327 : }
12328 0 : test_str = PyBytes_AS_STRING(unicode);
12329 0 : } else if (PyBytes_Check(py_service_start_name)) {
12330 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
12331 : } else {
12332 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
12333 0 : return false;
12334 : }
12335 0 : talloc_str = talloc_strdup(r, test_str);
12336 0 : if (unicode != NULL) {
12337 0 : Py_DECREF(unicode);
12338 : }
12339 0 : if (talloc_str == NULL) {
12340 0 : PyErr_NoMemory();
12341 0 : return false;
12342 : }
12343 0 : r->in.service_start_name = talloc_str;
12344 : }
12345 : }
12346 0 : if (py_password == NULL) {
12347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
12348 0 : return false;
12349 : }
12350 0 : if (py_password == Py_None) {
12351 0 : r->in.password = NULL;
12352 : } else {
12353 0 : r->in.password = NULL;
12354 : {
12355 0 : const char *test_str;
12356 0 : const char *talloc_str;
12357 0 : PyObject *unicode = NULL;
12358 0 : if (PyUnicode_Check(py_password)) {
12359 0 : unicode = PyUnicode_AsEncodedString(py_password, "utf-8", "ignore");
12360 0 : if (unicode == NULL) {
12361 0 : return false;
12362 : }
12363 0 : test_str = PyBytes_AS_STRING(unicode);
12364 0 : } else if (PyBytes_Check(py_password)) {
12365 0 : test_str = PyBytes_AS_STRING(py_password);
12366 : } else {
12367 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_password)->tp_name);
12368 0 : return false;
12369 : }
12370 0 : talloc_str = talloc_strdup(r, test_str);
12371 0 : if (unicode != NULL) {
12372 0 : Py_DECREF(unicode);
12373 : }
12374 0 : if (talloc_str == NULL) {
12375 0 : PyErr_NoMemory();
12376 0 : return false;
12377 : }
12378 0 : r->in.password = talloc_str;
12379 : }
12380 : }
12381 0 : PY_CHECK_TYPE(&PyList_Type, py_password, return false;);
12382 0 : r->in.dwPwSize = PyList_GET_SIZE(py_password);
12383 0 : if (py_display_name == NULL) {
12384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name");
12385 0 : return false;
12386 : }
12387 0 : if (py_display_name == Py_None) {
12388 0 : r->in.display_name = NULL;
12389 : } else {
12390 0 : r->in.display_name = NULL;
12391 : {
12392 0 : const char *test_str;
12393 0 : const char *talloc_str;
12394 0 : PyObject *unicode = NULL;
12395 0 : if (PyUnicode_Check(py_display_name)) {
12396 0 : unicode = PyUnicode_AsEncodedString(py_display_name, "utf-8", "ignore");
12397 0 : if (unicode == NULL) {
12398 0 : return false;
12399 : }
12400 0 : test_str = PyBytes_AS_STRING(unicode);
12401 0 : } else if (PyBytes_Check(py_display_name)) {
12402 0 : test_str = PyBytes_AS_STRING(py_display_name);
12403 : } else {
12404 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_display_name)->tp_name);
12405 0 : return false;
12406 : }
12407 0 : talloc_str = talloc_strdup(r, test_str);
12408 0 : if (unicode != NULL) {
12409 0 : Py_DECREF(unicode);
12410 : }
12411 0 : if (talloc_str == NULL) {
12412 0 : PyErr_NoMemory();
12413 0 : return false;
12414 : }
12415 0 : r->in.display_name = talloc_str;
12416 : }
12417 : }
12418 0 : return true;
12419 : }
12420 :
12421 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfigW_args_out(struct svcctl_ChangeServiceConfigW *r)
12422 : {
12423 0 : PyObject *result;
12424 0 : PyObject *py_tag_id;
12425 0 : if (r->out.tag_id == NULL) {
12426 0 : py_tag_id = Py_None;
12427 0 : Py_INCREF(py_tag_id);
12428 : } else {
12429 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*r->out.tag_id);
12430 : }
12431 0 : result = py_tag_id;
12432 0 : if (!W_ERROR_IS_OK(r->out.result)) {
12433 0 : PyErr_SetWERROR(r->out.result);
12434 0 : return NULL;
12435 : }
12436 :
12437 0 : return result;
12438 : }
12439 :
12440 :
12441 0 : static PyObject *py_svcctl_CreateServiceW_in_get_scmanager_handle(PyObject *obj, void *closure)
12442 : {
12443 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12444 0 : PyObject *py_scmanager_handle;
12445 0 : if (object->in.scmanager_handle == NULL) {
12446 0 : Py_RETURN_NONE;
12447 : }
12448 0 : py_scmanager_handle = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager_handle, object->in.scmanager_handle);
12449 0 : return py_scmanager_handle;
12450 : }
12451 :
12452 0 : static int py_svcctl_CreateServiceW_in_set_scmanager_handle(PyObject *py_obj, PyObject *value, void *closure)
12453 : {
12454 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12455 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager_handle));
12456 0 : if (value == NULL) {
12457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager_handle");
12458 0 : return -1;
12459 : }
12460 0 : object->in.scmanager_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager_handle);
12461 0 : if (object->in.scmanager_handle == NULL) {
12462 0 : PyErr_NoMemory();
12463 0 : return -1;
12464 : }
12465 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12466 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12467 0 : PyErr_NoMemory();
12468 0 : return -1;
12469 : }
12470 0 : object->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(value);
12471 0 : return 0;
12472 : }
12473 :
12474 0 : static PyObject *py_svcctl_CreateServiceW_in_get_ServiceName(PyObject *obj, void *closure)
12475 : {
12476 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12477 0 : PyObject *py_ServiceName;
12478 0 : if (object->in.ServiceName == NULL) {
12479 0 : py_ServiceName = Py_None;
12480 0 : Py_INCREF(py_ServiceName);
12481 : } else {
12482 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
12483 : }
12484 0 : return py_ServiceName;
12485 : }
12486 :
12487 0 : static int py_svcctl_CreateServiceW_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
12488 : {
12489 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12490 0 : if (value == NULL) {
12491 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
12492 0 : return -1;
12493 : }
12494 : {
12495 0 : const char *test_str;
12496 0 : const char *talloc_str;
12497 0 : PyObject *unicode = NULL;
12498 0 : if (PyUnicode_Check(value)) {
12499 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12500 0 : if (unicode == NULL) {
12501 0 : return -1;
12502 : }
12503 0 : test_str = PyBytes_AS_STRING(unicode);
12504 0 : } else if (PyBytes_Check(value)) {
12505 0 : test_str = PyBytes_AS_STRING(value);
12506 : } else {
12507 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12508 0 : return -1;
12509 : }
12510 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12511 0 : if (unicode != NULL) {
12512 0 : Py_DECREF(unicode);
12513 : }
12514 0 : if (talloc_str == NULL) {
12515 0 : PyErr_NoMemory();
12516 0 : return -1;
12517 : }
12518 0 : object->in.ServiceName = talloc_str;
12519 : }
12520 0 : return 0;
12521 : }
12522 :
12523 0 : static PyObject *py_svcctl_CreateServiceW_in_get_DisplayName(PyObject *obj, void *closure)
12524 : {
12525 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12526 0 : PyObject *py_DisplayName;
12527 0 : if (object->in.DisplayName == NULL) {
12528 0 : Py_RETURN_NONE;
12529 : }
12530 0 : if (object->in.DisplayName == NULL) {
12531 0 : py_DisplayName = Py_None;
12532 0 : Py_INCREF(py_DisplayName);
12533 : } else {
12534 0 : if (object->in.DisplayName == NULL) {
12535 0 : py_DisplayName = Py_None;
12536 0 : Py_INCREF(py_DisplayName);
12537 : } else {
12538 0 : py_DisplayName = PyUnicode_Decode(object->in.DisplayName, strlen(object->in.DisplayName), "utf-8", "ignore");
12539 : }
12540 : }
12541 0 : return py_DisplayName;
12542 : }
12543 :
12544 0 : static int py_svcctl_CreateServiceW_in_set_DisplayName(PyObject *py_obj, PyObject *value, void *closure)
12545 : {
12546 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12547 0 : if (value == NULL) {
12548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DisplayName");
12549 0 : return -1;
12550 : }
12551 0 : if (value == Py_None) {
12552 0 : object->in.DisplayName = NULL;
12553 : } else {
12554 0 : object->in.DisplayName = NULL;
12555 : {
12556 0 : const char *test_str;
12557 0 : const char *talloc_str;
12558 0 : PyObject *unicode = NULL;
12559 0 : if (PyUnicode_Check(value)) {
12560 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12561 0 : if (unicode == NULL) {
12562 0 : return -1;
12563 : }
12564 0 : test_str = PyBytes_AS_STRING(unicode);
12565 0 : } else if (PyBytes_Check(value)) {
12566 0 : test_str = PyBytes_AS_STRING(value);
12567 : } else {
12568 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12569 0 : return -1;
12570 : }
12571 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12572 0 : if (unicode != NULL) {
12573 0 : Py_DECREF(unicode);
12574 : }
12575 0 : if (talloc_str == NULL) {
12576 0 : PyErr_NoMemory();
12577 0 : return -1;
12578 : }
12579 0 : object->in.DisplayName = talloc_str;
12580 : }
12581 : }
12582 0 : return 0;
12583 : }
12584 :
12585 0 : static PyObject *py_svcctl_CreateServiceW_in_get_desired_access(PyObject *obj, void *closure)
12586 : {
12587 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12588 0 : PyObject *py_desired_access;
12589 0 : py_desired_access = PyLong_FromUnsignedLongLong((uint32_t)object->in.desired_access);
12590 0 : return py_desired_access;
12591 : }
12592 :
12593 0 : static int py_svcctl_CreateServiceW_in_set_desired_access(PyObject *py_obj, PyObject *value, void *closure)
12594 : {
12595 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12596 0 : if (value == NULL) {
12597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.desired_access");
12598 0 : return -1;
12599 : }
12600 : {
12601 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.desired_access));
12602 0 : if (PyLong_Check(value)) {
12603 0 : unsigned long long test_var;
12604 0 : test_var = PyLong_AsUnsignedLongLong(value);
12605 0 : if (PyErr_Occurred() != NULL) {
12606 0 : return -1;
12607 : }
12608 0 : if (test_var > uint_max) {
12609 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12610 : PyLong_Type.tp_name, uint_max, test_var);
12611 0 : return -1;
12612 : }
12613 0 : object->in.desired_access = test_var;
12614 : } else {
12615 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12616 : PyLong_Type.tp_name);
12617 0 : return -1;
12618 : }
12619 : }
12620 0 : return 0;
12621 : }
12622 :
12623 0 : static PyObject *py_svcctl_CreateServiceW_in_get_type(PyObject *obj, void *closure)
12624 : {
12625 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12626 0 : PyObject *py_type;
12627 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
12628 0 : return py_type;
12629 : }
12630 :
12631 0 : static int py_svcctl_CreateServiceW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
12632 : {
12633 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12634 0 : if (value == NULL) {
12635 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
12636 0 : return -1;
12637 : }
12638 : {
12639 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
12640 0 : if (PyLong_Check(value)) {
12641 0 : unsigned long long test_var;
12642 0 : test_var = PyLong_AsUnsignedLongLong(value);
12643 0 : if (PyErr_Occurred() != NULL) {
12644 0 : return -1;
12645 : }
12646 0 : if (test_var > uint_max) {
12647 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12648 : PyLong_Type.tp_name, uint_max, test_var);
12649 0 : return -1;
12650 : }
12651 0 : object->in.type = test_var;
12652 : } else {
12653 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12654 : PyLong_Type.tp_name);
12655 0 : return -1;
12656 : }
12657 : }
12658 0 : return 0;
12659 : }
12660 :
12661 0 : static PyObject *py_svcctl_CreateServiceW_in_get_start_type(PyObject *obj, void *closure)
12662 : {
12663 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12664 0 : PyObject *py_start_type;
12665 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
12666 0 : return py_start_type;
12667 : }
12668 :
12669 0 : static int py_svcctl_CreateServiceW_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
12670 : {
12671 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12672 0 : if (value == NULL) {
12673 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
12674 0 : return -1;
12675 : }
12676 : {
12677 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
12678 0 : if (PyLong_Check(value)) {
12679 0 : unsigned long long test_var;
12680 0 : test_var = PyLong_AsUnsignedLongLong(value);
12681 0 : if (PyErr_Occurred() != NULL) {
12682 0 : return -1;
12683 : }
12684 0 : if (test_var > uint_max) {
12685 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12686 : PyLong_Type.tp_name, uint_max, test_var);
12687 0 : return -1;
12688 : }
12689 0 : object->in.start_type = test_var;
12690 : } else {
12691 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12692 : PyLong_Type.tp_name);
12693 0 : return -1;
12694 : }
12695 : }
12696 0 : return 0;
12697 : }
12698 :
12699 0 : static PyObject *py_svcctl_CreateServiceW_in_get_error_control(PyObject *obj, void *closure)
12700 : {
12701 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12702 0 : PyObject *py_error_control;
12703 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
12704 0 : return py_error_control;
12705 : }
12706 :
12707 0 : static int py_svcctl_CreateServiceW_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
12708 : {
12709 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12710 0 : if (value == NULL) {
12711 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
12712 0 : return -1;
12713 : }
12714 : {
12715 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
12716 0 : if (PyLong_Check(value)) {
12717 0 : unsigned long long test_var;
12718 0 : test_var = PyLong_AsUnsignedLongLong(value);
12719 0 : if (PyErr_Occurred() != NULL) {
12720 0 : return -1;
12721 : }
12722 0 : if (test_var > uint_max) {
12723 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12724 : PyLong_Type.tp_name, uint_max, test_var);
12725 0 : return -1;
12726 : }
12727 0 : object->in.error_control = test_var;
12728 : } else {
12729 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12730 : PyLong_Type.tp_name);
12731 0 : return -1;
12732 : }
12733 : }
12734 0 : return 0;
12735 : }
12736 :
12737 0 : static PyObject *py_svcctl_CreateServiceW_in_get_binary_path(PyObject *obj, void *closure)
12738 : {
12739 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12740 0 : PyObject *py_binary_path;
12741 0 : if (object->in.binary_path == NULL) {
12742 0 : py_binary_path = Py_None;
12743 0 : Py_INCREF(py_binary_path);
12744 : } else {
12745 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
12746 : }
12747 0 : return py_binary_path;
12748 : }
12749 :
12750 0 : static int py_svcctl_CreateServiceW_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
12751 : {
12752 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12753 0 : if (value == NULL) {
12754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
12755 0 : return -1;
12756 : }
12757 : {
12758 0 : const char *test_str;
12759 0 : const char *talloc_str;
12760 0 : PyObject *unicode = NULL;
12761 0 : if (PyUnicode_Check(value)) {
12762 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12763 0 : if (unicode == NULL) {
12764 0 : return -1;
12765 : }
12766 0 : test_str = PyBytes_AS_STRING(unicode);
12767 0 : } else if (PyBytes_Check(value)) {
12768 0 : test_str = PyBytes_AS_STRING(value);
12769 : } else {
12770 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12771 0 : return -1;
12772 : }
12773 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12774 0 : if (unicode != NULL) {
12775 0 : Py_DECREF(unicode);
12776 : }
12777 0 : if (talloc_str == NULL) {
12778 0 : PyErr_NoMemory();
12779 0 : return -1;
12780 : }
12781 0 : object->in.binary_path = talloc_str;
12782 : }
12783 0 : return 0;
12784 : }
12785 :
12786 0 : static PyObject *py_svcctl_CreateServiceW_in_get_LoadOrderGroupKey(PyObject *obj, void *closure)
12787 : {
12788 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12789 0 : PyObject *py_LoadOrderGroupKey;
12790 0 : if (object->in.LoadOrderGroupKey == NULL) {
12791 0 : Py_RETURN_NONE;
12792 : }
12793 0 : if (object->in.LoadOrderGroupKey == NULL) {
12794 0 : py_LoadOrderGroupKey = Py_None;
12795 0 : Py_INCREF(py_LoadOrderGroupKey);
12796 : } else {
12797 0 : if (object->in.LoadOrderGroupKey == NULL) {
12798 0 : py_LoadOrderGroupKey = Py_None;
12799 0 : Py_INCREF(py_LoadOrderGroupKey);
12800 : } else {
12801 0 : py_LoadOrderGroupKey = PyUnicode_Decode(object->in.LoadOrderGroupKey, strlen(object->in.LoadOrderGroupKey), "utf-8", "ignore");
12802 : }
12803 : }
12804 0 : return py_LoadOrderGroupKey;
12805 : }
12806 :
12807 0 : static int py_svcctl_CreateServiceW_in_set_LoadOrderGroupKey(PyObject *py_obj, PyObject *value, void *closure)
12808 : {
12809 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12810 0 : if (value == NULL) {
12811 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.LoadOrderGroupKey");
12812 0 : return -1;
12813 : }
12814 0 : if (value == Py_None) {
12815 0 : object->in.LoadOrderGroupKey = NULL;
12816 : } else {
12817 0 : object->in.LoadOrderGroupKey = NULL;
12818 : {
12819 0 : const char *test_str;
12820 0 : const char *talloc_str;
12821 0 : PyObject *unicode = NULL;
12822 0 : if (PyUnicode_Check(value)) {
12823 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12824 0 : if (unicode == NULL) {
12825 0 : return -1;
12826 : }
12827 0 : test_str = PyBytes_AS_STRING(unicode);
12828 0 : } else if (PyBytes_Check(value)) {
12829 0 : test_str = PyBytes_AS_STRING(value);
12830 : } else {
12831 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12832 0 : return -1;
12833 : }
12834 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12835 0 : if (unicode != NULL) {
12836 0 : Py_DECREF(unicode);
12837 : }
12838 0 : if (talloc_str == NULL) {
12839 0 : PyErr_NoMemory();
12840 0 : return -1;
12841 : }
12842 0 : object->in.LoadOrderGroupKey = talloc_str;
12843 : }
12844 : }
12845 0 : return 0;
12846 : }
12847 :
12848 0 : static PyObject *py_svcctl_CreateServiceW_in_get_TagId(PyObject *obj, void *closure)
12849 : {
12850 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12851 0 : PyObject *py_TagId;
12852 0 : if (object->in.TagId == NULL) {
12853 0 : Py_RETURN_NONE;
12854 : }
12855 0 : if (object->in.TagId == NULL) {
12856 0 : py_TagId = Py_None;
12857 0 : Py_INCREF(py_TagId);
12858 : } else {
12859 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->in.TagId);
12860 : }
12861 0 : return py_TagId;
12862 : }
12863 :
12864 0 : static int py_svcctl_CreateServiceW_in_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
12865 : {
12866 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12867 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.TagId));
12868 0 : if (value == NULL) {
12869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.TagId");
12870 0 : return -1;
12871 : }
12872 0 : if (value == Py_None) {
12873 0 : object->in.TagId = NULL;
12874 : } else {
12875 0 : object->in.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.TagId);
12876 0 : if (object->in.TagId == NULL) {
12877 0 : PyErr_NoMemory();
12878 0 : return -1;
12879 : }
12880 : {
12881 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.TagId));
12882 0 : if (PyLong_Check(value)) {
12883 0 : unsigned long long test_var;
12884 0 : test_var = PyLong_AsUnsignedLongLong(value);
12885 0 : if (PyErr_Occurred() != NULL) {
12886 0 : return -1;
12887 : }
12888 0 : if (test_var > uint_max) {
12889 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12890 : PyLong_Type.tp_name, uint_max, test_var);
12891 0 : return -1;
12892 : }
12893 0 : *object->in.TagId = test_var;
12894 : } else {
12895 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12896 : PyLong_Type.tp_name);
12897 0 : return -1;
12898 : }
12899 : }
12900 : }
12901 0 : return 0;
12902 : }
12903 :
12904 0 : static PyObject *py_svcctl_CreateServiceW_out_get_TagId(PyObject *obj, void *closure)
12905 : {
12906 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12907 0 : PyObject *py_TagId;
12908 0 : if (object->out.TagId == NULL) {
12909 0 : Py_RETURN_NONE;
12910 : }
12911 0 : if (object->out.TagId == NULL) {
12912 0 : py_TagId = Py_None;
12913 0 : Py_INCREF(py_TagId);
12914 : } else {
12915 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.TagId);
12916 : }
12917 0 : return py_TagId;
12918 : }
12919 :
12920 0 : static int py_svcctl_CreateServiceW_out_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
12921 : {
12922 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12923 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.TagId));
12924 0 : if (value == NULL) {
12925 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.TagId");
12926 0 : return -1;
12927 : }
12928 0 : if (value == Py_None) {
12929 0 : object->out.TagId = NULL;
12930 : } else {
12931 0 : object->out.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.TagId);
12932 0 : if (object->out.TagId == NULL) {
12933 0 : PyErr_NoMemory();
12934 0 : return -1;
12935 : }
12936 : {
12937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.TagId));
12938 0 : if (PyLong_Check(value)) {
12939 0 : unsigned long long test_var;
12940 0 : test_var = PyLong_AsUnsignedLongLong(value);
12941 0 : if (PyErr_Occurred() != NULL) {
12942 0 : return -1;
12943 : }
12944 0 : if (test_var > uint_max) {
12945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12946 : PyLong_Type.tp_name, uint_max, test_var);
12947 0 : return -1;
12948 : }
12949 0 : *object->out.TagId = test_var;
12950 : } else {
12951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12952 : PyLong_Type.tp_name);
12953 0 : return -1;
12954 : }
12955 : }
12956 : }
12957 0 : return 0;
12958 : }
12959 :
12960 0 : static PyObject *py_svcctl_CreateServiceW_in_get_dependencies(PyObject *obj, void *closure)
12961 : {
12962 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
12963 0 : PyObject *py_dependencies;
12964 0 : if (object->in.dependencies == NULL) {
12965 0 : Py_RETURN_NONE;
12966 : }
12967 0 : if (object->in.dependencies == NULL) {
12968 0 : py_dependencies = Py_None;
12969 0 : Py_INCREF(py_dependencies);
12970 : } else {
12971 0 : py_dependencies = PyList_New(object->in.dependencies_size);
12972 0 : if (py_dependencies == NULL) {
12973 0 : return NULL;
12974 : }
12975 : {
12976 : int dependencies_cntr_1;
12977 0 : for (dependencies_cntr_1 = 0; dependencies_cntr_1 < (object->in.dependencies_size); dependencies_cntr_1++) {
12978 0 : PyObject *py_dependencies_1;
12979 0 : py_dependencies_1 = PyLong_FromLong((uint16_t)object->in.dependencies[dependencies_cntr_1]);
12980 0 : PyList_SetItem(py_dependencies, dependencies_cntr_1, py_dependencies_1);
12981 : }
12982 : }
12983 : }
12984 0 : return py_dependencies;
12985 : }
12986 :
12987 0 : static int py_svcctl_CreateServiceW_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
12988 : {
12989 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
12990 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dependencies));
12991 0 : if (value == NULL) {
12992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
12993 0 : return -1;
12994 : }
12995 0 : if (value == Py_None) {
12996 0 : object->in.dependencies = NULL;
12997 : } else {
12998 0 : object->in.dependencies = NULL;
12999 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
13000 : {
13001 0 : int dependencies_cntr_1;
13002 0 : object->in.dependencies = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dependencies, PyList_GET_SIZE(value));
13003 0 : if (!object->in.dependencies) { return -1; }
13004 0 : talloc_set_name_const(object->in.dependencies, "ARRAY: object->in.dependencies");
13005 0 : for (dependencies_cntr_1 = 0; dependencies_cntr_1 < PyList_GET_SIZE(value); dependencies_cntr_1++) {
13006 0 : if (PyList_GET_ITEM(value, dependencies_cntr_1) == NULL) {
13007 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies[dependencies_cntr_1]");
13008 0 : return -1;
13009 : }
13010 : {
13011 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dependencies[dependencies_cntr_1]));
13012 0 : if (PyLong_Check(PyList_GET_ITEM(value, dependencies_cntr_1))) {
13013 0 : unsigned long long test_var;
13014 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, dependencies_cntr_1));
13015 0 : if (PyErr_Occurred() != NULL) {
13016 0 : return -1;
13017 : }
13018 0 : if (test_var > uint_max) {
13019 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13020 : PyLong_Type.tp_name, uint_max, test_var);
13021 0 : return -1;
13022 : }
13023 0 : object->in.dependencies[dependencies_cntr_1] = test_var;
13024 : } else {
13025 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13026 : PyLong_Type.tp_name);
13027 0 : return -1;
13028 : }
13029 : }
13030 : }
13031 : }
13032 : }
13033 0 : return 0;
13034 : }
13035 :
13036 0 : static PyObject *py_svcctl_CreateServiceW_in_get_dependencies_size(PyObject *obj, void *closure)
13037 : {
13038 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
13039 0 : PyObject *py_dependencies_size;
13040 0 : py_dependencies_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.dependencies_size);
13041 0 : return py_dependencies_size;
13042 : }
13043 :
13044 0 : static int py_svcctl_CreateServiceW_in_set_dependencies_size(PyObject *py_obj, PyObject *value, void *closure)
13045 : {
13046 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13047 0 : if (value == NULL) {
13048 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies_size");
13049 0 : return -1;
13050 : }
13051 : {
13052 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dependencies_size));
13053 0 : if (PyLong_Check(value)) {
13054 0 : unsigned long long test_var;
13055 0 : test_var = PyLong_AsUnsignedLongLong(value);
13056 0 : if (PyErr_Occurred() != NULL) {
13057 0 : return -1;
13058 : }
13059 0 : if (test_var > uint_max) {
13060 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13061 : PyLong_Type.tp_name, uint_max, test_var);
13062 0 : return -1;
13063 : }
13064 0 : object->in.dependencies_size = test_var;
13065 : } else {
13066 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13067 : PyLong_Type.tp_name);
13068 0 : return -1;
13069 : }
13070 : }
13071 0 : return 0;
13072 : }
13073 :
13074 0 : static PyObject *py_svcctl_CreateServiceW_in_get_service_start_name(PyObject *obj, void *closure)
13075 : {
13076 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
13077 0 : PyObject *py_service_start_name;
13078 0 : if (object->in.service_start_name == NULL) {
13079 0 : Py_RETURN_NONE;
13080 : }
13081 0 : if (object->in.service_start_name == NULL) {
13082 0 : py_service_start_name = Py_None;
13083 0 : Py_INCREF(py_service_start_name);
13084 : } else {
13085 0 : if (object->in.service_start_name == NULL) {
13086 0 : py_service_start_name = Py_None;
13087 0 : Py_INCREF(py_service_start_name);
13088 : } else {
13089 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
13090 : }
13091 : }
13092 0 : return py_service_start_name;
13093 : }
13094 :
13095 0 : static int py_svcctl_CreateServiceW_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
13096 : {
13097 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13098 0 : if (value == NULL) {
13099 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
13100 0 : return -1;
13101 : }
13102 0 : if (value == Py_None) {
13103 0 : object->in.service_start_name = NULL;
13104 : } else {
13105 0 : object->in.service_start_name = NULL;
13106 : {
13107 0 : const char *test_str;
13108 0 : const char *talloc_str;
13109 0 : PyObject *unicode = NULL;
13110 0 : if (PyUnicode_Check(value)) {
13111 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13112 0 : if (unicode == NULL) {
13113 0 : return -1;
13114 : }
13115 0 : test_str = PyBytes_AS_STRING(unicode);
13116 0 : } else if (PyBytes_Check(value)) {
13117 0 : test_str = PyBytes_AS_STRING(value);
13118 : } else {
13119 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13120 0 : return -1;
13121 : }
13122 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13123 0 : if (unicode != NULL) {
13124 0 : Py_DECREF(unicode);
13125 : }
13126 0 : if (talloc_str == NULL) {
13127 0 : PyErr_NoMemory();
13128 0 : return -1;
13129 : }
13130 0 : object->in.service_start_name = talloc_str;
13131 : }
13132 : }
13133 0 : return 0;
13134 : }
13135 :
13136 0 : static PyObject *py_svcctl_CreateServiceW_in_get_password(PyObject *obj, void *closure)
13137 : {
13138 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
13139 0 : PyObject *py_password;
13140 0 : if (object->in.password == NULL) {
13141 0 : Py_RETURN_NONE;
13142 : }
13143 0 : if (object->in.password == NULL) {
13144 0 : py_password = Py_None;
13145 0 : Py_INCREF(py_password);
13146 : } else {
13147 0 : py_password = PyList_New(object->in.password_size);
13148 0 : if (py_password == NULL) {
13149 0 : return NULL;
13150 : }
13151 : {
13152 : int password_cntr_1;
13153 0 : for (password_cntr_1 = 0; password_cntr_1 < (object->in.password_size); password_cntr_1++) {
13154 0 : PyObject *py_password_1;
13155 0 : py_password_1 = PyLong_FromLong((uint16_t)object->in.password[password_cntr_1]);
13156 0 : PyList_SetItem(py_password, password_cntr_1, py_password_1);
13157 : }
13158 : }
13159 : }
13160 0 : return py_password;
13161 : }
13162 :
13163 0 : static int py_svcctl_CreateServiceW_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
13164 : {
13165 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13166 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.password));
13167 0 : if (value == NULL) {
13168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
13169 0 : return -1;
13170 : }
13171 0 : if (value == Py_None) {
13172 0 : object->in.password = NULL;
13173 : } else {
13174 0 : object->in.password = NULL;
13175 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
13176 : {
13177 0 : int password_cntr_1;
13178 0 : object->in.password = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.password, PyList_GET_SIZE(value));
13179 0 : if (!object->in.password) { return -1; }
13180 0 : talloc_set_name_const(object->in.password, "ARRAY: object->in.password");
13181 0 : for (password_cntr_1 = 0; password_cntr_1 < PyList_GET_SIZE(value); password_cntr_1++) {
13182 0 : if (PyList_GET_ITEM(value, password_cntr_1) == NULL) {
13183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password[password_cntr_1]");
13184 0 : return -1;
13185 : }
13186 : {
13187 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.password[password_cntr_1]));
13188 0 : if (PyLong_Check(PyList_GET_ITEM(value, password_cntr_1))) {
13189 0 : unsigned long long test_var;
13190 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, password_cntr_1));
13191 0 : if (PyErr_Occurred() != NULL) {
13192 0 : return -1;
13193 : }
13194 0 : if (test_var > uint_max) {
13195 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13196 : PyLong_Type.tp_name, uint_max, test_var);
13197 0 : return -1;
13198 : }
13199 0 : object->in.password[password_cntr_1] = test_var;
13200 : } else {
13201 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13202 : PyLong_Type.tp_name);
13203 0 : return -1;
13204 : }
13205 : }
13206 : }
13207 : }
13208 : }
13209 0 : return 0;
13210 : }
13211 :
13212 0 : static PyObject *py_svcctl_CreateServiceW_in_get_password_size(PyObject *obj, void *closure)
13213 : {
13214 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
13215 0 : PyObject *py_password_size;
13216 0 : py_password_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.password_size);
13217 0 : return py_password_size;
13218 : }
13219 :
13220 0 : static int py_svcctl_CreateServiceW_in_set_password_size(PyObject *py_obj, PyObject *value, void *closure)
13221 : {
13222 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13223 0 : if (value == NULL) {
13224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password_size");
13225 0 : return -1;
13226 : }
13227 : {
13228 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.password_size));
13229 0 : if (PyLong_Check(value)) {
13230 0 : unsigned long long test_var;
13231 0 : test_var = PyLong_AsUnsignedLongLong(value);
13232 0 : if (PyErr_Occurred() != NULL) {
13233 0 : return -1;
13234 : }
13235 0 : if (test_var > uint_max) {
13236 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13237 : PyLong_Type.tp_name, uint_max, test_var);
13238 0 : return -1;
13239 : }
13240 0 : object->in.password_size = test_var;
13241 : } else {
13242 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13243 : PyLong_Type.tp_name);
13244 0 : return -1;
13245 : }
13246 : }
13247 0 : return 0;
13248 : }
13249 :
13250 0 : static PyObject *py_svcctl_CreateServiceW_out_get_handle(PyObject *obj, void *closure)
13251 : {
13252 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
13253 0 : PyObject *py_handle;
13254 0 : if (object->out.handle == NULL) {
13255 0 : Py_RETURN_NONE;
13256 : }
13257 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
13258 0 : return py_handle;
13259 : }
13260 :
13261 0 : static int py_svcctl_CreateServiceW_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13262 : {
13263 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13264 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
13265 0 : if (value == NULL) {
13266 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
13267 0 : return -1;
13268 : }
13269 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
13270 0 : if (object->out.handle == NULL) {
13271 0 : PyErr_NoMemory();
13272 0 : return -1;
13273 : }
13274 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13275 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13276 0 : PyErr_NoMemory();
13277 0 : return -1;
13278 : }
13279 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13280 0 : return 0;
13281 : }
13282 :
13283 0 : static PyObject *py_svcctl_CreateServiceW_get_result(PyObject *obj, void *closure)
13284 : {
13285 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
13286 0 : PyObject *py_result;
13287 0 : py_result = PyErr_FromWERROR(object->out.result);
13288 0 : return py_result;
13289 : }
13290 :
13291 0 : static int py_svcctl_CreateServiceW_set_result(PyObject *py_obj, PyObject *value, void *closure)
13292 : {
13293 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13294 0 : if (value == NULL) {
13295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13296 0 : return -1;
13297 : }
13298 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
13299 0 : return 0;
13300 : }
13301 :
13302 : static PyGetSetDef py_svcctl_CreateServiceW_getsetters[] = {
13303 : {
13304 : .name = discard_const_p(char, "in_scmanager_handle"),
13305 : .get = py_svcctl_CreateServiceW_in_get_scmanager_handle,
13306 : .set = py_svcctl_CreateServiceW_in_set_scmanager_handle,
13307 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13308 : },
13309 : {
13310 : .name = discard_const_p(char, "in_ServiceName"),
13311 : .get = py_svcctl_CreateServiceW_in_get_ServiceName,
13312 : .set = py_svcctl_CreateServiceW_in_set_ServiceName,
13313 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13314 : },
13315 : {
13316 : .name = discard_const_p(char, "in_DisplayName"),
13317 : .get = py_svcctl_CreateServiceW_in_get_DisplayName,
13318 : .set = py_svcctl_CreateServiceW_in_set_DisplayName,
13319 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13320 : },
13321 : {
13322 : .name = discard_const_p(char, "in_desired_access"),
13323 : .get = py_svcctl_CreateServiceW_in_get_desired_access,
13324 : .set = py_svcctl_CreateServiceW_in_set_desired_access,
13325 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13326 : },
13327 : {
13328 : .name = discard_const_p(char, "in_type"),
13329 : .get = py_svcctl_CreateServiceW_in_get_type,
13330 : .set = py_svcctl_CreateServiceW_in_set_type,
13331 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13332 : },
13333 : {
13334 : .name = discard_const_p(char, "in_start_type"),
13335 : .get = py_svcctl_CreateServiceW_in_get_start_type,
13336 : .set = py_svcctl_CreateServiceW_in_set_start_type,
13337 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
13338 : },
13339 : {
13340 : .name = discard_const_p(char, "in_error_control"),
13341 : .get = py_svcctl_CreateServiceW_in_get_error_control,
13342 : .set = py_svcctl_CreateServiceW_in_set_error_control,
13343 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
13344 : },
13345 : {
13346 : .name = discard_const_p(char, "in_binary_path"),
13347 : .get = py_svcctl_CreateServiceW_in_get_binary_path,
13348 : .set = py_svcctl_CreateServiceW_in_set_binary_path,
13349 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13350 : },
13351 : {
13352 : .name = discard_const_p(char, "in_LoadOrderGroupKey"),
13353 : .get = py_svcctl_CreateServiceW_in_get_LoadOrderGroupKey,
13354 : .set = py_svcctl_CreateServiceW_in_set_LoadOrderGroupKey,
13355 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13356 : },
13357 : {
13358 : .name = discard_const_p(char, "in_TagId"),
13359 : .get = py_svcctl_CreateServiceW_in_get_TagId,
13360 : .set = py_svcctl_CreateServiceW_in_set_TagId,
13361 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13362 : },
13363 : {
13364 : .name = discard_const_p(char, "out_TagId"),
13365 : .get = py_svcctl_CreateServiceW_out_get_TagId,
13366 : .set = py_svcctl_CreateServiceW_out_set_TagId,
13367 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13368 : },
13369 : {
13370 : .name = discard_const_p(char, "in_dependencies"),
13371 : .get = py_svcctl_CreateServiceW_in_get_dependencies,
13372 : .set = py_svcctl_CreateServiceW_in_set_dependencies,
13373 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13374 : },
13375 : {
13376 : .name = discard_const_p(char, "in_dependencies_size"),
13377 : .get = py_svcctl_CreateServiceW_in_get_dependencies_size,
13378 : .set = py_svcctl_CreateServiceW_in_set_dependencies_size,
13379 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13380 : },
13381 : {
13382 : .name = discard_const_p(char, "in_service_start_name"),
13383 : .get = py_svcctl_CreateServiceW_in_get_service_start_name,
13384 : .set = py_svcctl_CreateServiceW_in_set_service_start_name,
13385 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13386 : },
13387 : {
13388 : .name = discard_const_p(char, "in_password"),
13389 : .get = py_svcctl_CreateServiceW_in_get_password,
13390 : .set = py_svcctl_CreateServiceW_in_set_password,
13391 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13392 : },
13393 : {
13394 : .name = discard_const_p(char, "in_password_size"),
13395 : .get = py_svcctl_CreateServiceW_in_get_password_size,
13396 : .set = py_svcctl_CreateServiceW_in_set_password_size,
13397 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13398 : },
13399 : {
13400 : .name = discard_const_p(char, "out_handle"),
13401 : .get = py_svcctl_CreateServiceW_out_get_handle,
13402 : .set = py_svcctl_CreateServiceW_out_set_handle,
13403 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13404 : },
13405 : {
13406 : .name = discard_const_p(char, "result"),
13407 : .get = py_svcctl_CreateServiceW_get_result,
13408 : .set = py_svcctl_CreateServiceW_set_result,
13409 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
13410 : },
13411 : { .name = NULL }
13412 : };
13413 :
13414 0 : static PyObject *py_svcctl_CreateServiceW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13415 : {
13416 0 : PyObject *self = pytalloc_new(struct svcctl_CreateServiceW, type);
13417 0 : struct svcctl_CreateServiceW *_self = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(self);
13418 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13419 0 : _self->in.scmanager_handle = talloc_zero(mem_ctx, struct policy_handle);
13420 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
13421 0 : return self;
13422 : }
13423 :
13424 0 : static PyObject *py_svcctl_CreateServiceW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13425 : {
13426 :
13427 :
13428 0 : return PyLong_FromLong(12);
13429 : }
13430 :
13431 0 : static PyObject *py_svcctl_CreateServiceW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
13432 : {
13433 0 : const struct ndr_interface_call *call = NULL;
13434 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13435 0 : PyObject *ret = NULL;
13436 0 : struct ndr_push *push = NULL;
13437 0 : DATA_BLOB blob;
13438 0 : enum ndr_err_code err;
13439 :
13440 0 : if (ndr_table_svcctl.num_calls < 13) {
13441 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceW_ndr_pack");
13442 0 : return NULL;
13443 : }
13444 0 : call = &ndr_table_svcctl.calls[12];
13445 :
13446 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13447 0 : if (push == NULL) {
13448 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13449 0 : return NULL;
13450 : }
13451 :
13452 0 : push->flags |= ndr_push_flags;
13453 :
13454 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13455 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13456 0 : TALLOC_FREE(push);
13457 0 : PyErr_SetNdrError(err);
13458 0 : return NULL;
13459 : }
13460 0 : blob = ndr_push_blob(push);
13461 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13462 0 : TALLOC_FREE(push);
13463 0 : return ret;
13464 : }
13465 :
13466 0 : static PyObject *py_svcctl_CreateServiceW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13467 : {
13468 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13469 0 : PyObject *bigendian_obj = NULL;
13470 0 : PyObject *ndr64_obj = NULL;
13471 0 : libndr_flags ndr_push_flags = 0;
13472 :
13473 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13474 : discard_const_p(char *, kwnames),
13475 : &bigendian_obj,
13476 : &ndr64_obj)) {
13477 0 : return NULL;
13478 : }
13479 :
13480 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13481 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13482 : }
13483 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13484 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13485 : }
13486 :
13487 0 : return py_svcctl_CreateServiceW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13488 : }
13489 :
13490 0 : static PyObject *py_svcctl_CreateServiceW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13491 : {
13492 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13493 0 : PyObject *bigendian_obj = NULL;
13494 0 : PyObject *ndr64_obj = NULL;
13495 0 : libndr_flags ndr_push_flags = 0;
13496 :
13497 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13498 : discard_const_p(char *, kwnames),
13499 : &bigendian_obj,
13500 : &ndr64_obj)) {
13501 0 : return NULL;
13502 : }
13503 :
13504 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13505 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13506 : }
13507 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13508 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13509 : }
13510 :
13511 0 : return py_svcctl_CreateServiceW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13512 : }
13513 :
13514 0 : static PyObject *py_svcctl_CreateServiceW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
13515 : {
13516 0 : const struct ndr_interface_call *call = NULL;
13517 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13518 0 : struct ndr_pull *pull = NULL;
13519 0 : enum ndr_err_code err;
13520 :
13521 0 : if (ndr_table_svcctl.num_calls < 13) {
13522 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceW_ndr_unpack");
13523 0 : return NULL;
13524 : }
13525 0 : call = &ndr_table_svcctl.calls[12];
13526 :
13527 0 : pull = ndr_pull_init_blob(blob, object);
13528 0 : if (pull == NULL) {
13529 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13530 0 : return NULL;
13531 : }
13532 :
13533 0 : pull->flags |= ndr_pull_flags;
13534 :
13535 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13536 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13537 0 : TALLOC_FREE(pull);
13538 0 : PyErr_SetNdrError(err);
13539 0 : return NULL;
13540 : }
13541 0 : if (!allow_remaining) {
13542 0 : uint32_t highest_ofs;
13543 :
13544 0 : if (pull->offset > pull->relative_highest_offset) {
13545 0 : highest_ofs = pull->offset;
13546 : } else {
13547 0 : highest_ofs = pull->relative_highest_offset;
13548 : }
13549 0 : if (highest_ofs < pull->data_size) {
13550 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13551 : "not all bytes consumed ofs[%u] size[%u]",
13552 : highest_ofs, pull->data_size);
13553 0 : TALLOC_FREE(pull);
13554 0 : PyErr_SetNdrError(err);
13555 0 : return NULL;
13556 : }
13557 : }
13558 :
13559 0 : TALLOC_FREE(pull);
13560 0 : Py_RETURN_NONE;
13561 : }
13562 :
13563 0 : static PyObject *py_svcctl_CreateServiceW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13564 : {
13565 0 : DATA_BLOB blob;
13566 0 : Py_ssize_t blob_length = 0;
13567 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13568 0 : PyObject *bigendian_obj = NULL;
13569 0 : PyObject *ndr64_obj = NULL;
13570 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13571 0 : PyObject *allow_remaining_obj = NULL;
13572 0 : bool allow_remaining = false;
13573 :
13574 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13575 : discard_const_p(char *, kwnames),
13576 : &blob.data, &blob_length,
13577 : &bigendian_obj,
13578 : &ndr64_obj,
13579 : &allow_remaining_obj)) {
13580 0 : return NULL;
13581 : }
13582 0 : blob.length = blob_length;
13583 :
13584 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13585 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13586 : }
13587 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13588 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13589 : }
13590 :
13591 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13592 0 : allow_remaining = true;
13593 : }
13594 :
13595 0 : return py_svcctl_CreateServiceW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13596 : }
13597 :
13598 0 : static PyObject *py_svcctl_CreateServiceW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13599 : {
13600 0 : DATA_BLOB blob;
13601 0 : Py_ssize_t blob_length = 0;
13602 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13603 0 : PyObject *bigendian_obj = NULL;
13604 0 : PyObject *ndr64_obj = NULL;
13605 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13606 0 : PyObject *allow_remaining_obj = NULL;
13607 0 : bool allow_remaining = false;
13608 :
13609 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13610 : discard_const_p(char *, kwnames),
13611 : &blob.data, &blob_length,
13612 : &bigendian_obj,
13613 : &ndr64_obj,
13614 : &allow_remaining_obj)) {
13615 0 : return NULL;
13616 : }
13617 0 : blob.length = blob_length;
13618 :
13619 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13620 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13621 : }
13622 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13623 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13624 : }
13625 :
13626 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13627 0 : allow_remaining = true;
13628 : }
13629 :
13630 0 : return py_svcctl_CreateServiceW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13631 : }
13632 :
13633 0 : static PyObject *py_svcctl_CreateServiceW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
13634 : {
13635 0 : const struct ndr_interface_call *call = NULL;
13636 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
13637 0 : PyObject *ret;
13638 0 : char *retstr;
13639 :
13640 0 : if (ndr_table_svcctl.num_calls < 13) {
13641 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceW_ndr_print");
13642 0 : return NULL;
13643 : }
13644 0 : call = &ndr_table_svcctl.calls[12];
13645 :
13646 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13647 0 : ret = PyUnicode_FromString(retstr);
13648 0 : TALLOC_FREE(retstr);
13649 :
13650 0 : return ret;
13651 : }
13652 :
13653 0 : static PyObject *py_svcctl_CreateServiceW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13654 : {
13655 0 : return py_svcctl_CreateServiceW_ndr_print(py_obj, "svcctl_CreateServiceW_in", NDR_IN);
13656 : }
13657 :
13658 0 : static PyObject *py_svcctl_CreateServiceW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13659 : {
13660 0 : return py_svcctl_CreateServiceW_ndr_print(py_obj, "svcctl_CreateServiceW_out", NDR_OUT);
13661 : }
13662 :
13663 : static PyMethodDef py_svcctl_CreateServiceW_methods[] = {
13664 : { "opnum", (PyCFunction)py_svcctl_CreateServiceW_ndr_opnum, METH_NOARGS|METH_CLASS,
13665 : "svcctl.CreateServiceW.opnum() -> 12 (0x0c) " },
13666 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13667 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13668 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13669 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13670 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13671 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13672 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13673 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13674 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CreateServiceW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13675 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CreateServiceW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13676 : { NULL, NULL, 0, NULL }
13677 : };
13678 :
13679 :
13680 : static PyTypeObject svcctl_CreateServiceW_Type = {
13681 : PyVarObject_HEAD_INIT(NULL, 0)
13682 : .tp_name = "svcctl.CreateServiceW",
13683 : .tp_getset = py_svcctl_CreateServiceW_getsetters,
13684 : .tp_methods = py_svcctl_CreateServiceW_methods,
13685 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13686 : .tp_new = py_svcctl_CreateServiceW_new,
13687 : };
13688 :
13689 0 : static bool pack_py_svcctl_CreateServiceW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CreateServiceW *r)
13690 : {
13691 0 : PyObject *py_scmanager_handle;
13692 0 : PyObject *py_ServiceName;
13693 0 : PyObject *py_DisplayName;
13694 0 : PyObject *py_desired_access;
13695 0 : PyObject *py_type;
13696 0 : PyObject *py_start_type;
13697 0 : PyObject *py_error_control;
13698 0 : PyObject *py_binary_path;
13699 0 : PyObject *py_LoadOrderGroupKey;
13700 0 : PyObject *py_TagId;
13701 0 : PyObject *py_dependencies;
13702 0 : PyObject *py_service_start_name;
13703 0 : PyObject *py_password;
13704 0 : const char *kwnames[] = {
13705 : "scmanager_handle", "ServiceName", "DisplayName", "desired_access", "type", "start_type", "error_control", "binary_path", "LoadOrderGroupKey", "TagId", "dependencies", "service_start_name", "password", NULL
13706 : };
13707 :
13708 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOOOO:svcctl_CreateServiceW", discard_const_p(char *, kwnames), &py_scmanager_handle, &py_ServiceName, &py_DisplayName, &py_desired_access, &py_type, &py_start_type, &py_error_control, &py_binary_path, &py_LoadOrderGroupKey, &py_TagId, &py_dependencies, &py_service_start_name, &py_password)) {
13709 0 : return false;
13710 : }
13711 :
13712 0 : if (py_scmanager_handle == NULL) {
13713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager_handle");
13714 0 : return false;
13715 : }
13716 0 : r->in.scmanager_handle = talloc_ptrtype(r, r->in.scmanager_handle);
13717 0 : if (r->in.scmanager_handle == NULL) {
13718 0 : PyErr_NoMemory();
13719 0 : return false;
13720 : }
13721 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager_handle, return false;);
13722 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager_handle)) == NULL) {
13723 0 : PyErr_NoMemory();
13724 0 : return false;
13725 : }
13726 0 : r->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(py_scmanager_handle);
13727 0 : if (py_ServiceName == NULL) {
13728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
13729 0 : return false;
13730 : }
13731 : {
13732 0 : const char *test_str;
13733 0 : const char *talloc_str;
13734 0 : PyObject *unicode = NULL;
13735 0 : if (PyUnicode_Check(py_ServiceName)) {
13736 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
13737 0 : if (unicode == NULL) {
13738 0 : return false;
13739 : }
13740 0 : test_str = PyBytes_AS_STRING(unicode);
13741 0 : } else if (PyBytes_Check(py_ServiceName)) {
13742 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
13743 : } else {
13744 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
13745 0 : return false;
13746 : }
13747 0 : talloc_str = talloc_strdup(r, test_str);
13748 0 : if (unicode != NULL) {
13749 0 : Py_DECREF(unicode);
13750 : }
13751 0 : if (talloc_str == NULL) {
13752 0 : PyErr_NoMemory();
13753 0 : return false;
13754 : }
13755 0 : r->in.ServiceName = talloc_str;
13756 : }
13757 0 : if (py_DisplayName == NULL) {
13758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DisplayName");
13759 0 : return false;
13760 : }
13761 0 : if (py_DisplayName == Py_None) {
13762 0 : r->in.DisplayName = NULL;
13763 : } else {
13764 0 : r->in.DisplayName = NULL;
13765 : {
13766 0 : const char *test_str;
13767 0 : const char *talloc_str;
13768 0 : PyObject *unicode = NULL;
13769 0 : if (PyUnicode_Check(py_DisplayName)) {
13770 0 : unicode = PyUnicode_AsEncodedString(py_DisplayName, "utf-8", "ignore");
13771 0 : if (unicode == NULL) {
13772 0 : return false;
13773 : }
13774 0 : test_str = PyBytes_AS_STRING(unicode);
13775 0 : } else if (PyBytes_Check(py_DisplayName)) {
13776 0 : test_str = PyBytes_AS_STRING(py_DisplayName);
13777 : } else {
13778 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DisplayName)->tp_name);
13779 0 : return false;
13780 : }
13781 0 : talloc_str = talloc_strdup(r, test_str);
13782 0 : if (unicode != NULL) {
13783 0 : Py_DECREF(unicode);
13784 : }
13785 0 : if (talloc_str == NULL) {
13786 0 : PyErr_NoMemory();
13787 0 : return false;
13788 : }
13789 0 : r->in.DisplayName = talloc_str;
13790 : }
13791 : }
13792 0 : if (py_desired_access == NULL) {
13793 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.desired_access");
13794 0 : return false;
13795 : }
13796 : {
13797 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.desired_access));
13798 0 : if (PyLong_Check(py_desired_access)) {
13799 0 : unsigned long long test_var;
13800 0 : test_var = PyLong_AsUnsignedLongLong(py_desired_access);
13801 0 : if (PyErr_Occurred() != NULL) {
13802 0 : return false;
13803 : }
13804 0 : if (test_var > uint_max) {
13805 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13806 : PyLong_Type.tp_name, uint_max, test_var);
13807 0 : return false;
13808 : }
13809 0 : r->in.desired_access = test_var;
13810 : } else {
13811 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13812 : PyLong_Type.tp_name);
13813 0 : return false;
13814 : }
13815 : }
13816 0 : if (py_type == NULL) {
13817 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
13818 0 : return false;
13819 : }
13820 : {
13821 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
13822 0 : if (PyLong_Check(py_type)) {
13823 0 : unsigned long long test_var;
13824 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
13825 0 : if (PyErr_Occurred() != NULL) {
13826 0 : return false;
13827 : }
13828 0 : if (test_var > uint_max) {
13829 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13830 : PyLong_Type.tp_name, uint_max, test_var);
13831 0 : return false;
13832 : }
13833 0 : r->in.type = test_var;
13834 : } else {
13835 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13836 : PyLong_Type.tp_name);
13837 0 : return false;
13838 : }
13839 : }
13840 0 : if (py_start_type == NULL) {
13841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
13842 0 : return false;
13843 : }
13844 : {
13845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
13846 0 : if (PyLong_Check(py_start_type)) {
13847 0 : unsigned long long test_var;
13848 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
13849 0 : if (PyErr_Occurred() != NULL) {
13850 0 : return false;
13851 : }
13852 0 : if (test_var > uint_max) {
13853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13854 : PyLong_Type.tp_name, uint_max, test_var);
13855 0 : return false;
13856 : }
13857 0 : r->in.start_type = test_var;
13858 : } else {
13859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13860 : PyLong_Type.tp_name);
13861 0 : return false;
13862 : }
13863 : }
13864 0 : if (py_error_control == NULL) {
13865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
13866 0 : return false;
13867 : }
13868 : {
13869 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
13870 0 : if (PyLong_Check(py_error_control)) {
13871 0 : unsigned long long test_var;
13872 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
13873 0 : if (PyErr_Occurred() != NULL) {
13874 0 : return false;
13875 : }
13876 0 : if (test_var > uint_max) {
13877 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13878 : PyLong_Type.tp_name, uint_max, test_var);
13879 0 : return false;
13880 : }
13881 0 : r->in.error_control = test_var;
13882 : } else {
13883 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13884 : PyLong_Type.tp_name);
13885 0 : return false;
13886 : }
13887 : }
13888 0 : if (py_binary_path == NULL) {
13889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
13890 0 : return false;
13891 : }
13892 : {
13893 0 : const char *test_str;
13894 0 : const char *talloc_str;
13895 0 : PyObject *unicode = NULL;
13896 0 : if (PyUnicode_Check(py_binary_path)) {
13897 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
13898 0 : if (unicode == NULL) {
13899 0 : return false;
13900 : }
13901 0 : test_str = PyBytes_AS_STRING(unicode);
13902 0 : } else if (PyBytes_Check(py_binary_path)) {
13903 0 : test_str = PyBytes_AS_STRING(py_binary_path);
13904 : } else {
13905 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
13906 0 : return false;
13907 : }
13908 0 : talloc_str = talloc_strdup(r, test_str);
13909 0 : if (unicode != NULL) {
13910 0 : Py_DECREF(unicode);
13911 : }
13912 0 : if (talloc_str == NULL) {
13913 0 : PyErr_NoMemory();
13914 0 : return false;
13915 : }
13916 0 : r->in.binary_path = talloc_str;
13917 : }
13918 0 : if (py_LoadOrderGroupKey == NULL) {
13919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.LoadOrderGroupKey");
13920 0 : return false;
13921 : }
13922 0 : if (py_LoadOrderGroupKey == Py_None) {
13923 0 : r->in.LoadOrderGroupKey = NULL;
13924 : } else {
13925 0 : r->in.LoadOrderGroupKey = NULL;
13926 : {
13927 0 : const char *test_str;
13928 0 : const char *talloc_str;
13929 0 : PyObject *unicode = NULL;
13930 0 : if (PyUnicode_Check(py_LoadOrderGroupKey)) {
13931 0 : unicode = PyUnicode_AsEncodedString(py_LoadOrderGroupKey, "utf-8", "ignore");
13932 0 : if (unicode == NULL) {
13933 0 : return false;
13934 : }
13935 0 : test_str = PyBytes_AS_STRING(unicode);
13936 0 : } else if (PyBytes_Check(py_LoadOrderGroupKey)) {
13937 0 : test_str = PyBytes_AS_STRING(py_LoadOrderGroupKey);
13938 : } else {
13939 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_LoadOrderGroupKey)->tp_name);
13940 0 : return false;
13941 : }
13942 0 : talloc_str = talloc_strdup(r, test_str);
13943 0 : if (unicode != NULL) {
13944 0 : Py_DECREF(unicode);
13945 : }
13946 0 : if (talloc_str == NULL) {
13947 0 : PyErr_NoMemory();
13948 0 : return false;
13949 : }
13950 0 : r->in.LoadOrderGroupKey = talloc_str;
13951 : }
13952 : }
13953 0 : if (py_TagId == NULL) {
13954 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.TagId");
13955 0 : return false;
13956 : }
13957 0 : if (py_TagId == Py_None) {
13958 0 : r->in.TagId = NULL;
13959 : } else {
13960 0 : r->in.TagId = talloc_ptrtype(r, r->in.TagId);
13961 0 : if (r->in.TagId == NULL) {
13962 0 : PyErr_NoMemory();
13963 0 : return false;
13964 : }
13965 : {
13966 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.TagId));
13967 0 : if (PyLong_Check(py_TagId)) {
13968 0 : unsigned long long test_var;
13969 0 : test_var = PyLong_AsUnsignedLongLong(py_TagId);
13970 0 : if (PyErr_Occurred() != NULL) {
13971 0 : return false;
13972 : }
13973 0 : if (test_var > uint_max) {
13974 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13975 : PyLong_Type.tp_name, uint_max, test_var);
13976 0 : return false;
13977 : }
13978 0 : *r->in.TagId = test_var;
13979 : } else {
13980 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13981 : PyLong_Type.tp_name);
13982 0 : return false;
13983 : }
13984 : }
13985 : }
13986 0 : if (py_dependencies == NULL) {
13987 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
13988 0 : return false;
13989 : }
13990 0 : if (py_dependencies == Py_None) {
13991 0 : r->in.dependencies = NULL;
13992 : } else {
13993 0 : r->in.dependencies = NULL;
13994 0 : PY_CHECK_TYPE(&PyList_Type, py_dependencies, return false;);
13995 : {
13996 0 : int dependencies_cntr_1;
13997 0 : r->in.dependencies = talloc_array_ptrtype(r, r->in.dependencies, PyList_GET_SIZE(py_dependencies));
13998 0 : if (!r->in.dependencies) { return false; }
13999 0 : talloc_set_name_const(r->in.dependencies, "ARRAY: r->in.dependencies");
14000 0 : for (dependencies_cntr_1 = 0; dependencies_cntr_1 < PyList_GET_SIZE(py_dependencies); dependencies_cntr_1++) {
14001 0 : if (PyList_GET_ITEM(py_dependencies, dependencies_cntr_1) == NULL) {
14002 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies[dependencies_cntr_1]");
14003 0 : return false;
14004 : }
14005 : {
14006 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dependencies[dependencies_cntr_1]));
14007 0 : if (PyLong_Check(PyList_GET_ITEM(py_dependencies, dependencies_cntr_1))) {
14008 0 : unsigned long long test_var;
14009 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_dependencies, dependencies_cntr_1));
14010 0 : if (PyErr_Occurred() != NULL) {
14011 0 : return false;
14012 : }
14013 0 : if (test_var > uint_max) {
14014 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14015 : PyLong_Type.tp_name, uint_max, test_var);
14016 0 : return false;
14017 : }
14018 0 : r->in.dependencies[dependencies_cntr_1] = test_var;
14019 : } else {
14020 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14021 : PyLong_Type.tp_name);
14022 0 : return false;
14023 : }
14024 : }
14025 : }
14026 : }
14027 : }
14028 0 : PY_CHECK_TYPE(&PyList_Type, py_dependencies, return false;);
14029 0 : r->in.dependencies_size = PyList_GET_SIZE(py_dependencies);
14030 0 : if (py_service_start_name == NULL) {
14031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
14032 0 : return false;
14033 : }
14034 0 : if (py_service_start_name == Py_None) {
14035 0 : r->in.service_start_name = NULL;
14036 : } else {
14037 0 : r->in.service_start_name = NULL;
14038 : {
14039 0 : const char *test_str;
14040 0 : const char *talloc_str;
14041 0 : PyObject *unicode = NULL;
14042 0 : if (PyUnicode_Check(py_service_start_name)) {
14043 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
14044 0 : if (unicode == NULL) {
14045 0 : return false;
14046 : }
14047 0 : test_str = PyBytes_AS_STRING(unicode);
14048 0 : } else if (PyBytes_Check(py_service_start_name)) {
14049 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
14050 : } else {
14051 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
14052 0 : return false;
14053 : }
14054 0 : talloc_str = talloc_strdup(r, test_str);
14055 0 : if (unicode != NULL) {
14056 0 : Py_DECREF(unicode);
14057 : }
14058 0 : if (talloc_str == NULL) {
14059 0 : PyErr_NoMemory();
14060 0 : return false;
14061 : }
14062 0 : r->in.service_start_name = talloc_str;
14063 : }
14064 : }
14065 0 : if (py_password == NULL) {
14066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
14067 0 : return false;
14068 : }
14069 0 : if (py_password == Py_None) {
14070 0 : r->in.password = NULL;
14071 : } else {
14072 0 : r->in.password = NULL;
14073 0 : PY_CHECK_TYPE(&PyList_Type, py_password, return false;);
14074 : {
14075 0 : int password_cntr_1;
14076 0 : r->in.password = talloc_array_ptrtype(r, r->in.password, PyList_GET_SIZE(py_password));
14077 0 : if (!r->in.password) { return false; }
14078 0 : talloc_set_name_const(r->in.password, "ARRAY: r->in.password");
14079 0 : for (password_cntr_1 = 0; password_cntr_1 < PyList_GET_SIZE(py_password); password_cntr_1++) {
14080 0 : if (PyList_GET_ITEM(py_password, password_cntr_1) == NULL) {
14081 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password[password_cntr_1]");
14082 0 : return false;
14083 : }
14084 : {
14085 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.password[password_cntr_1]));
14086 0 : if (PyLong_Check(PyList_GET_ITEM(py_password, password_cntr_1))) {
14087 0 : unsigned long long test_var;
14088 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_password, password_cntr_1));
14089 0 : if (PyErr_Occurred() != NULL) {
14090 0 : return false;
14091 : }
14092 0 : if (test_var > uint_max) {
14093 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14094 : PyLong_Type.tp_name, uint_max, test_var);
14095 0 : return false;
14096 : }
14097 0 : r->in.password[password_cntr_1] = test_var;
14098 : } else {
14099 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14100 : PyLong_Type.tp_name);
14101 0 : return false;
14102 : }
14103 : }
14104 : }
14105 : }
14106 : }
14107 0 : PY_CHECK_TYPE(&PyList_Type, py_password, return false;);
14108 0 : r->in.password_size = PyList_GET_SIZE(py_password);
14109 0 : return true;
14110 : }
14111 :
14112 0 : static PyObject *unpack_py_svcctl_CreateServiceW_args_out(struct svcctl_CreateServiceW *r)
14113 : {
14114 0 : PyObject *result;
14115 0 : PyObject *py_TagId;
14116 0 : PyObject *py_handle;
14117 0 : result = PyTuple_New(2);
14118 0 : if (r->out.TagId == NULL) {
14119 0 : py_TagId = Py_None;
14120 0 : Py_INCREF(py_TagId);
14121 : } else {
14122 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*r->out.TagId);
14123 : }
14124 0 : PyTuple_SetItem(result, 0, py_TagId);
14125 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
14126 0 : PyTuple_SetItem(result, 1, py_handle);
14127 0 : if (!W_ERROR_IS_OK(r->out.result)) {
14128 0 : PyErr_SetWERROR(r->out.result);
14129 0 : return NULL;
14130 : }
14131 :
14132 0 : return result;
14133 : }
14134 :
14135 :
14136 0 : static PyObject *py_svcctl_EnumDependentServicesW_in_get_service(PyObject *obj, void *closure)
14137 : {
14138 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
14139 0 : PyObject *py_service;
14140 0 : if (object->in.service == NULL) {
14141 0 : Py_RETURN_NONE;
14142 : }
14143 0 : py_service = pytalloc_reference_ex(policy_handle_Type, object->in.service, object->in.service);
14144 0 : return py_service;
14145 : }
14146 :
14147 0 : static int py_svcctl_EnumDependentServicesW_in_set_service(PyObject *py_obj, PyObject *value, void *closure)
14148 : {
14149 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14150 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.service));
14151 0 : if (value == NULL) {
14152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service");
14153 0 : return -1;
14154 : }
14155 0 : object->in.service = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.service);
14156 0 : if (object->in.service == NULL) {
14157 0 : PyErr_NoMemory();
14158 0 : return -1;
14159 : }
14160 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14161 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14162 0 : PyErr_NoMemory();
14163 0 : return -1;
14164 : }
14165 0 : object->in.service = (struct policy_handle *)pytalloc_get_ptr(value);
14166 0 : return 0;
14167 : }
14168 :
14169 0 : static PyObject *py_svcctl_EnumDependentServicesW_in_get_state(PyObject *obj, void *closure)
14170 : {
14171 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
14172 0 : PyObject *py_state;
14173 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
14174 0 : return py_state;
14175 : }
14176 :
14177 0 : static int py_svcctl_EnumDependentServicesW_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
14178 : {
14179 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14180 0 : if (value == NULL) {
14181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
14182 0 : return -1;
14183 : }
14184 : {
14185 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
14186 0 : if (PyLong_Check(value)) {
14187 0 : unsigned long long test_var;
14188 0 : test_var = PyLong_AsUnsignedLongLong(value);
14189 0 : if (PyErr_Occurred() != NULL) {
14190 0 : return -1;
14191 : }
14192 0 : if (test_var > uint_max) {
14193 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14194 : PyLong_Type.tp_name, uint_max, test_var);
14195 0 : return -1;
14196 : }
14197 0 : object->in.state = test_var;
14198 : } else {
14199 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14200 : PyLong_Type.tp_name);
14201 0 : return -1;
14202 : }
14203 : }
14204 0 : return 0;
14205 : }
14206 :
14207 0 : static PyObject *py_svcctl_EnumDependentServicesW_out_get_service_status(PyObject *obj, void *closure)
14208 : {
14209 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
14210 0 : PyObject *py_service_status;
14211 0 : if (object->out.service_status == NULL) {
14212 0 : Py_RETURN_NONE;
14213 : }
14214 0 : py_service_status = PyList_New(object->in.offered);
14215 0 : if (py_service_status == NULL) {
14216 0 : return NULL;
14217 : }
14218 : {
14219 : int service_status_cntr_1;
14220 0 : for (service_status_cntr_1 = 0; service_status_cntr_1 < (object->in.offered); service_status_cntr_1++) {
14221 0 : PyObject *py_service_status_1;
14222 0 : py_service_status_1 = PyLong_FromLong((uint16_t)object->out.service_status[service_status_cntr_1]);
14223 0 : PyList_SetItem(py_service_status, service_status_cntr_1, py_service_status_1);
14224 : }
14225 : }
14226 0 : return py_service_status;
14227 : }
14228 :
14229 0 : static int py_svcctl_EnumDependentServicesW_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
14230 : {
14231 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14232 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
14233 0 : if (value == NULL) {
14234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
14235 0 : return -1;
14236 : }
14237 0 : object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
14238 0 : if (object->out.service_status == NULL) {
14239 0 : PyErr_NoMemory();
14240 0 : return -1;
14241 : }
14242 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
14243 : {
14244 0 : int service_status_cntr_1;
14245 0 : object->out.service_status = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status, PyList_GET_SIZE(value));
14246 0 : if (!object->out.service_status) { return -1; }
14247 0 : talloc_set_name_const(object->out.service_status, "ARRAY: object->out.service_status");
14248 0 : for (service_status_cntr_1 = 0; service_status_cntr_1 < PyList_GET_SIZE(value); service_status_cntr_1++) {
14249 0 : if (PyList_GET_ITEM(value, service_status_cntr_1) == NULL) {
14250 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status[service_status_cntr_1]");
14251 0 : return -1;
14252 : }
14253 : {
14254 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.service_status[service_status_cntr_1]));
14255 0 : if (PyLong_Check(PyList_GET_ITEM(value, service_status_cntr_1))) {
14256 0 : unsigned long long test_var;
14257 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, service_status_cntr_1));
14258 0 : if (PyErr_Occurred() != NULL) {
14259 0 : return -1;
14260 : }
14261 0 : if (test_var > uint_max) {
14262 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14263 : PyLong_Type.tp_name, uint_max, test_var);
14264 0 : return -1;
14265 : }
14266 0 : object->out.service_status[service_status_cntr_1] = test_var;
14267 : } else {
14268 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14269 : PyLong_Type.tp_name);
14270 0 : return -1;
14271 : }
14272 : }
14273 : }
14274 : }
14275 0 : return 0;
14276 : }
14277 :
14278 0 : static PyObject *py_svcctl_EnumDependentServicesW_in_get_offered(PyObject *obj, void *closure)
14279 : {
14280 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
14281 0 : PyObject *py_offered;
14282 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
14283 0 : return py_offered;
14284 : }
14285 :
14286 0 : static int py_svcctl_EnumDependentServicesW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
14287 : {
14288 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14289 0 : if (value == NULL) {
14290 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
14291 0 : return -1;
14292 : }
14293 : {
14294 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
14295 0 : if (PyLong_Check(value)) {
14296 0 : unsigned long long test_var;
14297 0 : test_var = PyLong_AsUnsignedLongLong(value);
14298 0 : if (PyErr_Occurred() != NULL) {
14299 0 : return -1;
14300 : }
14301 0 : if (test_var > uint_max) {
14302 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14303 : PyLong_Type.tp_name, uint_max, test_var);
14304 0 : return -1;
14305 : }
14306 0 : object->in.offered = test_var;
14307 : } else {
14308 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14309 : PyLong_Type.tp_name);
14310 0 : return -1;
14311 : }
14312 : }
14313 0 : return 0;
14314 : }
14315 :
14316 0 : static PyObject *py_svcctl_EnumDependentServicesW_out_get_needed(PyObject *obj, void *closure)
14317 : {
14318 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
14319 0 : PyObject *py_needed;
14320 0 : if (object->out.needed == NULL) {
14321 0 : Py_RETURN_NONE;
14322 : }
14323 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
14324 0 : return py_needed;
14325 : }
14326 :
14327 0 : static int py_svcctl_EnumDependentServicesW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
14328 : {
14329 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14330 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
14331 0 : if (value == NULL) {
14332 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
14333 0 : return -1;
14334 : }
14335 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
14336 0 : if (object->out.needed == NULL) {
14337 0 : PyErr_NoMemory();
14338 0 : return -1;
14339 : }
14340 : {
14341 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
14342 0 : if (PyLong_Check(value)) {
14343 0 : unsigned long long test_var;
14344 0 : test_var = PyLong_AsUnsignedLongLong(value);
14345 0 : if (PyErr_Occurred() != NULL) {
14346 0 : return -1;
14347 : }
14348 0 : if (test_var > uint_max) {
14349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14350 : PyLong_Type.tp_name, uint_max, test_var);
14351 0 : return -1;
14352 : }
14353 0 : *object->out.needed = test_var;
14354 : } else {
14355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14356 : PyLong_Type.tp_name);
14357 0 : return -1;
14358 : }
14359 : }
14360 0 : return 0;
14361 : }
14362 :
14363 0 : static PyObject *py_svcctl_EnumDependentServicesW_out_get_services_returned(PyObject *obj, void *closure)
14364 : {
14365 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
14366 0 : PyObject *py_services_returned;
14367 0 : if (object->out.services_returned == NULL) {
14368 0 : Py_RETURN_NONE;
14369 : }
14370 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
14371 0 : return py_services_returned;
14372 : }
14373 :
14374 0 : static int py_svcctl_EnumDependentServicesW_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
14375 : {
14376 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14377 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
14378 0 : if (value == NULL) {
14379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
14380 0 : return -1;
14381 : }
14382 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
14383 0 : if (object->out.services_returned == NULL) {
14384 0 : PyErr_NoMemory();
14385 0 : return -1;
14386 : }
14387 : {
14388 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
14389 0 : if (PyLong_Check(value)) {
14390 0 : unsigned long long test_var;
14391 0 : test_var = PyLong_AsUnsignedLongLong(value);
14392 0 : if (PyErr_Occurred() != NULL) {
14393 0 : return -1;
14394 : }
14395 0 : if (test_var > uint_max) {
14396 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14397 : PyLong_Type.tp_name, uint_max, test_var);
14398 0 : return -1;
14399 : }
14400 0 : *object->out.services_returned = test_var;
14401 : } else {
14402 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14403 : PyLong_Type.tp_name);
14404 0 : return -1;
14405 : }
14406 : }
14407 0 : return 0;
14408 : }
14409 :
14410 0 : static PyObject *py_svcctl_EnumDependentServicesW_get_result(PyObject *obj, void *closure)
14411 : {
14412 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
14413 0 : PyObject *py_result;
14414 0 : py_result = PyErr_FromWERROR(object->out.result);
14415 0 : return py_result;
14416 : }
14417 :
14418 0 : static int py_svcctl_EnumDependentServicesW_set_result(PyObject *py_obj, PyObject *value, void *closure)
14419 : {
14420 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14421 0 : if (value == NULL) {
14422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
14423 0 : return -1;
14424 : }
14425 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
14426 0 : return 0;
14427 : }
14428 :
14429 : static PyGetSetDef py_svcctl_EnumDependentServicesW_getsetters[] = {
14430 : {
14431 : .name = discard_const_p(char, "in_service"),
14432 : .get = py_svcctl_EnumDependentServicesW_in_get_service,
14433 : .set = py_svcctl_EnumDependentServicesW_in_set_service,
14434 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14435 : },
14436 : {
14437 : .name = discard_const_p(char, "in_state"),
14438 : .get = py_svcctl_EnumDependentServicesW_in_get_state,
14439 : .set = py_svcctl_EnumDependentServicesW_in_set_state,
14440 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
14441 : },
14442 : {
14443 : .name = discard_const_p(char, "out_service_status"),
14444 : .get = py_svcctl_EnumDependentServicesW_out_get_service_status,
14445 : .set = py_svcctl_EnumDependentServicesW_out_set_service_status,
14446 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14447 : },
14448 : {
14449 : .name = discard_const_p(char, "in_offered"),
14450 : .get = py_svcctl_EnumDependentServicesW_in_get_offered,
14451 : .set = py_svcctl_EnumDependentServicesW_in_set_offered,
14452 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14453 : },
14454 : {
14455 : .name = discard_const_p(char, "out_needed"),
14456 : .get = py_svcctl_EnumDependentServicesW_out_get_needed,
14457 : .set = py_svcctl_EnumDependentServicesW_out_set_needed,
14458 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14459 : },
14460 : {
14461 : .name = discard_const_p(char, "out_services_returned"),
14462 : .get = py_svcctl_EnumDependentServicesW_out_get_services_returned,
14463 : .set = py_svcctl_EnumDependentServicesW_out_set_services_returned,
14464 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14465 : },
14466 : {
14467 : .name = discard_const_p(char, "result"),
14468 : .get = py_svcctl_EnumDependentServicesW_get_result,
14469 : .set = py_svcctl_EnumDependentServicesW_set_result,
14470 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
14471 : },
14472 : { .name = NULL }
14473 : };
14474 :
14475 0 : static PyObject *py_svcctl_EnumDependentServicesW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14476 : {
14477 0 : PyObject *self = pytalloc_new(struct svcctl_EnumDependentServicesW, type);
14478 0 : struct svcctl_EnumDependentServicesW *_self = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(self);
14479 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14480 0 : _self->in.service = talloc_zero(mem_ctx, struct policy_handle);
14481 0 : _self->out.service_status = talloc_zero(mem_ctx, uint8_t);
14482 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
14483 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
14484 0 : return self;
14485 : }
14486 :
14487 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14488 : {
14489 :
14490 :
14491 0 : return PyLong_FromLong(13);
14492 : }
14493 :
14494 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14495 : {
14496 0 : const struct ndr_interface_call *call = NULL;
14497 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14498 0 : PyObject *ret = NULL;
14499 0 : struct ndr_push *push = NULL;
14500 0 : DATA_BLOB blob;
14501 0 : enum ndr_err_code err;
14502 :
14503 0 : if (ndr_table_svcctl.num_calls < 14) {
14504 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesW_ndr_pack");
14505 0 : return NULL;
14506 : }
14507 0 : call = &ndr_table_svcctl.calls[13];
14508 :
14509 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14510 0 : if (push == NULL) {
14511 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14512 0 : return NULL;
14513 : }
14514 :
14515 0 : push->flags |= ndr_push_flags;
14516 :
14517 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14518 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14519 0 : TALLOC_FREE(push);
14520 0 : PyErr_SetNdrError(err);
14521 0 : return NULL;
14522 : }
14523 0 : blob = ndr_push_blob(push);
14524 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14525 0 : TALLOC_FREE(push);
14526 0 : return ret;
14527 : }
14528 :
14529 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14530 : {
14531 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14532 0 : PyObject *bigendian_obj = NULL;
14533 0 : PyObject *ndr64_obj = NULL;
14534 0 : libndr_flags ndr_push_flags = 0;
14535 :
14536 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14537 : discard_const_p(char *, kwnames),
14538 : &bigendian_obj,
14539 : &ndr64_obj)) {
14540 0 : return NULL;
14541 : }
14542 :
14543 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14544 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14545 : }
14546 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14547 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14548 : }
14549 :
14550 0 : return py_svcctl_EnumDependentServicesW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14551 : }
14552 :
14553 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14554 : {
14555 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14556 0 : PyObject *bigendian_obj = NULL;
14557 0 : PyObject *ndr64_obj = NULL;
14558 0 : libndr_flags ndr_push_flags = 0;
14559 :
14560 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14561 : discard_const_p(char *, kwnames),
14562 : &bigendian_obj,
14563 : &ndr64_obj)) {
14564 0 : return NULL;
14565 : }
14566 :
14567 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14568 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14569 : }
14570 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14571 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14572 : }
14573 :
14574 0 : return py_svcctl_EnumDependentServicesW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14575 : }
14576 :
14577 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
14578 : {
14579 0 : const struct ndr_interface_call *call = NULL;
14580 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14581 0 : struct ndr_pull *pull = NULL;
14582 0 : enum ndr_err_code err;
14583 :
14584 0 : if (ndr_table_svcctl.num_calls < 14) {
14585 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesW_ndr_unpack");
14586 0 : return NULL;
14587 : }
14588 0 : call = &ndr_table_svcctl.calls[13];
14589 :
14590 0 : pull = ndr_pull_init_blob(blob, object);
14591 0 : if (pull == NULL) {
14592 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14593 0 : return NULL;
14594 : }
14595 :
14596 0 : pull->flags |= ndr_pull_flags;
14597 :
14598 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14599 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14600 0 : TALLOC_FREE(pull);
14601 0 : PyErr_SetNdrError(err);
14602 0 : return NULL;
14603 : }
14604 0 : if (!allow_remaining) {
14605 0 : uint32_t highest_ofs;
14606 :
14607 0 : if (pull->offset > pull->relative_highest_offset) {
14608 0 : highest_ofs = pull->offset;
14609 : } else {
14610 0 : highest_ofs = pull->relative_highest_offset;
14611 : }
14612 0 : if (highest_ofs < pull->data_size) {
14613 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14614 : "not all bytes consumed ofs[%u] size[%u]",
14615 : highest_ofs, pull->data_size);
14616 0 : TALLOC_FREE(pull);
14617 0 : PyErr_SetNdrError(err);
14618 0 : return NULL;
14619 : }
14620 : }
14621 :
14622 0 : TALLOC_FREE(pull);
14623 0 : Py_RETURN_NONE;
14624 : }
14625 :
14626 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14627 : {
14628 0 : DATA_BLOB blob;
14629 0 : Py_ssize_t blob_length = 0;
14630 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14631 0 : PyObject *bigendian_obj = NULL;
14632 0 : PyObject *ndr64_obj = NULL;
14633 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14634 0 : PyObject *allow_remaining_obj = NULL;
14635 0 : bool allow_remaining = false;
14636 :
14637 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14638 : discard_const_p(char *, kwnames),
14639 : &blob.data, &blob_length,
14640 : &bigendian_obj,
14641 : &ndr64_obj,
14642 : &allow_remaining_obj)) {
14643 0 : return NULL;
14644 : }
14645 0 : blob.length = blob_length;
14646 :
14647 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14648 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14649 : }
14650 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14651 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14652 : }
14653 :
14654 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14655 0 : allow_remaining = true;
14656 : }
14657 :
14658 0 : return py_svcctl_EnumDependentServicesW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14659 : }
14660 :
14661 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14662 : {
14663 0 : DATA_BLOB blob;
14664 0 : Py_ssize_t blob_length = 0;
14665 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14666 0 : PyObject *bigendian_obj = NULL;
14667 0 : PyObject *ndr64_obj = NULL;
14668 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14669 0 : PyObject *allow_remaining_obj = NULL;
14670 0 : bool allow_remaining = false;
14671 :
14672 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14673 : discard_const_p(char *, kwnames),
14674 : &blob.data, &blob_length,
14675 : &bigendian_obj,
14676 : &ndr64_obj,
14677 : &allow_remaining_obj)) {
14678 0 : return NULL;
14679 : }
14680 0 : blob.length = blob_length;
14681 :
14682 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14683 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14684 : }
14685 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14686 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14687 : }
14688 :
14689 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14690 0 : allow_remaining = true;
14691 : }
14692 :
14693 0 : return py_svcctl_EnumDependentServicesW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14694 : }
14695 :
14696 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14697 : {
14698 0 : const struct ndr_interface_call *call = NULL;
14699 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
14700 0 : PyObject *ret;
14701 0 : char *retstr;
14702 :
14703 0 : if (ndr_table_svcctl.num_calls < 14) {
14704 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesW_ndr_print");
14705 0 : return NULL;
14706 : }
14707 0 : call = &ndr_table_svcctl.calls[13];
14708 :
14709 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14710 0 : ret = PyUnicode_FromString(retstr);
14711 0 : TALLOC_FREE(retstr);
14712 :
14713 0 : return ret;
14714 : }
14715 :
14716 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14717 : {
14718 0 : return py_svcctl_EnumDependentServicesW_ndr_print(py_obj, "svcctl_EnumDependentServicesW_in", NDR_IN);
14719 : }
14720 :
14721 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14722 : {
14723 0 : return py_svcctl_EnumDependentServicesW_ndr_print(py_obj, "svcctl_EnumDependentServicesW_out", NDR_OUT);
14724 : }
14725 :
14726 : static PyMethodDef py_svcctl_EnumDependentServicesW_methods[] = {
14727 : { "opnum", (PyCFunction)py_svcctl_EnumDependentServicesW_ndr_opnum, METH_NOARGS|METH_CLASS,
14728 : "svcctl.EnumDependentServicesW.opnum() -> 13 (0x0d) " },
14729 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14730 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14731 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14732 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14733 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14734 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14735 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14736 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14737 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumDependentServicesW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14738 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumDependentServicesW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14739 : { NULL, NULL, 0, NULL }
14740 : };
14741 :
14742 :
14743 : static PyTypeObject svcctl_EnumDependentServicesW_Type = {
14744 : PyVarObject_HEAD_INIT(NULL, 0)
14745 : .tp_name = "svcctl.EnumDependentServicesW",
14746 : .tp_getset = py_svcctl_EnumDependentServicesW_getsetters,
14747 : .tp_methods = py_svcctl_EnumDependentServicesW_methods,
14748 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14749 : .tp_new = py_svcctl_EnumDependentServicesW_new,
14750 : };
14751 :
14752 0 : static bool pack_py_svcctl_EnumDependentServicesW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumDependentServicesW *r)
14753 : {
14754 0 : PyObject *py_service;
14755 0 : PyObject *py_state;
14756 0 : PyObject *py_offered;
14757 0 : const char *kwnames[] = {
14758 : "service", "state", "offered", NULL
14759 : };
14760 :
14761 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_EnumDependentServicesW", discard_const_p(char *, kwnames), &py_service, &py_state, &py_offered)) {
14762 0 : return false;
14763 : }
14764 :
14765 0 : if (py_service == NULL) {
14766 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service");
14767 0 : return false;
14768 : }
14769 0 : r->in.service = talloc_ptrtype(r, r->in.service);
14770 0 : if (r->in.service == NULL) {
14771 0 : PyErr_NoMemory();
14772 0 : return false;
14773 : }
14774 0 : PY_CHECK_TYPE(policy_handle_Type, py_service, return false;);
14775 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_service)) == NULL) {
14776 0 : PyErr_NoMemory();
14777 0 : return false;
14778 : }
14779 0 : r->in.service = (struct policy_handle *)pytalloc_get_ptr(py_service);
14780 0 : if (py_state == NULL) {
14781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
14782 0 : return false;
14783 : }
14784 : {
14785 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
14786 0 : if (PyLong_Check(py_state)) {
14787 0 : unsigned long long test_var;
14788 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
14789 0 : if (PyErr_Occurred() != NULL) {
14790 0 : return false;
14791 : }
14792 0 : if (test_var > uint_max) {
14793 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14794 : PyLong_Type.tp_name, uint_max, test_var);
14795 0 : return false;
14796 : }
14797 0 : r->in.state = test_var;
14798 : } else {
14799 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14800 : PyLong_Type.tp_name);
14801 0 : return false;
14802 : }
14803 : }
14804 0 : if (py_offered == NULL) {
14805 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
14806 0 : return false;
14807 : }
14808 : {
14809 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
14810 0 : if (PyLong_Check(py_offered)) {
14811 0 : unsigned long long test_var;
14812 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
14813 0 : if (PyErr_Occurred() != NULL) {
14814 0 : return false;
14815 : }
14816 0 : if (test_var > uint_max) {
14817 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14818 : PyLong_Type.tp_name, uint_max, test_var);
14819 0 : return false;
14820 : }
14821 0 : r->in.offered = test_var;
14822 : } else {
14823 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14824 : PyLong_Type.tp_name);
14825 0 : return false;
14826 : }
14827 : }
14828 0 : return true;
14829 : }
14830 :
14831 0 : static PyObject *unpack_py_svcctl_EnumDependentServicesW_args_out(struct svcctl_EnumDependentServicesW *r)
14832 : {
14833 0 : PyObject *result;
14834 0 : PyObject *py_service_status;
14835 0 : PyObject *py_needed;
14836 0 : PyObject *py_services_returned;
14837 0 : result = PyTuple_New(3);
14838 0 : py_service_status = PyList_New(r->in.offered);
14839 0 : if (py_service_status == NULL) {
14840 0 : return NULL;
14841 : }
14842 : {
14843 : int service_status_cntr_1;
14844 0 : for (service_status_cntr_1 = 0; service_status_cntr_1 < (r->in.offered); service_status_cntr_1++) {
14845 0 : PyObject *py_service_status_1;
14846 0 : py_service_status_1 = PyLong_FromLong((uint16_t)r->out.service_status[service_status_cntr_1]);
14847 0 : PyList_SetItem(py_service_status, service_status_cntr_1, py_service_status_1);
14848 : }
14849 : }
14850 0 : PyTuple_SetItem(result, 0, py_service_status);
14851 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
14852 0 : PyTuple_SetItem(result, 1, py_needed);
14853 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
14854 0 : PyTuple_SetItem(result, 2, py_services_returned);
14855 0 : if (!W_ERROR_IS_OK(r->out.result)) {
14856 0 : PyErr_SetWERROR(r->out.result);
14857 0 : return NULL;
14858 : }
14859 :
14860 0 : return result;
14861 : }
14862 :
14863 :
14864 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_handle(PyObject *obj, void *closure)
14865 : {
14866 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
14867 0 : PyObject *py_handle;
14868 0 : if (object->in.handle == NULL) {
14869 0 : Py_RETURN_NONE;
14870 : }
14871 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14872 0 : return py_handle;
14873 : }
14874 :
14875 0 : static int py_svcctl_EnumServicesStatusW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14876 : {
14877 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
14878 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14879 0 : if (value == NULL) {
14880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
14881 0 : return -1;
14882 : }
14883 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14884 0 : if (object->in.handle == NULL) {
14885 0 : PyErr_NoMemory();
14886 0 : return -1;
14887 : }
14888 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14889 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14890 0 : PyErr_NoMemory();
14891 0 : return -1;
14892 : }
14893 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14894 0 : return 0;
14895 : }
14896 :
14897 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_type(PyObject *obj, void *closure)
14898 : {
14899 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
14900 0 : PyObject *py_type;
14901 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
14902 0 : return py_type;
14903 : }
14904 :
14905 0 : static int py_svcctl_EnumServicesStatusW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
14906 : {
14907 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
14908 0 : if (value == NULL) {
14909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
14910 0 : return -1;
14911 : }
14912 : {
14913 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
14914 0 : if (PyLong_Check(value)) {
14915 0 : unsigned long long test_var;
14916 0 : test_var = PyLong_AsUnsignedLongLong(value);
14917 0 : if (PyErr_Occurred() != NULL) {
14918 0 : return -1;
14919 : }
14920 0 : if (test_var > uint_max) {
14921 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14922 : PyLong_Type.tp_name, uint_max, test_var);
14923 0 : return -1;
14924 : }
14925 0 : object->in.type = test_var;
14926 : } else {
14927 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14928 : PyLong_Type.tp_name);
14929 0 : return -1;
14930 : }
14931 : }
14932 0 : return 0;
14933 : }
14934 :
14935 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_state(PyObject *obj, void *closure)
14936 : {
14937 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
14938 0 : PyObject *py_state;
14939 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
14940 0 : return py_state;
14941 : }
14942 :
14943 0 : static int py_svcctl_EnumServicesStatusW_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
14944 : {
14945 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
14946 0 : if (value == NULL) {
14947 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
14948 0 : return -1;
14949 : }
14950 : {
14951 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
14952 0 : if (PyLong_Check(value)) {
14953 0 : unsigned long long test_var;
14954 0 : test_var = PyLong_AsUnsignedLongLong(value);
14955 0 : if (PyErr_Occurred() != NULL) {
14956 0 : return -1;
14957 : }
14958 0 : if (test_var > uint_max) {
14959 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14960 : PyLong_Type.tp_name, uint_max, test_var);
14961 0 : return -1;
14962 : }
14963 0 : object->in.state = test_var;
14964 : } else {
14965 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14966 : PyLong_Type.tp_name);
14967 0 : return -1;
14968 : }
14969 : }
14970 0 : return 0;
14971 : }
14972 :
14973 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_service(PyObject *obj, void *closure)
14974 : {
14975 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
14976 0 : PyObject *py_service;
14977 0 : if (object->out.service == NULL) {
14978 0 : Py_RETURN_NONE;
14979 : }
14980 0 : py_service = PyList_New(object->in.offered);
14981 0 : if (py_service == NULL) {
14982 0 : return NULL;
14983 : }
14984 : {
14985 : int service_cntr_1;
14986 0 : for (service_cntr_1 = 0; service_cntr_1 < (object->in.offered); service_cntr_1++) {
14987 0 : PyObject *py_service_1;
14988 0 : py_service_1 = PyLong_FromLong((uint16_t)object->out.service[service_cntr_1]);
14989 0 : PyList_SetItem(py_service, service_cntr_1, py_service_1);
14990 : }
14991 : }
14992 0 : return py_service;
14993 : }
14994 :
14995 0 : static int py_svcctl_EnumServicesStatusW_out_set_service(PyObject *py_obj, PyObject *value, void *closure)
14996 : {
14997 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
14998 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service));
14999 0 : if (value == NULL) {
15000 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service");
15001 0 : return -1;
15002 : }
15003 0 : object->out.service = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service);
15004 0 : if (object->out.service == NULL) {
15005 0 : PyErr_NoMemory();
15006 0 : return -1;
15007 : }
15008 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
15009 : {
15010 0 : int service_cntr_1;
15011 0 : object->out.service = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service, PyList_GET_SIZE(value));
15012 0 : if (!object->out.service) { return -1; }
15013 0 : talloc_set_name_const(object->out.service, "ARRAY: object->out.service");
15014 0 : for (service_cntr_1 = 0; service_cntr_1 < PyList_GET_SIZE(value); service_cntr_1++) {
15015 0 : if (PyList_GET_ITEM(value, service_cntr_1) == NULL) {
15016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service[service_cntr_1]");
15017 0 : return -1;
15018 : }
15019 : {
15020 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.service[service_cntr_1]));
15021 0 : if (PyLong_Check(PyList_GET_ITEM(value, service_cntr_1))) {
15022 0 : unsigned long long test_var;
15023 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, service_cntr_1));
15024 0 : if (PyErr_Occurred() != NULL) {
15025 0 : return -1;
15026 : }
15027 0 : if (test_var > uint_max) {
15028 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15029 : PyLong_Type.tp_name, uint_max, test_var);
15030 0 : return -1;
15031 : }
15032 0 : object->out.service[service_cntr_1] = test_var;
15033 : } else {
15034 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15035 : PyLong_Type.tp_name);
15036 0 : return -1;
15037 : }
15038 : }
15039 : }
15040 : }
15041 0 : return 0;
15042 : }
15043 :
15044 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_offered(PyObject *obj, void *closure)
15045 : {
15046 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
15047 0 : PyObject *py_offered;
15048 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
15049 0 : return py_offered;
15050 : }
15051 :
15052 0 : static int py_svcctl_EnumServicesStatusW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
15053 : {
15054 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15055 0 : if (value == NULL) {
15056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
15057 0 : return -1;
15058 : }
15059 : {
15060 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
15061 0 : if (PyLong_Check(value)) {
15062 0 : unsigned long long test_var;
15063 0 : test_var = PyLong_AsUnsignedLongLong(value);
15064 0 : if (PyErr_Occurred() != NULL) {
15065 0 : return -1;
15066 : }
15067 0 : if (test_var > uint_max) {
15068 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15069 : PyLong_Type.tp_name, uint_max, test_var);
15070 0 : return -1;
15071 : }
15072 0 : object->in.offered = test_var;
15073 : } else {
15074 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15075 : PyLong_Type.tp_name);
15076 0 : return -1;
15077 : }
15078 : }
15079 0 : return 0;
15080 : }
15081 :
15082 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_needed(PyObject *obj, void *closure)
15083 : {
15084 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
15085 0 : PyObject *py_needed;
15086 0 : if (object->out.needed == NULL) {
15087 0 : Py_RETURN_NONE;
15088 : }
15089 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
15090 0 : return py_needed;
15091 : }
15092 :
15093 0 : static int py_svcctl_EnumServicesStatusW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
15094 : {
15095 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15096 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
15097 0 : if (value == NULL) {
15098 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
15099 0 : return -1;
15100 : }
15101 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
15102 0 : if (object->out.needed == NULL) {
15103 0 : PyErr_NoMemory();
15104 0 : return -1;
15105 : }
15106 : {
15107 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
15108 0 : if (PyLong_Check(value)) {
15109 0 : unsigned long long test_var;
15110 0 : test_var = PyLong_AsUnsignedLongLong(value);
15111 0 : if (PyErr_Occurred() != NULL) {
15112 0 : return -1;
15113 : }
15114 0 : if (test_var > uint_max) {
15115 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15116 : PyLong_Type.tp_name, uint_max, test_var);
15117 0 : return -1;
15118 : }
15119 0 : *object->out.needed = test_var;
15120 : } else {
15121 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15122 : PyLong_Type.tp_name);
15123 0 : return -1;
15124 : }
15125 : }
15126 0 : return 0;
15127 : }
15128 :
15129 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_services_returned(PyObject *obj, void *closure)
15130 : {
15131 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
15132 0 : PyObject *py_services_returned;
15133 0 : if (object->out.services_returned == NULL) {
15134 0 : Py_RETURN_NONE;
15135 : }
15136 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
15137 0 : return py_services_returned;
15138 : }
15139 :
15140 0 : static int py_svcctl_EnumServicesStatusW_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
15141 : {
15142 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15143 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
15144 0 : if (value == NULL) {
15145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
15146 0 : return -1;
15147 : }
15148 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
15149 0 : if (object->out.services_returned == NULL) {
15150 0 : PyErr_NoMemory();
15151 0 : return -1;
15152 : }
15153 : {
15154 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
15155 0 : if (PyLong_Check(value)) {
15156 0 : unsigned long long test_var;
15157 0 : test_var = PyLong_AsUnsignedLongLong(value);
15158 0 : if (PyErr_Occurred() != NULL) {
15159 0 : return -1;
15160 : }
15161 0 : if (test_var > uint_max) {
15162 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15163 : PyLong_Type.tp_name, uint_max, test_var);
15164 0 : return -1;
15165 : }
15166 0 : *object->out.services_returned = test_var;
15167 : } else {
15168 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15169 : PyLong_Type.tp_name);
15170 0 : return -1;
15171 : }
15172 : }
15173 0 : return 0;
15174 : }
15175 :
15176 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_resume_handle(PyObject *obj, void *closure)
15177 : {
15178 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
15179 0 : PyObject *py_resume_handle;
15180 0 : if (object->in.resume_handle == NULL) {
15181 0 : Py_RETURN_NONE;
15182 : }
15183 0 : if (object->in.resume_handle == NULL) {
15184 0 : py_resume_handle = Py_None;
15185 0 : Py_INCREF(py_resume_handle);
15186 : } else {
15187 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
15188 : }
15189 0 : return py_resume_handle;
15190 : }
15191 :
15192 0 : static int py_svcctl_EnumServicesStatusW_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
15193 : {
15194 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15195 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
15196 0 : if (value == NULL) {
15197 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
15198 0 : return -1;
15199 : }
15200 0 : if (value == Py_None) {
15201 0 : object->in.resume_handle = NULL;
15202 : } else {
15203 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
15204 0 : if (object->in.resume_handle == NULL) {
15205 0 : PyErr_NoMemory();
15206 0 : return -1;
15207 : }
15208 : {
15209 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
15210 0 : if (PyLong_Check(value)) {
15211 0 : unsigned long long test_var;
15212 0 : test_var = PyLong_AsUnsignedLongLong(value);
15213 0 : if (PyErr_Occurred() != NULL) {
15214 0 : return -1;
15215 : }
15216 0 : if (test_var > uint_max) {
15217 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15218 : PyLong_Type.tp_name, uint_max, test_var);
15219 0 : return -1;
15220 : }
15221 0 : *object->in.resume_handle = test_var;
15222 : } else {
15223 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15224 : PyLong_Type.tp_name);
15225 0 : return -1;
15226 : }
15227 : }
15228 : }
15229 0 : return 0;
15230 : }
15231 :
15232 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_resume_handle(PyObject *obj, void *closure)
15233 : {
15234 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
15235 0 : PyObject *py_resume_handle;
15236 0 : if (object->out.resume_handle == NULL) {
15237 0 : Py_RETURN_NONE;
15238 : }
15239 0 : if (object->out.resume_handle == NULL) {
15240 0 : py_resume_handle = Py_None;
15241 0 : Py_INCREF(py_resume_handle);
15242 : } else {
15243 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
15244 : }
15245 0 : return py_resume_handle;
15246 : }
15247 :
15248 0 : static int py_svcctl_EnumServicesStatusW_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
15249 : {
15250 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15251 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
15252 0 : if (value == NULL) {
15253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
15254 0 : return -1;
15255 : }
15256 0 : if (value == Py_None) {
15257 0 : object->out.resume_handle = NULL;
15258 : } else {
15259 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
15260 0 : if (object->out.resume_handle == NULL) {
15261 0 : PyErr_NoMemory();
15262 0 : return -1;
15263 : }
15264 : {
15265 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
15266 0 : if (PyLong_Check(value)) {
15267 0 : unsigned long long test_var;
15268 0 : test_var = PyLong_AsUnsignedLongLong(value);
15269 0 : if (PyErr_Occurred() != NULL) {
15270 0 : return -1;
15271 : }
15272 0 : if (test_var > uint_max) {
15273 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15274 : PyLong_Type.tp_name, uint_max, test_var);
15275 0 : return -1;
15276 : }
15277 0 : *object->out.resume_handle = test_var;
15278 : } else {
15279 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15280 : PyLong_Type.tp_name);
15281 0 : return -1;
15282 : }
15283 : }
15284 : }
15285 0 : return 0;
15286 : }
15287 :
15288 0 : static PyObject *py_svcctl_EnumServicesStatusW_get_result(PyObject *obj, void *closure)
15289 : {
15290 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
15291 0 : PyObject *py_result;
15292 0 : py_result = PyErr_FromWERROR(object->out.result);
15293 0 : return py_result;
15294 : }
15295 :
15296 0 : static int py_svcctl_EnumServicesStatusW_set_result(PyObject *py_obj, PyObject *value, void *closure)
15297 : {
15298 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15299 0 : if (value == NULL) {
15300 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15301 0 : return -1;
15302 : }
15303 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
15304 0 : return 0;
15305 : }
15306 :
15307 : static PyGetSetDef py_svcctl_EnumServicesStatusW_getsetters[] = {
15308 : {
15309 : .name = discard_const_p(char, "in_handle"),
15310 : .get = py_svcctl_EnumServicesStatusW_in_get_handle,
15311 : .set = py_svcctl_EnumServicesStatusW_in_set_handle,
15312 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15313 : },
15314 : {
15315 : .name = discard_const_p(char, "in_type"),
15316 : .get = py_svcctl_EnumServicesStatusW_in_get_type,
15317 : .set = py_svcctl_EnumServicesStatusW_in_set_type,
15318 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15319 : },
15320 : {
15321 : .name = discard_const_p(char, "in_state"),
15322 : .get = py_svcctl_EnumServicesStatusW_in_get_state,
15323 : .set = py_svcctl_EnumServicesStatusW_in_set_state,
15324 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
15325 : },
15326 : {
15327 : .name = discard_const_p(char, "out_service"),
15328 : .get = py_svcctl_EnumServicesStatusW_out_get_service,
15329 : .set = py_svcctl_EnumServicesStatusW_out_set_service,
15330 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
15331 : },
15332 : {
15333 : .name = discard_const_p(char, "in_offered"),
15334 : .get = py_svcctl_EnumServicesStatusW_in_get_offered,
15335 : .set = py_svcctl_EnumServicesStatusW_in_set_offered,
15336 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15337 : },
15338 : {
15339 : .name = discard_const_p(char, "out_needed"),
15340 : .get = py_svcctl_EnumServicesStatusW_out_get_needed,
15341 : .set = py_svcctl_EnumServicesStatusW_out_set_needed,
15342 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15343 : },
15344 : {
15345 : .name = discard_const_p(char, "out_services_returned"),
15346 : .get = py_svcctl_EnumServicesStatusW_out_get_services_returned,
15347 : .set = py_svcctl_EnumServicesStatusW_out_set_services_returned,
15348 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15349 : },
15350 : {
15351 : .name = discard_const_p(char, "in_resume_handle"),
15352 : .get = py_svcctl_EnumServicesStatusW_in_get_resume_handle,
15353 : .set = py_svcctl_EnumServicesStatusW_in_set_resume_handle,
15354 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15355 : },
15356 : {
15357 : .name = discard_const_p(char, "out_resume_handle"),
15358 : .get = py_svcctl_EnumServicesStatusW_out_get_resume_handle,
15359 : .set = py_svcctl_EnumServicesStatusW_out_set_resume_handle,
15360 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15361 : },
15362 : {
15363 : .name = discard_const_p(char, "result"),
15364 : .get = py_svcctl_EnumServicesStatusW_get_result,
15365 : .set = py_svcctl_EnumServicesStatusW_set_result,
15366 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
15367 : },
15368 : { .name = NULL }
15369 : };
15370 :
15371 0 : static PyObject *py_svcctl_EnumServicesStatusW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15372 : {
15373 0 : PyObject *self = pytalloc_new(struct svcctl_EnumServicesStatusW, type);
15374 0 : struct svcctl_EnumServicesStatusW *_self = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(self);
15375 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15376 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15377 0 : _self->out.service = talloc_zero(mem_ctx, uint8_t);
15378 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
15379 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
15380 0 : return self;
15381 : }
15382 :
15383 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15384 : {
15385 :
15386 :
15387 0 : return PyLong_FromLong(14);
15388 : }
15389 :
15390 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15391 : {
15392 0 : const struct ndr_interface_call *call = NULL;
15393 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15394 0 : PyObject *ret = NULL;
15395 0 : struct ndr_push *push = NULL;
15396 0 : DATA_BLOB blob;
15397 0 : enum ndr_err_code err;
15398 :
15399 0 : if (ndr_table_svcctl.num_calls < 15) {
15400 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusW_ndr_pack");
15401 0 : return NULL;
15402 : }
15403 0 : call = &ndr_table_svcctl.calls[14];
15404 :
15405 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15406 0 : if (push == NULL) {
15407 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15408 0 : return NULL;
15409 : }
15410 :
15411 0 : push->flags |= ndr_push_flags;
15412 :
15413 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15414 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15415 0 : TALLOC_FREE(push);
15416 0 : PyErr_SetNdrError(err);
15417 0 : return NULL;
15418 : }
15419 0 : blob = ndr_push_blob(push);
15420 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15421 0 : TALLOC_FREE(push);
15422 0 : return ret;
15423 : }
15424 :
15425 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15426 : {
15427 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15428 0 : PyObject *bigendian_obj = NULL;
15429 0 : PyObject *ndr64_obj = NULL;
15430 0 : libndr_flags ndr_push_flags = 0;
15431 :
15432 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15433 : discard_const_p(char *, kwnames),
15434 : &bigendian_obj,
15435 : &ndr64_obj)) {
15436 0 : return NULL;
15437 : }
15438 :
15439 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15440 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15441 : }
15442 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15443 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15444 : }
15445 :
15446 0 : return py_svcctl_EnumServicesStatusW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15447 : }
15448 :
15449 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15450 : {
15451 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15452 0 : PyObject *bigendian_obj = NULL;
15453 0 : PyObject *ndr64_obj = NULL;
15454 0 : libndr_flags ndr_push_flags = 0;
15455 :
15456 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15457 : discard_const_p(char *, kwnames),
15458 : &bigendian_obj,
15459 : &ndr64_obj)) {
15460 0 : return NULL;
15461 : }
15462 :
15463 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15464 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15465 : }
15466 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15467 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15468 : }
15469 :
15470 0 : return py_svcctl_EnumServicesStatusW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15471 : }
15472 :
15473 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
15474 : {
15475 0 : const struct ndr_interface_call *call = NULL;
15476 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15477 0 : struct ndr_pull *pull = NULL;
15478 0 : enum ndr_err_code err;
15479 :
15480 0 : if (ndr_table_svcctl.num_calls < 15) {
15481 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusW_ndr_unpack");
15482 0 : return NULL;
15483 : }
15484 0 : call = &ndr_table_svcctl.calls[14];
15485 :
15486 0 : pull = ndr_pull_init_blob(blob, object);
15487 0 : if (pull == NULL) {
15488 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15489 0 : return NULL;
15490 : }
15491 :
15492 0 : pull->flags |= ndr_pull_flags;
15493 :
15494 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15495 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15496 0 : TALLOC_FREE(pull);
15497 0 : PyErr_SetNdrError(err);
15498 0 : return NULL;
15499 : }
15500 0 : if (!allow_remaining) {
15501 0 : uint32_t highest_ofs;
15502 :
15503 0 : if (pull->offset > pull->relative_highest_offset) {
15504 0 : highest_ofs = pull->offset;
15505 : } else {
15506 0 : highest_ofs = pull->relative_highest_offset;
15507 : }
15508 0 : if (highest_ofs < pull->data_size) {
15509 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15510 : "not all bytes consumed ofs[%u] size[%u]",
15511 : highest_ofs, pull->data_size);
15512 0 : TALLOC_FREE(pull);
15513 0 : PyErr_SetNdrError(err);
15514 0 : return NULL;
15515 : }
15516 : }
15517 :
15518 0 : TALLOC_FREE(pull);
15519 0 : Py_RETURN_NONE;
15520 : }
15521 :
15522 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15523 : {
15524 0 : DATA_BLOB blob;
15525 0 : Py_ssize_t blob_length = 0;
15526 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15527 0 : PyObject *bigendian_obj = NULL;
15528 0 : PyObject *ndr64_obj = NULL;
15529 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15530 0 : PyObject *allow_remaining_obj = NULL;
15531 0 : bool allow_remaining = false;
15532 :
15533 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15534 : discard_const_p(char *, kwnames),
15535 : &blob.data, &blob_length,
15536 : &bigendian_obj,
15537 : &ndr64_obj,
15538 : &allow_remaining_obj)) {
15539 0 : return NULL;
15540 : }
15541 0 : blob.length = blob_length;
15542 :
15543 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15544 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15545 : }
15546 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15547 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15548 : }
15549 :
15550 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15551 0 : allow_remaining = true;
15552 : }
15553 :
15554 0 : return py_svcctl_EnumServicesStatusW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15555 : }
15556 :
15557 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15558 : {
15559 0 : DATA_BLOB blob;
15560 0 : Py_ssize_t blob_length = 0;
15561 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15562 0 : PyObject *bigendian_obj = NULL;
15563 0 : PyObject *ndr64_obj = NULL;
15564 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15565 0 : PyObject *allow_remaining_obj = NULL;
15566 0 : bool allow_remaining = false;
15567 :
15568 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15569 : discard_const_p(char *, kwnames),
15570 : &blob.data, &blob_length,
15571 : &bigendian_obj,
15572 : &ndr64_obj,
15573 : &allow_remaining_obj)) {
15574 0 : return NULL;
15575 : }
15576 0 : blob.length = blob_length;
15577 :
15578 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15579 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15580 : }
15581 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15582 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15583 : }
15584 :
15585 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15586 0 : allow_remaining = true;
15587 : }
15588 :
15589 0 : return py_svcctl_EnumServicesStatusW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15590 : }
15591 :
15592 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
15593 : {
15594 0 : const struct ndr_interface_call *call = NULL;
15595 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
15596 0 : PyObject *ret;
15597 0 : char *retstr;
15598 :
15599 0 : if (ndr_table_svcctl.num_calls < 15) {
15600 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusW_ndr_print");
15601 0 : return NULL;
15602 : }
15603 0 : call = &ndr_table_svcctl.calls[14];
15604 :
15605 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15606 0 : ret = PyUnicode_FromString(retstr);
15607 0 : TALLOC_FREE(retstr);
15608 :
15609 0 : return ret;
15610 : }
15611 :
15612 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15613 : {
15614 0 : return py_svcctl_EnumServicesStatusW_ndr_print(py_obj, "svcctl_EnumServicesStatusW_in", NDR_IN);
15615 : }
15616 :
15617 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15618 : {
15619 0 : return py_svcctl_EnumServicesStatusW_ndr_print(py_obj, "svcctl_EnumServicesStatusW_out", NDR_OUT);
15620 : }
15621 :
15622 : static PyMethodDef py_svcctl_EnumServicesStatusW_methods[] = {
15623 : { "opnum", (PyCFunction)py_svcctl_EnumServicesStatusW_ndr_opnum, METH_NOARGS|METH_CLASS,
15624 : "svcctl.EnumServicesStatusW.opnum() -> 14 (0x0e) " },
15625 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15626 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15627 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15628 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15629 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15630 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15631 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15632 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15633 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumServicesStatusW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15634 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumServicesStatusW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15635 : { NULL, NULL, 0, NULL }
15636 : };
15637 :
15638 :
15639 : static PyTypeObject svcctl_EnumServicesStatusW_Type = {
15640 : PyVarObject_HEAD_INIT(NULL, 0)
15641 : .tp_name = "svcctl.EnumServicesStatusW",
15642 : .tp_getset = py_svcctl_EnumServicesStatusW_getsetters,
15643 : .tp_methods = py_svcctl_EnumServicesStatusW_methods,
15644 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15645 : .tp_new = py_svcctl_EnumServicesStatusW_new,
15646 : };
15647 :
15648 0 : static bool pack_py_svcctl_EnumServicesStatusW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumServicesStatusW *r)
15649 : {
15650 0 : PyObject *py_handle;
15651 0 : PyObject *py_type;
15652 0 : PyObject *py_state;
15653 0 : PyObject *py_offered;
15654 0 : PyObject *py_resume_handle;
15655 0 : const char *kwnames[] = {
15656 : "handle", "type", "state", "offered", "resume_handle", NULL
15657 : };
15658 :
15659 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:svcctl_EnumServicesStatusW", discard_const_p(char *, kwnames), &py_handle, &py_type, &py_state, &py_offered, &py_resume_handle)) {
15660 0 : return false;
15661 : }
15662 :
15663 0 : if (py_handle == NULL) {
15664 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
15665 0 : return false;
15666 : }
15667 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15668 0 : if (r->in.handle == NULL) {
15669 0 : PyErr_NoMemory();
15670 0 : return false;
15671 : }
15672 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15673 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15674 0 : PyErr_NoMemory();
15675 0 : return false;
15676 : }
15677 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15678 0 : if (py_type == NULL) {
15679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
15680 0 : return false;
15681 : }
15682 : {
15683 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
15684 0 : if (PyLong_Check(py_type)) {
15685 0 : unsigned long long test_var;
15686 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
15687 0 : if (PyErr_Occurred() != NULL) {
15688 0 : return false;
15689 : }
15690 0 : if (test_var > uint_max) {
15691 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15692 : PyLong_Type.tp_name, uint_max, test_var);
15693 0 : return false;
15694 : }
15695 0 : r->in.type = test_var;
15696 : } else {
15697 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15698 : PyLong_Type.tp_name);
15699 0 : return false;
15700 : }
15701 : }
15702 0 : if (py_state == NULL) {
15703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
15704 0 : return false;
15705 : }
15706 : {
15707 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
15708 0 : if (PyLong_Check(py_state)) {
15709 0 : unsigned long long test_var;
15710 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
15711 0 : if (PyErr_Occurred() != NULL) {
15712 0 : return false;
15713 : }
15714 0 : if (test_var > uint_max) {
15715 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15716 : PyLong_Type.tp_name, uint_max, test_var);
15717 0 : return false;
15718 : }
15719 0 : r->in.state = test_var;
15720 : } else {
15721 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15722 : PyLong_Type.tp_name);
15723 0 : return false;
15724 : }
15725 : }
15726 0 : if (py_offered == NULL) {
15727 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
15728 0 : return false;
15729 : }
15730 : {
15731 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
15732 0 : if (PyLong_Check(py_offered)) {
15733 0 : unsigned long long test_var;
15734 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
15735 0 : if (PyErr_Occurred() != NULL) {
15736 0 : return false;
15737 : }
15738 0 : if (test_var > uint_max) {
15739 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15740 : PyLong_Type.tp_name, uint_max, test_var);
15741 0 : return false;
15742 : }
15743 0 : r->in.offered = test_var;
15744 : } else {
15745 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15746 : PyLong_Type.tp_name);
15747 0 : return false;
15748 : }
15749 : }
15750 0 : if (py_resume_handle == NULL) {
15751 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
15752 0 : return false;
15753 : }
15754 0 : if (py_resume_handle == Py_None) {
15755 0 : r->in.resume_handle = NULL;
15756 : } else {
15757 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
15758 0 : if (r->in.resume_handle == NULL) {
15759 0 : PyErr_NoMemory();
15760 0 : return false;
15761 : }
15762 : {
15763 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
15764 0 : if (PyLong_Check(py_resume_handle)) {
15765 0 : unsigned long long test_var;
15766 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
15767 0 : if (PyErr_Occurred() != NULL) {
15768 0 : return false;
15769 : }
15770 0 : if (test_var > uint_max) {
15771 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15772 : PyLong_Type.tp_name, uint_max, test_var);
15773 0 : return false;
15774 : }
15775 0 : *r->in.resume_handle = test_var;
15776 : } else {
15777 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15778 : PyLong_Type.tp_name);
15779 0 : return false;
15780 : }
15781 : }
15782 : }
15783 0 : return true;
15784 : }
15785 :
15786 0 : static PyObject *unpack_py_svcctl_EnumServicesStatusW_args_out(struct svcctl_EnumServicesStatusW *r)
15787 : {
15788 0 : PyObject *result;
15789 0 : PyObject *py_service;
15790 0 : PyObject *py_needed;
15791 0 : PyObject *py_services_returned;
15792 0 : PyObject *py_resume_handle;
15793 0 : result = PyTuple_New(4);
15794 0 : py_service = PyList_New(r->in.offered);
15795 0 : if (py_service == NULL) {
15796 0 : return NULL;
15797 : }
15798 : {
15799 : int service_cntr_1;
15800 0 : for (service_cntr_1 = 0; service_cntr_1 < (r->in.offered); service_cntr_1++) {
15801 0 : PyObject *py_service_1;
15802 0 : py_service_1 = PyLong_FromLong((uint16_t)r->out.service[service_cntr_1]);
15803 0 : PyList_SetItem(py_service, service_cntr_1, py_service_1);
15804 : }
15805 : }
15806 0 : PyTuple_SetItem(result, 0, py_service);
15807 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
15808 0 : PyTuple_SetItem(result, 1, py_needed);
15809 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
15810 0 : PyTuple_SetItem(result, 2, py_services_returned);
15811 0 : if (r->out.resume_handle == NULL) {
15812 0 : py_resume_handle = Py_None;
15813 0 : Py_INCREF(py_resume_handle);
15814 : } else {
15815 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
15816 : }
15817 0 : PyTuple_SetItem(result, 3, py_resume_handle);
15818 0 : if (!W_ERROR_IS_OK(r->out.result)) {
15819 0 : PyErr_SetWERROR(r->out.result);
15820 0 : return NULL;
15821 : }
15822 :
15823 0 : return result;
15824 : }
15825 :
15826 :
15827 0 : static PyObject *py_svcctl_OpenSCManagerW_in_get_MachineName(PyObject *obj, void *closure)
15828 : {
15829 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
15830 0 : PyObject *py_MachineName;
15831 0 : if (object->in.MachineName == NULL) {
15832 0 : Py_RETURN_NONE;
15833 : }
15834 0 : if (object->in.MachineName == NULL) {
15835 0 : py_MachineName = Py_None;
15836 0 : Py_INCREF(py_MachineName);
15837 : } else {
15838 0 : if (object->in.MachineName == NULL) {
15839 0 : py_MachineName = Py_None;
15840 0 : Py_INCREF(py_MachineName);
15841 : } else {
15842 0 : py_MachineName = PyUnicode_Decode(object->in.MachineName, strlen(object->in.MachineName), "utf-8", "ignore");
15843 : }
15844 : }
15845 0 : return py_MachineName;
15846 : }
15847 :
15848 0 : static int py_svcctl_OpenSCManagerW_in_set_MachineName(PyObject *py_obj, PyObject *value, void *closure)
15849 : {
15850 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
15851 0 : if (value == NULL) {
15852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.MachineName");
15853 0 : return -1;
15854 : }
15855 0 : if (value == Py_None) {
15856 0 : object->in.MachineName = NULL;
15857 : } else {
15858 0 : object->in.MachineName = NULL;
15859 : {
15860 0 : const char *test_str;
15861 0 : const char *talloc_str;
15862 0 : PyObject *unicode = NULL;
15863 0 : if (PyUnicode_Check(value)) {
15864 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15865 0 : if (unicode == NULL) {
15866 0 : return -1;
15867 : }
15868 0 : test_str = PyBytes_AS_STRING(unicode);
15869 0 : } else if (PyBytes_Check(value)) {
15870 0 : test_str = PyBytes_AS_STRING(value);
15871 : } else {
15872 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15873 0 : return -1;
15874 : }
15875 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15876 0 : if (unicode != NULL) {
15877 0 : Py_DECREF(unicode);
15878 : }
15879 0 : if (talloc_str == NULL) {
15880 0 : PyErr_NoMemory();
15881 0 : return -1;
15882 : }
15883 0 : object->in.MachineName = talloc_str;
15884 : }
15885 : }
15886 0 : return 0;
15887 : }
15888 :
15889 0 : static PyObject *py_svcctl_OpenSCManagerW_in_get_DatabaseName(PyObject *obj, void *closure)
15890 : {
15891 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
15892 0 : PyObject *py_DatabaseName;
15893 0 : if (object->in.DatabaseName == NULL) {
15894 0 : Py_RETURN_NONE;
15895 : }
15896 0 : if (object->in.DatabaseName == NULL) {
15897 0 : py_DatabaseName = Py_None;
15898 0 : Py_INCREF(py_DatabaseName);
15899 : } else {
15900 0 : if (object->in.DatabaseName == NULL) {
15901 0 : py_DatabaseName = Py_None;
15902 0 : Py_INCREF(py_DatabaseName);
15903 : } else {
15904 0 : py_DatabaseName = PyUnicode_Decode(object->in.DatabaseName, strlen(object->in.DatabaseName), "utf-8", "ignore");
15905 : }
15906 : }
15907 0 : return py_DatabaseName;
15908 : }
15909 :
15910 0 : static int py_svcctl_OpenSCManagerW_in_set_DatabaseName(PyObject *py_obj, PyObject *value, void *closure)
15911 : {
15912 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
15913 0 : if (value == NULL) {
15914 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DatabaseName");
15915 0 : return -1;
15916 : }
15917 0 : if (value == Py_None) {
15918 0 : object->in.DatabaseName = NULL;
15919 : } else {
15920 0 : object->in.DatabaseName = NULL;
15921 : {
15922 0 : const char *test_str;
15923 0 : const char *talloc_str;
15924 0 : PyObject *unicode = NULL;
15925 0 : if (PyUnicode_Check(value)) {
15926 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15927 0 : if (unicode == NULL) {
15928 0 : return -1;
15929 : }
15930 0 : test_str = PyBytes_AS_STRING(unicode);
15931 0 : } else if (PyBytes_Check(value)) {
15932 0 : test_str = PyBytes_AS_STRING(value);
15933 : } else {
15934 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15935 0 : return -1;
15936 : }
15937 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15938 0 : if (unicode != NULL) {
15939 0 : Py_DECREF(unicode);
15940 : }
15941 0 : if (talloc_str == NULL) {
15942 0 : PyErr_NoMemory();
15943 0 : return -1;
15944 : }
15945 0 : object->in.DatabaseName = talloc_str;
15946 : }
15947 : }
15948 0 : return 0;
15949 : }
15950 :
15951 0 : static PyObject *py_svcctl_OpenSCManagerW_in_get_access_mask(PyObject *obj, void *closure)
15952 : {
15953 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
15954 0 : PyObject *py_access_mask;
15955 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
15956 0 : return py_access_mask;
15957 : }
15958 :
15959 0 : static int py_svcctl_OpenSCManagerW_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
15960 : {
15961 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
15962 0 : if (value == NULL) {
15963 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
15964 0 : return -1;
15965 : }
15966 : {
15967 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
15968 0 : if (PyLong_Check(value)) {
15969 0 : unsigned long long test_var;
15970 0 : test_var = PyLong_AsUnsignedLongLong(value);
15971 0 : if (PyErr_Occurred() != NULL) {
15972 0 : return -1;
15973 : }
15974 0 : if (test_var > uint_max) {
15975 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15976 : PyLong_Type.tp_name, uint_max, test_var);
15977 0 : return -1;
15978 : }
15979 0 : object->in.access_mask = test_var;
15980 : } else {
15981 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15982 : PyLong_Type.tp_name);
15983 0 : return -1;
15984 : }
15985 : }
15986 0 : return 0;
15987 : }
15988 :
15989 0 : static PyObject *py_svcctl_OpenSCManagerW_out_get_handle(PyObject *obj, void *closure)
15990 : {
15991 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
15992 0 : PyObject *py_handle;
15993 0 : if (object->out.handle == NULL) {
15994 0 : Py_RETURN_NONE;
15995 : }
15996 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
15997 0 : return py_handle;
15998 : }
15999 :
16000 0 : static int py_svcctl_OpenSCManagerW_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16001 : {
16002 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
16003 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
16004 0 : if (value == NULL) {
16005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
16006 0 : return -1;
16007 : }
16008 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
16009 0 : if (object->out.handle == NULL) {
16010 0 : PyErr_NoMemory();
16011 0 : return -1;
16012 : }
16013 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16014 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16015 0 : PyErr_NoMemory();
16016 0 : return -1;
16017 : }
16018 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16019 0 : return 0;
16020 : }
16021 :
16022 0 : static PyObject *py_svcctl_OpenSCManagerW_get_result(PyObject *obj, void *closure)
16023 : {
16024 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
16025 0 : PyObject *py_result;
16026 0 : py_result = PyErr_FromWERROR(object->out.result);
16027 0 : return py_result;
16028 : }
16029 :
16030 0 : static int py_svcctl_OpenSCManagerW_set_result(PyObject *py_obj, PyObject *value, void *closure)
16031 : {
16032 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
16033 0 : if (value == NULL) {
16034 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16035 0 : return -1;
16036 : }
16037 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
16038 0 : return 0;
16039 : }
16040 :
16041 : static PyGetSetDef py_svcctl_OpenSCManagerW_getsetters[] = {
16042 : {
16043 : .name = discard_const_p(char, "in_MachineName"),
16044 : .get = py_svcctl_OpenSCManagerW_in_get_MachineName,
16045 : .set = py_svcctl_OpenSCManagerW_in_set_MachineName,
16046 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
16047 : },
16048 : {
16049 : .name = discard_const_p(char, "in_DatabaseName"),
16050 : .get = py_svcctl_OpenSCManagerW_in_get_DatabaseName,
16051 : .set = py_svcctl_OpenSCManagerW_in_set_DatabaseName,
16052 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
16053 : },
16054 : {
16055 : .name = discard_const_p(char, "in_access_mask"),
16056 : .get = py_svcctl_OpenSCManagerW_in_get_access_mask,
16057 : .set = py_svcctl_OpenSCManagerW_in_set_access_mask,
16058 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_MgrAccessMask")
16059 : },
16060 : {
16061 : .name = discard_const_p(char, "out_handle"),
16062 : .get = py_svcctl_OpenSCManagerW_out_get_handle,
16063 : .set = py_svcctl_OpenSCManagerW_out_set_handle,
16064 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16065 : },
16066 : {
16067 : .name = discard_const_p(char, "result"),
16068 : .get = py_svcctl_OpenSCManagerW_get_result,
16069 : .set = py_svcctl_OpenSCManagerW_set_result,
16070 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
16071 : },
16072 : { .name = NULL }
16073 : };
16074 :
16075 0 : static PyObject *py_svcctl_OpenSCManagerW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16076 : {
16077 0 : PyObject *self = pytalloc_new(struct svcctl_OpenSCManagerW, type);
16078 0 : struct svcctl_OpenSCManagerW *_self = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(self);
16079 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16080 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
16081 0 : return self;
16082 : }
16083 :
16084 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16085 : {
16086 :
16087 :
16088 0 : return PyLong_FromLong(15);
16089 : }
16090 :
16091 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16092 : {
16093 0 : const struct ndr_interface_call *call = NULL;
16094 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
16095 0 : PyObject *ret = NULL;
16096 0 : struct ndr_push *push = NULL;
16097 0 : DATA_BLOB blob;
16098 0 : enum ndr_err_code err;
16099 :
16100 0 : if (ndr_table_svcctl.num_calls < 16) {
16101 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerW_ndr_pack");
16102 0 : return NULL;
16103 : }
16104 0 : call = &ndr_table_svcctl.calls[15];
16105 :
16106 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16107 0 : if (push == NULL) {
16108 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16109 0 : return NULL;
16110 : }
16111 :
16112 0 : push->flags |= ndr_push_flags;
16113 :
16114 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16115 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16116 0 : TALLOC_FREE(push);
16117 0 : PyErr_SetNdrError(err);
16118 0 : return NULL;
16119 : }
16120 0 : blob = ndr_push_blob(push);
16121 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16122 0 : TALLOC_FREE(push);
16123 0 : return ret;
16124 : }
16125 :
16126 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16127 : {
16128 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16129 0 : PyObject *bigendian_obj = NULL;
16130 0 : PyObject *ndr64_obj = NULL;
16131 0 : libndr_flags ndr_push_flags = 0;
16132 :
16133 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16134 : discard_const_p(char *, kwnames),
16135 : &bigendian_obj,
16136 : &ndr64_obj)) {
16137 0 : return NULL;
16138 : }
16139 :
16140 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16141 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16142 : }
16143 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16144 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16145 : }
16146 :
16147 0 : return py_svcctl_OpenSCManagerW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16148 : }
16149 :
16150 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16151 : {
16152 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16153 0 : PyObject *bigendian_obj = NULL;
16154 0 : PyObject *ndr64_obj = NULL;
16155 0 : libndr_flags ndr_push_flags = 0;
16156 :
16157 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16158 : discard_const_p(char *, kwnames),
16159 : &bigendian_obj,
16160 : &ndr64_obj)) {
16161 0 : return NULL;
16162 : }
16163 :
16164 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16165 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16166 : }
16167 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16168 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16169 : }
16170 :
16171 0 : return py_svcctl_OpenSCManagerW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16172 : }
16173 :
16174 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
16175 : {
16176 0 : const struct ndr_interface_call *call = NULL;
16177 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
16178 0 : struct ndr_pull *pull = NULL;
16179 0 : enum ndr_err_code err;
16180 :
16181 0 : if (ndr_table_svcctl.num_calls < 16) {
16182 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerW_ndr_unpack");
16183 0 : return NULL;
16184 : }
16185 0 : call = &ndr_table_svcctl.calls[15];
16186 :
16187 0 : pull = ndr_pull_init_blob(blob, object);
16188 0 : if (pull == NULL) {
16189 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16190 0 : return NULL;
16191 : }
16192 :
16193 0 : pull->flags |= ndr_pull_flags;
16194 :
16195 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16196 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16197 0 : TALLOC_FREE(pull);
16198 0 : PyErr_SetNdrError(err);
16199 0 : return NULL;
16200 : }
16201 0 : if (!allow_remaining) {
16202 0 : uint32_t highest_ofs;
16203 :
16204 0 : if (pull->offset > pull->relative_highest_offset) {
16205 0 : highest_ofs = pull->offset;
16206 : } else {
16207 0 : highest_ofs = pull->relative_highest_offset;
16208 : }
16209 0 : if (highest_ofs < pull->data_size) {
16210 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16211 : "not all bytes consumed ofs[%u] size[%u]",
16212 : highest_ofs, pull->data_size);
16213 0 : TALLOC_FREE(pull);
16214 0 : PyErr_SetNdrError(err);
16215 0 : return NULL;
16216 : }
16217 : }
16218 :
16219 0 : TALLOC_FREE(pull);
16220 0 : Py_RETURN_NONE;
16221 : }
16222 :
16223 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16224 : {
16225 0 : DATA_BLOB blob;
16226 0 : Py_ssize_t blob_length = 0;
16227 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16228 0 : PyObject *bigendian_obj = NULL;
16229 0 : PyObject *ndr64_obj = NULL;
16230 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16231 0 : PyObject *allow_remaining_obj = NULL;
16232 0 : bool allow_remaining = false;
16233 :
16234 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16235 : discard_const_p(char *, kwnames),
16236 : &blob.data, &blob_length,
16237 : &bigendian_obj,
16238 : &ndr64_obj,
16239 : &allow_remaining_obj)) {
16240 0 : return NULL;
16241 : }
16242 0 : blob.length = blob_length;
16243 :
16244 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16245 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16246 : }
16247 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16248 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16249 : }
16250 :
16251 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16252 0 : allow_remaining = true;
16253 : }
16254 :
16255 0 : return py_svcctl_OpenSCManagerW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16256 : }
16257 :
16258 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16259 : {
16260 0 : DATA_BLOB blob;
16261 0 : Py_ssize_t blob_length = 0;
16262 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16263 0 : PyObject *bigendian_obj = NULL;
16264 0 : PyObject *ndr64_obj = NULL;
16265 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16266 0 : PyObject *allow_remaining_obj = NULL;
16267 0 : bool allow_remaining = false;
16268 :
16269 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16270 : discard_const_p(char *, kwnames),
16271 : &blob.data, &blob_length,
16272 : &bigendian_obj,
16273 : &ndr64_obj,
16274 : &allow_remaining_obj)) {
16275 0 : return NULL;
16276 : }
16277 0 : blob.length = blob_length;
16278 :
16279 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16280 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16281 : }
16282 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16283 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16284 : }
16285 :
16286 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16287 0 : allow_remaining = true;
16288 : }
16289 :
16290 0 : return py_svcctl_OpenSCManagerW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16291 : }
16292 :
16293 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16294 : {
16295 0 : const struct ndr_interface_call *call = NULL;
16296 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
16297 0 : PyObject *ret;
16298 0 : char *retstr;
16299 :
16300 0 : if (ndr_table_svcctl.num_calls < 16) {
16301 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerW_ndr_print");
16302 0 : return NULL;
16303 : }
16304 0 : call = &ndr_table_svcctl.calls[15];
16305 :
16306 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16307 0 : ret = PyUnicode_FromString(retstr);
16308 0 : TALLOC_FREE(retstr);
16309 :
16310 0 : return ret;
16311 : }
16312 :
16313 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16314 : {
16315 0 : return py_svcctl_OpenSCManagerW_ndr_print(py_obj, "svcctl_OpenSCManagerW_in", NDR_IN);
16316 : }
16317 :
16318 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16319 : {
16320 0 : return py_svcctl_OpenSCManagerW_ndr_print(py_obj, "svcctl_OpenSCManagerW_out", NDR_OUT);
16321 : }
16322 :
16323 : static PyMethodDef py_svcctl_OpenSCManagerW_methods[] = {
16324 : { "opnum", (PyCFunction)py_svcctl_OpenSCManagerW_ndr_opnum, METH_NOARGS|METH_CLASS,
16325 : "svcctl.OpenSCManagerW.opnum() -> 15 (0x0f) " },
16326 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16327 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16328 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16329 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16330 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16331 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16332 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16333 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16334 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenSCManagerW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16335 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenSCManagerW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16336 : { NULL, NULL, 0, NULL }
16337 : };
16338 :
16339 :
16340 : static PyTypeObject svcctl_OpenSCManagerW_Type = {
16341 : PyVarObject_HEAD_INIT(NULL, 0)
16342 : .tp_name = "svcctl.OpenSCManagerW",
16343 : .tp_getset = py_svcctl_OpenSCManagerW_getsetters,
16344 : .tp_methods = py_svcctl_OpenSCManagerW_methods,
16345 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16346 : .tp_new = py_svcctl_OpenSCManagerW_new,
16347 : };
16348 :
16349 0 : static bool pack_py_svcctl_OpenSCManagerW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenSCManagerW *r)
16350 : {
16351 0 : PyObject *py_MachineName;
16352 0 : PyObject *py_DatabaseName;
16353 0 : PyObject *py_access_mask;
16354 0 : const char *kwnames[] = {
16355 : "MachineName", "DatabaseName", "access_mask", NULL
16356 : };
16357 :
16358 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenSCManagerW", discard_const_p(char *, kwnames), &py_MachineName, &py_DatabaseName, &py_access_mask)) {
16359 0 : return false;
16360 : }
16361 :
16362 0 : if (py_MachineName == NULL) {
16363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.MachineName");
16364 0 : return false;
16365 : }
16366 0 : if (py_MachineName == Py_None) {
16367 0 : r->in.MachineName = NULL;
16368 : } else {
16369 0 : r->in.MachineName = NULL;
16370 : {
16371 0 : const char *test_str;
16372 0 : const char *talloc_str;
16373 0 : PyObject *unicode = NULL;
16374 0 : if (PyUnicode_Check(py_MachineName)) {
16375 0 : unicode = PyUnicode_AsEncodedString(py_MachineName, "utf-8", "ignore");
16376 0 : if (unicode == NULL) {
16377 0 : return false;
16378 : }
16379 0 : test_str = PyBytes_AS_STRING(unicode);
16380 0 : } else if (PyBytes_Check(py_MachineName)) {
16381 0 : test_str = PyBytes_AS_STRING(py_MachineName);
16382 : } else {
16383 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_MachineName)->tp_name);
16384 0 : return false;
16385 : }
16386 0 : talloc_str = talloc_strdup(r, test_str);
16387 0 : if (unicode != NULL) {
16388 0 : Py_DECREF(unicode);
16389 : }
16390 0 : if (talloc_str == NULL) {
16391 0 : PyErr_NoMemory();
16392 0 : return false;
16393 : }
16394 0 : r->in.MachineName = talloc_str;
16395 : }
16396 : }
16397 0 : if (py_DatabaseName == NULL) {
16398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DatabaseName");
16399 0 : return false;
16400 : }
16401 0 : if (py_DatabaseName == Py_None) {
16402 0 : r->in.DatabaseName = NULL;
16403 : } else {
16404 0 : r->in.DatabaseName = NULL;
16405 : {
16406 0 : const char *test_str;
16407 0 : const char *talloc_str;
16408 0 : PyObject *unicode = NULL;
16409 0 : if (PyUnicode_Check(py_DatabaseName)) {
16410 0 : unicode = PyUnicode_AsEncodedString(py_DatabaseName, "utf-8", "ignore");
16411 0 : if (unicode == NULL) {
16412 0 : return false;
16413 : }
16414 0 : test_str = PyBytes_AS_STRING(unicode);
16415 0 : } else if (PyBytes_Check(py_DatabaseName)) {
16416 0 : test_str = PyBytes_AS_STRING(py_DatabaseName);
16417 : } else {
16418 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DatabaseName)->tp_name);
16419 0 : return false;
16420 : }
16421 0 : talloc_str = talloc_strdup(r, test_str);
16422 0 : if (unicode != NULL) {
16423 0 : Py_DECREF(unicode);
16424 : }
16425 0 : if (talloc_str == NULL) {
16426 0 : PyErr_NoMemory();
16427 0 : return false;
16428 : }
16429 0 : r->in.DatabaseName = talloc_str;
16430 : }
16431 : }
16432 0 : if (py_access_mask == NULL) {
16433 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
16434 0 : return false;
16435 : }
16436 : {
16437 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
16438 0 : if (PyLong_Check(py_access_mask)) {
16439 0 : unsigned long long test_var;
16440 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
16441 0 : if (PyErr_Occurred() != NULL) {
16442 0 : return false;
16443 : }
16444 0 : if (test_var > uint_max) {
16445 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16446 : PyLong_Type.tp_name, uint_max, test_var);
16447 0 : return false;
16448 : }
16449 0 : r->in.access_mask = test_var;
16450 : } else {
16451 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16452 : PyLong_Type.tp_name);
16453 0 : return false;
16454 : }
16455 : }
16456 0 : return true;
16457 : }
16458 :
16459 0 : static PyObject *unpack_py_svcctl_OpenSCManagerW_args_out(struct svcctl_OpenSCManagerW *r)
16460 : {
16461 0 : PyObject *result;
16462 0 : PyObject *py_handle;
16463 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
16464 0 : result = py_handle;
16465 0 : if (!W_ERROR_IS_OK(r->out.result)) {
16466 0 : PyErr_SetWERROR(r->out.result);
16467 0 : return NULL;
16468 : }
16469 :
16470 0 : return result;
16471 : }
16472 :
16473 :
16474 0 : static PyObject *py_svcctl_OpenServiceW_in_get_scmanager_handle(PyObject *obj, void *closure)
16475 : {
16476 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
16477 0 : PyObject *py_scmanager_handle;
16478 0 : if (object->in.scmanager_handle == NULL) {
16479 0 : Py_RETURN_NONE;
16480 : }
16481 0 : py_scmanager_handle = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager_handle, object->in.scmanager_handle);
16482 0 : return py_scmanager_handle;
16483 : }
16484 :
16485 0 : static int py_svcctl_OpenServiceW_in_set_scmanager_handle(PyObject *py_obj, PyObject *value, void *closure)
16486 : {
16487 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16488 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager_handle));
16489 0 : if (value == NULL) {
16490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager_handle");
16491 0 : return -1;
16492 : }
16493 0 : object->in.scmanager_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager_handle);
16494 0 : if (object->in.scmanager_handle == NULL) {
16495 0 : PyErr_NoMemory();
16496 0 : return -1;
16497 : }
16498 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16499 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16500 0 : PyErr_NoMemory();
16501 0 : return -1;
16502 : }
16503 0 : object->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(value);
16504 0 : return 0;
16505 : }
16506 :
16507 0 : static PyObject *py_svcctl_OpenServiceW_in_get_ServiceName(PyObject *obj, void *closure)
16508 : {
16509 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
16510 0 : PyObject *py_ServiceName;
16511 0 : if (object->in.ServiceName == NULL) {
16512 0 : py_ServiceName = Py_None;
16513 0 : Py_INCREF(py_ServiceName);
16514 : } else {
16515 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
16516 : }
16517 0 : return py_ServiceName;
16518 : }
16519 :
16520 0 : static int py_svcctl_OpenServiceW_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
16521 : {
16522 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16523 0 : if (value == NULL) {
16524 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
16525 0 : return -1;
16526 : }
16527 : {
16528 0 : const char *test_str;
16529 0 : const char *talloc_str;
16530 0 : PyObject *unicode = NULL;
16531 0 : if (PyUnicode_Check(value)) {
16532 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
16533 0 : if (unicode == NULL) {
16534 0 : return -1;
16535 : }
16536 0 : test_str = PyBytes_AS_STRING(unicode);
16537 0 : } else if (PyBytes_Check(value)) {
16538 0 : test_str = PyBytes_AS_STRING(value);
16539 : } else {
16540 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
16541 0 : return -1;
16542 : }
16543 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
16544 0 : if (unicode != NULL) {
16545 0 : Py_DECREF(unicode);
16546 : }
16547 0 : if (talloc_str == NULL) {
16548 0 : PyErr_NoMemory();
16549 0 : return -1;
16550 : }
16551 0 : object->in.ServiceName = talloc_str;
16552 : }
16553 0 : return 0;
16554 : }
16555 :
16556 0 : static PyObject *py_svcctl_OpenServiceW_in_get_access_mask(PyObject *obj, void *closure)
16557 : {
16558 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
16559 0 : PyObject *py_access_mask;
16560 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
16561 0 : return py_access_mask;
16562 : }
16563 :
16564 0 : static int py_svcctl_OpenServiceW_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
16565 : {
16566 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16567 0 : if (value == NULL) {
16568 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
16569 0 : return -1;
16570 : }
16571 : {
16572 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
16573 0 : if (PyLong_Check(value)) {
16574 0 : unsigned long long test_var;
16575 0 : test_var = PyLong_AsUnsignedLongLong(value);
16576 0 : if (PyErr_Occurred() != NULL) {
16577 0 : return -1;
16578 : }
16579 0 : if (test_var > uint_max) {
16580 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16581 : PyLong_Type.tp_name, uint_max, test_var);
16582 0 : return -1;
16583 : }
16584 0 : object->in.access_mask = test_var;
16585 : } else {
16586 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16587 : PyLong_Type.tp_name);
16588 0 : return -1;
16589 : }
16590 : }
16591 0 : return 0;
16592 : }
16593 :
16594 0 : static PyObject *py_svcctl_OpenServiceW_out_get_handle(PyObject *obj, void *closure)
16595 : {
16596 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
16597 0 : PyObject *py_handle;
16598 0 : if (object->out.handle == NULL) {
16599 0 : Py_RETURN_NONE;
16600 : }
16601 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
16602 0 : return py_handle;
16603 : }
16604 :
16605 0 : static int py_svcctl_OpenServiceW_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16606 : {
16607 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16608 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
16609 0 : if (value == NULL) {
16610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
16611 0 : return -1;
16612 : }
16613 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
16614 0 : if (object->out.handle == NULL) {
16615 0 : PyErr_NoMemory();
16616 0 : return -1;
16617 : }
16618 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16619 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16620 0 : PyErr_NoMemory();
16621 0 : return -1;
16622 : }
16623 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16624 0 : return 0;
16625 : }
16626 :
16627 0 : static PyObject *py_svcctl_OpenServiceW_get_result(PyObject *obj, void *closure)
16628 : {
16629 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
16630 0 : PyObject *py_result;
16631 0 : py_result = PyErr_FromWERROR(object->out.result);
16632 0 : return py_result;
16633 : }
16634 :
16635 0 : static int py_svcctl_OpenServiceW_set_result(PyObject *py_obj, PyObject *value, void *closure)
16636 : {
16637 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16638 0 : if (value == NULL) {
16639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16640 0 : return -1;
16641 : }
16642 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
16643 0 : return 0;
16644 : }
16645 :
16646 : static PyGetSetDef py_svcctl_OpenServiceW_getsetters[] = {
16647 : {
16648 : .name = discard_const_p(char, "in_scmanager_handle"),
16649 : .get = py_svcctl_OpenServiceW_in_get_scmanager_handle,
16650 : .set = py_svcctl_OpenServiceW_in_set_scmanager_handle,
16651 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16652 : },
16653 : {
16654 : .name = discard_const_p(char, "in_ServiceName"),
16655 : .get = py_svcctl_OpenServiceW_in_get_ServiceName,
16656 : .set = py_svcctl_OpenServiceW_in_set_ServiceName,
16657 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
16658 : },
16659 : {
16660 : .name = discard_const_p(char, "in_access_mask"),
16661 : .get = py_svcctl_OpenServiceW_in_get_access_mask,
16662 : .set = py_svcctl_OpenServiceW_in_set_access_mask,
16663 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceAccessMask")
16664 : },
16665 : {
16666 : .name = discard_const_p(char, "out_handle"),
16667 : .get = py_svcctl_OpenServiceW_out_get_handle,
16668 : .set = py_svcctl_OpenServiceW_out_set_handle,
16669 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16670 : },
16671 : {
16672 : .name = discard_const_p(char, "result"),
16673 : .get = py_svcctl_OpenServiceW_get_result,
16674 : .set = py_svcctl_OpenServiceW_set_result,
16675 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
16676 : },
16677 : { .name = NULL }
16678 : };
16679 :
16680 0 : static PyObject *py_svcctl_OpenServiceW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16681 : {
16682 0 : PyObject *self = pytalloc_new(struct svcctl_OpenServiceW, type);
16683 0 : struct svcctl_OpenServiceW *_self = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(self);
16684 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16685 0 : _self->in.scmanager_handle = talloc_zero(mem_ctx, struct policy_handle);
16686 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
16687 0 : return self;
16688 : }
16689 :
16690 0 : static PyObject *py_svcctl_OpenServiceW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16691 : {
16692 :
16693 :
16694 0 : return PyLong_FromLong(16);
16695 : }
16696 :
16697 0 : static PyObject *py_svcctl_OpenServiceW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16698 : {
16699 0 : const struct ndr_interface_call *call = NULL;
16700 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16701 0 : PyObject *ret = NULL;
16702 0 : struct ndr_push *push = NULL;
16703 0 : DATA_BLOB blob;
16704 0 : enum ndr_err_code err;
16705 :
16706 0 : if (ndr_table_svcctl.num_calls < 17) {
16707 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceW_ndr_pack");
16708 0 : return NULL;
16709 : }
16710 0 : call = &ndr_table_svcctl.calls[16];
16711 :
16712 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16713 0 : if (push == NULL) {
16714 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16715 0 : return NULL;
16716 : }
16717 :
16718 0 : push->flags |= ndr_push_flags;
16719 :
16720 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16721 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16722 0 : TALLOC_FREE(push);
16723 0 : PyErr_SetNdrError(err);
16724 0 : return NULL;
16725 : }
16726 0 : blob = ndr_push_blob(push);
16727 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16728 0 : TALLOC_FREE(push);
16729 0 : return ret;
16730 : }
16731 :
16732 0 : static PyObject *py_svcctl_OpenServiceW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16733 : {
16734 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16735 0 : PyObject *bigendian_obj = NULL;
16736 0 : PyObject *ndr64_obj = NULL;
16737 0 : libndr_flags ndr_push_flags = 0;
16738 :
16739 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16740 : discard_const_p(char *, kwnames),
16741 : &bigendian_obj,
16742 : &ndr64_obj)) {
16743 0 : return NULL;
16744 : }
16745 :
16746 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16747 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16748 : }
16749 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16750 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16751 : }
16752 :
16753 0 : return py_svcctl_OpenServiceW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16754 : }
16755 :
16756 0 : static PyObject *py_svcctl_OpenServiceW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16757 : {
16758 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16759 0 : PyObject *bigendian_obj = NULL;
16760 0 : PyObject *ndr64_obj = NULL;
16761 0 : libndr_flags ndr_push_flags = 0;
16762 :
16763 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16764 : discard_const_p(char *, kwnames),
16765 : &bigendian_obj,
16766 : &ndr64_obj)) {
16767 0 : return NULL;
16768 : }
16769 :
16770 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16771 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16772 : }
16773 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16774 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16775 : }
16776 :
16777 0 : return py_svcctl_OpenServiceW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16778 : }
16779 :
16780 0 : static PyObject *py_svcctl_OpenServiceW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
16781 : {
16782 0 : const struct ndr_interface_call *call = NULL;
16783 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16784 0 : struct ndr_pull *pull = NULL;
16785 0 : enum ndr_err_code err;
16786 :
16787 0 : if (ndr_table_svcctl.num_calls < 17) {
16788 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceW_ndr_unpack");
16789 0 : return NULL;
16790 : }
16791 0 : call = &ndr_table_svcctl.calls[16];
16792 :
16793 0 : pull = ndr_pull_init_blob(blob, object);
16794 0 : if (pull == NULL) {
16795 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16796 0 : return NULL;
16797 : }
16798 :
16799 0 : pull->flags |= ndr_pull_flags;
16800 :
16801 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16802 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16803 0 : TALLOC_FREE(pull);
16804 0 : PyErr_SetNdrError(err);
16805 0 : return NULL;
16806 : }
16807 0 : if (!allow_remaining) {
16808 0 : uint32_t highest_ofs;
16809 :
16810 0 : if (pull->offset > pull->relative_highest_offset) {
16811 0 : highest_ofs = pull->offset;
16812 : } else {
16813 0 : highest_ofs = pull->relative_highest_offset;
16814 : }
16815 0 : if (highest_ofs < pull->data_size) {
16816 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16817 : "not all bytes consumed ofs[%u] size[%u]",
16818 : highest_ofs, pull->data_size);
16819 0 : TALLOC_FREE(pull);
16820 0 : PyErr_SetNdrError(err);
16821 0 : return NULL;
16822 : }
16823 : }
16824 :
16825 0 : TALLOC_FREE(pull);
16826 0 : Py_RETURN_NONE;
16827 : }
16828 :
16829 0 : static PyObject *py_svcctl_OpenServiceW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16830 : {
16831 0 : DATA_BLOB blob;
16832 0 : Py_ssize_t blob_length = 0;
16833 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16834 0 : PyObject *bigendian_obj = NULL;
16835 0 : PyObject *ndr64_obj = NULL;
16836 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16837 0 : PyObject *allow_remaining_obj = NULL;
16838 0 : bool allow_remaining = false;
16839 :
16840 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16841 : discard_const_p(char *, kwnames),
16842 : &blob.data, &blob_length,
16843 : &bigendian_obj,
16844 : &ndr64_obj,
16845 : &allow_remaining_obj)) {
16846 0 : return NULL;
16847 : }
16848 0 : blob.length = blob_length;
16849 :
16850 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16851 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16852 : }
16853 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16854 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16855 : }
16856 :
16857 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16858 0 : allow_remaining = true;
16859 : }
16860 :
16861 0 : return py_svcctl_OpenServiceW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16862 : }
16863 :
16864 0 : static PyObject *py_svcctl_OpenServiceW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16865 : {
16866 0 : DATA_BLOB blob;
16867 0 : Py_ssize_t blob_length = 0;
16868 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16869 0 : PyObject *bigendian_obj = NULL;
16870 0 : PyObject *ndr64_obj = NULL;
16871 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16872 0 : PyObject *allow_remaining_obj = NULL;
16873 0 : bool allow_remaining = false;
16874 :
16875 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16876 : discard_const_p(char *, kwnames),
16877 : &blob.data, &blob_length,
16878 : &bigendian_obj,
16879 : &ndr64_obj,
16880 : &allow_remaining_obj)) {
16881 0 : return NULL;
16882 : }
16883 0 : blob.length = blob_length;
16884 :
16885 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16886 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16887 : }
16888 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16889 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16890 : }
16891 :
16892 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16893 0 : allow_remaining = true;
16894 : }
16895 :
16896 0 : return py_svcctl_OpenServiceW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16897 : }
16898 :
16899 0 : static PyObject *py_svcctl_OpenServiceW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16900 : {
16901 0 : const struct ndr_interface_call *call = NULL;
16902 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
16903 0 : PyObject *ret;
16904 0 : char *retstr;
16905 :
16906 0 : if (ndr_table_svcctl.num_calls < 17) {
16907 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceW_ndr_print");
16908 0 : return NULL;
16909 : }
16910 0 : call = &ndr_table_svcctl.calls[16];
16911 :
16912 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16913 0 : ret = PyUnicode_FromString(retstr);
16914 0 : TALLOC_FREE(retstr);
16915 :
16916 0 : return ret;
16917 : }
16918 :
16919 0 : static PyObject *py_svcctl_OpenServiceW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16920 : {
16921 0 : return py_svcctl_OpenServiceW_ndr_print(py_obj, "svcctl_OpenServiceW_in", NDR_IN);
16922 : }
16923 :
16924 0 : static PyObject *py_svcctl_OpenServiceW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16925 : {
16926 0 : return py_svcctl_OpenServiceW_ndr_print(py_obj, "svcctl_OpenServiceW_out", NDR_OUT);
16927 : }
16928 :
16929 : static PyMethodDef py_svcctl_OpenServiceW_methods[] = {
16930 : { "opnum", (PyCFunction)py_svcctl_OpenServiceW_ndr_opnum, METH_NOARGS|METH_CLASS,
16931 : "svcctl.OpenServiceW.opnum() -> 16 (0x10) " },
16932 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16933 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16934 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16935 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16936 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16937 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16938 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16939 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16940 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenServiceW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16941 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenServiceW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16942 : { NULL, NULL, 0, NULL }
16943 : };
16944 :
16945 :
16946 : static PyTypeObject svcctl_OpenServiceW_Type = {
16947 : PyVarObject_HEAD_INIT(NULL, 0)
16948 : .tp_name = "svcctl.OpenServiceW",
16949 : .tp_getset = py_svcctl_OpenServiceW_getsetters,
16950 : .tp_methods = py_svcctl_OpenServiceW_methods,
16951 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16952 : .tp_new = py_svcctl_OpenServiceW_new,
16953 : };
16954 :
16955 0 : static bool pack_py_svcctl_OpenServiceW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenServiceW *r)
16956 : {
16957 0 : PyObject *py_scmanager_handle;
16958 0 : PyObject *py_ServiceName;
16959 0 : PyObject *py_access_mask;
16960 0 : const char *kwnames[] = {
16961 : "scmanager_handle", "ServiceName", "access_mask", NULL
16962 : };
16963 :
16964 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenServiceW", discard_const_p(char *, kwnames), &py_scmanager_handle, &py_ServiceName, &py_access_mask)) {
16965 0 : return false;
16966 : }
16967 :
16968 0 : if (py_scmanager_handle == NULL) {
16969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager_handle");
16970 0 : return false;
16971 : }
16972 0 : r->in.scmanager_handle = talloc_ptrtype(r, r->in.scmanager_handle);
16973 0 : if (r->in.scmanager_handle == NULL) {
16974 0 : PyErr_NoMemory();
16975 0 : return false;
16976 : }
16977 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager_handle, return false;);
16978 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager_handle)) == NULL) {
16979 0 : PyErr_NoMemory();
16980 0 : return false;
16981 : }
16982 0 : r->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(py_scmanager_handle);
16983 0 : if (py_ServiceName == NULL) {
16984 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
16985 0 : return false;
16986 : }
16987 : {
16988 0 : const char *test_str;
16989 0 : const char *talloc_str;
16990 0 : PyObject *unicode = NULL;
16991 0 : if (PyUnicode_Check(py_ServiceName)) {
16992 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
16993 0 : if (unicode == NULL) {
16994 0 : return false;
16995 : }
16996 0 : test_str = PyBytes_AS_STRING(unicode);
16997 0 : } else if (PyBytes_Check(py_ServiceName)) {
16998 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
16999 : } else {
17000 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
17001 0 : return false;
17002 : }
17003 0 : talloc_str = talloc_strdup(r, test_str);
17004 0 : if (unicode != NULL) {
17005 0 : Py_DECREF(unicode);
17006 : }
17007 0 : if (talloc_str == NULL) {
17008 0 : PyErr_NoMemory();
17009 0 : return false;
17010 : }
17011 0 : r->in.ServiceName = talloc_str;
17012 : }
17013 0 : if (py_access_mask == NULL) {
17014 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
17015 0 : return false;
17016 : }
17017 : {
17018 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
17019 0 : if (PyLong_Check(py_access_mask)) {
17020 0 : unsigned long long test_var;
17021 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
17022 0 : if (PyErr_Occurred() != NULL) {
17023 0 : return false;
17024 : }
17025 0 : if (test_var > uint_max) {
17026 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17027 : PyLong_Type.tp_name, uint_max, test_var);
17028 0 : return false;
17029 : }
17030 0 : r->in.access_mask = test_var;
17031 : } else {
17032 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17033 : PyLong_Type.tp_name);
17034 0 : return false;
17035 : }
17036 : }
17037 0 : return true;
17038 : }
17039 :
17040 0 : static PyObject *unpack_py_svcctl_OpenServiceW_args_out(struct svcctl_OpenServiceW *r)
17041 : {
17042 0 : PyObject *result;
17043 0 : PyObject *py_handle;
17044 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
17045 0 : result = py_handle;
17046 0 : if (!W_ERROR_IS_OK(r->out.result)) {
17047 0 : PyErr_SetWERROR(r->out.result);
17048 0 : return NULL;
17049 : }
17050 :
17051 0 : return result;
17052 : }
17053 :
17054 :
17055 0 : static PyObject *py_svcctl_QueryServiceConfigW_in_get_handle(PyObject *obj, void *closure)
17056 : {
17057 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
17058 0 : PyObject *py_handle;
17059 0 : if (object->in.handle == NULL) {
17060 0 : Py_RETURN_NONE;
17061 : }
17062 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
17063 0 : return py_handle;
17064 : }
17065 :
17066 0 : static int py_svcctl_QueryServiceConfigW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
17067 : {
17068 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17069 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
17070 0 : if (value == NULL) {
17071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
17072 0 : return -1;
17073 : }
17074 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
17075 0 : if (object->in.handle == NULL) {
17076 0 : PyErr_NoMemory();
17077 0 : return -1;
17078 : }
17079 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17080 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17081 0 : PyErr_NoMemory();
17082 0 : return -1;
17083 : }
17084 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
17085 0 : return 0;
17086 : }
17087 :
17088 0 : static PyObject *py_svcctl_QueryServiceConfigW_out_get_query(PyObject *obj, void *closure)
17089 : {
17090 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
17091 0 : PyObject *py_query;
17092 0 : if (object->out.query == NULL) {
17093 0 : Py_RETURN_NONE;
17094 : }
17095 0 : py_query = pytalloc_reference_ex(&QUERY_SERVICE_CONFIG_Type, object->out.query, object->out.query);
17096 0 : return py_query;
17097 : }
17098 :
17099 0 : static int py_svcctl_QueryServiceConfigW_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
17100 : {
17101 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17102 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query));
17103 0 : if (value == NULL) {
17104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
17105 0 : return -1;
17106 : }
17107 0 : object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query);
17108 0 : if (object->out.query == NULL) {
17109 0 : PyErr_NoMemory();
17110 0 : return -1;
17111 : }
17112 0 : PY_CHECK_TYPE(&QUERY_SERVICE_CONFIG_Type, value, return -1;);
17113 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17114 0 : PyErr_NoMemory();
17115 0 : return -1;
17116 : }
17117 0 : object->out.query = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(value);
17118 0 : return 0;
17119 : }
17120 :
17121 0 : static PyObject *py_svcctl_QueryServiceConfigW_in_get_offered(PyObject *obj, void *closure)
17122 : {
17123 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
17124 0 : PyObject *py_offered;
17125 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
17126 0 : return py_offered;
17127 : }
17128 :
17129 0 : static int py_svcctl_QueryServiceConfigW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
17130 : {
17131 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17132 0 : if (value == NULL) {
17133 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
17134 0 : return -1;
17135 : }
17136 : {
17137 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
17138 0 : if (PyLong_Check(value)) {
17139 0 : unsigned long long test_var;
17140 0 : test_var = PyLong_AsUnsignedLongLong(value);
17141 0 : if (PyErr_Occurred() != NULL) {
17142 0 : return -1;
17143 : }
17144 0 : if (test_var > uint_max) {
17145 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17146 : PyLong_Type.tp_name, uint_max, test_var);
17147 0 : return -1;
17148 : }
17149 0 : object->in.offered = test_var;
17150 : } else {
17151 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17152 : PyLong_Type.tp_name);
17153 0 : return -1;
17154 : }
17155 : }
17156 0 : return 0;
17157 : }
17158 :
17159 0 : static PyObject *py_svcctl_QueryServiceConfigW_out_get_needed(PyObject *obj, void *closure)
17160 : {
17161 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
17162 0 : PyObject *py_needed;
17163 0 : if (object->out.needed == NULL) {
17164 0 : Py_RETURN_NONE;
17165 : }
17166 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
17167 0 : return py_needed;
17168 : }
17169 :
17170 0 : static int py_svcctl_QueryServiceConfigW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
17171 : {
17172 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17173 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
17174 0 : if (value == NULL) {
17175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
17176 0 : return -1;
17177 : }
17178 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
17179 0 : if (object->out.needed == NULL) {
17180 0 : PyErr_NoMemory();
17181 0 : return -1;
17182 : }
17183 : {
17184 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
17185 0 : if (PyLong_Check(value)) {
17186 0 : unsigned long long test_var;
17187 0 : test_var = PyLong_AsUnsignedLongLong(value);
17188 0 : if (PyErr_Occurred() != NULL) {
17189 0 : return -1;
17190 : }
17191 0 : if (test_var > uint_max) {
17192 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17193 : PyLong_Type.tp_name, uint_max, test_var);
17194 0 : return -1;
17195 : }
17196 0 : *object->out.needed = test_var;
17197 : } else {
17198 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17199 : PyLong_Type.tp_name);
17200 0 : return -1;
17201 : }
17202 : }
17203 0 : return 0;
17204 : }
17205 :
17206 0 : static PyObject *py_svcctl_QueryServiceConfigW_get_result(PyObject *obj, void *closure)
17207 : {
17208 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
17209 0 : PyObject *py_result;
17210 0 : py_result = PyErr_FromWERROR(object->out.result);
17211 0 : return py_result;
17212 : }
17213 :
17214 0 : static int py_svcctl_QueryServiceConfigW_set_result(PyObject *py_obj, PyObject *value, void *closure)
17215 : {
17216 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17217 0 : if (value == NULL) {
17218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17219 0 : return -1;
17220 : }
17221 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
17222 0 : return 0;
17223 : }
17224 :
17225 : static PyGetSetDef py_svcctl_QueryServiceConfigW_getsetters[] = {
17226 : {
17227 : .name = discard_const_p(char, "in_handle"),
17228 : .get = py_svcctl_QueryServiceConfigW_in_get_handle,
17229 : .set = py_svcctl_QueryServiceConfigW_in_set_handle,
17230 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17231 : },
17232 : {
17233 : .name = discard_const_p(char, "out_query"),
17234 : .get = py_svcctl_QueryServiceConfigW_out_get_query,
17235 : .set = py_svcctl_QueryServiceConfigW_out_set_query,
17236 : .doc = discard_const_p(char, "PIDL-generated element of base type QUERY_SERVICE_CONFIG")
17237 : },
17238 : {
17239 : .name = discard_const_p(char, "in_offered"),
17240 : .get = py_svcctl_QueryServiceConfigW_in_get_offered,
17241 : .set = py_svcctl_QueryServiceConfigW_in_set_offered,
17242 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17243 : },
17244 : {
17245 : .name = discard_const_p(char, "out_needed"),
17246 : .get = py_svcctl_QueryServiceConfigW_out_get_needed,
17247 : .set = py_svcctl_QueryServiceConfigW_out_set_needed,
17248 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17249 : },
17250 : {
17251 : .name = discard_const_p(char, "result"),
17252 : .get = py_svcctl_QueryServiceConfigW_get_result,
17253 : .set = py_svcctl_QueryServiceConfigW_set_result,
17254 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
17255 : },
17256 : { .name = NULL }
17257 : };
17258 :
17259 0 : static PyObject *py_svcctl_QueryServiceConfigW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17260 : {
17261 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfigW, type);
17262 0 : struct svcctl_QueryServiceConfigW *_self = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(self);
17263 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17264 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
17265 0 : _self->out.query = talloc_zero(mem_ctx, struct QUERY_SERVICE_CONFIG);
17266 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
17267 0 : return self;
17268 : }
17269 :
17270 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17271 : {
17272 :
17273 :
17274 0 : return PyLong_FromLong(17);
17275 : }
17276 :
17277 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17278 : {
17279 0 : const struct ndr_interface_call *call = NULL;
17280 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17281 0 : PyObject *ret = NULL;
17282 0 : struct ndr_push *push = NULL;
17283 0 : DATA_BLOB blob;
17284 0 : enum ndr_err_code err;
17285 :
17286 0 : if (ndr_table_svcctl.num_calls < 18) {
17287 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigW_ndr_pack");
17288 0 : return NULL;
17289 : }
17290 0 : call = &ndr_table_svcctl.calls[17];
17291 :
17292 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17293 0 : if (push == NULL) {
17294 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17295 0 : return NULL;
17296 : }
17297 :
17298 0 : push->flags |= ndr_push_flags;
17299 :
17300 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17301 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17302 0 : TALLOC_FREE(push);
17303 0 : PyErr_SetNdrError(err);
17304 0 : return NULL;
17305 : }
17306 0 : blob = ndr_push_blob(push);
17307 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17308 0 : TALLOC_FREE(push);
17309 0 : return ret;
17310 : }
17311 :
17312 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17313 : {
17314 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17315 0 : PyObject *bigendian_obj = NULL;
17316 0 : PyObject *ndr64_obj = NULL;
17317 0 : libndr_flags ndr_push_flags = 0;
17318 :
17319 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17320 : discard_const_p(char *, kwnames),
17321 : &bigendian_obj,
17322 : &ndr64_obj)) {
17323 0 : return NULL;
17324 : }
17325 :
17326 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17327 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17328 : }
17329 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17330 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17331 : }
17332 :
17333 0 : return py_svcctl_QueryServiceConfigW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17334 : }
17335 :
17336 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17337 : {
17338 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17339 0 : PyObject *bigendian_obj = NULL;
17340 0 : PyObject *ndr64_obj = NULL;
17341 0 : libndr_flags ndr_push_flags = 0;
17342 :
17343 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17344 : discard_const_p(char *, kwnames),
17345 : &bigendian_obj,
17346 : &ndr64_obj)) {
17347 0 : return NULL;
17348 : }
17349 :
17350 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17351 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17352 : }
17353 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17354 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17355 : }
17356 :
17357 0 : return py_svcctl_QueryServiceConfigW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17358 : }
17359 :
17360 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
17361 : {
17362 0 : const struct ndr_interface_call *call = NULL;
17363 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17364 0 : struct ndr_pull *pull = NULL;
17365 0 : enum ndr_err_code err;
17366 :
17367 0 : if (ndr_table_svcctl.num_calls < 18) {
17368 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigW_ndr_unpack");
17369 0 : return NULL;
17370 : }
17371 0 : call = &ndr_table_svcctl.calls[17];
17372 :
17373 0 : pull = ndr_pull_init_blob(blob, object);
17374 0 : if (pull == NULL) {
17375 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17376 0 : return NULL;
17377 : }
17378 :
17379 0 : pull->flags |= ndr_pull_flags;
17380 :
17381 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17382 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17383 0 : TALLOC_FREE(pull);
17384 0 : PyErr_SetNdrError(err);
17385 0 : return NULL;
17386 : }
17387 0 : if (!allow_remaining) {
17388 0 : uint32_t highest_ofs;
17389 :
17390 0 : if (pull->offset > pull->relative_highest_offset) {
17391 0 : highest_ofs = pull->offset;
17392 : } else {
17393 0 : highest_ofs = pull->relative_highest_offset;
17394 : }
17395 0 : if (highest_ofs < pull->data_size) {
17396 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17397 : "not all bytes consumed ofs[%u] size[%u]",
17398 : highest_ofs, pull->data_size);
17399 0 : TALLOC_FREE(pull);
17400 0 : PyErr_SetNdrError(err);
17401 0 : return NULL;
17402 : }
17403 : }
17404 :
17405 0 : TALLOC_FREE(pull);
17406 0 : Py_RETURN_NONE;
17407 : }
17408 :
17409 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17410 : {
17411 0 : DATA_BLOB blob;
17412 0 : Py_ssize_t blob_length = 0;
17413 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17414 0 : PyObject *bigendian_obj = NULL;
17415 0 : PyObject *ndr64_obj = NULL;
17416 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17417 0 : PyObject *allow_remaining_obj = NULL;
17418 0 : bool allow_remaining = false;
17419 :
17420 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17421 : discard_const_p(char *, kwnames),
17422 : &blob.data, &blob_length,
17423 : &bigendian_obj,
17424 : &ndr64_obj,
17425 : &allow_remaining_obj)) {
17426 0 : return NULL;
17427 : }
17428 0 : blob.length = blob_length;
17429 :
17430 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17431 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17432 : }
17433 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17434 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17435 : }
17436 :
17437 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17438 0 : allow_remaining = true;
17439 : }
17440 :
17441 0 : return py_svcctl_QueryServiceConfigW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17442 : }
17443 :
17444 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17445 : {
17446 0 : DATA_BLOB blob;
17447 0 : Py_ssize_t blob_length = 0;
17448 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17449 0 : PyObject *bigendian_obj = NULL;
17450 0 : PyObject *ndr64_obj = NULL;
17451 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17452 0 : PyObject *allow_remaining_obj = NULL;
17453 0 : bool allow_remaining = false;
17454 :
17455 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17456 : discard_const_p(char *, kwnames),
17457 : &blob.data, &blob_length,
17458 : &bigendian_obj,
17459 : &ndr64_obj,
17460 : &allow_remaining_obj)) {
17461 0 : return NULL;
17462 : }
17463 0 : blob.length = blob_length;
17464 :
17465 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17466 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17467 : }
17468 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17469 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17470 : }
17471 :
17472 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17473 0 : allow_remaining = true;
17474 : }
17475 :
17476 0 : return py_svcctl_QueryServiceConfigW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17477 : }
17478 :
17479 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17480 : {
17481 0 : const struct ndr_interface_call *call = NULL;
17482 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
17483 0 : PyObject *ret;
17484 0 : char *retstr;
17485 :
17486 0 : if (ndr_table_svcctl.num_calls < 18) {
17487 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigW_ndr_print");
17488 0 : return NULL;
17489 : }
17490 0 : call = &ndr_table_svcctl.calls[17];
17491 :
17492 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17493 0 : ret = PyUnicode_FromString(retstr);
17494 0 : TALLOC_FREE(retstr);
17495 :
17496 0 : return ret;
17497 : }
17498 :
17499 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17500 : {
17501 0 : return py_svcctl_QueryServiceConfigW_ndr_print(py_obj, "svcctl_QueryServiceConfigW_in", NDR_IN);
17502 : }
17503 :
17504 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17505 : {
17506 0 : return py_svcctl_QueryServiceConfigW_ndr_print(py_obj, "svcctl_QueryServiceConfigW_out", NDR_OUT);
17507 : }
17508 :
17509 : static PyMethodDef py_svcctl_QueryServiceConfigW_methods[] = {
17510 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfigW_ndr_opnum, METH_NOARGS|METH_CLASS,
17511 : "svcctl.QueryServiceConfigW.opnum() -> 17 (0x11) " },
17512 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17513 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17514 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17515 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17516 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17517 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17518 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17519 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17520 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfigW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17521 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfigW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17522 : { NULL, NULL, 0, NULL }
17523 : };
17524 :
17525 :
17526 : static PyTypeObject svcctl_QueryServiceConfigW_Type = {
17527 : PyVarObject_HEAD_INIT(NULL, 0)
17528 : .tp_name = "svcctl.QueryServiceConfigW",
17529 : .tp_getset = py_svcctl_QueryServiceConfigW_getsetters,
17530 : .tp_methods = py_svcctl_QueryServiceConfigW_methods,
17531 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17532 : .tp_new = py_svcctl_QueryServiceConfigW_new,
17533 : };
17534 :
17535 0 : static bool pack_py_svcctl_QueryServiceConfigW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfigW *r)
17536 : {
17537 0 : PyObject *py_handle;
17538 0 : PyObject *py_offered;
17539 0 : const char *kwnames[] = {
17540 : "handle", "offered", NULL
17541 : };
17542 :
17543 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceConfigW", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
17544 0 : return false;
17545 : }
17546 :
17547 0 : if (py_handle == NULL) {
17548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
17549 0 : return false;
17550 : }
17551 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
17552 0 : if (r->in.handle == NULL) {
17553 0 : PyErr_NoMemory();
17554 0 : return false;
17555 : }
17556 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
17557 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
17558 0 : PyErr_NoMemory();
17559 0 : return false;
17560 : }
17561 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
17562 0 : if (py_offered == NULL) {
17563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
17564 0 : return false;
17565 : }
17566 : {
17567 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
17568 0 : if (PyLong_Check(py_offered)) {
17569 0 : unsigned long long test_var;
17570 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
17571 0 : if (PyErr_Occurred() != NULL) {
17572 0 : return false;
17573 : }
17574 0 : if (test_var > uint_max) {
17575 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17576 : PyLong_Type.tp_name, uint_max, test_var);
17577 0 : return false;
17578 : }
17579 0 : r->in.offered = test_var;
17580 : } else {
17581 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17582 : PyLong_Type.tp_name);
17583 0 : return false;
17584 : }
17585 : }
17586 0 : return true;
17587 : }
17588 :
17589 0 : static PyObject *unpack_py_svcctl_QueryServiceConfigW_args_out(struct svcctl_QueryServiceConfigW *r)
17590 : {
17591 0 : PyObject *result;
17592 0 : PyObject *py_query;
17593 0 : PyObject *py_needed;
17594 0 : result = PyTuple_New(2);
17595 0 : py_query = pytalloc_reference_ex(&QUERY_SERVICE_CONFIG_Type, r->out.query, r->out.query);
17596 0 : PyTuple_SetItem(result, 0, py_query);
17597 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
17598 0 : PyTuple_SetItem(result, 1, py_needed);
17599 0 : if (!W_ERROR_IS_OK(r->out.result)) {
17600 0 : PyErr_SetWERROR(r->out.result);
17601 0 : return NULL;
17602 : }
17603 :
17604 0 : return result;
17605 : }
17606 :
17607 :
17608 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_in_get_handle(PyObject *obj, void *closure)
17609 : {
17610 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
17611 0 : PyObject *py_handle;
17612 0 : if (object->in.handle == NULL) {
17613 0 : Py_RETURN_NONE;
17614 : }
17615 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
17616 0 : return py_handle;
17617 : }
17618 :
17619 0 : static int py_svcctl_QueryServiceLockStatusW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
17620 : {
17621 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
17622 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
17623 0 : if (value == NULL) {
17624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
17625 0 : return -1;
17626 : }
17627 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
17628 0 : if (object->in.handle == NULL) {
17629 0 : PyErr_NoMemory();
17630 0 : return -1;
17631 : }
17632 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17633 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17634 0 : PyErr_NoMemory();
17635 0 : return -1;
17636 : }
17637 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
17638 0 : return 0;
17639 : }
17640 :
17641 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_in_get_offered(PyObject *obj, void *closure)
17642 : {
17643 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
17644 0 : PyObject *py_offered;
17645 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
17646 0 : return py_offered;
17647 : }
17648 :
17649 0 : static int py_svcctl_QueryServiceLockStatusW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
17650 : {
17651 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
17652 0 : if (value == NULL) {
17653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
17654 0 : return -1;
17655 : }
17656 : {
17657 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
17658 0 : if (PyLong_Check(value)) {
17659 0 : unsigned long long test_var;
17660 0 : test_var = PyLong_AsUnsignedLongLong(value);
17661 0 : if (PyErr_Occurred() != NULL) {
17662 0 : return -1;
17663 : }
17664 0 : if (test_var > uint_max) {
17665 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17666 : PyLong_Type.tp_name, uint_max, test_var);
17667 0 : return -1;
17668 : }
17669 0 : object->in.offered = test_var;
17670 : } else {
17671 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17672 : PyLong_Type.tp_name);
17673 0 : return -1;
17674 : }
17675 : }
17676 0 : return 0;
17677 : }
17678 :
17679 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_out_get_lock_status(PyObject *obj, void *closure)
17680 : {
17681 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
17682 0 : PyObject *py_lock_status;
17683 0 : if (object->out.lock_status == NULL) {
17684 0 : Py_RETURN_NONE;
17685 : }
17686 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, object->out.lock_status, object->out.lock_status);
17687 0 : return py_lock_status;
17688 : }
17689 :
17690 0 : static int py_svcctl_QueryServiceLockStatusW_out_set_lock_status(PyObject *py_obj, PyObject *value, void *closure)
17691 : {
17692 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
17693 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock_status));
17694 0 : if (value == NULL) {
17695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock_status");
17696 0 : return -1;
17697 : }
17698 0 : object->out.lock_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock_status);
17699 0 : if (object->out.lock_status == NULL) {
17700 0 : PyErr_NoMemory();
17701 0 : return -1;
17702 : }
17703 0 : PY_CHECK_TYPE(&SERVICE_LOCK_STATUS_Type, value, return -1;);
17704 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17705 0 : PyErr_NoMemory();
17706 0 : return -1;
17707 : }
17708 0 : object->out.lock_status = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(value);
17709 0 : return 0;
17710 : }
17711 :
17712 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_out_get_needed(PyObject *obj, void *closure)
17713 : {
17714 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
17715 0 : PyObject *py_needed;
17716 0 : if (object->out.needed == NULL) {
17717 0 : Py_RETURN_NONE;
17718 : }
17719 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
17720 0 : return py_needed;
17721 : }
17722 :
17723 0 : static int py_svcctl_QueryServiceLockStatusW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
17724 : {
17725 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
17726 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
17727 0 : if (value == NULL) {
17728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
17729 0 : return -1;
17730 : }
17731 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
17732 0 : if (object->out.needed == NULL) {
17733 0 : PyErr_NoMemory();
17734 0 : return -1;
17735 : }
17736 : {
17737 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
17738 0 : if (PyLong_Check(value)) {
17739 0 : unsigned long long test_var;
17740 0 : test_var = PyLong_AsUnsignedLongLong(value);
17741 0 : if (PyErr_Occurred() != NULL) {
17742 0 : return -1;
17743 : }
17744 0 : if (test_var > uint_max) {
17745 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17746 : PyLong_Type.tp_name, uint_max, test_var);
17747 0 : return -1;
17748 : }
17749 0 : *object->out.needed = test_var;
17750 : } else {
17751 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17752 : PyLong_Type.tp_name);
17753 0 : return -1;
17754 : }
17755 : }
17756 0 : return 0;
17757 : }
17758 :
17759 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_get_result(PyObject *obj, void *closure)
17760 : {
17761 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
17762 0 : PyObject *py_result;
17763 0 : py_result = PyErr_FromWERROR(object->out.result);
17764 0 : return py_result;
17765 : }
17766 :
17767 0 : static int py_svcctl_QueryServiceLockStatusW_set_result(PyObject *py_obj, PyObject *value, void *closure)
17768 : {
17769 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
17770 0 : if (value == NULL) {
17771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17772 0 : return -1;
17773 : }
17774 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
17775 0 : return 0;
17776 : }
17777 :
17778 : static PyGetSetDef py_svcctl_QueryServiceLockStatusW_getsetters[] = {
17779 : {
17780 : .name = discard_const_p(char, "in_handle"),
17781 : .get = py_svcctl_QueryServiceLockStatusW_in_get_handle,
17782 : .set = py_svcctl_QueryServiceLockStatusW_in_set_handle,
17783 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17784 : },
17785 : {
17786 : .name = discard_const_p(char, "in_offered"),
17787 : .get = py_svcctl_QueryServiceLockStatusW_in_get_offered,
17788 : .set = py_svcctl_QueryServiceLockStatusW_in_set_offered,
17789 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17790 : },
17791 : {
17792 : .name = discard_const_p(char, "out_lock_status"),
17793 : .get = py_svcctl_QueryServiceLockStatusW_out_get_lock_status,
17794 : .set = py_svcctl_QueryServiceLockStatusW_out_set_lock_status,
17795 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_LOCK_STATUS")
17796 : },
17797 : {
17798 : .name = discard_const_p(char, "out_needed"),
17799 : .get = py_svcctl_QueryServiceLockStatusW_out_get_needed,
17800 : .set = py_svcctl_QueryServiceLockStatusW_out_set_needed,
17801 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17802 : },
17803 : {
17804 : .name = discard_const_p(char, "result"),
17805 : .get = py_svcctl_QueryServiceLockStatusW_get_result,
17806 : .set = py_svcctl_QueryServiceLockStatusW_set_result,
17807 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
17808 : },
17809 : { .name = NULL }
17810 : };
17811 :
17812 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17813 : {
17814 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceLockStatusW, type);
17815 0 : struct svcctl_QueryServiceLockStatusW *_self = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(self);
17816 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17817 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
17818 0 : _self->out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
17819 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
17820 0 : return self;
17821 : }
17822 :
17823 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17824 : {
17825 :
17826 :
17827 0 : return PyLong_FromLong(18);
17828 : }
17829 :
17830 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17831 : {
17832 0 : const struct ndr_interface_call *call = NULL;
17833 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
17834 0 : PyObject *ret = NULL;
17835 0 : struct ndr_push *push = NULL;
17836 0 : DATA_BLOB blob;
17837 0 : enum ndr_err_code err;
17838 :
17839 0 : if (ndr_table_svcctl.num_calls < 19) {
17840 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusW_ndr_pack");
17841 0 : return NULL;
17842 : }
17843 0 : call = &ndr_table_svcctl.calls[18];
17844 :
17845 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17846 0 : if (push == NULL) {
17847 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17848 0 : return NULL;
17849 : }
17850 :
17851 0 : push->flags |= ndr_push_flags;
17852 :
17853 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17854 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17855 0 : TALLOC_FREE(push);
17856 0 : PyErr_SetNdrError(err);
17857 0 : return NULL;
17858 : }
17859 0 : blob = ndr_push_blob(push);
17860 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17861 0 : TALLOC_FREE(push);
17862 0 : return ret;
17863 : }
17864 :
17865 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17866 : {
17867 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17868 0 : PyObject *bigendian_obj = NULL;
17869 0 : PyObject *ndr64_obj = NULL;
17870 0 : libndr_flags ndr_push_flags = 0;
17871 :
17872 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17873 : discard_const_p(char *, kwnames),
17874 : &bigendian_obj,
17875 : &ndr64_obj)) {
17876 0 : return NULL;
17877 : }
17878 :
17879 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17880 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17881 : }
17882 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17883 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17884 : }
17885 :
17886 0 : return py_svcctl_QueryServiceLockStatusW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17887 : }
17888 :
17889 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17890 : {
17891 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17892 0 : PyObject *bigendian_obj = NULL;
17893 0 : PyObject *ndr64_obj = NULL;
17894 0 : libndr_flags ndr_push_flags = 0;
17895 :
17896 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17897 : discard_const_p(char *, kwnames),
17898 : &bigendian_obj,
17899 : &ndr64_obj)) {
17900 0 : return NULL;
17901 : }
17902 :
17903 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17904 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17905 : }
17906 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17907 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17908 : }
17909 :
17910 0 : return py_svcctl_QueryServiceLockStatusW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17911 : }
17912 :
17913 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
17914 : {
17915 0 : const struct ndr_interface_call *call = NULL;
17916 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
17917 0 : struct ndr_pull *pull = NULL;
17918 0 : enum ndr_err_code err;
17919 :
17920 0 : if (ndr_table_svcctl.num_calls < 19) {
17921 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusW_ndr_unpack");
17922 0 : return NULL;
17923 : }
17924 0 : call = &ndr_table_svcctl.calls[18];
17925 :
17926 0 : pull = ndr_pull_init_blob(blob, object);
17927 0 : if (pull == NULL) {
17928 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17929 0 : return NULL;
17930 : }
17931 :
17932 0 : pull->flags |= ndr_pull_flags;
17933 :
17934 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17935 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17936 0 : TALLOC_FREE(pull);
17937 0 : PyErr_SetNdrError(err);
17938 0 : return NULL;
17939 : }
17940 0 : if (!allow_remaining) {
17941 0 : uint32_t highest_ofs;
17942 :
17943 0 : if (pull->offset > pull->relative_highest_offset) {
17944 0 : highest_ofs = pull->offset;
17945 : } else {
17946 0 : highest_ofs = pull->relative_highest_offset;
17947 : }
17948 0 : if (highest_ofs < pull->data_size) {
17949 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17950 : "not all bytes consumed ofs[%u] size[%u]",
17951 : highest_ofs, pull->data_size);
17952 0 : TALLOC_FREE(pull);
17953 0 : PyErr_SetNdrError(err);
17954 0 : return NULL;
17955 : }
17956 : }
17957 :
17958 0 : TALLOC_FREE(pull);
17959 0 : Py_RETURN_NONE;
17960 : }
17961 :
17962 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17963 : {
17964 0 : DATA_BLOB blob;
17965 0 : Py_ssize_t blob_length = 0;
17966 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17967 0 : PyObject *bigendian_obj = NULL;
17968 0 : PyObject *ndr64_obj = NULL;
17969 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17970 0 : PyObject *allow_remaining_obj = NULL;
17971 0 : bool allow_remaining = false;
17972 :
17973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17974 : discard_const_p(char *, kwnames),
17975 : &blob.data, &blob_length,
17976 : &bigendian_obj,
17977 : &ndr64_obj,
17978 : &allow_remaining_obj)) {
17979 0 : return NULL;
17980 : }
17981 0 : blob.length = blob_length;
17982 :
17983 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17984 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17985 : }
17986 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17987 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17988 : }
17989 :
17990 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17991 0 : allow_remaining = true;
17992 : }
17993 :
17994 0 : return py_svcctl_QueryServiceLockStatusW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17995 : }
17996 :
17997 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17998 : {
17999 0 : DATA_BLOB blob;
18000 0 : Py_ssize_t blob_length = 0;
18001 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18002 0 : PyObject *bigendian_obj = NULL;
18003 0 : PyObject *ndr64_obj = NULL;
18004 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18005 0 : PyObject *allow_remaining_obj = NULL;
18006 0 : bool allow_remaining = false;
18007 :
18008 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18009 : discard_const_p(char *, kwnames),
18010 : &blob.data, &blob_length,
18011 : &bigendian_obj,
18012 : &ndr64_obj,
18013 : &allow_remaining_obj)) {
18014 0 : return NULL;
18015 : }
18016 0 : blob.length = blob_length;
18017 :
18018 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18019 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18020 : }
18021 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18022 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18023 : }
18024 :
18025 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18026 0 : allow_remaining = true;
18027 : }
18028 :
18029 0 : return py_svcctl_QueryServiceLockStatusW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18030 : }
18031 :
18032 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
18033 : {
18034 0 : const struct ndr_interface_call *call = NULL;
18035 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
18036 0 : PyObject *ret;
18037 0 : char *retstr;
18038 :
18039 0 : if (ndr_table_svcctl.num_calls < 19) {
18040 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusW_ndr_print");
18041 0 : return NULL;
18042 : }
18043 0 : call = &ndr_table_svcctl.calls[18];
18044 :
18045 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18046 0 : ret = PyUnicode_FromString(retstr);
18047 0 : TALLOC_FREE(retstr);
18048 :
18049 0 : return ret;
18050 : }
18051 :
18052 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18053 : {
18054 0 : return py_svcctl_QueryServiceLockStatusW_ndr_print(py_obj, "svcctl_QueryServiceLockStatusW_in", NDR_IN);
18055 : }
18056 :
18057 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18058 : {
18059 0 : return py_svcctl_QueryServiceLockStatusW_ndr_print(py_obj, "svcctl_QueryServiceLockStatusW_out", NDR_OUT);
18060 : }
18061 :
18062 : static PyMethodDef py_svcctl_QueryServiceLockStatusW_methods[] = {
18063 : { "opnum", (PyCFunction)py_svcctl_QueryServiceLockStatusW_ndr_opnum, METH_NOARGS|METH_CLASS,
18064 : "svcctl.QueryServiceLockStatusW.opnum() -> 18 (0x12) " },
18065 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18066 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18067 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18068 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18069 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18070 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18071 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18072 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18073 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceLockStatusW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18074 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceLockStatusW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18075 : { NULL, NULL, 0, NULL }
18076 : };
18077 :
18078 :
18079 : static PyTypeObject svcctl_QueryServiceLockStatusW_Type = {
18080 : PyVarObject_HEAD_INIT(NULL, 0)
18081 : .tp_name = "svcctl.QueryServiceLockStatusW",
18082 : .tp_getset = py_svcctl_QueryServiceLockStatusW_getsetters,
18083 : .tp_methods = py_svcctl_QueryServiceLockStatusW_methods,
18084 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18085 : .tp_new = py_svcctl_QueryServiceLockStatusW_new,
18086 : };
18087 :
18088 0 : static bool pack_py_svcctl_QueryServiceLockStatusW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceLockStatusW *r)
18089 : {
18090 0 : PyObject *py_handle;
18091 0 : PyObject *py_offered;
18092 0 : const char *kwnames[] = {
18093 : "handle", "offered", NULL
18094 : };
18095 :
18096 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceLockStatusW", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
18097 0 : return false;
18098 : }
18099 :
18100 0 : if (py_handle == NULL) {
18101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
18102 0 : return false;
18103 : }
18104 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
18105 0 : if (r->in.handle == NULL) {
18106 0 : PyErr_NoMemory();
18107 0 : return false;
18108 : }
18109 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
18110 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
18111 0 : PyErr_NoMemory();
18112 0 : return false;
18113 : }
18114 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
18115 0 : if (py_offered == NULL) {
18116 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
18117 0 : return false;
18118 : }
18119 : {
18120 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
18121 0 : if (PyLong_Check(py_offered)) {
18122 0 : unsigned long long test_var;
18123 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
18124 0 : if (PyErr_Occurred() != NULL) {
18125 0 : return false;
18126 : }
18127 0 : if (test_var > uint_max) {
18128 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18129 : PyLong_Type.tp_name, uint_max, test_var);
18130 0 : return false;
18131 : }
18132 0 : r->in.offered = test_var;
18133 : } else {
18134 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18135 : PyLong_Type.tp_name);
18136 0 : return false;
18137 : }
18138 : }
18139 0 : return true;
18140 : }
18141 :
18142 0 : static PyObject *unpack_py_svcctl_QueryServiceLockStatusW_args_out(struct svcctl_QueryServiceLockStatusW *r)
18143 : {
18144 0 : PyObject *result;
18145 0 : PyObject *py_lock_status;
18146 0 : PyObject *py_needed;
18147 0 : result = PyTuple_New(2);
18148 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, r->out.lock_status, r->out.lock_status);
18149 0 : PyTuple_SetItem(result, 0, py_lock_status);
18150 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
18151 0 : PyTuple_SetItem(result, 1, py_needed);
18152 0 : if (!W_ERROR_IS_OK(r->out.result)) {
18153 0 : PyErr_SetWERROR(r->out.result);
18154 0 : return NULL;
18155 : }
18156 :
18157 0 : return result;
18158 : }
18159 :
18160 :
18161 0 : static PyObject *py_svcctl_StartServiceW_in_get_handle(PyObject *obj, void *closure)
18162 : {
18163 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
18164 0 : PyObject *py_handle;
18165 0 : if (object->in.handle == NULL) {
18166 0 : Py_RETURN_NONE;
18167 : }
18168 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
18169 0 : return py_handle;
18170 : }
18171 :
18172 0 : static int py_svcctl_StartServiceW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
18173 : {
18174 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
18175 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
18176 0 : if (value == NULL) {
18177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
18178 0 : return -1;
18179 : }
18180 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
18181 0 : if (object->in.handle == NULL) {
18182 0 : PyErr_NoMemory();
18183 0 : return -1;
18184 : }
18185 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18186 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18187 0 : PyErr_NoMemory();
18188 0 : return -1;
18189 : }
18190 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
18191 0 : return 0;
18192 : }
18193 :
18194 0 : static PyObject *py_svcctl_StartServiceW_in_get_NumArgs(PyObject *obj, void *closure)
18195 : {
18196 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
18197 0 : PyObject *py_NumArgs;
18198 0 : py_NumArgs = PyLong_FromUnsignedLongLong((uint32_t)object->in.NumArgs);
18199 0 : return py_NumArgs;
18200 : }
18201 :
18202 0 : static int py_svcctl_StartServiceW_in_set_NumArgs(PyObject *py_obj, PyObject *value, void *closure)
18203 : {
18204 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
18205 0 : if (value == NULL) {
18206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.NumArgs");
18207 0 : return -1;
18208 : }
18209 : {
18210 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.NumArgs));
18211 0 : if (PyLong_Check(value)) {
18212 0 : unsigned long long test_var;
18213 0 : test_var = PyLong_AsUnsignedLongLong(value);
18214 0 : if (PyErr_Occurred() != NULL) {
18215 0 : return -1;
18216 : }
18217 0 : if (test_var > uint_max) {
18218 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18219 : PyLong_Type.tp_name, uint_max, test_var);
18220 0 : return -1;
18221 : }
18222 0 : object->in.NumArgs = test_var;
18223 : } else {
18224 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18225 : PyLong_Type.tp_name);
18226 0 : return -1;
18227 : }
18228 : }
18229 0 : return 0;
18230 : }
18231 :
18232 0 : static PyObject *py_svcctl_StartServiceW_in_get_Arguments(PyObject *obj, void *closure)
18233 : {
18234 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
18235 0 : PyObject *py_Arguments;
18236 0 : if (object->in.Arguments == NULL) {
18237 0 : Py_RETURN_NONE;
18238 : }
18239 0 : if (object->in.Arguments == NULL) {
18240 0 : py_Arguments = Py_None;
18241 0 : Py_INCREF(py_Arguments);
18242 : } else {
18243 0 : py_Arguments = PyList_New(object->in.NumArgs);
18244 0 : if (py_Arguments == NULL) {
18245 0 : return NULL;
18246 : }
18247 : {
18248 : int Arguments_cntr_1;
18249 0 : for (Arguments_cntr_1 = 0; Arguments_cntr_1 < (object->in.NumArgs); Arguments_cntr_1++) {
18250 0 : PyObject *py_Arguments_1;
18251 0 : py_Arguments_1 = pytalloc_reference_ex(&svcctl_ArgumentString_Type, object->in.Arguments, &object->in.Arguments[Arguments_cntr_1]);
18252 0 : PyList_SetItem(py_Arguments, Arguments_cntr_1, py_Arguments_1);
18253 : }
18254 : }
18255 : }
18256 0 : return py_Arguments;
18257 : }
18258 :
18259 0 : static int py_svcctl_StartServiceW_in_set_Arguments(PyObject *py_obj, PyObject *value, void *closure)
18260 : {
18261 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
18262 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.Arguments));
18263 0 : if (value == NULL) {
18264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Arguments");
18265 0 : return -1;
18266 : }
18267 0 : if (value == Py_None) {
18268 0 : object->in.Arguments = NULL;
18269 : } else {
18270 0 : object->in.Arguments = NULL;
18271 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
18272 : {
18273 0 : int Arguments_cntr_1;
18274 0 : object->in.Arguments = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.Arguments, PyList_GET_SIZE(value));
18275 0 : if (!object->in.Arguments) { return -1; }
18276 0 : talloc_set_name_const(object->in.Arguments, "ARRAY: object->in.Arguments");
18277 0 : for (Arguments_cntr_1 = 0; Arguments_cntr_1 < PyList_GET_SIZE(value); Arguments_cntr_1++) {
18278 0 : if (PyList_GET_ITEM(value, Arguments_cntr_1) == NULL) {
18279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Arguments[Arguments_cntr_1]");
18280 0 : return -1;
18281 : }
18282 0 : PY_CHECK_TYPE(&svcctl_ArgumentString_Type, PyList_GET_ITEM(value, Arguments_cntr_1), return -1;);
18283 0 : if (talloc_reference(object->in.Arguments, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, Arguments_cntr_1))) == NULL) {
18284 0 : PyErr_NoMemory();
18285 0 : return -1;
18286 : }
18287 0 : object->in.Arguments[Arguments_cntr_1] = *(struct svcctl_ArgumentString *)pytalloc_get_ptr(PyList_GET_ITEM(value, Arguments_cntr_1));
18288 : }
18289 : }
18290 : }
18291 0 : return 0;
18292 : }
18293 :
18294 0 : static PyObject *py_svcctl_StartServiceW_get_result(PyObject *obj, void *closure)
18295 : {
18296 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
18297 0 : PyObject *py_result;
18298 0 : py_result = PyErr_FromWERROR(object->out.result);
18299 0 : return py_result;
18300 : }
18301 :
18302 0 : static int py_svcctl_StartServiceW_set_result(PyObject *py_obj, PyObject *value, void *closure)
18303 : {
18304 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
18305 0 : if (value == NULL) {
18306 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
18307 0 : return -1;
18308 : }
18309 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
18310 0 : return 0;
18311 : }
18312 :
18313 : static PyGetSetDef py_svcctl_StartServiceW_getsetters[] = {
18314 : {
18315 : .name = discard_const_p(char, "in_handle"),
18316 : .get = py_svcctl_StartServiceW_in_get_handle,
18317 : .set = py_svcctl_StartServiceW_in_set_handle,
18318 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18319 : },
18320 : {
18321 : .name = discard_const_p(char, "in_NumArgs"),
18322 : .get = py_svcctl_StartServiceW_in_get_NumArgs,
18323 : .set = py_svcctl_StartServiceW_in_set_NumArgs,
18324 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18325 : },
18326 : {
18327 : .name = discard_const_p(char, "in_Arguments"),
18328 : .get = py_svcctl_StartServiceW_in_get_Arguments,
18329 : .set = py_svcctl_StartServiceW_in_set_Arguments,
18330 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ArgumentString")
18331 : },
18332 : {
18333 : .name = discard_const_p(char, "result"),
18334 : .get = py_svcctl_StartServiceW_get_result,
18335 : .set = py_svcctl_StartServiceW_set_result,
18336 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
18337 : },
18338 : { .name = NULL }
18339 : };
18340 :
18341 0 : static PyObject *py_svcctl_StartServiceW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18342 : {
18343 0 : PyObject *self = pytalloc_new(struct svcctl_StartServiceW, type);
18344 0 : struct svcctl_StartServiceW *_self = (struct svcctl_StartServiceW *)pytalloc_get_ptr(self);
18345 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18346 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
18347 0 : return self;
18348 : }
18349 :
18350 0 : static PyObject *py_svcctl_StartServiceW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18351 : {
18352 :
18353 :
18354 0 : return PyLong_FromLong(19);
18355 : }
18356 :
18357 0 : static PyObject *py_svcctl_StartServiceW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
18358 : {
18359 0 : const struct ndr_interface_call *call = NULL;
18360 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
18361 0 : PyObject *ret = NULL;
18362 0 : struct ndr_push *push = NULL;
18363 0 : DATA_BLOB blob;
18364 0 : enum ndr_err_code err;
18365 :
18366 0 : if (ndr_table_svcctl.num_calls < 20) {
18367 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceW_ndr_pack");
18368 0 : return NULL;
18369 : }
18370 0 : call = &ndr_table_svcctl.calls[19];
18371 :
18372 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18373 0 : if (push == NULL) {
18374 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18375 0 : return NULL;
18376 : }
18377 :
18378 0 : push->flags |= ndr_push_flags;
18379 :
18380 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18381 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18382 0 : TALLOC_FREE(push);
18383 0 : PyErr_SetNdrError(err);
18384 0 : return NULL;
18385 : }
18386 0 : blob = ndr_push_blob(push);
18387 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18388 0 : TALLOC_FREE(push);
18389 0 : return ret;
18390 : }
18391 :
18392 0 : static PyObject *py_svcctl_StartServiceW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18393 : {
18394 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18395 0 : PyObject *bigendian_obj = NULL;
18396 0 : PyObject *ndr64_obj = NULL;
18397 0 : libndr_flags ndr_push_flags = 0;
18398 :
18399 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18400 : discard_const_p(char *, kwnames),
18401 : &bigendian_obj,
18402 : &ndr64_obj)) {
18403 0 : return NULL;
18404 : }
18405 :
18406 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18407 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18408 : }
18409 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18410 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18411 : }
18412 :
18413 0 : return py_svcctl_StartServiceW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18414 : }
18415 :
18416 0 : static PyObject *py_svcctl_StartServiceW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18417 : {
18418 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18419 0 : PyObject *bigendian_obj = NULL;
18420 0 : PyObject *ndr64_obj = NULL;
18421 0 : libndr_flags ndr_push_flags = 0;
18422 :
18423 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18424 : discard_const_p(char *, kwnames),
18425 : &bigendian_obj,
18426 : &ndr64_obj)) {
18427 0 : return NULL;
18428 : }
18429 :
18430 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18431 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18432 : }
18433 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18434 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18435 : }
18436 :
18437 0 : return py_svcctl_StartServiceW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18438 : }
18439 :
18440 0 : static PyObject *py_svcctl_StartServiceW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
18441 : {
18442 0 : const struct ndr_interface_call *call = NULL;
18443 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
18444 0 : struct ndr_pull *pull = NULL;
18445 0 : enum ndr_err_code err;
18446 :
18447 0 : if (ndr_table_svcctl.num_calls < 20) {
18448 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceW_ndr_unpack");
18449 0 : return NULL;
18450 : }
18451 0 : call = &ndr_table_svcctl.calls[19];
18452 :
18453 0 : pull = ndr_pull_init_blob(blob, object);
18454 0 : if (pull == NULL) {
18455 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18456 0 : return NULL;
18457 : }
18458 :
18459 0 : pull->flags |= ndr_pull_flags;
18460 :
18461 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18462 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18463 0 : TALLOC_FREE(pull);
18464 0 : PyErr_SetNdrError(err);
18465 0 : return NULL;
18466 : }
18467 0 : if (!allow_remaining) {
18468 0 : uint32_t highest_ofs;
18469 :
18470 0 : if (pull->offset > pull->relative_highest_offset) {
18471 0 : highest_ofs = pull->offset;
18472 : } else {
18473 0 : highest_ofs = pull->relative_highest_offset;
18474 : }
18475 0 : if (highest_ofs < pull->data_size) {
18476 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18477 : "not all bytes consumed ofs[%u] size[%u]",
18478 : highest_ofs, pull->data_size);
18479 0 : TALLOC_FREE(pull);
18480 0 : PyErr_SetNdrError(err);
18481 0 : return NULL;
18482 : }
18483 : }
18484 :
18485 0 : TALLOC_FREE(pull);
18486 0 : Py_RETURN_NONE;
18487 : }
18488 :
18489 0 : static PyObject *py_svcctl_StartServiceW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18490 : {
18491 0 : DATA_BLOB blob;
18492 0 : Py_ssize_t blob_length = 0;
18493 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18494 0 : PyObject *bigendian_obj = NULL;
18495 0 : PyObject *ndr64_obj = NULL;
18496 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18497 0 : PyObject *allow_remaining_obj = NULL;
18498 0 : bool allow_remaining = false;
18499 :
18500 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18501 : discard_const_p(char *, kwnames),
18502 : &blob.data, &blob_length,
18503 : &bigendian_obj,
18504 : &ndr64_obj,
18505 : &allow_remaining_obj)) {
18506 0 : return NULL;
18507 : }
18508 0 : blob.length = blob_length;
18509 :
18510 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18511 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18512 : }
18513 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18514 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18515 : }
18516 :
18517 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18518 0 : allow_remaining = true;
18519 : }
18520 :
18521 0 : return py_svcctl_StartServiceW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18522 : }
18523 :
18524 0 : static PyObject *py_svcctl_StartServiceW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18525 : {
18526 0 : DATA_BLOB blob;
18527 0 : Py_ssize_t blob_length = 0;
18528 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18529 0 : PyObject *bigendian_obj = NULL;
18530 0 : PyObject *ndr64_obj = NULL;
18531 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18532 0 : PyObject *allow_remaining_obj = NULL;
18533 0 : bool allow_remaining = false;
18534 :
18535 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18536 : discard_const_p(char *, kwnames),
18537 : &blob.data, &blob_length,
18538 : &bigendian_obj,
18539 : &ndr64_obj,
18540 : &allow_remaining_obj)) {
18541 0 : return NULL;
18542 : }
18543 0 : blob.length = blob_length;
18544 :
18545 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18546 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18547 : }
18548 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18549 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18550 : }
18551 :
18552 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18553 0 : allow_remaining = true;
18554 : }
18555 :
18556 0 : return py_svcctl_StartServiceW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18557 : }
18558 :
18559 0 : static PyObject *py_svcctl_StartServiceW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
18560 : {
18561 0 : const struct ndr_interface_call *call = NULL;
18562 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
18563 0 : PyObject *ret;
18564 0 : char *retstr;
18565 :
18566 0 : if (ndr_table_svcctl.num_calls < 20) {
18567 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceW_ndr_print");
18568 0 : return NULL;
18569 : }
18570 0 : call = &ndr_table_svcctl.calls[19];
18571 :
18572 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18573 0 : ret = PyUnicode_FromString(retstr);
18574 0 : TALLOC_FREE(retstr);
18575 :
18576 0 : return ret;
18577 : }
18578 :
18579 0 : static PyObject *py_svcctl_StartServiceW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18580 : {
18581 0 : return py_svcctl_StartServiceW_ndr_print(py_obj, "svcctl_StartServiceW_in", NDR_IN);
18582 : }
18583 :
18584 0 : static PyObject *py_svcctl_StartServiceW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18585 : {
18586 0 : return py_svcctl_StartServiceW_ndr_print(py_obj, "svcctl_StartServiceW_out", NDR_OUT);
18587 : }
18588 :
18589 : static PyMethodDef py_svcctl_StartServiceW_methods[] = {
18590 : { "opnum", (PyCFunction)py_svcctl_StartServiceW_ndr_opnum, METH_NOARGS|METH_CLASS,
18591 : "svcctl.StartServiceW.opnum() -> 19 (0x13) " },
18592 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18593 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18594 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18595 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18596 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18597 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18598 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18599 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18600 : { "__ndr_print_in__", (PyCFunction)py_svcctl_StartServiceW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18601 : { "__ndr_print_out__", (PyCFunction)py_svcctl_StartServiceW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18602 : { NULL, NULL, 0, NULL }
18603 : };
18604 :
18605 :
18606 : static PyTypeObject svcctl_StartServiceW_Type = {
18607 : PyVarObject_HEAD_INIT(NULL, 0)
18608 : .tp_name = "svcctl.StartServiceW",
18609 : .tp_getset = py_svcctl_StartServiceW_getsetters,
18610 : .tp_methods = py_svcctl_StartServiceW_methods,
18611 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18612 : .tp_new = py_svcctl_StartServiceW_new,
18613 : };
18614 :
18615 0 : static bool pack_py_svcctl_StartServiceW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_StartServiceW *r)
18616 : {
18617 0 : PyObject *py_handle;
18618 0 : PyObject *py_Arguments;
18619 0 : const char *kwnames[] = {
18620 : "handle", "Arguments", NULL
18621 : };
18622 :
18623 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_StartServiceW", discard_const_p(char *, kwnames), &py_handle, &py_Arguments)) {
18624 0 : return false;
18625 : }
18626 :
18627 0 : if (py_handle == NULL) {
18628 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
18629 0 : return false;
18630 : }
18631 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
18632 0 : if (r->in.handle == NULL) {
18633 0 : PyErr_NoMemory();
18634 0 : return false;
18635 : }
18636 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
18637 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
18638 0 : PyErr_NoMemory();
18639 0 : return false;
18640 : }
18641 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
18642 0 : PY_CHECK_TYPE(&PyList_Type, py_Arguments, return false;);
18643 0 : r->in.NumArgs = PyList_GET_SIZE(py_Arguments);
18644 0 : if (py_Arguments == NULL) {
18645 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Arguments");
18646 0 : return false;
18647 : }
18648 0 : if (py_Arguments == Py_None) {
18649 0 : r->in.Arguments = NULL;
18650 : } else {
18651 0 : r->in.Arguments = NULL;
18652 0 : PY_CHECK_TYPE(&PyList_Type, py_Arguments, return false;);
18653 : {
18654 0 : int Arguments_cntr_1;
18655 0 : r->in.Arguments = talloc_array_ptrtype(r, r->in.Arguments, PyList_GET_SIZE(py_Arguments));
18656 0 : if (!r->in.Arguments) { return false; }
18657 0 : talloc_set_name_const(r->in.Arguments, "ARRAY: r->in.Arguments");
18658 0 : for (Arguments_cntr_1 = 0; Arguments_cntr_1 < PyList_GET_SIZE(py_Arguments); Arguments_cntr_1++) {
18659 0 : if (PyList_GET_ITEM(py_Arguments, Arguments_cntr_1) == NULL) {
18660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Arguments[Arguments_cntr_1]");
18661 0 : return false;
18662 : }
18663 0 : PY_CHECK_TYPE(&svcctl_ArgumentString_Type, PyList_GET_ITEM(py_Arguments, Arguments_cntr_1), return false;);
18664 0 : if (talloc_reference(r->in.Arguments, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_Arguments, Arguments_cntr_1))) == NULL) {
18665 0 : PyErr_NoMemory();
18666 0 : return false;
18667 : }
18668 0 : r->in.Arguments[Arguments_cntr_1] = *(struct svcctl_ArgumentString *)pytalloc_get_ptr(PyList_GET_ITEM(py_Arguments, Arguments_cntr_1));
18669 : }
18670 : }
18671 : }
18672 0 : return true;
18673 : }
18674 :
18675 0 : static PyObject *unpack_py_svcctl_StartServiceW_args_out(struct svcctl_StartServiceW *r)
18676 : {
18677 0 : PyObject *result;
18678 0 : result = Py_None;
18679 0 : Py_INCREF(result);
18680 0 : if (!W_ERROR_IS_OK(r->out.result)) {
18681 0 : PyErr_SetWERROR(r->out.result);
18682 0 : return NULL;
18683 : }
18684 :
18685 0 : return result;
18686 : }
18687 :
18688 :
18689 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_in_get_handle(PyObject *obj, void *closure)
18690 : {
18691 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
18692 0 : PyObject *py_handle;
18693 0 : if (object->in.handle == NULL) {
18694 0 : Py_RETURN_NONE;
18695 : }
18696 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
18697 0 : return py_handle;
18698 : }
18699 :
18700 0 : static int py_svcctl_GetServiceDisplayNameW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
18701 : {
18702 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
18703 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
18704 0 : if (value == NULL) {
18705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
18706 0 : return -1;
18707 : }
18708 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
18709 0 : if (object->in.handle == NULL) {
18710 0 : PyErr_NoMemory();
18711 0 : return -1;
18712 : }
18713 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18714 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18715 0 : PyErr_NoMemory();
18716 0 : return -1;
18717 : }
18718 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
18719 0 : return 0;
18720 : }
18721 :
18722 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_in_get_service_name(PyObject *obj, void *closure)
18723 : {
18724 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
18725 0 : PyObject *py_service_name;
18726 0 : if (object->in.service_name == NULL) {
18727 0 : Py_RETURN_NONE;
18728 : }
18729 0 : if (object->in.service_name == NULL) {
18730 0 : py_service_name = Py_None;
18731 0 : Py_INCREF(py_service_name);
18732 : } else {
18733 0 : if (object->in.service_name == NULL) {
18734 0 : py_service_name = Py_None;
18735 0 : Py_INCREF(py_service_name);
18736 : } else {
18737 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
18738 : }
18739 : }
18740 0 : return py_service_name;
18741 : }
18742 :
18743 0 : static int py_svcctl_GetServiceDisplayNameW_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
18744 : {
18745 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
18746 0 : if (value == NULL) {
18747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
18748 0 : return -1;
18749 : }
18750 0 : if (value == Py_None) {
18751 0 : object->in.service_name = NULL;
18752 : } else {
18753 0 : object->in.service_name = NULL;
18754 : {
18755 0 : const char *test_str;
18756 0 : const char *talloc_str;
18757 0 : PyObject *unicode = NULL;
18758 0 : if (PyUnicode_Check(value)) {
18759 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18760 0 : if (unicode == NULL) {
18761 0 : return -1;
18762 : }
18763 0 : test_str = PyBytes_AS_STRING(unicode);
18764 0 : } else if (PyBytes_Check(value)) {
18765 0 : test_str = PyBytes_AS_STRING(value);
18766 : } else {
18767 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18768 0 : return -1;
18769 : }
18770 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18771 0 : if (unicode != NULL) {
18772 0 : Py_DECREF(unicode);
18773 : }
18774 0 : if (talloc_str == NULL) {
18775 0 : PyErr_NoMemory();
18776 0 : return -1;
18777 : }
18778 0 : object->in.service_name = talloc_str;
18779 : }
18780 : }
18781 0 : return 0;
18782 : }
18783 :
18784 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_out_get_display_name(PyObject *obj, void *closure)
18785 : {
18786 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
18787 0 : PyObject *py_display_name;
18788 0 : if (object->out.display_name == NULL) {
18789 0 : Py_RETURN_NONE;
18790 : }
18791 0 : if (*object->out.display_name == NULL) {
18792 0 : py_display_name = Py_None;
18793 0 : Py_INCREF(py_display_name);
18794 : } else {
18795 0 : if (*object->out.display_name == NULL) {
18796 0 : py_display_name = Py_None;
18797 0 : Py_INCREF(py_display_name);
18798 : } else {
18799 0 : py_display_name = PyUnicode_Decode(*object->out.display_name, strlen(*object->out.display_name), "utf-8", "ignore");
18800 : }
18801 : }
18802 0 : return py_display_name;
18803 : }
18804 :
18805 0 : static int py_svcctl_GetServiceDisplayNameW_out_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
18806 : {
18807 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
18808 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name));
18809 0 : if (value == NULL) {
18810 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name");
18811 0 : return -1;
18812 : }
18813 0 : object->out.display_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name);
18814 0 : if (object->out.display_name == NULL) {
18815 0 : PyErr_NoMemory();
18816 0 : return -1;
18817 : }
18818 0 : if (value == Py_None) {
18819 0 : *object->out.display_name = NULL;
18820 : } else {
18821 0 : *object->out.display_name = NULL;
18822 : {
18823 0 : const char *test_str;
18824 0 : const char *talloc_str;
18825 0 : PyObject *unicode = NULL;
18826 0 : if (PyUnicode_Check(value)) {
18827 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18828 0 : if (unicode == NULL) {
18829 0 : return -1;
18830 : }
18831 0 : test_str = PyBytes_AS_STRING(unicode);
18832 0 : } else if (PyBytes_Check(value)) {
18833 0 : test_str = PyBytes_AS_STRING(value);
18834 : } else {
18835 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18836 0 : return -1;
18837 : }
18838 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18839 0 : if (unicode != NULL) {
18840 0 : Py_DECREF(unicode);
18841 : }
18842 0 : if (talloc_str == NULL) {
18843 0 : PyErr_NoMemory();
18844 0 : return -1;
18845 : }
18846 0 : *object->out.display_name = talloc_str;
18847 : }
18848 : }
18849 0 : return 0;
18850 : }
18851 :
18852 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_in_get_display_name_length(PyObject *obj, void *closure)
18853 : {
18854 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
18855 0 : PyObject *py_display_name_length;
18856 0 : if (object->in.display_name_length == NULL) {
18857 0 : Py_RETURN_NONE;
18858 : }
18859 0 : if (object->in.display_name_length == NULL) {
18860 0 : py_display_name_length = Py_None;
18861 0 : Py_INCREF(py_display_name_length);
18862 : } else {
18863 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
18864 : }
18865 0 : return py_display_name_length;
18866 : }
18867 :
18868 0 : static int py_svcctl_GetServiceDisplayNameW_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
18869 : {
18870 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
18871 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
18872 0 : if (value == NULL) {
18873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
18874 0 : return -1;
18875 : }
18876 0 : if (value == Py_None) {
18877 0 : object->in.display_name_length = NULL;
18878 : } else {
18879 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
18880 0 : if (object->in.display_name_length == NULL) {
18881 0 : PyErr_NoMemory();
18882 0 : return -1;
18883 : }
18884 : {
18885 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
18886 0 : if (PyLong_Check(value)) {
18887 0 : unsigned long long test_var;
18888 0 : test_var = PyLong_AsUnsignedLongLong(value);
18889 0 : if (PyErr_Occurred() != NULL) {
18890 0 : return -1;
18891 : }
18892 0 : if (test_var > uint_max) {
18893 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18894 : PyLong_Type.tp_name, uint_max, test_var);
18895 0 : return -1;
18896 : }
18897 0 : *object->in.display_name_length = test_var;
18898 : } else {
18899 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18900 : PyLong_Type.tp_name);
18901 0 : return -1;
18902 : }
18903 : }
18904 : }
18905 0 : return 0;
18906 : }
18907 :
18908 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_out_get_display_name_length(PyObject *obj, void *closure)
18909 : {
18910 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
18911 0 : PyObject *py_display_name_length;
18912 0 : if (object->out.display_name_length == NULL) {
18913 0 : Py_RETURN_NONE;
18914 : }
18915 0 : if (object->out.display_name_length == NULL) {
18916 0 : py_display_name_length = Py_None;
18917 0 : Py_INCREF(py_display_name_length);
18918 : } else {
18919 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
18920 : }
18921 0 : return py_display_name_length;
18922 : }
18923 :
18924 0 : static int py_svcctl_GetServiceDisplayNameW_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
18925 : {
18926 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
18927 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
18928 0 : if (value == NULL) {
18929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
18930 0 : return -1;
18931 : }
18932 0 : if (value == Py_None) {
18933 0 : object->out.display_name_length = NULL;
18934 : } else {
18935 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
18936 0 : if (object->out.display_name_length == NULL) {
18937 0 : PyErr_NoMemory();
18938 0 : return -1;
18939 : }
18940 : {
18941 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
18942 0 : if (PyLong_Check(value)) {
18943 0 : unsigned long long test_var;
18944 0 : test_var = PyLong_AsUnsignedLongLong(value);
18945 0 : if (PyErr_Occurred() != NULL) {
18946 0 : return -1;
18947 : }
18948 0 : if (test_var > uint_max) {
18949 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18950 : PyLong_Type.tp_name, uint_max, test_var);
18951 0 : return -1;
18952 : }
18953 0 : *object->out.display_name_length = test_var;
18954 : } else {
18955 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18956 : PyLong_Type.tp_name);
18957 0 : return -1;
18958 : }
18959 : }
18960 : }
18961 0 : return 0;
18962 : }
18963 :
18964 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_get_result(PyObject *obj, void *closure)
18965 : {
18966 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
18967 0 : PyObject *py_result;
18968 0 : py_result = PyErr_FromWERROR(object->out.result);
18969 0 : return py_result;
18970 : }
18971 :
18972 0 : static int py_svcctl_GetServiceDisplayNameW_set_result(PyObject *py_obj, PyObject *value, void *closure)
18973 : {
18974 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
18975 0 : if (value == NULL) {
18976 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
18977 0 : return -1;
18978 : }
18979 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
18980 0 : return 0;
18981 : }
18982 :
18983 : static PyGetSetDef py_svcctl_GetServiceDisplayNameW_getsetters[] = {
18984 : {
18985 : .name = discard_const_p(char, "in_handle"),
18986 : .get = py_svcctl_GetServiceDisplayNameW_in_get_handle,
18987 : .set = py_svcctl_GetServiceDisplayNameW_in_set_handle,
18988 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18989 : },
18990 : {
18991 : .name = discard_const_p(char, "in_service_name"),
18992 : .get = py_svcctl_GetServiceDisplayNameW_in_get_service_name,
18993 : .set = py_svcctl_GetServiceDisplayNameW_in_set_service_name,
18994 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
18995 : },
18996 : {
18997 : .name = discard_const_p(char, "out_display_name"),
18998 : .get = py_svcctl_GetServiceDisplayNameW_out_get_display_name,
18999 : .set = py_svcctl_GetServiceDisplayNameW_out_set_display_name,
19000 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19001 : },
19002 : {
19003 : .name = discard_const_p(char, "in_display_name_length"),
19004 : .get = py_svcctl_GetServiceDisplayNameW_in_get_display_name_length,
19005 : .set = py_svcctl_GetServiceDisplayNameW_in_set_display_name_length,
19006 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19007 : },
19008 : {
19009 : .name = discard_const_p(char, "out_display_name_length"),
19010 : .get = py_svcctl_GetServiceDisplayNameW_out_get_display_name_length,
19011 : .set = py_svcctl_GetServiceDisplayNameW_out_set_display_name_length,
19012 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19013 : },
19014 : {
19015 : .name = discard_const_p(char, "result"),
19016 : .get = py_svcctl_GetServiceDisplayNameW_get_result,
19017 : .set = py_svcctl_GetServiceDisplayNameW_set_result,
19018 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
19019 : },
19020 : { .name = NULL }
19021 : };
19022 :
19023 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19024 : {
19025 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceDisplayNameW, type);
19026 0 : struct svcctl_GetServiceDisplayNameW *_self = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(self);
19027 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19028 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
19029 0 : return self;
19030 : }
19031 :
19032 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19033 : {
19034 :
19035 :
19036 0 : return PyLong_FromLong(20);
19037 : }
19038 :
19039 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
19040 : {
19041 0 : const struct ndr_interface_call *call = NULL;
19042 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
19043 0 : PyObject *ret = NULL;
19044 0 : struct ndr_push *push = NULL;
19045 0 : DATA_BLOB blob;
19046 0 : enum ndr_err_code err;
19047 :
19048 0 : if (ndr_table_svcctl.num_calls < 21) {
19049 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameW_ndr_pack");
19050 0 : return NULL;
19051 : }
19052 0 : call = &ndr_table_svcctl.calls[20];
19053 :
19054 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19055 0 : if (push == NULL) {
19056 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19057 0 : return NULL;
19058 : }
19059 :
19060 0 : push->flags |= ndr_push_flags;
19061 :
19062 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19063 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19064 0 : TALLOC_FREE(push);
19065 0 : PyErr_SetNdrError(err);
19066 0 : return NULL;
19067 : }
19068 0 : blob = ndr_push_blob(push);
19069 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19070 0 : TALLOC_FREE(push);
19071 0 : return ret;
19072 : }
19073 :
19074 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19075 : {
19076 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19077 0 : PyObject *bigendian_obj = NULL;
19078 0 : PyObject *ndr64_obj = NULL;
19079 0 : libndr_flags ndr_push_flags = 0;
19080 :
19081 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19082 : discard_const_p(char *, kwnames),
19083 : &bigendian_obj,
19084 : &ndr64_obj)) {
19085 0 : return NULL;
19086 : }
19087 :
19088 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19089 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19090 : }
19091 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19092 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19093 : }
19094 :
19095 0 : return py_svcctl_GetServiceDisplayNameW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19096 : }
19097 :
19098 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19099 : {
19100 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19101 0 : PyObject *bigendian_obj = NULL;
19102 0 : PyObject *ndr64_obj = NULL;
19103 0 : libndr_flags ndr_push_flags = 0;
19104 :
19105 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19106 : discard_const_p(char *, kwnames),
19107 : &bigendian_obj,
19108 : &ndr64_obj)) {
19109 0 : return NULL;
19110 : }
19111 :
19112 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19113 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19114 : }
19115 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19116 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19117 : }
19118 :
19119 0 : return py_svcctl_GetServiceDisplayNameW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19120 : }
19121 :
19122 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
19123 : {
19124 0 : const struct ndr_interface_call *call = NULL;
19125 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
19126 0 : struct ndr_pull *pull = NULL;
19127 0 : enum ndr_err_code err;
19128 :
19129 0 : if (ndr_table_svcctl.num_calls < 21) {
19130 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameW_ndr_unpack");
19131 0 : return NULL;
19132 : }
19133 0 : call = &ndr_table_svcctl.calls[20];
19134 :
19135 0 : pull = ndr_pull_init_blob(blob, object);
19136 0 : if (pull == NULL) {
19137 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19138 0 : return NULL;
19139 : }
19140 :
19141 0 : pull->flags |= ndr_pull_flags;
19142 :
19143 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19144 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19145 0 : TALLOC_FREE(pull);
19146 0 : PyErr_SetNdrError(err);
19147 0 : return NULL;
19148 : }
19149 0 : if (!allow_remaining) {
19150 0 : uint32_t highest_ofs;
19151 :
19152 0 : if (pull->offset > pull->relative_highest_offset) {
19153 0 : highest_ofs = pull->offset;
19154 : } else {
19155 0 : highest_ofs = pull->relative_highest_offset;
19156 : }
19157 0 : if (highest_ofs < pull->data_size) {
19158 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19159 : "not all bytes consumed ofs[%u] size[%u]",
19160 : highest_ofs, pull->data_size);
19161 0 : TALLOC_FREE(pull);
19162 0 : PyErr_SetNdrError(err);
19163 0 : return NULL;
19164 : }
19165 : }
19166 :
19167 0 : TALLOC_FREE(pull);
19168 0 : Py_RETURN_NONE;
19169 : }
19170 :
19171 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19172 : {
19173 0 : DATA_BLOB blob;
19174 0 : Py_ssize_t blob_length = 0;
19175 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19176 0 : PyObject *bigendian_obj = NULL;
19177 0 : PyObject *ndr64_obj = NULL;
19178 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19179 0 : PyObject *allow_remaining_obj = NULL;
19180 0 : bool allow_remaining = false;
19181 :
19182 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19183 : discard_const_p(char *, kwnames),
19184 : &blob.data, &blob_length,
19185 : &bigendian_obj,
19186 : &ndr64_obj,
19187 : &allow_remaining_obj)) {
19188 0 : return NULL;
19189 : }
19190 0 : blob.length = blob_length;
19191 :
19192 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19193 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19194 : }
19195 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19196 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19197 : }
19198 :
19199 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19200 0 : allow_remaining = true;
19201 : }
19202 :
19203 0 : return py_svcctl_GetServiceDisplayNameW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19204 : }
19205 :
19206 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19207 : {
19208 0 : DATA_BLOB blob;
19209 0 : Py_ssize_t blob_length = 0;
19210 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19211 0 : PyObject *bigendian_obj = NULL;
19212 0 : PyObject *ndr64_obj = NULL;
19213 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19214 0 : PyObject *allow_remaining_obj = NULL;
19215 0 : bool allow_remaining = false;
19216 :
19217 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19218 : discard_const_p(char *, kwnames),
19219 : &blob.data, &blob_length,
19220 : &bigendian_obj,
19221 : &ndr64_obj,
19222 : &allow_remaining_obj)) {
19223 0 : return NULL;
19224 : }
19225 0 : blob.length = blob_length;
19226 :
19227 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19228 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19229 : }
19230 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19231 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19232 : }
19233 :
19234 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19235 0 : allow_remaining = true;
19236 : }
19237 :
19238 0 : return py_svcctl_GetServiceDisplayNameW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19239 : }
19240 :
19241 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19242 : {
19243 0 : const struct ndr_interface_call *call = NULL;
19244 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
19245 0 : PyObject *ret;
19246 0 : char *retstr;
19247 :
19248 0 : if (ndr_table_svcctl.num_calls < 21) {
19249 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameW_ndr_print");
19250 0 : return NULL;
19251 : }
19252 0 : call = &ndr_table_svcctl.calls[20];
19253 :
19254 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19255 0 : ret = PyUnicode_FromString(retstr);
19256 0 : TALLOC_FREE(retstr);
19257 :
19258 0 : return ret;
19259 : }
19260 :
19261 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19262 : {
19263 0 : return py_svcctl_GetServiceDisplayNameW_ndr_print(py_obj, "svcctl_GetServiceDisplayNameW_in", NDR_IN);
19264 : }
19265 :
19266 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19267 : {
19268 0 : return py_svcctl_GetServiceDisplayNameW_ndr_print(py_obj, "svcctl_GetServiceDisplayNameW_out", NDR_OUT);
19269 : }
19270 :
19271 : static PyMethodDef py_svcctl_GetServiceDisplayNameW_methods[] = {
19272 : { "opnum", (PyCFunction)py_svcctl_GetServiceDisplayNameW_ndr_opnum, METH_NOARGS|METH_CLASS,
19273 : "svcctl.GetServiceDisplayNameW.opnum() -> 20 (0x14) " },
19274 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19275 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19276 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19277 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19278 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19279 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19280 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19281 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19282 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceDisplayNameW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19283 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceDisplayNameW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19284 : { NULL, NULL, 0, NULL }
19285 : };
19286 :
19287 :
19288 : static PyTypeObject svcctl_GetServiceDisplayNameW_Type = {
19289 : PyVarObject_HEAD_INIT(NULL, 0)
19290 : .tp_name = "svcctl.GetServiceDisplayNameW",
19291 : .tp_getset = py_svcctl_GetServiceDisplayNameW_getsetters,
19292 : .tp_methods = py_svcctl_GetServiceDisplayNameW_methods,
19293 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19294 : .tp_new = py_svcctl_GetServiceDisplayNameW_new,
19295 : };
19296 :
19297 0 : static bool pack_py_svcctl_GetServiceDisplayNameW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceDisplayNameW *r)
19298 : {
19299 0 : PyObject *py_handle;
19300 0 : PyObject *py_service_name;
19301 0 : PyObject *py_display_name_length;
19302 0 : const char *kwnames[] = {
19303 : "handle", "service_name", "display_name_length", NULL
19304 : };
19305 :
19306 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceDisplayNameW", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
19307 0 : return false;
19308 : }
19309 :
19310 0 : if (py_handle == NULL) {
19311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
19312 0 : return false;
19313 : }
19314 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
19315 0 : if (r->in.handle == NULL) {
19316 0 : PyErr_NoMemory();
19317 0 : return false;
19318 : }
19319 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
19320 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
19321 0 : PyErr_NoMemory();
19322 0 : return false;
19323 : }
19324 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
19325 0 : if (py_service_name == NULL) {
19326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
19327 0 : return false;
19328 : }
19329 0 : if (py_service_name == Py_None) {
19330 0 : r->in.service_name = NULL;
19331 : } else {
19332 0 : r->in.service_name = NULL;
19333 : {
19334 0 : const char *test_str;
19335 0 : const char *talloc_str;
19336 0 : PyObject *unicode = NULL;
19337 0 : if (PyUnicode_Check(py_service_name)) {
19338 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
19339 0 : if (unicode == NULL) {
19340 0 : return false;
19341 : }
19342 0 : test_str = PyBytes_AS_STRING(unicode);
19343 0 : } else if (PyBytes_Check(py_service_name)) {
19344 0 : test_str = PyBytes_AS_STRING(py_service_name);
19345 : } else {
19346 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
19347 0 : return false;
19348 : }
19349 0 : talloc_str = talloc_strdup(r, test_str);
19350 0 : if (unicode != NULL) {
19351 0 : Py_DECREF(unicode);
19352 : }
19353 0 : if (talloc_str == NULL) {
19354 0 : PyErr_NoMemory();
19355 0 : return false;
19356 : }
19357 0 : r->in.service_name = talloc_str;
19358 : }
19359 : }
19360 0 : if (py_display_name_length == NULL) {
19361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
19362 0 : return false;
19363 : }
19364 0 : if (py_display_name_length == Py_None) {
19365 0 : r->in.display_name_length = NULL;
19366 : } else {
19367 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
19368 0 : if (r->in.display_name_length == NULL) {
19369 0 : PyErr_NoMemory();
19370 0 : return false;
19371 : }
19372 : {
19373 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
19374 0 : if (PyLong_Check(py_display_name_length)) {
19375 0 : unsigned long long test_var;
19376 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
19377 0 : if (PyErr_Occurred() != NULL) {
19378 0 : return false;
19379 : }
19380 0 : if (test_var > uint_max) {
19381 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19382 : PyLong_Type.tp_name, uint_max, test_var);
19383 0 : return false;
19384 : }
19385 0 : *r->in.display_name_length = test_var;
19386 : } else {
19387 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19388 : PyLong_Type.tp_name);
19389 0 : return false;
19390 : }
19391 : }
19392 : }
19393 0 : return true;
19394 : }
19395 :
19396 0 : static PyObject *unpack_py_svcctl_GetServiceDisplayNameW_args_out(struct svcctl_GetServiceDisplayNameW *r)
19397 : {
19398 0 : PyObject *result;
19399 0 : PyObject *py_display_name;
19400 0 : PyObject *py_display_name_length;
19401 0 : result = PyTuple_New(2);
19402 0 : if (*r->out.display_name == NULL) {
19403 0 : py_display_name = Py_None;
19404 0 : Py_INCREF(py_display_name);
19405 : } else {
19406 0 : if (*r->out.display_name == NULL) {
19407 0 : py_display_name = Py_None;
19408 0 : Py_INCREF(py_display_name);
19409 : } else {
19410 0 : py_display_name = PyUnicode_Decode(*r->out.display_name, strlen(*r->out.display_name), "utf-8", "ignore");
19411 : }
19412 : }
19413 0 : PyTuple_SetItem(result, 0, py_display_name);
19414 0 : if (r->out.display_name_length == NULL) {
19415 0 : py_display_name_length = Py_None;
19416 0 : Py_INCREF(py_display_name_length);
19417 : } else {
19418 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
19419 : }
19420 0 : PyTuple_SetItem(result, 1, py_display_name_length);
19421 0 : if (!W_ERROR_IS_OK(r->out.result)) {
19422 0 : PyErr_SetWERROR(r->out.result);
19423 0 : return NULL;
19424 : }
19425 :
19426 0 : return result;
19427 : }
19428 :
19429 :
19430 0 : static PyObject *py_svcctl_GetServiceKeyNameW_in_get_handle(PyObject *obj, void *closure)
19431 : {
19432 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
19433 0 : PyObject *py_handle;
19434 0 : if (object->in.handle == NULL) {
19435 0 : Py_RETURN_NONE;
19436 : }
19437 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
19438 0 : return py_handle;
19439 : }
19440 :
19441 0 : static int py_svcctl_GetServiceKeyNameW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
19442 : {
19443 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19444 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
19445 0 : if (value == NULL) {
19446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
19447 0 : return -1;
19448 : }
19449 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
19450 0 : if (object->in.handle == NULL) {
19451 0 : PyErr_NoMemory();
19452 0 : return -1;
19453 : }
19454 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19455 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19456 0 : PyErr_NoMemory();
19457 0 : return -1;
19458 : }
19459 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
19460 0 : return 0;
19461 : }
19462 :
19463 0 : static PyObject *py_svcctl_GetServiceKeyNameW_in_get_service_name(PyObject *obj, void *closure)
19464 : {
19465 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
19466 0 : PyObject *py_service_name;
19467 0 : if (object->in.service_name == NULL) {
19468 0 : Py_RETURN_NONE;
19469 : }
19470 0 : if (object->in.service_name == NULL) {
19471 0 : py_service_name = Py_None;
19472 0 : Py_INCREF(py_service_name);
19473 : } else {
19474 0 : if (object->in.service_name == NULL) {
19475 0 : py_service_name = Py_None;
19476 0 : Py_INCREF(py_service_name);
19477 : } else {
19478 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
19479 : }
19480 : }
19481 0 : return py_service_name;
19482 : }
19483 :
19484 0 : static int py_svcctl_GetServiceKeyNameW_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
19485 : {
19486 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19487 0 : if (value == NULL) {
19488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
19489 0 : return -1;
19490 : }
19491 0 : if (value == Py_None) {
19492 0 : object->in.service_name = NULL;
19493 : } else {
19494 0 : object->in.service_name = NULL;
19495 : {
19496 0 : const char *test_str;
19497 0 : const char *talloc_str;
19498 0 : PyObject *unicode = NULL;
19499 0 : if (PyUnicode_Check(value)) {
19500 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19501 0 : if (unicode == NULL) {
19502 0 : return -1;
19503 : }
19504 0 : test_str = PyBytes_AS_STRING(unicode);
19505 0 : } else if (PyBytes_Check(value)) {
19506 0 : test_str = PyBytes_AS_STRING(value);
19507 : } else {
19508 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19509 0 : return -1;
19510 : }
19511 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19512 0 : if (unicode != NULL) {
19513 0 : Py_DECREF(unicode);
19514 : }
19515 0 : if (talloc_str == NULL) {
19516 0 : PyErr_NoMemory();
19517 0 : return -1;
19518 : }
19519 0 : object->in.service_name = talloc_str;
19520 : }
19521 : }
19522 0 : return 0;
19523 : }
19524 :
19525 0 : static PyObject *py_svcctl_GetServiceKeyNameW_out_get_key_name(PyObject *obj, void *closure)
19526 : {
19527 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
19528 0 : PyObject *py_key_name;
19529 0 : if (object->out.key_name == NULL) {
19530 0 : Py_RETURN_NONE;
19531 : }
19532 0 : if (*object->out.key_name == NULL) {
19533 0 : py_key_name = Py_None;
19534 0 : Py_INCREF(py_key_name);
19535 : } else {
19536 0 : if (*object->out.key_name == NULL) {
19537 0 : py_key_name = Py_None;
19538 0 : Py_INCREF(py_key_name);
19539 : } else {
19540 0 : py_key_name = PyUnicode_Decode(*object->out.key_name, strlen(*object->out.key_name), "utf-8", "ignore");
19541 : }
19542 : }
19543 0 : return py_key_name;
19544 : }
19545 :
19546 0 : static int py_svcctl_GetServiceKeyNameW_out_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
19547 : {
19548 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19549 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.key_name));
19550 0 : if (value == NULL) {
19551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.key_name");
19552 0 : return -1;
19553 : }
19554 0 : object->out.key_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.key_name);
19555 0 : if (object->out.key_name == NULL) {
19556 0 : PyErr_NoMemory();
19557 0 : return -1;
19558 : }
19559 0 : if (value == Py_None) {
19560 0 : *object->out.key_name = NULL;
19561 : } else {
19562 0 : *object->out.key_name = NULL;
19563 : {
19564 0 : const char *test_str;
19565 0 : const char *talloc_str;
19566 0 : PyObject *unicode = NULL;
19567 0 : if (PyUnicode_Check(value)) {
19568 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19569 0 : if (unicode == NULL) {
19570 0 : return -1;
19571 : }
19572 0 : test_str = PyBytes_AS_STRING(unicode);
19573 0 : } else if (PyBytes_Check(value)) {
19574 0 : test_str = PyBytes_AS_STRING(value);
19575 : } else {
19576 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19577 0 : return -1;
19578 : }
19579 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19580 0 : if (unicode != NULL) {
19581 0 : Py_DECREF(unicode);
19582 : }
19583 0 : if (talloc_str == NULL) {
19584 0 : PyErr_NoMemory();
19585 0 : return -1;
19586 : }
19587 0 : *object->out.key_name = talloc_str;
19588 : }
19589 : }
19590 0 : return 0;
19591 : }
19592 :
19593 0 : static PyObject *py_svcctl_GetServiceKeyNameW_in_get_display_name_length(PyObject *obj, void *closure)
19594 : {
19595 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
19596 0 : PyObject *py_display_name_length;
19597 0 : if (object->in.display_name_length == NULL) {
19598 0 : Py_RETURN_NONE;
19599 : }
19600 0 : if (object->in.display_name_length == NULL) {
19601 0 : py_display_name_length = Py_None;
19602 0 : Py_INCREF(py_display_name_length);
19603 : } else {
19604 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
19605 : }
19606 0 : return py_display_name_length;
19607 : }
19608 :
19609 0 : static int py_svcctl_GetServiceKeyNameW_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
19610 : {
19611 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19612 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
19613 0 : if (value == NULL) {
19614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
19615 0 : return -1;
19616 : }
19617 0 : if (value == Py_None) {
19618 0 : object->in.display_name_length = NULL;
19619 : } else {
19620 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
19621 0 : if (object->in.display_name_length == NULL) {
19622 0 : PyErr_NoMemory();
19623 0 : return -1;
19624 : }
19625 : {
19626 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
19627 0 : if (PyLong_Check(value)) {
19628 0 : unsigned long long test_var;
19629 0 : test_var = PyLong_AsUnsignedLongLong(value);
19630 0 : if (PyErr_Occurred() != NULL) {
19631 0 : return -1;
19632 : }
19633 0 : if (test_var > uint_max) {
19634 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19635 : PyLong_Type.tp_name, uint_max, test_var);
19636 0 : return -1;
19637 : }
19638 0 : *object->in.display_name_length = test_var;
19639 : } else {
19640 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19641 : PyLong_Type.tp_name);
19642 0 : return -1;
19643 : }
19644 : }
19645 : }
19646 0 : return 0;
19647 : }
19648 :
19649 0 : static PyObject *py_svcctl_GetServiceKeyNameW_out_get_display_name_length(PyObject *obj, void *closure)
19650 : {
19651 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
19652 0 : PyObject *py_display_name_length;
19653 0 : if (object->out.display_name_length == NULL) {
19654 0 : Py_RETURN_NONE;
19655 : }
19656 0 : if (object->out.display_name_length == NULL) {
19657 0 : py_display_name_length = Py_None;
19658 0 : Py_INCREF(py_display_name_length);
19659 : } else {
19660 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
19661 : }
19662 0 : return py_display_name_length;
19663 : }
19664 :
19665 0 : static int py_svcctl_GetServiceKeyNameW_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
19666 : {
19667 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19668 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
19669 0 : if (value == NULL) {
19670 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
19671 0 : return -1;
19672 : }
19673 0 : if (value == Py_None) {
19674 0 : object->out.display_name_length = NULL;
19675 : } else {
19676 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
19677 0 : if (object->out.display_name_length == NULL) {
19678 0 : PyErr_NoMemory();
19679 0 : return -1;
19680 : }
19681 : {
19682 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
19683 0 : if (PyLong_Check(value)) {
19684 0 : unsigned long long test_var;
19685 0 : test_var = PyLong_AsUnsignedLongLong(value);
19686 0 : if (PyErr_Occurred() != NULL) {
19687 0 : return -1;
19688 : }
19689 0 : if (test_var > uint_max) {
19690 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19691 : PyLong_Type.tp_name, uint_max, test_var);
19692 0 : return -1;
19693 : }
19694 0 : *object->out.display_name_length = test_var;
19695 : } else {
19696 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19697 : PyLong_Type.tp_name);
19698 0 : return -1;
19699 : }
19700 : }
19701 : }
19702 0 : return 0;
19703 : }
19704 :
19705 0 : static PyObject *py_svcctl_GetServiceKeyNameW_get_result(PyObject *obj, void *closure)
19706 : {
19707 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
19708 0 : PyObject *py_result;
19709 0 : py_result = PyErr_FromWERROR(object->out.result);
19710 0 : return py_result;
19711 : }
19712 :
19713 0 : static int py_svcctl_GetServiceKeyNameW_set_result(PyObject *py_obj, PyObject *value, void *closure)
19714 : {
19715 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19716 0 : if (value == NULL) {
19717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
19718 0 : return -1;
19719 : }
19720 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
19721 0 : return 0;
19722 : }
19723 :
19724 : static PyGetSetDef py_svcctl_GetServiceKeyNameW_getsetters[] = {
19725 : {
19726 : .name = discard_const_p(char, "in_handle"),
19727 : .get = py_svcctl_GetServiceKeyNameW_in_get_handle,
19728 : .set = py_svcctl_GetServiceKeyNameW_in_set_handle,
19729 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
19730 : },
19731 : {
19732 : .name = discard_const_p(char, "in_service_name"),
19733 : .get = py_svcctl_GetServiceKeyNameW_in_get_service_name,
19734 : .set = py_svcctl_GetServiceKeyNameW_in_set_service_name,
19735 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19736 : },
19737 : {
19738 : .name = discard_const_p(char, "out_key_name"),
19739 : .get = py_svcctl_GetServiceKeyNameW_out_get_key_name,
19740 : .set = py_svcctl_GetServiceKeyNameW_out_set_key_name,
19741 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19742 : },
19743 : {
19744 : .name = discard_const_p(char, "in_display_name_length"),
19745 : .get = py_svcctl_GetServiceKeyNameW_in_get_display_name_length,
19746 : .set = py_svcctl_GetServiceKeyNameW_in_set_display_name_length,
19747 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19748 : },
19749 : {
19750 : .name = discard_const_p(char, "out_display_name_length"),
19751 : .get = py_svcctl_GetServiceKeyNameW_out_get_display_name_length,
19752 : .set = py_svcctl_GetServiceKeyNameW_out_set_display_name_length,
19753 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19754 : },
19755 : {
19756 : .name = discard_const_p(char, "result"),
19757 : .get = py_svcctl_GetServiceKeyNameW_get_result,
19758 : .set = py_svcctl_GetServiceKeyNameW_set_result,
19759 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
19760 : },
19761 : { .name = NULL }
19762 : };
19763 :
19764 0 : static PyObject *py_svcctl_GetServiceKeyNameW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19765 : {
19766 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceKeyNameW, type);
19767 0 : struct svcctl_GetServiceKeyNameW *_self = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(self);
19768 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19769 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
19770 0 : return self;
19771 : }
19772 :
19773 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19774 : {
19775 :
19776 :
19777 0 : return PyLong_FromLong(21);
19778 : }
19779 :
19780 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
19781 : {
19782 0 : const struct ndr_interface_call *call = NULL;
19783 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19784 0 : PyObject *ret = NULL;
19785 0 : struct ndr_push *push = NULL;
19786 0 : DATA_BLOB blob;
19787 0 : enum ndr_err_code err;
19788 :
19789 0 : if (ndr_table_svcctl.num_calls < 22) {
19790 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameW_ndr_pack");
19791 0 : return NULL;
19792 : }
19793 0 : call = &ndr_table_svcctl.calls[21];
19794 :
19795 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19796 0 : if (push == NULL) {
19797 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19798 0 : return NULL;
19799 : }
19800 :
19801 0 : push->flags |= ndr_push_flags;
19802 :
19803 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19804 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19805 0 : TALLOC_FREE(push);
19806 0 : PyErr_SetNdrError(err);
19807 0 : return NULL;
19808 : }
19809 0 : blob = ndr_push_blob(push);
19810 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19811 0 : TALLOC_FREE(push);
19812 0 : return ret;
19813 : }
19814 :
19815 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19816 : {
19817 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19818 0 : PyObject *bigendian_obj = NULL;
19819 0 : PyObject *ndr64_obj = NULL;
19820 0 : libndr_flags ndr_push_flags = 0;
19821 :
19822 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19823 : discard_const_p(char *, kwnames),
19824 : &bigendian_obj,
19825 : &ndr64_obj)) {
19826 0 : return NULL;
19827 : }
19828 :
19829 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19830 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19831 : }
19832 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19833 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19834 : }
19835 :
19836 0 : return py_svcctl_GetServiceKeyNameW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19837 : }
19838 :
19839 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19840 : {
19841 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19842 0 : PyObject *bigendian_obj = NULL;
19843 0 : PyObject *ndr64_obj = NULL;
19844 0 : libndr_flags ndr_push_flags = 0;
19845 :
19846 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19847 : discard_const_p(char *, kwnames),
19848 : &bigendian_obj,
19849 : &ndr64_obj)) {
19850 0 : return NULL;
19851 : }
19852 :
19853 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19854 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19855 : }
19856 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19857 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19858 : }
19859 :
19860 0 : return py_svcctl_GetServiceKeyNameW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19861 : }
19862 :
19863 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
19864 : {
19865 0 : const struct ndr_interface_call *call = NULL;
19866 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19867 0 : struct ndr_pull *pull = NULL;
19868 0 : enum ndr_err_code err;
19869 :
19870 0 : if (ndr_table_svcctl.num_calls < 22) {
19871 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameW_ndr_unpack");
19872 0 : return NULL;
19873 : }
19874 0 : call = &ndr_table_svcctl.calls[21];
19875 :
19876 0 : pull = ndr_pull_init_blob(blob, object);
19877 0 : if (pull == NULL) {
19878 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19879 0 : return NULL;
19880 : }
19881 :
19882 0 : pull->flags |= ndr_pull_flags;
19883 :
19884 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19885 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19886 0 : TALLOC_FREE(pull);
19887 0 : PyErr_SetNdrError(err);
19888 0 : return NULL;
19889 : }
19890 0 : if (!allow_remaining) {
19891 0 : uint32_t highest_ofs;
19892 :
19893 0 : if (pull->offset > pull->relative_highest_offset) {
19894 0 : highest_ofs = pull->offset;
19895 : } else {
19896 0 : highest_ofs = pull->relative_highest_offset;
19897 : }
19898 0 : if (highest_ofs < pull->data_size) {
19899 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19900 : "not all bytes consumed ofs[%u] size[%u]",
19901 : highest_ofs, pull->data_size);
19902 0 : TALLOC_FREE(pull);
19903 0 : PyErr_SetNdrError(err);
19904 0 : return NULL;
19905 : }
19906 : }
19907 :
19908 0 : TALLOC_FREE(pull);
19909 0 : Py_RETURN_NONE;
19910 : }
19911 :
19912 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19913 : {
19914 0 : DATA_BLOB blob;
19915 0 : Py_ssize_t blob_length = 0;
19916 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19917 0 : PyObject *bigendian_obj = NULL;
19918 0 : PyObject *ndr64_obj = NULL;
19919 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19920 0 : PyObject *allow_remaining_obj = NULL;
19921 0 : bool allow_remaining = false;
19922 :
19923 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19924 : discard_const_p(char *, kwnames),
19925 : &blob.data, &blob_length,
19926 : &bigendian_obj,
19927 : &ndr64_obj,
19928 : &allow_remaining_obj)) {
19929 0 : return NULL;
19930 : }
19931 0 : blob.length = blob_length;
19932 :
19933 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19934 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19935 : }
19936 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19937 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19938 : }
19939 :
19940 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19941 0 : allow_remaining = true;
19942 : }
19943 :
19944 0 : return py_svcctl_GetServiceKeyNameW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19945 : }
19946 :
19947 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19948 : {
19949 0 : DATA_BLOB blob;
19950 0 : Py_ssize_t blob_length = 0;
19951 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19952 0 : PyObject *bigendian_obj = NULL;
19953 0 : PyObject *ndr64_obj = NULL;
19954 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19955 0 : PyObject *allow_remaining_obj = NULL;
19956 0 : bool allow_remaining = false;
19957 :
19958 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19959 : discard_const_p(char *, kwnames),
19960 : &blob.data, &blob_length,
19961 : &bigendian_obj,
19962 : &ndr64_obj,
19963 : &allow_remaining_obj)) {
19964 0 : return NULL;
19965 : }
19966 0 : blob.length = blob_length;
19967 :
19968 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19969 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19970 : }
19971 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19972 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19973 : }
19974 :
19975 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19976 0 : allow_remaining = true;
19977 : }
19978 :
19979 0 : return py_svcctl_GetServiceKeyNameW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19980 : }
19981 :
19982 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19983 : {
19984 0 : const struct ndr_interface_call *call = NULL;
19985 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
19986 0 : PyObject *ret;
19987 0 : char *retstr;
19988 :
19989 0 : if (ndr_table_svcctl.num_calls < 22) {
19990 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameW_ndr_print");
19991 0 : return NULL;
19992 : }
19993 0 : call = &ndr_table_svcctl.calls[21];
19994 :
19995 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19996 0 : ret = PyUnicode_FromString(retstr);
19997 0 : TALLOC_FREE(retstr);
19998 :
19999 0 : return ret;
20000 : }
20001 :
20002 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20003 : {
20004 0 : return py_svcctl_GetServiceKeyNameW_ndr_print(py_obj, "svcctl_GetServiceKeyNameW_in", NDR_IN);
20005 : }
20006 :
20007 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20008 : {
20009 0 : return py_svcctl_GetServiceKeyNameW_ndr_print(py_obj, "svcctl_GetServiceKeyNameW_out", NDR_OUT);
20010 : }
20011 :
20012 : static PyMethodDef py_svcctl_GetServiceKeyNameW_methods[] = {
20013 : { "opnum", (PyCFunction)py_svcctl_GetServiceKeyNameW_ndr_opnum, METH_NOARGS|METH_CLASS,
20014 : "svcctl.GetServiceKeyNameW.opnum() -> 21 (0x15) " },
20015 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20016 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20017 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20018 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20019 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20020 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20021 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20022 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20023 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceKeyNameW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20024 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceKeyNameW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20025 : { NULL, NULL, 0, NULL }
20026 : };
20027 :
20028 :
20029 : static PyTypeObject svcctl_GetServiceKeyNameW_Type = {
20030 : PyVarObject_HEAD_INIT(NULL, 0)
20031 : .tp_name = "svcctl.GetServiceKeyNameW",
20032 : .tp_getset = py_svcctl_GetServiceKeyNameW_getsetters,
20033 : .tp_methods = py_svcctl_GetServiceKeyNameW_methods,
20034 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20035 : .tp_new = py_svcctl_GetServiceKeyNameW_new,
20036 : };
20037 :
20038 0 : static bool pack_py_svcctl_GetServiceKeyNameW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceKeyNameW *r)
20039 : {
20040 0 : PyObject *py_handle;
20041 0 : PyObject *py_service_name;
20042 0 : PyObject *py_display_name_length;
20043 0 : const char *kwnames[] = {
20044 : "handle", "service_name", "display_name_length", NULL
20045 : };
20046 :
20047 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceKeyNameW", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
20048 0 : return false;
20049 : }
20050 :
20051 0 : if (py_handle == NULL) {
20052 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
20053 0 : return false;
20054 : }
20055 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
20056 0 : if (r->in.handle == NULL) {
20057 0 : PyErr_NoMemory();
20058 0 : return false;
20059 : }
20060 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
20061 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
20062 0 : PyErr_NoMemory();
20063 0 : return false;
20064 : }
20065 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
20066 0 : if (py_service_name == NULL) {
20067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
20068 0 : return false;
20069 : }
20070 0 : if (py_service_name == Py_None) {
20071 0 : r->in.service_name = NULL;
20072 : } else {
20073 0 : r->in.service_name = NULL;
20074 : {
20075 0 : const char *test_str;
20076 0 : const char *talloc_str;
20077 0 : PyObject *unicode = NULL;
20078 0 : if (PyUnicode_Check(py_service_name)) {
20079 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
20080 0 : if (unicode == NULL) {
20081 0 : return false;
20082 : }
20083 0 : test_str = PyBytes_AS_STRING(unicode);
20084 0 : } else if (PyBytes_Check(py_service_name)) {
20085 0 : test_str = PyBytes_AS_STRING(py_service_name);
20086 : } else {
20087 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
20088 0 : return false;
20089 : }
20090 0 : talloc_str = talloc_strdup(r, test_str);
20091 0 : if (unicode != NULL) {
20092 0 : Py_DECREF(unicode);
20093 : }
20094 0 : if (talloc_str == NULL) {
20095 0 : PyErr_NoMemory();
20096 0 : return false;
20097 : }
20098 0 : r->in.service_name = talloc_str;
20099 : }
20100 : }
20101 0 : if (py_display_name_length == NULL) {
20102 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
20103 0 : return false;
20104 : }
20105 0 : if (py_display_name_length == Py_None) {
20106 0 : r->in.display_name_length = NULL;
20107 : } else {
20108 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
20109 0 : if (r->in.display_name_length == NULL) {
20110 0 : PyErr_NoMemory();
20111 0 : return false;
20112 : }
20113 : {
20114 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
20115 0 : if (PyLong_Check(py_display_name_length)) {
20116 0 : unsigned long long test_var;
20117 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
20118 0 : if (PyErr_Occurred() != NULL) {
20119 0 : return false;
20120 : }
20121 0 : if (test_var > uint_max) {
20122 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20123 : PyLong_Type.tp_name, uint_max, test_var);
20124 0 : return false;
20125 : }
20126 0 : *r->in.display_name_length = test_var;
20127 : } else {
20128 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20129 : PyLong_Type.tp_name);
20130 0 : return false;
20131 : }
20132 : }
20133 : }
20134 0 : return true;
20135 : }
20136 :
20137 0 : static PyObject *unpack_py_svcctl_GetServiceKeyNameW_args_out(struct svcctl_GetServiceKeyNameW *r)
20138 : {
20139 0 : PyObject *result;
20140 0 : PyObject *py_key_name;
20141 0 : PyObject *py_display_name_length;
20142 0 : result = PyTuple_New(2);
20143 0 : if (*r->out.key_name == NULL) {
20144 0 : py_key_name = Py_None;
20145 0 : Py_INCREF(py_key_name);
20146 : } else {
20147 0 : if (*r->out.key_name == NULL) {
20148 0 : py_key_name = Py_None;
20149 0 : Py_INCREF(py_key_name);
20150 : } else {
20151 0 : py_key_name = PyUnicode_Decode(*r->out.key_name, strlen(*r->out.key_name), "utf-8", "ignore");
20152 : }
20153 : }
20154 0 : PyTuple_SetItem(result, 0, py_key_name);
20155 0 : if (r->out.display_name_length == NULL) {
20156 0 : py_display_name_length = Py_None;
20157 0 : Py_INCREF(py_display_name_length);
20158 : } else {
20159 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
20160 : }
20161 0 : PyTuple_SetItem(result, 1, py_display_name_length);
20162 0 : if (!W_ERROR_IS_OK(r->out.result)) {
20163 0 : PyErr_SetWERROR(r->out.result);
20164 0 : return NULL;
20165 : }
20166 :
20167 0 : return result;
20168 : }
20169 :
20170 :
20171 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_handle(PyObject *obj, void *closure)
20172 : {
20173 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
20174 0 : PyObject *py_handle;
20175 0 : if (object->in.handle == NULL) {
20176 0 : Py_RETURN_NONE;
20177 : }
20178 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20179 0 : return py_handle;
20180 : }
20181 :
20182 0 : static int py_svcctl_SCSetServiceBitsA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20183 : {
20184 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20185 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20186 0 : if (value == NULL) {
20187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
20188 0 : return -1;
20189 : }
20190 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20191 0 : if (object->in.handle == NULL) {
20192 0 : PyErr_NoMemory();
20193 0 : return -1;
20194 : }
20195 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20196 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20197 0 : PyErr_NoMemory();
20198 0 : return -1;
20199 : }
20200 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20201 0 : return 0;
20202 : }
20203 :
20204 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_bits(PyObject *obj, void *closure)
20205 : {
20206 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
20207 0 : PyObject *py_bits;
20208 0 : py_bits = PyLong_FromUnsignedLongLong((uint32_t)object->in.bits);
20209 0 : return py_bits;
20210 : }
20211 :
20212 0 : static int py_svcctl_SCSetServiceBitsA_in_set_bits(PyObject *py_obj, PyObject *value, void *closure)
20213 : {
20214 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20215 0 : if (value == NULL) {
20216 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bits");
20217 0 : return -1;
20218 : }
20219 : {
20220 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bits));
20221 0 : if (PyLong_Check(value)) {
20222 0 : unsigned long long test_var;
20223 0 : test_var = PyLong_AsUnsignedLongLong(value);
20224 0 : if (PyErr_Occurred() != NULL) {
20225 0 : return -1;
20226 : }
20227 0 : if (test_var > uint_max) {
20228 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20229 : PyLong_Type.tp_name, uint_max, test_var);
20230 0 : return -1;
20231 : }
20232 0 : object->in.bits = test_var;
20233 : } else {
20234 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20235 : PyLong_Type.tp_name);
20236 0 : return -1;
20237 : }
20238 : }
20239 0 : return 0;
20240 : }
20241 :
20242 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_bitson(PyObject *obj, void *closure)
20243 : {
20244 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
20245 0 : PyObject *py_bitson;
20246 0 : py_bitson = PyLong_FromUnsignedLongLong((uint32_t)object->in.bitson);
20247 0 : return py_bitson;
20248 : }
20249 :
20250 0 : static int py_svcctl_SCSetServiceBitsA_in_set_bitson(PyObject *py_obj, PyObject *value, void *closure)
20251 : {
20252 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20253 0 : if (value == NULL) {
20254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bitson");
20255 0 : return -1;
20256 : }
20257 : {
20258 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bitson));
20259 0 : if (PyLong_Check(value)) {
20260 0 : unsigned long long test_var;
20261 0 : test_var = PyLong_AsUnsignedLongLong(value);
20262 0 : if (PyErr_Occurred() != NULL) {
20263 0 : return -1;
20264 : }
20265 0 : if (test_var > uint_max) {
20266 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20267 : PyLong_Type.tp_name, uint_max, test_var);
20268 0 : return -1;
20269 : }
20270 0 : object->in.bitson = test_var;
20271 : } else {
20272 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20273 : PyLong_Type.tp_name);
20274 0 : return -1;
20275 : }
20276 : }
20277 0 : return 0;
20278 : }
20279 :
20280 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_immediate(PyObject *obj, void *closure)
20281 : {
20282 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
20283 0 : PyObject *py_immediate;
20284 0 : py_immediate = PyLong_FromUnsignedLongLong((uint32_t)object->in.immediate);
20285 0 : return py_immediate;
20286 : }
20287 :
20288 0 : static int py_svcctl_SCSetServiceBitsA_in_set_immediate(PyObject *py_obj, PyObject *value, void *closure)
20289 : {
20290 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20291 0 : if (value == NULL) {
20292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.immediate");
20293 0 : return -1;
20294 : }
20295 : {
20296 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.immediate));
20297 0 : if (PyLong_Check(value)) {
20298 0 : unsigned long long test_var;
20299 0 : test_var = PyLong_AsUnsignedLongLong(value);
20300 0 : if (PyErr_Occurred() != NULL) {
20301 0 : return -1;
20302 : }
20303 0 : if (test_var > uint_max) {
20304 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20305 : PyLong_Type.tp_name, uint_max, test_var);
20306 0 : return -1;
20307 : }
20308 0 : object->in.immediate = test_var;
20309 : } else {
20310 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20311 : PyLong_Type.tp_name);
20312 0 : return -1;
20313 : }
20314 : }
20315 0 : return 0;
20316 : }
20317 :
20318 0 : static PyObject *py_svcctl_SCSetServiceBitsA_get_result(PyObject *obj, void *closure)
20319 : {
20320 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
20321 0 : PyObject *py_result;
20322 0 : py_result = PyErr_FromWERROR(object->out.result);
20323 0 : return py_result;
20324 : }
20325 :
20326 0 : static int py_svcctl_SCSetServiceBitsA_set_result(PyObject *py_obj, PyObject *value, void *closure)
20327 : {
20328 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20329 0 : if (value == NULL) {
20330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20331 0 : return -1;
20332 : }
20333 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
20334 0 : return 0;
20335 : }
20336 :
20337 : static PyGetSetDef py_svcctl_SCSetServiceBitsA_getsetters[] = {
20338 : {
20339 : .name = discard_const_p(char, "in_handle"),
20340 : .get = py_svcctl_SCSetServiceBitsA_in_get_handle,
20341 : .set = py_svcctl_SCSetServiceBitsA_in_set_handle,
20342 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20343 : },
20344 : {
20345 : .name = discard_const_p(char, "in_bits"),
20346 : .get = py_svcctl_SCSetServiceBitsA_in_get_bits,
20347 : .set = py_svcctl_SCSetServiceBitsA_in_set_bits,
20348 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20349 : },
20350 : {
20351 : .name = discard_const_p(char, "in_bitson"),
20352 : .get = py_svcctl_SCSetServiceBitsA_in_get_bitson,
20353 : .set = py_svcctl_SCSetServiceBitsA_in_set_bitson,
20354 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20355 : },
20356 : {
20357 : .name = discard_const_p(char, "in_immediate"),
20358 : .get = py_svcctl_SCSetServiceBitsA_in_get_immediate,
20359 : .set = py_svcctl_SCSetServiceBitsA_in_set_immediate,
20360 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20361 : },
20362 : {
20363 : .name = discard_const_p(char, "result"),
20364 : .get = py_svcctl_SCSetServiceBitsA_get_result,
20365 : .set = py_svcctl_SCSetServiceBitsA_set_result,
20366 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
20367 : },
20368 : { .name = NULL }
20369 : };
20370 :
20371 0 : static PyObject *py_svcctl_SCSetServiceBitsA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20372 : {
20373 0 : PyObject *self = pytalloc_new(struct svcctl_SCSetServiceBitsA, type);
20374 0 : struct svcctl_SCSetServiceBitsA *_self = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(self);
20375 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20376 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20377 0 : return self;
20378 : }
20379 :
20380 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20381 : {
20382 :
20383 :
20384 0 : return PyLong_FromLong(22);
20385 : }
20386 :
20387 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20388 : {
20389 0 : const struct ndr_interface_call *call = NULL;
20390 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20391 0 : PyObject *ret = NULL;
20392 0 : struct ndr_push *push = NULL;
20393 0 : DATA_BLOB blob;
20394 0 : enum ndr_err_code err;
20395 :
20396 0 : if (ndr_table_svcctl.num_calls < 23) {
20397 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsA_ndr_pack");
20398 0 : return NULL;
20399 : }
20400 0 : call = &ndr_table_svcctl.calls[22];
20401 :
20402 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20403 0 : if (push == NULL) {
20404 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20405 0 : return NULL;
20406 : }
20407 :
20408 0 : push->flags |= ndr_push_flags;
20409 :
20410 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20411 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20412 0 : TALLOC_FREE(push);
20413 0 : PyErr_SetNdrError(err);
20414 0 : return NULL;
20415 : }
20416 0 : blob = ndr_push_blob(push);
20417 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20418 0 : TALLOC_FREE(push);
20419 0 : return ret;
20420 : }
20421 :
20422 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20423 : {
20424 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20425 0 : PyObject *bigendian_obj = NULL;
20426 0 : PyObject *ndr64_obj = NULL;
20427 0 : libndr_flags ndr_push_flags = 0;
20428 :
20429 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20430 : discard_const_p(char *, kwnames),
20431 : &bigendian_obj,
20432 : &ndr64_obj)) {
20433 0 : return NULL;
20434 : }
20435 :
20436 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20437 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20438 : }
20439 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20440 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20441 : }
20442 :
20443 0 : return py_svcctl_SCSetServiceBitsA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20444 : }
20445 :
20446 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20447 : {
20448 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20449 0 : PyObject *bigendian_obj = NULL;
20450 0 : PyObject *ndr64_obj = NULL;
20451 0 : libndr_flags ndr_push_flags = 0;
20452 :
20453 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20454 : discard_const_p(char *, kwnames),
20455 : &bigendian_obj,
20456 : &ndr64_obj)) {
20457 0 : return NULL;
20458 : }
20459 :
20460 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20461 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20462 : }
20463 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20464 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20465 : }
20466 :
20467 0 : return py_svcctl_SCSetServiceBitsA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20468 : }
20469 :
20470 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
20471 : {
20472 0 : const struct ndr_interface_call *call = NULL;
20473 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20474 0 : struct ndr_pull *pull = NULL;
20475 0 : enum ndr_err_code err;
20476 :
20477 0 : if (ndr_table_svcctl.num_calls < 23) {
20478 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsA_ndr_unpack");
20479 0 : return NULL;
20480 : }
20481 0 : call = &ndr_table_svcctl.calls[22];
20482 :
20483 0 : pull = ndr_pull_init_blob(blob, object);
20484 0 : if (pull == NULL) {
20485 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20486 0 : return NULL;
20487 : }
20488 :
20489 0 : pull->flags |= ndr_pull_flags;
20490 :
20491 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20492 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20493 0 : TALLOC_FREE(pull);
20494 0 : PyErr_SetNdrError(err);
20495 0 : return NULL;
20496 : }
20497 0 : if (!allow_remaining) {
20498 0 : uint32_t highest_ofs;
20499 :
20500 0 : if (pull->offset > pull->relative_highest_offset) {
20501 0 : highest_ofs = pull->offset;
20502 : } else {
20503 0 : highest_ofs = pull->relative_highest_offset;
20504 : }
20505 0 : if (highest_ofs < pull->data_size) {
20506 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20507 : "not all bytes consumed ofs[%u] size[%u]",
20508 : highest_ofs, pull->data_size);
20509 0 : TALLOC_FREE(pull);
20510 0 : PyErr_SetNdrError(err);
20511 0 : return NULL;
20512 : }
20513 : }
20514 :
20515 0 : TALLOC_FREE(pull);
20516 0 : Py_RETURN_NONE;
20517 : }
20518 :
20519 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20520 : {
20521 0 : DATA_BLOB blob;
20522 0 : Py_ssize_t blob_length = 0;
20523 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20524 0 : PyObject *bigendian_obj = NULL;
20525 0 : PyObject *ndr64_obj = NULL;
20526 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20527 0 : PyObject *allow_remaining_obj = NULL;
20528 0 : bool allow_remaining = false;
20529 :
20530 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20531 : discard_const_p(char *, kwnames),
20532 : &blob.data, &blob_length,
20533 : &bigendian_obj,
20534 : &ndr64_obj,
20535 : &allow_remaining_obj)) {
20536 0 : return NULL;
20537 : }
20538 0 : blob.length = blob_length;
20539 :
20540 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20541 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20542 : }
20543 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20544 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20545 : }
20546 :
20547 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20548 0 : allow_remaining = true;
20549 : }
20550 :
20551 0 : return py_svcctl_SCSetServiceBitsA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20552 : }
20553 :
20554 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20555 : {
20556 0 : DATA_BLOB blob;
20557 0 : Py_ssize_t blob_length = 0;
20558 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20559 0 : PyObject *bigendian_obj = NULL;
20560 0 : PyObject *ndr64_obj = NULL;
20561 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20562 0 : PyObject *allow_remaining_obj = NULL;
20563 0 : bool allow_remaining = false;
20564 :
20565 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20566 : discard_const_p(char *, kwnames),
20567 : &blob.data, &blob_length,
20568 : &bigendian_obj,
20569 : &ndr64_obj,
20570 : &allow_remaining_obj)) {
20571 0 : return NULL;
20572 : }
20573 0 : blob.length = blob_length;
20574 :
20575 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20576 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20577 : }
20578 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20579 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20580 : }
20581 :
20582 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20583 0 : allow_remaining = true;
20584 : }
20585 :
20586 0 : return py_svcctl_SCSetServiceBitsA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20587 : }
20588 :
20589 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
20590 : {
20591 0 : const struct ndr_interface_call *call = NULL;
20592 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
20593 0 : PyObject *ret;
20594 0 : char *retstr;
20595 :
20596 0 : if (ndr_table_svcctl.num_calls < 23) {
20597 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsA_ndr_print");
20598 0 : return NULL;
20599 : }
20600 0 : call = &ndr_table_svcctl.calls[22];
20601 :
20602 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20603 0 : ret = PyUnicode_FromString(retstr);
20604 0 : TALLOC_FREE(retstr);
20605 :
20606 0 : return ret;
20607 : }
20608 :
20609 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20610 : {
20611 0 : return py_svcctl_SCSetServiceBitsA_ndr_print(py_obj, "svcctl_SCSetServiceBitsA_in", NDR_IN);
20612 : }
20613 :
20614 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20615 : {
20616 0 : return py_svcctl_SCSetServiceBitsA_ndr_print(py_obj, "svcctl_SCSetServiceBitsA_out", NDR_OUT);
20617 : }
20618 :
20619 : static PyMethodDef py_svcctl_SCSetServiceBitsA_methods[] = {
20620 : { "opnum", (PyCFunction)py_svcctl_SCSetServiceBitsA_ndr_opnum, METH_NOARGS|METH_CLASS,
20621 : "svcctl.SCSetServiceBitsA.opnum() -> 22 (0x16) " },
20622 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20623 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20624 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20625 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20626 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20627 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20628 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20629 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20630 : { "__ndr_print_in__", (PyCFunction)py_svcctl_SCSetServiceBitsA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20631 : { "__ndr_print_out__", (PyCFunction)py_svcctl_SCSetServiceBitsA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20632 : { NULL, NULL, 0, NULL }
20633 : };
20634 :
20635 :
20636 : static PyTypeObject svcctl_SCSetServiceBitsA_Type = {
20637 : PyVarObject_HEAD_INIT(NULL, 0)
20638 : .tp_name = "svcctl.SCSetServiceBitsA",
20639 : .tp_getset = py_svcctl_SCSetServiceBitsA_getsetters,
20640 : .tp_methods = py_svcctl_SCSetServiceBitsA_methods,
20641 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20642 : .tp_new = py_svcctl_SCSetServiceBitsA_new,
20643 : };
20644 :
20645 0 : static bool pack_py_svcctl_SCSetServiceBitsA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SCSetServiceBitsA *r)
20646 : {
20647 0 : PyObject *py_handle;
20648 0 : PyObject *py_bits;
20649 0 : PyObject *py_bitson;
20650 0 : PyObject *py_immediate;
20651 0 : const char *kwnames[] = {
20652 : "handle", "bits", "bitson", "immediate", NULL
20653 : };
20654 :
20655 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:svcctl_SCSetServiceBitsA", discard_const_p(char *, kwnames), &py_handle, &py_bits, &py_bitson, &py_immediate)) {
20656 0 : return false;
20657 : }
20658 :
20659 0 : if (py_handle == NULL) {
20660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
20661 0 : return false;
20662 : }
20663 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
20664 0 : if (r->in.handle == NULL) {
20665 0 : PyErr_NoMemory();
20666 0 : return false;
20667 : }
20668 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
20669 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
20670 0 : PyErr_NoMemory();
20671 0 : return false;
20672 : }
20673 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
20674 0 : if (py_bits == NULL) {
20675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bits");
20676 0 : return false;
20677 : }
20678 : {
20679 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bits));
20680 0 : if (PyLong_Check(py_bits)) {
20681 0 : unsigned long long test_var;
20682 0 : test_var = PyLong_AsUnsignedLongLong(py_bits);
20683 0 : if (PyErr_Occurred() != NULL) {
20684 0 : return false;
20685 : }
20686 0 : if (test_var > uint_max) {
20687 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20688 : PyLong_Type.tp_name, uint_max, test_var);
20689 0 : return false;
20690 : }
20691 0 : r->in.bits = test_var;
20692 : } else {
20693 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20694 : PyLong_Type.tp_name);
20695 0 : return false;
20696 : }
20697 : }
20698 0 : if (py_bitson == NULL) {
20699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bitson");
20700 0 : return false;
20701 : }
20702 : {
20703 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bitson));
20704 0 : if (PyLong_Check(py_bitson)) {
20705 0 : unsigned long long test_var;
20706 0 : test_var = PyLong_AsUnsignedLongLong(py_bitson);
20707 0 : if (PyErr_Occurred() != NULL) {
20708 0 : return false;
20709 : }
20710 0 : if (test_var > uint_max) {
20711 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20712 : PyLong_Type.tp_name, uint_max, test_var);
20713 0 : return false;
20714 : }
20715 0 : r->in.bitson = test_var;
20716 : } else {
20717 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20718 : PyLong_Type.tp_name);
20719 0 : return false;
20720 : }
20721 : }
20722 0 : if (py_immediate == NULL) {
20723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.immediate");
20724 0 : return false;
20725 : }
20726 : {
20727 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.immediate));
20728 0 : if (PyLong_Check(py_immediate)) {
20729 0 : unsigned long long test_var;
20730 0 : test_var = PyLong_AsUnsignedLongLong(py_immediate);
20731 0 : if (PyErr_Occurred() != NULL) {
20732 0 : return false;
20733 : }
20734 0 : if (test_var > uint_max) {
20735 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20736 : PyLong_Type.tp_name, uint_max, test_var);
20737 0 : return false;
20738 : }
20739 0 : r->in.immediate = test_var;
20740 : } else {
20741 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20742 : PyLong_Type.tp_name);
20743 0 : return false;
20744 : }
20745 : }
20746 0 : return true;
20747 : }
20748 :
20749 0 : static PyObject *unpack_py_svcctl_SCSetServiceBitsA_args_out(struct svcctl_SCSetServiceBitsA *r)
20750 : {
20751 0 : PyObject *result;
20752 0 : result = Py_None;
20753 0 : Py_INCREF(result);
20754 0 : if (!W_ERROR_IS_OK(r->out.result)) {
20755 0 : PyErr_SetWERROR(r->out.result);
20756 0 : return NULL;
20757 : }
20758 :
20759 0 : return result;
20760 : }
20761 :
20762 :
20763 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_handle(PyObject *obj, void *closure)
20764 : {
20765 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
20766 0 : PyObject *py_handle;
20767 0 : if (object->in.handle == NULL) {
20768 0 : Py_RETURN_NONE;
20769 : }
20770 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20771 0 : return py_handle;
20772 : }
20773 :
20774 0 : static int py_svcctl_ChangeServiceConfigA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20775 : {
20776 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
20777 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20778 0 : if (value == NULL) {
20779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
20780 0 : return -1;
20781 : }
20782 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20783 0 : if (object->in.handle == NULL) {
20784 0 : PyErr_NoMemory();
20785 0 : return -1;
20786 : }
20787 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20788 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20789 0 : PyErr_NoMemory();
20790 0 : return -1;
20791 : }
20792 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20793 0 : return 0;
20794 : }
20795 :
20796 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_type(PyObject *obj, void *closure)
20797 : {
20798 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
20799 0 : PyObject *py_type;
20800 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
20801 0 : return py_type;
20802 : }
20803 :
20804 0 : static int py_svcctl_ChangeServiceConfigA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
20805 : {
20806 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
20807 0 : if (value == NULL) {
20808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
20809 0 : return -1;
20810 : }
20811 : {
20812 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
20813 0 : if (PyLong_Check(value)) {
20814 0 : unsigned long long test_var;
20815 0 : test_var = PyLong_AsUnsignedLongLong(value);
20816 0 : if (PyErr_Occurred() != NULL) {
20817 0 : return -1;
20818 : }
20819 0 : if (test_var > uint_max) {
20820 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20821 : PyLong_Type.tp_name, uint_max, test_var);
20822 0 : return -1;
20823 : }
20824 0 : object->in.type = test_var;
20825 : } else {
20826 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20827 : PyLong_Type.tp_name);
20828 0 : return -1;
20829 : }
20830 : }
20831 0 : return 0;
20832 : }
20833 :
20834 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_start_type(PyObject *obj, void *closure)
20835 : {
20836 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
20837 0 : PyObject *py_start_type;
20838 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
20839 0 : return py_start_type;
20840 : }
20841 :
20842 0 : static int py_svcctl_ChangeServiceConfigA_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
20843 : {
20844 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
20845 0 : if (value == NULL) {
20846 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
20847 0 : return -1;
20848 : }
20849 : {
20850 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
20851 0 : if (PyLong_Check(value)) {
20852 0 : unsigned long long test_var;
20853 0 : test_var = PyLong_AsUnsignedLongLong(value);
20854 0 : if (PyErr_Occurred() != NULL) {
20855 0 : return -1;
20856 : }
20857 0 : if (test_var > uint_max) {
20858 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20859 : PyLong_Type.tp_name, uint_max, test_var);
20860 0 : return -1;
20861 : }
20862 0 : object->in.start_type = test_var;
20863 : } else {
20864 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20865 : PyLong_Type.tp_name);
20866 0 : return -1;
20867 : }
20868 : }
20869 0 : return 0;
20870 : }
20871 :
20872 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_error_control(PyObject *obj, void *closure)
20873 : {
20874 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
20875 0 : PyObject *py_error_control;
20876 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
20877 0 : return py_error_control;
20878 : }
20879 :
20880 0 : static int py_svcctl_ChangeServiceConfigA_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
20881 : {
20882 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
20883 0 : if (value == NULL) {
20884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
20885 0 : return -1;
20886 : }
20887 : {
20888 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
20889 0 : if (PyLong_Check(value)) {
20890 0 : unsigned long long test_var;
20891 0 : test_var = PyLong_AsUnsignedLongLong(value);
20892 0 : if (PyErr_Occurred() != NULL) {
20893 0 : return -1;
20894 : }
20895 0 : if (test_var > uint_max) {
20896 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20897 : PyLong_Type.tp_name, uint_max, test_var);
20898 0 : return -1;
20899 : }
20900 0 : object->in.error_control = test_var;
20901 : } else {
20902 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20903 : PyLong_Type.tp_name);
20904 0 : return -1;
20905 : }
20906 : }
20907 0 : return 0;
20908 : }
20909 :
20910 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_binary_path(PyObject *obj, void *closure)
20911 : {
20912 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
20913 0 : PyObject *py_binary_path;
20914 0 : if (object->in.binary_path == NULL) {
20915 0 : Py_RETURN_NONE;
20916 : }
20917 0 : if (object->in.binary_path == NULL) {
20918 0 : py_binary_path = Py_None;
20919 0 : Py_INCREF(py_binary_path);
20920 : } else {
20921 0 : if (object->in.binary_path == NULL) {
20922 0 : py_binary_path = Py_None;
20923 0 : Py_INCREF(py_binary_path);
20924 : } else {
20925 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
20926 : }
20927 : }
20928 0 : return py_binary_path;
20929 : }
20930 :
20931 0 : static int py_svcctl_ChangeServiceConfigA_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
20932 : {
20933 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
20934 0 : if (value == NULL) {
20935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
20936 0 : return -1;
20937 : }
20938 0 : if (value == Py_None) {
20939 0 : object->in.binary_path = NULL;
20940 : } else {
20941 0 : object->in.binary_path = NULL;
20942 : {
20943 0 : const char *test_str;
20944 0 : const char *talloc_str;
20945 0 : PyObject *unicode = NULL;
20946 0 : if (PyUnicode_Check(value)) {
20947 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
20948 0 : if (unicode == NULL) {
20949 0 : return -1;
20950 : }
20951 0 : test_str = PyBytes_AS_STRING(unicode);
20952 0 : } else if (PyBytes_Check(value)) {
20953 0 : test_str = PyBytes_AS_STRING(value);
20954 : } else {
20955 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
20956 0 : return -1;
20957 : }
20958 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
20959 0 : if (unicode != NULL) {
20960 0 : Py_DECREF(unicode);
20961 : }
20962 0 : if (talloc_str == NULL) {
20963 0 : PyErr_NoMemory();
20964 0 : return -1;
20965 : }
20966 0 : object->in.binary_path = talloc_str;
20967 : }
20968 : }
20969 0 : return 0;
20970 : }
20971 :
20972 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_load_order_group(PyObject *obj, void *closure)
20973 : {
20974 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
20975 0 : PyObject *py_load_order_group;
20976 0 : if (object->in.load_order_group == NULL) {
20977 0 : Py_RETURN_NONE;
20978 : }
20979 0 : if (object->in.load_order_group == NULL) {
20980 0 : py_load_order_group = Py_None;
20981 0 : Py_INCREF(py_load_order_group);
20982 : } else {
20983 0 : if (object->in.load_order_group == NULL) {
20984 0 : py_load_order_group = Py_None;
20985 0 : Py_INCREF(py_load_order_group);
20986 : } else {
20987 0 : py_load_order_group = PyUnicode_Decode(object->in.load_order_group, strlen(object->in.load_order_group), "utf-8", "ignore");
20988 : }
20989 : }
20990 0 : return py_load_order_group;
20991 : }
20992 :
20993 0 : static int py_svcctl_ChangeServiceConfigA_in_set_load_order_group(PyObject *py_obj, PyObject *value, void *closure)
20994 : {
20995 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
20996 0 : if (value == NULL) {
20997 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.load_order_group");
20998 0 : return -1;
20999 : }
21000 0 : if (value == Py_None) {
21001 0 : object->in.load_order_group = NULL;
21002 : } else {
21003 0 : object->in.load_order_group = NULL;
21004 : {
21005 0 : const char *test_str;
21006 0 : const char *talloc_str;
21007 0 : PyObject *unicode = NULL;
21008 0 : if (PyUnicode_Check(value)) {
21009 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21010 0 : if (unicode == NULL) {
21011 0 : return -1;
21012 : }
21013 0 : test_str = PyBytes_AS_STRING(unicode);
21014 0 : } else if (PyBytes_Check(value)) {
21015 0 : test_str = PyBytes_AS_STRING(value);
21016 : } else {
21017 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21018 0 : return -1;
21019 : }
21020 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21021 0 : if (unicode != NULL) {
21022 0 : Py_DECREF(unicode);
21023 : }
21024 0 : if (talloc_str == NULL) {
21025 0 : PyErr_NoMemory();
21026 0 : return -1;
21027 : }
21028 0 : object->in.load_order_group = talloc_str;
21029 : }
21030 : }
21031 0 : return 0;
21032 : }
21033 :
21034 0 : static PyObject *py_svcctl_ChangeServiceConfigA_out_get_tag_id(PyObject *obj, void *closure)
21035 : {
21036 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
21037 0 : PyObject *py_tag_id;
21038 0 : if (object->out.tag_id == NULL) {
21039 0 : Py_RETURN_NONE;
21040 : }
21041 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->out.tag_id);
21042 0 : return py_tag_id;
21043 : }
21044 :
21045 0 : static int py_svcctl_ChangeServiceConfigA_out_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
21046 : {
21047 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21048 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.tag_id));
21049 0 : if (value == NULL) {
21050 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.tag_id");
21051 0 : return -1;
21052 : }
21053 0 : object->out.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.tag_id);
21054 0 : if (object->out.tag_id == NULL) {
21055 0 : PyErr_NoMemory();
21056 0 : return -1;
21057 : }
21058 : {
21059 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.tag_id));
21060 0 : if (PyLong_Check(value)) {
21061 0 : unsigned long long test_var;
21062 0 : test_var = PyLong_AsUnsignedLongLong(value);
21063 0 : if (PyErr_Occurred() != NULL) {
21064 0 : return -1;
21065 : }
21066 0 : if (test_var > uint_max) {
21067 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21068 : PyLong_Type.tp_name, uint_max, test_var);
21069 0 : return -1;
21070 : }
21071 0 : *object->out.tag_id = test_var;
21072 : } else {
21073 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21074 : PyLong_Type.tp_name);
21075 0 : return -1;
21076 : }
21077 : }
21078 0 : return 0;
21079 : }
21080 :
21081 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_dependencies(PyObject *obj, void *closure)
21082 : {
21083 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
21084 0 : PyObject *py_dependencies;
21085 0 : if (object->in.dependencies == NULL) {
21086 0 : Py_RETURN_NONE;
21087 : }
21088 0 : if (object->in.dependencies == NULL) {
21089 0 : py_dependencies = Py_None;
21090 0 : Py_INCREF(py_dependencies);
21091 : } else {
21092 0 : if (object->in.dependencies == NULL) {
21093 0 : py_dependencies = Py_None;
21094 0 : Py_INCREF(py_dependencies);
21095 : } else {
21096 0 : py_dependencies = PyUnicode_Decode(object->in.dependencies, strlen(object->in.dependencies), "utf-8", "ignore");
21097 : }
21098 : }
21099 0 : return py_dependencies;
21100 : }
21101 :
21102 0 : static int py_svcctl_ChangeServiceConfigA_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
21103 : {
21104 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21105 0 : if (value == NULL) {
21106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
21107 0 : return -1;
21108 : }
21109 0 : if (value == Py_None) {
21110 0 : object->in.dependencies = NULL;
21111 : } else {
21112 0 : object->in.dependencies = NULL;
21113 : {
21114 0 : const char *test_str;
21115 0 : const char *talloc_str;
21116 0 : PyObject *unicode = NULL;
21117 0 : if (PyUnicode_Check(value)) {
21118 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21119 0 : if (unicode == NULL) {
21120 0 : return -1;
21121 : }
21122 0 : test_str = PyBytes_AS_STRING(unicode);
21123 0 : } else if (PyBytes_Check(value)) {
21124 0 : test_str = PyBytes_AS_STRING(value);
21125 : } else {
21126 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21127 0 : return -1;
21128 : }
21129 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21130 0 : if (unicode != NULL) {
21131 0 : Py_DECREF(unicode);
21132 : }
21133 0 : if (talloc_str == NULL) {
21134 0 : PyErr_NoMemory();
21135 0 : return -1;
21136 : }
21137 0 : object->in.dependencies = talloc_str;
21138 : }
21139 : }
21140 0 : return 0;
21141 : }
21142 :
21143 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_service_start_name(PyObject *obj, void *closure)
21144 : {
21145 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
21146 0 : PyObject *py_service_start_name;
21147 0 : if (object->in.service_start_name == NULL) {
21148 0 : Py_RETURN_NONE;
21149 : }
21150 0 : if (object->in.service_start_name == NULL) {
21151 0 : py_service_start_name = Py_None;
21152 0 : Py_INCREF(py_service_start_name);
21153 : } else {
21154 0 : if (object->in.service_start_name == NULL) {
21155 0 : py_service_start_name = Py_None;
21156 0 : Py_INCREF(py_service_start_name);
21157 : } else {
21158 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
21159 : }
21160 : }
21161 0 : return py_service_start_name;
21162 : }
21163 :
21164 0 : static int py_svcctl_ChangeServiceConfigA_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
21165 : {
21166 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21167 0 : if (value == NULL) {
21168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
21169 0 : return -1;
21170 : }
21171 0 : if (value == Py_None) {
21172 0 : object->in.service_start_name = NULL;
21173 : } else {
21174 0 : object->in.service_start_name = NULL;
21175 : {
21176 0 : const char *test_str;
21177 0 : const char *talloc_str;
21178 0 : PyObject *unicode = NULL;
21179 0 : if (PyUnicode_Check(value)) {
21180 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21181 0 : if (unicode == NULL) {
21182 0 : return -1;
21183 : }
21184 0 : test_str = PyBytes_AS_STRING(unicode);
21185 0 : } else if (PyBytes_Check(value)) {
21186 0 : test_str = PyBytes_AS_STRING(value);
21187 : } else {
21188 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21189 0 : return -1;
21190 : }
21191 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21192 0 : if (unicode != NULL) {
21193 0 : Py_DECREF(unicode);
21194 : }
21195 0 : if (talloc_str == NULL) {
21196 0 : PyErr_NoMemory();
21197 0 : return -1;
21198 : }
21199 0 : object->in.service_start_name = talloc_str;
21200 : }
21201 : }
21202 0 : return 0;
21203 : }
21204 :
21205 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_password(PyObject *obj, void *closure)
21206 : {
21207 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
21208 0 : PyObject *py_password;
21209 0 : if (object->in.password == NULL) {
21210 0 : Py_RETURN_NONE;
21211 : }
21212 0 : if (object->in.password == NULL) {
21213 0 : py_password = Py_None;
21214 0 : Py_INCREF(py_password);
21215 : } else {
21216 0 : if (object->in.password == NULL) {
21217 0 : py_password = Py_None;
21218 0 : Py_INCREF(py_password);
21219 : } else {
21220 0 : py_password = PyUnicode_Decode(object->in.password, strlen(object->in.password), "utf-8", "ignore");
21221 : }
21222 : }
21223 0 : return py_password;
21224 : }
21225 :
21226 0 : static int py_svcctl_ChangeServiceConfigA_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
21227 : {
21228 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21229 0 : if (value == NULL) {
21230 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
21231 0 : return -1;
21232 : }
21233 0 : if (value == Py_None) {
21234 0 : object->in.password = NULL;
21235 : } else {
21236 0 : object->in.password = NULL;
21237 : {
21238 0 : const char *test_str;
21239 0 : const char *talloc_str;
21240 0 : PyObject *unicode = NULL;
21241 0 : if (PyUnicode_Check(value)) {
21242 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21243 0 : if (unicode == NULL) {
21244 0 : return -1;
21245 : }
21246 0 : test_str = PyBytes_AS_STRING(unicode);
21247 0 : } else if (PyBytes_Check(value)) {
21248 0 : test_str = PyBytes_AS_STRING(value);
21249 : } else {
21250 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21251 0 : return -1;
21252 : }
21253 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21254 0 : if (unicode != NULL) {
21255 0 : Py_DECREF(unicode);
21256 : }
21257 0 : if (talloc_str == NULL) {
21258 0 : PyErr_NoMemory();
21259 0 : return -1;
21260 : }
21261 0 : object->in.password = talloc_str;
21262 : }
21263 : }
21264 0 : return 0;
21265 : }
21266 :
21267 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_display_name(PyObject *obj, void *closure)
21268 : {
21269 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
21270 0 : PyObject *py_display_name;
21271 0 : if (object->in.display_name == NULL) {
21272 0 : Py_RETURN_NONE;
21273 : }
21274 0 : if (object->in.display_name == NULL) {
21275 0 : py_display_name = Py_None;
21276 0 : Py_INCREF(py_display_name);
21277 : } else {
21278 0 : if (object->in.display_name == NULL) {
21279 0 : py_display_name = Py_None;
21280 0 : Py_INCREF(py_display_name);
21281 : } else {
21282 0 : py_display_name = PyUnicode_Decode(object->in.display_name, strlen(object->in.display_name), "utf-8", "ignore");
21283 : }
21284 : }
21285 0 : return py_display_name;
21286 : }
21287 :
21288 0 : static int py_svcctl_ChangeServiceConfigA_in_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
21289 : {
21290 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21291 0 : if (value == NULL) {
21292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name");
21293 0 : return -1;
21294 : }
21295 0 : if (value == Py_None) {
21296 0 : object->in.display_name = NULL;
21297 : } else {
21298 0 : object->in.display_name = NULL;
21299 : {
21300 0 : const char *test_str;
21301 0 : const char *talloc_str;
21302 0 : PyObject *unicode = NULL;
21303 0 : if (PyUnicode_Check(value)) {
21304 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21305 0 : if (unicode == NULL) {
21306 0 : return -1;
21307 : }
21308 0 : test_str = PyBytes_AS_STRING(unicode);
21309 0 : } else if (PyBytes_Check(value)) {
21310 0 : test_str = PyBytes_AS_STRING(value);
21311 : } else {
21312 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21313 0 : return -1;
21314 : }
21315 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21316 0 : if (unicode != NULL) {
21317 0 : Py_DECREF(unicode);
21318 : }
21319 0 : if (talloc_str == NULL) {
21320 0 : PyErr_NoMemory();
21321 0 : return -1;
21322 : }
21323 0 : object->in.display_name = talloc_str;
21324 : }
21325 : }
21326 0 : return 0;
21327 : }
21328 :
21329 0 : static PyObject *py_svcctl_ChangeServiceConfigA_get_result(PyObject *obj, void *closure)
21330 : {
21331 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
21332 0 : PyObject *py_result;
21333 0 : py_result = PyErr_FromWERROR(object->out.result);
21334 0 : return py_result;
21335 : }
21336 :
21337 0 : static int py_svcctl_ChangeServiceConfigA_set_result(PyObject *py_obj, PyObject *value, void *closure)
21338 : {
21339 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21340 0 : if (value == NULL) {
21341 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
21342 0 : return -1;
21343 : }
21344 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
21345 0 : return 0;
21346 : }
21347 :
21348 : static PyGetSetDef py_svcctl_ChangeServiceConfigA_getsetters[] = {
21349 : {
21350 : .name = discard_const_p(char, "in_handle"),
21351 : .get = py_svcctl_ChangeServiceConfigA_in_get_handle,
21352 : .set = py_svcctl_ChangeServiceConfigA_in_set_handle,
21353 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21354 : },
21355 : {
21356 : .name = discard_const_p(char, "in_type"),
21357 : .get = py_svcctl_ChangeServiceConfigA_in_get_type,
21358 : .set = py_svcctl_ChangeServiceConfigA_in_set_type,
21359 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
21360 : },
21361 : {
21362 : .name = discard_const_p(char, "in_start_type"),
21363 : .get = py_svcctl_ChangeServiceConfigA_in_get_start_type,
21364 : .set = py_svcctl_ChangeServiceConfigA_in_set_start_type,
21365 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
21366 : },
21367 : {
21368 : .name = discard_const_p(char, "in_error_control"),
21369 : .get = py_svcctl_ChangeServiceConfigA_in_get_error_control,
21370 : .set = py_svcctl_ChangeServiceConfigA_in_set_error_control,
21371 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
21372 : },
21373 : {
21374 : .name = discard_const_p(char, "in_binary_path"),
21375 : .get = py_svcctl_ChangeServiceConfigA_in_get_binary_path,
21376 : .set = py_svcctl_ChangeServiceConfigA_in_set_binary_path,
21377 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21378 : },
21379 : {
21380 : .name = discard_const_p(char, "in_load_order_group"),
21381 : .get = py_svcctl_ChangeServiceConfigA_in_get_load_order_group,
21382 : .set = py_svcctl_ChangeServiceConfigA_in_set_load_order_group,
21383 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21384 : },
21385 : {
21386 : .name = discard_const_p(char, "out_tag_id"),
21387 : .get = py_svcctl_ChangeServiceConfigA_out_get_tag_id,
21388 : .set = py_svcctl_ChangeServiceConfigA_out_set_tag_id,
21389 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
21390 : },
21391 : {
21392 : .name = discard_const_p(char, "in_dependencies"),
21393 : .get = py_svcctl_ChangeServiceConfigA_in_get_dependencies,
21394 : .set = py_svcctl_ChangeServiceConfigA_in_set_dependencies,
21395 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21396 : },
21397 : {
21398 : .name = discard_const_p(char, "in_service_start_name"),
21399 : .get = py_svcctl_ChangeServiceConfigA_in_get_service_start_name,
21400 : .set = py_svcctl_ChangeServiceConfigA_in_set_service_start_name,
21401 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21402 : },
21403 : {
21404 : .name = discard_const_p(char, "in_password"),
21405 : .get = py_svcctl_ChangeServiceConfigA_in_get_password,
21406 : .set = py_svcctl_ChangeServiceConfigA_in_set_password,
21407 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21408 : },
21409 : {
21410 : .name = discard_const_p(char, "in_display_name"),
21411 : .get = py_svcctl_ChangeServiceConfigA_in_get_display_name,
21412 : .set = py_svcctl_ChangeServiceConfigA_in_set_display_name,
21413 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21414 : },
21415 : {
21416 : .name = discard_const_p(char, "result"),
21417 : .get = py_svcctl_ChangeServiceConfigA_get_result,
21418 : .set = py_svcctl_ChangeServiceConfigA_set_result,
21419 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
21420 : },
21421 : { .name = NULL }
21422 : };
21423 :
21424 0 : static PyObject *py_svcctl_ChangeServiceConfigA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21425 : {
21426 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfigA, type);
21427 0 : struct svcctl_ChangeServiceConfigA *_self = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(self);
21428 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21429 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
21430 0 : _self->out.tag_id = talloc_zero(mem_ctx, uint32_t);
21431 0 : return self;
21432 : }
21433 :
21434 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21435 : {
21436 :
21437 :
21438 0 : return PyLong_FromLong(23);
21439 : }
21440 :
21441 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
21442 : {
21443 0 : const struct ndr_interface_call *call = NULL;
21444 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21445 0 : PyObject *ret = NULL;
21446 0 : struct ndr_push *push = NULL;
21447 0 : DATA_BLOB blob;
21448 0 : enum ndr_err_code err;
21449 :
21450 0 : if (ndr_table_svcctl.num_calls < 24) {
21451 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigA_ndr_pack");
21452 0 : return NULL;
21453 : }
21454 0 : call = &ndr_table_svcctl.calls[23];
21455 :
21456 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21457 0 : if (push == NULL) {
21458 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21459 0 : return NULL;
21460 : }
21461 :
21462 0 : push->flags |= ndr_push_flags;
21463 :
21464 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21465 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21466 0 : TALLOC_FREE(push);
21467 0 : PyErr_SetNdrError(err);
21468 0 : return NULL;
21469 : }
21470 0 : blob = ndr_push_blob(push);
21471 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21472 0 : TALLOC_FREE(push);
21473 0 : return ret;
21474 : }
21475 :
21476 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21477 : {
21478 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21479 0 : PyObject *bigendian_obj = NULL;
21480 0 : PyObject *ndr64_obj = NULL;
21481 0 : libndr_flags ndr_push_flags = 0;
21482 :
21483 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21484 : discard_const_p(char *, kwnames),
21485 : &bigendian_obj,
21486 : &ndr64_obj)) {
21487 0 : return NULL;
21488 : }
21489 :
21490 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21491 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21492 : }
21493 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21494 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21495 : }
21496 :
21497 0 : return py_svcctl_ChangeServiceConfigA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21498 : }
21499 :
21500 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21501 : {
21502 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21503 0 : PyObject *bigendian_obj = NULL;
21504 0 : PyObject *ndr64_obj = NULL;
21505 0 : libndr_flags ndr_push_flags = 0;
21506 :
21507 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21508 : discard_const_p(char *, kwnames),
21509 : &bigendian_obj,
21510 : &ndr64_obj)) {
21511 0 : return NULL;
21512 : }
21513 :
21514 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21515 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21516 : }
21517 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21518 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21519 : }
21520 :
21521 0 : return py_svcctl_ChangeServiceConfigA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21522 : }
21523 :
21524 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
21525 : {
21526 0 : const struct ndr_interface_call *call = NULL;
21527 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21528 0 : struct ndr_pull *pull = NULL;
21529 0 : enum ndr_err_code err;
21530 :
21531 0 : if (ndr_table_svcctl.num_calls < 24) {
21532 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigA_ndr_unpack");
21533 0 : return NULL;
21534 : }
21535 0 : call = &ndr_table_svcctl.calls[23];
21536 :
21537 0 : pull = ndr_pull_init_blob(blob, object);
21538 0 : if (pull == NULL) {
21539 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21540 0 : return NULL;
21541 : }
21542 :
21543 0 : pull->flags |= ndr_pull_flags;
21544 :
21545 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21546 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21547 0 : TALLOC_FREE(pull);
21548 0 : PyErr_SetNdrError(err);
21549 0 : return NULL;
21550 : }
21551 0 : if (!allow_remaining) {
21552 0 : uint32_t highest_ofs;
21553 :
21554 0 : if (pull->offset > pull->relative_highest_offset) {
21555 0 : highest_ofs = pull->offset;
21556 : } else {
21557 0 : highest_ofs = pull->relative_highest_offset;
21558 : }
21559 0 : if (highest_ofs < pull->data_size) {
21560 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21561 : "not all bytes consumed ofs[%u] size[%u]",
21562 : highest_ofs, pull->data_size);
21563 0 : TALLOC_FREE(pull);
21564 0 : PyErr_SetNdrError(err);
21565 0 : return NULL;
21566 : }
21567 : }
21568 :
21569 0 : TALLOC_FREE(pull);
21570 0 : Py_RETURN_NONE;
21571 : }
21572 :
21573 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21574 : {
21575 0 : DATA_BLOB blob;
21576 0 : Py_ssize_t blob_length = 0;
21577 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21578 0 : PyObject *bigendian_obj = NULL;
21579 0 : PyObject *ndr64_obj = NULL;
21580 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21581 0 : PyObject *allow_remaining_obj = NULL;
21582 0 : bool allow_remaining = false;
21583 :
21584 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21585 : discard_const_p(char *, kwnames),
21586 : &blob.data, &blob_length,
21587 : &bigendian_obj,
21588 : &ndr64_obj,
21589 : &allow_remaining_obj)) {
21590 0 : return NULL;
21591 : }
21592 0 : blob.length = blob_length;
21593 :
21594 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21595 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21596 : }
21597 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21598 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21599 : }
21600 :
21601 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21602 0 : allow_remaining = true;
21603 : }
21604 :
21605 0 : return py_svcctl_ChangeServiceConfigA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21606 : }
21607 :
21608 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21609 : {
21610 0 : DATA_BLOB blob;
21611 0 : Py_ssize_t blob_length = 0;
21612 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21613 0 : PyObject *bigendian_obj = NULL;
21614 0 : PyObject *ndr64_obj = NULL;
21615 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21616 0 : PyObject *allow_remaining_obj = NULL;
21617 0 : bool allow_remaining = false;
21618 :
21619 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21620 : discard_const_p(char *, kwnames),
21621 : &blob.data, &blob_length,
21622 : &bigendian_obj,
21623 : &ndr64_obj,
21624 : &allow_remaining_obj)) {
21625 0 : return NULL;
21626 : }
21627 0 : blob.length = blob_length;
21628 :
21629 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21630 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21631 : }
21632 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21633 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21634 : }
21635 :
21636 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21637 0 : allow_remaining = true;
21638 : }
21639 :
21640 0 : return py_svcctl_ChangeServiceConfigA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21641 : }
21642 :
21643 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21644 : {
21645 0 : const struct ndr_interface_call *call = NULL;
21646 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
21647 0 : PyObject *ret;
21648 0 : char *retstr;
21649 :
21650 0 : if (ndr_table_svcctl.num_calls < 24) {
21651 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigA_ndr_print");
21652 0 : return NULL;
21653 : }
21654 0 : call = &ndr_table_svcctl.calls[23];
21655 :
21656 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21657 0 : ret = PyUnicode_FromString(retstr);
21658 0 : TALLOC_FREE(retstr);
21659 :
21660 0 : return ret;
21661 : }
21662 :
21663 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21664 : {
21665 0 : return py_svcctl_ChangeServiceConfigA_ndr_print(py_obj, "svcctl_ChangeServiceConfigA_in", NDR_IN);
21666 : }
21667 :
21668 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21669 : {
21670 0 : return py_svcctl_ChangeServiceConfigA_ndr_print(py_obj, "svcctl_ChangeServiceConfigA_out", NDR_OUT);
21671 : }
21672 :
21673 : static PyMethodDef py_svcctl_ChangeServiceConfigA_methods[] = {
21674 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfigA_ndr_opnum, METH_NOARGS|METH_CLASS,
21675 : "svcctl.ChangeServiceConfigA.opnum() -> 23 (0x17) " },
21676 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21677 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21678 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21679 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21680 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21681 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21682 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21683 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21684 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfigA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21685 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfigA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21686 : { NULL, NULL, 0, NULL }
21687 : };
21688 :
21689 :
21690 : static PyTypeObject svcctl_ChangeServiceConfigA_Type = {
21691 : PyVarObject_HEAD_INIT(NULL, 0)
21692 : .tp_name = "svcctl.ChangeServiceConfigA",
21693 : .tp_getset = py_svcctl_ChangeServiceConfigA_getsetters,
21694 : .tp_methods = py_svcctl_ChangeServiceConfigA_methods,
21695 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21696 : .tp_new = py_svcctl_ChangeServiceConfigA_new,
21697 : };
21698 :
21699 0 : static bool pack_py_svcctl_ChangeServiceConfigA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfigA *r)
21700 : {
21701 0 : PyObject *py_handle;
21702 0 : PyObject *py_type;
21703 0 : PyObject *py_start_type;
21704 0 : PyObject *py_error_control;
21705 0 : PyObject *py_binary_path;
21706 0 : PyObject *py_load_order_group;
21707 0 : PyObject *py_dependencies;
21708 0 : PyObject *py_service_start_name;
21709 0 : PyObject *py_password;
21710 0 : PyObject *py_display_name;
21711 0 : const char *kwnames[] = {
21712 : "handle", "type", "start_type", "error_control", "binary_path", "load_order_group", "dependencies", "service_start_name", "password", "display_name", NULL
21713 : };
21714 :
21715 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOO:svcctl_ChangeServiceConfigA", discard_const_p(char *, kwnames), &py_handle, &py_type, &py_start_type, &py_error_control, &py_binary_path, &py_load_order_group, &py_dependencies, &py_service_start_name, &py_password, &py_display_name)) {
21716 0 : return false;
21717 : }
21718 :
21719 0 : if (py_handle == NULL) {
21720 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21721 0 : return false;
21722 : }
21723 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21724 0 : if (r->in.handle == NULL) {
21725 0 : PyErr_NoMemory();
21726 0 : return false;
21727 : }
21728 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21729 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21730 0 : PyErr_NoMemory();
21731 0 : return false;
21732 : }
21733 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21734 0 : if (py_type == NULL) {
21735 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
21736 0 : return false;
21737 : }
21738 : {
21739 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
21740 0 : if (PyLong_Check(py_type)) {
21741 0 : unsigned long long test_var;
21742 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
21743 0 : if (PyErr_Occurred() != NULL) {
21744 0 : return false;
21745 : }
21746 0 : if (test_var > uint_max) {
21747 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21748 : PyLong_Type.tp_name, uint_max, test_var);
21749 0 : return false;
21750 : }
21751 0 : r->in.type = test_var;
21752 : } else {
21753 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21754 : PyLong_Type.tp_name);
21755 0 : return false;
21756 : }
21757 : }
21758 0 : if (py_start_type == NULL) {
21759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
21760 0 : return false;
21761 : }
21762 : {
21763 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
21764 0 : if (PyLong_Check(py_start_type)) {
21765 0 : unsigned long long test_var;
21766 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
21767 0 : if (PyErr_Occurred() != NULL) {
21768 0 : return false;
21769 : }
21770 0 : if (test_var > uint_max) {
21771 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21772 : PyLong_Type.tp_name, uint_max, test_var);
21773 0 : return false;
21774 : }
21775 0 : r->in.start_type = test_var;
21776 : } else {
21777 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21778 : PyLong_Type.tp_name);
21779 0 : return false;
21780 : }
21781 : }
21782 0 : if (py_error_control == NULL) {
21783 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
21784 0 : return false;
21785 : }
21786 : {
21787 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
21788 0 : if (PyLong_Check(py_error_control)) {
21789 0 : unsigned long long test_var;
21790 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
21791 0 : if (PyErr_Occurred() != NULL) {
21792 0 : return false;
21793 : }
21794 0 : if (test_var > uint_max) {
21795 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21796 : PyLong_Type.tp_name, uint_max, test_var);
21797 0 : return false;
21798 : }
21799 0 : r->in.error_control = test_var;
21800 : } else {
21801 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21802 : PyLong_Type.tp_name);
21803 0 : return false;
21804 : }
21805 : }
21806 0 : if (py_binary_path == NULL) {
21807 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
21808 0 : return false;
21809 : }
21810 0 : if (py_binary_path == Py_None) {
21811 0 : r->in.binary_path = NULL;
21812 : } else {
21813 0 : r->in.binary_path = NULL;
21814 : {
21815 0 : const char *test_str;
21816 0 : const char *talloc_str;
21817 0 : PyObject *unicode = NULL;
21818 0 : if (PyUnicode_Check(py_binary_path)) {
21819 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
21820 0 : if (unicode == NULL) {
21821 0 : return false;
21822 : }
21823 0 : test_str = PyBytes_AS_STRING(unicode);
21824 0 : } else if (PyBytes_Check(py_binary_path)) {
21825 0 : test_str = PyBytes_AS_STRING(py_binary_path);
21826 : } else {
21827 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
21828 0 : return false;
21829 : }
21830 0 : talloc_str = talloc_strdup(r, test_str);
21831 0 : if (unicode != NULL) {
21832 0 : Py_DECREF(unicode);
21833 : }
21834 0 : if (talloc_str == NULL) {
21835 0 : PyErr_NoMemory();
21836 0 : return false;
21837 : }
21838 0 : r->in.binary_path = talloc_str;
21839 : }
21840 : }
21841 0 : if (py_load_order_group == NULL) {
21842 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.load_order_group");
21843 0 : return false;
21844 : }
21845 0 : if (py_load_order_group == Py_None) {
21846 0 : r->in.load_order_group = NULL;
21847 : } else {
21848 0 : r->in.load_order_group = NULL;
21849 : {
21850 0 : const char *test_str;
21851 0 : const char *talloc_str;
21852 0 : PyObject *unicode = NULL;
21853 0 : if (PyUnicode_Check(py_load_order_group)) {
21854 0 : unicode = PyUnicode_AsEncodedString(py_load_order_group, "utf-8", "ignore");
21855 0 : if (unicode == NULL) {
21856 0 : return false;
21857 : }
21858 0 : test_str = PyBytes_AS_STRING(unicode);
21859 0 : } else if (PyBytes_Check(py_load_order_group)) {
21860 0 : test_str = PyBytes_AS_STRING(py_load_order_group);
21861 : } else {
21862 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_load_order_group)->tp_name);
21863 0 : return false;
21864 : }
21865 0 : talloc_str = talloc_strdup(r, test_str);
21866 0 : if (unicode != NULL) {
21867 0 : Py_DECREF(unicode);
21868 : }
21869 0 : if (talloc_str == NULL) {
21870 0 : PyErr_NoMemory();
21871 0 : return false;
21872 : }
21873 0 : r->in.load_order_group = talloc_str;
21874 : }
21875 : }
21876 0 : if (py_dependencies == NULL) {
21877 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
21878 0 : return false;
21879 : }
21880 0 : if (py_dependencies == Py_None) {
21881 0 : r->in.dependencies = NULL;
21882 : } else {
21883 0 : r->in.dependencies = NULL;
21884 : {
21885 0 : const char *test_str;
21886 0 : const char *talloc_str;
21887 0 : PyObject *unicode = NULL;
21888 0 : if (PyUnicode_Check(py_dependencies)) {
21889 0 : unicode = PyUnicode_AsEncodedString(py_dependencies, "utf-8", "ignore");
21890 0 : if (unicode == NULL) {
21891 0 : return false;
21892 : }
21893 0 : test_str = PyBytes_AS_STRING(unicode);
21894 0 : } else if (PyBytes_Check(py_dependencies)) {
21895 0 : test_str = PyBytes_AS_STRING(py_dependencies);
21896 : } else {
21897 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dependencies)->tp_name);
21898 0 : return false;
21899 : }
21900 0 : talloc_str = talloc_strdup(r, test_str);
21901 0 : if (unicode != NULL) {
21902 0 : Py_DECREF(unicode);
21903 : }
21904 0 : if (talloc_str == NULL) {
21905 0 : PyErr_NoMemory();
21906 0 : return false;
21907 : }
21908 0 : r->in.dependencies = talloc_str;
21909 : }
21910 : }
21911 0 : if (py_service_start_name == NULL) {
21912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
21913 0 : return false;
21914 : }
21915 0 : if (py_service_start_name == Py_None) {
21916 0 : r->in.service_start_name = NULL;
21917 : } else {
21918 0 : r->in.service_start_name = NULL;
21919 : {
21920 0 : const char *test_str;
21921 0 : const char *talloc_str;
21922 0 : PyObject *unicode = NULL;
21923 0 : if (PyUnicode_Check(py_service_start_name)) {
21924 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
21925 0 : if (unicode == NULL) {
21926 0 : return false;
21927 : }
21928 0 : test_str = PyBytes_AS_STRING(unicode);
21929 0 : } else if (PyBytes_Check(py_service_start_name)) {
21930 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
21931 : } else {
21932 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
21933 0 : return false;
21934 : }
21935 0 : talloc_str = talloc_strdup(r, test_str);
21936 0 : if (unicode != NULL) {
21937 0 : Py_DECREF(unicode);
21938 : }
21939 0 : if (talloc_str == NULL) {
21940 0 : PyErr_NoMemory();
21941 0 : return false;
21942 : }
21943 0 : r->in.service_start_name = talloc_str;
21944 : }
21945 : }
21946 0 : if (py_password == NULL) {
21947 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
21948 0 : return false;
21949 : }
21950 0 : if (py_password == Py_None) {
21951 0 : r->in.password = NULL;
21952 : } else {
21953 0 : r->in.password = NULL;
21954 : {
21955 0 : const char *test_str;
21956 0 : const char *talloc_str;
21957 0 : PyObject *unicode = NULL;
21958 0 : if (PyUnicode_Check(py_password)) {
21959 0 : unicode = PyUnicode_AsEncodedString(py_password, "utf-8", "ignore");
21960 0 : if (unicode == NULL) {
21961 0 : return false;
21962 : }
21963 0 : test_str = PyBytes_AS_STRING(unicode);
21964 0 : } else if (PyBytes_Check(py_password)) {
21965 0 : test_str = PyBytes_AS_STRING(py_password);
21966 : } else {
21967 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_password)->tp_name);
21968 0 : return false;
21969 : }
21970 0 : talloc_str = talloc_strdup(r, test_str);
21971 0 : if (unicode != NULL) {
21972 0 : Py_DECREF(unicode);
21973 : }
21974 0 : if (talloc_str == NULL) {
21975 0 : PyErr_NoMemory();
21976 0 : return false;
21977 : }
21978 0 : r->in.password = talloc_str;
21979 : }
21980 : }
21981 0 : if (py_display_name == NULL) {
21982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name");
21983 0 : return false;
21984 : }
21985 0 : if (py_display_name == Py_None) {
21986 0 : r->in.display_name = NULL;
21987 : } else {
21988 0 : r->in.display_name = NULL;
21989 : {
21990 0 : const char *test_str;
21991 0 : const char *talloc_str;
21992 0 : PyObject *unicode = NULL;
21993 0 : if (PyUnicode_Check(py_display_name)) {
21994 0 : unicode = PyUnicode_AsEncodedString(py_display_name, "utf-8", "ignore");
21995 0 : if (unicode == NULL) {
21996 0 : return false;
21997 : }
21998 0 : test_str = PyBytes_AS_STRING(unicode);
21999 0 : } else if (PyBytes_Check(py_display_name)) {
22000 0 : test_str = PyBytes_AS_STRING(py_display_name);
22001 : } else {
22002 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_display_name)->tp_name);
22003 0 : return false;
22004 : }
22005 0 : talloc_str = talloc_strdup(r, test_str);
22006 0 : if (unicode != NULL) {
22007 0 : Py_DECREF(unicode);
22008 : }
22009 0 : if (talloc_str == NULL) {
22010 0 : PyErr_NoMemory();
22011 0 : return false;
22012 : }
22013 0 : r->in.display_name = talloc_str;
22014 : }
22015 : }
22016 0 : return true;
22017 : }
22018 :
22019 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfigA_args_out(struct svcctl_ChangeServiceConfigA *r)
22020 : {
22021 0 : PyObject *result;
22022 0 : PyObject *py_tag_id;
22023 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*r->out.tag_id);
22024 0 : result = py_tag_id;
22025 0 : if (!W_ERROR_IS_OK(r->out.result)) {
22026 0 : PyErr_SetWERROR(r->out.result);
22027 0 : return NULL;
22028 : }
22029 :
22030 0 : return result;
22031 : }
22032 :
22033 :
22034 0 : static PyObject *py_svcctl_CreateServiceA_in_get_handle(PyObject *obj, void *closure)
22035 : {
22036 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22037 0 : PyObject *py_handle;
22038 0 : if (object->in.handle == NULL) {
22039 0 : Py_RETURN_NONE;
22040 : }
22041 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22042 0 : return py_handle;
22043 : }
22044 :
22045 0 : static int py_svcctl_CreateServiceA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22046 : {
22047 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22048 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22049 0 : if (value == NULL) {
22050 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22051 0 : return -1;
22052 : }
22053 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22054 0 : if (object->in.handle == NULL) {
22055 0 : PyErr_NoMemory();
22056 0 : return -1;
22057 : }
22058 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22059 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22060 0 : PyErr_NoMemory();
22061 0 : return -1;
22062 : }
22063 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22064 0 : return 0;
22065 : }
22066 :
22067 0 : static PyObject *py_svcctl_CreateServiceA_in_get_ServiceName(PyObject *obj, void *closure)
22068 : {
22069 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22070 0 : PyObject *py_ServiceName;
22071 0 : if (object->in.ServiceName == NULL) {
22072 0 : Py_RETURN_NONE;
22073 : }
22074 0 : if (object->in.ServiceName == NULL) {
22075 0 : py_ServiceName = Py_None;
22076 0 : Py_INCREF(py_ServiceName);
22077 : } else {
22078 0 : if (object->in.ServiceName == NULL) {
22079 0 : py_ServiceName = Py_None;
22080 0 : Py_INCREF(py_ServiceName);
22081 : } else {
22082 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
22083 : }
22084 : }
22085 0 : return py_ServiceName;
22086 : }
22087 :
22088 0 : static int py_svcctl_CreateServiceA_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
22089 : {
22090 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22091 0 : if (value == NULL) {
22092 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
22093 0 : return -1;
22094 : }
22095 0 : if (value == Py_None) {
22096 0 : object->in.ServiceName = NULL;
22097 : } else {
22098 0 : object->in.ServiceName = NULL;
22099 : {
22100 0 : const char *test_str;
22101 0 : const char *talloc_str;
22102 0 : PyObject *unicode = NULL;
22103 0 : if (PyUnicode_Check(value)) {
22104 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22105 0 : if (unicode == NULL) {
22106 0 : return -1;
22107 : }
22108 0 : test_str = PyBytes_AS_STRING(unicode);
22109 0 : } else if (PyBytes_Check(value)) {
22110 0 : test_str = PyBytes_AS_STRING(value);
22111 : } else {
22112 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22113 0 : return -1;
22114 : }
22115 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22116 0 : if (unicode != NULL) {
22117 0 : Py_DECREF(unicode);
22118 : }
22119 0 : if (talloc_str == NULL) {
22120 0 : PyErr_NoMemory();
22121 0 : return -1;
22122 : }
22123 0 : object->in.ServiceName = talloc_str;
22124 : }
22125 : }
22126 0 : return 0;
22127 : }
22128 :
22129 0 : static PyObject *py_svcctl_CreateServiceA_in_get_DisplayName(PyObject *obj, void *closure)
22130 : {
22131 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22132 0 : PyObject *py_DisplayName;
22133 0 : if (object->in.DisplayName == NULL) {
22134 0 : Py_RETURN_NONE;
22135 : }
22136 0 : if (object->in.DisplayName == NULL) {
22137 0 : py_DisplayName = Py_None;
22138 0 : Py_INCREF(py_DisplayName);
22139 : } else {
22140 0 : if (object->in.DisplayName == NULL) {
22141 0 : py_DisplayName = Py_None;
22142 0 : Py_INCREF(py_DisplayName);
22143 : } else {
22144 0 : py_DisplayName = PyUnicode_Decode(object->in.DisplayName, strlen(object->in.DisplayName), "utf-8", "ignore");
22145 : }
22146 : }
22147 0 : return py_DisplayName;
22148 : }
22149 :
22150 0 : static int py_svcctl_CreateServiceA_in_set_DisplayName(PyObject *py_obj, PyObject *value, void *closure)
22151 : {
22152 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22153 0 : if (value == NULL) {
22154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DisplayName");
22155 0 : return -1;
22156 : }
22157 0 : if (value == Py_None) {
22158 0 : object->in.DisplayName = NULL;
22159 : } else {
22160 0 : object->in.DisplayName = NULL;
22161 : {
22162 0 : const char *test_str;
22163 0 : const char *talloc_str;
22164 0 : PyObject *unicode = NULL;
22165 0 : if (PyUnicode_Check(value)) {
22166 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22167 0 : if (unicode == NULL) {
22168 0 : return -1;
22169 : }
22170 0 : test_str = PyBytes_AS_STRING(unicode);
22171 0 : } else if (PyBytes_Check(value)) {
22172 0 : test_str = PyBytes_AS_STRING(value);
22173 : } else {
22174 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22175 0 : return -1;
22176 : }
22177 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22178 0 : if (unicode != NULL) {
22179 0 : Py_DECREF(unicode);
22180 : }
22181 0 : if (talloc_str == NULL) {
22182 0 : PyErr_NoMemory();
22183 0 : return -1;
22184 : }
22185 0 : object->in.DisplayName = talloc_str;
22186 : }
22187 : }
22188 0 : return 0;
22189 : }
22190 :
22191 0 : static PyObject *py_svcctl_CreateServiceA_in_get_desired_access(PyObject *obj, void *closure)
22192 : {
22193 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22194 0 : PyObject *py_desired_access;
22195 0 : py_desired_access = PyLong_FromUnsignedLongLong((uint32_t)object->in.desired_access);
22196 0 : return py_desired_access;
22197 : }
22198 :
22199 0 : static int py_svcctl_CreateServiceA_in_set_desired_access(PyObject *py_obj, PyObject *value, void *closure)
22200 : {
22201 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22202 0 : if (value == NULL) {
22203 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.desired_access");
22204 0 : return -1;
22205 : }
22206 : {
22207 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.desired_access));
22208 0 : if (PyLong_Check(value)) {
22209 0 : unsigned long long test_var;
22210 0 : test_var = PyLong_AsUnsignedLongLong(value);
22211 0 : if (PyErr_Occurred() != NULL) {
22212 0 : return -1;
22213 : }
22214 0 : if (test_var > uint_max) {
22215 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22216 : PyLong_Type.tp_name, uint_max, test_var);
22217 0 : return -1;
22218 : }
22219 0 : object->in.desired_access = test_var;
22220 : } else {
22221 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22222 : PyLong_Type.tp_name);
22223 0 : return -1;
22224 : }
22225 : }
22226 0 : return 0;
22227 : }
22228 :
22229 0 : static PyObject *py_svcctl_CreateServiceA_in_get_type(PyObject *obj, void *closure)
22230 : {
22231 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22232 0 : PyObject *py_type;
22233 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
22234 0 : return py_type;
22235 : }
22236 :
22237 0 : static int py_svcctl_CreateServiceA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
22238 : {
22239 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22240 0 : if (value == NULL) {
22241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
22242 0 : return -1;
22243 : }
22244 : {
22245 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
22246 0 : if (PyLong_Check(value)) {
22247 0 : unsigned long long test_var;
22248 0 : test_var = PyLong_AsUnsignedLongLong(value);
22249 0 : if (PyErr_Occurred() != NULL) {
22250 0 : return -1;
22251 : }
22252 0 : if (test_var > uint_max) {
22253 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22254 : PyLong_Type.tp_name, uint_max, test_var);
22255 0 : return -1;
22256 : }
22257 0 : object->in.type = test_var;
22258 : } else {
22259 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22260 : PyLong_Type.tp_name);
22261 0 : return -1;
22262 : }
22263 : }
22264 0 : return 0;
22265 : }
22266 :
22267 0 : static PyObject *py_svcctl_CreateServiceA_in_get_start_type(PyObject *obj, void *closure)
22268 : {
22269 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22270 0 : PyObject *py_start_type;
22271 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
22272 0 : return py_start_type;
22273 : }
22274 :
22275 0 : static int py_svcctl_CreateServiceA_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
22276 : {
22277 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22278 0 : if (value == NULL) {
22279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
22280 0 : return -1;
22281 : }
22282 : {
22283 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
22284 0 : if (PyLong_Check(value)) {
22285 0 : unsigned long long test_var;
22286 0 : test_var = PyLong_AsUnsignedLongLong(value);
22287 0 : if (PyErr_Occurred() != NULL) {
22288 0 : return -1;
22289 : }
22290 0 : if (test_var > uint_max) {
22291 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22292 : PyLong_Type.tp_name, uint_max, test_var);
22293 0 : return -1;
22294 : }
22295 0 : object->in.start_type = test_var;
22296 : } else {
22297 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22298 : PyLong_Type.tp_name);
22299 0 : return -1;
22300 : }
22301 : }
22302 0 : return 0;
22303 : }
22304 :
22305 0 : static PyObject *py_svcctl_CreateServiceA_in_get_error_control(PyObject *obj, void *closure)
22306 : {
22307 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22308 0 : PyObject *py_error_control;
22309 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
22310 0 : return py_error_control;
22311 : }
22312 :
22313 0 : static int py_svcctl_CreateServiceA_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
22314 : {
22315 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22316 0 : if (value == NULL) {
22317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
22318 0 : return -1;
22319 : }
22320 : {
22321 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
22322 0 : if (PyLong_Check(value)) {
22323 0 : unsigned long long test_var;
22324 0 : test_var = PyLong_AsUnsignedLongLong(value);
22325 0 : if (PyErr_Occurred() != NULL) {
22326 0 : return -1;
22327 : }
22328 0 : if (test_var > uint_max) {
22329 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22330 : PyLong_Type.tp_name, uint_max, test_var);
22331 0 : return -1;
22332 : }
22333 0 : object->in.error_control = test_var;
22334 : } else {
22335 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22336 : PyLong_Type.tp_name);
22337 0 : return -1;
22338 : }
22339 : }
22340 0 : return 0;
22341 : }
22342 :
22343 0 : static PyObject *py_svcctl_CreateServiceA_in_get_binary_path(PyObject *obj, void *closure)
22344 : {
22345 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22346 0 : PyObject *py_binary_path;
22347 0 : if (object->in.binary_path == NULL) {
22348 0 : Py_RETURN_NONE;
22349 : }
22350 0 : if (object->in.binary_path == NULL) {
22351 0 : py_binary_path = Py_None;
22352 0 : Py_INCREF(py_binary_path);
22353 : } else {
22354 0 : if (object->in.binary_path == NULL) {
22355 0 : py_binary_path = Py_None;
22356 0 : Py_INCREF(py_binary_path);
22357 : } else {
22358 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
22359 : }
22360 : }
22361 0 : return py_binary_path;
22362 : }
22363 :
22364 0 : static int py_svcctl_CreateServiceA_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
22365 : {
22366 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22367 0 : if (value == NULL) {
22368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
22369 0 : return -1;
22370 : }
22371 0 : if (value == Py_None) {
22372 0 : object->in.binary_path = NULL;
22373 : } else {
22374 0 : object->in.binary_path = NULL;
22375 : {
22376 0 : const char *test_str;
22377 0 : const char *talloc_str;
22378 0 : PyObject *unicode = NULL;
22379 0 : if (PyUnicode_Check(value)) {
22380 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22381 0 : if (unicode == NULL) {
22382 0 : return -1;
22383 : }
22384 0 : test_str = PyBytes_AS_STRING(unicode);
22385 0 : } else if (PyBytes_Check(value)) {
22386 0 : test_str = PyBytes_AS_STRING(value);
22387 : } else {
22388 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22389 0 : return -1;
22390 : }
22391 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22392 0 : if (unicode != NULL) {
22393 0 : Py_DECREF(unicode);
22394 : }
22395 0 : if (talloc_str == NULL) {
22396 0 : PyErr_NoMemory();
22397 0 : return -1;
22398 : }
22399 0 : object->in.binary_path = talloc_str;
22400 : }
22401 : }
22402 0 : return 0;
22403 : }
22404 :
22405 0 : static PyObject *py_svcctl_CreateServiceA_in_get_LoadOrderGroupKey(PyObject *obj, void *closure)
22406 : {
22407 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22408 0 : PyObject *py_LoadOrderGroupKey;
22409 0 : if (object->in.LoadOrderGroupKey == NULL) {
22410 0 : Py_RETURN_NONE;
22411 : }
22412 0 : if (object->in.LoadOrderGroupKey == NULL) {
22413 0 : py_LoadOrderGroupKey = Py_None;
22414 0 : Py_INCREF(py_LoadOrderGroupKey);
22415 : } else {
22416 0 : if (object->in.LoadOrderGroupKey == NULL) {
22417 0 : py_LoadOrderGroupKey = Py_None;
22418 0 : Py_INCREF(py_LoadOrderGroupKey);
22419 : } else {
22420 0 : py_LoadOrderGroupKey = PyUnicode_Decode(object->in.LoadOrderGroupKey, strlen(object->in.LoadOrderGroupKey), "utf-8", "ignore");
22421 : }
22422 : }
22423 0 : return py_LoadOrderGroupKey;
22424 : }
22425 :
22426 0 : static int py_svcctl_CreateServiceA_in_set_LoadOrderGroupKey(PyObject *py_obj, PyObject *value, void *closure)
22427 : {
22428 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22429 0 : if (value == NULL) {
22430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.LoadOrderGroupKey");
22431 0 : return -1;
22432 : }
22433 0 : if (value == Py_None) {
22434 0 : object->in.LoadOrderGroupKey = NULL;
22435 : } else {
22436 0 : object->in.LoadOrderGroupKey = NULL;
22437 : {
22438 0 : const char *test_str;
22439 0 : const char *talloc_str;
22440 0 : PyObject *unicode = NULL;
22441 0 : if (PyUnicode_Check(value)) {
22442 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22443 0 : if (unicode == NULL) {
22444 0 : return -1;
22445 : }
22446 0 : test_str = PyBytes_AS_STRING(unicode);
22447 0 : } else if (PyBytes_Check(value)) {
22448 0 : test_str = PyBytes_AS_STRING(value);
22449 : } else {
22450 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22451 0 : return -1;
22452 : }
22453 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22454 0 : if (unicode != NULL) {
22455 0 : Py_DECREF(unicode);
22456 : }
22457 0 : if (talloc_str == NULL) {
22458 0 : PyErr_NoMemory();
22459 0 : return -1;
22460 : }
22461 0 : object->in.LoadOrderGroupKey = talloc_str;
22462 : }
22463 : }
22464 0 : return 0;
22465 : }
22466 :
22467 0 : static PyObject *py_svcctl_CreateServiceA_out_get_TagId(PyObject *obj, void *closure)
22468 : {
22469 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22470 0 : PyObject *py_TagId;
22471 0 : if (object->out.TagId == NULL) {
22472 0 : Py_RETURN_NONE;
22473 : }
22474 0 : if (object->out.TagId == NULL) {
22475 0 : py_TagId = Py_None;
22476 0 : Py_INCREF(py_TagId);
22477 : } else {
22478 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.TagId);
22479 : }
22480 0 : return py_TagId;
22481 : }
22482 :
22483 0 : static int py_svcctl_CreateServiceA_out_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
22484 : {
22485 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22486 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.TagId));
22487 0 : if (value == NULL) {
22488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.TagId");
22489 0 : return -1;
22490 : }
22491 0 : if (value == Py_None) {
22492 0 : object->out.TagId = NULL;
22493 : } else {
22494 0 : object->out.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.TagId);
22495 0 : if (object->out.TagId == NULL) {
22496 0 : PyErr_NoMemory();
22497 0 : return -1;
22498 : }
22499 : {
22500 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.TagId));
22501 0 : if (PyLong_Check(value)) {
22502 0 : unsigned long long test_var;
22503 0 : test_var = PyLong_AsUnsignedLongLong(value);
22504 0 : if (PyErr_Occurred() != NULL) {
22505 0 : return -1;
22506 : }
22507 0 : if (test_var > uint_max) {
22508 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22509 : PyLong_Type.tp_name, uint_max, test_var);
22510 0 : return -1;
22511 : }
22512 0 : *object->out.TagId = test_var;
22513 : } else {
22514 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22515 : PyLong_Type.tp_name);
22516 0 : return -1;
22517 : }
22518 : }
22519 : }
22520 0 : return 0;
22521 : }
22522 :
22523 0 : static PyObject *py_svcctl_CreateServiceA_in_get_dependencies(PyObject *obj, void *closure)
22524 : {
22525 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22526 0 : PyObject *py_dependencies;
22527 0 : if (object->in.dependencies == NULL) {
22528 0 : Py_RETURN_NONE;
22529 : }
22530 0 : if (object->in.dependencies == NULL) {
22531 0 : py_dependencies = Py_None;
22532 0 : Py_INCREF(py_dependencies);
22533 : } else {
22534 0 : if (object->in.dependencies == NULL) {
22535 0 : py_dependencies = Py_None;
22536 0 : Py_INCREF(py_dependencies);
22537 : } else {
22538 0 : py_dependencies = PyUnicode_Decode(object->in.dependencies, strlen(object->in.dependencies), "utf-8", "ignore");
22539 : }
22540 : }
22541 0 : return py_dependencies;
22542 : }
22543 :
22544 0 : static int py_svcctl_CreateServiceA_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
22545 : {
22546 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22547 0 : if (value == NULL) {
22548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
22549 0 : return -1;
22550 : }
22551 0 : if (value == Py_None) {
22552 0 : object->in.dependencies = NULL;
22553 : } else {
22554 0 : object->in.dependencies = NULL;
22555 : {
22556 0 : const char *test_str;
22557 0 : const char *talloc_str;
22558 0 : PyObject *unicode = NULL;
22559 0 : if (PyUnicode_Check(value)) {
22560 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22561 0 : if (unicode == NULL) {
22562 0 : return -1;
22563 : }
22564 0 : test_str = PyBytes_AS_STRING(unicode);
22565 0 : } else if (PyBytes_Check(value)) {
22566 0 : test_str = PyBytes_AS_STRING(value);
22567 : } else {
22568 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22569 0 : return -1;
22570 : }
22571 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22572 0 : if (unicode != NULL) {
22573 0 : Py_DECREF(unicode);
22574 : }
22575 0 : if (talloc_str == NULL) {
22576 0 : PyErr_NoMemory();
22577 0 : return -1;
22578 : }
22579 0 : object->in.dependencies = talloc_str;
22580 : }
22581 : }
22582 0 : return 0;
22583 : }
22584 :
22585 0 : static PyObject *py_svcctl_CreateServiceA_in_get_service_start_name(PyObject *obj, void *closure)
22586 : {
22587 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22588 0 : PyObject *py_service_start_name;
22589 0 : if (object->in.service_start_name == NULL) {
22590 0 : Py_RETURN_NONE;
22591 : }
22592 0 : if (object->in.service_start_name == NULL) {
22593 0 : py_service_start_name = Py_None;
22594 0 : Py_INCREF(py_service_start_name);
22595 : } else {
22596 0 : if (object->in.service_start_name == NULL) {
22597 0 : py_service_start_name = Py_None;
22598 0 : Py_INCREF(py_service_start_name);
22599 : } else {
22600 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
22601 : }
22602 : }
22603 0 : return py_service_start_name;
22604 : }
22605 :
22606 0 : static int py_svcctl_CreateServiceA_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
22607 : {
22608 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22609 0 : if (value == NULL) {
22610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
22611 0 : return -1;
22612 : }
22613 0 : if (value == Py_None) {
22614 0 : object->in.service_start_name = NULL;
22615 : } else {
22616 0 : object->in.service_start_name = NULL;
22617 : {
22618 0 : const char *test_str;
22619 0 : const char *talloc_str;
22620 0 : PyObject *unicode = NULL;
22621 0 : if (PyUnicode_Check(value)) {
22622 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22623 0 : if (unicode == NULL) {
22624 0 : return -1;
22625 : }
22626 0 : test_str = PyBytes_AS_STRING(unicode);
22627 0 : } else if (PyBytes_Check(value)) {
22628 0 : test_str = PyBytes_AS_STRING(value);
22629 : } else {
22630 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22631 0 : return -1;
22632 : }
22633 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22634 0 : if (unicode != NULL) {
22635 0 : Py_DECREF(unicode);
22636 : }
22637 0 : if (talloc_str == NULL) {
22638 0 : PyErr_NoMemory();
22639 0 : return -1;
22640 : }
22641 0 : object->in.service_start_name = talloc_str;
22642 : }
22643 : }
22644 0 : return 0;
22645 : }
22646 :
22647 0 : static PyObject *py_svcctl_CreateServiceA_in_get_password(PyObject *obj, void *closure)
22648 : {
22649 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22650 0 : PyObject *py_password;
22651 0 : if (object->in.password == NULL) {
22652 0 : Py_RETURN_NONE;
22653 : }
22654 0 : if (object->in.password == NULL) {
22655 0 : py_password = Py_None;
22656 0 : Py_INCREF(py_password);
22657 : } else {
22658 0 : if (object->in.password == NULL) {
22659 0 : py_password = Py_None;
22660 0 : Py_INCREF(py_password);
22661 : } else {
22662 0 : py_password = PyUnicode_Decode(object->in.password, strlen(object->in.password), "utf-8", "ignore");
22663 : }
22664 : }
22665 0 : return py_password;
22666 : }
22667 :
22668 0 : static int py_svcctl_CreateServiceA_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
22669 : {
22670 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22671 0 : if (value == NULL) {
22672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
22673 0 : return -1;
22674 : }
22675 0 : if (value == Py_None) {
22676 0 : object->in.password = NULL;
22677 : } else {
22678 0 : object->in.password = NULL;
22679 : {
22680 0 : const char *test_str;
22681 0 : const char *talloc_str;
22682 0 : PyObject *unicode = NULL;
22683 0 : if (PyUnicode_Check(value)) {
22684 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22685 0 : if (unicode == NULL) {
22686 0 : return -1;
22687 : }
22688 0 : test_str = PyBytes_AS_STRING(unicode);
22689 0 : } else if (PyBytes_Check(value)) {
22690 0 : test_str = PyBytes_AS_STRING(value);
22691 : } else {
22692 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22693 0 : return -1;
22694 : }
22695 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22696 0 : if (unicode != NULL) {
22697 0 : Py_DECREF(unicode);
22698 : }
22699 0 : if (talloc_str == NULL) {
22700 0 : PyErr_NoMemory();
22701 0 : return -1;
22702 : }
22703 0 : object->in.password = talloc_str;
22704 : }
22705 : }
22706 0 : return 0;
22707 : }
22708 :
22709 0 : static PyObject *py_svcctl_CreateServiceA_get_result(PyObject *obj, void *closure)
22710 : {
22711 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
22712 0 : PyObject *py_result;
22713 0 : py_result = PyErr_FromWERROR(object->out.result);
22714 0 : return py_result;
22715 : }
22716 :
22717 0 : static int py_svcctl_CreateServiceA_set_result(PyObject *py_obj, PyObject *value, void *closure)
22718 : {
22719 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22720 0 : if (value == NULL) {
22721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22722 0 : return -1;
22723 : }
22724 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
22725 0 : return 0;
22726 : }
22727 :
22728 : static PyGetSetDef py_svcctl_CreateServiceA_getsetters[] = {
22729 : {
22730 : .name = discard_const_p(char, "in_handle"),
22731 : .get = py_svcctl_CreateServiceA_in_get_handle,
22732 : .set = py_svcctl_CreateServiceA_in_set_handle,
22733 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22734 : },
22735 : {
22736 : .name = discard_const_p(char, "in_ServiceName"),
22737 : .get = py_svcctl_CreateServiceA_in_get_ServiceName,
22738 : .set = py_svcctl_CreateServiceA_in_set_ServiceName,
22739 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22740 : },
22741 : {
22742 : .name = discard_const_p(char, "in_DisplayName"),
22743 : .get = py_svcctl_CreateServiceA_in_get_DisplayName,
22744 : .set = py_svcctl_CreateServiceA_in_set_DisplayName,
22745 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22746 : },
22747 : {
22748 : .name = discard_const_p(char, "in_desired_access"),
22749 : .get = py_svcctl_CreateServiceA_in_get_desired_access,
22750 : .set = py_svcctl_CreateServiceA_in_set_desired_access,
22751 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22752 : },
22753 : {
22754 : .name = discard_const_p(char, "in_type"),
22755 : .get = py_svcctl_CreateServiceA_in_get_type,
22756 : .set = py_svcctl_CreateServiceA_in_set_type,
22757 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22758 : },
22759 : {
22760 : .name = discard_const_p(char, "in_start_type"),
22761 : .get = py_svcctl_CreateServiceA_in_get_start_type,
22762 : .set = py_svcctl_CreateServiceA_in_set_start_type,
22763 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
22764 : },
22765 : {
22766 : .name = discard_const_p(char, "in_error_control"),
22767 : .get = py_svcctl_CreateServiceA_in_get_error_control,
22768 : .set = py_svcctl_CreateServiceA_in_set_error_control,
22769 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
22770 : },
22771 : {
22772 : .name = discard_const_p(char, "in_binary_path"),
22773 : .get = py_svcctl_CreateServiceA_in_get_binary_path,
22774 : .set = py_svcctl_CreateServiceA_in_set_binary_path,
22775 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22776 : },
22777 : {
22778 : .name = discard_const_p(char, "in_LoadOrderGroupKey"),
22779 : .get = py_svcctl_CreateServiceA_in_get_LoadOrderGroupKey,
22780 : .set = py_svcctl_CreateServiceA_in_set_LoadOrderGroupKey,
22781 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22782 : },
22783 : {
22784 : .name = discard_const_p(char, "out_TagId"),
22785 : .get = py_svcctl_CreateServiceA_out_get_TagId,
22786 : .set = py_svcctl_CreateServiceA_out_set_TagId,
22787 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22788 : },
22789 : {
22790 : .name = discard_const_p(char, "in_dependencies"),
22791 : .get = py_svcctl_CreateServiceA_in_get_dependencies,
22792 : .set = py_svcctl_CreateServiceA_in_set_dependencies,
22793 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22794 : },
22795 : {
22796 : .name = discard_const_p(char, "in_service_start_name"),
22797 : .get = py_svcctl_CreateServiceA_in_get_service_start_name,
22798 : .set = py_svcctl_CreateServiceA_in_set_service_start_name,
22799 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22800 : },
22801 : {
22802 : .name = discard_const_p(char, "in_password"),
22803 : .get = py_svcctl_CreateServiceA_in_get_password,
22804 : .set = py_svcctl_CreateServiceA_in_set_password,
22805 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22806 : },
22807 : {
22808 : .name = discard_const_p(char, "result"),
22809 : .get = py_svcctl_CreateServiceA_get_result,
22810 : .set = py_svcctl_CreateServiceA_set_result,
22811 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
22812 : },
22813 : { .name = NULL }
22814 : };
22815 :
22816 0 : static PyObject *py_svcctl_CreateServiceA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22817 : {
22818 0 : PyObject *self = pytalloc_new(struct svcctl_CreateServiceA, type);
22819 0 : struct svcctl_CreateServiceA *_self = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(self);
22820 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22821 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22822 0 : return self;
22823 : }
22824 :
22825 0 : static PyObject *py_svcctl_CreateServiceA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22826 : {
22827 :
22828 :
22829 0 : return PyLong_FromLong(24);
22830 : }
22831 :
22832 0 : static PyObject *py_svcctl_CreateServiceA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22833 : {
22834 0 : const struct ndr_interface_call *call = NULL;
22835 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22836 0 : PyObject *ret = NULL;
22837 0 : struct ndr_push *push = NULL;
22838 0 : DATA_BLOB blob;
22839 0 : enum ndr_err_code err;
22840 :
22841 0 : if (ndr_table_svcctl.num_calls < 25) {
22842 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceA_ndr_pack");
22843 0 : return NULL;
22844 : }
22845 0 : call = &ndr_table_svcctl.calls[24];
22846 :
22847 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22848 0 : if (push == NULL) {
22849 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22850 0 : return NULL;
22851 : }
22852 :
22853 0 : push->flags |= ndr_push_flags;
22854 :
22855 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22856 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22857 0 : TALLOC_FREE(push);
22858 0 : PyErr_SetNdrError(err);
22859 0 : return NULL;
22860 : }
22861 0 : blob = ndr_push_blob(push);
22862 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22863 0 : TALLOC_FREE(push);
22864 0 : return ret;
22865 : }
22866 :
22867 0 : static PyObject *py_svcctl_CreateServiceA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22868 : {
22869 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22870 0 : PyObject *bigendian_obj = NULL;
22871 0 : PyObject *ndr64_obj = NULL;
22872 0 : libndr_flags ndr_push_flags = 0;
22873 :
22874 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22875 : discard_const_p(char *, kwnames),
22876 : &bigendian_obj,
22877 : &ndr64_obj)) {
22878 0 : return NULL;
22879 : }
22880 :
22881 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22882 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22883 : }
22884 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22885 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22886 : }
22887 :
22888 0 : return py_svcctl_CreateServiceA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22889 : }
22890 :
22891 0 : static PyObject *py_svcctl_CreateServiceA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22892 : {
22893 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22894 0 : PyObject *bigendian_obj = NULL;
22895 0 : PyObject *ndr64_obj = NULL;
22896 0 : libndr_flags ndr_push_flags = 0;
22897 :
22898 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22899 : discard_const_p(char *, kwnames),
22900 : &bigendian_obj,
22901 : &ndr64_obj)) {
22902 0 : return NULL;
22903 : }
22904 :
22905 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22906 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22907 : }
22908 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22909 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22910 : }
22911 :
22912 0 : return py_svcctl_CreateServiceA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22913 : }
22914 :
22915 0 : static PyObject *py_svcctl_CreateServiceA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
22916 : {
22917 0 : const struct ndr_interface_call *call = NULL;
22918 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
22919 0 : struct ndr_pull *pull = NULL;
22920 0 : enum ndr_err_code err;
22921 :
22922 0 : if (ndr_table_svcctl.num_calls < 25) {
22923 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceA_ndr_unpack");
22924 0 : return NULL;
22925 : }
22926 0 : call = &ndr_table_svcctl.calls[24];
22927 :
22928 0 : pull = ndr_pull_init_blob(blob, object);
22929 0 : if (pull == NULL) {
22930 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22931 0 : return NULL;
22932 : }
22933 :
22934 0 : pull->flags |= ndr_pull_flags;
22935 :
22936 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22937 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22938 0 : TALLOC_FREE(pull);
22939 0 : PyErr_SetNdrError(err);
22940 0 : return NULL;
22941 : }
22942 0 : if (!allow_remaining) {
22943 0 : uint32_t highest_ofs;
22944 :
22945 0 : if (pull->offset > pull->relative_highest_offset) {
22946 0 : highest_ofs = pull->offset;
22947 : } else {
22948 0 : highest_ofs = pull->relative_highest_offset;
22949 : }
22950 0 : if (highest_ofs < pull->data_size) {
22951 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22952 : "not all bytes consumed ofs[%u] size[%u]",
22953 : highest_ofs, pull->data_size);
22954 0 : TALLOC_FREE(pull);
22955 0 : PyErr_SetNdrError(err);
22956 0 : return NULL;
22957 : }
22958 : }
22959 :
22960 0 : TALLOC_FREE(pull);
22961 0 : Py_RETURN_NONE;
22962 : }
22963 :
22964 0 : static PyObject *py_svcctl_CreateServiceA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22965 : {
22966 0 : DATA_BLOB blob;
22967 0 : Py_ssize_t blob_length = 0;
22968 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22969 0 : PyObject *bigendian_obj = NULL;
22970 0 : PyObject *ndr64_obj = NULL;
22971 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22972 0 : PyObject *allow_remaining_obj = NULL;
22973 0 : bool allow_remaining = false;
22974 :
22975 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22976 : discard_const_p(char *, kwnames),
22977 : &blob.data, &blob_length,
22978 : &bigendian_obj,
22979 : &ndr64_obj,
22980 : &allow_remaining_obj)) {
22981 0 : return NULL;
22982 : }
22983 0 : blob.length = blob_length;
22984 :
22985 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22986 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22987 : }
22988 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22989 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22990 : }
22991 :
22992 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22993 0 : allow_remaining = true;
22994 : }
22995 :
22996 0 : return py_svcctl_CreateServiceA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22997 : }
22998 :
22999 0 : static PyObject *py_svcctl_CreateServiceA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23000 : {
23001 0 : DATA_BLOB blob;
23002 0 : Py_ssize_t blob_length = 0;
23003 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23004 0 : PyObject *bigendian_obj = NULL;
23005 0 : PyObject *ndr64_obj = NULL;
23006 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23007 0 : PyObject *allow_remaining_obj = NULL;
23008 0 : bool allow_remaining = false;
23009 :
23010 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23011 : discard_const_p(char *, kwnames),
23012 : &blob.data, &blob_length,
23013 : &bigendian_obj,
23014 : &ndr64_obj,
23015 : &allow_remaining_obj)) {
23016 0 : return NULL;
23017 : }
23018 0 : blob.length = blob_length;
23019 :
23020 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23021 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23022 : }
23023 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23024 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23025 : }
23026 :
23027 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23028 0 : allow_remaining = true;
23029 : }
23030 :
23031 0 : return py_svcctl_CreateServiceA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23032 : }
23033 :
23034 0 : static PyObject *py_svcctl_CreateServiceA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
23035 : {
23036 0 : const struct ndr_interface_call *call = NULL;
23037 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
23038 0 : PyObject *ret;
23039 0 : char *retstr;
23040 :
23041 0 : if (ndr_table_svcctl.num_calls < 25) {
23042 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceA_ndr_print");
23043 0 : return NULL;
23044 : }
23045 0 : call = &ndr_table_svcctl.calls[24];
23046 :
23047 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23048 0 : ret = PyUnicode_FromString(retstr);
23049 0 : TALLOC_FREE(retstr);
23050 :
23051 0 : return ret;
23052 : }
23053 :
23054 0 : static PyObject *py_svcctl_CreateServiceA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23055 : {
23056 0 : return py_svcctl_CreateServiceA_ndr_print(py_obj, "svcctl_CreateServiceA_in", NDR_IN);
23057 : }
23058 :
23059 0 : static PyObject *py_svcctl_CreateServiceA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23060 : {
23061 0 : return py_svcctl_CreateServiceA_ndr_print(py_obj, "svcctl_CreateServiceA_out", NDR_OUT);
23062 : }
23063 :
23064 : static PyMethodDef py_svcctl_CreateServiceA_methods[] = {
23065 : { "opnum", (PyCFunction)py_svcctl_CreateServiceA_ndr_opnum, METH_NOARGS|METH_CLASS,
23066 : "svcctl.CreateServiceA.opnum() -> 24 (0x18) " },
23067 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23068 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23069 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23070 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23071 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23072 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23073 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23074 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23075 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CreateServiceA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23076 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CreateServiceA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23077 : { NULL, NULL, 0, NULL }
23078 : };
23079 :
23080 :
23081 : static PyTypeObject svcctl_CreateServiceA_Type = {
23082 : PyVarObject_HEAD_INIT(NULL, 0)
23083 : .tp_name = "svcctl.CreateServiceA",
23084 : .tp_getset = py_svcctl_CreateServiceA_getsetters,
23085 : .tp_methods = py_svcctl_CreateServiceA_methods,
23086 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23087 : .tp_new = py_svcctl_CreateServiceA_new,
23088 : };
23089 :
23090 0 : static bool pack_py_svcctl_CreateServiceA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CreateServiceA *r)
23091 : {
23092 0 : PyObject *py_handle;
23093 0 : PyObject *py_ServiceName;
23094 0 : PyObject *py_DisplayName;
23095 0 : PyObject *py_desired_access;
23096 0 : PyObject *py_type;
23097 0 : PyObject *py_start_type;
23098 0 : PyObject *py_error_control;
23099 0 : PyObject *py_binary_path;
23100 0 : PyObject *py_LoadOrderGroupKey;
23101 0 : PyObject *py_dependencies;
23102 0 : PyObject *py_service_start_name;
23103 0 : PyObject *py_password;
23104 0 : const char *kwnames[] = {
23105 : "handle", "ServiceName", "DisplayName", "desired_access", "type", "start_type", "error_control", "binary_path", "LoadOrderGroupKey", "dependencies", "service_start_name", "password", NULL
23106 : };
23107 :
23108 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOOO:svcctl_CreateServiceA", discard_const_p(char *, kwnames), &py_handle, &py_ServiceName, &py_DisplayName, &py_desired_access, &py_type, &py_start_type, &py_error_control, &py_binary_path, &py_LoadOrderGroupKey, &py_dependencies, &py_service_start_name, &py_password)) {
23109 0 : return false;
23110 : }
23111 :
23112 0 : if (py_handle == NULL) {
23113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
23114 0 : return false;
23115 : }
23116 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23117 0 : if (r->in.handle == NULL) {
23118 0 : PyErr_NoMemory();
23119 0 : return false;
23120 : }
23121 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23122 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23123 0 : PyErr_NoMemory();
23124 0 : return false;
23125 : }
23126 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23127 0 : if (py_ServiceName == NULL) {
23128 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
23129 0 : return false;
23130 : }
23131 0 : if (py_ServiceName == Py_None) {
23132 0 : r->in.ServiceName = NULL;
23133 : } else {
23134 0 : r->in.ServiceName = NULL;
23135 : {
23136 0 : const char *test_str;
23137 0 : const char *talloc_str;
23138 0 : PyObject *unicode = NULL;
23139 0 : if (PyUnicode_Check(py_ServiceName)) {
23140 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
23141 0 : if (unicode == NULL) {
23142 0 : return false;
23143 : }
23144 0 : test_str = PyBytes_AS_STRING(unicode);
23145 0 : } else if (PyBytes_Check(py_ServiceName)) {
23146 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
23147 : } else {
23148 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
23149 0 : return false;
23150 : }
23151 0 : talloc_str = talloc_strdup(r, test_str);
23152 0 : if (unicode != NULL) {
23153 0 : Py_DECREF(unicode);
23154 : }
23155 0 : if (talloc_str == NULL) {
23156 0 : PyErr_NoMemory();
23157 0 : return false;
23158 : }
23159 0 : r->in.ServiceName = talloc_str;
23160 : }
23161 : }
23162 0 : if (py_DisplayName == NULL) {
23163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DisplayName");
23164 0 : return false;
23165 : }
23166 0 : if (py_DisplayName == Py_None) {
23167 0 : r->in.DisplayName = NULL;
23168 : } else {
23169 0 : r->in.DisplayName = NULL;
23170 : {
23171 0 : const char *test_str;
23172 0 : const char *talloc_str;
23173 0 : PyObject *unicode = NULL;
23174 0 : if (PyUnicode_Check(py_DisplayName)) {
23175 0 : unicode = PyUnicode_AsEncodedString(py_DisplayName, "utf-8", "ignore");
23176 0 : if (unicode == NULL) {
23177 0 : return false;
23178 : }
23179 0 : test_str = PyBytes_AS_STRING(unicode);
23180 0 : } else if (PyBytes_Check(py_DisplayName)) {
23181 0 : test_str = PyBytes_AS_STRING(py_DisplayName);
23182 : } else {
23183 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DisplayName)->tp_name);
23184 0 : return false;
23185 : }
23186 0 : talloc_str = talloc_strdup(r, test_str);
23187 0 : if (unicode != NULL) {
23188 0 : Py_DECREF(unicode);
23189 : }
23190 0 : if (talloc_str == NULL) {
23191 0 : PyErr_NoMemory();
23192 0 : return false;
23193 : }
23194 0 : r->in.DisplayName = talloc_str;
23195 : }
23196 : }
23197 0 : if (py_desired_access == NULL) {
23198 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.desired_access");
23199 0 : return false;
23200 : }
23201 : {
23202 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.desired_access));
23203 0 : if (PyLong_Check(py_desired_access)) {
23204 0 : unsigned long long test_var;
23205 0 : test_var = PyLong_AsUnsignedLongLong(py_desired_access);
23206 0 : if (PyErr_Occurred() != NULL) {
23207 0 : return false;
23208 : }
23209 0 : if (test_var > uint_max) {
23210 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23211 : PyLong_Type.tp_name, uint_max, test_var);
23212 0 : return false;
23213 : }
23214 0 : r->in.desired_access = test_var;
23215 : } else {
23216 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23217 : PyLong_Type.tp_name);
23218 0 : return false;
23219 : }
23220 : }
23221 0 : if (py_type == NULL) {
23222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
23223 0 : return false;
23224 : }
23225 : {
23226 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
23227 0 : if (PyLong_Check(py_type)) {
23228 0 : unsigned long long test_var;
23229 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
23230 0 : if (PyErr_Occurred() != NULL) {
23231 0 : return false;
23232 : }
23233 0 : if (test_var > uint_max) {
23234 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23235 : PyLong_Type.tp_name, uint_max, test_var);
23236 0 : return false;
23237 : }
23238 0 : r->in.type = test_var;
23239 : } else {
23240 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23241 : PyLong_Type.tp_name);
23242 0 : return false;
23243 : }
23244 : }
23245 0 : if (py_start_type == NULL) {
23246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
23247 0 : return false;
23248 : }
23249 : {
23250 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
23251 0 : if (PyLong_Check(py_start_type)) {
23252 0 : unsigned long long test_var;
23253 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
23254 0 : if (PyErr_Occurred() != NULL) {
23255 0 : return false;
23256 : }
23257 0 : if (test_var > uint_max) {
23258 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23259 : PyLong_Type.tp_name, uint_max, test_var);
23260 0 : return false;
23261 : }
23262 0 : r->in.start_type = test_var;
23263 : } else {
23264 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23265 : PyLong_Type.tp_name);
23266 0 : return false;
23267 : }
23268 : }
23269 0 : if (py_error_control == NULL) {
23270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
23271 0 : return false;
23272 : }
23273 : {
23274 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
23275 0 : if (PyLong_Check(py_error_control)) {
23276 0 : unsigned long long test_var;
23277 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
23278 0 : if (PyErr_Occurred() != NULL) {
23279 0 : return false;
23280 : }
23281 0 : if (test_var > uint_max) {
23282 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23283 : PyLong_Type.tp_name, uint_max, test_var);
23284 0 : return false;
23285 : }
23286 0 : r->in.error_control = test_var;
23287 : } else {
23288 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23289 : PyLong_Type.tp_name);
23290 0 : return false;
23291 : }
23292 : }
23293 0 : if (py_binary_path == NULL) {
23294 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
23295 0 : return false;
23296 : }
23297 0 : if (py_binary_path == Py_None) {
23298 0 : r->in.binary_path = NULL;
23299 : } else {
23300 0 : r->in.binary_path = NULL;
23301 : {
23302 0 : const char *test_str;
23303 0 : const char *talloc_str;
23304 0 : PyObject *unicode = NULL;
23305 0 : if (PyUnicode_Check(py_binary_path)) {
23306 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
23307 0 : if (unicode == NULL) {
23308 0 : return false;
23309 : }
23310 0 : test_str = PyBytes_AS_STRING(unicode);
23311 0 : } else if (PyBytes_Check(py_binary_path)) {
23312 0 : test_str = PyBytes_AS_STRING(py_binary_path);
23313 : } else {
23314 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
23315 0 : return false;
23316 : }
23317 0 : talloc_str = talloc_strdup(r, test_str);
23318 0 : if (unicode != NULL) {
23319 0 : Py_DECREF(unicode);
23320 : }
23321 0 : if (talloc_str == NULL) {
23322 0 : PyErr_NoMemory();
23323 0 : return false;
23324 : }
23325 0 : r->in.binary_path = talloc_str;
23326 : }
23327 : }
23328 0 : if (py_LoadOrderGroupKey == NULL) {
23329 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.LoadOrderGroupKey");
23330 0 : return false;
23331 : }
23332 0 : if (py_LoadOrderGroupKey == Py_None) {
23333 0 : r->in.LoadOrderGroupKey = NULL;
23334 : } else {
23335 0 : r->in.LoadOrderGroupKey = NULL;
23336 : {
23337 0 : const char *test_str;
23338 0 : const char *talloc_str;
23339 0 : PyObject *unicode = NULL;
23340 0 : if (PyUnicode_Check(py_LoadOrderGroupKey)) {
23341 0 : unicode = PyUnicode_AsEncodedString(py_LoadOrderGroupKey, "utf-8", "ignore");
23342 0 : if (unicode == NULL) {
23343 0 : return false;
23344 : }
23345 0 : test_str = PyBytes_AS_STRING(unicode);
23346 0 : } else if (PyBytes_Check(py_LoadOrderGroupKey)) {
23347 0 : test_str = PyBytes_AS_STRING(py_LoadOrderGroupKey);
23348 : } else {
23349 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_LoadOrderGroupKey)->tp_name);
23350 0 : return false;
23351 : }
23352 0 : talloc_str = talloc_strdup(r, test_str);
23353 0 : if (unicode != NULL) {
23354 0 : Py_DECREF(unicode);
23355 : }
23356 0 : if (talloc_str == NULL) {
23357 0 : PyErr_NoMemory();
23358 0 : return false;
23359 : }
23360 0 : r->in.LoadOrderGroupKey = talloc_str;
23361 : }
23362 : }
23363 0 : if (py_dependencies == NULL) {
23364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
23365 0 : return false;
23366 : }
23367 0 : if (py_dependencies == Py_None) {
23368 0 : r->in.dependencies = NULL;
23369 : } else {
23370 0 : r->in.dependencies = NULL;
23371 : {
23372 0 : const char *test_str;
23373 0 : const char *talloc_str;
23374 0 : PyObject *unicode = NULL;
23375 0 : if (PyUnicode_Check(py_dependencies)) {
23376 0 : unicode = PyUnicode_AsEncodedString(py_dependencies, "utf-8", "ignore");
23377 0 : if (unicode == NULL) {
23378 0 : return false;
23379 : }
23380 0 : test_str = PyBytes_AS_STRING(unicode);
23381 0 : } else if (PyBytes_Check(py_dependencies)) {
23382 0 : test_str = PyBytes_AS_STRING(py_dependencies);
23383 : } else {
23384 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dependencies)->tp_name);
23385 0 : return false;
23386 : }
23387 0 : talloc_str = talloc_strdup(r, test_str);
23388 0 : if (unicode != NULL) {
23389 0 : Py_DECREF(unicode);
23390 : }
23391 0 : if (talloc_str == NULL) {
23392 0 : PyErr_NoMemory();
23393 0 : return false;
23394 : }
23395 0 : r->in.dependencies = talloc_str;
23396 : }
23397 : }
23398 0 : if (py_service_start_name == NULL) {
23399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
23400 0 : return false;
23401 : }
23402 0 : if (py_service_start_name == Py_None) {
23403 0 : r->in.service_start_name = NULL;
23404 : } else {
23405 0 : r->in.service_start_name = NULL;
23406 : {
23407 0 : const char *test_str;
23408 0 : const char *talloc_str;
23409 0 : PyObject *unicode = NULL;
23410 0 : if (PyUnicode_Check(py_service_start_name)) {
23411 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
23412 0 : if (unicode == NULL) {
23413 0 : return false;
23414 : }
23415 0 : test_str = PyBytes_AS_STRING(unicode);
23416 0 : } else if (PyBytes_Check(py_service_start_name)) {
23417 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
23418 : } else {
23419 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
23420 0 : return false;
23421 : }
23422 0 : talloc_str = talloc_strdup(r, test_str);
23423 0 : if (unicode != NULL) {
23424 0 : Py_DECREF(unicode);
23425 : }
23426 0 : if (talloc_str == NULL) {
23427 0 : PyErr_NoMemory();
23428 0 : return false;
23429 : }
23430 0 : r->in.service_start_name = talloc_str;
23431 : }
23432 : }
23433 0 : if (py_password == NULL) {
23434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
23435 0 : return false;
23436 : }
23437 0 : if (py_password == Py_None) {
23438 0 : r->in.password = NULL;
23439 : } else {
23440 0 : r->in.password = NULL;
23441 : {
23442 0 : const char *test_str;
23443 0 : const char *talloc_str;
23444 0 : PyObject *unicode = NULL;
23445 0 : if (PyUnicode_Check(py_password)) {
23446 0 : unicode = PyUnicode_AsEncodedString(py_password, "utf-8", "ignore");
23447 0 : if (unicode == NULL) {
23448 0 : return false;
23449 : }
23450 0 : test_str = PyBytes_AS_STRING(unicode);
23451 0 : } else if (PyBytes_Check(py_password)) {
23452 0 : test_str = PyBytes_AS_STRING(py_password);
23453 : } else {
23454 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_password)->tp_name);
23455 0 : return false;
23456 : }
23457 0 : talloc_str = talloc_strdup(r, test_str);
23458 0 : if (unicode != NULL) {
23459 0 : Py_DECREF(unicode);
23460 : }
23461 0 : if (talloc_str == NULL) {
23462 0 : PyErr_NoMemory();
23463 0 : return false;
23464 : }
23465 0 : r->in.password = talloc_str;
23466 : }
23467 : }
23468 0 : return true;
23469 : }
23470 :
23471 0 : static PyObject *unpack_py_svcctl_CreateServiceA_args_out(struct svcctl_CreateServiceA *r)
23472 : {
23473 0 : PyObject *result;
23474 0 : PyObject *py_TagId;
23475 0 : if (r->out.TagId == NULL) {
23476 0 : py_TagId = Py_None;
23477 0 : Py_INCREF(py_TagId);
23478 : } else {
23479 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*r->out.TagId);
23480 : }
23481 0 : result = py_TagId;
23482 0 : if (!W_ERROR_IS_OK(r->out.result)) {
23483 0 : PyErr_SetWERROR(r->out.result);
23484 0 : return NULL;
23485 : }
23486 :
23487 0 : return result;
23488 : }
23489 :
23490 :
23491 0 : static PyObject *py_svcctl_EnumDependentServicesA_in_get_service(PyObject *obj, void *closure)
23492 : {
23493 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
23494 0 : PyObject *py_service;
23495 0 : if (object->in.service == NULL) {
23496 0 : Py_RETURN_NONE;
23497 : }
23498 0 : py_service = pytalloc_reference_ex(policy_handle_Type, object->in.service, object->in.service);
23499 0 : return py_service;
23500 : }
23501 :
23502 0 : static int py_svcctl_EnumDependentServicesA_in_set_service(PyObject *py_obj, PyObject *value, void *closure)
23503 : {
23504 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23505 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.service));
23506 0 : if (value == NULL) {
23507 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service");
23508 0 : return -1;
23509 : }
23510 0 : object->in.service = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.service);
23511 0 : if (object->in.service == NULL) {
23512 0 : PyErr_NoMemory();
23513 0 : return -1;
23514 : }
23515 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23516 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23517 0 : PyErr_NoMemory();
23518 0 : return -1;
23519 : }
23520 0 : object->in.service = (struct policy_handle *)pytalloc_get_ptr(value);
23521 0 : return 0;
23522 : }
23523 :
23524 0 : static PyObject *py_svcctl_EnumDependentServicesA_in_get_state(PyObject *obj, void *closure)
23525 : {
23526 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
23527 0 : PyObject *py_state;
23528 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
23529 0 : return py_state;
23530 : }
23531 :
23532 0 : static int py_svcctl_EnumDependentServicesA_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
23533 : {
23534 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23535 0 : if (value == NULL) {
23536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
23537 0 : return -1;
23538 : }
23539 : {
23540 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
23541 0 : if (PyLong_Check(value)) {
23542 0 : unsigned long long test_var;
23543 0 : test_var = PyLong_AsUnsignedLongLong(value);
23544 0 : if (PyErr_Occurred() != NULL) {
23545 0 : return -1;
23546 : }
23547 0 : if (test_var > uint_max) {
23548 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23549 : PyLong_Type.tp_name, uint_max, test_var);
23550 0 : return -1;
23551 : }
23552 0 : object->in.state = test_var;
23553 : } else {
23554 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23555 : PyLong_Type.tp_name);
23556 0 : return -1;
23557 : }
23558 : }
23559 0 : return 0;
23560 : }
23561 :
23562 0 : static PyObject *py_svcctl_EnumDependentServicesA_out_get_service_status(PyObject *obj, void *closure)
23563 : {
23564 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
23565 0 : PyObject *py_service_status;
23566 0 : if (object->out.service_status == NULL) {
23567 0 : Py_RETURN_NONE;
23568 : }
23569 0 : if (object->out.service_status == NULL) {
23570 0 : py_service_status = Py_None;
23571 0 : Py_INCREF(py_service_status);
23572 : } else {
23573 0 : py_service_status = pytalloc_reference_ex(&ENUM_SERVICE_STATUSA_Type, object->out.service_status, object->out.service_status);
23574 : }
23575 0 : return py_service_status;
23576 : }
23577 :
23578 0 : static int py_svcctl_EnumDependentServicesA_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
23579 : {
23580 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23581 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
23582 0 : if (value == NULL) {
23583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
23584 0 : return -1;
23585 : }
23586 0 : if (value == Py_None) {
23587 0 : object->out.service_status = NULL;
23588 : } else {
23589 0 : object->out.service_status = NULL;
23590 0 : PY_CHECK_TYPE(&ENUM_SERVICE_STATUSA_Type, value, return -1;);
23591 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23592 0 : PyErr_NoMemory();
23593 0 : return -1;
23594 : }
23595 0 : object->out.service_status = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(value);
23596 : }
23597 0 : return 0;
23598 : }
23599 :
23600 0 : static PyObject *py_svcctl_EnumDependentServicesA_in_get_offered(PyObject *obj, void *closure)
23601 : {
23602 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
23603 0 : PyObject *py_offered;
23604 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
23605 0 : return py_offered;
23606 : }
23607 :
23608 0 : static int py_svcctl_EnumDependentServicesA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
23609 : {
23610 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23611 0 : if (value == NULL) {
23612 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
23613 0 : return -1;
23614 : }
23615 : {
23616 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
23617 0 : if (PyLong_Check(value)) {
23618 0 : unsigned long long test_var;
23619 0 : test_var = PyLong_AsUnsignedLongLong(value);
23620 0 : if (PyErr_Occurred() != NULL) {
23621 0 : return -1;
23622 : }
23623 0 : if (test_var > uint_max) {
23624 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23625 : PyLong_Type.tp_name, uint_max, test_var);
23626 0 : return -1;
23627 : }
23628 0 : object->in.offered = test_var;
23629 : } else {
23630 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23631 : PyLong_Type.tp_name);
23632 0 : return -1;
23633 : }
23634 : }
23635 0 : return 0;
23636 : }
23637 :
23638 0 : static PyObject *py_svcctl_EnumDependentServicesA_out_get_needed(PyObject *obj, void *closure)
23639 : {
23640 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
23641 0 : PyObject *py_needed;
23642 0 : if (object->out.needed == NULL) {
23643 0 : Py_RETURN_NONE;
23644 : }
23645 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
23646 0 : return py_needed;
23647 : }
23648 :
23649 0 : static int py_svcctl_EnumDependentServicesA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
23650 : {
23651 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23652 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
23653 0 : if (value == NULL) {
23654 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
23655 0 : return -1;
23656 : }
23657 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
23658 0 : if (object->out.needed == NULL) {
23659 0 : PyErr_NoMemory();
23660 0 : return -1;
23661 : }
23662 : {
23663 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
23664 0 : if (PyLong_Check(value)) {
23665 0 : unsigned long long test_var;
23666 0 : test_var = PyLong_AsUnsignedLongLong(value);
23667 0 : if (PyErr_Occurred() != NULL) {
23668 0 : return -1;
23669 : }
23670 0 : if (test_var > uint_max) {
23671 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23672 : PyLong_Type.tp_name, uint_max, test_var);
23673 0 : return -1;
23674 : }
23675 0 : *object->out.needed = test_var;
23676 : } else {
23677 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23678 : PyLong_Type.tp_name);
23679 0 : return -1;
23680 : }
23681 : }
23682 0 : return 0;
23683 : }
23684 :
23685 0 : static PyObject *py_svcctl_EnumDependentServicesA_out_get_services_returned(PyObject *obj, void *closure)
23686 : {
23687 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
23688 0 : PyObject *py_services_returned;
23689 0 : if (object->out.services_returned == NULL) {
23690 0 : Py_RETURN_NONE;
23691 : }
23692 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
23693 0 : return py_services_returned;
23694 : }
23695 :
23696 0 : static int py_svcctl_EnumDependentServicesA_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
23697 : {
23698 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23699 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
23700 0 : if (value == NULL) {
23701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
23702 0 : return -1;
23703 : }
23704 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
23705 0 : if (object->out.services_returned == NULL) {
23706 0 : PyErr_NoMemory();
23707 0 : return -1;
23708 : }
23709 : {
23710 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
23711 0 : if (PyLong_Check(value)) {
23712 0 : unsigned long long test_var;
23713 0 : test_var = PyLong_AsUnsignedLongLong(value);
23714 0 : if (PyErr_Occurred() != NULL) {
23715 0 : return -1;
23716 : }
23717 0 : if (test_var > uint_max) {
23718 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23719 : PyLong_Type.tp_name, uint_max, test_var);
23720 0 : return -1;
23721 : }
23722 0 : *object->out.services_returned = test_var;
23723 : } else {
23724 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23725 : PyLong_Type.tp_name);
23726 0 : return -1;
23727 : }
23728 : }
23729 0 : return 0;
23730 : }
23731 :
23732 0 : static PyObject *py_svcctl_EnumDependentServicesA_get_result(PyObject *obj, void *closure)
23733 : {
23734 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
23735 0 : PyObject *py_result;
23736 0 : py_result = PyErr_FromWERROR(object->out.result);
23737 0 : return py_result;
23738 : }
23739 :
23740 0 : static int py_svcctl_EnumDependentServicesA_set_result(PyObject *py_obj, PyObject *value, void *closure)
23741 : {
23742 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23743 0 : if (value == NULL) {
23744 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23745 0 : return -1;
23746 : }
23747 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
23748 0 : return 0;
23749 : }
23750 :
23751 : static PyGetSetDef py_svcctl_EnumDependentServicesA_getsetters[] = {
23752 : {
23753 : .name = discard_const_p(char, "in_service"),
23754 : .get = py_svcctl_EnumDependentServicesA_in_get_service,
23755 : .set = py_svcctl_EnumDependentServicesA_in_set_service,
23756 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23757 : },
23758 : {
23759 : .name = discard_const_p(char, "in_state"),
23760 : .get = py_svcctl_EnumDependentServicesA_in_get_state,
23761 : .set = py_svcctl_EnumDependentServicesA_in_set_state,
23762 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
23763 : },
23764 : {
23765 : .name = discard_const_p(char, "out_service_status"),
23766 : .get = py_svcctl_EnumDependentServicesA_out_get_service_status,
23767 : .set = py_svcctl_EnumDependentServicesA_out_set_service_status,
23768 : .doc = discard_const_p(char, "PIDL-generated element of base type ENUM_SERVICE_STATUSA")
23769 : },
23770 : {
23771 : .name = discard_const_p(char, "in_offered"),
23772 : .get = py_svcctl_EnumDependentServicesA_in_get_offered,
23773 : .set = py_svcctl_EnumDependentServicesA_in_set_offered,
23774 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23775 : },
23776 : {
23777 : .name = discard_const_p(char, "out_needed"),
23778 : .get = py_svcctl_EnumDependentServicesA_out_get_needed,
23779 : .set = py_svcctl_EnumDependentServicesA_out_set_needed,
23780 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23781 : },
23782 : {
23783 : .name = discard_const_p(char, "out_services_returned"),
23784 : .get = py_svcctl_EnumDependentServicesA_out_get_services_returned,
23785 : .set = py_svcctl_EnumDependentServicesA_out_set_services_returned,
23786 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23787 : },
23788 : {
23789 : .name = discard_const_p(char, "result"),
23790 : .get = py_svcctl_EnumDependentServicesA_get_result,
23791 : .set = py_svcctl_EnumDependentServicesA_set_result,
23792 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
23793 : },
23794 : { .name = NULL }
23795 : };
23796 :
23797 0 : static PyObject *py_svcctl_EnumDependentServicesA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23798 : {
23799 0 : PyObject *self = pytalloc_new(struct svcctl_EnumDependentServicesA, type);
23800 0 : struct svcctl_EnumDependentServicesA *_self = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(self);
23801 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23802 0 : _self->in.service = talloc_zero(mem_ctx, struct policy_handle);
23803 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
23804 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
23805 0 : return self;
23806 : }
23807 :
23808 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23809 : {
23810 :
23811 :
23812 0 : return PyLong_FromLong(25);
23813 : }
23814 :
23815 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
23816 : {
23817 0 : const struct ndr_interface_call *call = NULL;
23818 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23819 0 : PyObject *ret = NULL;
23820 0 : struct ndr_push *push = NULL;
23821 0 : DATA_BLOB blob;
23822 0 : enum ndr_err_code err;
23823 :
23824 0 : if (ndr_table_svcctl.num_calls < 26) {
23825 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesA_ndr_pack");
23826 0 : return NULL;
23827 : }
23828 0 : call = &ndr_table_svcctl.calls[25];
23829 :
23830 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23831 0 : if (push == NULL) {
23832 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23833 0 : return NULL;
23834 : }
23835 :
23836 0 : push->flags |= ndr_push_flags;
23837 :
23838 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23839 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23840 0 : TALLOC_FREE(push);
23841 0 : PyErr_SetNdrError(err);
23842 0 : return NULL;
23843 : }
23844 0 : blob = ndr_push_blob(push);
23845 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23846 0 : TALLOC_FREE(push);
23847 0 : return ret;
23848 : }
23849 :
23850 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23851 : {
23852 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23853 0 : PyObject *bigendian_obj = NULL;
23854 0 : PyObject *ndr64_obj = NULL;
23855 0 : libndr_flags ndr_push_flags = 0;
23856 :
23857 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23858 : discard_const_p(char *, kwnames),
23859 : &bigendian_obj,
23860 : &ndr64_obj)) {
23861 0 : return NULL;
23862 : }
23863 :
23864 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23865 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23866 : }
23867 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23868 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23869 : }
23870 :
23871 0 : return py_svcctl_EnumDependentServicesA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23872 : }
23873 :
23874 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23875 : {
23876 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23877 0 : PyObject *bigendian_obj = NULL;
23878 0 : PyObject *ndr64_obj = NULL;
23879 0 : libndr_flags ndr_push_flags = 0;
23880 :
23881 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23882 : discard_const_p(char *, kwnames),
23883 : &bigendian_obj,
23884 : &ndr64_obj)) {
23885 0 : return NULL;
23886 : }
23887 :
23888 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23889 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23890 : }
23891 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23892 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23893 : }
23894 :
23895 0 : return py_svcctl_EnumDependentServicesA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23896 : }
23897 :
23898 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
23899 : {
23900 0 : const struct ndr_interface_call *call = NULL;
23901 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
23902 0 : struct ndr_pull *pull = NULL;
23903 0 : enum ndr_err_code err;
23904 :
23905 0 : if (ndr_table_svcctl.num_calls < 26) {
23906 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesA_ndr_unpack");
23907 0 : return NULL;
23908 : }
23909 0 : call = &ndr_table_svcctl.calls[25];
23910 :
23911 0 : pull = ndr_pull_init_blob(blob, object);
23912 0 : if (pull == NULL) {
23913 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23914 0 : return NULL;
23915 : }
23916 :
23917 0 : pull->flags |= ndr_pull_flags;
23918 :
23919 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23920 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23921 0 : TALLOC_FREE(pull);
23922 0 : PyErr_SetNdrError(err);
23923 0 : return NULL;
23924 : }
23925 0 : if (!allow_remaining) {
23926 0 : uint32_t highest_ofs;
23927 :
23928 0 : if (pull->offset > pull->relative_highest_offset) {
23929 0 : highest_ofs = pull->offset;
23930 : } else {
23931 0 : highest_ofs = pull->relative_highest_offset;
23932 : }
23933 0 : if (highest_ofs < pull->data_size) {
23934 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23935 : "not all bytes consumed ofs[%u] size[%u]",
23936 : highest_ofs, pull->data_size);
23937 0 : TALLOC_FREE(pull);
23938 0 : PyErr_SetNdrError(err);
23939 0 : return NULL;
23940 : }
23941 : }
23942 :
23943 0 : TALLOC_FREE(pull);
23944 0 : Py_RETURN_NONE;
23945 : }
23946 :
23947 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23948 : {
23949 0 : DATA_BLOB blob;
23950 0 : Py_ssize_t blob_length = 0;
23951 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23952 0 : PyObject *bigendian_obj = NULL;
23953 0 : PyObject *ndr64_obj = NULL;
23954 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23955 0 : PyObject *allow_remaining_obj = NULL;
23956 0 : bool allow_remaining = false;
23957 :
23958 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23959 : discard_const_p(char *, kwnames),
23960 : &blob.data, &blob_length,
23961 : &bigendian_obj,
23962 : &ndr64_obj,
23963 : &allow_remaining_obj)) {
23964 0 : return NULL;
23965 : }
23966 0 : blob.length = blob_length;
23967 :
23968 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23969 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23970 : }
23971 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23972 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23973 : }
23974 :
23975 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23976 0 : allow_remaining = true;
23977 : }
23978 :
23979 0 : return py_svcctl_EnumDependentServicesA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23980 : }
23981 :
23982 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23983 : {
23984 0 : DATA_BLOB blob;
23985 0 : Py_ssize_t blob_length = 0;
23986 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23987 0 : PyObject *bigendian_obj = NULL;
23988 0 : PyObject *ndr64_obj = NULL;
23989 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23990 0 : PyObject *allow_remaining_obj = NULL;
23991 0 : bool allow_remaining = false;
23992 :
23993 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23994 : discard_const_p(char *, kwnames),
23995 : &blob.data, &blob_length,
23996 : &bigendian_obj,
23997 : &ndr64_obj,
23998 : &allow_remaining_obj)) {
23999 0 : return NULL;
24000 : }
24001 0 : blob.length = blob_length;
24002 :
24003 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24004 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24005 : }
24006 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24007 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24008 : }
24009 :
24010 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24011 0 : allow_remaining = true;
24012 : }
24013 :
24014 0 : return py_svcctl_EnumDependentServicesA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24015 : }
24016 :
24017 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24018 : {
24019 0 : const struct ndr_interface_call *call = NULL;
24020 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
24021 0 : PyObject *ret;
24022 0 : char *retstr;
24023 :
24024 0 : if (ndr_table_svcctl.num_calls < 26) {
24025 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesA_ndr_print");
24026 0 : return NULL;
24027 : }
24028 0 : call = &ndr_table_svcctl.calls[25];
24029 :
24030 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24031 0 : ret = PyUnicode_FromString(retstr);
24032 0 : TALLOC_FREE(retstr);
24033 :
24034 0 : return ret;
24035 : }
24036 :
24037 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24038 : {
24039 0 : return py_svcctl_EnumDependentServicesA_ndr_print(py_obj, "svcctl_EnumDependentServicesA_in", NDR_IN);
24040 : }
24041 :
24042 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24043 : {
24044 0 : return py_svcctl_EnumDependentServicesA_ndr_print(py_obj, "svcctl_EnumDependentServicesA_out", NDR_OUT);
24045 : }
24046 :
24047 : static PyMethodDef py_svcctl_EnumDependentServicesA_methods[] = {
24048 : { "opnum", (PyCFunction)py_svcctl_EnumDependentServicesA_ndr_opnum, METH_NOARGS|METH_CLASS,
24049 : "svcctl.EnumDependentServicesA.opnum() -> 25 (0x19) " },
24050 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24051 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24052 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24053 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24054 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24055 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24056 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24057 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24058 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumDependentServicesA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24059 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumDependentServicesA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24060 : { NULL, NULL, 0, NULL }
24061 : };
24062 :
24063 :
24064 : static PyTypeObject svcctl_EnumDependentServicesA_Type = {
24065 : PyVarObject_HEAD_INIT(NULL, 0)
24066 : .tp_name = "svcctl.EnumDependentServicesA",
24067 : .tp_getset = py_svcctl_EnumDependentServicesA_getsetters,
24068 : .tp_methods = py_svcctl_EnumDependentServicesA_methods,
24069 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24070 : .tp_new = py_svcctl_EnumDependentServicesA_new,
24071 : };
24072 :
24073 0 : static bool pack_py_svcctl_EnumDependentServicesA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumDependentServicesA *r)
24074 : {
24075 0 : PyObject *py_service;
24076 0 : PyObject *py_state;
24077 0 : PyObject *py_offered;
24078 0 : const char *kwnames[] = {
24079 : "service", "state", "offered", NULL
24080 : };
24081 :
24082 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_EnumDependentServicesA", discard_const_p(char *, kwnames), &py_service, &py_state, &py_offered)) {
24083 0 : return false;
24084 : }
24085 :
24086 0 : if (py_service == NULL) {
24087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service");
24088 0 : return false;
24089 : }
24090 0 : r->in.service = talloc_ptrtype(r, r->in.service);
24091 0 : if (r->in.service == NULL) {
24092 0 : PyErr_NoMemory();
24093 0 : return false;
24094 : }
24095 0 : PY_CHECK_TYPE(policy_handle_Type, py_service, return false;);
24096 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_service)) == NULL) {
24097 0 : PyErr_NoMemory();
24098 0 : return false;
24099 : }
24100 0 : r->in.service = (struct policy_handle *)pytalloc_get_ptr(py_service);
24101 0 : if (py_state == NULL) {
24102 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
24103 0 : return false;
24104 : }
24105 : {
24106 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
24107 0 : if (PyLong_Check(py_state)) {
24108 0 : unsigned long long test_var;
24109 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
24110 0 : if (PyErr_Occurred() != NULL) {
24111 0 : return false;
24112 : }
24113 0 : if (test_var > uint_max) {
24114 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24115 : PyLong_Type.tp_name, uint_max, test_var);
24116 0 : return false;
24117 : }
24118 0 : r->in.state = test_var;
24119 : } else {
24120 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24121 : PyLong_Type.tp_name);
24122 0 : return false;
24123 : }
24124 : }
24125 0 : if (py_offered == NULL) {
24126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
24127 0 : return false;
24128 : }
24129 : {
24130 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
24131 0 : if (PyLong_Check(py_offered)) {
24132 0 : unsigned long long test_var;
24133 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
24134 0 : if (PyErr_Occurred() != NULL) {
24135 0 : return false;
24136 : }
24137 0 : if (test_var > uint_max) {
24138 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24139 : PyLong_Type.tp_name, uint_max, test_var);
24140 0 : return false;
24141 : }
24142 0 : r->in.offered = test_var;
24143 : } else {
24144 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24145 : PyLong_Type.tp_name);
24146 0 : return false;
24147 : }
24148 : }
24149 0 : return true;
24150 : }
24151 :
24152 0 : static PyObject *unpack_py_svcctl_EnumDependentServicesA_args_out(struct svcctl_EnumDependentServicesA *r)
24153 : {
24154 0 : PyObject *result;
24155 0 : PyObject *py_service_status;
24156 0 : PyObject *py_needed;
24157 0 : PyObject *py_services_returned;
24158 0 : result = PyTuple_New(3);
24159 0 : if (r->out.service_status == NULL) {
24160 0 : py_service_status = Py_None;
24161 0 : Py_INCREF(py_service_status);
24162 : } else {
24163 0 : py_service_status = pytalloc_reference_ex(&ENUM_SERVICE_STATUSA_Type, r->out.service_status, r->out.service_status);
24164 : }
24165 0 : PyTuple_SetItem(result, 0, py_service_status);
24166 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
24167 0 : PyTuple_SetItem(result, 1, py_needed);
24168 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
24169 0 : PyTuple_SetItem(result, 2, py_services_returned);
24170 0 : if (!W_ERROR_IS_OK(r->out.result)) {
24171 0 : PyErr_SetWERROR(r->out.result);
24172 0 : return NULL;
24173 : }
24174 :
24175 0 : return result;
24176 : }
24177 :
24178 :
24179 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_handle(PyObject *obj, void *closure)
24180 : {
24181 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24182 0 : PyObject *py_handle;
24183 0 : if (object->in.handle == NULL) {
24184 0 : Py_RETURN_NONE;
24185 : }
24186 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
24187 0 : return py_handle;
24188 : }
24189 :
24190 0 : static int py_svcctl_EnumServicesStatusA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
24191 : {
24192 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24193 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
24194 0 : if (value == NULL) {
24195 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
24196 0 : return -1;
24197 : }
24198 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
24199 0 : if (object->in.handle == NULL) {
24200 0 : PyErr_NoMemory();
24201 0 : return -1;
24202 : }
24203 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24204 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24205 0 : PyErr_NoMemory();
24206 0 : return -1;
24207 : }
24208 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
24209 0 : return 0;
24210 : }
24211 :
24212 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_type(PyObject *obj, void *closure)
24213 : {
24214 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24215 0 : PyObject *py_type;
24216 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
24217 0 : return py_type;
24218 : }
24219 :
24220 0 : static int py_svcctl_EnumServicesStatusA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
24221 : {
24222 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24223 0 : if (value == NULL) {
24224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
24225 0 : return -1;
24226 : }
24227 : {
24228 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
24229 0 : if (PyLong_Check(value)) {
24230 0 : unsigned long long test_var;
24231 0 : test_var = PyLong_AsUnsignedLongLong(value);
24232 0 : if (PyErr_Occurred() != NULL) {
24233 0 : return -1;
24234 : }
24235 0 : if (test_var > uint_max) {
24236 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24237 : PyLong_Type.tp_name, uint_max, test_var);
24238 0 : return -1;
24239 : }
24240 0 : object->in.type = test_var;
24241 : } else {
24242 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24243 : PyLong_Type.tp_name);
24244 0 : return -1;
24245 : }
24246 : }
24247 0 : return 0;
24248 : }
24249 :
24250 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_state(PyObject *obj, void *closure)
24251 : {
24252 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24253 0 : PyObject *py_state;
24254 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
24255 0 : return py_state;
24256 : }
24257 :
24258 0 : static int py_svcctl_EnumServicesStatusA_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
24259 : {
24260 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24261 0 : if (value == NULL) {
24262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
24263 0 : return -1;
24264 : }
24265 : {
24266 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
24267 0 : if (PyLong_Check(value)) {
24268 0 : unsigned long long test_var;
24269 0 : test_var = PyLong_AsUnsignedLongLong(value);
24270 0 : if (PyErr_Occurred() != NULL) {
24271 0 : return -1;
24272 : }
24273 0 : if (test_var > uint_max) {
24274 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24275 : PyLong_Type.tp_name, uint_max, test_var);
24276 0 : return -1;
24277 : }
24278 0 : object->in.state = test_var;
24279 : } else {
24280 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24281 : PyLong_Type.tp_name);
24282 0 : return -1;
24283 : }
24284 : }
24285 0 : return 0;
24286 : }
24287 :
24288 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_offered(PyObject *obj, void *closure)
24289 : {
24290 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24291 0 : PyObject *py_offered;
24292 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
24293 0 : return py_offered;
24294 : }
24295 :
24296 0 : static int py_svcctl_EnumServicesStatusA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
24297 : {
24298 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24299 0 : if (value == NULL) {
24300 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
24301 0 : return -1;
24302 : }
24303 : {
24304 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
24305 0 : if (PyLong_Check(value)) {
24306 0 : unsigned long long test_var;
24307 0 : test_var = PyLong_AsUnsignedLongLong(value);
24308 0 : if (PyErr_Occurred() != NULL) {
24309 0 : return -1;
24310 : }
24311 0 : if (test_var > uint_max) {
24312 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24313 : PyLong_Type.tp_name, uint_max, test_var);
24314 0 : return -1;
24315 : }
24316 0 : object->in.offered = test_var;
24317 : } else {
24318 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24319 : PyLong_Type.tp_name);
24320 0 : return -1;
24321 : }
24322 : }
24323 0 : return 0;
24324 : }
24325 :
24326 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_service(PyObject *obj, void *closure)
24327 : {
24328 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24329 0 : PyObject *py_service;
24330 0 : py_service = PyList_New(object->in.offered);
24331 0 : if (py_service == NULL) {
24332 0 : return NULL;
24333 : }
24334 : {
24335 : int service_cntr_0;
24336 0 : for (service_cntr_0 = 0; service_cntr_0 < (object->in.offered); service_cntr_0++) {
24337 0 : PyObject *py_service_0;
24338 0 : py_service_0 = PyLong_FromLong((uint16_t)object->out.service[service_cntr_0]);
24339 0 : PyList_SetItem(py_service, service_cntr_0, py_service_0);
24340 : }
24341 : }
24342 0 : return py_service;
24343 : }
24344 :
24345 0 : static int py_svcctl_EnumServicesStatusA_out_set_service(PyObject *py_obj, PyObject *value, void *closure)
24346 : {
24347 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24348 0 : if (value == NULL) {
24349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service");
24350 0 : return -1;
24351 : }
24352 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
24353 : {
24354 0 : int service_cntr_0;
24355 0 : object->out.service = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service, PyList_GET_SIZE(value));
24356 0 : if (!object->out.service) { return -1; }
24357 0 : talloc_set_name_const(object->out.service, "ARRAY: object->out.service");
24358 0 : for (service_cntr_0 = 0; service_cntr_0 < PyList_GET_SIZE(value); service_cntr_0++) {
24359 0 : if (PyList_GET_ITEM(value, service_cntr_0) == NULL) {
24360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service[service_cntr_0]");
24361 0 : return -1;
24362 : }
24363 : {
24364 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.service[service_cntr_0]));
24365 0 : if (PyLong_Check(PyList_GET_ITEM(value, service_cntr_0))) {
24366 0 : unsigned long long test_var;
24367 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, service_cntr_0));
24368 0 : if (PyErr_Occurred() != NULL) {
24369 0 : return -1;
24370 : }
24371 0 : if (test_var > uint_max) {
24372 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24373 : PyLong_Type.tp_name, uint_max, test_var);
24374 0 : return -1;
24375 : }
24376 0 : object->out.service[service_cntr_0] = test_var;
24377 : } else {
24378 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24379 : PyLong_Type.tp_name);
24380 0 : return -1;
24381 : }
24382 : }
24383 : }
24384 : }
24385 0 : return 0;
24386 : }
24387 :
24388 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_needed(PyObject *obj, void *closure)
24389 : {
24390 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24391 0 : PyObject *py_needed;
24392 0 : if (object->out.needed == NULL) {
24393 0 : Py_RETURN_NONE;
24394 : }
24395 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
24396 0 : return py_needed;
24397 : }
24398 :
24399 0 : static int py_svcctl_EnumServicesStatusA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
24400 : {
24401 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24402 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
24403 0 : if (value == NULL) {
24404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
24405 0 : return -1;
24406 : }
24407 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
24408 0 : if (object->out.needed == NULL) {
24409 0 : PyErr_NoMemory();
24410 0 : return -1;
24411 : }
24412 : {
24413 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
24414 0 : if (PyLong_Check(value)) {
24415 0 : unsigned long long test_var;
24416 0 : test_var = PyLong_AsUnsignedLongLong(value);
24417 0 : if (PyErr_Occurred() != NULL) {
24418 0 : return -1;
24419 : }
24420 0 : if (test_var > uint_max) {
24421 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24422 : PyLong_Type.tp_name, uint_max, test_var);
24423 0 : return -1;
24424 : }
24425 0 : *object->out.needed = test_var;
24426 : } else {
24427 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24428 : PyLong_Type.tp_name);
24429 0 : return -1;
24430 : }
24431 : }
24432 0 : return 0;
24433 : }
24434 :
24435 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_services_returned(PyObject *obj, void *closure)
24436 : {
24437 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24438 0 : PyObject *py_services_returned;
24439 0 : if (object->out.services_returned == NULL) {
24440 0 : Py_RETURN_NONE;
24441 : }
24442 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
24443 0 : return py_services_returned;
24444 : }
24445 :
24446 0 : static int py_svcctl_EnumServicesStatusA_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
24447 : {
24448 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24449 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
24450 0 : if (value == NULL) {
24451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
24452 0 : return -1;
24453 : }
24454 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
24455 0 : if (object->out.services_returned == NULL) {
24456 0 : PyErr_NoMemory();
24457 0 : return -1;
24458 : }
24459 : {
24460 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
24461 0 : if (PyLong_Check(value)) {
24462 0 : unsigned long long test_var;
24463 0 : test_var = PyLong_AsUnsignedLongLong(value);
24464 0 : if (PyErr_Occurred() != NULL) {
24465 0 : return -1;
24466 : }
24467 0 : if (test_var > uint_max) {
24468 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24469 : PyLong_Type.tp_name, uint_max, test_var);
24470 0 : return -1;
24471 : }
24472 0 : *object->out.services_returned = test_var;
24473 : } else {
24474 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24475 : PyLong_Type.tp_name);
24476 0 : return -1;
24477 : }
24478 : }
24479 0 : return 0;
24480 : }
24481 :
24482 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_resume_handle(PyObject *obj, void *closure)
24483 : {
24484 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24485 0 : PyObject *py_resume_handle;
24486 0 : if (object->in.resume_handle == NULL) {
24487 0 : Py_RETURN_NONE;
24488 : }
24489 0 : if (object->in.resume_handle == NULL) {
24490 0 : py_resume_handle = Py_None;
24491 0 : Py_INCREF(py_resume_handle);
24492 : } else {
24493 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
24494 : }
24495 0 : return py_resume_handle;
24496 : }
24497 :
24498 0 : static int py_svcctl_EnumServicesStatusA_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
24499 : {
24500 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24501 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
24502 0 : if (value == NULL) {
24503 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
24504 0 : return -1;
24505 : }
24506 0 : if (value == Py_None) {
24507 0 : object->in.resume_handle = NULL;
24508 : } else {
24509 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
24510 0 : if (object->in.resume_handle == NULL) {
24511 0 : PyErr_NoMemory();
24512 0 : return -1;
24513 : }
24514 : {
24515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
24516 0 : if (PyLong_Check(value)) {
24517 0 : unsigned long long test_var;
24518 0 : test_var = PyLong_AsUnsignedLongLong(value);
24519 0 : if (PyErr_Occurred() != NULL) {
24520 0 : return -1;
24521 : }
24522 0 : if (test_var > uint_max) {
24523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24524 : PyLong_Type.tp_name, uint_max, test_var);
24525 0 : return -1;
24526 : }
24527 0 : *object->in.resume_handle = test_var;
24528 : } else {
24529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24530 : PyLong_Type.tp_name);
24531 0 : return -1;
24532 : }
24533 : }
24534 : }
24535 0 : return 0;
24536 : }
24537 :
24538 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_resume_handle(PyObject *obj, void *closure)
24539 : {
24540 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24541 0 : PyObject *py_resume_handle;
24542 0 : if (object->out.resume_handle == NULL) {
24543 0 : Py_RETURN_NONE;
24544 : }
24545 0 : if (object->out.resume_handle == NULL) {
24546 0 : py_resume_handle = Py_None;
24547 0 : Py_INCREF(py_resume_handle);
24548 : } else {
24549 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
24550 : }
24551 0 : return py_resume_handle;
24552 : }
24553 :
24554 0 : static int py_svcctl_EnumServicesStatusA_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
24555 : {
24556 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24557 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
24558 0 : if (value == NULL) {
24559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
24560 0 : return -1;
24561 : }
24562 0 : if (value == Py_None) {
24563 0 : object->out.resume_handle = NULL;
24564 : } else {
24565 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
24566 0 : if (object->out.resume_handle == NULL) {
24567 0 : PyErr_NoMemory();
24568 0 : return -1;
24569 : }
24570 : {
24571 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
24572 0 : if (PyLong_Check(value)) {
24573 0 : unsigned long long test_var;
24574 0 : test_var = PyLong_AsUnsignedLongLong(value);
24575 0 : if (PyErr_Occurred() != NULL) {
24576 0 : return -1;
24577 : }
24578 0 : if (test_var > uint_max) {
24579 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24580 : PyLong_Type.tp_name, uint_max, test_var);
24581 0 : return -1;
24582 : }
24583 0 : *object->out.resume_handle = test_var;
24584 : } else {
24585 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24586 : PyLong_Type.tp_name);
24587 0 : return -1;
24588 : }
24589 : }
24590 : }
24591 0 : return 0;
24592 : }
24593 :
24594 0 : static PyObject *py_svcctl_EnumServicesStatusA_get_result(PyObject *obj, void *closure)
24595 : {
24596 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
24597 0 : PyObject *py_result;
24598 0 : py_result = PyErr_FromWERROR(object->out.result);
24599 0 : return py_result;
24600 : }
24601 :
24602 0 : static int py_svcctl_EnumServicesStatusA_set_result(PyObject *py_obj, PyObject *value, void *closure)
24603 : {
24604 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24605 0 : if (value == NULL) {
24606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
24607 0 : return -1;
24608 : }
24609 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
24610 0 : return 0;
24611 : }
24612 :
24613 : static PyGetSetDef py_svcctl_EnumServicesStatusA_getsetters[] = {
24614 : {
24615 : .name = discard_const_p(char, "in_handle"),
24616 : .get = py_svcctl_EnumServicesStatusA_in_get_handle,
24617 : .set = py_svcctl_EnumServicesStatusA_in_set_handle,
24618 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24619 : },
24620 : {
24621 : .name = discard_const_p(char, "in_type"),
24622 : .get = py_svcctl_EnumServicesStatusA_in_get_type,
24623 : .set = py_svcctl_EnumServicesStatusA_in_set_type,
24624 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24625 : },
24626 : {
24627 : .name = discard_const_p(char, "in_state"),
24628 : .get = py_svcctl_EnumServicesStatusA_in_get_state,
24629 : .set = py_svcctl_EnumServicesStatusA_in_set_state,
24630 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
24631 : },
24632 : {
24633 : .name = discard_const_p(char, "in_offered"),
24634 : .get = py_svcctl_EnumServicesStatusA_in_get_offered,
24635 : .set = py_svcctl_EnumServicesStatusA_in_set_offered,
24636 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24637 : },
24638 : {
24639 : .name = discard_const_p(char, "out_service"),
24640 : .get = py_svcctl_EnumServicesStatusA_out_get_service,
24641 : .set = py_svcctl_EnumServicesStatusA_out_set_service,
24642 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
24643 : },
24644 : {
24645 : .name = discard_const_p(char, "out_needed"),
24646 : .get = py_svcctl_EnumServicesStatusA_out_get_needed,
24647 : .set = py_svcctl_EnumServicesStatusA_out_set_needed,
24648 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24649 : },
24650 : {
24651 : .name = discard_const_p(char, "out_services_returned"),
24652 : .get = py_svcctl_EnumServicesStatusA_out_get_services_returned,
24653 : .set = py_svcctl_EnumServicesStatusA_out_set_services_returned,
24654 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24655 : },
24656 : {
24657 : .name = discard_const_p(char, "in_resume_handle"),
24658 : .get = py_svcctl_EnumServicesStatusA_in_get_resume_handle,
24659 : .set = py_svcctl_EnumServicesStatusA_in_set_resume_handle,
24660 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24661 : },
24662 : {
24663 : .name = discard_const_p(char, "out_resume_handle"),
24664 : .get = py_svcctl_EnumServicesStatusA_out_get_resume_handle,
24665 : .set = py_svcctl_EnumServicesStatusA_out_set_resume_handle,
24666 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24667 : },
24668 : {
24669 : .name = discard_const_p(char, "result"),
24670 : .get = py_svcctl_EnumServicesStatusA_get_result,
24671 : .set = py_svcctl_EnumServicesStatusA_set_result,
24672 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
24673 : },
24674 : { .name = NULL }
24675 : };
24676 :
24677 0 : static PyObject *py_svcctl_EnumServicesStatusA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24678 : {
24679 0 : PyObject *self = pytalloc_new(struct svcctl_EnumServicesStatusA, type);
24680 0 : struct svcctl_EnumServicesStatusA *_self = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(self);
24681 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24682 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
24683 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
24684 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
24685 0 : return self;
24686 : }
24687 :
24688 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24689 : {
24690 :
24691 :
24692 0 : return PyLong_FromLong(26);
24693 : }
24694 :
24695 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
24696 : {
24697 0 : const struct ndr_interface_call *call = NULL;
24698 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24699 0 : PyObject *ret = NULL;
24700 0 : struct ndr_push *push = NULL;
24701 0 : DATA_BLOB blob;
24702 0 : enum ndr_err_code err;
24703 :
24704 0 : if (ndr_table_svcctl.num_calls < 27) {
24705 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusA_ndr_pack");
24706 0 : return NULL;
24707 : }
24708 0 : call = &ndr_table_svcctl.calls[26];
24709 :
24710 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24711 0 : if (push == NULL) {
24712 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24713 0 : return NULL;
24714 : }
24715 :
24716 0 : push->flags |= ndr_push_flags;
24717 :
24718 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24719 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24720 0 : TALLOC_FREE(push);
24721 0 : PyErr_SetNdrError(err);
24722 0 : return NULL;
24723 : }
24724 0 : blob = ndr_push_blob(push);
24725 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24726 0 : TALLOC_FREE(push);
24727 0 : return ret;
24728 : }
24729 :
24730 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24731 : {
24732 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24733 0 : PyObject *bigendian_obj = NULL;
24734 0 : PyObject *ndr64_obj = NULL;
24735 0 : libndr_flags ndr_push_flags = 0;
24736 :
24737 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24738 : discard_const_p(char *, kwnames),
24739 : &bigendian_obj,
24740 : &ndr64_obj)) {
24741 0 : return NULL;
24742 : }
24743 :
24744 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24745 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24746 : }
24747 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24748 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24749 : }
24750 :
24751 0 : return py_svcctl_EnumServicesStatusA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24752 : }
24753 :
24754 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24755 : {
24756 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24757 0 : PyObject *bigendian_obj = NULL;
24758 0 : PyObject *ndr64_obj = NULL;
24759 0 : libndr_flags ndr_push_flags = 0;
24760 :
24761 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24762 : discard_const_p(char *, kwnames),
24763 : &bigendian_obj,
24764 : &ndr64_obj)) {
24765 0 : return NULL;
24766 : }
24767 :
24768 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24769 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24770 : }
24771 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24772 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24773 : }
24774 :
24775 0 : return py_svcctl_EnumServicesStatusA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24776 : }
24777 :
24778 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
24779 : {
24780 0 : const struct ndr_interface_call *call = NULL;
24781 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24782 0 : struct ndr_pull *pull = NULL;
24783 0 : enum ndr_err_code err;
24784 :
24785 0 : if (ndr_table_svcctl.num_calls < 27) {
24786 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusA_ndr_unpack");
24787 0 : return NULL;
24788 : }
24789 0 : call = &ndr_table_svcctl.calls[26];
24790 :
24791 0 : pull = ndr_pull_init_blob(blob, object);
24792 0 : if (pull == NULL) {
24793 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24794 0 : return NULL;
24795 : }
24796 :
24797 0 : pull->flags |= ndr_pull_flags;
24798 :
24799 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24800 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24801 0 : TALLOC_FREE(pull);
24802 0 : PyErr_SetNdrError(err);
24803 0 : return NULL;
24804 : }
24805 0 : if (!allow_remaining) {
24806 0 : uint32_t highest_ofs;
24807 :
24808 0 : if (pull->offset > pull->relative_highest_offset) {
24809 0 : highest_ofs = pull->offset;
24810 : } else {
24811 0 : highest_ofs = pull->relative_highest_offset;
24812 : }
24813 0 : if (highest_ofs < pull->data_size) {
24814 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24815 : "not all bytes consumed ofs[%u] size[%u]",
24816 : highest_ofs, pull->data_size);
24817 0 : TALLOC_FREE(pull);
24818 0 : PyErr_SetNdrError(err);
24819 0 : return NULL;
24820 : }
24821 : }
24822 :
24823 0 : TALLOC_FREE(pull);
24824 0 : Py_RETURN_NONE;
24825 : }
24826 :
24827 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24828 : {
24829 0 : DATA_BLOB blob;
24830 0 : Py_ssize_t blob_length = 0;
24831 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24832 0 : PyObject *bigendian_obj = NULL;
24833 0 : PyObject *ndr64_obj = NULL;
24834 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24835 0 : PyObject *allow_remaining_obj = NULL;
24836 0 : bool allow_remaining = false;
24837 :
24838 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24839 : discard_const_p(char *, kwnames),
24840 : &blob.data, &blob_length,
24841 : &bigendian_obj,
24842 : &ndr64_obj,
24843 : &allow_remaining_obj)) {
24844 0 : return NULL;
24845 : }
24846 0 : blob.length = blob_length;
24847 :
24848 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24849 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24850 : }
24851 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24852 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24853 : }
24854 :
24855 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24856 0 : allow_remaining = true;
24857 : }
24858 :
24859 0 : return py_svcctl_EnumServicesStatusA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24860 : }
24861 :
24862 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24863 : {
24864 0 : DATA_BLOB blob;
24865 0 : Py_ssize_t blob_length = 0;
24866 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24867 0 : PyObject *bigendian_obj = NULL;
24868 0 : PyObject *ndr64_obj = NULL;
24869 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24870 0 : PyObject *allow_remaining_obj = NULL;
24871 0 : bool allow_remaining = false;
24872 :
24873 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24874 : discard_const_p(char *, kwnames),
24875 : &blob.data, &blob_length,
24876 : &bigendian_obj,
24877 : &ndr64_obj,
24878 : &allow_remaining_obj)) {
24879 0 : return NULL;
24880 : }
24881 0 : blob.length = blob_length;
24882 :
24883 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24884 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24885 : }
24886 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24887 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24888 : }
24889 :
24890 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24891 0 : allow_remaining = true;
24892 : }
24893 :
24894 0 : return py_svcctl_EnumServicesStatusA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24895 : }
24896 :
24897 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24898 : {
24899 0 : const struct ndr_interface_call *call = NULL;
24900 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
24901 0 : PyObject *ret;
24902 0 : char *retstr;
24903 :
24904 0 : if (ndr_table_svcctl.num_calls < 27) {
24905 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusA_ndr_print");
24906 0 : return NULL;
24907 : }
24908 0 : call = &ndr_table_svcctl.calls[26];
24909 :
24910 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24911 0 : ret = PyUnicode_FromString(retstr);
24912 0 : TALLOC_FREE(retstr);
24913 :
24914 0 : return ret;
24915 : }
24916 :
24917 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24918 : {
24919 0 : return py_svcctl_EnumServicesStatusA_ndr_print(py_obj, "svcctl_EnumServicesStatusA_in", NDR_IN);
24920 : }
24921 :
24922 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24923 : {
24924 0 : return py_svcctl_EnumServicesStatusA_ndr_print(py_obj, "svcctl_EnumServicesStatusA_out", NDR_OUT);
24925 : }
24926 :
24927 : static PyMethodDef py_svcctl_EnumServicesStatusA_methods[] = {
24928 : { "opnum", (PyCFunction)py_svcctl_EnumServicesStatusA_ndr_opnum, METH_NOARGS|METH_CLASS,
24929 : "svcctl.EnumServicesStatusA.opnum() -> 26 (0x1a) " },
24930 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24931 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24932 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24933 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24934 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24935 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24936 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24937 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24938 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumServicesStatusA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24939 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumServicesStatusA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24940 : { NULL, NULL, 0, NULL }
24941 : };
24942 :
24943 :
24944 : static PyTypeObject svcctl_EnumServicesStatusA_Type = {
24945 : PyVarObject_HEAD_INIT(NULL, 0)
24946 : .tp_name = "svcctl.EnumServicesStatusA",
24947 : .tp_getset = py_svcctl_EnumServicesStatusA_getsetters,
24948 : .tp_methods = py_svcctl_EnumServicesStatusA_methods,
24949 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24950 : .tp_new = py_svcctl_EnumServicesStatusA_new,
24951 : };
24952 :
24953 0 : static bool pack_py_svcctl_EnumServicesStatusA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumServicesStatusA *r)
24954 : {
24955 0 : PyObject *py_handle;
24956 0 : PyObject *py_type;
24957 0 : PyObject *py_state;
24958 0 : PyObject *py_offered;
24959 0 : PyObject *py_resume_handle;
24960 0 : const char *kwnames[] = {
24961 : "handle", "type", "state", "offered", "resume_handle", NULL
24962 : };
24963 :
24964 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:svcctl_EnumServicesStatusA", discard_const_p(char *, kwnames), &py_handle, &py_type, &py_state, &py_offered, &py_resume_handle)) {
24965 0 : return false;
24966 : }
24967 :
24968 0 : if (py_handle == NULL) {
24969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
24970 0 : return false;
24971 : }
24972 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
24973 0 : if (r->in.handle == NULL) {
24974 0 : PyErr_NoMemory();
24975 0 : return false;
24976 : }
24977 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
24978 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
24979 0 : PyErr_NoMemory();
24980 0 : return false;
24981 : }
24982 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
24983 0 : if (py_type == NULL) {
24984 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
24985 0 : return false;
24986 : }
24987 : {
24988 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
24989 0 : if (PyLong_Check(py_type)) {
24990 0 : unsigned long long test_var;
24991 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
24992 0 : if (PyErr_Occurred() != NULL) {
24993 0 : return false;
24994 : }
24995 0 : if (test_var > uint_max) {
24996 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24997 : PyLong_Type.tp_name, uint_max, test_var);
24998 0 : return false;
24999 : }
25000 0 : r->in.type = test_var;
25001 : } else {
25002 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25003 : PyLong_Type.tp_name);
25004 0 : return false;
25005 : }
25006 : }
25007 0 : if (py_state == NULL) {
25008 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
25009 0 : return false;
25010 : }
25011 : {
25012 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
25013 0 : if (PyLong_Check(py_state)) {
25014 0 : unsigned long long test_var;
25015 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
25016 0 : if (PyErr_Occurred() != NULL) {
25017 0 : return false;
25018 : }
25019 0 : if (test_var > uint_max) {
25020 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25021 : PyLong_Type.tp_name, uint_max, test_var);
25022 0 : return false;
25023 : }
25024 0 : r->in.state = test_var;
25025 : } else {
25026 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25027 : PyLong_Type.tp_name);
25028 0 : return false;
25029 : }
25030 : }
25031 0 : if (py_offered == NULL) {
25032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
25033 0 : return false;
25034 : }
25035 : {
25036 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
25037 0 : if (PyLong_Check(py_offered)) {
25038 0 : unsigned long long test_var;
25039 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
25040 0 : if (PyErr_Occurred() != NULL) {
25041 0 : return false;
25042 : }
25043 0 : if (test_var > uint_max) {
25044 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25045 : PyLong_Type.tp_name, uint_max, test_var);
25046 0 : return false;
25047 : }
25048 0 : r->in.offered = test_var;
25049 : } else {
25050 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25051 : PyLong_Type.tp_name);
25052 0 : return false;
25053 : }
25054 : }
25055 0 : if (py_resume_handle == NULL) {
25056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
25057 0 : return false;
25058 : }
25059 0 : if (py_resume_handle == Py_None) {
25060 0 : r->in.resume_handle = NULL;
25061 : } else {
25062 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
25063 0 : if (r->in.resume_handle == NULL) {
25064 0 : PyErr_NoMemory();
25065 0 : return false;
25066 : }
25067 : {
25068 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
25069 0 : if (PyLong_Check(py_resume_handle)) {
25070 0 : unsigned long long test_var;
25071 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
25072 0 : if (PyErr_Occurred() != NULL) {
25073 0 : return false;
25074 : }
25075 0 : if (test_var > uint_max) {
25076 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25077 : PyLong_Type.tp_name, uint_max, test_var);
25078 0 : return false;
25079 : }
25080 0 : *r->in.resume_handle = test_var;
25081 : } else {
25082 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25083 : PyLong_Type.tp_name);
25084 0 : return false;
25085 : }
25086 : }
25087 : }
25088 0 : return true;
25089 : }
25090 :
25091 0 : static PyObject *unpack_py_svcctl_EnumServicesStatusA_args_out(struct svcctl_EnumServicesStatusA *r)
25092 : {
25093 0 : PyObject *result;
25094 0 : PyObject *py_service;
25095 0 : PyObject *py_needed;
25096 0 : PyObject *py_services_returned;
25097 0 : PyObject *py_resume_handle;
25098 0 : result = PyTuple_New(4);
25099 0 : py_service = PyList_New(r->in.offered);
25100 0 : if (py_service == NULL) {
25101 0 : return NULL;
25102 : }
25103 : {
25104 : int service_cntr_0;
25105 0 : for (service_cntr_0 = 0; service_cntr_0 < (r->in.offered); service_cntr_0++) {
25106 0 : PyObject *py_service_0;
25107 0 : py_service_0 = PyLong_FromLong((uint16_t)r->out.service[service_cntr_0]);
25108 0 : PyList_SetItem(py_service, service_cntr_0, py_service_0);
25109 : }
25110 : }
25111 0 : PyTuple_SetItem(result, 0, py_service);
25112 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
25113 0 : PyTuple_SetItem(result, 1, py_needed);
25114 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
25115 0 : PyTuple_SetItem(result, 2, py_services_returned);
25116 0 : if (r->out.resume_handle == NULL) {
25117 0 : py_resume_handle = Py_None;
25118 0 : Py_INCREF(py_resume_handle);
25119 : } else {
25120 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
25121 : }
25122 0 : PyTuple_SetItem(result, 3, py_resume_handle);
25123 0 : if (!W_ERROR_IS_OK(r->out.result)) {
25124 0 : PyErr_SetWERROR(r->out.result);
25125 0 : return NULL;
25126 : }
25127 :
25128 0 : return result;
25129 : }
25130 :
25131 :
25132 0 : static PyObject *py_svcctl_OpenSCManagerA_in_get_MachineName(PyObject *obj, void *closure)
25133 : {
25134 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
25135 0 : PyObject *py_MachineName;
25136 0 : if (object->in.MachineName == NULL) {
25137 0 : Py_RETURN_NONE;
25138 : }
25139 0 : if (object->in.MachineName == NULL) {
25140 0 : py_MachineName = Py_None;
25141 0 : Py_INCREF(py_MachineName);
25142 : } else {
25143 0 : if (object->in.MachineName == NULL) {
25144 0 : py_MachineName = Py_None;
25145 0 : Py_INCREF(py_MachineName);
25146 : } else {
25147 0 : py_MachineName = PyUnicode_Decode(object->in.MachineName, strlen(object->in.MachineName), "utf-8", "ignore");
25148 : }
25149 : }
25150 0 : return py_MachineName;
25151 : }
25152 :
25153 0 : static int py_svcctl_OpenSCManagerA_in_set_MachineName(PyObject *py_obj, PyObject *value, void *closure)
25154 : {
25155 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25156 0 : if (value == NULL) {
25157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.MachineName");
25158 0 : return -1;
25159 : }
25160 0 : if (value == Py_None) {
25161 0 : object->in.MachineName = NULL;
25162 : } else {
25163 0 : object->in.MachineName = NULL;
25164 : {
25165 0 : const char *test_str;
25166 0 : const char *talloc_str;
25167 0 : PyObject *unicode = NULL;
25168 0 : if (PyUnicode_Check(value)) {
25169 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
25170 0 : if (unicode == NULL) {
25171 0 : return -1;
25172 : }
25173 0 : test_str = PyBytes_AS_STRING(unicode);
25174 0 : } else if (PyBytes_Check(value)) {
25175 0 : test_str = PyBytes_AS_STRING(value);
25176 : } else {
25177 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
25178 0 : return -1;
25179 : }
25180 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
25181 0 : if (unicode != NULL) {
25182 0 : Py_DECREF(unicode);
25183 : }
25184 0 : if (talloc_str == NULL) {
25185 0 : PyErr_NoMemory();
25186 0 : return -1;
25187 : }
25188 0 : object->in.MachineName = talloc_str;
25189 : }
25190 : }
25191 0 : return 0;
25192 : }
25193 :
25194 0 : static PyObject *py_svcctl_OpenSCManagerA_in_get_DatabaseName(PyObject *obj, void *closure)
25195 : {
25196 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
25197 0 : PyObject *py_DatabaseName;
25198 0 : if (object->in.DatabaseName == NULL) {
25199 0 : Py_RETURN_NONE;
25200 : }
25201 0 : if (object->in.DatabaseName == NULL) {
25202 0 : py_DatabaseName = Py_None;
25203 0 : Py_INCREF(py_DatabaseName);
25204 : } else {
25205 0 : if (object->in.DatabaseName == NULL) {
25206 0 : py_DatabaseName = Py_None;
25207 0 : Py_INCREF(py_DatabaseName);
25208 : } else {
25209 0 : py_DatabaseName = PyUnicode_Decode(object->in.DatabaseName, strlen(object->in.DatabaseName), "utf-8", "ignore");
25210 : }
25211 : }
25212 0 : return py_DatabaseName;
25213 : }
25214 :
25215 0 : static int py_svcctl_OpenSCManagerA_in_set_DatabaseName(PyObject *py_obj, PyObject *value, void *closure)
25216 : {
25217 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25218 0 : if (value == NULL) {
25219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DatabaseName");
25220 0 : return -1;
25221 : }
25222 0 : if (value == Py_None) {
25223 0 : object->in.DatabaseName = NULL;
25224 : } else {
25225 0 : object->in.DatabaseName = NULL;
25226 : {
25227 0 : const char *test_str;
25228 0 : const char *talloc_str;
25229 0 : PyObject *unicode = NULL;
25230 0 : if (PyUnicode_Check(value)) {
25231 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
25232 0 : if (unicode == NULL) {
25233 0 : return -1;
25234 : }
25235 0 : test_str = PyBytes_AS_STRING(unicode);
25236 0 : } else if (PyBytes_Check(value)) {
25237 0 : test_str = PyBytes_AS_STRING(value);
25238 : } else {
25239 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
25240 0 : return -1;
25241 : }
25242 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
25243 0 : if (unicode != NULL) {
25244 0 : Py_DECREF(unicode);
25245 : }
25246 0 : if (talloc_str == NULL) {
25247 0 : PyErr_NoMemory();
25248 0 : return -1;
25249 : }
25250 0 : object->in.DatabaseName = talloc_str;
25251 : }
25252 : }
25253 0 : return 0;
25254 : }
25255 :
25256 0 : static PyObject *py_svcctl_OpenSCManagerA_in_get_access_mask(PyObject *obj, void *closure)
25257 : {
25258 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
25259 0 : PyObject *py_access_mask;
25260 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
25261 0 : return py_access_mask;
25262 : }
25263 :
25264 0 : static int py_svcctl_OpenSCManagerA_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
25265 : {
25266 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25267 0 : if (value == NULL) {
25268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
25269 0 : return -1;
25270 : }
25271 : {
25272 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
25273 0 : if (PyLong_Check(value)) {
25274 0 : unsigned long long test_var;
25275 0 : test_var = PyLong_AsUnsignedLongLong(value);
25276 0 : if (PyErr_Occurred() != NULL) {
25277 0 : return -1;
25278 : }
25279 0 : if (test_var > uint_max) {
25280 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25281 : PyLong_Type.tp_name, uint_max, test_var);
25282 0 : return -1;
25283 : }
25284 0 : object->in.access_mask = test_var;
25285 : } else {
25286 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25287 : PyLong_Type.tp_name);
25288 0 : return -1;
25289 : }
25290 : }
25291 0 : return 0;
25292 : }
25293 :
25294 0 : static PyObject *py_svcctl_OpenSCManagerA_out_get_handle(PyObject *obj, void *closure)
25295 : {
25296 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
25297 0 : PyObject *py_handle;
25298 0 : if (object->out.handle == NULL) {
25299 0 : Py_RETURN_NONE;
25300 : }
25301 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
25302 0 : return py_handle;
25303 : }
25304 :
25305 0 : static int py_svcctl_OpenSCManagerA_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
25306 : {
25307 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25308 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
25309 0 : if (value == NULL) {
25310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
25311 0 : return -1;
25312 : }
25313 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
25314 0 : if (object->out.handle == NULL) {
25315 0 : PyErr_NoMemory();
25316 0 : return -1;
25317 : }
25318 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25319 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25320 0 : PyErr_NoMemory();
25321 0 : return -1;
25322 : }
25323 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
25324 0 : return 0;
25325 : }
25326 :
25327 0 : static PyObject *py_svcctl_OpenSCManagerA_get_result(PyObject *obj, void *closure)
25328 : {
25329 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
25330 0 : PyObject *py_result;
25331 0 : py_result = PyErr_FromWERROR(object->out.result);
25332 0 : return py_result;
25333 : }
25334 :
25335 0 : static int py_svcctl_OpenSCManagerA_set_result(PyObject *py_obj, PyObject *value, void *closure)
25336 : {
25337 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25338 0 : if (value == NULL) {
25339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25340 0 : return -1;
25341 : }
25342 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
25343 0 : return 0;
25344 : }
25345 :
25346 : static PyGetSetDef py_svcctl_OpenSCManagerA_getsetters[] = {
25347 : {
25348 : .name = discard_const_p(char, "in_MachineName"),
25349 : .get = py_svcctl_OpenSCManagerA_in_get_MachineName,
25350 : .set = py_svcctl_OpenSCManagerA_in_set_MachineName,
25351 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
25352 : },
25353 : {
25354 : .name = discard_const_p(char, "in_DatabaseName"),
25355 : .get = py_svcctl_OpenSCManagerA_in_get_DatabaseName,
25356 : .set = py_svcctl_OpenSCManagerA_in_set_DatabaseName,
25357 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
25358 : },
25359 : {
25360 : .name = discard_const_p(char, "in_access_mask"),
25361 : .get = py_svcctl_OpenSCManagerA_in_get_access_mask,
25362 : .set = py_svcctl_OpenSCManagerA_in_set_access_mask,
25363 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25364 : },
25365 : {
25366 : .name = discard_const_p(char, "out_handle"),
25367 : .get = py_svcctl_OpenSCManagerA_out_get_handle,
25368 : .set = py_svcctl_OpenSCManagerA_out_set_handle,
25369 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25370 : },
25371 : {
25372 : .name = discard_const_p(char, "result"),
25373 : .get = py_svcctl_OpenSCManagerA_get_result,
25374 : .set = py_svcctl_OpenSCManagerA_set_result,
25375 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
25376 : },
25377 : { .name = NULL }
25378 : };
25379 :
25380 0 : static PyObject *py_svcctl_OpenSCManagerA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25381 : {
25382 0 : PyObject *self = pytalloc_new(struct svcctl_OpenSCManagerA, type);
25383 0 : struct svcctl_OpenSCManagerA *_self = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(self);
25384 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25385 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
25386 0 : return self;
25387 : }
25388 :
25389 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25390 : {
25391 :
25392 :
25393 0 : return PyLong_FromLong(27);
25394 : }
25395 :
25396 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
25397 : {
25398 0 : const struct ndr_interface_call *call = NULL;
25399 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25400 0 : PyObject *ret = NULL;
25401 0 : struct ndr_push *push = NULL;
25402 0 : DATA_BLOB blob;
25403 0 : enum ndr_err_code err;
25404 :
25405 0 : if (ndr_table_svcctl.num_calls < 28) {
25406 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerA_ndr_pack");
25407 0 : return NULL;
25408 : }
25409 0 : call = &ndr_table_svcctl.calls[27];
25410 :
25411 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25412 0 : if (push == NULL) {
25413 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25414 0 : return NULL;
25415 : }
25416 :
25417 0 : push->flags |= ndr_push_flags;
25418 :
25419 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25420 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25421 0 : TALLOC_FREE(push);
25422 0 : PyErr_SetNdrError(err);
25423 0 : return NULL;
25424 : }
25425 0 : blob = ndr_push_blob(push);
25426 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25427 0 : TALLOC_FREE(push);
25428 0 : return ret;
25429 : }
25430 :
25431 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25432 : {
25433 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25434 0 : PyObject *bigendian_obj = NULL;
25435 0 : PyObject *ndr64_obj = NULL;
25436 0 : libndr_flags ndr_push_flags = 0;
25437 :
25438 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25439 : discard_const_p(char *, kwnames),
25440 : &bigendian_obj,
25441 : &ndr64_obj)) {
25442 0 : return NULL;
25443 : }
25444 :
25445 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25446 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25447 : }
25448 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25449 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25450 : }
25451 :
25452 0 : return py_svcctl_OpenSCManagerA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25453 : }
25454 :
25455 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25456 : {
25457 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25458 0 : PyObject *bigendian_obj = NULL;
25459 0 : PyObject *ndr64_obj = NULL;
25460 0 : libndr_flags ndr_push_flags = 0;
25461 :
25462 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25463 : discard_const_p(char *, kwnames),
25464 : &bigendian_obj,
25465 : &ndr64_obj)) {
25466 0 : return NULL;
25467 : }
25468 :
25469 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25470 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25471 : }
25472 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25473 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25474 : }
25475 :
25476 0 : return py_svcctl_OpenSCManagerA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25477 : }
25478 :
25479 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
25480 : {
25481 0 : const struct ndr_interface_call *call = NULL;
25482 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25483 0 : struct ndr_pull *pull = NULL;
25484 0 : enum ndr_err_code err;
25485 :
25486 0 : if (ndr_table_svcctl.num_calls < 28) {
25487 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerA_ndr_unpack");
25488 0 : return NULL;
25489 : }
25490 0 : call = &ndr_table_svcctl.calls[27];
25491 :
25492 0 : pull = ndr_pull_init_blob(blob, object);
25493 0 : if (pull == NULL) {
25494 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25495 0 : return NULL;
25496 : }
25497 :
25498 0 : pull->flags |= ndr_pull_flags;
25499 :
25500 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25501 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25502 0 : TALLOC_FREE(pull);
25503 0 : PyErr_SetNdrError(err);
25504 0 : return NULL;
25505 : }
25506 0 : if (!allow_remaining) {
25507 0 : uint32_t highest_ofs;
25508 :
25509 0 : if (pull->offset > pull->relative_highest_offset) {
25510 0 : highest_ofs = pull->offset;
25511 : } else {
25512 0 : highest_ofs = pull->relative_highest_offset;
25513 : }
25514 0 : if (highest_ofs < pull->data_size) {
25515 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25516 : "not all bytes consumed ofs[%u] size[%u]",
25517 : highest_ofs, pull->data_size);
25518 0 : TALLOC_FREE(pull);
25519 0 : PyErr_SetNdrError(err);
25520 0 : return NULL;
25521 : }
25522 : }
25523 :
25524 0 : TALLOC_FREE(pull);
25525 0 : Py_RETURN_NONE;
25526 : }
25527 :
25528 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25529 : {
25530 0 : DATA_BLOB blob;
25531 0 : Py_ssize_t blob_length = 0;
25532 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25533 0 : PyObject *bigendian_obj = NULL;
25534 0 : PyObject *ndr64_obj = NULL;
25535 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25536 0 : PyObject *allow_remaining_obj = NULL;
25537 0 : bool allow_remaining = false;
25538 :
25539 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25540 : discard_const_p(char *, kwnames),
25541 : &blob.data, &blob_length,
25542 : &bigendian_obj,
25543 : &ndr64_obj,
25544 : &allow_remaining_obj)) {
25545 0 : return NULL;
25546 : }
25547 0 : blob.length = blob_length;
25548 :
25549 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25550 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25551 : }
25552 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25553 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25554 : }
25555 :
25556 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25557 0 : allow_remaining = true;
25558 : }
25559 :
25560 0 : return py_svcctl_OpenSCManagerA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25561 : }
25562 :
25563 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25564 : {
25565 0 : DATA_BLOB blob;
25566 0 : Py_ssize_t blob_length = 0;
25567 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25568 0 : PyObject *bigendian_obj = NULL;
25569 0 : PyObject *ndr64_obj = NULL;
25570 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25571 0 : PyObject *allow_remaining_obj = NULL;
25572 0 : bool allow_remaining = false;
25573 :
25574 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25575 : discard_const_p(char *, kwnames),
25576 : &blob.data, &blob_length,
25577 : &bigendian_obj,
25578 : &ndr64_obj,
25579 : &allow_remaining_obj)) {
25580 0 : return NULL;
25581 : }
25582 0 : blob.length = blob_length;
25583 :
25584 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25585 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25586 : }
25587 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25588 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25589 : }
25590 :
25591 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25592 0 : allow_remaining = true;
25593 : }
25594 :
25595 0 : return py_svcctl_OpenSCManagerA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25596 : }
25597 :
25598 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
25599 : {
25600 0 : const struct ndr_interface_call *call = NULL;
25601 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
25602 0 : PyObject *ret;
25603 0 : char *retstr;
25604 :
25605 0 : if (ndr_table_svcctl.num_calls < 28) {
25606 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerA_ndr_print");
25607 0 : return NULL;
25608 : }
25609 0 : call = &ndr_table_svcctl.calls[27];
25610 :
25611 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25612 0 : ret = PyUnicode_FromString(retstr);
25613 0 : TALLOC_FREE(retstr);
25614 :
25615 0 : return ret;
25616 : }
25617 :
25618 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25619 : {
25620 0 : return py_svcctl_OpenSCManagerA_ndr_print(py_obj, "svcctl_OpenSCManagerA_in", NDR_IN);
25621 : }
25622 :
25623 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25624 : {
25625 0 : return py_svcctl_OpenSCManagerA_ndr_print(py_obj, "svcctl_OpenSCManagerA_out", NDR_OUT);
25626 : }
25627 :
25628 : static PyMethodDef py_svcctl_OpenSCManagerA_methods[] = {
25629 : { "opnum", (PyCFunction)py_svcctl_OpenSCManagerA_ndr_opnum, METH_NOARGS|METH_CLASS,
25630 : "svcctl.OpenSCManagerA.opnum() -> 27 (0x1b) " },
25631 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25632 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25633 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25634 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25635 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25636 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25637 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25638 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25639 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenSCManagerA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25640 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenSCManagerA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25641 : { NULL, NULL, 0, NULL }
25642 : };
25643 :
25644 :
25645 : static PyTypeObject svcctl_OpenSCManagerA_Type = {
25646 : PyVarObject_HEAD_INIT(NULL, 0)
25647 : .tp_name = "svcctl.OpenSCManagerA",
25648 : .tp_getset = py_svcctl_OpenSCManagerA_getsetters,
25649 : .tp_methods = py_svcctl_OpenSCManagerA_methods,
25650 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25651 : .tp_new = py_svcctl_OpenSCManagerA_new,
25652 : };
25653 :
25654 0 : static bool pack_py_svcctl_OpenSCManagerA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenSCManagerA *r)
25655 : {
25656 0 : PyObject *py_MachineName;
25657 0 : PyObject *py_DatabaseName;
25658 0 : PyObject *py_access_mask;
25659 0 : const char *kwnames[] = {
25660 : "MachineName", "DatabaseName", "access_mask", NULL
25661 : };
25662 :
25663 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenSCManagerA", discard_const_p(char *, kwnames), &py_MachineName, &py_DatabaseName, &py_access_mask)) {
25664 0 : return false;
25665 : }
25666 :
25667 0 : if (py_MachineName == NULL) {
25668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.MachineName");
25669 0 : return false;
25670 : }
25671 0 : if (py_MachineName == Py_None) {
25672 0 : r->in.MachineName = NULL;
25673 : } else {
25674 0 : r->in.MachineName = NULL;
25675 : {
25676 0 : const char *test_str;
25677 0 : const char *talloc_str;
25678 0 : PyObject *unicode = NULL;
25679 0 : if (PyUnicode_Check(py_MachineName)) {
25680 0 : unicode = PyUnicode_AsEncodedString(py_MachineName, "utf-8", "ignore");
25681 0 : if (unicode == NULL) {
25682 0 : return false;
25683 : }
25684 0 : test_str = PyBytes_AS_STRING(unicode);
25685 0 : } else if (PyBytes_Check(py_MachineName)) {
25686 0 : test_str = PyBytes_AS_STRING(py_MachineName);
25687 : } else {
25688 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_MachineName)->tp_name);
25689 0 : return false;
25690 : }
25691 0 : talloc_str = talloc_strdup(r, test_str);
25692 0 : if (unicode != NULL) {
25693 0 : Py_DECREF(unicode);
25694 : }
25695 0 : if (talloc_str == NULL) {
25696 0 : PyErr_NoMemory();
25697 0 : return false;
25698 : }
25699 0 : r->in.MachineName = talloc_str;
25700 : }
25701 : }
25702 0 : if (py_DatabaseName == NULL) {
25703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DatabaseName");
25704 0 : return false;
25705 : }
25706 0 : if (py_DatabaseName == Py_None) {
25707 0 : r->in.DatabaseName = NULL;
25708 : } else {
25709 0 : r->in.DatabaseName = NULL;
25710 : {
25711 0 : const char *test_str;
25712 0 : const char *talloc_str;
25713 0 : PyObject *unicode = NULL;
25714 0 : if (PyUnicode_Check(py_DatabaseName)) {
25715 0 : unicode = PyUnicode_AsEncodedString(py_DatabaseName, "utf-8", "ignore");
25716 0 : if (unicode == NULL) {
25717 0 : return false;
25718 : }
25719 0 : test_str = PyBytes_AS_STRING(unicode);
25720 0 : } else if (PyBytes_Check(py_DatabaseName)) {
25721 0 : test_str = PyBytes_AS_STRING(py_DatabaseName);
25722 : } else {
25723 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DatabaseName)->tp_name);
25724 0 : return false;
25725 : }
25726 0 : talloc_str = talloc_strdup(r, test_str);
25727 0 : if (unicode != NULL) {
25728 0 : Py_DECREF(unicode);
25729 : }
25730 0 : if (talloc_str == NULL) {
25731 0 : PyErr_NoMemory();
25732 0 : return false;
25733 : }
25734 0 : r->in.DatabaseName = talloc_str;
25735 : }
25736 : }
25737 0 : if (py_access_mask == NULL) {
25738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
25739 0 : return false;
25740 : }
25741 : {
25742 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
25743 0 : if (PyLong_Check(py_access_mask)) {
25744 0 : unsigned long long test_var;
25745 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
25746 0 : if (PyErr_Occurred() != NULL) {
25747 0 : return false;
25748 : }
25749 0 : if (test_var > uint_max) {
25750 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25751 : PyLong_Type.tp_name, uint_max, test_var);
25752 0 : return false;
25753 : }
25754 0 : r->in.access_mask = test_var;
25755 : } else {
25756 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25757 : PyLong_Type.tp_name);
25758 0 : return false;
25759 : }
25760 : }
25761 0 : return true;
25762 : }
25763 :
25764 0 : static PyObject *unpack_py_svcctl_OpenSCManagerA_args_out(struct svcctl_OpenSCManagerA *r)
25765 : {
25766 0 : PyObject *result;
25767 0 : PyObject *py_handle;
25768 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
25769 0 : result = py_handle;
25770 0 : if (!W_ERROR_IS_OK(r->out.result)) {
25771 0 : PyErr_SetWERROR(r->out.result);
25772 0 : return NULL;
25773 : }
25774 :
25775 0 : return result;
25776 : }
25777 :
25778 :
25779 0 : static PyObject *py_svcctl_OpenServiceA_in_get_scmanager_handle(PyObject *obj, void *closure)
25780 : {
25781 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
25782 0 : PyObject *py_scmanager_handle;
25783 0 : if (object->in.scmanager_handle == NULL) {
25784 0 : Py_RETURN_NONE;
25785 : }
25786 0 : py_scmanager_handle = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager_handle, object->in.scmanager_handle);
25787 0 : return py_scmanager_handle;
25788 : }
25789 :
25790 0 : static int py_svcctl_OpenServiceA_in_set_scmanager_handle(PyObject *py_obj, PyObject *value, void *closure)
25791 : {
25792 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
25793 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager_handle));
25794 0 : if (value == NULL) {
25795 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager_handle");
25796 0 : return -1;
25797 : }
25798 0 : object->in.scmanager_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager_handle);
25799 0 : if (object->in.scmanager_handle == NULL) {
25800 0 : PyErr_NoMemory();
25801 0 : return -1;
25802 : }
25803 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25804 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25805 0 : PyErr_NoMemory();
25806 0 : return -1;
25807 : }
25808 0 : object->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25809 0 : return 0;
25810 : }
25811 :
25812 0 : static PyObject *py_svcctl_OpenServiceA_in_get_ServiceName(PyObject *obj, void *closure)
25813 : {
25814 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
25815 0 : PyObject *py_ServiceName;
25816 0 : if (object->in.ServiceName == NULL) {
25817 0 : Py_RETURN_NONE;
25818 : }
25819 0 : if (object->in.ServiceName == NULL) {
25820 0 : py_ServiceName = Py_None;
25821 0 : Py_INCREF(py_ServiceName);
25822 : } else {
25823 0 : if (object->in.ServiceName == NULL) {
25824 0 : py_ServiceName = Py_None;
25825 0 : Py_INCREF(py_ServiceName);
25826 : } else {
25827 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
25828 : }
25829 : }
25830 0 : return py_ServiceName;
25831 : }
25832 :
25833 0 : static int py_svcctl_OpenServiceA_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
25834 : {
25835 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
25836 0 : if (value == NULL) {
25837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
25838 0 : return -1;
25839 : }
25840 0 : if (value == Py_None) {
25841 0 : object->in.ServiceName = NULL;
25842 : } else {
25843 0 : object->in.ServiceName = NULL;
25844 : {
25845 0 : const char *test_str;
25846 0 : const char *talloc_str;
25847 0 : PyObject *unicode = NULL;
25848 0 : if (PyUnicode_Check(value)) {
25849 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
25850 0 : if (unicode == NULL) {
25851 0 : return -1;
25852 : }
25853 0 : test_str = PyBytes_AS_STRING(unicode);
25854 0 : } else if (PyBytes_Check(value)) {
25855 0 : test_str = PyBytes_AS_STRING(value);
25856 : } else {
25857 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
25858 0 : return -1;
25859 : }
25860 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
25861 0 : if (unicode != NULL) {
25862 0 : Py_DECREF(unicode);
25863 : }
25864 0 : if (talloc_str == NULL) {
25865 0 : PyErr_NoMemory();
25866 0 : return -1;
25867 : }
25868 0 : object->in.ServiceName = talloc_str;
25869 : }
25870 : }
25871 0 : return 0;
25872 : }
25873 :
25874 0 : static PyObject *py_svcctl_OpenServiceA_in_get_access_mask(PyObject *obj, void *closure)
25875 : {
25876 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
25877 0 : PyObject *py_access_mask;
25878 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
25879 0 : return py_access_mask;
25880 : }
25881 :
25882 0 : static int py_svcctl_OpenServiceA_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
25883 : {
25884 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
25885 0 : if (value == NULL) {
25886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
25887 0 : return -1;
25888 : }
25889 : {
25890 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
25891 0 : if (PyLong_Check(value)) {
25892 0 : unsigned long long test_var;
25893 0 : test_var = PyLong_AsUnsignedLongLong(value);
25894 0 : if (PyErr_Occurred() != NULL) {
25895 0 : return -1;
25896 : }
25897 0 : if (test_var > uint_max) {
25898 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25899 : PyLong_Type.tp_name, uint_max, test_var);
25900 0 : return -1;
25901 : }
25902 0 : object->in.access_mask = test_var;
25903 : } else {
25904 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25905 : PyLong_Type.tp_name);
25906 0 : return -1;
25907 : }
25908 : }
25909 0 : return 0;
25910 : }
25911 :
25912 0 : static PyObject *py_svcctl_OpenServiceA_out_get_handle(PyObject *obj, void *closure)
25913 : {
25914 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
25915 0 : PyObject *py_handle;
25916 0 : if (object->out.handle == NULL) {
25917 0 : Py_RETURN_NONE;
25918 : }
25919 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
25920 0 : return py_handle;
25921 : }
25922 :
25923 0 : static int py_svcctl_OpenServiceA_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
25924 : {
25925 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
25926 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
25927 0 : if (value == NULL) {
25928 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
25929 0 : return -1;
25930 : }
25931 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
25932 0 : if (object->out.handle == NULL) {
25933 0 : PyErr_NoMemory();
25934 0 : return -1;
25935 : }
25936 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25937 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25938 0 : PyErr_NoMemory();
25939 0 : return -1;
25940 : }
25941 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
25942 0 : return 0;
25943 : }
25944 :
25945 0 : static PyObject *py_svcctl_OpenServiceA_get_result(PyObject *obj, void *closure)
25946 : {
25947 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
25948 0 : PyObject *py_result;
25949 0 : py_result = PyErr_FromWERROR(object->out.result);
25950 0 : return py_result;
25951 : }
25952 :
25953 0 : static int py_svcctl_OpenServiceA_set_result(PyObject *py_obj, PyObject *value, void *closure)
25954 : {
25955 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
25956 0 : if (value == NULL) {
25957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25958 0 : return -1;
25959 : }
25960 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
25961 0 : return 0;
25962 : }
25963 :
25964 : static PyGetSetDef py_svcctl_OpenServiceA_getsetters[] = {
25965 : {
25966 : .name = discard_const_p(char, "in_scmanager_handle"),
25967 : .get = py_svcctl_OpenServiceA_in_get_scmanager_handle,
25968 : .set = py_svcctl_OpenServiceA_in_set_scmanager_handle,
25969 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25970 : },
25971 : {
25972 : .name = discard_const_p(char, "in_ServiceName"),
25973 : .get = py_svcctl_OpenServiceA_in_get_ServiceName,
25974 : .set = py_svcctl_OpenServiceA_in_set_ServiceName,
25975 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
25976 : },
25977 : {
25978 : .name = discard_const_p(char, "in_access_mask"),
25979 : .get = py_svcctl_OpenServiceA_in_get_access_mask,
25980 : .set = py_svcctl_OpenServiceA_in_set_access_mask,
25981 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25982 : },
25983 : {
25984 : .name = discard_const_p(char, "out_handle"),
25985 : .get = py_svcctl_OpenServiceA_out_get_handle,
25986 : .set = py_svcctl_OpenServiceA_out_set_handle,
25987 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25988 : },
25989 : {
25990 : .name = discard_const_p(char, "result"),
25991 : .get = py_svcctl_OpenServiceA_get_result,
25992 : .set = py_svcctl_OpenServiceA_set_result,
25993 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
25994 : },
25995 : { .name = NULL }
25996 : };
25997 :
25998 0 : static PyObject *py_svcctl_OpenServiceA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25999 : {
26000 0 : PyObject *self = pytalloc_new(struct svcctl_OpenServiceA, type);
26001 0 : struct svcctl_OpenServiceA *_self = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(self);
26002 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26003 0 : _self->in.scmanager_handle = talloc_zero(mem_ctx, struct policy_handle);
26004 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
26005 0 : return self;
26006 : }
26007 :
26008 0 : static PyObject *py_svcctl_OpenServiceA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26009 : {
26010 :
26011 :
26012 0 : return PyLong_FromLong(28);
26013 : }
26014 :
26015 0 : static PyObject *py_svcctl_OpenServiceA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
26016 : {
26017 0 : const struct ndr_interface_call *call = NULL;
26018 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
26019 0 : PyObject *ret = NULL;
26020 0 : struct ndr_push *push = NULL;
26021 0 : DATA_BLOB blob;
26022 0 : enum ndr_err_code err;
26023 :
26024 0 : if (ndr_table_svcctl.num_calls < 29) {
26025 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceA_ndr_pack");
26026 0 : return NULL;
26027 : }
26028 0 : call = &ndr_table_svcctl.calls[28];
26029 :
26030 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26031 0 : if (push == NULL) {
26032 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26033 0 : return NULL;
26034 : }
26035 :
26036 0 : push->flags |= ndr_push_flags;
26037 :
26038 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26039 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26040 0 : TALLOC_FREE(push);
26041 0 : PyErr_SetNdrError(err);
26042 0 : return NULL;
26043 : }
26044 0 : blob = ndr_push_blob(push);
26045 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26046 0 : TALLOC_FREE(push);
26047 0 : return ret;
26048 : }
26049 :
26050 0 : static PyObject *py_svcctl_OpenServiceA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26051 : {
26052 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26053 0 : PyObject *bigendian_obj = NULL;
26054 0 : PyObject *ndr64_obj = NULL;
26055 0 : libndr_flags ndr_push_flags = 0;
26056 :
26057 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26058 : discard_const_p(char *, kwnames),
26059 : &bigendian_obj,
26060 : &ndr64_obj)) {
26061 0 : return NULL;
26062 : }
26063 :
26064 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26065 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26066 : }
26067 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26068 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26069 : }
26070 :
26071 0 : return py_svcctl_OpenServiceA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26072 : }
26073 :
26074 0 : static PyObject *py_svcctl_OpenServiceA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26075 : {
26076 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26077 0 : PyObject *bigendian_obj = NULL;
26078 0 : PyObject *ndr64_obj = NULL;
26079 0 : libndr_flags ndr_push_flags = 0;
26080 :
26081 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26082 : discard_const_p(char *, kwnames),
26083 : &bigendian_obj,
26084 : &ndr64_obj)) {
26085 0 : return NULL;
26086 : }
26087 :
26088 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26089 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26090 : }
26091 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26092 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26093 : }
26094 :
26095 0 : return py_svcctl_OpenServiceA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26096 : }
26097 :
26098 0 : static PyObject *py_svcctl_OpenServiceA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
26099 : {
26100 0 : const struct ndr_interface_call *call = NULL;
26101 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
26102 0 : struct ndr_pull *pull = NULL;
26103 0 : enum ndr_err_code err;
26104 :
26105 0 : if (ndr_table_svcctl.num_calls < 29) {
26106 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceA_ndr_unpack");
26107 0 : return NULL;
26108 : }
26109 0 : call = &ndr_table_svcctl.calls[28];
26110 :
26111 0 : pull = ndr_pull_init_blob(blob, object);
26112 0 : if (pull == NULL) {
26113 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26114 0 : return NULL;
26115 : }
26116 :
26117 0 : pull->flags |= ndr_pull_flags;
26118 :
26119 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26120 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26121 0 : TALLOC_FREE(pull);
26122 0 : PyErr_SetNdrError(err);
26123 0 : return NULL;
26124 : }
26125 0 : if (!allow_remaining) {
26126 0 : uint32_t highest_ofs;
26127 :
26128 0 : if (pull->offset > pull->relative_highest_offset) {
26129 0 : highest_ofs = pull->offset;
26130 : } else {
26131 0 : highest_ofs = pull->relative_highest_offset;
26132 : }
26133 0 : if (highest_ofs < pull->data_size) {
26134 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26135 : "not all bytes consumed ofs[%u] size[%u]",
26136 : highest_ofs, pull->data_size);
26137 0 : TALLOC_FREE(pull);
26138 0 : PyErr_SetNdrError(err);
26139 0 : return NULL;
26140 : }
26141 : }
26142 :
26143 0 : TALLOC_FREE(pull);
26144 0 : Py_RETURN_NONE;
26145 : }
26146 :
26147 0 : static PyObject *py_svcctl_OpenServiceA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26148 : {
26149 0 : DATA_BLOB blob;
26150 0 : Py_ssize_t blob_length = 0;
26151 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26152 0 : PyObject *bigendian_obj = NULL;
26153 0 : PyObject *ndr64_obj = NULL;
26154 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26155 0 : PyObject *allow_remaining_obj = NULL;
26156 0 : bool allow_remaining = false;
26157 :
26158 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26159 : discard_const_p(char *, kwnames),
26160 : &blob.data, &blob_length,
26161 : &bigendian_obj,
26162 : &ndr64_obj,
26163 : &allow_remaining_obj)) {
26164 0 : return NULL;
26165 : }
26166 0 : blob.length = blob_length;
26167 :
26168 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26169 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26170 : }
26171 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26172 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26173 : }
26174 :
26175 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26176 0 : allow_remaining = true;
26177 : }
26178 :
26179 0 : return py_svcctl_OpenServiceA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26180 : }
26181 :
26182 0 : static PyObject *py_svcctl_OpenServiceA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26183 : {
26184 0 : DATA_BLOB blob;
26185 0 : Py_ssize_t blob_length = 0;
26186 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26187 0 : PyObject *bigendian_obj = NULL;
26188 0 : PyObject *ndr64_obj = NULL;
26189 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26190 0 : PyObject *allow_remaining_obj = NULL;
26191 0 : bool allow_remaining = false;
26192 :
26193 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26194 : discard_const_p(char *, kwnames),
26195 : &blob.data, &blob_length,
26196 : &bigendian_obj,
26197 : &ndr64_obj,
26198 : &allow_remaining_obj)) {
26199 0 : return NULL;
26200 : }
26201 0 : blob.length = blob_length;
26202 :
26203 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26204 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26205 : }
26206 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26207 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26208 : }
26209 :
26210 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26211 0 : allow_remaining = true;
26212 : }
26213 :
26214 0 : return py_svcctl_OpenServiceA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26215 : }
26216 :
26217 0 : static PyObject *py_svcctl_OpenServiceA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
26218 : {
26219 0 : const struct ndr_interface_call *call = NULL;
26220 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
26221 0 : PyObject *ret;
26222 0 : char *retstr;
26223 :
26224 0 : if (ndr_table_svcctl.num_calls < 29) {
26225 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceA_ndr_print");
26226 0 : return NULL;
26227 : }
26228 0 : call = &ndr_table_svcctl.calls[28];
26229 :
26230 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26231 0 : ret = PyUnicode_FromString(retstr);
26232 0 : TALLOC_FREE(retstr);
26233 :
26234 0 : return ret;
26235 : }
26236 :
26237 0 : static PyObject *py_svcctl_OpenServiceA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26238 : {
26239 0 : return py_svcctl_OpenServiceA_ndr_print(py_obj, "svcctl_OpenServiceA_in", NDR_IN);
26240 : }
26241 :
26242 0 : static PyObject *py_svcctl_OpenServiceA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26243 : {
26244 0 : return py_svcctl_OpenServiceA_ndr_print(py_obj, "svcctl_OpenServiceA_out", NDR_OUT);
26245 : }
26246 :
26247 : static PyMethodDef py_svcctl_OpenServiceA_methods[] = {
26248 : { "opnum", (PyCFunction)py_svcctl_OpenServiceA_ndr_opnum, METH_NOARGS|METH_CLASS,
26249 : "svcctl.OpenServiceA.opnum() -> 28 (0x1c) " },
26250 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26251 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26252 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26253 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26254 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26255 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26256 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26257 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26258 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenServiceA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26259 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenServiceA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26260 : { NULL, NULL, 0, NULL }
26261 : };
26262 :
26263 :
26264 : static PyTypeObject svcctl_OpenServiceA_Type = {
26265 : PyVarObject_HEAD_INIT(NULL, 0)
26266 : .tp_name = "svcctl.OpenServiceA",
26267 : .tp_getset = py_svcctl_OpenServiceA_getsetters,
26268 : .tp_methods = py_svcctl_OpenServiceA_methods,
26269 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26270 : .tp_new = py_svcctl_OpenServiceA_new,
26271 : };
26272 :
26273 0 : static bool pack_py_svcctl_OpenServiceA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenServiceA *r)
26274 : {
26275 0 : PyObject *py_scmanager_handle;
26276 0 : PyObject *py_ServiceName;
26277 0 : PyObject *py_access_mask;
26278 0 : const char *kwnames[] = {
26279 : "scmanager_handle", "ServiceName", "access_mask", NULL
26280 : };
26281 :
26282 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenServiceA", discard_const_p(char *, kwnames), &py_scmanager_handle, &py_ServiceName, &py_access_mask)) {
26283 0 : return false;
26284 : }
26285 :
26286 0 : if (py_scmanager_handle == NULL) {
26287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager_handle");
26288 0 : return false;
26289 : }
26290 0 : r->in.scmanager_handle = talloc_ptrtype(r, r->in.scmanager_handle);
26291 0 : if (r->in.scmanager_handle == NULL) {
26292 0 : PyErr_NoMemory();
26293 0 : return false;
26294 : }
26295 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager_handle, return false;);
26296 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager_handle)) == NULL) {
26297 0 : PyErr_NoMemory();
26298 0 : return false;
26299 : }
26300 0 : r->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(py_scmanager_handle);
26301 0 : if (py_ServiceName == NULL) {
26302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
26303 0 : return false;
26304 : }
26305 0 : if (py_ServiceName == Py_None) {
26306 0 : r->in.ServiceName = NULL;
26307 : } else {
26308 0 : r->in.ServiceName = NULL;
26309 : {
26310 0 : const char *test_str;
26311 0 : const char *talloc_str;
26312 0 : PyObject *unicode = NULL;
26313 0 : if (PyUnicode_Check(py_ServiceName)) {
26314 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
26315 0 : if (unicode == NULL) {
26316 0 : return false;
26317 : }
26318 0 : test_str = PyBytes_AS_STRING(unicode);
26319 0 : } else if (PyBytes_Check(py_ServiceName)) {
26320 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
26321 : } else {
26322 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
26323 0 : return false;
26324 : }
26325 0 : talloc_str = talloc_strdup(r, test_str);
26326 0 : if (unicode != NULL) {
26327 0 : Py_DECREF(unicode);
26328 : }
26329 0 : if (talloc_str == NULL) {
26330 0 : PyErr_NoMemory();
26331 0 : return false;
26332 : }
26333 0 : r->in.ServiceName = talloc_str;
26334 : }
26335 : }
26336 0 : if (py_access_mask == NULL) {
26337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
26338 0 : return false;
26339 : }
26340 : {
26341 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
26342 0 : if (PyLong_Check(py_access_mask)) {
26343 0 : unsigned long long test_var;
26344 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
26345 0 : if (PyErr_Occurred() != NULL) {
26346 0 : return false;
26347 : }
26348 0 : if (test_var > uint_max) {
26349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26350 : PyLong_Type.tp_name, uint_max, test_var);
26351 0 : return false;
26352 : }
26353 0 : r->in.access_mask = test_var;
26354 : } else {
26355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26356 : PyLong_Type.tp_name);
26357 0 : return false;
26358 : }
26359 : }
26360 0 : return true;
26361 : }
26362 :
26363 0 : static PyObject *unpack_py_svcctl_OpenServiceA_args_out(struct svcctl_OpenServiceA *r)
26364 : {
26365 0 : PyObject *result;
26366 0 : PyObject *py_handle;
26367 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
26368 0 : result = py_handle;
26369 0 : if (!W_ERROR_IS_OK(r->out.result)) {
26370 0 : PyErr_SetWERROR(r->out.result);
26371 0 : return NULL;
26372 : }
26373 :
26374 0 : return result;
26375 : }
26376 :
26377 :
26378 0 : static PyObject *py_svcctl_QueryServiceConfigA_in_get_handle(PyObject *obj, void *closure)
26379 : {
26380 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
26381 0 : PyObject *py_handle;
26382 0 : if (object->in.handle == NULL) {
26383 0 : Py_RETURN_NONE;
26384 : }
26385 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
26386 0 : return py_handle;
26387 : }
26388 :
26389 0 : static int py_svcctl_QueryServiceConfigA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
26390 : {
26391 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26392 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
26393 0 : if (value == NULL) {
26394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
26395 0 : return -1;
26396 : }
26397 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
26398 0 : if (object->in.handle == NULL) {
26399 0 : PyErr_NoMemory();
26400 0 : return -1;
26401 : }
26402 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26403 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26404 0 : PyErr_NoMemory();
26405 0 : return -1;
26406 : }
26407 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
26408 0 : return 0;
26409 : }
26410 :
26411 0 : static PyObject *py_svcctl_QueryServiceConfigA_out_get_query(PyObject *obj, void *closure)
26412 : {
26413 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
26414 0 : PyObject *py_query;
26415 0 : py_query = PyList_New(object->in.offered);
26416 0 : if (py_query == NULL) {
26417 0 : return NULL;
26418 : }
26419 : {
26420 : int query_cntr_0;
26421 0 : for (query_cntr_0 = 0; query_cntr_0 < (object->in.offered); query_cntr_0++) {
26422 0 : PyObject *py_query_0;
26423 0 : py_query_0 = PyLong_FromLong((uint16_t)object->out.query[query_cntr_0]);
26424 0 : PyList_SetItem(py_query, query_cntr_0, py_query_0);
26425 : }
26426 : }
26427 0 : return py_query;
26428 : }
26429 :
26430 0 : static int py_svcctl_QueryServiceConfigA_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
26431 : {
26432 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26433 0 : if (value == NULL) {
26434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
26435 0 : return -1;
26436 : }
26437 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
26438 : {
26439 0 : int query_cntr_0;
26440 0 : object->out.query = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query, PyList_GET_SIZE(value));
26441 0 : if (!object->out.query) { return -1; }
26442 0 : talloc_set_name_const(object->out.query, "ARRAY: object->out.query");
26443 0 : for (query_cntr_0 = 0; query_cntr_0 < PyList_GET_SIZE(value); query_cntr_0++) {
26444 0 : if (PyList_GET_ITEM(value, query_cntr_0) == NULL) {
26445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query[query_cntr_0]");
26446 0 : return -1;
26447 : }
26448 : {
26449 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.query[query_cntr_0]));
26450 0 : if (PyLong_Check(PyList_GET_ITEM(value, query_cntr_0))) {
26451 0 : unsigned long long test_var;
26452 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, query_cntr_0));
26453 0 : if (PyErr_Occurred() != NULL) {
26454 0 : return -1;
26455 : }
26456 0 : if (test_var > uint_max) {
26457 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26458 : PyLong_Type.tp_name, uint_max, test_var);
26459 0 : return -1;
26460 : }
26461 0 : object->out.query[query_cntr_0] = test_var;
26462 : } else {
26463 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26464 : PyLong_Type.tp_name);
26465 0 : return -1;
26466 : }
26467 : }
26468 : }
26469 : }
26470 0 : return 0;
26471 : }
26472 :
26473 0 : static PyObject *py_svcctl_QueryServiceConfigA_in_get_offered(PyObject *obj, void *closure)
26474 : {
26475 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
26476 0 : PyObject *py_offered;
26477 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
26478 0 : return py_offered;
26479 : }
26480 :
26481 0 : static int py_svcctl_QueryServiceConfigA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
26482 : {
26483 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26484 0 : if (value == NULL) {
26485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
26486 0 : return -1;
26487 : }
26488 : {
26489 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
26490 0 : if (PyLong_Check(value)) {
26491 0 : unsigned long long test_var;
26492 0 : test_var = PyLong_AsUnsignedLongLong(value);
26493 0 : if (PyErr_Occurred() != NULL) {
26494 0 : return -1;
26495 : }
26496 0 : if (test_var > uint_max) {
26497 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26498 : PyLong_Type.tp_name, uint_max, test_var);
26499 0 : return -1;
26500 : }
26501 0 : object->in.offered = test_var;
26502 : } else {
26503 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26504 : PyLong_Type.tp_name);
26505 0 : return -1;
26506 : }
26507 : }
26508 0 : return 0;
26509 : }
26510 :
26511 0 : static PyObject *py_svcctl_QueryServiceConfigA_out_get_needed(PyObject *obj, void *closure)
26512 : {
26513 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
26514 0 : PyObject *py_needed;
26515 0 : if (object->out.needed == NULL) {
26516 0 : Py_RETURN_NONE;
26517 : }
26518 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
26519 0 : return py_needed;
26520 : }
26521 :
26522 0 : static int py_svcctl_QueryServiceConfigA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
26523 : {
26524 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26525 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
26526 0 : if (value == NULL) {
26527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
26528 0 : return -1;
26529 : }
26530 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
26531 0 : if (object->out.needed == NULL) {
26532 0 : PyErr_NoMemory();
26533 0 : return -1;
26534 : }
26535 : {
26536 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
26537 0 : if (PyLong_Check(value)) {
26538 0 : unsigned long long test_var;
26539 0 : test_var = PyLong_AsUnsignedLongLong(value);
26540 0 : if (PyErr_Occurred() != NULL) {
26541 0 : return -1;
26542 : }
26543 0 : if (test_var > uint_max) {
26544 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26545 : PyLong_Type.tp_name, uint_max, test_var);
26546 0 : return -1;
26547 : }
26548 0 : *object->out.needed = test_var;
26549 : } else {
26550 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26551 : PyLong_Type.tp_name);
26552 0 : return -1;
26553 : }
26554 : }
26555 0 : return 0;
26556 : }
26557 :
26558 0 : static PyObject *py_svcctl_QueryServiceConfigA_get_result(PyObject *obj, void *closure)
26559 : {
26560 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
26561 0 : PyObject *py_result;
26562 0 : py_result = PyErr_FromWERROR(object->out.result);
26563 0 : return py_result;
26564 : }
26565 :
26566 0 : static int py_svcctl_QueryServiceConfigA_set_result(PyObject *py_obj, PyObject *value, void *closure)
26567 : {
26568 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26569 0 : if (value == NULL) {
26570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26571 0 : return -1;
26572 : }
26573 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
26574 0 : return 0;
26575 : }
26576 :
26577 : static PyGetSetDef py_svcctl_QueryServiceConfigA_getsetters[] = {
26578 : {
26579 : .name = discard_const_p(char, "in_handle"),
26580 : .get = py_svcctl_QueryServiceConfigA_in_get_handle,
26581 : .set = py_svcctl_QueryServiceConfigA_in_set_handle,
26582 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26583 : },
26584 : {
26585 : .name = discard_const_p(char, "out_query"),
26586 : .get = py_svcctl_QueryServiceConfigA_out_get_query,
26587 : .set = py_svcctl_QueryServiceConfigA_out_set_query,
26588 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
26589 : },
26590 : {
26591 : .name = discard_const_p(char, "in_offered"),
26592 : .get = py_svcctl_QueryServiceConfigA_in_get_offered,
26593 : .set = py_svcctl_QueryServiceConfigA_in_set_offered,
26594 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26595 : },
26596 : {
26597 : .name = discard_const_p(char, "out_needed"),
26598 : .get = py_svcctl_QueryServiceConfigA_out_get_needed,
26599 : .set = py_svcctl_QueryServiceConfigA_out_set_needed,
26600 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26601 : },
26602 : {
26603 : .name = discard_const_p(char, "result"),
26604 : .get = py_svcctl_QueryServiceConfigA_get_result,
26605 : .set = py_svcctl_QueryServiceConfigA_set_result,
26606 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
26607 : },
26608 : { .name = NULL }
26609 : };
26610 :
26611 0 : static PyObject *py_svcctl_QueryServiceConfigA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26612 : {
26613 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfigA, type);
26614 0 : struct svcctl_QueryServiceConfigA *_self = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(self);
26615 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26616 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
26617 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
26618 0 : return self;
26619 : }
26620 :
26621 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26622 : {
26623 :
26624 :
26625 0 : return PyLong_FromLong(29);
26626 : }
26627 :
26628 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
26629 : {
26630 0 : const struct ndr_interface_call *call = NULL;
26631 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26632 0 : PyObject *ret = NULL;
26633 0 : struct ndr_push *push = NULL;
26634 0 : DATA_BLOB blob;
26635 0 : enum ndr_err_code err;
26636 :
26637 0 : if (ndr_table_svcctl.num_calls < 30) {
26638 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigA_ndr_pack");
26639 0 : return NULL;
26640 : }
26641 0 : call = &ndr_table_svcctl.calls[29];
26642 :
26643 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26644 0 : if (push == NULL) {
26645 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26646 0 : return NULL;
26647 : }
26648 :
26649 0 : push->flags |= ndr_push_flags;
26650 :
26651 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26652 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26653 0 : TALLOC_FREE(push);
26654 0 : PyErr_SetNdrError(err);
26655 0 : return NULL;
26656 : }
26657 0 : blob = ndr_push_blob(push);
26658 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26659 0 : TALLOC_FREE(push);
26660 0 : return ret;
26661 : }
26662 :
26663 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26664 : {
26665 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26666 0 : PyObject *bigendian_obj = NULL;
26667 0 : PyObject *ndr64_obj = NULL;
26668 0 : libndr_flags ndr_push_flags = 0;
26669 :
26670 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26671 : discard_const_p(char *, kwnames),
26672 : &bigendian_obj,
26673 : &ndr64_obj)) {
26674 0 : return NULL;
26675 : }
26676 :
26677 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26678 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26679 : }
26680 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26681 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26682 : }
26683 :
26684 0 : return py_svcctl_QueryServiceConfigA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26685 : }
26686 :
26687 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26688 : {
26689 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26690 0 : PyObject *bigendian_obj = NULL;
26691 0 : PyObject *ndr64_obj = NULL;
26692 0 : libndr_flags ndr_push_flags = 0;
26693 :
26694 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26695 : discard_const_p(char *, kwnames),
26696 : &bigendian_obj,
26697 : &ndr64_obj)) {
26698 0 : return NULL;
26699 : }
26700 :
26701 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26702 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26703 : }
26704 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26705 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26706 : }
26707 :
26708 0 : return py_svcctl_QueryServiceConfigA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26709 : }
26710 :
26711 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
26712 : {
26713 0 : const struct ndr_interface_call *call = NULL;
26714 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26715 0 : struct ndr_pull *pull = NULL;
26716 0 : enum ndr_err_code err;
26717 :
26718 0 : if (ndr_table_svcctl.num_calls < 30) {
26719 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigA_ndr_unpack");
26720 0 : return NULL;
26721 : }
26722 0 : call = &ndr_table_svcctl.calls[29];
26723 :
26724 0 : pull = ndr_pull_init_blob(blob, object);
26725 0 : if (pull == NULL) {
26726 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26727 0 : return NULL;
26728 : }
26729 :
26730 0 : pull->flags |= ndr_pull_flags;
26731 :
26732 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26733 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26734 0 : TALLOC_FREE(pull);
26735 0 : PyErr_SetNdrError(err);
26736 0 : return NULL;
26737 : }
26738 0 : if (!allow_remaining) {
26739 0 : uint32_t highest_ofs;
26740 :
26741 0 : if (pull->offset > pull->relative_highest_offset) {
26742 0 : highest_ofs = pull->offset;
26743 : } else {
26744 0 : highest_ofs = pull->relative_highest_offset;
26745 : }
26746 0 : if (highest_ofs < pull->data_size) {
26747 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26748 : "not all bytes consumed ofs[%u] size[%u]",
26749 : highest_ofs, pull->data_size);
26750 0 : TALLOC_FREE(pull);
26751 0 : PyErr_SetNdrError(err);
26752 0 : return NULL;
26753 : }
26754 : }
26755 :
26756 0 : TALLOC_FREE(pull);
26757 0 : Py_RETURN_NONE;
26758 : }
26759 :
26760 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26761 : {
26762 0 : DATA_BLOB blob;
26763 0 : Py_ssize_t blob_length = 0;
26764 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26765 0 : PyObject *bigendian_obj = NULL;
26766 0 : PyObject *ndr64_obj = NULL;
26767 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26768 0 : PyObject *allow_remaining_obj = NULL;
26769 0 : bool allow_remaining = false;
26770 :
26771 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26772 : discard_const_p(char *, kwnames),
26773 : &blob.data, &blob_length,
26774 : &bigendian_obj,
26775 : &ndr64_obj,
26776 : &allow_remaining_obj)) {
26777 0 : return NULL;
26778 : }
26779 0 : blob.length = blob_length;
26780 :
26781 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26782 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26783 : }
26784 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26785 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26786 : }
26787 :
26788 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26789 0 : allow_remaining = true;
26790 : }
26791 :
26792 0 : return py_svcctl_QueryServiceConfigA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26793 : }
26794 :
26795 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26796 : {
26797 0 : DATA_BLOB blob;
26798 0 : Py_ssize_t blob_length = 0;
26799 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26800 0 : PyObject *bigendian_obj = NULL;
26801 0 : PyObject *ndr64_obj = NULL;
26802 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26803 0 : PyObject *allow_remaining_obj = NULL;
26804 0 : bool allow_remaining = false;
26805 :
26806 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26807 : discard_const_p(char *, kwnames),
26808 : &blob.data, &blob_length,
26809 : &bigendian_obj,
26810 : &ndr64_obj,
26811 : &allow_remaining_obj)) {
26812 0 : return NULL;
26813 : }
26814 0 : blob.length = blob_length;
26815 :
26816 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26817 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26818 : }
26819 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26820 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26821 : }
26822 :
26823 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26824 0 : allow_remaining = true;
26825 : }
26826 :
26827 0 : return py_svcctl_QueryServiceConfigA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26828 : }
26829 :
26830 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
26831 : {
26832 0 : const struct ndr_interface_call *call = NULL;
26833 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
26834 0 : PyObject *ret;
26835 0 : char *retstr;
26836 :
26837 0 : if (ndr_table_svcctl.num_calls < 30) {
26838 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigA_ndr_print");
26839 0 : return NULL;
26840 : }
26841 0 : call = &ndr_table_svcctl.calls[29];
26842 :
26843 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26844 0 : ret = PyUnicode_FromString(retstr);
26845 0 : TALLOC_FREE(retstr);
26846 :
26847 0 : return ret;
26848 : }
26849 :
26850 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26851 : {
26852 0 : return py_svcctl_QueryServiceConfigA_ndr_print(py_obj, "svcctl_QueryServiceConfigA_in", NDR_IN);
26853 : }
26854 :
26855 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26856 : {
26857 0 : return py_svcctl_QueryServiceConfigA_ndr_print(py_obj, "svcctl_QueryServiceConfigA_out", NDR_OUT);
26858 : }
26859 :
26860 : static PyMethodDef py_svcctl_QueryServiceConfigA_methods[] = {
26861 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfigA_ndr_opnum, METH_NOARGS|METH_CLASS,
26862 : "svcctl.QueryServiceConfigA.opnum() -> 29 (0x1d) " },
26863 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26864 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26865 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26866 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26867 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26868 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26869 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26870 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26871 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfigA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26872 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfigA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26873 : { NULL, NULL, 0, NULL }
26874 : };
26875 :
26876 :
26877 : static PyTypeObject svcctl_QueryServiceConfigA_Type = {
26878 : PyVarObject_HEAD_INIT(NULL, 0)
26879 : .tp_name = "svcctl.QueryServiceConfigA",
26880 : .tp_getset = py_svcctl_QueryServiceConfigA_getsetters,
26881 : .tp_methods = py_svcctl_QueryServiceConfigA_methods,
26882 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26883 : .tp_new = py_svcctl_QueryServiceConfigA_new,
26884 : };
26885 :
26886 0 : static bool pack_py_svcctl_QueryServiceConfigA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfigA *r)
26887 : {
26888 0 : PyObject *py_handle;
26889 0 : PyObject *py_offered;
26890 0 : const char *kwnames[] = {
26891 : "handle", "offered", NULL
26892 : };
26893 :
26894 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceConfigA", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
26895 0 : return false;
26896 : }
26897 :
26898 0 : if (py_handle == NULL) {
26899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
26900 0 : return false;
26901 : }
26902 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
26903 0 : if (r->in.handle == NULL) {
26904 0 : PyErr_NoMemory();
26905 0 : return false;
26906 : }
26907 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
26908 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
26909 0 : PyErr_NoMemory();
26910 0 : return false;
26911 : }
26912 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
26913 0 : if (py_offered == NULL) {
26914 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
26915 0 : return false;
26916 : }
26917 : {
26918 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
26919 0 : if (PyLong_Check(py_offered)) {
26920 0 : unsigned long long test_var;
26921 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
26922 0 : if (PyErr_Occurred() != NULL) {
26923 0 : return false;
26924 : }
26925 0 : if (test_var > uint_max) {
26926 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26927 : PyLong_Type.tp_name, uint_max, test_var);
26928 0 : return false;
26929 : }
26930 0 : r->in.offered = test_var;
26931 : } else {
26932 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26933 : PyLong_Type.tp_name);
26934 0 : return false;
26935 : }
26936 : }
26937 0 : return true;
26938 : }
26939 :
26940 0 : static PyObject *unpack_py_svcctl_QueryServiceConfigA_args_out(struct svcctl_QueryServiceConfigA *r)
26941 : {
26942 0 : PyObject *result;
26943 0 : PyObject *py_query;
26944 0 : PyObject *py_needed;
26945 0 : result = PyTuple_New(2);
26946 0 : py_query = PyList_New(r->in.offered);
26947 0 : if (py_query == NULL) {
26948 0 : return NULL;
26949 : }
26950 : {
26951 : int query_cntr_0;
26952 0 : for (query_cntr_0 = 0; query_cntr_0 < (r->in.offered); query_cntr_0++) {
26953 0 : PyObject *py_query_0;
26954 0 : py_query_0 = PyLong_FromLong((uint16_t)r->out.query[query_cntr_0]);
26955 0 : PyList_SetItem(py_query, query_cntr_0, py_query_0);
26956 : }
26957 : }
26958 0 : PyTuple_SetItem(result, 0, py_query);
26959 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
26960 0 : PyTuple_SetItem(result, 1, py_needed);
26961 0 : if (!W_ERROR_IS_OK(r->out.result)) {
26962 0 : PyErr_SetWERROR(r->out.result);
26963 0 : return NULL;
26964 : }
26965 :
26966 0 : return result;
26967 : }
26968 :
26969 :
26970 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_in_get_handle(PyObject *obj, void *closure)
26971 : {
26972 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
26973 0 : PyObject *py_handle;
26974 0 : if (object->in.handle == NULL) {
26975 0 : Py_RETURN_NONE;
26976 : }
26977 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
26978 0 : return py_handle;
26979 : }
26980 :
26981 0 : static int py_svcctl_QueryServiceLockStatusA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
26982 : {
26983 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
26984 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
26985 0 : if (value == NULL) {
26986 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
26987 0 : return -1;
26988 : }
26989 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
26990 0 : if (object->in.handle == NULL) {
26991 0 : PyErr_NoMemory();
26992 0 : return -1;
26993 : }
26994 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26995 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26996 0 : PyErr_NoMemory();
26997 0 : return -1;
26998 : }
26999 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27000 0 : return 0;
27001 : }
27002 :
27003 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_in_get_offered(PyObject *obj, void *closure)
27004 : {
27005 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
27006 0 : PyObject *py_offered;
27007 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
27008 0 : return py_offered;
27009 : }
27010 :
27011 0 : static int py_svcctl_QueryServiceLockStatusA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
27012 : {
27013 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
27014 0 : if (value == NULL) {
27015 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
27016 0 : return -1;
27017 : }
27018 : {
27019 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
27020 0 : if (PyLong_Check(value)) {
27021 0 : unsigned long long test_var;
27022 0 : test_var = PyLong_AsUnsignedLongLong(value);
27023 0 : if (PyErr_Occurred() != NULL) {
27024 0 : return -1;
27025 : }
27026 0 : if (test_var > uint_max) {
27027 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27028 : PyLong_Type.tp_name, uint_max, test_var);
27029 0 : return -1;
27030 : }
27031 0 : object->in.offered = test_var;
27032 : } else {
27033 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27034 : PyLong_Type.tp_name);
27035 0 : return -1;
27036 : }
27037 : }
27038 0 : return 0;
27039 : }
27040 :
27041 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_out_get_lock_status(PyObject *obj, void *closure)
27042 : {
27043 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
27044 0 : PyObject *py_lock_status;
27045 0 : if (object->out.lock_status == NULL) {
27046 0 : Py_RETURN_NONE;
27047 : }
27048 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, object->out.lock_status, object->out.lock_status);
27049 0 : return py_lock_status;
27050 : }
27051 :
27052 0 : static int py_svcctl_QueryServiceLockStatusA_out_set_lock_status(PyObject *py_obj, PyObject *value, void *closure)
27053 : {
27054 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
27055 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock_status));
27056 0 : if (value == NULL) {
27057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock_status");
27058 0 : return -1;
27059 : }
27060 0 : object->out.lock_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock_status);
27061 0 : if (object->out.lock_status == NULL) {
27062 0 : PyErr_NoMemory();
27063 0 : return -1;
27064 : }
27065 0 : PY_CHECK_TYPE(&SERVICE_LOCK_STATUS_Type, value, return -1;);
27066 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27067 0 : PyErr_NoMemory();
27068 0 : return -1;
27069 : }
27070 0 : object->out.lock_status = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(value);
27071 0 : return 0;
27072 : }
27073 :
27074 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_out_get_needed(PyObject *obj, void *closure)
27075 : {
27076 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
27077 0 : PyObject *py_needed;
27078 0 : if (object->out.needed == NULL) {
27079 0 : Py_RETURN_NONE;
27080 : }
27081 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
27082 0 : return py_needed;
27083 : }
27084 :
27085 0 : static int py_svcctl_QueryServiceLockStatusA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
27086 : {
27087 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
27088 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
27089 0 : if (value == NULL) {
27090 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
27091 0 : return -1;
27092 : }
27093 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
27094 0 : if (object->out.needed == NULL) {
27095 0 : PyErr_NoMemory();
27096 0 : return -1;
27097 : }
27098 : {
27099 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
27100 0 : if (PyLong_Check(value)) {
27101 0 : unsigned long long test_var;
27102 0 : test_var = PyLong_AsUnsignedLongLong(value);
27103 0 : if (PyErr_Occurred() != NULL) {
27104 0 : return -1;
27105 : }
27106 0 : if (test_var > uint_max) {
27107 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27108 : PyLong_Type.tp_name, uint_max, test_var);
27109 0 : return -1;
27110 : }
27111 0 : *object->out.needed = test_var;
27112 : } else {
27113 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27114 : PyLong_Type.tp_name);
27115 0 : return -1;
27116 : }
27117 : }
27118 0 : return 0;
27119 : }
27120 :
27121 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_get_result(PyObject *obj, void *closure)
27122 : {
27123 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
27124 0 : PyObject *py_result;
27125 0 : py_result = PyErr_FromWERROR(object->out.result);
27126 0 : return py_result;
27127 : }
27128 :
27129 0 : static int py_svcctl_QueryServiceLockStatusA_set_result(PyObject *py_obj, PyObject *value, void *closure)
27130 : {
27131 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
27132 0 : if (value == NULL) {
27133 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27134 0 : return -1;
27135 : }
27136 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
27137 0 : return 0;
27138 : }
27139 :
27140 : static PyGetSetDef py_svcctl_QueryServiceLockStatusA_getsetters[] = {
27141 : {
27142 : .name = discard_const_p(char, "in_handle"),
27143 : .get = py_svcctl_QueryServiceLockStatusA_in_get_handle,
27144 : .set = py_svcctl_QueryServiceLockStatusA_in_set_handle,
27145 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27146 : },
27147 : {
27148 : .name = discard_const_p(char, "in_offered"),
27149 : .get = py_svcctl_QueryServiceLockStatusA_in_get_offered,
27150 : .set = py_svcctl_QueryServiceLockStatusA_in_set_offered,
27151 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27152 : },
27153 : {
27154 : .name = discard_const_p(char, "out_lock_status"),
27155 : .get = py_svcctl_QueryServiceLockStatusA_out_get_lock_status,
27156 : .set = py_svcctl_QueryServiceLockStatusA_out_set_lock_status,
27157 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_LOCK_STATUS")
27158 : },
27159 : {
27160 : .name = discard_const_p(char, "out_needed"),
27161 : .get = py_svcctl_QueryServiceLockStatusA_out_get_needed,
27162 : .set = py_svcctl_QueryServiceLockStatusA_out_set_needed,
27163 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27164 : },
27165 : {
27166 : .name = discard_const_p(char, "result"),
27167 : .get = py_svcctl_QueryServiceLockStatusA_get_result,
27168 : .set = py_svcctl_QueryServiceLockStatusA_set_result,
27169 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
27170 : },
27171 : { .name = NULL }
27172 : };
27173 :
27174 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27175 : {
27176 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceLockStatusA, type);
27177 0 : struct svcctl_QueryServiceLockStatusA *_self = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(self);
27178 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27179 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27180 0 : _self->out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
27181 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
27182 0 : return self;
27183 : }
27184 :
27185 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27186 : {
27187 :
27188 :
27189 0 : return PyLong_FromLong(30);
27190 : }
27191 :
27192 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27193 : {
27194 0 : const struct ndr_interface_call *call = NULL;
27195 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
27196 0 : PyObject *ret = NULL;
27197 0 : struct ndr_push *push = NULL;
27198 0 : DATA_BLOB blob;
27199 0 : enum ndr_err_code err;
27200 :
27201 0 : if (ndr_table_svcctl.num_calls < 31) {
27202 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusA_ndr_pack");
27203 0 : return NULL;
27204 : }
27205 0 : call = &ndr_table_svcctl.calls[30];
27206 :
27207 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27208 0 : if (push == NULL) {
27209 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27210 0 : return NULL;
27211 : }
27212 :
27213 0 : push->flags |= ndr_push_flags;
27214 :
27215 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27216 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27217 0 : TALLOC_FREE(push);
27218 0 : PyErr_SetNdrError(err);
27219 0 : return NULL;
27220 : }
27221 0 : blob = ndr_push_blob(push);
27222 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27223 0 : TALLOC_FREE(push);
27224 0 : return ret;
27225 : }
27226 :
27227 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27228 : {
27229 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27230 0 : PyObject *bigendian_obj = NULL;
27231 0 : PyObject *ndr64_obj = NULL;
27232 0 : libndr_flags ndr_push_flags = 0;
27233 :
27234 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27235 : discard_const_p(char *, kwnames),
27236 : &bigendian_obj,
27237 : &ndr64_obj)) {
27238 0 : return NULL;
27239 : }
27240 :
27241 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27242 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27243 : }
27244 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27245 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27246 : }
27247 :
27248 0 : return py_svcctl_QueryServiceLockStatusA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27249 : }
27250 :
27251 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27252 : {
27253 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27254 0 : PyObject *bigendian_obj = NULL;
27255 0 : PyObject *ndr64_obj = NULL;
27256 0 : libndr_flags ndr_push_flags = 0;
27257 :
27258 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27259 : discard_const_p(char *, kwnames),
27260 : &bigendian_obj,
27261 : &ndr64_obj)) {
27262 0 : return NULL;
27263 : }
27264 :
27265 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27266 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27267 : }
27268 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27269 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27270 : }
27271 :
27272 0 : return py_svcctl_QueryServiceLockStatusA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27273 : }
27274 :
27275 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
27276 : {
27277 0 : const struct ndr_interface_call *call = NULL;
27278 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
27279 0 : struct ndr_pull *pull = NULL;
27280 0 : enum ndr_err_code err;
27281 :
27282 0 : if (ndr_table_svcctl.num_calls < 31) {
27283 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusA_ndr_unpack");
27284 0 : return NULL;
27285 : }
27286 0 : call = &ndr_table_svcctl.calls[30];
27287 :
27288 0 : pull = ndr_pull_init_blob(blob, object);
27289 0 : if (pull == NULL) {
27290 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27291 0 : return NULL;
27292 : }
27293 :
27294 0 : pull->flags |= ndr_pull_flags;
27295 :
27296 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27297 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27298 0 : TALLOC_FREE(pull);
27299 0 : PyErr_SetNdrError(err);
27300 0 : return NULL;
27301 : }
27302 0 : if (!allow_remaining) {
27303 0 : uint32_t highest_ofs;
27304 :
27305 0 : if (pull->offset > pull->relative_highest_offset) {
27306 0 : highest_ofs = pull->offset;
27307 : } else {
27308 0 : highest_ofs = pull->relative_highest_offset;
27309 : }
27310 0 : if (highest_ofs < pull->data_size) {
27311 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27312 : "not all bytes consumed ofs[%u] size[%u]",
27313 : highest_ofs, pull->data_size);
27314 0 : TALLOC_FREE(pull);
27315 0 : PyErr_SetNdrError(err);
27316 0 : return NULL;
27317 : }
27318 : }
27319 :
27320 0 : TALLOC_FREE(pull);
27321 0 : Py_RETURN_NONE;
27322 : }
27323 :
27324 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27325 : {
27326 0 : DATA_BLOB blob;
27327 0 : Py_ssize_t blob_length = 0;
27328 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27329 0 : PyObject *bigendian_obj = NULL;
27330 0 : PyObject *ndr64_obj = NULL;
27331 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27332 0 : PyObject *allow_remaining_obj = NULL;
27333 0 : bool allow_remaining = false;
27334 :
27335 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27336 : discard_const_p(char *, kwnames),
27337 : &blob.data, &blob_length,
27338 : &bigendian_obj,
27339 : &ndr64_obj,
27340 : &allow_remaining_obj)) {
27341 0 : return NULL;
27342 : }
27343 0 : blob.length = blob_length;
27344 :
27345 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27346 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27347 : }
27348 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27349 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27350 : }
27351 :
27352 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27353 0 : allow_remaining = true;
27354 : }
27355 :
27356 0 : return py_svcctl_QueryServiceLockStatusA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27357 : }
27358 :
27359 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27360 : {
27361 0 : DATA_BLOB blob;
27362 0 : Py_ssize_t blob_length = 0;
27363 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27364 0 : PyObject *bigendian_obj = NULL;
27365 0 : PyObject *ndr64_obj = NULL;
27366 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27367 0 : PyObject *allow_remaining_obj = NULL;
27368 0 : bool allow_remaining = false;
27369 :
27370 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27371 : discard_const_p(char *, kwnames),
27372 : &blob.data, &blob_length,
27373 : &bigendian_obj,
27374 : &ndr64_obj,
27375 : &allow_remaining_obj)) {
27376 0 : return NULL;
27377 : }
27378 0 : blob.length = blob_length;
27379 :
27380 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27381 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27382 : }
27383 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27384 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27385 : }
27386 :
27387 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27388 0 : allow_remaining = true;
27389 : }
27390 :
27391 0 : return py_svcctl_QueryServiceLockStatusA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27392 : }
27393 :
27394 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
27395 : {
27396 0 : const struct ndr_interface_call *call = NULL;
27397 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
27398 0 : PyObject *ret;
27399 0 : char *retstr;
27400 :
27401 0 : if (ndr_table_svcctl.num_calls < 31) {
27402 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusA_ndr_print");
27403 0 : return NULL;
27404 : }
27405 0 : call = &ndr_table_svcctl.calls[30];
27406 :
27407 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27408 0 : ret = PyUnicode_FromString(retstr);
27409 0 : TALLOC_FREE(retstr);
27410 :
27411 0 : return ret;
27412 : }
27413 :
27414 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27415 : {
27416 0 : return py_svcctl_QueryServiceLockStatusA_ndr_print(py_obj, "svcctl_QueryServiceLockStatusA_in", NDR_IN);
27417 : }
27418 :
27419 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27420 : {
27421 0 : return py_svcctl_QueryServiceLockStatusA_ndr_print(py_obj, "svcctl_QueryServiceLockStatusA_out", NDR_OUT);
27422 : }
27423 :
27424 : static PyMethodDef py_svcctl_QueryServiceLockStatusA_methods[] = {
27425 : { "opnum", (PyCFunction)py_svcctl_QueryServiceLockStatusA_ndr_opnum, METH_NOARGS|METH_CLASS,
27426 : "svcctl.QueryServiceLockStatusA.opnum() -> 30 (0x1e) " },
27427 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27428 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27429 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27430 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27431 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27432 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27433 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27434 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27435 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceLockStatusA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27436 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceLockStatusA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27437 : { NULL, NULL, 0, NULL }
27438 : };
27439 :
27440 :
27441 : static PyTypeObject svcctl_QueryServiceLockStatusA_Type = {
27442 : PyVarObject_HEAD_INIT(NULL, 0)
27443 : .tp_name = "svcctl.QueryServiceLockStatusA",
27444 : .tp_getset = py_svcctl_QueryServiceLockStatusA_getsetters,
27445 : .tp_methods = py_svcctl_QueryServiceLockStatusA_methods,
27446 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27447 : .tp_new = py_svcctl_QueryServiceLockStatusA_new,
27448 : };
27449 :
27450 0 : static bool pack_py_svcctl_QueryServiceLockStatusA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceLockStatusA *r)
27451 : {
27452 0 : PyObject *py_handle;
27453 0 : PyObject *py_offered;
27454 0 : const char *kwnames[] = {
27455 : "handle", "offered", NULL
27456 : };
27457 :
27458 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceLockStatusA", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
27459 0 : return false;
27460 : }
27461 :
27462 0 : if (py_handle == NULL) {
27463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
27464 0 : return false;
27465 : }
27466 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
27467 0 : if (r->in.handle == NULL) {
27468 0 : PyErr_NoMemory();
27469 0 : return false;
27470 : }
27471 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
27472 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
27473 0 : PyErr_NoMemory();
27474 0 : return false;
27475 : }
27476 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
27477 0 : if (py_offered == NULL) {
27478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
27479 0 : return false;
27480 : }
27481 : {
27482 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
27483 0 : if (PyLong_Check(py_offered)) {
27484 0 : unsigned long long test_var;
27485 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
27486 0 : if (PyErr_Occurred() != NULL) {
27487 0 : return false;
27488 : }
27489 0 : if (test_var > uint_max) {
27490 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27491 : PyLong_Type.tp_name, uint_max, test_var);
27492 0 : return false;
27493 : }
27494 0 : r->in.offered = test_var;
27495 : } else {
27496 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27497 : PyLong_Type.tp_name);
27498 0 : return false;
27499 : }
27500 : }
27501 0 : return true;
27502 : }
27503 :
27504 0 : static PyObject *unpack_py_svcctl_QueryServiceLockStatusA_args_out(struct svcctl_QueryServiceLockStatusA *r)
27505 : {
27506 0 : PyObject *result;
27507 0 : PyObject *py_lock_status;
27508 0 : PyObject *py_needed;
27509 0 : result = PyTuple_New(2);
27510 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, r->out.lock_status, r->out.lock_status);
27511 0 : PyTuple_SetItem(result, 0, py_lock_status);
27512 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
27513 0 : PyTuple_SetItem(result, 1, py_needed);
27514 0 : if (!W_ERROR_IS_OK(r->out.result)) {
27515 0 : PyErr_SetWERROR(r->out.result);
27516 0 : return NULL;
27517 : }
27518 :
27519 0 : return result;
27520 : }
27521 :
27522 :
27523 0 : static PyObject *py_svcctl_StartServiceA_in_get_handle(PyObject *obj, void *closure)
27524 : {
27525 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
27526 0 : PyObject *py_handle;
27527 0 : if (object->in.handle == NULL) {
27528 0 : Py_RETURN_NONE;
27529 : }
27530 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
27531 0 : return py_handle;
27532 : }
27533 :
27534 0 : static int py_svcctl_StartServiceA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27535 : {
27536 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
27537 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27538 0 : if (value == NULL) {
27539 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27540 0 : return -1;
27541 : }
27542 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27543 0 : if (object->in.handle == NULL) {
27544 0 : PyErr_NoMemory();
27545 0 : return -1;
27546 : }
27547 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27548 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27549 0 : PyErr_NoMemory();
27550 0 : return -1;
27551 : }
27552 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27553 0 : return 0;
27554 : }
27555 :
27556 0 : static PyObject *py_svcctl_StartServiceA_in_get_NumArgs(PyObject *obj, void *closure)
27557 : {
27558 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
27559 0 : PyObject *py_NumArgs;
27560 0 : py_NumArgs = PyLong_FromUnsignedLongLong((uint32_t)object->in.NumArgs);
27561 0 : return py_NumArgs;
27562 : }
27563 :
27564 0 : static int py_svcctl_StartServiceA_in_set_NumArgs(PyObject *py_obj, PyObject *value, void *closure)
27565 : {
27566 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
27567 0 : if (value == NULL) {
27568 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.NumArgs");
27569 0 : return -1;
27570 : }
27571 : {
27572 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.NumArgs));
27573 0 : if (PyLong_Check(value)) {
27574 0 : unsigned long long test_var;
27575 0 : test_var = PyLong_AsUnsignedLongLong(value);
27576 0 : if (PyErr_Occurred() != NULL) {
27577 0 : return -1;
27578 : }
27579 0 : if (test_var > uint_max) {
27580 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27581 : PyLong_Type.tp_name, uint_max, test_var);
27582 0 : return -1;
27583 : }
27584 0 : object->in.NumArgs = test_var;
27585 : } else {
27586 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27587 : PyLong_Type.tp_name);
27588 0 : return -1;
27589 : }
27590 : }
27591 0 : return 0;
27592 : }
27593 :
27594 0 : static PyObject *py_svcctl_StartServiceA_in_get_Arguments(PyObject *obj, void *closure)
27595 : {
27596 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
27597 0 : PyObject *py_Arguments;
27598 0 : if (object->in.Arguments == NULL) {
27599 0 : Py_RETURN_NONE;
27600 : }
27601 0 : if (object->in.Arguments == NULL) {
27602 0 : py_Arguments = Py_None;
27603 0 : Py_INCREF(py_Arguments);
27604 : } else {
27605 0 : if (object->in.Arguments == NULL) {
27606 0 : py_Arguments = Py_None;
27607 0 : Py_INCREF(py_Arguments);
27608 : } else {
27609 0 : py_Arguments = PyUnicode_Decode(object->in.Arguments, strlen(object->in.Arguments), "utf-8", "ignore");
27610 : }
27611 : }
27612 0 : return py_Arguments;
27613 : }
27614 :
27615 0 : static int py_svcctl_StartServiceA_in_set_Arguments(PyObject *py_obj, PyObject *value, void *closure)
27616 : {
27617 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
27618 0 : if (value == NULL) {
27619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Arguments");
27620 0 : return -1;
27621 : }
27622 0 : if (value == Py_None) {
27623 0 : object->in.Arguments = NULL;
27624 : } else {
27625 0 : object->in.Arguments = NULL;
27626 : {
27627 0 : const char *test_str;
27628 0 : const char *talloc_str;
27629 0 : PyObject *unicode = NULL;
27630 0 : if (PyUnicode_Check(value)) {
27631 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
27632 0 : if (unicode == NULL) {
27633 0 : return -1;
27634 : }
27635 0 : test_str = PyBytes_AS_STRING(unicode);
27636 0 : } else if (PyBytes_Check(value)) {
27637 0 : test_str = PyBytes_AS_STRING(value);
27638 : } else {
27639 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
27640 0 : return -1;
27641 : }
27642 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
27643 0 : if (unicode != NULL) {
27644 0 : Py_DECREF(unicode);
27645 : }
27646 0 : if (talloc_str == NULL) {
27647 0 : PyErr_NoMemory();
27648 0 : return -1;
27649 : }
27650 0 : object->in.Arguments = talloc_str;
27651 : }
27652 : }
27653 0 : return 0;
27654 : }
27655 :
27656 0 : static PyObject *py_svcctl_StartServiceA_get_result(PyObject *obj, void *closure)
27657 : {
27658 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
27659 0 : PyObject *py_result;
27660 0 : py_result = PyErr_FromWERROR(object->out.result);
27661 0 : return py_result;
27662 : }
27663 :
27664 0 : static int py_svcctl_StartServiceA_set_result(PyObject *py_obj, PyObject *value, void *closure)
27665 : {
27666 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
27667 0 : if (value == NULL) {
27668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27669 0 : return -1;
27670 : }
27671 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
27672 0 : return 0;
27673 : }
27674 :
27675 : static PyGetSetDef py_svcctl_StartServiceA_getsetters[] = {
27676 : {
27677 : .name = discard_const_p(char, "in_handle"),
27678 : .get = py_svcctl_StartServiceA_in_get_handle,
27679 : .set = py_svcctl_StartServiceA_in_set_handle,
27680 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27681 : },
27682 : {
27683 : .name = discard_const_p(char, "in_NumArgs"),
27684 : .get = py_svcctl_StartServiceA_in_get_NumArgs,
27685 : .set = py_svcctl_StartServiceA_in_set_NumArgs,
27686 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27687 : },
27688 : {
27689 : .name = discard_const_p(char, "in_Arguments"),
27690 : .get = py_svcctl_StartServiceA_in_get_Arguments,
27691 : .set = py_svcctl_StartServiceA_in_set_Arguments,
27692 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
27693 : },
27694 : {
27695 : .name = discard_const_p(char, "result"),
27696 : .get = py_svcctl_StartServiceA_get_result,
27697 : .set = py_svcctl_StartServiceA_set_result,
27698 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
27699 : },
27700 : { .name = NULL }
27701 : };
27702 :
27703 0 : static PyObject *py_svcctl_StartServiceA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27704 : {
27705 0 : PyObject *self = pytalloc_new(struct svcctl_StartServiceA, type);
27706 0 : struct svcctl_StartServiceA *_self = (struct svcctl_StartServiceA *)pytalloc_get_ptr(self);
27707 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27708 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27709 0 : return self;
27710 : }
27711 :
27712 0 : static PyObject *py_svcctl_StartServiceA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27713 : {
27714 :
27715 :
27716 0 : return PyLong_FromLong(31);
27717 : }
27718 :
27719 0 : static PyObject *py_svcctl_StartServiceA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27720 : {
27721 0 : const struct ndr_interface_call *call = NULL;
27722 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
27723 0 : PyObject *ret = NULL;
27724 0 : struct ndr_push *push = NULL;
27725 0 : DATA_BLOB blob;
27726 0 : enum ndr_err_code err;
27727 :
27728 0 : if (ndr_table_svcctl.num_calls < 32) {
27729 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceA_ndr_pack");
27730 0 : return NULL;
27731 : }
27732 0 : call = &ndr_table_svcctl.calls[31];
27733 :
27734 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27735 0 : if (push == NULL) {
27736 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27737 0 : return NULL;
27738 : }
27739 :
27740 0 : push->flags |= ndr_push_flags;
27741 :
27742 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27743 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27744 0 : TALLOC_FREE(push);
27745 0 : PyErr_SetNdrError(err);
27746 0 : return NULL;
27747 : }
27748 0 : blob = ndr_push_blob(push);
27749 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27750 0 : TALLOC_FREE(push);
27751 0 : return ret;
27752 : }
27753 :
27754 0 : static PyObject *py_svcctl_StartServiceA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27755 : {
27756 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27757 0 : PyObject *bigendian_obj = NULL;
27758 0 : PyObject *ndr64_obj = NULL;
27759 0 : libndr_flags ndr_push_flags = 0;
27760 :
27761 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27762 : discard_const_p(char *, kwnames),
27763 : &bigendian_obj,
27764 : &ndr64_obj)) {
27765 0 : return NULL;
27766 : }
27767 :
27768 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27769 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27770 : }
27771 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27772 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27773 : }
27774 :
27775 0 : return py_svcctl_StartServiceA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27776 : }
27777 :
27778 0 : static PyObject *py_svcctl_StartServiceA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27779 : {
27780 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27781 0 : PyObject *bigendian_obj = NULL;
27782 0 : PyObject *ndr64_obj = NULL;
27783 0 : libndr_flags ndr_push_flags = 0;
27784 :
27785 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27786 : discard_const_p(char *, kwnames),
27787 : &bigendian_obj,
27788 : &ndr64_obj)) {
27789 0 : return NULL;
27790 : }
27791 :
27792 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27793 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27794 : }
27795 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27796 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27797 : }
27798 :
27799 0 : return py_svcctl_StartServiceA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27800 : }
27801 :
27802 0 : static PyObject *py_svcctl_StartServiceA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
27803 : {
27804 0 : const struct ndr_interface_call *call = NULL;
27805 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
27806 0 : struct ndr_pull *pull = NULL;
27807 0 : enum ndr_err_code err;
27808 :
27809 0 : if (ndr_table_svcctl.num_calls < 32) {
27810 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceA_ndr_unpack");
27811 0 : return NULL;
27812 : }
27813 0 : call = &ndr_table_svcctl.calls[31];
27814 :
27815 0 : pull = ndr_pull_init_blob(blob, object);
27816 0 : if (pull == NULL) {
27817 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27818 0 : return NULL;
27819 : }
27820 :
27821 0 : pull->flags |= ndr_pull_flags;
27822 :
27823 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27824 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27825 0 : TALLOC_FREE(pull);
27826 0 : PyErr_SetNdrError(err);
27827 0 : return NULL;
27828 : }
27829 0 : if (!allow_remaining) {
27830 0 : uint32_t highest_ofs;
27831 :
27832 0 : if (pull->offset > pull->relative_highest_offset) {
27833 0 : highest_ofs = pull->offset;
27834 : } else {
27835 0 : highest_ofs = pull->relative_highest_offset;
27836 : }
27837 0 : if (highest_ofs < pull->data_size) {
27838 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27839 : "not all bytes consumed ofs[%u] size[%u]",
27840 : highest_ofs, pull->data_size);
27841 0 : TALLOC_FREE(pull);
27842 0 : PyErr_SetNdrError(err);
27843 0 : return NULL;
27844 : }
27845 : }
27846 :
27847 0 : TALLOC_FREE(pull);
27848 0 : Py_RETURN_NONE;
27849 : }
27850 :
27851 0 : static PyObject *py_svcctl_StartServiceA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27852 : {
27853 0 : DATA_BLOB blob;
27854 0 : Py_ssize_t blob_length = 0;
27855 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27856 0 : PyObject *bigendian_obj = NULL;
27857 0 : PyObject *ndr64_obj = NULL;
27858 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27859 0 : PyObject *allow_remaining_obj = NULL;
27860 0 : bool allow_remaining = false;
27861 :
27862 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27863 : discard_const_p(char *, kwnames),
27864 : &blob.data, &blob_length,
27865 : &bigendian_obj,
27866 : &ndr64_obj,
27867 : &allow_remaining_obj)) {
27868 0 : return NULL;
27869 : }
27870 0 : blob.length = blob_length;
27871 :
27872 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27873 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27874 : }
27875 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27876 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27877 : }
27878 :
27879 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27880 0 : allow_remaining = true;
27881 : }
27882 :
27883 0 : return py_svcctl_StartServiceA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27884 : }
27885 :
27886 0 : static PyObject *py_svcctl_StartServiceA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27887 : {
27888 0 : DATA_BLOB blob;
27889 0 : Py_ssize_t blob_length = 0;
27890 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27891 0 : PyObject *bigendian_obj = NULL;
27892 0 : PyObject *ndr64_obj = NULL;
27893 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27894 0 : PyObject *allow_remaining_obj = NULL;
27895 0 : bool allow_remaining = false;
27896 :
27897 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27898 : discard_const_p(char *, kwnames),
27899 : &blob.data, &blob_length,
27900 : &bigendian_obj,
27901 : &ndr64_obj,
27902 : &allow_remaining_obj)) {
27903 0 : return NULL;
27904 : }
27905 0 : blob.length = blob_length;
27906 :
27907 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27908 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27909 : }
27910 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27911 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27912 : }
27913 :
27914 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27915 0 : allow_remaining = true;
27916 : }
27917 :
27918 0 : return py_svcctl_StartServiceA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27919 : }
27920 :
27921 0 : static PyObject *py_svcctl_StartServiceA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
27922 : {
27923 0 : const struct ndr_interface_call *call = NULL;
27924 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
27925 0 : PyObject *ret;
27926 0 : char *retstr;
27927 :
27928 0 : if (ndr_table_svcctl.num_calls < 32) {
27929 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceA_ndr_print");
27930 0 : return NULL;
27931 : }
27932 0 : call = &ndr_table_svcctl.calls[31];
27933 :
27934 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27935 0 : ret = PyUnicode_FromString(retstr);
27936 0 : TALLOC_FREE(retstr);
27937 :
27938 0 : return ret;
27939 : }
27940 :
27941 0 : static PyObject *py_svcctl_StartServiceA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27942 : {
27943 0 : return py_svcctl_StartServiceA_ndr_print(py_obj, "svcctl_StartServiceA_in", NDR_IN);
27944 : }
27945 :
27946 0 : static PyObject *py_svcctl_StartServiceA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27947 : {
27948 0 : return py_svcctl_StartServiceA_ndr_print(py_obj, "svcctl_StartServiceA_out", NDR_OUT);
27949 : }
27950 :
27951 : static PyMethodDef py_svcctl_StartServiceA_methods[] = {
27952 : { "opnum", (PyCFunction)py_svcctl_StartServiceA_ndr_opnum, METH_NOARGS|METH_CLASS,
27953 : "svcctl.StartServiceA.opnum() -> 31 (0x1f) " },
27954 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27955 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27956 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27957 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27958 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27959 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27960 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27961 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27962 : { "__ndr_print_in__", (PyCFunction)py_svcctl_StartServiceA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27963 : { "__ndr_print_out__", (PyCFunction)py_svcctl_StartServiceA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27964 : { NULL, NULL, 0, NULL }
27965 : };
27966 :
27967 :
27968 : static PyTypeObject svcctl_StartServiceA_Type = {
27969 : PyVarObject_HEAD_INIT(NULL, 0)
27970 : .tp_name = "svcctl.StartServiceA",
27971 : .tp_getset = py_svcctl_StartServiceA_getsetters,
27972 : .tp_methods = py_svcctl_StartServiceA_methods,
27973 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27974 : .tp_new = py_svcctl_StartServiceA_new,
27975 : };
27976 :
27977 0 : static bool pack_py_svcctl_StartServiceA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_StartServiceA *r)
27978 : {
27979 0 : PyObject *py_handle;
27980 0 : PyObject *py_NumArgs;
27981 0 : PyObject *py_Arguments;
27982 0 : const char *kwnames[] = {
27983 : "handle", "NumArgs", "Arguments", NULL
27984 : };
27985 :
27986 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_StartServiceA", discard_const_p(char *, kwnames), &py_handle, &py_NumArgs, &py_Arguments)) {
27987 0 : return false;
27988 : }
27989 :
27990 0 : if (py_handle == NULL) {
27991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
27992 0 : return false;
27993 : }
27994 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
27995 0 : if (r->in.handle == NULL) {
27996 0 : PyErr_NoMemory();
27997 0 : return false;
27998 : }
27999 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
28000 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
28001 0 : PyErr_NoMemory();
28002 0 : return false;
28003 : }
28004 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
28005 0 : if (py_NumArgs == NULL) {
28006 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.NumArgs");
28007 0 : return false;
28008 : }
28009 : {
28010 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.NumArgs));
28011 0 : if (PyLong_Check(py_NumArgs)) {
28012 0 : unsigned long long test_var;
28013 0 : test_var = PyLong_AsUnsignedLongLong(py_NumArgs);
28014 0 : if (PyErr_Occurred() != NULL) {
28015 0 : return false;
28016 : }
28017 0 : if (test_var > uint_max) {
28018 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28019 : PyLong_Type.tp_name, uint_max, test_var);
28020 0 : return false;
28021 : }
28022 0 : r->in.NumArgs = test_var;
28023 : } else {
28024 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28025 : PyLong_Type.tp_name);
28026 0 : return false;
28027 : }
28028 : }
28029 0 : if (py_Arguments == NULL) {
28030 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Arguments");
28031 0 : return false;
28032 : }
28033 0 : if (py_Arguments == Py_None) {
28034 0 : r->in.Arguments = NULL;
28035 : } else {
28036 0 : r->in.Arguments = NULL;
28037 : {
28038 0 : const char *test_str;
28039 0 : const char *talloc_str;
28040 0 : PyObject *unicode = NULL;
28041 0 : if (PyUnicode_Check(py_Arguments)) {
28042 0 : unicode = PyUnicode_AsEncodedString(py_Arguments, "utf-8", "ignore");
28043 0 : if (unicode == NULL) {
28044 0 : return false;
28045 : }
28046 0 : test_str = PyBytes_AS_STRING(unicode);
28047 0 : } else if (PyBytes_Check(py_Arguments)) {
28048 0 : test_str = PyBytes_AS_STRING(py_Arguments);
28049 : } else {
28050 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_Arguments)->tp_name);
28051 0 : return false;
28052 : }
28053 0 : talloc_str = talloc_strdup(r, test_str);
28054 0 : if (unicode != NULL) {
28055 0 : Py_DECREF(unicode);
28056 : }
28057 0 : if (talloc_str == NULL) {
28058 0 : PyErr_NoMemory();
28059 0 : return false;
28060 : }
28061 0 : r->in.Arguments = talloc_str;
28062 : }
28063 : }
28064 0 : return true;
28065 : }
28066 :
28067 0 : static PyObject *unpack_py_svcctl_StartServiceA_args_out(struct svcctl_StartServiceA *r)
28068 : {
28069 0 : PyObject *result;
28070 0 : result = Py_None;
28071 0 : Py_INCREF(result);
28072 0 : if (!W_ERROR_IS_OK(r->out.result)) {
28073 0 : PyErr_SetWERROR(r->out.result);
28074 0 : return NULL;
28075 : }
28076 :
28077 0 : return result;
28078 : }
28079 :
28080 :
28081 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_in_get_handle(PyObject *obj, void *closure)
28082 : {
28083 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
28084 0 : PyObject *py_handle;
28085 0 : if (object->in.handle == NULL) {
28086 0 : Py_RETURN_NONE;
28087 : }
28088 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
28089 0 : return py_handle;
28090 : }
28091 :
28092 0 : static int py_svcctl_GetServiceDisplayNameA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28093 : {
28094 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28095 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
28096 0 : if (value == NULL) {
28097 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
28098 0 : return -1;
28099 : }
28100 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
28101 0 : if (object->in.handle == NULL) {
28102 0 : PyErr_NoMemory();
28103 0 : return -1;
28104 : }
28105 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28106 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28107 0 : PyErr_NoMemory();
28108 0 : return -1;
28109 : }
28110 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28111 0 : return 0;
28112 : }
28113 :
28114 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_in_get_service_name(PyObject *obj, void *closure)
28115 : {
28116 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
28117 0 : PyObject *py_service_name;
28118 0 : if (object->in.service_name == NULL) {
28119 0 : Py_RETURN_NONE;
28120 : }
28121 0 : if (object->in.service_name == NULL) {
28122 0 : py_service_name = Py_None;
28123 0 : Py_INCREF(py_service_name);
28124 : } else {
28125 0 : if (object->in.service_name == NULL) {
28126 0 : py_service_name = Py_None;
28127 0 : Py_INCREF(py_service_name);
28128 : } else {
28129 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
28130 : }
28131 : }
28132 0 : return py_service_name;
28133 : }
28134 :
28135 0 : static int py_svcctl_GetServiceDisplayNameA_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
28136 : {
28137 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28138 0 : if (value == NULL) {
28139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
28140 0 : return -1;
28141 : }
28142 0 : if (value == Py_None) {
28143 0 : object->in.service_name = NULL;
28144 : } else {
28145 0 : object->in.service_name = NULL;
28146 : {
28147 0 : const char *test_str;
28148 0 : const char *talloc_str;
28149 0 : PyObject *unicode = NULL;
28150 0 : if (PyUnicode_Check(value)) {
28151 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
28152 0 : if (unicode == NULL) {
28153 0 : return -1;
28154 : }
28155 0 : test_str = PyBytes_AS_STRING(unicode);
28156 0 : } else if (PyBytes_Check(value)) {
28157 0 : test_str = PyBytes_AS_STRING(value);
28158 : } else {
28159 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
28160 0 : return -1;
28161 : }
28162 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
28163 0 : if (unicode != NULL) {
28164 0 : Py_DECREF(unicode);
28165 : }
28166 0 : if (talloc_str == NULL) {
28167 0 : PyErr_NoMemory();
28168 0 : return -1;
28169 : }
28170 0 : object->in.service_name = talloc_str;
28171 : }
28172 : }
28173 0 : return 0;
28174 : }
28175 :
28176 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_out_get_display_name(PyObject *obj, void *closure)
28177 : {
28178 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
28179 0 : PyObject *py_display_name;
28180 0 : if (object->out.display_name == NULL) {
28181 0 : Py_RETURN_NONE;
28182 : }
28183 0 : if (*object->out.display_name == NULL) {
28184 0 : py_display_name = Py_None;
28185 0 : Py_INCREF(py_display_name);
28186 : } else {
28187 0 : if (*object->out.display_name == NULL) {
28188 0 : py_display_name = Py_None;
28189 0 : Py_INCREF(py_display_name);
28190 : } else {
28191 0 : py_display_name = PyUnicode_Decode(*object->out.display_name, strlen(*object->out.display_name), "utf-8", "ignore");
28192 : }
28193 : }
28194 0 : return py_display_name;
28195 : }
28196 :
28197 0 : static int py_svcctl_GetServiceDisplayNameA_out_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
28198 : {
28199 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28200 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name));
28201 0 : if (value == NULL) {
28202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name");
28203 0 : return -1;
28204 : }
28205 0 : object->out.display_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name);
28206 0 : if (object->out.display_name == NULL) {
28207 0 : PyErr_NoMemory();
28208 0 : return -1;
28209 : }
28210 0 : if (value == Py_None) {
28211 0 : *object->out.display_name = NULL;
28212 : } else {
28213 0 : *object->out.display_name = NULL;
28214 : {
28215 0 : const char *test_str;
28216 0 : const char *talloc_str;
28217 0 : PyObject *unicode = NULL;
28218 0 : if (PyUnicode_Check(value)) {
28219 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
28220 0 : if (unicode == NULL) {
28221 0 : return -1;
28222 : }
28223 0 : test_str = PyBytes_AS_STRING(unicode);
28224 0 : } else if (PyBytes_Check(value)) {
28225 0 : test_str = PyBytes_AS_STRING(value);
28226 : } else {
28227 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
28228 0 : return -1;
28229 : }
28230 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
28231 0 : if (unicode != NULL) {
28232 0 : Py_DECREF(unicode);
28233 : }
28234 0 : if (talloc_str == NULL) {
28235 0 : PyErr_NoMemory();
28236 0 : return -1;
28237 : }
28238 0 : *object->out.display_name = talloc_str;
28239 : }
28240 : }
28241 0 : return 0;
28242 : }
28243 :
28244 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_in_get_display_name_length(PyObject *obj, void *closure)
28245 : {
28246 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
28247 0 : PyObject *py_display_name_length;
28248 0 : if (object->in.display_name_length == NULL) {
28249 0 : Py_RETURN_NONE;
28250 : }
28251 0 : if (object->in.display_name_length == NULL) {
28252 0 : py_display_name_length = Py_None;
28253 0 : Py_INCREF(py_display_name_length);
28254 : } else {
28255 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
28256 : }
28257 0 : return py_display_name_length;
28258 : }
28259 :
28260 0 : static int py_svcctl_GetServiceDisplayNameA_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
28261 : {
28262 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28263 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
28264 0 : if (value == NULL) {
28265 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
28266 0 : return -1;
28267 : }
28268 0 : if (value == Py_None) {
28269 0 : object->in.display_name_length = NULL;
28270 : } else {
28271 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
28272 0 : if (object->in.display_name_length == NULL) {
28273 0 : PyErr_NoMemory();
28274 0 : return -1;
28275 : }
28276 : {
28277 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
28278 0 : if (PyLong_Check(value)) {
28279 0 : unsigned long long test_var;
28280 0 : test_var = PyLong_AsUnsignedLongLong(value);
28281 0 : if (PyErr_Occurred() != NULL) {
28282 0 : return -1;
28283 : }
28284 0 : if (test_var > uint_max) {
28285 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28286 : PyLong_Type.tp_name, uint_max, test_var);
28287 0 : return -1;
28288 : }
28289 0 : *object->in.display_name_length = test_var;
28290 : } else {
28291 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28292 : PyLong_Type.tp_name);
28293 0 : return -1;
28294 : }
28295 : }
28296 : }
28297 0 : return 0;
28298 : }
28299 :
28300 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_out_get_display_name_length(PyObject *obj, void *closure)
28301 : {
28302 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
28303 0 : PyObject *py_display_name_length;
28304 0 : if (object->out.display_name_length == NULL) {
28305 0 : Py_RETURN_NONE;
28306 : }
28307 0 : if (object->out.display_name_length == NULL) {
28308 0 : py_display_name_length = Py_None;
28309 0 : Py_INCREF(py_display_name_length);
28310 : } else {
28311 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
28312 : }
28313 0 : return py_display_name_length;
28314 : }
28315 :
28316 0 : static int py_svcctl_GetServiceDisplayNameA_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
28317 : {
28318 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28319 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
28320 0 : if (value == NULL) {
28321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
28322 0 : return -1;
28323 : }
28324 0 : if (value == Py_None) {
28325 0 : object->out.display_name_length = NULL;
28326 : } else {
28327 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
28328 0 : if (object->out.display_name_length == NULL) {
28329 0 : PyErr_NoMemory();
28330 0 : return -1;
28331 : }
28332 : {
28333 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
28334 0 : if (PyLong_Check(value)) {
28335 0 : unsigned long long test_var;
28336 0 : test_var = PyLong_AsUnsignedLongLong(value);
28337 0 : if (PyErr_Occurred() != NULL) {
28338 0 : return -1;
28339 : }
28340 0 : if (test_var > uint_max) {
28341 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28342 : PyLong_Type.tp_name, uint_max, test_var);
28343 0 : return -1;
28344 : }
28345 0 : *object->out.display_name_length = test_var;
28346 : } else {
28347 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28348 : PyLong_Type.tp_name);
28349 0 : return -1;
28350 : }
28351 : }
28352 : }
28353 0 : return 0;
28354 : }
28355 :
28356 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_get_result(PyObject *obj, void *closure)
28357 : {
28358 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
28359 0 : PyObject *py_result;
28360 0 : py_result = PyErr_FromWERROR(object->out.result);
28361 0 : return py_result;
28362 : }
28363 :
28364 0 : static int py_svcctl_GetServiceDisplayNameA_set_result(PyObject *py_obj, PyObject *value, void *closure)
28365 : {
28366 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28367 0 : if (value == NULL) {
28368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28369 0 : return -1;
28370 : }
28371 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
28372 0 : return 0;
28373 : }
28374 :
28375 : static PyGetSetDef py_svcctl_GetServiceDisplayNameA_getsetters[] = {
28376 : {
28377 : .name = discard_const_p(char, "in_handle"),
28378 : .get = py_svcctl_GetServiceDisplayNameA_in_get_handle,
28379 : .set = py_svcctl_GetServiceDisplayNameA_in_set_handle,
28380 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28381 : },
28382 : {
28383 : .name = discard_const_p(char, "in_service_name"),
28384 : .get = py_svcctl_GetServiceDisplayNameA_in_get_service_name,
28385 : .set = py_svcctl_GetServiceDisplayNameA_in_set_service_name,
28386 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28387 : },
28388 : {
28389 : .name = discard_const_p(char, "out_display_name"),
28390 : .get = py_svcctl_GetServiceDisplayNameA_out_get_display_name,
28391 : .set = py_svcctl_GetServiceDisplayNameA_out_set_display_name,
28392 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28393 : },
28394 : {
28395 : .name = discard_const_p(char, "in_display_name_length"),
28396 : .get = py_svcctl_GetServiceDisplayNameA_in_get_display_name_length,
28397 : .set = py_svcctl_GetServiceDisplayNameA_in_set_display_name_length,
28398 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
28399 : },
28400 : {
28401 : .name = discard_const_p(char, "out_display_name_length"),
28402 : .get = py_svcctl_GetServiceDisplayNameA_out_get_display_name_length,
28403 : .set = py_svcctl_GetServiceDisplayNameA_out_set_display_name_length,
28404 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
28405 : },
28406 : {
28407 : .name = discard_const_p(char, "result"),
28408 : .get = py_svcctl_GetServiceDisplayNameA_get_result,
28409 : .set = py_svcctl_GetServiceDisplayNameA_set_result,
28410 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
28411 : },
28412 : { .name = NULL }
28413 : };
28414 :
28415 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28416 : {
28417 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceDisplayNameA, type);
28418 0 : struct svcctl_GetServiceDisplayNameA *_self = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(self);
28419 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28420 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28421 0 : return self;
28422 : }
28423 :
28424 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28425 : {
28426 :
28427 :
28428 0 : return PyLong_FromLong(32);
28429 : }
28430 :
28431 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
28432 : {
28433 0 : const struct ndr_interface_call *call = NULL;
28434 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28435 0 : PyObject *ret = NULL;
28436 0 : struct ndr_push *push = NULL;
28437 0 : DATA_BLOB blob;
28438 0 : enum ndr_err_code err;
28439 :
28440 0 : if (ndr_table_svcctl.num_calls < 33) {
28441 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameA_ndr_pack");
28442 0 : return NULL;
28443 : }
28444 0 : call = &ndr_table_svcctl.calls[32];
28445 :
28446 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28447 0 : if (push == NULL) {
28448 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28449 0 : return NULL;
28450 : }
28451 :
28452 0 : push->flags |= ndr_push_flags;
28453 :
28454 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28455 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28456 0 : TALLOC_FREE(push);
28457 0 : PyErr_SetNdrError(err);
28458 0 : return NULL;
28459 : }
28460 0 : blob = ndr_push_blob(push);
28461 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28462 0 : TALLOC_FREE(push);
28463 0 : return ret;
28464 : }
28465 :
28466 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28467 : {
28468 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28469 0 : PyObject *bigendian_obj = NULL;
28470 0 : PyObject *ndr64_obj = NULL;
28471 0 : libndr_flags ndr_push_flags = 0;
28472 :
28473 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28474 : discard_const_p(char *, kwnames),
28475 : &bigendian_obj,
28476 : &ndr64_obj)) {
28477 0 : return NULL;
28478 : }
28479 :
28480 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28481 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28482 : }
28483 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28484 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28485 : }
28486 :
28487 0 : return py_svcctl_GetServiceDisplayNameA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28488 : }
28489 :
28490 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28491 : {
28492 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28493 0 : PyObject *bigendian_obj = NULL;
28494 0 : PyObject *ndr64_obj = NULL;
28495 0 : libndr_flags ndr_push_flags = 0;
28496 :
28497 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28498 : discard_const_p(char *, kwnames),
28499 : &bigendian_obj,
28500 : &ndr64_obj)) {
28501 0 : return NULL;
28502 : }
28503 :
28504 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28505 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28506 : }
28507 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28508 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28509 : }
28510 :
28511 0 : return py_svcctl_GetServiceDisplayNameA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28512 : }
28513 :
28514 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
28515 : {
28516 0 : const struct ndr_interface_call *call = NULL;
28517 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28518 0 : struct ndr_pull *pull = NULL;
28519 0 : enum ndr_err_code err;
28520 :
28521 0 : if (ndr_table_svcctl.num_calls < 33) {
28522 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameA_ndr_unpack");
28523 0 : return NULL;
28524 : }
28525 0 : call = &ndr_table_svcctl.calls[32];
28526 :
28527 0 : pull = ndr_pull_init_blob(blob, object);
28528 0 : if (pull == NULL) {
28529 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28530 0 : return NULL;
28531 : }
28532 :
28533 0 : pull->flags |= ndr_pull_flags;
28534 :
28535 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28536 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28537 0 : TALLOC_FREE(pull);
28538 0 : PyErr_SetNdrError(err);
28539 0 : return NULL;
28540 : }
28541 0 : if (!allow_remaining) {
28542 0 : uint32_t highest_ofs;
28543 :
28544 0 : if (pull->offset > pull->relative_highest_offset) {
28545 0 : highest_ofs = pull->offset;
28546 : } else {
28547 0 : highest_ofs = pull->relative_highest_offset;
28548 : }
28549 0 : if (highest_ofs < pull->data_size) {
28550 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28551 : "not all bytes consumed ofs[%u] size[%u]",
28552 : highest_ofs, pull->data_size);
28553 0 : TALLOC_FREE(pull);
28554 0 : PyErr_SetNdrError(err);
28555 0 : return NULL;
28556 : }
28557 : }
28558 :
28559 0 : TALLOC_FREE(pull);
28560 0 : Py_RETURN_NONE;
28561 : }
28562 :
28563 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28564 : {
28565 0 : DATA_BLOB blob;
28566 0 : Py_ssize_t blob_length = 0;
28567 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28568 0 : PyObject *bigendian_obj = NULL;
28569 0 : PyObject *ndr64_obj = NULL;
28570 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28571 0 : PyObject *allow_remaining_obj = NULL;
28572 0 : bool allow_remaining = false;
28573 :
28574 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28575 : discard_const_p(char *, kwnames),
28576 : &blob.data, &blob_length,
28577 : &bigendian_obj,
28578 : &ndr64_obj,
28579 : &allow_remaining_obj)) {
28580 0 : return NULL;
28581 : }
28582 0 : blob.length = blob_length;
28583 :
28584 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28585 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28586 : }
28587 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28588 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28589 : }
28590 :
28591 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28592 0 : allow_remaining = true;
28593 : }
28594 :
28595 0 : return py_svcctl_GetServiceDisplayNameA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28596 : }
28597 :
28598 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28599 : {
28600 0 : DATA_BLOB blob;
28601 0 : Py_ssize_t blob_length = 0;
28602 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28603 0 : PyObject *bigendian_obj = NULL;
28604 0 : PyObject *ndr64_obj = NULL;
28605 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28606 0 : PyObject *allow_remaining_obj = NULL;
28607 0 : bool allow_remaining = false;
28608 :
28609 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28610 : discard_const_p(char *, kwnames),
28611 : &blob.data, &blob_length,
28612 : &bigendian_obj,
28613 : &ndr64_obj,
28614 : &allow_remaining_obj)) {
28615 0 : return NULL;
28616 : }
28617 0 : blob.length = blob_length;
28618 :
28619 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28620 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28621 : }
28622 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28623 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28624 : }
28625 :
28626 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28627 0 : allow_remaining = true;
28628 : }
28629 :
28630 0 : return py_svcctl_GetServiceDisplayNameA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28631 : }
28632 :
28633 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
28634 : {
28635 0 : const struct ndr_interface_call *call = NULL;
28636 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
28637 0 : PyObject *ret;
28638 0 : char *retstr;
28639 :
28640 0 : if (ndr_table_svcctl.num_calls < 33) {
28641 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameA_ndr_print");
28642 0 : return NULL;
28643 : }
28644 0 : call = &ndr_table_svcctl.calls[32];
28645 :
28646 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28647 0 : ret = PyUnicode_FromString(retstr);
28648 0 : TALLOC_FREE(retstr);
28649 :
28650 0 : return ret;
28651 : }
28652 :
28653 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28654 : {
28655 0 : return py_svcctl_GetServiceDisplayNameA_ndr_print(py_obj, "svcctl_GetServiceDisplayNameA_in", NDR_IN);
28656 : }
28657 :
28658 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28659 : {
28660 0 : return py_svcctl_GetServiceDisplayNameA_ndr_print(py_obj, "svcctl_GetServiceDisplayNameA_out", NDR_OUT);
28661 : }
28662 :
28663 : static PyMethodDef py_svcctl_GetServiceDisplayNameA_methods[] = {
28664 : { "opnum", (PyCFunction)py_svcctl_GetServiceDisplayNameA_ndr_opnum, METH_NOARGS|METH_CLASS,
28665 : "svcctl.GetServiceDisplayNameA.opnum() -> 32 (0x20) " },
28666 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28667 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28668 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28669 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28670 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28671 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28672 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28673 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28674 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceDisplayNameA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28675 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceDisplayNameA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28676 : { NULL, NULL, 0, NULL }
28677 : };
28678 :
28679 :
28680 : static PyTypeObject svcctl_GetServiceDisplayNameA_Type = {
28681 : PyVarObject_HEAD_INIT(NULL, 0)
28682 : .tp_name = "svcctl.GetServiceDisplayNameA",
28683 : .tp_getset = py_svcctl_GetServiceDisplayNameA_getsetters,
28684 : .tp_methods = py_svcctl_GetServiceDisplayNameA_methods,
28685 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28686 : .tp_new = py_svcctl_GetServiceDisplayNameA_new,
28687 : };
28688 :
28689 0 : static bool pack_py_svcctl_GetServiceDisplayNameA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceDisplayNameA *r)
28690 : {
28691 0 : PyObject *py_handle;
28692 0 : PyObject *py_service_name;
28693 0 : PyObject *py_display_name_length;
28694 0 : const char *kwnames[] = {
28695 : "handle", "service_name", "display_name_length", NULL
28696 : };
28697 :
28698 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceDisplayNameA", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
28699 0 : return false;
28700 : }
28701 :
28702 0 : if (py_handle == NULL) {
28703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
28704 0 : return false;
28705 : }
28706 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
28707 0 : if (r->in.handle == NULL) {
28708 0 : PyErr_NoMemory();
28709 0 : return false;
28710 : }
28711 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
28712 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
28713 0 : PyErr_NoMemory();
28714 0 : return false;
28715 : }
28716 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
28717 0 : if (py_service_name == NULL) {
28718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
28719 0 : return false;
28720 : }
28721 0 : if (py_service_name == Py_None) {
28722 0 : r->in.service_name = NULL;
28723 : } else {
28724 0 : r->in.service_name = NULL;
28725 : {
28726 0 : const char *test_str;
28727 0 : const char *talloc_str;
28728 0 : PyObject *unicode = NULL;
28729 0 : if (PyUnicode_Check(py_service_name)) {
28730 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
28731 0 : if (unicode == NULL) {
28732 0 : return false;
28733 : }
28734 0 : test_str = PyBytes_AS_STRING(unicode);
28735 0 : } else if (PyBytes_Check(py_service_name)) {
28736 0 : test_str = PyBytes_AS_STRING(py_service_name);
28737 : } else {
28738 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
28739 0 : return false;
28740 : }
28741 0 : talloc_str = talloc_strdup(r, test_str);
28742 0 : if (unicode != NULL) {
28743 0 : Py_DECREF(unicode);
28744 : }
28745 0 : if (talloc_str == NULL) {
28746 0 : PyErr_NoMemory();
28747 0 : return false;
28748 : }
28749 0 : r->in.service_name = talloc_str;
28750 : }
28751 : }
28752 0 : if (py_display_name_length == NULL) {
28753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
28754 0 : return false;
28755 : }
28756 0 : if (py_display_name_length == Py_None) {
28757 0 : r->in.display_name_length = NULL;
28758 : } else {
28759 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
28760 0 : if (r->in.display_name_length == NULL) {
28761 0 : PyErr_NoMemory();
28762 0 : return false;
28763 : }
28764 : {
28765 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
28766 0 : if (PyLong_Check(py_display_name_length)) {
28767 0 : unsigned long long test_var;
28768 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
28769 0 : if (PyErr_Occurred() != NULL) {
28770 0 : return false;
28771 : }
28772 0 : if (test_var > uint_max) {
28773 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28774 : PyLong_Type.tp_name, uint_max, test_var);
28775 0 : return false;
28776 : }
28777 0 : *r->in.display_name_length = test_var;
28778 : } else {
28779 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28780 : PyLong_Type.tp_name);
28781 0 : return false;
28782 : }
28783 : }
28784 : }
28785 0 : return true;
28786 : }
28787 :
28788 0 : static PyObject *unpack_py_svcctl_GetServiceDisplayNameA_args_out(struct svcctl_GetServiceDisplayNameA *r)
28789 : {
28790 0 : PyObject *result;
28791 0 : PyObject *py_display_name;
28792 0 : PyObject *py_display_name_length;
28793 0 : result = PyTuple_New(2);
28794 0 : if (*r->out.display_name == NULL) {
28795 0 : py_display_name = Py_None;
28796 0 : Py_INCREF(py_display_name);
28797 : } else {
28798 0 : if (*r->out.display_name == NULL) {
28799 0 : py_display_name = Py_None;
28800 0 : Py_INCREF(py_display_name);
28801 : } else {
28802 0 : py_display_name = PyUnicode_Decode(*r->out.display_name, strlen(*r->out.display_name), "utf-8", "ignore");
28803 : }
28804 : }
28805 0 : PyTuple_SetItem(result, 0, py_display_name);
28806 0 : if (r->out.display_name_length == NULL) {
28807 0 : py_display_name_length = Py_None;
28808 0 : Py_INCREF(py_display_name_length);
28809 : } else {
28810 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
28811 : }
28812 0 : PyTuple_SetItem(result, 1, py_display_name_length);
28813 0 : if (!W_ERROR_IS_OK(r->out.result)) {
28814 0 : PyErr_SetWERROR(r->out.result);
28815 0 : return NULL;
28816 : }
28817 :
28818 0 : return result;
28819 : }
28820 :
28821 :
28822 0 : static PyObject *py_svcctl_GetServiceKeyNameA_in_get_handle(PyObject *obj, void *closure)
28823 : {
28824 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
28825 0 : PyObject *py_handle;
28826 0 : if (object->in.handle == NULL) {
28827 0 : Py_RETURN_NONE;
28828 : }
28829 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
28830 0 : return py_handle;
28831 : }
28832 :
28833 0 : static int py_svcctl_GetServiceKeyNameA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28834 : {
28835 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
28836 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
28837 0 : if (value == NULL) {
28838 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
28839 0 : return -1;
28840 : }
28841 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
28842 0 : if (object->in.handle == NULL) {
28843 0 : PyErr_NoMemory();
28844 0 : return -1;
28845 : }
28846 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28847 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28848 0 : PyErr_NoMemory();
28849 0 : return -1;
28850 : }
28851 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28852 0 : return 0;
28853 : }
28854 :
28855 0 : static PyObject *py_svcctl_GetServiceKeyNameA_in_get_service_name(PyObject *obj, void *closure)
28856 : {
28857 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
28858 0 : PyObject *py_service_name;
28859 0 : if (object->in.service_name == NULL) {
28860 0 : Py_RETURN_NONE;
28861 : }
28862 0 : if (object->in.service_name == NULL) {
28863 0 : py_service_name = Py_None;
28864 0 : Py_INCREF(py_service_name);
28865 : } else {
28866 0 : if (object->in.service_name == NULL) {
28867 0 : py_service_name = Py_None;
28868 0 : Py_INCREF(py_service_name);
28869 : } else {
28870 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
28871 : }
28872 : }
28873 0 : return py_service_name;
28874 : }
28875 :
28876 0 : static int py_svcctl_GetServiceKeyNameA_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
28877 : {
28878 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
28879 0 : if (value == NULL) {
28880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
28881 0 : return -1;
28882 : }
28883 0 : if (value == Py_None) {
28884 0 : object->in.service_name = NULL;
28885 : } else {
28886 0 : object->in.service_name = NULL;
28887 : {
28888 0 : const char *test_str;
28889 0 : const char *talloc_str;
28890 0 : PyObject *unicode = NULL;
28891 0 : if (PyUnicode_Check(value)) {
28892 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
28893 0 : if (unicode == NULL) {
28894 0 : return -1;
28895 : }
28896 0 : test_str = PyBytes_AS_STRING(unicode);
28897 0 : } else if (PyBytes_Check(value)) {
28898 0 : test_str = PyBytes_AS_STRING(value);
28899 : } else {
28900 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
28901 0 : return -1;
28902 : }
28903 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
28904 0 : if (unicode != NULL) {
28905 0 : Py_DECREF(unicode);
28906 : }
28907 0 : if (talloc_str == NULL) {
28908 0 : PyErr_NoMemory();
28909 0 : return -1;
28910 : }
28911 0 : object->in.service_name = talloc_str;
28912 : }
28913 : }
28914 0 : return 0;
28915 : }
28916 :
28917 0 : static PyObject *py_svcctl_GetServiceKeyNameA_out_get_key_name(PyObject *obj, void *closure)
28918 : {
28919 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
28920 0 : PyObject *py_key_name;
28921 0 : if (object->out.key_name == NULL) {
28922 0 : Py_RETURN_NONE;
28923 : }
28924 0 : if (*object->out.key_name == NULL) {
28925 0 : py_key_name = Py_None;
28926 0 : Py_INCREF(py_key_name);
28927 : } else {
28928 0 : if (*object->out.key_name == NULL) {
28929 0 : py_key_name = Py_None;
28930 0 : Py_INCREF(py_key_name);
28931 : } else {
28932 0 : py_key_name = PyUnicode_Decode(*object->out.key_name, strlen(*object->out.key_name), "utf-8", "ignore");
28933 : }
28934 : }
28935 0 : return py_key_name;
28936 : }
28937 :
28938 0 : static int py_svcctl_GetServiceKeyNameA_out_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
28939 : {
28940 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
28941 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.key_name));
28942 0 : if (value == NULL) {
28943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.key_name");
28944 0 : return -1;
28945 : }
28946 0 : object->out.key_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.key_name);
28947 0 : if (object->out.key_name == NULL) {
28948 0 : PyErr_NoMemory();
28949 0 : return -1;
28950 : }
28951 0 : if (value == Py_None) {
28952 0 : *object->out.key_name = NULL;
28953 : } else {
28954 0 : *object->out.key_name = NULL;
28955 : {
28956 0 : const char *test_str;
28957 0 : const char *talloc_str;
28958 0 : PyObject *unicode = NULL;
28959 0 : if (PyUnicode_Check(value)) {
28960 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
28961 0 : if (unicode == NULL) {
28962 0 : return -1;
28963 : }
28964 0 : test_str = PyBytes_AS_STRING(unicode);
28965 0 : } else if (PyBytes_Check(value)) {
28966 0 : test_str = PyBytes_AS_STRING(value);
28967 : } else {
28968 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
28969 0 : return -1;
28970 : }
28971 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
28972 0 : if (unicode != NULL) {
28973 0 : Py_DECREF(unicode);
28974 : }
28975 0 : if (talloc_str == NULL) {
28976 0 : PyErr_NoMemory();
28977 0 : return -1;
28978 : }
28979 0 : *object->out.key_name = talloc_str;
28980 : }
28981 : }
28982 0 : return 0;
28983 : }
28984 :
28985 0 : static PyObject *py_svcctl_GetServiceKeyNameA_in_get_display_name_length(PyObject *obj, void *closure)
28986 : {
28987 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
28988 0 : PyObject *py_display_name_length;
28989 0 : if (object->in.display_name_length == NULL) {
28990 0 : Py_RETURN_NONE;
28991 : }
28992 0 : if (object->in.display_name_length == NULL) {
28993 0 : py_display_name_length = Py_None;
28994 0 : Py_INCREF(py_display_name_length);
28995 : } else {
28996 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
28997 : }
28998 0 : return py_display_name_length;
28999 : }
29000 :
29001 0 : static int py_svcctl_GetServiceKeyNameA_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
29002 : {
29003 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
29004 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
29005 0 : if (value == NULL) {
29006 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
29007 0 : return -1;
29008 : }
29009 0 : if (value == Py_None) {
29010 0 : object->in.display_name_length = NULL;
29011 : } else {
29012 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
29013 0 : if (object->in.display_name_length == NULL) {
29014 0 : PyErr_NoMemory();
29015 0 : return -1;
29016 : }
29017 : {
29018 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
29019 0 : if (PyLong_Check(value)) {
29020 0 : unsigned long long test_var;
29021 0 : test_var = PyLong_AsUnsignedLongLong(value);
29022 0 : if (PyErr_Occurred() != NULL) {
29023 0 : return -1;
29024 : }
29025 0 : if (test_var > uint_max) {
29026 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29027 : PyLong_Type.tp_name, uint_max, test_var);
29028 0 : return -1;
29029 : }
29030 0 : *object->in.display_name_length = test_var;
29031 : } else {
29032 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29033 : PyLong_Type.tp_name);
29034 0 : return -1;
29035 : }
29036 : }
29037 : }
29038 0 : return 0;
29039 : }
29040 :
29041 0 : static PyObject *py_svcctl_GetServiceKeyNameA_out_get_display_name_length(PyObject *obj, void *closure)
29042 : {
29043 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
29044 0 : PyObject *py_display_name_length;
29045 0 : if (object->out.display_name_length == NULL) {
29046 0 : Py_RETURN_NONE;
29047 : }
29048 0 : if (object->out.display_name_length == NULL) {
29049 0 : py_display_name_length = Py_None;
29050 0 : Py_INCREF(py_display_name_length);
29051 : } else {
29052 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
29053 : }
29054 0 : return py_display_name_length;
29055 : }
29056 :
29057 0 : static int py_svcctl_GetServiceKeyNameA_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
29058 : {
29059 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
29060 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
29061 0 : if (value == NULL) {
29062 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
29063 0 : return -1;
29064 : }
29065 0 : if (value == Py_None) {
29066 0 : object->out.display_name_length = NULL;
29067 : } else {
29068 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
29069 0 : if (object->out.display_name_length == NULL) {
29070 0 : PyErr_NoMemory();
29071 0 : return -1;
29072 : }
29073 : {
29074 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
29075 0 : if (PyLong_Check(value)) {
29076 0 : unsigned long long test_var;
29077 0 : test_var = PyLong_AsUnsignedLongLong(value);
29078 0 : if (PyErr_Occurred() != NULL) {
29079 0 : return -1;
29080 : }
29081 0 : if (test_var > uint_max) {
29082 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29083 : PyLong_Type.tp_name, uint_max, test_var);
29084 0 : return -1;
29085 : }
29086 0 : *object->out.display_name_length = test_var;
29087 : } else {
29088 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29089 : PyLong_Type.tp_name);
29090 0 : return -1;
29091 : }
29092 : }
29093 : }
29094 0 : return 0;
29095 : }
29096 :
29097 0 : static PyObject *py_svcctl_GetServiceKeyNameA_get_result(PyObject *obj, void *closure)
29098 : {
29099 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
29100 0 : PyObject *py_result;
29101 0 : py_result = PyErr_FromWERROR(object->out.result);
29102 0 : return py_result;
29103 : }
29104 :
29105 0 : static int py_svcctl_GetServiceKeyNameA_set_result(PyObject *py_obj, PyObject *value, void *closure)
29106 : {
29107 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
29108 0 : if (value == NULL) {
29109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29110 0 : return -1;
29111 : }
29112 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
29113 0 : return 0;
29114 : }
29115 :
29116 : static PyGetSetDef py_svcctl_GetServiceKeyNameA_getsetters[] = {
29117 : {
29118 : .name = discard_const_p(char, "in_handle"),
29119 : .get = py_svcctl_GetServiceKeyNameA_in_get_handle,
29120 : .set = py_svcctl_GetServiceKeyNameA_in_set_handle,
29121 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29122 : },
29123 : {
29124 : .name = discard_const_p(char, "in_service_name"),
29125 : .get = py_svcctl_GetServiceKeyNameA_in_get_service_name,
29126 : .set = py_svcctl_GetServiceKeyNameA_in_set_service_name,
29127 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29128 : },
29129 : {
29130 : .name = discard_const_p(char, "out_key_name"),
29131 : .get = py_svcctl_GetServiceKeyNameA_out_get_key_name,
29132 : .set = py_svcctl_GetServiceKeyNameA_out_set_key_name,
29133 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29134 : },
29135 : {
29136 : .name = discard_const_p(char, "in_display_name_length"),
29137 : .get = py_svcctl_GetServiceKeyNameA_in_get_display_name_length,
29138 : .set = py_svcctl_GetServiceKeyNameA_in_set_display_name_length,
29139 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29140 : },
29141 : {
29142 : .name = discard_const_p(char, "out_display_name_length"),
29143 : .get = py_svcctl_GetServiceKeyNameA_out_get_display_name_length,
29144 : .set = py_svcctl_GetServiceKeyNameA_out_set_display_name_length,
29145 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29146 : },
29147 : {
29148 : .name = discard_const_p(char, "result"),
29149 : .get = py_svcctl_GetServiceKeyNameA_get_result,
29150 : .set = py_svcctl_GetServiceKeyNameA_set_result,
29151 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
29152 : },
29153 : { .name = NULL }
29154 : };
29155 :
29156 0 : static PyObject *py_svcctl_GetServiceKeyNameA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29157 : {
29158 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceKeyNameA, type);
29159 0 : struct svcctl_GetServiceKeyNameA *_self = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(self);
29160 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29161 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
29162 0 : return self;
29163 : }
29164 :
29165 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29166 : {
29167 :
29168 :
29169 0 : return PyLong_FromLong(33);
29170 : }
29171 :
29172 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
29173 : {
29174 0 : const struct ndr_interface_call *call = NULL;
29175 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
29176 0 : PyObject *ret = NULL;
29177 0 : struct ndr_push *push = NULL;
29178 0 : DATA_BLOB blob;
29179 0 : enum ndr_err_code err;
29180 :
29181 0 : if (ndr_table_svcctl.num_calls < 34) {
29182 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameA_ndr_pack");
29183 0 : return NULL;
29184 : }
29185 0 : call = &ndr_table_svcctl.calls[33];
29186 :
29187 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29188 0 : if (push == NULL) {
29189 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29190 0 : return NULL;
29191 : }
29192 :
29193 0 : push->flags |= ndr_push_flags;
29194 :
29195 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29196 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29197 0 : TALLOC_FREE(push);
29198 0 : PyErr_SetNdrError(err);
29199 0 : return NULL;
29200 : }
29201 0 : blob = ndr_push_blob(push);
29202 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29203 0 : TALLOC_FREE(push);
29204 0 : return ret;
29205 : }
29206 :
29207 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29208 : {
29209 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29210 0 : PyObject *bigendian_obj = NULL;
29211 0 : PyObject *ndr64_obj = NULL;
29212 0 : libndr_flags ndr_push_flags = 0;
29213 :
29214 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29215 : discard_const_p(char *, kwnames),
29216 : &bigendian_obj,
29217 : &ndr64_obj)) {
29218 0 : return NULL;
29219 : }
29220 :
29221 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29222 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29223 : }
29224 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29225 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29226 : }
29227 :
29228 0 : return py_svcctl_GetServiceKeyNameA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29229 : }
29230 :
29231 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29232 : {
29233 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29234 0 : PyObject *bigendian_obj = NULL;
29235 0 : PyObject *ndr64_obj = NULL;
29236 0 : libndr_flags ndr_push_flags = 0;
29237 :
29238 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29239 : discard_const_p(char *, kwnames),
29240 : &bigendian_obj,
29241 : &ndr64_obj)) {
29242 0 : return NULL;
29243 : }
29244 :
29245 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29246 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29247 : }
29248 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29249 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29250 : }
29251 :
29252 0 : return py_svcctl_GetServiceKeyNameA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29253 : }
29254 :
29255 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
29256 : {
29257 0 : const struct ndr_interface_call *call = NULL;
29258 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
29259 0 : struct ndr_pull *pull = NULL;
29260 0 : enum ndr_err_code err;
29261 :
29262 0 : if (ndr_table_svcctl.num_calls < 34) {
29263 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameA_ndr_unpack");
29264 0 : return NULL;
29265 : }
29266 0 : call = &ndr_table_svcctl.calls[33];
29267 :
29268 0 : pull = ndr_pull_init_blob(blob, object);
29269 0 : if (pull == NULL) {
29270 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29271 0 : return NULL;
29272 : }
29273 :
29274 0 : pull->flags |= ndr_pull_flags;
29275 :
29276 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29277 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29278 0 : TALLOC_FREE(pull);
29279 0 : PyErr_SetNdrError(err);
29280 0 : return NULL;
29281 : }
29282 0 : if (!allow_remaining) {
29283 0 : uint32_t highest_ofs;
29284 :
29285 0 : if (pull->offset > pull->relative_highest_offset) {
29286 0 : highest_ofs = pull->offset;
29287 : } else {
29288 0 : highest_ofs = pull->relative_highest_offset;
29289 : }
29290 0 : if (highest_ofs < pull->data_size) {
29291 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29292 : "not all bytes consumed ofs[%u] size[%u]",
29293 : highest_ofs, pull->data_size);
29294 0 : TALLOC_FREE(pull);
29295 0 : PyErr_SetNdrError(err);
29296 0 : return NULL;
29297 : }
29298 : }
29299 :
29300 0 : TALLOC_FREE(pull);
29301 0 : Py_RETURN_NONE;
29302 : }
29303 :
29304 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29305 : {
29306 0 : DATA_BLOB blob;
29307 0 : Py_ssize_t blob_length = 0;
29308 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29309 0 : PyObject *bigendian_obj = NULL;
29310 0 : PyObject *ndr64_obj = NULL;
29311 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29312 0 : PyObject *allow_remaining_obj = NULL;
29313 0 : bool allow_remaining = false;
29314 :
29315 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29316 : discard_const_p(char *, kwnames),
29317 : &blob.data, &blob_length,
29318 : &bigendian_obj,
29319 : &ndr64_obj,
29320 : &allow_remaining_obj)) {
29321 0 : return NULL;
29322 : }
29323 0 : blob.length = blob_length;
29324 :
29325 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29326 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29327 : }
29328 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29329 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29330 : }
29331 :
29332 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29333 0 : allow_remaining = true;
29334 : }
29335 :
29336 0 : return py_svcctl_GetServiceKeyNameA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29337 : }
29338 :
29339 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29340 : {
29341 0 : DATA_BLOB blob;
29342 0 : Py_ssize_t blob_length = 0;
29343 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29344 0 : PyObject *bigendian_obj = NULL;
29345 0 : PyObject *ndr64_obj = NULL;
29346 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29347 0 : PyObject *allow_remaining_obj = NULL;
29348 0 : bool allow_remaining = false;
29349 :
29350 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29351 : discard_const_p(char *, kwnames),
29352 : &blob.data, &blob_length,
29353 : &bigendian_obj,
29354 : &ndr64_obj,
29355 : &allow_remaining_obj)) {
29356 0 : return NULL;
29357 : }
29358 0 : blob.length = blob_length;
29359 :
29360 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29361 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29362 : }
29363 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29364 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29365 : }
29366 :
29367 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29368 0 : allow_remaining = true;
29369 : }
29370 :
29371 0 : return py_svcctl_GetServiceKeyNameA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29372 : }
29373 :
29374 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29375 : {
29376 0 : const struct ndr_interface_call *call = NULL;
29377 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
29378 0 : PyObject *ret;
29379 0 : char *retstr;
29380 :
29381 0 : if (ndr_table_svcctl.num_calls < 34) {
29382 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameA_ndr_print");
29383 0 : return NULL;
29384 : }
29385 0 : call = &ndr_table_svcctl.calls[33];
29386 :
29387 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29388 0 : ret = PyUnicode_FromString(retstr);
29389 0 : TALLOC_FREE(retstr);
29390 :
29391 0 : return ret;
29392 : }
29393 :
29394 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29395 : {
29396 0 : return py_svcctl_GetServiceKeyNameA_ndr_print(py_obj, "svcctl_GetServiceKeyNameA_in", NDR_IN);
29397 : }
29398 :
29399 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29400 : {
29401 0 : return py_svcctl_GetServiceKeyNameA_ndr_print(py_obj, "svcctl_GetServiceKeyNameA_out", NDR_OUT);
29402 : }
29403 :
29404 : static PyMethodDef py_svcctl_GetServiceKeyNameA_methods[] = {
29405 : { "opnum", (PyCFunction)py_svcctl_GetServiceKeyNameA_ndr_opnum, METH_NOARGS|METH_CLASS,
29406 : "svcctl.GetServiceKeyNameA.opnum() -> 33 (0x21) " },
29407 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29408 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29409 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29410 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29411 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29412 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29413 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29414 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29415 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceKeyNameA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29416 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceKeyNameA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29417 : { NULL, NULL, 0, NULL }
29418 : };
29419 :
29420 :
29421 : static PyTypeObject svcctl_GetServiceKeyNameA_Type = {
29422 : PyVarObject_HEAD_INIT(NULL, 0)
29423 : .tp_name = "svcctl.GetServiceKeyNameA",
29424 : .tp_getset = py_svcctl_GetServiceKeyNameA_getsetters,
29425 : .tp_methods = py_svcctl_GetServiceKeyNameA_methods,
29426 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29427 : .tp_new = py_svcctl_GetServiceKeyNameA_new,
29428 : };
29429 :
29430 0 : static bool pack_py_svcctl_GetServiceKeyNameA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceKeyNameA *r)
29431 : {
29432 0 : PyObject *py_handle;
29433 0 : PyObject *py_service_name;
29434 0 : PyObject *py_display_name_length;
29435 0 : const char *kwnames[] = {
29436 : "handle", "service_name", "display_name_length", NULL
29437 : };
29438 :
29439 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceKeyNameA", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
29440 0 : return false;
29441 : }
29442 :
29443 0 : if (py_handle == NULL) {
29444 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
29445 0 : return false;
29446 : }
29447 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
29448 0 : if (r->in.handle == NULL) {
29449 0 : PyErr_NoMemory();
29450 0 : return false;
29451 : }
29452 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
29453 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
29454 0 : PyErr_NoMemory();
29455 0 : return false;
29456 : }
29457 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
29458 0 : if (py_service_name == NULL) {
29459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
29460 0 : return false;
29461 : }
29462 0 : if (py_service_name == Py_None) {
29463 0 : r->in.service_name = NULL;
29464 : } else {
29465 0 : r->in.service_name = NULL;
29466 : {
29467 0 : const char *test_str;
29468 0 : const char *talloc_str;
29469 0 : PyObject *unicode = NULL;
29470 0 : if (PyUnicode_Check(py_service_name)) {
29471 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
29472 0 : if (unicode == NULL) {
29473 0 : return false;
29474 : }
29475 0 : test_str = PyBytes_AS_STRING(unicode);
29476 0 : } else if (PyBytes_Check(py_service_name)) {
29477 0 : test_str = PyBytes_AS_STRING(py_service_name);
29478 : } else {
29479 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
29480 0 : return false;
29481 : }
29482 0 : talloc_str = talloc_strdup(r, test_str);
29483 0 : if (unicode != NULL) {
29484 0 : Py_DECREF(unicode);
29485 : }
29486 0 : if (talloc_str == NULL) {
29487 0 : PyErr_NoMemory();
29488 0 : return false;
29489 : }
29490 0 : r->in.service_name = talloc_str;
29491 : }
29492 : }
29493 0 : if (py_display_name_length == NULL) {
29494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
29495 0 : return false;
29496 : }
29497 0 : if (py_display_name_length == Py_None) {
29498 0 : r->in.display_name_length = NULL;
29499 : } else {
29500 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
29501 0 : if (r->in.display_name_length == NULL) {
29502 0 : PyErr_NoMemory();
29503 0 : return false;
29504 : }
29505 : {
29506 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
29507 0 : if (PyLong_Check(py_display_name_length)) {
29508 0 : unsigned long long test_var;
29509 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
29510 0 : if (PyErr_Occurred() != NULL) {
29511 0 : return false;
29512 : }
29513 0 : if (test_var > uint_max) {
29514 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29515 : PyLong_Type.tp_name, uint_max, test_var);
29516 0 : return false;
29517 : }
29518 0 : *r->in.display_name_length = test_var;
29519 : } else {
29520 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29521 : PyLong_Type.tp_name);
29522 0 : return false;
29523 : }
29524 : }
29525 : }
29526 0 : return true;
29527 : }
29528 :
29529 0 : static PyObject *unpack_py_svcctl_GetServiceKeyNameA_args_out(struct svcctl_GetServiceKeyNameA *r)
29530 : {
29531 0 : PyObject *result;
29532 0 : PyObject *py_key_name;
29533 0 : PyObject *py_display_name_length;
29534 0 : result = PyTuple_New(2);
29535 0 : if (*r->out.key_name == NULL) {
29536 0 : py_key_name = Py_None;
29537 0 : Py_INCREF(py_key_name);
29538 : } else {
29539 0 : if (*r->out.key_name == NULL) {
29540 0 : py_key_name = Py_None;
29541 0 : Py_INCREF(py_key_name);
29542 : } else {
29543 0 : py_key_name = PyUnicode_Decode(*r->out.key_name, strlen(*r->out.key_name), "utf-8", "ignore");
29544 : }
29545 : }
29546 0 : PyTuple_SetItem(result, 0, py_key_name);
29547 0 : if (r->out.display_name_length == NULL) {
29548 0 : py_display_name_length = Py_None;
29549 0 : Py_INCREF(py_display_name_length);
29550 : } else {
29551 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
29552 : }
29553 0 : PyTuple_SetItem(result, 1, py_display_name_length);
29554 0 : if (!W_ERROR_IS_OK(r->out.result)) {
29555 0 : PyErr_SetWERROR(r->out.result);
29556 0 : return NULL;
29557 : }
29558 :
29559 0 : return result;
29560 : }
29561 :
29562 :
29563 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_in_get_handle(PyObject *obj, void *closure)
29564 : {
29565 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
29566 0 : PyObject *py_handle;
29567 0 : if (object->in.handle == NULL) {
29568 0 : Py_RETURN_NONE;
29569 : }
29570 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
29571 0 : return py_handle;
29572 : }
29573 :
29574 0 : static int py_svcctl_ChangeServiceConfig2A_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29575 : {
29576 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
29577 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
29578 0 : if (value == NULL) {
29579 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
29580 0 : return -1;
29581 : }
29582 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
29583 0 : if (object->in.handle == NULL) {
29584 0 : PyErr_NoMemory();
29585 0 : return -1;
29586 : }
29587 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29588 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29589 0 : PyErr_NoMemory();
29590 0 : return -1;
29591 : }
29592 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29593 0 : return 0;
29594 : }
29595 :
29596 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_in_get_info_level(PyObject *obj, void *closure)
29597 : {
29598 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
29599 0 : PyObject *py_info_level;
29600 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
29601 0 : return py_info_level;
29602 : }
29603 :
29604 0 : static int py_svcctl_ChangeServiceConfig2A_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
29605 : {
29606 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
29607 0 : if (value == NULL) {
29608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
29609 0 : return -1;
29610 : }
29611 : {
29612 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
29613 0 : if (PyLong_Check(value)) {
29614 0 : unsigned long long test_var;
29615 0 : test_var = PyLong_AsUnsignedLongLong(value);
29616 0 : if (PyErr_Occurred() != NULL) {
29617 0 : return -1;
29618 : }
29619 0 : if (test_var > uint_max) {
29620 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29621 : PyLong_Type.tp_name, uint_max, test_var);
29622 0 : return -1;
29623 : }
29624 0 : object->in.info_level = test_var;
29625 : } else {
29626 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29627 : PyLong_Type.tp_name);
29628 0 : return -1;
29629 : }
29630 : }
29631 0 : return 0;
29632 : }
29633 :
29634 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_in_get_info(PyObject *obj, void *closure)
29635 : {
29636 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
29637 0 : PyObject *py_info;
29638 0 : if (object->in.info == NULL) {
29639 0 : Py_RETURN_NONE;
29640 : }
29641 0 : if (object->in.info == NULL) {
29642 0 : py_info = Py_None;
29643 0 : Py_INCREF(py_info);
29644 : } else {
29645 0 : py_info = PyLong_FromLong((uint16_t)*object->in.info);
29646 : }
29647 0 : return py_info;
29648 : }
29649 :
29650 0 : static int py_svcctl_ChangeServiceConfig2A_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
29651 : {
29652 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
29653 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
29654 0 : if (value == NULL) {
29655 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
29656 0 : return -1;
29657 : }
29658 0 : if (value == Py_None) {
29659 0 : object->in.info = NULL;
29660 : } else {
29661 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
29662 0 : if (object->in.info == NULL) {
29663 0 : PyErr_NoMemory();
29664 0 : return -1;
29665 : }
29666 : {
29667 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.info));
29668 0 : if (PyLong_Check(value)) {
29669 0 : unsigned long long test_var;
29670 0 : test_var = PyLong_AsUnsignedLongLong(value);
29671 0 : if (PyErr_Occurred() != NULL) {
29672 0 : return -1;
29673 : }
29674 0 : if (test_var > uint_max) {
29675 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29676 : PyLong_Type.tp_name, uint_max, test_var);
29677 0 : return -1;
29678 : }
29679 0 : *object->in.info = test_var;
29680 : } else {
29681 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29682 : PyLong_Type.tp_name);
29683 0 : return -1;
29684 : }
29685 : }
29686 : }
29687 0 : return 0;
29688 : }
29689 :
29690 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_get_result(PyObject *obj, void *closure)
29691 : {
29692 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
29693 0 : PyObject *py_result;
29694 0 : py_result = PyErr_FromWERROR(object->out.result);
29695 0 : return py_result;
29696 : }
29697 :
29698 0 : static int py_svcctl_ChangeServiceConfig2A_set_result(PyObject *py_obj, PyObject *value, void *closure)
29699 : {
29700 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
29701 0 : if (value == NULL) {
29702 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29703 0 : return -1;
29704 : }
29705 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
29706 0 : return 0;
29707 : }
29708 :
29709 : static PyGetSetDef py_svcctl_ChangeServiceConfig2A_getsetters[] = {
29710 : {
29711 : .name = discard_const_p(char, "in_handle"),
29712 : .get = py_svcctl_ChangeServiceConfig2A_in_get_handle,
29713 : .set = py_svcctl_ChangeServiceConfig2A_in_set_handle,
29714 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29715 : },
29716 : {
29717 : .name = discard_const_p(char, "in_info_level"),
29718 : .get = py_svcctl_ChangeServiceConfig2A_in_get_info_level,
29719 : .set = py_svcctl_ChangeServiceConfig2A_in_set_info_level,
29720 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29721 : },
29722 : {
29723 : .name = discard_const_p(char, "in_info"),
29724 : .get = py_svcctl_ChangeServiceConfig2A_in_get_info,
29725 : .set = py_svcctl_ChangeServiceConfig2A_in_set_info,
29726 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
29727 : },
29728 : {
29729 : .name = discard_const_p(char, "result"),
29730 : .get = py_svcctl_ChangeServiceConfig2A_get_result,
29731 : .set = py_svcctl_ChangeServiceConfig2A_set_result,
29732 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
29733 : },
29734 : { .name = NULL }
29735 : };
29736 :
29737 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29738 : {
29739 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfig2A, type);
29740 0 : struct svcctl_ChangeServiceConfig2A *_self = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(self);
29741 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29742 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
29743 0 : return self;
29744 : }
29745 :
29746 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29747 : {
29748 :
29749 :
29750 0 : return PyLong_FromLong(36);
29751 : }
29752 :
29753 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
29754 : {
29755 0 : const struct ndr_interface_call *call = NULL;
29756 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
29757 0 : PyObject *ret = NULL;
29758 0 : struct ndr_push *push = NULL;
29759 0 : DATA_BLOB blob;
29760 0 : enum ndr_err_code err;
29761 :
29762 0 : if (ndr_table_svcctl.num_calls < 37) {
29763 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2A_ndr_pack");
29764 0 : return NULL;
29765 : }
29766 0 : call = &ndr_table_svcctl.calls[36];
29767 :
29768 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29769 0 : if (push == NULL) {
29770 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29771 0 : return NULL;
29772 : }
29773 :
29774 0 : push->flags |= ndr_push_flags;
29775 :
29776 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29777 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29778 0 : TALLOC_FREE(push);
29779 0 : PyErr_SetNdrError(err);
29780 0 : return NULL;
29781 : }
29782 0 : blob = ndr_push_blob(push);
29783 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29784 0 : TALLOC_FREE(push);
29785 0 : return ret;
29786 : }
29787 :
29788 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29789 : {
29790 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29791 0 : PyObject *bigendian_obj = NULL;
29792 0 : PyObject *ndr64_obj = NULL;
29793 0 : libndr_flags ndr_push_flags = 0;
29794 :
29795 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29796 : discard_const_p(char *, kwnames),
29797 : &bigendian_obj,
29798 : &ndr64_obj)) {
29799 0 : return NULL;
29800 : }
29801 :
29802 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29803 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29804 : }
29805 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29806 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29807 : }
29808 :
29809 0 : return py_svcctl_ChangeServiceConfig2A_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29810 : }
29811 :
29812 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29813 : {
29814 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29815 0 : PyObject *bigendian_obj = NULL;
29816 0 : PyObject *ndr64_obj = NULL;
29817 0 : libndr_flags ndr_push_flags = 0;
29818 :
29819 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29820 : discard_const_p(char *, kwnames),
29821 : &bigendian_obj,
29822 : &ndr64_obj)) {
29823 0 : return NULL;
29824 : }
29825 :
29826 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29827 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29828 : }
29829 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29830 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29831 : }
29832 :
29833 0 : return py_svcctl_ChangeServiceConfig2A_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29834 : }
29835 :
29836 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
29837 : {
29838 0 : const struct ndr_interface_call *call = NULL;
29839 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
29840 0 : struct ndr_pull *pull = NULL;
29841 0 : enum ndr_err_code err;
29842 :
29843 0 : if (ndr_table_svcctl.num_calls < 37) {
29844 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2A_ndr_unpack");
29845 0 : return NULL;
29846 : }
29847 0 : call = &ndr_table_svcctl.calls[36];
29848 :
29849 0 : pull = ndr_pull_init_blob(blob, object);
29850 0 : if (pull == NULL) {
29851 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29852 0 : return NULL;
29853 : }
29854 :
29855 0 : pull->flags |= ndr_pull_flags;
29856 :
29857 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29858 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29859 0 : TALLOC_FREE(pull);
29860 0 : PyErr_SetNdrError(err);
29861 0 : return NULL;
29862 : }
29863 0 : if (!allow_remaining) {
29864 0 : uint32_t highest_ofs;
29865 :
29866 0 : if (pull->offset > pull->relative_highest_offset) {
29867 0 : highest_ofs = pull->offset;
29868 : } else {
29869 0 : highest_ofs = pull->relative_highest_offset;
29870 : }
29871 0 : if (highest_ofs < pull->data_size) {
29872 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29873 : "not all bytes consumed ofs[%u] size[%u]",
29874 : highest_ofs, pull->data_size);
29875 0 : TALLOC_FREE(pull);
29876 0 : PyErr_SetNdrError(err);
29877 0 : return NULL;
29878 : }
29879 : }
29880 :
29881 0 : TALLOC_FREE(pull);
29882 0 : Py_RETURN_NONE;
29883 : }
29884 :
29885 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29886 : {
29887 0 : DATA_BLOB blob;
29888 0 : Py_ssize_t blob_length = 0;
29889 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29890 0 : PyObject *bigendian_obj = NULL;
29891 0 : PyObject *ndr64_obj = NULL;
29892 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29893 0 : PyObject *allow_remaining_obj = NULL;
29894 0 : bool allow_remaining = false;
29895 :
29896 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29897 : discard_const_p(char *, kwnames),
29898 : &blob.data, &blob_length,
29899 : &bigendian_obj,
29900 : &ndr64_obj,
29901 : &allow_remaining_obj)) {
29902 0 : return NULL;
29903 : }
29904 0 : blob.length = blob_length;
29905 :
29906 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29907 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29908 : }
29909 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29910 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29911 : }
29912 :
29913 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29914 0 : allow_remaining = true;
29915 : }
29916 :
29917 0 : return py_svcctl_ChangeServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29918 : }
29919 :
29920 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29921 : {
29922 0 : DATA_BLOB blob;
29923 0 : Py_ssize_t blob_length = 0;
29924 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29925 0 : PyObject *bigendian_obj = NULL;
29926 0 : PyObject *ndr64_obj = NULL;
29927 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29928 0 : PyObject *allow_remaining_obj = NULL;
29929 0 : bool allow_remaining = false;
29930 :
29931 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29932 : discard_const_p(char *, kwnames),
29933 : &blob.data, &blob_length,
29934 : &bigendian_obj,
29935 : &ndr64_obj,
29936 : &allow_remaining_obj)) {
29937 0 : return NULL;
29938 : }
29939 0 : blob.length = blob_length;
29940 :
29941 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29942 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29943 : }
29944 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29945 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29946 : }
29947 :
29948 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29949 0 : allow_remaining = true;
29950 : }
29951 :
29952 0 : return py_svcctl_ChangeServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29953 : }
29954 :
29955 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29956 : {
29957 0 : const struct ndr_interface_call *call = NULL;
29958 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
29959 0 : PyObject *ret;
29960 0 : char *retstr;
29961 :
29962 0 : if (ndr_table_svcctl.num_calls < 37) {
29963 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2A_ndr_print");
29964 0 : return NULL;
29965 : }
29966 0 : call = &ndr_table_svcctl.calls[36];
29967 :
29968 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29969 0 : ret = PyUnicode_FromString(retstr);
29970 0 : TALLOC_FREE(retstr);
29971 :
29972 0 : return ret;
29973 : }
29974 :
29975 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29976 : {
29977 0 : return py_svcctl_ChangeServiceConfig2A_ndr_print(py_obj, "svcctl_ChangeServiceConfig2A_in", NDR_IN);
29978 : }
29979 :
29980 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29981 : {
29982 0 : return py_svcctl_ChangeServiceConfig2A_ndr_print(py_obj, "svcctl_ChangeServiceConfig2A_out", NDR_OUT);
29983 : }
29984 :
29985 : static PyMethodDef py_svcctl_ChangeServiceConfig2A_methods[] = {
29986 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfig2A_ndr_opnum, METH_NOARGS|METH_CLASS,
29987 : "svcctl.ChangeServiceConfig2A.opnum() -> 36 (0x24) " },
29988 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29989 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29990 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29991 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29992 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29993 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29994 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29995 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29996 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfig2A_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29997 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfig2A_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29998 : { NULL, NULL, 0, NULL }
29999 : };
30000 :
30001 :
30002 : static PyTypeObject svcctl_ChangeServiceConfig2A_Type = {
30003 : PyVarObject_HEAD_INIT(NULL, 0)
30004 : .tp_name = "svcctl.ChangeServiceConfig2A",
30005 : .tp_getset = py_svcctl_ChangeServiceConfig2A_getsetters,
30006 : .tp_methods = py_svcctl_ChangeServiceConfig2A_methods,
30007 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30008 : .tp_new = py_svcctl_ChangeServiceConfig2A_new,
30009 : };
30010 :
30011 0 : static bool pack_py_svcctl_ChangeServiceConfig2A_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfig2A *r)
30012 : {
30013 0 : PyObject *py_handle;
30014 0 : PyObject *py_info_level;
30015 0 : PyObject *py_info;
30016 0 : const char *kwnames[] = {
30017 : "handle", "info_level", "info", NULL
30018 : };
30019 :
30020 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_ChangeServiceConfig2A", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_info)) {
30021 0 : return false;
30022 : }
30023 :
30024 0 : if (py_handle == NULL) {
30025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
30026 0 : return false;
30027 : }
30028 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30029 0 : if (r->in.handle == NULL) {
30030 0 : PyErr_NoMemory();
30031 0 : return false;
30032 : }
30033 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30034 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30035 0 : PyErr_NoMemory();
30036 0 : return false;
30037 : }
30038 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30039 0 : if (py_info_level == NULL) {
30040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
30041 0 : return false;
30042 : }
30043 : {
30044 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
30045 0 : if (PyLong_Check(py_info_level)) {
30046 0 : unsigned long long test_var;
30047 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
30048 0 : if (PyErr_Occurred() != NULL) {
30049 0 : return false;
30050 : }
30051 0 : if (test_var > uint_max) {
30052 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30053 : PyLong_Type.tp_name, uint_max, test_var);
30054 0 : return false;
30055 : }
30056 0 : r->in.info_level = test_var;
30057 : } else {
30058 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30059 : PyLong_Type.tp_name);
30060 0 : return false;
30061 : }
30062 : }
30063 0 : if (py_info == NULL) {
30064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
30065 0 : return false;
30066 : }
30067 0 : if (py_info == Py_None) {
30068 0 : r->in.info = NULL;
30069 : } else {
30070 0 : r->in.info = talloc_ptrtype(r, r->in.info);
30071 0 : if (r->in.info == NULL) {
30072 0 : PyErr_NoMemory();
30073 0 : return false;
30074 : }
30075 : {
30076 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.info));
30077 0 : if (PyLong_Check(py_info)) {
30078 0 : unsigned long long test_var;
30079 0 : test_var = PyLong_AsUnsignedLongLong(py_info);
30080 0 : if (PyErr_Occurred() != NULL) {
30081 0 : return false;
30082 : }
30083 0 : if (test_var > uint_max) {
30084 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30085 : PyLong_Type.tp_name, uint_max, test_var);
30086 0 : return false;
30087 : }
30088 0 : *r->in.info = test_var;
30089 : } else {
30090 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30091 : PyLong_Type.tp_name);
30092 0 : return false;
30093 : }
30094 : }
30095 : }
30096 0 : return true;
30097 : }
30098 :
30099 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfig2A_args_out(struct svcctl_ChangeServiceConfig2A *r)
30100 : {
30101 0 : PyObject *result;
30102 0 : result = Py_None;
30103 0 : Py_INCREF(result);
30104 0 : if (!W_ERROR_IS_OK(r->out.result)) {
30105 0 : PyErr_SetWERROR(r->out.result);
30106 0 : return NULL;
30107 : }
30108 :
30109 0 : return result;
30110 : }
30111 :
30112 :
30113 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_in_get_handle(PyObject *obj, void *closure)
30114 : {
30115 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
30116 0 : PyObject *py_handle;
30117 0 : if (object->in.handle == NULL) {
30118 0 : Py_RETURN_NONE;
30119 : }
30120 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30121 0 : return py_handle;
30122 : }
30123 :
30124 0 : static int py_svcctl_ChangeServiceConfig2W_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30125 : {
30126 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
30127 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30128 0 : if (value == NULL) {
30129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
30130 0 : return -1;
30131 : }
30132 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30133 0 : if (object->in.handle == NULL) {
30134 0 : PyErr_NoMemory();
30135 0 : return -1;
30136 : }
30137 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30138 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30139 0 : PyErr_NoMemory();
30140 0 : return -1;
30141 : }
30142 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30143 0 : return 0;
30144 : }
30145 :
30146 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_in_get_info_level(PyObject *obj, void *closure)
30147 : {
30148 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
30149 0 : PyObject *py_info_level;
30150 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
30151 0 : return py_info_level;
30152 : }
30153 :
30154 0 : static int py_svcctl_ChangeServiceConfig2W_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
30155 : {
30156 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
30157 0 : if (value == NULL) {
30158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
30159 0 : return -1;
30160 : }
30161 : {
30162 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
30163 0 : if (PyLong_Check(value)) {
30164 0 : unsigned long long test_var;
30165 0 : test_var = PyLong_AsUnsignedLongLong(value);
30166 0 : if (PyErr_Occurred() != NULL) {
30167 0 : return -1;
30168 : }
30169 0 : if (test_var > uint_max) {
30170 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30171 : PyLong_Type.tp_name, uint_max, test_var);
30172 0 : return -1;
30173 : }
30174 0 : object->in.info_level = test_var;
30175 : } else {
30176 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30177 : PyLong_Type.tp_name);
30178 0 : return -1;
30179 : }
30180 : }
30181 0 : return 0;
30182 : }
30183 :
30184 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_in_get_info(PyObject *obj, void *closure)
30185 : {
30186 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
30187 0 : PyObject *py_info;
30188 0 : if (object->in.info == NULL) {
30189 0 : Py_RETURN_NONE;
30190 : }
30191 0 : if (object->in.info == NULL) {
30192 0 : py_info = Py_None;
30193 0 : Py_INCREF(py_info);
30194 : } else {
30195 0 : py_info = PyLong_FromLong((uint16_t)*object->in.info);
30196 : }
30197 0 : return py_info;
30198 : }
30199 :
30200 0 : static int py_svcctl_ChangeServiceConfig2W_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
30201 : {
30202 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
30203 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
30204 0 : if (value == NULL) {
30205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
30206 0 : return -1;
30207 : }
30208 0 : if (value == Py_None) {
30209 0 : object->in.info = NULL;
30210 : } else {
30211 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
30212 0 : if (object->in.info == NULL) {
30213 0 : PyErr_NoMemory();
30214 0 : return -1;
30215 : }
30216 : {
30217 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.info));
30218 0 : if (PyLong_Check(value)) {
30219 0 : unsigned long long test_var;
30220 0 : test_var = PyLong_AsUnsignedLongLong(value);
30221 0 : if (PyErr_Occurred() != NULL) {
30222 0 : return -1;
30223 : }
30224 0 : if (test_var > uint_max) {
30225 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30226 : PyLong_Type.tp_name, uint_max, test_var);
30227 0 : return -1;
30228 : }
30229 0 : *object->in.info = test_var;
30230 : } else {
30231 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30232 : PyLong_Type.tp_name);
30233 0 : return -1;
30234 : }
30235 : }
30236 : }
30237 0 : return 0;
30238 : }
30239 :
30240 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_get_result(PyObject *obj, void *closure)
30241 : {
30242 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
30243 0 : PyObject *py_result;
30244 0 : py_result = PyErr_FromWERROR(object->out.result);
30245 0 : return py_result;
30246 : }
30247 :
30248 0 : static int py_svcctl_ChangeServiceConfig2W_set_result(PyObject *py_obj, PyObject *value, void *closure)
30249 : {
30250 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
30251 0 : if (value == NULL) {
30252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30253 0 : return -1;
30254 : }
30255 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
30256 0 : return 0;
30257 : }
30258 :
30259 : static PyGetSetDef py_svcctl_ChangeServiceConfig2W_getsetters[] = {
30260 : {
30261 : .name = discard_const_p(char, "in_handle"),
30262 : .get = py_svcctl_ChangeServiceConfig2W_in_get_handle,
30263 : .set = py_svcctl_ChangeServiceConfig2W_in_set_handle,
30264 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30265 : },
30266 : {
30267 : .name = discard_const_p(char, "in_info_level"),
30268 : .get = py_svcctl_ChangeServiceConfig2W_in_get_info_level,
30269 : .set = py_svcctl_ChangeServiceConfig2W_in_set_info_level,
30270 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30271 : },
30272 : {
30273 : .name = discard_const_p(char, "in_info"),
30274 : .get = py_svcctl_ChangeServiceConfig2W_in_get_info,
30275 : .set = py_svcctl_ChangeServiceConfig2W_in_set_info,
30276 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
30277 : },
30278 : {
30279 : .name = discard_const_p(char, "result"),
30280 : .get = py_svcctl_ChangeServiceConfig2W_get_result,
30281 : .set = py_svcctl_ChangeServiceConfig2W_set_result,
30282 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
30283 : },
30284 : { .name = NULL }
30285 : };
30286 :
30287 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30288 : {
30289 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfig2W, type);
30290 0 : struct svcctl_ChangeServiceConfig2W *_self = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(self);
30291 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30292 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30293 0 : return self;
30294 : }
30295 :
30296 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30297 : {
30298 :
30299 :
30300 0 : return PyLong_FromLong(37);
30301 : }
30302 :
30303 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30304 : {
30305 0 : const struct ndr_interface_call *call = NULL;
30306 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
30307 0 : PyObject *ret = NULL;
30308 0 : struct ndr_push *push = NULL;
30309 0 : DATA_BLOB blob;
30310 0 : enum ndr_err_code err;
30311 :
30312 0 : if (ndr_table_svcctl.num_calls < 38) {
30313 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2W_ndr_pack");
30314 0 : return NULL;
30315 : }
30316 0 : call = &ndr_table_svcctl.calls[37];
30317 :
30318 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30319 0 : if (push == NULL) {
30320 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30321 0 : return NULL;
30322 : }
30323 :
30324 0 : push->flags |= ndr_push_flags;
30325 :
30326 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30327 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30328 0 : TALLOC_FREE(push);
30329 0 : PyErr_SetNdrError(err);
30330 0 : return NULL;
30331 : }
30332 0 : blob = ndr_push_blob(push);
30333 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30334 0 : TALLOC_FREE(push);
30335 0 : return ret;
30336 : }
30337 :
30338 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30339 : {
30340 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30341 0 : PyObject *bigendian_obj = NULL;
30342 0 : PyObject *ndr64_obj = NULL;
30343 0 : libndr_flags ndr_push_flags = 0;
30344 :
30345 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30346 : discard_const_p(char *, kwnames),
30347 : &bigendian_obj,
30348 : &ndr64_obj)) {
30349 0 : return NULL;
30350 : }
30351 :
30352 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30353 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30354 : }
30355 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30356 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30357 : }
30358 :
30359 0 : return py_svcctl_ChangeServiceConfig2W_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30360 : }
30361 :
30362 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30363 : {
30364 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30365 0 : PyObject *bigendian_obj = NULL;
30366 0 : PyObject *ndr64_obj = NULL;
30367 0 : libndr_flags ndr_push_flags = 0;
30368 :
30369 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30370 : discard_const_p(char *, kwnames),
30371 : &bigendian_obj,
30372 : &ndr64_obj)) {
30373 0 : return NULL;
30374 : }
30375 :
30376 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30377 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30378 : }
30379 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30380 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30381 : }
30382 :
30383 0 : return py_svcctl_ChangeServiceConfig2W_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30384 : }
30385 :
30386 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
30387 : {
30388 0 : const struct ndr_interface_call *call = NULL;
30389 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
30390 0 : struct ndr_pull *pull = NULL;
30391 0 : enum ndr_err_code err;
30392 :
30393 0 : if (ndr_table_svcctl.num_calls < 38) {
30394 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2W_ndr_unpack");
30395 0 : return NULL;
30396 : }
30397 0 : call = &ndr_table_svcctl.calls[37];
30398 :
30399 0 : pull = ndr_pull_init_blob(blob, object);
30400 0 : if (pull == NULL) {
30401 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30402 0 : return NULL;
30403 : }
30404 :
30405 0 : pull->flags |= ndr_pull_flags;
30406 :
30407 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30408 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30409 0 : TALLOC_FREE(pull);
30410 0 : PyErr_SetNdrError(err);
30411 0 : return NULL;
30412 : }
30413 0 : if (!allow_remaining) {
30414 0 : uint32_t highest_ofs;
30415 :
30416 0 : if (pull->offset > pull->relative_highest_offset) {
30417 0 : highest_ofs = pull->offset;
30418 : } else {
30419 0 : highest_ofs = pull->relative_highest_offset;
30420 : }
30421 0 : if (highest_ofs < pull->data_size) {
30422 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30423 : "not all bytes consumed ofs[%u] size[%u]",
30424 : highest_ofs, pull->data_size);
30425 0 : TALLOC_FREE(pull);
30426 0 : PyErr_SetNdrError(err);
30427 0 : return NULL;
30428 : }
30429 : }
30430 :
30431 0 : TALLOC_FREE(pull);
30432 0 : Py_RETURN_NONE;
30433 : }
30434 :
30435 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30436 : {
30437 0 : DATA_BLOB blob;
30438 0 : Py_ssize_t blob_length = 0;
30439 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30440 0 : PyObject *bigendian_obj = NULL;
30441 0 : PyObject *ndr64_obj = NULL;
30442 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30443 0 : PyObject *allow_remaining_obj = NULL;
30444 0 : bool allow_remaining = false;
30445 :
30446 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30447 : discard_const_p(char *, kwnames),
30448 : &blob.data, &blob_length,
30449 : &bigendian_obj,
30450 : &ndr64_obj,
30451 : &allow_remaining_obj)) {
30452 0 : return NULL;
30453 : }
30454 0 : blob.length = blob_length;
30455 :
30456 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30457 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30458 : }
30459 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30460 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30461 : }
30462 :
30463 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30464 0 : allow_remaining = true;
30465 : }
30466 :
30467 0 : return py_svcctl_ChangeServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30468 : }
30469 :
30470 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30471 : {
30472 0 : DATA_BLOB blob;
30473 0 : Py_ssize_t blob_length = 0;
30474 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30475 0 : PyObject *bigendian_obj = NULL;
30476 0 : PyObject *ndr64_obj = NULL;
30477 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30478 0 : PyObject *allow_remaining_obj = NULL;
30479 0 : bool allow_remaining = false;
30480 :
30481 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30482 : discard_const_p(char *, kwnames),
30483 : &blob.data, &blob_length,
30484 : &bigendian_obj,
30485 : &ndr64_obj,
30486 : &allow_remaining_obj)) {
30487 0 : return NULL;
30488 : }
30489 0 : blob.length = blob_length;
30490 :
30491 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30492 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30493 : }
30494 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30495 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30496 : }
30497 :
30498 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30499 0 : allow_remaining = true;
30500 : }
30501 :
30502 0 : return py_svcctl_ChangeServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30503 : }
30504 :
30505 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
30506 : {
30507 0 : const struct ndr_interface_call *call = NULL;
30508 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
30509 0 : PyObject *ret;
30510 0 : char *retstr;
30511 :
30512 0 : if (ndr_table_svcctl.num_calls < 38) {
30513 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2W_ndr_print");
30514 0 : return NULL;
30515 : }
30516 0 : call = &ndr_table_svcctl.calls[37];
30517 :
30518 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30519 0 : ret = PyUnicode_FromString(retstr);
30520 0 : TALLOC_FREE(retstr);
30521 :
30522 0 : return ret;
30523 : }
30524 :
30525 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30526 : {
30527 0 : return py_svcctl_ChangeServiceConfig2W_ndr_print(py_obj, "svcctl_ChangeServiceConfig2W_in", NDR_IN);
30528 : }
30529 :
30530 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30531 : {
30532 0 : return py_svcctl_ChangeServiceConfig2W_ndr_print(py_obj, "svcctl_ChangeServiceConfig2W_out", NDR_OUT);
30533 : }
30534 :
30535 : static PyMethodDef py_svcctl_ChangeServiceConfig2W_methods[] = {
30536 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfig2W_ndr_opnum, METH_NOARGS|METH_CLASS,
30537 : "svcctl.ChangeServiceConfig2W.opnum() -> 37 (0x25) " },
30538 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30539 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30540 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30541 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30542 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30543 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30544 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30545 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30546 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfig2W_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30547 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfig2W_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30548 : { NULL, NULL, 0, NULL }
30549 : };
30550 :
30551 :
30552 : static PyTypeObject svcctl_ChangeServiceConfig2W_Type = {
30553 : PyVarObject_HEAD_INIT(NULL, 0)
30554 : .tp_name = "svcctl.ChangeServiceConfig2W",
30555 : .tp_getset = py_svcctl_ChangeServiceConfig2W_getsetters,
30556 : .tp_methods = py_svcctl_ChangeServiceConfig2W_methods,
30557 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30558 : .tp_new = py_svcctl_ChangeServiceConfig2W_new,
30559 : };
30560 :
30561 0 : static bool pack_py_svcctl_ChangeServiceConfig2W_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfig2W *r)
30562 : {
30563 0 : PyObject *py_handle;
30564 0 : PyObject *py_info_level;
30565 0 : PyObject *py_info;
30566 0 : const char *kwnames[] = {
30567 : "handle", "info_level", "info", NULL
30568 : };
30569 :
30570 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_ChangeServiceConfig2W", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_info)) {
30571 0 : return false;
30572 : }
30573 :
30574 0 : if (py_handle == NULL) {
30575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
30576 0 : return false;
30577 : }
30578 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30579 0 : if (r->in.handle == NULL) {
30580 0 : PyErr_NoMemory();
30581 0 : return false;
30582 : }
30583 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30584 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30585 0 : PyErr_NoMemory();
30586 0 : return false;
30587 : }
30588 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30589 0 : if (py_info_level == NULL) {
30590 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
30591 0 : return false;
30592 : }
30593 : {
30594 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
30595 0 : if (PyLong_Check(py_info_level)) {
30596 0 : unsigned long long test_var;
30597 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
30598 0 : if (PyErr_Occurred() != NULL) {
30599 0 : return false;
30600 : }
30601 0 : if (test_var > uint_max) {
30602 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30603 : PyLong_Type.tp_name, uint_max, test_var);
30604 0 : return false;
30605 : }
30606 0 : r->in.info_level = test_var;
30607 : } else {
30608 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30609 : PyLong_Type.tp_name);
30610 0 : return false;
30611 : }
30612 : }
30613 0 : if (py_info == NULL) {
30614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
30615 0 : return false;
30616 : }
30617 0 : if (py_info == Py_None) {
30618 0 : r->in.info = NULL;
30619 : } else {
30620 0 : r->in.info = talloc_ptrtype(r, r->in.info);
30621 0 : if (r->in.info == NULL) {
30622 0 : PyErr_NoMemory();
30623 0 : return false;
30624 : }
30625 : {
30626 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.info));
30627 0 : if (PyLong_Check(py_info)) {
30628 0 : unsigned long long test_var;
30629 0 : test_var = PyLong_AsUnsignedLongLong(py_info);
30630 0 : if (PyErr_Occurred() != NULL) {
30631 0 : return false;
30632 : }
30633 0 : if (test_var > uint_max) {
30634 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30635 : PyLong_Type.tp_name, uint_max, test_var);
30636 0 : return false;
30637 : }
30638 0 : *r->in.info = test_var;
30639 : } else {
30640 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30641 : PyLong_Type.tp_name);
30642 0 : return false;
30643 : }
30644 : }
30645 : }
30646 0 : return true;
30647 : }
30648 :
30649 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfig2W_args_out(struct svcctl_ChangeServiceConfig2W *r)
30650 : {
30651 0 : PyObject *result;
30652 0 : result = Py_None;
30653 0 : Py_INCREF(result);
30654 0 : if (!W_ERROR_IS_OK(r->out.result)) {
30655 0 : PyErr_SetWERROR(r->out.result);
30656 0 : return NULL;
30657 : }
30658 :
30659 0 : return result;
30660 : }
30661 :
30662 :
30663 0 : static PyObject *py_svcctl_QueryServiceConfig2A_in_get_handle(PyObject *obj, void *closure)
30664 : {
30665 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
30666 0 : PyObject *py_handle;
30667 0 : if (object->in.handle == NULL) {
30668 0 : Py_RETURN_NONE;
30669 : }
30670 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30671 0 : return py_handle;
30672 : }
30673 :
30674 0 : static int py_svcctl_QueryServiceConfig2A_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30675 : {
30676 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
30677 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30678 0 : if (value == NULL) {
30679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
30680 0 : return -1;
30681 : }
30682 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30683 0 : if (object->in.handle == NULL) {
30684 0 : PyErr_NoMemory();
30685 0 : return -1;
30686 : }
30687 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30688 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30689 0 : PyErr_NoMemory();
30690 0 : return -1;
30691 : }
30692 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30693 0 : return 0;
30694 : }
30695 :
30696 0 : static PyObject *py_svcctl_QueryServiceConfig2A_in_get_info_level(PyObject *obj, void *closure)
30697 : {
30698 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
30699 0 : PyObject *py_info_level;
30700 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
30701 0 : return py_info_level;
30702 : }
30703 :
30704 0 : static int py_svcctl_QueryServiceConfig2A_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
30705 : {
30706 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
30707 0 : if (value == NULL) {
30708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
30709 0 : return -1;
30710 : }
30711 : {
30712 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
30713 0 : if (PyLong_Check(value)) {
30714 0 : unsigned long long test_var;
30715 0 : test_var = PyLong_AsUnsignedLongLong(value);
30716 0 : if (PyErr_Occurred() != NULL) {
30717 0 : return -1;
30718 : }
30719 0 : if (test_var > uint_max) {
30720 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30721 : PyLong_Type.tp_name, uint_max, test_var);
30722 0 : return -1;
30723 : }
30724 0 : object->in.info_level = test_var;
30725 : } else {
30726 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30727 : PyLong_Type.tp_name);
30728 0 : return -1;
30729 : }
30730 : }
30731 0 : return 0;
30732 : }
30733 :
30734 0 : static PyObject *py_svcctl_QueryServiceConfig2A_out_get_buffer(PyObject *obj, void *closure)
30735 : {
30736 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
30737 0 : PyObject *py_buffer;
30738 0 : py_buffer = PyList_New(object->in.offered);
30739 0 : if (py_buffer == NULL) {
30740 0 : return NULL;
30741 : }
30742 : {
30743 : int buffer_cntr_0;
30744 0 : for (buffer_cntr_0 = 0; buffer_cntr_0 < (object->in.offered); buffer_cntr_0++) {
30745 0 : PyObject *py_buffer_0;
30746 0 : py_buffer_0 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_0]);
30747 0 : PyList_SetItem(py_buffer, buffer_cntr_0, py_buffer_0);
30748 : }
30749 : }
30750 0 : return py_buffer;
30751 : }
30752 :
30753 0 : static int py_svcctl_QueryServiceConfig2A_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
30754 : {
30755 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
30756 0 : if (value == NULL) {
30757 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
30758 0 : return -1;
30759 : }
30760 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
30761 : {
30762 0 : int buffer_cntr_0;
30763 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
30764 0 : if (!object->out.buffer) { return -1; }
30765 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
30766 0 : for (buffer_cntr_0 = 0; buffer_cntr_0 < PyList_GET_SIZE(value); buffer_cntr_0++) {
30767 0 : if (PyList_GET_ITEM(value, buffer_cntr_0) == NULL) {
30768 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_0]");
30769 0 : return -1;
30770 : }
30771 : {
30772 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_0]));
30773 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_0))) {
30774 0 : unsigned long long test_var;
30775 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_0));
30776 0 : if (PyErr_Occurred() != NULL) {
30777 0 : return -1;
30778 : }
30779 0 : if (test_var > uint_max) {
30780 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30781 : PyLong_Type.tp_name, uint_max, test_var);
30782 0 : return -1;
30783 : }
30784 0 : object->out.buffer[buffer_cntr_0] = test_var;
30785 : } else {
30786 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30787 : PyLong_Type.tp_name);
30788 0 : return -1;
30789 : }
30790 : }
30791 : }
30792 : }
30793 0 : return 0;
30794 : }
30795 :
30796 0 : static PyObject *py_svcctl_QueryServiceConfig2A_in_get_offered(PyObject *obj, void *closure)
30797 : {
30798 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
30799 0 : PyObject *py_offered;
30800 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
30801 0 : return py_offered;
30802 : }
30803 :
30804 0 : static int py_svcctl_QueryServiceConfig2A_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
30805 : {
30806 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
30807 0 : if (value == NULL) {
30808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
30809 0 : return -1;
30810 : }
30811 : {
30812 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
30813 0 : if (PyLong_Check(value)) {
30814 0 : unsigned long long test_var;
30815 0 : test_var = PyLong_AsUnsignedLongLong(value);
30816 0 : if (PyErr_Occurred() != NULL) {
30817 0 : return -1;
30818 : }
30819 0 : if (test_var > uint_max) {
30820 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30821 : PyLong_Type.tp_name, uint_max, test_var);
30822 0 : return -1;
30823 : }
30824 0 : object->in.offered = test_var;
30825 : } else {
30826 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30827 : PyLong_Type.tp_name);
30828 0 : return -1;
30829 : }
30830 : }
30831 0 : return 0;
30832 : }
30833 :
30834 0 : static PyObject *py_svcctl_QueryServiceConfig2A_out_get_needed(PyObject *obj, void *closure)
30835 : {
30836 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
30837 0 : PyObject *py_needed;
30838 0 : if (object->out.needed == NULL) {
30839 0 : Py_RETURN_NONE;
30840 : }
30841 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
30842 0 : return py_needed;
30843 : }
30844 :
30845 0 : static int py_svcctl_QueryServiceConfig2A_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
30846 : {
30847 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
30848 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
30849 0 : if (value == NULL) {
30850 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
30851 0 : return -1;
30852 : }
30853 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
30854 0 : if (object->out.needed == NULL) {
30855 0 : PyErr_NoMemory();
30856 0 : return -1;
30857 : }
30858 : {
30859 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
30860 0 : if (PyLong_Check(value)) {
30861 0 : unsigned long long test_var;
30862 0 : test_var = PyLong_AsUnsignedLongLong(value);
30863 0 : if (PyErr_Occurred() != NULL) {
30864 0 : return -1;
30865 : }
30866 0 : if (test_var > uint_max) {
30867 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30868 : PyLong_Type.tp_name, uint_max, test_var);
30869 0 : return -1;
30870 : }
30871 0 : *object->out.needed = test_var;
30872 : } else {
30873 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30874 : PyLong_Type.tp_name);
30875 0 : return -1;
30876 : }
30877 : }
30878 0 : return 0;
30879 : }
30880 :
30881 0 : static PyObject *py_svcctl_QueryServiceConfig2A_get_result(PyObject *obj, void *closure)
30882 : {
30883 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
30884 0 : PyObject *py_result;
30885 0 : py_result = PyErr_FromWERROR(object->out.result);
30886 0 : return py_result;
30887 : }
30888 :
30889 0 : static int py_svcctl_QueryServiceConfig2A_set_result(PyObject *py_obj, PyObject *value, void *closure)
30890 : {
30891 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
30892 0 : if (value == NULL) {
30893 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30894 0 : return -1;
30895 : }
30896 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
30897 0 : return 0;
30898 : }
30899 :
30900 : static PyGetSetDef py_svcctl_QueryServiceConfig2A_getsetters[] = {
30901 : {
30902 : .name = discard_const_p(char, "in_handle"),
30903 : .get = py_svcctl_QueryServiceConfig2A_in_get_handle,
30904 : .set = py_svcctl_QueryServiceConfig2A_in_set_handle,
30905 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30906 : },
30907 : {
30908 : .name = discard_const_p(char, "in_info_level"),
30909 : .get = py_svcctl_QueryServiceConfig2A_in_get_info_level,
30910 : .set = py_svcctl_QueryServiceConfig2A_in_set_info_level,
30911 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ConfigLevel")
30912 : },
30913 : {
30914 : .name = discard_const_p(char, "out_buffer"),
30915 : .get = py_svcctl_QueryServiceConfig2A_out_get_buffer,
30916 : .set = py_svcctl_QueryServiceConfig2A_out_set_buffer,
30917 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
30918 : },
30919 : {
30920 : .name = discard_const_p(char, "in_offered"),
30921 : .get = py_svcctl_QueryServiceConfig2A_in_get_offered,
30922 : .set = py_svcctl_QueryServiceConfig2A_in_set_offered,
30923 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30924 : },
30925 : {
30926 : .name = discard_const_p(char, "out_needed"),
30927 : .get = py_svcctl_QueryServiceConfig2A_out_get_needed,
30928 : .set = py_svcctl_QueryServiceConfig2A_out_set_needed,
30929 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30930 : },
30931 : {
30932 : .name = discard_const_p(char, "result"),
30933 : .get = py_svcctl_QueryServiceConfig2A_get_result,
30934 : .set = py_svcctl_QueryServiceConfig2A_set_result,
30935 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
30936 : },
30937 : { .name = NULL }
30938 : };
30939 :
30940 0 : static PyObject *py_svcctl_QueryServiceConfig2A_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30941 : {
30942 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfig2A, type);
30943 0 : struct svcctl_QueryServiceConfig2A *_self = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(self);
30944 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30945 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30946 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
30947 0 : return self;
30948 : }
30949 :
30950 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30951 : {
30952 :
30953 :
30954 0 : return PyLong_FromLong(38);
30955 : }
30956 :
30957 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30958 : {
30959 0 : const struct ndr_interface_call *call = NULL;
30960 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
30961 0 : PyObject *ret = NULL;
30962 0 : struct ndr_push *push = NULL;
30963 0 : DATA_BLOB blob;
30964 0 : enum ndr_err_code err;
30965 :
30966 0 : if (ndr_table_svcctl.num_calls < 39) {
30967 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2A_ndr_pack");
30968 0 : return NULL;
30969 : }
30970 0 : call = &ndr_table_svcctl.calls[38];
30971 :
30972 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30973 0 : if (push == NULL) {
30974 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30975 0 : return NULL;
30976 : }
30977 :
30978 0 : push->flags |= ndr_push_flags;
30979 :
30980 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30981 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30982 0 : TALLOC_FREE(push);
30983 0 : PyErr_SetNdrError(err);
30984 0 : return NULL;
30985 : }
30986 0 : blob = ndr_push_blob(push);
30987 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30988 0 : TALLOC_FREE(push);
30989 0 : return ret;
30990 : }
30991 :
30992 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30993 : {
30994 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30995 0 : PyObject *bigendian_obj = NULL;
30996 0 : PyObject *ndr64_obj = NULL;
30997 0 : libndr_flags ndr_push_flags = 0;
30998 :
30999 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31000 : discard_const_p(char *, kwnames),
31001 : &bigendian_obj,
31002 : &ndr64_obj)) {
31003 0 : return NULL;
31004 : }
31005 :
31006 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31007 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31008 : }
31009 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31010 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31011 : }
31012 :
31013 0 : return py_svcctl_QueryServiceConfig2A_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31014 : }
31015 :
31016 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31017 : {
31018 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31019 0 : PyObject *bigendian_obj = NULL;
31020 0 : PyObject *ndr64_obj = NULL;
31021 0 : libndr_flags ndr_push_flags = 0;
31022 :
31023 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31024 : discard_const_p(char *, kwnames),
31025 : &bigendian_obj,
31026 : &ndr64_obj)) {
31027 0 : return NULL;
31028 : }
31029 :
31030 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31031 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31032 : }
31033 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31034 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31035 : }
31036 :
31037 0 : return py_svcctl_QueryServiceConfig2A_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31038 : }
31039 :
31040 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
31041 : {
31042 0 : const struct ndr_interface_call *call = NULL;
31043 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
31044 0 : struct ndr_pull *pull = NULL;
31045 0 : enum ndr_err_code err;
31046 :
31047 0 : if (ndr_table_svcctl.num_calls < 39) {
31048 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2A_ndr_unpack");
31049 0 : return NULL;
31050 : }
31051 0 : call = &ndr_table_svcctl.calls[38];
31052 :
31053 0 : pull = ndr_pull_init_blob(blob, object);
31054 0 : if (pull == NULL) {
31055 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31056 0 : return NULL;
31057 : }
31058 :
31059 0 : pull->flags |= ndr_pull_flags;
31060 :
31061 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31062 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31063 0 : TALLOC_FREE(pull);
31064 0 : PyErr_SetNdrError(err);
31065 0 : return NULL;
31066 : }
31067 0 : if (!allow_remaining) {
31068 0 : uint32_t highest_ofs;
31069 :
31070 0 : if (pull->offset > pull->relative_highest_offset) {
31071 0 : highest_ofs = pull->offset;
31072 : } else {
31073 0 : highest_ofs = pull->relative_highest_offset;
31074 : }
31075 0 : if (highest_ofs < pull->data_size) {
31076 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31077 : "not all bytes consumed ofs[%u] size[%u]",
31078 : highest_ofs, pull->data_size);
31079 0 : TALLOC_FREE(pull);
31080 0 : PyErr_SetNdrError(err);
31081 0 : return NULL;
31082 : }
31083 : }
31084 :
31085 0 : TALLOC_FREE(pull);
31086 0 : Py_RETURN_NONE;
31087 : }
31088 :
31089 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31090 : {
31091 0 : DATA_BLOB blob;
31092 0 : Py_ssize_t blob_length = 0;
31093 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31094 0 : PyObject *bigendian_obj = NULL;
31095 0 : PyObject *ndr64_obj = NULL;
31096 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31097 0 : PyObject *allow_remaining_obj = NULL;
31098 0 : bool allow_remaining = false;
31099 :
31100 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31101 : discard_const_p(char *, kwnames),
31102 : &blob.data, &blob_length,
31103 : &bigendian_obj,
31104 : &ndr64_obj,
31105 : &allow_remaining_obj)) {
31106 0 : return NULL;
31107 : }
31108 0 : blob.length = blob_length;
31109 :
31110 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31111 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31112 : }
31113 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31114 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31115 : }
31116 :
31117 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31118 0 : allow_remaining = true;
31119 : }
31120 :
31121 0 : return py_svcctl_QueryServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31122 : }
31123 :
31124 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31125 : {
31126 0 : DATA_BLOB blob;
31127 0 : Py_ssize_t blob_length = 0;
31128 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31129 0 : PyObject *bigendian_obj = NULL;
31130 0 : PyObject *ndr64_obj = NULL;
31131 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31132 0 : PyObject *allow_remaining_obj = NULL;
31133 0 : bool allow_remaining = false;
31134 :
31135 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31136 : discard_const_p(char *, kwnames),
31137 : &blob.data, &blob_length,
31138 : &bigendian_obj,
31139 : &ndr64_obj,
31140 : &allow_remaining_obj)) {
31141 0 : return NULL;
31142 : }
31143 0 : blob.length = blob_length;
31144 :
31145 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31146 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31147 : }
31148 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31149 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31150 : }
31151 :
31152 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31153 0 : allow_remaining = true;
31154 : }
31155 :
31156 0 : return py_svcctl_QueryServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31157 : }
31158 :
31159 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
31160 : {
31161 0 : const struct ndr_interface_call *call = NULL;
31162 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
31163 0 : PyObject *ret;
31164 0 : char *retstr;
31165 :
31166 0 : if (ndr_table_svcctl.num_calls < 39) {
31167 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2A_ndr_print");
31168 0 : return NULL;
31169 : }
31170 0 : call = &ndr_table_svcctl.calls[38];
31171 :
31172 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31173 0 : ret = PyUnicode_FromString(retstr);
31174 0 : TALLOC_FREE(retstr);
31175 :
31176 0 : return ret;
31177 : }
31178 :
31179 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31180 : {
31181 0 : return py_svcctl_QueryServiceConfig2A_ndr_print(py_obj, "svcctl_QueryServiceConfig2A_in", NDR_IN);
31182 : }
31183 :
31184 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31185 : {
31186 0 : return py_svcctl_QueryServiceConfig2A_ndr_print(py_obj, "svcctl_QueryServiceConfig2A_out", NDR_OUT);
31187 : }
31188 :
31189 : static PyMethodDef py_svcctl_QueryServiceConfig2A_methods[] = {
31190 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfig2A_ndr_opnum, METH_NOARGS|METH_CLASS,
31191 : "svcctl.QueryServiceConfig2A.opnum() -> 38 (0x26) " },
31192 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31193 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31194 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31195 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31196 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31197 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31198 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31199 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31200 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfig2A_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31201 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfig2A_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31202 : { NULL, NULL, 0, NULL }
31203 : };
31204 :
31205 :
31206 : static PyTypeObject svcctl_QueryServiceConfig2A_Type = {
31207 : PyVarObject_HEAD_INIT(NULL, 0)
31208 : .tp_name = "svcctl.QueryServiceConfig2A",
31209 : .tp_getset = py_svcctl_QueryServiceConfig2A_getsetters,
31210 : .tp_methods = py_svcctl_QueryServiceConfig2A_methods,
31211 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31212 : .tp_new = py_svcctl_QueryServiceConfig2A_new,
31213 : };
31214 :
31215 0 : static bool pack_py_svcctl_QueryServiceConfig2A_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfig2A *r)
31216 : {
31217 0 : PyObject *py_handle;
31218 0 : PyObject *py_info_level;
31219 0 : PyObject *py_offered;
31220 0 : const char *kwnames[] = {
31221 : "handle", "info_level", "offered", NULL
31222 : };
31223 :
31224 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceConfig2A", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_offered)) {
31225 0 : return false;
31226 : }
31227 :
31228 0 : if (py_handle == NULL) {
31229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
31230 0 : return false;
31231 : }
31232 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31233 0 : if (r->in.handle == NULL) {
31234 0 : PyErr_NoMemory();
31235 0 : return false;
31236 : }
31237 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31238 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31239 0 : PyErr_NoMemory();
31240 0 : return false;
31241 : }
31242 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31243 0 : if (py_info_level == NULL) {
31244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
31245 0 : return false;
31246 : }
31247 : {
31248 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
31249 0 : if (PyLong_Check(py_info_level)) {
31250 0 : unsigned long long test_var;
31251 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
31252 0 : if (PyErr_Occurred() != NULL) {
31253 0 : return false;
31254 : }
31255 0 : if (test_var > uint_max) {
31256 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31257 : PyLong_Type.tp_name, uint_max, test_var);
31258 0 : return false;
31259 : }
31260 0 : r->in.info_level = test_var;
31261 : } else {
31262 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31263 : PyLong_Type.tp_name);
31264 0 : return false;
31265 : }
31266 : }
31267 0 : if (py_offered == NULL) {
31268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
31269 0 : return false;
31270 : }
31271 : {
31272 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
31273 0 : if (PyLong_Check(py_offered)) {
31274 0 : unsigned long long test_var;
31275 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
31276 0 : if (PyErr_Occurred() != NULL) {
31277 0 : return false;
31278 : }
31279 0 : if (test_var > uint_max) {
31280 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31281 : PyLong_Type.tp_name, uint_max, test_var);
31282 0 : return false;
31283 : }
31284 0 : r->in.offered = test_var;
31285 : } else {
31286 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31287 : PyLong_Type.tp_name);
31288 0 : return false;
31289 : }
31290 : }
31291 0 : return true;
31292 : }
31293 :
31294 0 : static PyObject *unpack_py_svcctl_QueryServiceConfig2A_args_out(struct svcctl_QueryServiceConfig2A *r)
31295 : {
31296 0 : PyObject *result;
31297 0 : PyObject *py_buffer;
31298 0 : PyObject *py_needed;
31299 0 : result = PyTuple_New(2);
31300 0 : py_buffer = PyList_New(r->in.offered);
31301 0 : if (py_buffer == NULL) {
31302 0 : return NULL;
31303 : }
31304 : {
31305 : int buffer_cntr_0;
31306 0 : for (buffer_cntr_0 = 0; buffer_cntr_0 < (r->in.offered); buffer_cntr_0++) {
31307 0 : PyObject *py_buffer_0;
31308 0 : py_buffer_0 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_0]);
31309 0 : PyList_SetItem(py_buffer, buffer_cntr_0, py_buffer_0);
31310 : }
31311 : }
31312 0 : PyTuple_SetItem(result, 0, py_buffer);
31313 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
31314 0 : PyTuple_SetItem(result, 1, py_needed);
31315 0 : if (!W_ERROR_IS_OK(r->out.result)) {
31316 0 : PyErr_SetWERROR(r->out.result);
31317 0 : return NULL;
31318 : }
31319 :
31320 0 : return result;
31321 : }
31322 :
31323 :
31324 0 : static PyObject *py_svcctl_QueryServiceConfig2W_in_get_handle(PyObject *obj, void *closure)
31325 : {
31326 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
31327 0 : PyObject *py_handle;
31328 0 : if (object->in.handle == NULL) {
31329 0 : Py_RETURN_NONE;
31330 : }
31331 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
31332 0 : return py_handle;
31333 : }
31334 :
31335 0 : static int py_svcctl_QueryServiceConfig2W_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
31336 : {
31337 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31338 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
31339 0 : if (value == NULL) {
31340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
31341 0 : return -1;
31342 : }
31343 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
31344 0 : if (object->in.handle == NULL) {
31345 0 : PyErr_NoMemory();
31346 0 : return -1;
31347 : }
31348 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31349 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31350 0 : PyErr_NoMemory();
31351 0 : return -1;
31352 : }
31353 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
31354 0 : return 0;
31355 : }
31356 :
31357 0 : static PyObject *py_svcctl_QueryServiceConfig2W_in_get_info_level(PyObject *obj, void *closure)
31358 : {
31359 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
31360 0 : PyObject *py_info_level;
31361 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
31362 0 : return py_info_level;
31363 : }
31364 :
31365 0 : static int py_svcctl_QueryServiceConfig2W_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
31366 : {
31367 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31368 0 : if (value == NULL) {
31369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
31370 0 : return -1;
31371 : }
31372 : {
31373 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
31374 0 : if (PyLong_Check(value)) {
31375 0 : unsigned long long test_var;
31376 0 : test_var = PyLong_AsUnsignedLongLong(value);
31377 0 : if (PyErr_Occurred() != NULL) {
31378 0 : return -1;
31379 : }
31380 0 : if (test_var > uint_max) {
31381 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31382 : PyLong_Type.tp_name, uint_max, test_var);
31383 0 : return -1;
31384 : }
31385 0 : object->in.info_level = test_var;
31386 : } else {
31387 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31388 : PyLong_Type.tp_name);
31389 0 : return -1;
31390 : }
31391 : }
31392 0 : return 0;
31393 : }
31394 :
31395 0 : static PyObject *py_svcctl_QueryServiceConfig2W_out_get_buffer(PyObject *obj, void *closure)
31396 : {
31397 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
31398 0 : PyObject *py_buffer;
31399 0 : if (object->out.buffer == NULL) {
31400 0 : Py_RETURN_NONE;
31401 : }
31402 0 : py_buffer = PyList_New(object->in.offered);
31403 0 : if (py_buffer == NULL) {
31404 0 : return NULL;
31405 : }
31406 : {
31407 : int buffer_cntr_1;
31408 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
31409 0 : PyObject *py_buffer_1;
31410 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_1]);
31411 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
31412 : }
31413 : }
31414 0 : return py_buffer;
31415 : }
31416 :
31417 0 : static int py_svcctl_QueryServiceConfig2W_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
31418 : {
31419 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31420 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
31421 0 : if (value == NULL) {
31422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
31423 0 : return -1;
31424 : }
31425 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
31426 0 : if (object->out.buffer == NULL) {
31427 0 : PyErr_NoMemory();
31428 0 : return -1;
31429 : }
31430 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
31431 : {
31432 0 : int buffer_cntr_1;
31433 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
31434 0 : if (!object->out.buffer) { return -1; }
31435 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
31436 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
31437 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
31438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_1]");
31439 0 : return -1;
31440 : }
31441 : {
31442 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_1]));
31443 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
31444 0 : unsigned long long test_var;
31445 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
31446 0 : if (PyErr_Occurred() != NULL) {
31447 0 : return -1;
31448 : }
31449 0 : if (test_var > uint_max) {
31450 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31451 : PyLong_Type.tp_name, uint_max, test_var);
31452 0 : return -1;
31453 : }
31454 0 : object->out.buffer[buffer_cntr_1] = test_var;
31455 : } else {
31456 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31457 : PyLong_Type.tp_name);
31458 0 : return -1;
31459 : }
31460 : }
31461 : }
31462 : }
31463 0 : return 0;
31464 : }
31465 :
31466 0 : static PyObject *py_svcctl_QueryServiceConfig2W_in_get_offered(PyObject *obj, void *closure)
31467 : {
31468 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
31469 0 : PyObject *py_offered;
31470 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
31471 0 : return py_offered;
31472 : }
31473 :
31474 0 : static int py_svcctl_QueryServiceConfig2W_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
31475 : {
31476 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31477 0 : if (value == NULL) {
31478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
31479 0 : return -1;
31480 : }
31481 : {
31482 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
31483 0 : if (PyLong_Check(value)) {
31484 0 : unsigned long long test_var;
31485 0 : test_var = PyLong_AsUnsignedLongLong(value);
31486 0 : if (PyErr_Occurred() != NULL) {
31487 0 : return -1;
31488 : }
31489 0 : if (test_var > uint_max) {
31490 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31491 : PyLong_Type.tp_name, uint_max, test_var);
31492 0 : return -1;
31493 : }
31494 0 : object->in.offered = test_var;
31495 : } else {
31496 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31497 : PyLong_Type.tp_name);
31498 0 : return -1;
31499 : }
31500 : }
31501 0 : return 0;
31502 : }
31503 :
31504 0 : static PyObject *py_svcctl_QueryServiceConfig2W_out_get_needed(PyObject *obj, void *closure)
31505 : {
31506 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
31507 0 : PyObject *py_needed;
31508 0 : if (object->out.needed == NULL) {
31509 0 : Py_RETURN_NONE;
31510 : }
31511 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
31512 0 : return py_needed;
31513 : }
31514 :
31515 0 : static int py_svcctl_QueryServiceConfig2W_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
31516 : {
31517 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31518 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
31519 0 : if (value == NULL) {
31520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
31521 0 : return -1;
31522 : }
31523 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
31524 0 : if (object->out.needed == NULL) {
31525 0 : PyErr_NoMemory();
31526 0 : return -1;
31527 : }
31528 : {
31529 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
31530 0 : if (PyLong_Check(value)) {
31531 0 : unsigned long long test_var;
31532 0 : test_var = PyLong_AsUnsignedLongLong(value);
31533 0 : if (PyErr_Occurred() != NULL) {
31534 0 : return -1;
31535 : }
31536 0 : if (test_var > uint_max) {
31537 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31538 : PyLong_Type.tp_name, uint_max, test_var);
31539 0 : return -1;
31540 : }
31541 0 : *object->out.needed = test_var;
31542 : } else {
31543 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31544 : PyLong_Type.tp_name);
31545 0 : return -1;
31546 : }
31547 : }
31548 0 : return 0;
31549 : }
31550 :
31551 0 : static PyObject *py_svcctl_QueryServiceConfig2W_get_result(PyObject *obj, void *closure)
31552 : {
31553 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
31554 0 : PyObject *py_result;
31555 0 : py_result = PyErr_FromWERROR(object->out.result);
31556 0 : return py_result;
31557 : }
31558 :
31559 0 : static int py_svcctl_QueryServiceConfig2W_set_result(PyObject *py_obj, PyObject *value, void *closure)
31560 : {
31561 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31562 0 : if (value == NULL) {
31563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31564 0 : return -1;
31565 : }
31566 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
31567 0 : return 0;
31568 : }
31569 :
31570 : static PyGetSetDef py_svcctl_QueryServiceConfig2W_getsetters[] = {
31571 : {
31572 : .name = discard_const_p(char, "in_handle"),
31573 : .get = py_svcctl_QueryServiceConfig2W_in_get_handle,
31574 : .set = py_svcctl_QueryServiceConfig2W_in_set_handle,
31575 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31576 : },
31577 : {
31578 : .name = discard_const_p(char, "in_info_level"),
31579 : .get = py_svcctl_QueryServiceConfig2W_in_get_info_level,
31580 : .set = py_svcctl_QueryServiceConfig2W_in_set_info_level,
31581 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ConfigLevel")
31582 : },
31583 : {
31584 : .name = discard_const_p(char, "out_buffer"),
31585 : .get = py_svcctl_QueryServiceConfig2W_out_get_buffer,
31586 : .set = py_svcctl_QueryServiceConfig2W_out_set_buffer,
31587 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
31588 : },
31589 : {
31590 : .name = discard_const_p(char, "in_offered"),
31591 : .get = py_svcctl_QueryServiceConfig2W_in_get_offered,
31592 : .set = py_svcctl_QueryServiceConfig2W_in_set_offered,
31593 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
31594 : },
31595 : {
31596 : .name = discard_const_p(char, "out_needed"),
31597 : .get = py_svcctl_QueryServiceConfig2W_out_get_needed,
31598 : .set = py_svcctl_QueryServiceConfig2W_out_set_needed,
31599 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
31600 : },
31601 : {
31602 : .name = discard_const_p(char, "result"),
31603 : .get = py_svcctl_QueryServiceConfig2W_get_result,
31604 : .set = py_svcctl_QueryServiceConfig2W_set_result,
31605 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
31606 : },
31607 : { .name = NULL }
31608 : };
31609 :
31610 0 : static PyObject *py_svcctl_QueryServiceConfig2W_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31611 : {
31612 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfig2W, type);
31613 0 : struct svcctl_QueryServiceConfig2W *_self = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(self);
31614 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31615 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
31616 0 : _self->out.buffer = talloc_zero(mem_ctx, uint8_t);
31617 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
31618 0 : return self;
31619 : }
31620 :
31621 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31622 : {
31623 :
31624 :
31625 0 : return PyLong_FromLong(39);
31626 : }
31627 :
31628 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
31629 : {
31630 0 : const struct ndr_interface_call *call = NULL;
31631 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31632 0 : PyObject *ret = NULL;
31633 0 : struct ndr_push *push = NULL;
31634 0 : DATA_BLOB blob;
31635 0 : enum ndr_err_code err;
31636 :
31637 0 : if (ndr_table_svcctl.num_calls < 40) {
31638 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2W_ndr_pack");
31639 0 : return NULL;
31640 : }
31641 0 : call = &ndr_table_svcctl.calls[39];
31642 :
31643 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31644 0 : if (push == NULL) {
31645 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31646 0 : return NULL;
31647 : }
31648 :
31649 0 : push->flags |= ndr_push_flags;
31650 :
31651 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31652 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31653 0 : TALLOC_FREE(push);
31654 0 : PyErr_SetNdrError(err);
31655 0 : return NULL;
31656 : }
31657 0 : blob = ndr_push_blob(push);
31658 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31659 0 : TALLOC_FREE(push);
31660 0 : return ret;
31661 : }
31662 :
31663 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31664 : {
31665 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31666 0 : PyObject *bigendian_obj = NULL;
31667 0 : PyObject *ndr64_obj = NULL;
31668 0 : libndr_flags ndr_push_flags = 0;
31669 :
31670 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31671 : discard_const_p(char *, kwnames),
31672 : &bigendian_obj,
31673 : &ndr64_obj)) {
31674 0 : return NULL;
31675 : }
31676 :
31677 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31678 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31679 : }
31680 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31681 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31682 : }
31683 :
31684 0 : return py_svcctl_QueryServiceConfig2W_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31685 : }
31686 :
31687 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31688 : {
31689 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31690 0 : PyObject *bigendian_obj = NULL;
31691 0 : PyObject *ndr64_obj = NULL;
31692 0 : libndr_flags ndr_push_flags = 0;
31693 :
31694 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31695 : discard_const_p(char *, kwnames),
31696 : &bigendian_obj,
31697 : &ndr64_obj)) {
31698 0 : return NULL;
31699 : }
31700 :
31701 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31702 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31703 : }
31704 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31705 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31706 : }
31707 :
31708 0 : return py_svcctl_QueryServiceConfig2W_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31709 : }
31710 :
31711 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
31712 : {
31713 0 : const struct ndr_interface_call *call = NULL;
31714 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31715 0 : struct ndr_pull *pull = NULL;
31716 0 : enum ndr_err_code err;
31717 :
31718 0 : if (ndr_table_svcctl.num_calls < 40) {
31719 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2W_ndr_unpack");
31720 0 : return NULL;
31721 : }
31722 0 : call = &ndr_table_svcctl.calls[39];
31723 :
31724 0 : pull = ndr_pull_init_blob(blob, object);
31725 0 : if (pull == NULL) {
31726 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31727 0 : return NULL;
31728 : }
31729 :
31730 0 : pull->flags |= ndr_pull_flags;
31731 :
31732 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31733 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31734 0 : TALLOC_FREE(pull);
31735 0 : PyErr_SetNdrError(err);
31736 0 : return NULL;
31737 : }
31738 0 : if (!allow_remaining) {
31739 0 : uint32_t highest_ofs;
31740 :
31741 0 : if (pull->offset > pull->relative_highest_offset) {
31742 0 : highest_ofs = pull->offset;
31743 : } else {
31744 0 : highest_ofs = pull->relative_highest_offset;
31745 : }
31746 0 : if (highest_ofs < pull->data_size) {
31747 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31748 : "not all bytes consumed ofs[%u] size[%u]",
31749 : highest_ofs, pull->data_size);
31750 0 : TALLOC_FREE(pull);
31751 0 : PyErr_SetNdrError(err);
31752 0 : return NULL;
31753 : }
31754 : }
31755 :
31756 0 : TALLOC_FREE(pull);
31757 0 : Py_RETURN_NONE;
31758 : }
31759 :
31760 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31761 : {
31762 0 : DATA_BLOB blob;
31763 0 : Py_ssize_t blob_length = 0;
31764 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31765 0 : PyObject *bigendian_obj = NULL;
31766 0 : PyObject *ndr64_obj = NULL;
31767 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31768 0 : PyObject *allow_remaining_obj = NULL;
31769 0 : bool allow_remaining = false;
31770 :
31771 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31772 : discard_const_p(char *, kwnames),
31773 : &blob.data, &blob_length,
31774 : &bigendian_obj,
31775 : &ndr64_obj,
31776 : &allow_remaining_obj)) {
31777 0 : return NULL;
31778 : }
31779 0 : blob.length = blob_length;
31780 :
31781 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31782 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31783 : }
31784 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31785 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31786 : }
31787 :
31788 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31789 0 : allow_remaining = true;
31790 : }
31791 :
31792 0 : return py_svcctl_QueryServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31793 : }
31794 :
31795 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31796 : {
31797 0 : DATA_BLOB blob;
31798 0 : Py_ssize_t blob_length = 0;
31799 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31800 0 : PyObject *bigendian_obj = NULL;
31801 0 : PyObject *ndr64_obj = NULL;
31802 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31803 0 : PyObject *allow_remaining_obj = NULL;
31804 0 : bool allow_remaining = false;
31805 :
31806 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31807 : discard_const_p(char *, kwnames),
31808 : &blob.data, &blob_length,
31809 : &bigendian_obj,
31810 : &ndr64_obj,
31811 : &allow_remaining_obj)) {
31812 0 : return NULL;
31813 : }
31814 0 : blob.length = blob_length;
31815 :
31816 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31817 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31818 : }
31819 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31820 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31821 : }
31822 :
31823 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31824 0 : allow_remaining = true;
31825 : }
31826 :
31827 0 : return py_svcctl_QueryServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31828 : }
31829 :
31830 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
31831 : {
31832 0 : const struct ndr_interface_call *call = NULL;
31833 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
31834 0 : PyObject *ret;
31835 0 : char *retstr;
31836 :
31837 0 : if (ndr_table_svcctl.num_calls < 40) {
31838 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2W_ndr_print");
31839 0 : return NULL;
31840 : }
31841 0 : call = &ndr_table_svcctl.calls[39];
31842 :
31843 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31844 0 : ret = PyUnicode_FromString(retstr);
31845 0 : TALLOC_FREE(retstr);
31846 :
31847 0 : return ret;
31848 : }
31849 :
31850 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31851 : {
31852 0 : return py_svcctl_QueryServiceConfig2W_ndr_print(py_obj, "svcctl_QueryServiceConfig2W_in", NDR_IN);
31853 : }
31854 :
31855 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31856 : {
31857 0 : return py_svcctl_QueryServiceConfig2W_ndr_print(py_obj, "svcctl_QueryServiceConfig2W_out", NDR_OUT);
31858 : }
31859 :
31860 : static PyMethodDef py_svcctl_QueryServiceConfig2W_methods[] = {
31861 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfig2W_ndr_opnum, METH_NOARGS|METH_CLASS,
31862 : "svcctl.QueryServiceConfig2W.opnum() -> 39 (0x27) " },
31863 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31864 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31865 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31866 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31867 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31868 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31869 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31870 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31871 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfig2W_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31872 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfig2W_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31873 : { NULL, NULL, 0, NULL }
31874 : };
31875 :
31876 :
31877 : static PyTypeObject svcctl_QueryServiceConfig2W_Type = {
31878 : PyVarObject_HEAD_INIT(NULL, 0)
31879 : .tp_name = "svcctl.QueryServiceConfig2W",
31880 : .tp_getset = py_svcctl_QueryServiceConfig2W_getsetters,
31881 : .tp_methods = py_svcctl_QueryServiceConfig2W_methods,
31882 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31883 : .tp_new = py_svcctl_QueryServiceConfig2W_new,
31884 : };
31885 :
31886 0 : static bool pack_py_svcctl_QueryServiceConfig2W_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfig2W *r)
31887 : {
31888 0 : PyObject *py_handle;
31889 0 : PyObject *py_info_level;
31890 0 : PyObject *py_offered;
31891 0 : const char *kwnames[] = {
31892 : "handle", "info_level", "offered", NULL
31893 : };
31894 :
31895 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceConfig2W", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_offered)) {
31896 0 : return false;
31897 : }
31898 :
31899 0 : if (py_handle == NULL) {
31900 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
31901 0 : return false;
31902 : }
31903 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31904 0 : if (r->in.handle == NULL) {
31905 0 : PyErr_NoMemory();
31906 0 : return false;
31907 : }
31908 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31909 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31910 0 : PyErr_NoMemory();
31911 0 : return false;
31912 : }
31913 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31914 0 : if (py_info_level == NULL) {
31915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
31916 0 : return false;
31917 : }
31918 : {
31919 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
31920 0 : if (PyLong_Check(py_info_level)) {
31921 0 : unsigned long long test_var;
31922 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
31923 0 : if (PyErr_Occurred() != NULL) {
31924 0 : return false;
31925 : }
31926 0 : if (test_var > uint_max) {
31927 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31928 : PyLong_Type.tp_name, uint_max, test_var);
31929 0 : return false;
31930 : }
31931 0 : r->in.info_level = test_var;
31932 : } else {
31933 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31934 : PyLong_Type.tp_name);
31935 0 : return false;
31936 : }
31937 : }
31938 0 : if (py_offered == NULL) {
31939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
31940 0 : return false;
31941 : }
31942 : {
31943 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
31944 0 : if (PyLong_Check(py_offered)) {
31945 0 : unsigned long long test_var;
31946 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
31947 0 : if (PyErr_Occurred() != NULL) {
31948 0 : return false;
31949 : }
31950 0 : if (test_var > uint_max) {
31951 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31952 : PyLong_Type.tp_name, uint_max, test_var);
31953 0 : return false;
31954 : }
31955 0 : r->in.offered = test_var;
31956 : } else {
31957 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31958 : PyLong_Type.tp_name);
31959 0 : return false;
31960 : }
31961 : }
31962 0 : return true;
31963 : }
31964 :
31965 0 : static PyObject *unpack_py_svcctl_QueryServiceConfig2W_args_out(struct svcctl_QueryServiceConfig2W *r)
31966 : {
31967 0 : PyObject *result;
31968 0 : PyObject *py_buffer;
31969 0 : PyObject *py_needed;
31970 0 : result = PyTuple_New(2);
31971 0 : py_buffer = PyList_New(r->in.offered);
31972 0 : if (py_buffer == NULL) {
31973 0 : return NULL;
31974 : }
31975 : {
31976 : int buffer_cntr_1;
31977 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
31978 0 : PyObject *py_buffer_1;
31979 0 : py_buffer_1 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_1]);
31980 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
31981 : }
31982 : }
31983 0 : PyTuple_SetItem(result, 0, py_buffer);
31984 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
31985 0 : PyTuple_SetItem(result, 1, py_needed);
31986 0 : if (!W_ERROR_IS_OK(r->out.result)) {
31987 0 : PyErr_SetWERROR(r->out.result);
31988 0 : return NULL;
31989 : }
31990 :
31991 0 : return result;
31992 : }
31993 :
31994 :
31995 0 : static PyObject *py_svcctl_QueryServiceStatusEx_in_get_handle(PyObject *obj, void *closure)
31996 : {
31997 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
31998 0 : PyObject *py_handle;
31999 0 : if (object->in.handle == NULL) {
32000 0 : Py_RETURN_NONE;
32001 : }
32002 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
32003 0 : return py_handle;
32004 : }
32005 :
32006 0 : static int py_svcctl_QueryServiceStatusEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
32007 : {
32008 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32009 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
32010 0 : if (value == NULL) {
32011 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
32012 0 : return -1;
32013 : }
32014 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
32015 0 : if (object->in.handle == NULL) {
32016 0 : PyErr_NoMemory();
32017 0 : return -1;
32018 : }
32019 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32020 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32021 0 : PyErr_NoMemory();
32022 0 : return -1;
32023 : }
32024 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
32025 0 : return 0;
32026 : }
32027 :
32028 0 : static PyObject *py_svcctl_QueryServiceStatusEx_in_get_info_level(PyObject *obj, void *closure)
32029 : {
32030 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
32031 0 : PyObject *py_info_level;
32032 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
32033 0 : return py_info_level;
32034 : }
32035 :
32036 0 : static int py_svcctl_QueryServiceStatusEx_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
32037 : {
32038 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32039 0 : if (value == NULL) {
32040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
32041 0 : return -1;
32042 : }
32043 : {
32044 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
32045 0 : if (PyLong_Check(value)) {
32046 0 : unsigned long long test_var;
32047 0 : test_var = PyLong_AsUnsignedLongLong(value);
32048 0 : if (PyErr_Occurred() != NULL) {
32049 0 : return -1;
32050 : }
32051 0 : if (test_var > uint_max) {
32052 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32053 : PyLong_Type.tp_name, uint_max, test_var);
32054 0 : return -1;
32055 : }
32056 0 : object->in.info_level = test_var;
32057 : } else {
32058 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32059 : PyLong_Type.tp_name);
32060 0 : return -1;
32061 : }
32062 : }
32063 0 : return 0;
32064 : }
32065 :
32066 0 : static PyObject *py_svcctl_QueryServiceStatusEx_out_get_buffer(PyObject *obj, void *closure)
32067 : {
32068 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
32069 0 : PyObject *py_buffer;
32070 0 : if (object->out.buffer == NULL) {
32071 0 : Py_RETURN_NONE;
32072 : }
32073 0 : py_buffer = PyList_New(object->in.offered);
32074 0 : if (py_buffer == NULL) {
32075 0 : return NULL;
32076 : }
32077 : {
32078 : int buffer_cntr_1;
32079 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
32080 0 : PyObject *py_buffer_1;
32081 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_1]);
32082 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
32083 : }
32084 : }
32085 0 : return py_buffer;
32086 : }
32087 :
32088 0 : static int py_svcctl_QueryServiceStatusEx_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
32089 : {
32090 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32091 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
32092 0 : if (value == NULL) {
32093 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
32094 0 : return -1;
32095 : }
32096 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
32097 0 : if (object->out.buffer == NULL) {
32098 0 : PyErr_NoMemory();
32099 0 : return -1;
32100 : }
32101 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
32102 : {
32103 0 : int buffer_cntr_1;
32104 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
32105 0 : if (!object->out.buffer) { return -1; }
32106 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
32107 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
32108 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
32109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_1]");
32110 0 : return -1;
32111 : }
32112 : {
32113 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_1]));
32114 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
32115 0 : unsigned long long test_var;
32116 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
32117 0 : if (PyErr_Occurred() != NULL) {
32118 0 : return -1;
32119 : }
32120 0 : if (test_var > uint_max) {
32121 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32122 : PyLong_Type.tp_name, uint_max, test_var);
32123 0 : return -1;
32124 : }
32125 0 : object->out.buffer[buffer_cntr_1] = test_var;
32126 : } else {
32127 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32128 : PyLong_Type.tp_name);
32129 0 : return -1;
32130 : }
32131 : }
32132 : }
32133 : }
32134 0 : return 0;
32135 : }
32136 :
32137 0 : static PyObject *py_svcctl_QueryServiceStatusEx_in_get_offered(PyObject *obj, void *closure)
32138 : {
32139 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
32140 0 : PyObject *py_offered;
32141 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
32142 0 : return py_offered;
32143 : }
32144 :
32145 0 : static int py_svcctl_QueryServiceStatusEx_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
32146 : {
32147 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32148 0 : if (value == NULL) {
32149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
32150 0 : return -1;
32151 : }
32152 : {
32153 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
32154 0 : if (PyLong_Check(value)) {
32155 0 : unsigned long long test_var;
32156 0 : test_var = PyLong_AsUnsignedLongLong(value);
32157 0 : if (PyErr_Occurred() != NULL) {
32158 0 : return -1;
32159 : }
32160 0 : if (test_var > uint_max) {
32161 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32162 : PyLong_Type.tp_name, uint_max, test_var);
32163 0 : return -1;
32164 : }
32165 0 : object->in.offered = test_var;
32166 : } else {
32167 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32168 : PyLong_Type.tp_name);
32169 0 : return -1;
32170 : }
32171 : }
32172 0 : return 0;
32173 : }
32174 :
32175 0 : static PyObject *py_svcctl_QueryServiceStatusEx_out_get_needed(PyObject *obj, void *closure)
32176 : {
32177 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
32178 0 : PyObject *py_needed;
32179 0 : if (object->out.needed == NULL) {
32180 0 : Py_RETURN_NONE;
32181 : }
32182 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
32183 0 : return py_needed;
32184 : }
32185 :
32186 0 : static int py_svcctl_QueryServiceStatusEx_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
32187 : {
32188 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32189 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
32190 0 : if (value == NULL) {
32191 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
32192 0 : return -1;
32193 : }
32194 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
32195 0 : if (object->out.needed == NULL) {
32196 0 : PyErr_NoMemory();
32197 0 : return -1;
32198 : }
32199 : {
32200 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
32201 0 : if (PyLong_Check(value)) {
32202 0 : unsigned long long test_var;
32203 0 : test_var = PyLong_AsUnsignedLongLong(value);
32204 0 : if (PyErr_Occurred() != NULL) {
32205 0 : return -1;
32206 : }
32207 0 : if (test_var > uint_max) {
32208 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32209 : PyLong_Type.tp_name, uint_max, test_var);
32210 0 : return -1;
32211 : }
32212 0 : *object->out.needed = test_var;
32213 : } else {
32214 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32215 : PyLong_Type.tp_name);
32216 0 : return -1;
32217 : }
32218 : }
32219 0 : return 0;
32220 : }
32221 :
32222 0 : static PyObject *py_svcctl_QueryServiceStatusEx_get_result(PyObject *obj, void *closure)
32223 : {
32224 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
32225 0 : PyObject *py_result;
32226 0 : py_result = PyErr_FromWERROR(object->out.result);
32227 0 : return py_result;
32228 : }
32229 :
32230 0 : static int py_svcctl_QueryServiceStatusEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
32231 : {
32232 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32233 0 : if (value == NULL) {
32234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32235 0 : return -1;
32236 : }
32237 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
32238 0 : return 0;
32239 : }
32240 :
32241 : static PyGetSetDef py_svcctl_QueryServiceStatusEx_getsetters[] = {
32242 : {
32243 : .name = discard_const_p(char, "in_handle"),
32244 : .get = py_svcctl_QueryServiceStatusEx_in_get_handle,
32245 : .set = py_svcctl_QueryServiceStatusEx_in_set_handle,
32246 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32247 : },
32248 : {
32249 : .name = discard_const_p(char, "in_info_level"),
32250 : .get = py_svcctl_QueryServiceStatusEx_in_get_info_level,
32251 : .set = py_svcctl_QueryServiceStatusEx_in_set_info_level,
32252 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StatusLevel")
32253 : },
32254 : {
32255 : .name = discard_const_p(char, "out_buffer"),
32256 : .get = py_svcctl_QueryServiceStatusEx_out_get_buffer,
32257 : .set = py_svcctl_QueryServiceStatusEx_out_set_buffer,
32258 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
32259 : },
32260 : {
32261 : .name = discard_const_p(char, "in_offered"),
32262 : .get = py_svcctl_QueryServiceStatusEx_in_get_offered,
32263 : .set = py_svcctl_QueryServiceStatusEx_in_set_offered,
32264 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
32265 : },
32266 : {
32267 : .name = discard_const_p(char, "out_needed"),
32268 : .get = py_svcctl_QueryServiceStatusEx_out_get_needed,
32269 : .set = py_svcctl_QueryServiceStatusEx_out_set_needed,
32270 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
32271 : },
32272 : {
32273 : .name = discard_const_p(char, "result"),
32274 : .get = py_svcctl_QueryServiceStatusEx_get_result,
32275 : .set = py_svcctl_QueryServiceStatusEx_set_result,
32276 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
32277 : },
32278 : { .name = NULL }
32279 : };
32280 :
32281 0 : static PyObject *py_svcctl_QueryServiceStatusEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32282 : {
32283 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceStatusEx, type);
32284 0 : struct svcctl_QueryServiceStatusEx *_self = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(self);
32285 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32286 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
32287 0 : _self->out.buffer = talloc_zero(mem_ctx, uint8_t);
32288 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
32289 0 : return self;
32290 : }
32291 :
32292 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32293 : {
32294 :
32295 :
32296 0 : return PyLong_FromLong(40);
32297 : }
32298 :
32299 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
32300 : {
32301 0 : const struct ndr_interface_call *call = NULL;
32302 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32303 0 : PyObject *ret = NULL;
32304 0 : struct ndr_push *push = NULL;
32305 0 : DATA_BLOB blob;
32306 0 : enum ndr_err_code err;
32307 :
32308 0 : if (ndr_table_svcctl.num_calls < 41) {
32309 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatusEx_ndr_pack");
32310 0 : return NULL;
32311 : }
32312 0 : call = &ndr_table_svcctl.calls[40];
32313 :
32314 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32315 0 : if (push == NULL) {
32316 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32317 0 : return NULL;
32318 : }
32319 :
32320 0 : push->flags |= ndr_push_flags;
32321 :
32322 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32323 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32324 0 : TALLOC_FREE(push);
32325 0 : PyErr_SetNdrError(err);
32326 0 : return NULL;
32327 : }
32328 0 : blob = ndr_push_blob(push);
32329 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32330 0 : TALLOC_FREE(push);
32331 0 : return ret;
32332 : }
32333 :
32334 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32335 : {
32336 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32337 0 : PyObject *bigendian_obj = NULL;
32338 0 : PyObject *ndr64_obj = NULL;
32339 0 : libndr_flags ndr_push_flags = 0;
32340 :
32341 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32342 : discard_const_p(char *, kwnames),
32343 : &bigendian_obj,
32344 : &ndr64_obj)) {
32345 0 : return NULL;
32346 : }
32347 :
32348 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32349 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32350 : }
32351 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32352 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32353 : }
32354 :
32355 0 : return py_svcctl_QueryServiceStatusEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32356 : }
32357 :
32358 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32359 : {
32360 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32361 0 : PyObject *bigendian_obj = NULL;
32362 0 : PyObject *ndr64_obj = NULL;
32363 0 : libndr_flags ndr_push_flags = 0;
32364 :
32365 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32366 : discard_const_p(char *, kwnames),
32367 : &bigendian_obj,
32368 : &ndr64_obj)) {
32369 0 : return NULL;
32370 : }
32371 :
32372 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32373 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32374 : }
32375 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32376 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32377 : }
32378 :
32379 0 : return py_svcctl_QueryServiceStatusEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32380 : }
32381 :
32382 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
32383 : {
32384 0 : const struct ndr_interface_call *call = NULL;
32385 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32386 0 : struct ndr_pull *pull = NULL;
32387 0 : enum ndr_err_code err;
32388 :
32389 0 : if (ndr_table_svcctl.num_calls < 41) {
32390 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatusEx_ndr_unpack");
32391 0 : return NULL;
32392 : }
32393 0 : call = &ndr_table_svcctl.calls[40];
32394 :
32395 0 : pull = ndr_pull_init_blob(blob, object);
32396 0 : if (pull == NULL) {
32397 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32398 0 : return NULL;
32399 : }
32400 :
32401 0 : pull->flags |= ndr_pull_flags;
32402 :
32403 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32404 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32405 0 : TALLOC_FREE(pull);
32406 0 : PyErr_SetNdrError(err);
32407 0 : return NULL;
32408 : }
32409 0 : if (!allow_remaining) {
32410 0 : uint32_t highest_ofs;
32411 :
32412 0 : if (pull->offset > pull->relative_highest_offset) {
32413 0 : highest_ofs = pull->offset;
32414 : } else {
32415 0 : highest_ofs = pull->relative_highest_offset;
32416 : }
32417 0 : if (highest_ofs < pull->data_size) {
32418 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32419 : "not all bytes consumed ofs[%u] size[%u]",
32420 : highest_ofs, pull->data_size);
32421 0 : TALLOC_FREE(pull);
32422 0 : PyErr_SetNdrError(err);
32423 0 : return NULL;
32424 : }
32425 : }
32426 :
32427 0 : TALLOC_FREE(pull);
32428 0 : Py_RETURN_NONE;
32429 : }
32430 :
32431 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32432 : {
32433 0 : DATA_BLOB blob;
32434 0 : Py_ssize_t blob_length = 0;
32435 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32436 0 : PyObject *bigendian_obj = NULL;
32437 0 : PyObject *ndr64_obj = NULL;
32438 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32439 0 : PyObject *allow_remaining_obj = NULL;
32440 0 : bool allow_remaining = false;
32441 :
32442 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32443 : discard_const_p(char *, kwnames),
32444 : &blob.data, &blob_length,
32445 : &bigendian_obj,
32446 : &ndr64_obj,
32447 : &allow_remaining_obj)) {
32448 0 : return NULL;
32449 : }
32450 0 : blob.length = blob_length;
32451 :
32452 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32453 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32454 : }
32455 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32456 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32457 : }
32458 :
32459 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32460 0 : allow_remaining = true;
32461 : }
32462 :
32463 0 : return py_svcctl_QueryServiceStatusEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32464 : }
32465 :
32466 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32467 : {
32468 0 : DATA_BLOB blob;
32469 0 : Py_ssize_t blob_length = 0;
32470 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32471 0 : PyObject *bigendian_obj = NULL;
32472 0 : PyObject *ndr64_obj = NULL;
32473 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32474 0 : PyObject *allow_remaining_obj = NULL;
32475 0 : bool allow_remaining = false;
32476 :
32477 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32478 : discard_const_p(char *, kwnames),
32479 : &blob.data, &blob_length,
32480 : &bigendian_obj,
32481 : &ndr64_obj,
32482 : &allow_remaining_obj)) {
32483 0 : return NULL;
32484 : }
32485 0 : blob.length = blob_length;
32486 :
32487 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32488 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32489 : }
32490 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32491 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32492 : }
32493 :
32494 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32495 0 : allow_remaining = true;
32496 : }
32497 :
32498 0 : return py_svcctl_QueryServiceStatusEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32499 : }
32500 :
32501 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
32502 : {
32503 0 : const struct ndr_interface_call *call = NULL;
32504 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
32505 0 : PyObject *ret;
32506 0 : char *retstr;
32507 :
32508 0 : if (ndr_table_svcctl.num_calls < 41) {
32509 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatusEx_ndr_print");
32510 0 : return NULL;
32511 : }
32512 0 : call = &ndr_table_svcctl.calls[40];
32513 :
32514 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32515 0 : ret = PyUnicode_FromString(retstr);
32516 0 : TALLOC_FREE(retstr);
32517 :
32518 0 : return ret;
32519 : }
32520 :
32521 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32522 : {
32523 0 : return py_svcctl_QueryServiceStatusEx_ndr_print(py_obj, "svcctl_QueryServiceStatusEx_in", NDR_IN);
32524 : }
32525 :
32526 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32527 : {
32528 0 : return py_svcctl_QueryServiceStatusEx_ndr_print(py_obj, "svcctl_QueryServiceStatusEx_out", NDR_OUT);
32529 : }
32530 :
32531 : static PyMethodDef py_svcctl_QueryServiceStatusEx_methods[] = {
32532 : { "opnum", (PyCFunction)py_svcctl_QueryServiceStatusEx_ndr_opnum, METH_NOARGS|METH_CLASS,
32533 : "svcctl.QueryServiceStatusEx.opnum() -> 40 (0x28) " },
32534 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32535 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32536 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32537 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32538 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32539 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32540 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32541 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32542 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceStatusEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32543 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceStatusEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32544 : { NULL, NULL, 0, NULL }
32545 : };
32546 :
32547 :
32548 : static PyTypeObject svcctl_QueryServiceStatusEx_Type = {
32549 : PyVarObject_HEAD_INIT(NULL, 0)
32550 : .tp_name = "svcctl.QueryServiceStatusEx",
32551 : .tp_getset = py_svcctl_QueryServiceStatusEx_getsetters,
32552 : .tp_methods = py_svcctl_QueryServiceStatusEx_methods,
32553 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32554 : .tp_new = py_svcctl_QueryServiceStatusEx_new,
32555 : };
32556 :
32557 0 : static bool pack_py_svcctl_QueryServiceStatusEx_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceStatusEx *r)
32558 : {
32559 0 : PyObject *py_handle;
32560 0 : PyObject *py_info_level;
32561 0 : PyObject *py_offered;
32562 0 : const char *kwnames[] = {
32563 : "handle", "info_level", "offered", NULL
32564 : };
32565 :
32566 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceStatusEx", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_offered)) {
32567 0 : return false;
32568 : }
32569 :
32570 0 : if (py_handle == NULL) {
32571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
32572 0 : return false;
32573 : }
32574 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
32575 0 : if (r->in.handle == NULL) {
32576 0 : PyErr_NoMemory();
32577 0 : return false;
32578 : }
32579 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
32580 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
32581 0 : PyErr_NoMemory();
32582 0 : return false;
32583 : }
32584 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
32585 0 : if (py_info_level == NULL) {
32586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
32587 0 : return false;
32588 : }
32589 : {
32590 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
32591 0 : if (PyLong_Check(py_info_level)) {
32592 0 : unsigned long long test_var;
32593 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
32594 0 : if (PyErr_Occurred() != NULL) {
32595 0 : return false;
32596 : }
32597 0 : if (test_var > uint_max) {
32598 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32599 : PyLong_Type.tp_name, uint_max, test_var);
32600 0 : return false;
32601 : }
32602 0 : r->in.info_level = test_var;
32603 : } else {
32604 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32605 : PyLong_Type.tp_name);
32606 0 : return false;
32607 : }
32608 : }
32609 0 : if (py_offered == NULL) {
32610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
32611 0 : return false;
32612 : }
32613 : {
32614 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
32615 0 : if (PyLong_Check(py_offered)) {
32616 0 : unsigned long long test_var;
32617 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
32618 0 : if (PyErr_Occurred() != NULL) {
32619 0 : return false;
32620 : }
32621 0 : if (test_var > uint_max) {
32622 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32623 : PyLong_Type.tp_name, uint_max, test_var);
32624 0 : return false;
32625 : }
32626 0 : r->in.offered = test_var;
32627 : } else {
32628 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32629 : PyLong_Type.tp_name);
32630 0 : return false;
32631 : }
32632 : }
32633 0 : return true;
32634 : }
32635 :
32636 0 : static PyObject *unpack_py_svcctl_QueryServiceStatusEx_args_out(struct svcctl_QueryServiceStatusEx *r)
32637 : {
32638 0 : PyObject *result;
32639 0 : PyObject *py_buffer;
32640 0 : PyObject *py_needed;
32641 0 : result = PyTuple_New(2);
32642 0 : py_buffer = PyList_New(r->in.offered);
32643 0 : if (py_buffer == NULL) {
32644 0 : return NULL;
32645 : }
32646 : {
32647 : int buffer_cntr_1;
32648 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
32649 0 : PyObject *py_buffer_1;
32650 0 : py_buffer_1 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_1]);
32651 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
32652 : }
32653 : }
32654 0 : PyTuple_SetItem(result, 0, py_buffer);
32655 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
32656 0 : PyTuple_SetItem(result, 1, py_needed);
32657 0 : if (!W_ERROR_IS_OK(r->out.result)) {
32658 0 : PyErr_SetWERROR(r->out.result);
32659 0 : return NULL;
32660 : }
32661 :
32662 0 : return result;
32663 : }
32664 :
32665 :
32666 0 : static PyObject *py_svcctl_EnumServicesStatusExA_in_get_scmanager(PyObject *obj, void *closure)
32667 : {
32668 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32669 0 : PyObject *py_scmanager;
32670 0 : if (object->in.scmanager == NULL) {
32671 0 : Py_RETURN_NONE;
32672 : }
32673 0 : py_scmanager = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager, object->in.scmanager);
32674 0 : return py_scmanager;
32675 : }
32676 :
32677 0 : static int py_svcctl_EnumServicesStatusExA_in_set_scmanager(PyObject *py_obj, PyObject *value, void *closure)
32678 : {
32679 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32680 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager));
32681 0 : if (value == NULL) {
32682 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager");
32683 0 : return -1;
32684 : }
32685 0 : object->in.scmanager = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager);
32686 0 : if (object->in.scmanager == NULL) {
32687 0 : PyErr_NoMemory();
32688 0 : return -1;
32689 : }
32690 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32691 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32692 0 : PyErr_NoMemory();
32693 0 : return -1;
32694 : }
32695 0 : object->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(value);
32696 0 : return 0;
32697 : }
32698 :
32699 0 : static PyObject *py_svcctl_EnumServicesStatusExA_in_get_info_level(PyObject *obj, void *closure)
32700 : {
32701 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32702 0 : PyObject *py_info_level;
32703 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
32704 0 : return py_info_level;
32705 : }
32706 :
32707 0 : static int py_svcctl_EnumServicesStatusExA_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
32708 : {
32709 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32710 0 : if (value == NULL) {
32711 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
32712 0 : return -1;
32713 : }
32714 : {
32715 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
32716 0 : if (PyLong_Check(value)) {
32717 0 : unsigned long long test_var;
32718 0 : test_var = PyLong_AsUnsignedLongLong(value);
32719 0 : if (PyErr_Occurred() != NULL) {
32720 0 : return -1;
32721 : }
32722 0 : if (test_var > uint_max) {
32723 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32724 : PyLong_Type.tp_name, uint_max, test_var);
32725 0 : return -1;
32726 : }
32727 0 : object->in.info_level = test_var;
32728 : } else {
32729 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32730 : PyLong_Type.tp_name);
32731 0 : return -1;
32732 : }
32733 : }
32734 0 : return 0;
32735 : }
32736 :
32737 0 : static PyObject *py_svcctl_EnumServicesStatusExA_in_get_type(PyObject *obj, void *closure)
32738 : {
32739 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32740 0 : PyObject *py_type;
32741 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
32742 0 : return py_type;
32743 : }
32744 :
32745 0 : static int py_svcctl_EnumServicesStatusExA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
32746 : {
32747 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32748 0 : if (value == NULL) {
32749 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
32750 0 : return -1;
32751 : }
32752 : {
32753 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
32754 0 : if (PyLong_Check(value)) {
32755 0 : unsigned long long test_var;
32756 0 : test_var = PyLong_AsUnsignedLongLong(value);
32757 0 : if (PyErr_Occurred() != NULL) {
32758 0 : return -1;
32759 : }
32760 0 : if (test_var > uint_max) {
32761 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32762 : PyLong_Type.tp_name, uint_max, test_var);
32763 0 : return -1;
32764 : }
32765 0 : object->in.type = test_var;
32766 : } else {
32767 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32768 : PyLong_Type.tp_name);
32769 0 : return -1;
32770 : }
32771 : }
32772 0 : return 0;
32773 : }
32774 :
32775 0 : static PyObject *py_svcctl_EnumServicesStatusExA_in_get_state(PyObject *obj, void *closure)
32776 : {
32777 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32778 0 : PyObject *py_state;
32779 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
32780 0 : return py_state;
32781 : }
32782 :
32783 0 : static int py_svcctl_EnumServicesStatusExA_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
32784 : {
32785 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32786 0 : if (value == NULL) {
32787 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
32788 0 : return -1;
32789 : }
32790 : {
32791 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
32792 0 : if (PyLong_Check(value)) {
32793 0 : unsigned long long test_var;
32794 0 : test_var = PyLong_AsUnsignedLongLong(value);
32795 0 : if (PyErr_Occurred() != NULL) {
32796 0 : return -1;
32797 : }
32798 0 : if (test_var > uint_max) {
32799 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32800 : PyLong_Type.tp_name, uint_max, test_var);
32801 0 : return -1;
32802 : }
32803 0 : object->in.state = test_var;
32804 : } else {
32805 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32806 : PyLong_Type.tp_name);
32807 0 : return -1;
32808 : }
32809 : }
32810 0 : return 0;
32811 : }
32812 :
32813 0 : static PyObject *py_svcctl_EnumServicesStatusExA_out_get_services(PyObject *obj, void *closure)
32814 : {
32815 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32816 0 : PyObject *py_services;
32817 0 : py_services = PyList_New(object->in.offered);
32818 0 : if (py_services == NULL) {
32819 0 : return NULL;
32820 : }
32821 : {
32822 : int services_cntr_0;
32823 0 : for (services_cntr_0 = 0; services_cntr_0 < (object->in.offered); services_cntr_0++) {
32824 0 : PyObject *py_services_0;
32825 0 : py_services_0 = PyLong_FromLong((uint16_t)object->out.services[services_cntr_0]);
32826 0 : PyList_SetItem(py_services, services_cntr_0, py_services_0);
32827 : }
32828 : }
32829 0 : return py_services;
32830 : }
32831 :
32832 0 : static int py_svcctl_EnumServicesStatusExA_out_set_services(PyObject *py_obj, PyObject *value, void *closure)
32833 : {
32834 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32835 0 : if (value == NULL) {
32836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services");
32837 0 : return -1;
32838 : }
32839 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
32840 : {
32841 0 : int services_cntr_0;
32842 0 : object->out.services = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services, PyList_GET_SIZE(value));
32843 0 : if (!object->out.services) { return -1; }
32844 0 : talloc_set_name_const(object->out.services, "ARRAY: object->out.services");
32845 0 : for (services_cntr_0 = 0; services_cntr_0 < PyList_GET_SIZE(value); services_cntr_0++) {
32846 0 : if (PyList_GET_ITEM(value, services_cntr_0) == NULL) {
32847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services[services_cntr_0]");
32848 0 : return -1;
32849 : }
32850 : {
32851 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.services[services_cntr_0]));
32852 0 : if (PyLong_Check(PyList_GET_ITEM(value, services_cntr_0))) {
32853 0 : unsigned long long test_var;
32854 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, services_cntr_0));
32855 0 : if (PyErr_Occurred() != NULL) {
32856 0 : return -1;
32857 : }
32858 0 : if (test_var > uint_max) {
32859 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32860 : PyLong_Type.tp_name, uint_max, test_var);
32861 0 : return -1;
32862 : }
32863 0 : object->out.services[services_cntr_0] = test_var;
32864 : } else {
32865 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32866 : PyLong_Type.tp_name);
32867 0 : return -1;
32868 : }
32869 : }
32870 : }
32871 : }
32872 0 : return 0;
32873 : }
32874 :
32875 0 : static PyObject *py_svcctl_EnumServicesStatusExA_in_get_offered(PyObject *obj, void *closure)
32876 : {
32877 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32878 0 : PyObject *py_offered;
32879 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
32880 0 : return py_offered;
32881 : }
32882 :
32883 0 : static int py_svcctl_EnumServicesStatusExA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
32884 : {
32885 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32886 0 : if (value == NULL) {
32887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
32888 0 : return -1;
32889 : }
32890 : {
32891 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
32892 0 : if (PyLong_Check(value)) {
32893 0 : unsigned long long test_var;
32894 0 : test_var = PyLong_AsUnsignedLongLong(value);
32895 0 : if (PyErr_Occurred() != NULL) {
32896 0 : return -1;
32897 : }
32898 0 : if (test_var > uint_max) {
32899 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32900 : PyLong_Type.tp_name, uint_max, test_var);
32901 0 : return -1;
32902 : }
32903 0 : object->in.offered = test_var;
32904 : } else {
32905 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32906 : PyLong_Type.tp_name);
32907 0 : return -1;
32908 : }
32909 : }
32910 0 : return 0;
32911 : }
32912 :
32913 0 : static PyObject *py_svcctl_EnumServicesStatusExA_out_get_needed(PyObject *obj, void *closure)
32914 : {
32915 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32916 0 : PyObject *py_needed;
32917 0 : if (object->out.needed == NULL) {
32918 0 : Py_RETURN_NONE;
32919 : }
32920 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
32921 0 : return py_needed;
32922 : }
32923 :
32924 0 : static int py_svcctl_EnumServicesStatusExA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
32925 : {
32926 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32927 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
32928 0 : if (value == NULL) {
32929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
32930 0 : return -1;
32931 : }
32932 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
32933 0 : if (object->out.needed == NULL) {
32934 0 : PyErr_NoMemory();
32935 0 : return -1;
32936 : }
32937 : {
32938 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
32939 0 : if (PyLong_Check(value)) {
32940 0 : unsigned long long test_var;
32941 0 : test_var = PyLong_AsUnsignedLongLong(value);
32942 0 : if (PyErr_Occurred() != NULL) {
32943 0 : return -1;
32944 : }
32945 0 : if (test_var > uint_max) {
32946 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32947 : PyLong_Type.tp_name, uint_max, test_var);
32948 0 : return -1;
32949 : }
32950 0 : *object->out.needed = test_var;
32951 : } else {
32952 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32953 : PyLong_Type.tp_name);
32954 0 : return -1;
32955 : }
32956 : }
32957 0 : return 0;
32958 : }
32959 :
32960 0 : static PyObject *py_svcctl_EnumServicesStatusExA_out_get_service_returned(PyObject *obj, void *closure)
32961 : {
32962 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
32963 0 : PyObject *py_service_returned;
32964 0 : if (object->out.service_returned == NULL) {
32965 0 : Py_RETURN_NONE;
32966 : }
32967 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.service_returned);
32968 0 : return py_service_returned;
32969 : }
32970 :
32971 0 : static int py_svcctl_EnumServicesStatusExA_out_set_service_returned(PyObject *py_obj, PyObject *value, void *closure)
32972 : {
32973 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
32974 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_returned));
32975 0 : if (value == NULL) {
32976 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_returned");
32977 0 : return -1;
32978 : }
32979 0 : object->out.service_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_returned);
32980 0 : if (object->out.service_returned == NULL) {
32981 0 : PyErr_NoMemory();
32982 0 : return -1;
32983 : }
32984 : {
32985 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.service_returned));
32986 0 : if (PyLong_Check(value)) {
32987 0 : unsigned long long test_var;
32988 0 : test_var = PyLong_AsUnsignedLongLong(value);
32989 0 : if (PyErr_Occurred() != NULL) {
32990 0 : return -1;
32991 : }
32992 0 : if (test_var > uint_max) {
32993 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32994 : PyLong_Type.tp_name, uint_max, test_var);
32995 0 : return -1;
32996 : }
32997 0 : *object->out.service_returned = test_var;
32998 : } else {
32999 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33000 : PyLong_Type.tp_name);
33001 0 : return -1;
33002 : }
33003 : }
33004 0 : return 0;
33005 : }
33006 :
33007 0 : static PyObject *py_svcctl_EnumServicesStatusExA_in_get_resume_handle(PyObject *obj, void *closure)
33008 : {
33009 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
33010 0 : PyObject *py_resume_handle;
33011 0 : if (object->in.resume_handle == NULL) {
33012 0 : Py_RETURN_NONE;
33013 : }
33014 0 : if (object->in.resume_handle == NULL) {
33015 0 : py_resume_handle = Py_None;
33016 0 : Py_INCREF(py_resume_handle);
33017 : } else {
33018 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
33019 : }
33020 0 : return py_resume_handle;
33021 : }
33022 :
33023 0 : static int py_svcctl_EnumServicesStatusExA_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
33024 : {
33025 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
33026 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
33027 0 : if (value == NULL) {
33028 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
33029 0 : return -1;
33030 : }
33031 0 : if (value == Py_None) {
33032 0 : object->in.resume_handle = NULL;
33033 : } else {
33034 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
33035 0 : if (object->in.resume_handle == NULL) {
33036 0 : PyErr_NoMemory();
33037 0 : return -1;
33038 : }
33039 : {
33040 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
33041 0 : if (PyLong_Check(value)) {
33042 0 : unsigned long long test_var;
33043 0 : test_var = PyLong_AsUnsignedLongLong(value);
33044 0 : if (PyErr_Occurred() != NULL) {
33045 0 : return -1;
33046 : }
33047 0 : if (test_var > uint_max) {
33048 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33049 : PyLong_Type.tp_name, uint_max, test_var);
33050 0 : return -1;
33051 : }
33052 0 : *object->in.resume_handle = test_var;
33053 : } else {
33054 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33055 : PyLong_Type.tp_name);
33056 0 : return -1;
33057 : }
33058 : }
33059 : }
33060 0 : return 0;
33061 : }
33062 :
33063 0 : static PyObject *py_svcctl_EnumServicesStatusExA_out_get_resume_handle(PyObject *obj, void *closure)
33064 : {
33065 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
33066 0 : PyObject *py_resume_handle;
33067 0 : if (object->out.resume_handle == NULL) {
33068 0 : Py_RETURN_NONE;
33069 : }
33070 0 : if (object->out.resume_handle == NULL) {
33071 0 : py_resume_handle = Py_None;
33072 0 : Py_INCREF(py_resume_handle);
33073 : } else {
33074 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
33075 : }
33076 0 : return py_resume_handle;
33077 : }
33078 :
33079 0 : static int py_svcctl_EnumServicesStatusExA_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
33080 : {
33081 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
33082 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
33083 0 : if (value == NULL) {
33084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
33085 0 : return -1;
33086 : }
33087 0 : if (value == Py_None) {
33088 0 : object->out.resume_handle = NULL;
33089 : } else {
33090 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
33091 0 : if (object->out.resume_handle == NULL) {
33092 0 : PyErr_NoMemory();
33093 0 : return -1;
33094 : }
33095 : {
33096 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
33097 0 : if (PyLong_Check(value)) {
33098 0 : unsigned long long test_var;
33099 0 : test_var = PyLong_AsUnsignedLongLong(value);
33100 0 : if (PyErr_Occurred() != NULL) {
33101 0 : return -1;
33102 : }
33103 0 : if (test_var > uint_max) {
33104 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33105 : PyLong_Type.tp_name, uint_max, test_var);
33106 0 : return -1;
33107 : }
33108 0 : *object->out.resume_handle = test_var;
33109 : } else {
33110 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33111 : PyLong_Type.tp_name);
33112 0 : return -1;
33113 : }
33114 : }
33115 : }
33116 0 : return 0;
33117 : }
33118 :
33119 0 : static PyObject *py_svcctl_EnumServicesStatusExA_out_get_group_name(PyObject *obj, void *closure)
33120 : {
33121 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
33122 0 : PyObject *py_group_name;
33123 0 : if (object->out.group_name == NULL) {
33124 0 : Py_RETURN_NONE;
33125 : }
33126 0 : if (*object->out.group_name == NULL) {
33127 0 : py_group_name = Py_None;
33128 0 : Py_INCREF(py_group_name);
33129 : } else {
33130 0 : if (*object->out.group_name == NULL) {
33131 0 : py_group_name = Py_None;
33132 0 : Py_INCREF(py_group_name);
33133 : } else {
33134 0 : py_group_name = PyUnicode_Decode(*object->out.group_name, strlen(*object->out.group_name), "utf-8", "ignore");
33135 : }
33136 : }
33137 0 : return py_group_name;
33138 : }
33139 :
33140 0 : static int py_svcctl_EnumServicesStatusExA_out_set_group_name(PyObject *py_obj, PyObject *value, void *closure)
33141 : {
33142 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
33143 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_name));
33144 0 : if (value == NULL) {
33145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_name");
33146 0 : return -1;
33147 : }
33148 0 : object->out.group_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_name);
33149 0 : if (object->out.group_name == NULL) {
33150 0 : PyErr_NoMemory();
33151 0 : return -1;
33152 : }
33153 0 : if (value == Py_None) {
33154 0 : *object->out.group_name = NULL;
33155 : } else {
33156 0 : *object->out.group_name = NULL;
33157 : {
33158 0 : const char *test_str;
33159 0 : const char *talloc_str;
33160 0 : PyObject *unicode = NULL;
33161 0 : if (PyUnicode_Check(value)) {
33162 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
33163 0 : if (unicode == NULL) {
33164 0 : return -1;
33165 : }
33166 0 : test_str = PyBytes_AS_STRING(unicode);
33167 0 : } else if (PyBytes_Check(value)) {
33168 0 : test_str = PyBytes_AS_STRING(value);
33169 : } else {
33170 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
33171 0 : return -1;
33172 : }
33173 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
33174 0 : if (unicode != NULL) {
33175 0 : Py_DECREF(unicode);
33176 : }
33177 0 : if (talloc_str == NULL) {
33178 0 : PyErr_NoMemory();
33179 0 : return -1;
33180 : }
33181 0 : *object->out.group_name = talloc_str;
33182 : }
33183 : }
33184 0 : return 0;
33185 : }
33186 :
33187 0 : static PyObject *py_svcctl_EnumServicesStatusExA_get_result(PyObject *obj, void *closure)
33188 : {
33189 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(obj);
33190 0 : PyObject *py_result;
33191 0 : py_result = PyErr_FromWERROR(object->out.result);
33192 0 : return py_result;
33193 : }
33194 :
33195 0 : static int py_svcctl_EnumServicesStatusExA_set_result(PyObject *py_obj, PyObject *value, void *closure)
33196 : {
33197 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
33198 0 : if (value == NULL) {
33199 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
33200 0 : return -1;
33201 : }
33202 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
33203 0 : return 0;
33204 : }
33205 :
33206 : static PyGetSetDef py_svcctl_EnumServicesStatusExA_getsetters[] = {
33207 : {
33208 : .name = discard_const_p(char, "in_scmanager"),
33209 : .get = py_svcctl_EnumServicesStatusExA_in_get_scmanager,
33210 : .set = py_svcctl_EnumServicesStatusExA_in_set_scmanager,
33211 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33212 : },
33213 : {
33214 : .name = discard_const_p(char, "in_info_level"),
33215 : .get = py_svcctl_EnumServicesStatusExA_in_get_info_level,
33216 : .set = py_svcctl_EnumServicesStatusExA_in_set_info_level,
33217 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33218 : },
33219 : {
33220 : .name = discard_const_p(char, "in_type"),
33221 : .get = py_svcctl_EnumServicesStatusExA_in_get_type,
33222 : .set = py_svcctl_EnumServicesStatusExA_in_set_type,
33223 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33224 : },
33225 : {
33226 : .name = discard_const_p(char, "in_state"),
33227 : .get = py_svcctl_EnumServicesStatusExA_in_get_state,
33228 : .set = py_svcctl_EnumServicesStatusExA_in_set_state,
33229 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
33230 : },
33231 : {
33232 : .name = discard_const_p(char, "out_services"),
33233 : .get = py_svcctl_EnumServicesStatusExA_out_get_services,
33234 : .set = py_svcctl_EnumServicesStatusExA_out_set_services,
33235 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
33236 : },
33237 : {
33238 : .name = discard_const_p(char, "in_offered"),
33239 : .get = py_svcctl_EnumServicesStatusExA_in_get_offered,
33240 : .set = py_svcctl_EnumServicesStatusExA_in_set_offered,
33241 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33242 : },
33243 : {
33244 : .name = discard_const_p(char, "out_needed"),
33245 : .get = py_svcctl_EnumServicesStatusExA_out_get_needed,
33246 : .set = py_svcctl_EnumServicesStatusExA_out_set_needed,
33247 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33248 : },
33249 : {
33250 : .name = discard_const_p(char, "out_service_returned"),
33251 : .get = py_svcctl_EnumServicesStatusExA_out_get_service_returned,
33252 : .set = py_svcctl_EnumServicesStatusExA_out_set_service_returned,
33253 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33254 : },
33255 : {
33256 : .name = discard_const_p(char, "in_resume_handle"),
33257 : .get = py_svcctl_EnumServicesStatusExA_in_get_resume_handle,
33258 : .set = py_svcctl_EnumServicesStatusExA_in_set_resume_handle,
33259 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33260 : },
33261 : {
33262 : .name = discard_const_p(char, "out_resume_handle"),
33263 : .get = py_svcctl_EnumServicesStatusExA_out_get_resume_handle,
33264 : .set = py_svcctl_EnumServicesStatusExA_out_set_resume_handle,
33265 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33266 : },
33267 : {
33268 : .name = discard_const_p(char, "out_group_name"),
33269 : .get = py_svcctl_EnumServicesStatusExA_out_get_group_name,
33270 : .set = py_svcctl_EnumServicesStatusExA_out_set_group_name,
33271 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
33272 : },
33273 : {
33274 : .name = discard_const_p(char, "result"),
33275 : .get = py_svcctl_EnumServicesStatusExA_get_result,
33276 : .set = py_svcctl_EnumServicesStatusExA_set_result,
33277 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
33278 : },
33279 : { .name = NULL }
33280 : };
33281 :
33282 0 : static PyObject *py_svcctl_EnumServicesStatusExA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33283 : {
33284 0 : PyObject *self = pytalloc_new(struct svcctl_EnumServicesStatusExA, type);
33285 0 : struct svcctl_EnumServicesStatusExA *_self = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(self);
33286 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
33287 0 : _self->in.scmanager = talloc_zero(mem_ctx, struct policy_handle);
33288 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
33289 0 : _self->out.service_returned = talloc_zero(mem_ctx, uint32_t);
33290 0 : return self;
33291 : }
33292 :
33293 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
33294 : {
33295 :
33296 :
33297 0 : return PyLong_FromLong(41);
33298 : }
33299 :
33300 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
33301 : {
33302 0 : const struct ndr_interface_call *call = NULL;
33303 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
33304 0 : PyObject *ret = NULL;
33305 0 : struct ndr_push *push = NULL;
33306 0 : DATA_BLOB blob;
33307 0 : enum ndr_err_code err;
33308 :
33309 0 : if (ndr_table_svcctl.num_calls < 42) {
33310 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusExA_ndr_pack");
33311 0 : return NULL;
33312 : }
33313 0 : call = &ndr_table_svcctl.calls[41];
33314 :
33315 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
33316 0 : if (push == NULL) {
33317 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33318 0 : return NULL;
33319 : }
33320 :
33321 0 : push->flags |= ndr_push_flags;
33322 :
33323 0 : err = call->ndr_push(push, ndr_inout_flags, object);
33324 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33325 0 : TALLOC_FREE(push);
33326 0 : PyErr_SetNdrError(err);
33327 0 : return NULL;
33328 : }
33329 0 : blob = ndr_push_blob(push);
33330 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
33331 0 : TALLOC_FREE(push);
33332 0 : return ret;
33333 : }
33334 :
33335 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33336 : {
33337 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33338 0 : PyObject *bigendian_obj = NULL;
33339 0 : PyObject *ndr64_obj = NULL;
33340 0 : libndr_flags ndr_push_flags = 0;
33341 :
33342 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
33343 : discard_const_p(char *, kwnames),
33344 : &bigendian_obj,
33345 : &ndr64_obj)) {
33346 0 : return NULL;
33347 : }
33348 :
33349 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33350 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33351 : }
33352 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33353 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33354 : }
33355 :
33356 0 : return py_svcctl_EnumServicesStatusExA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
33357 : }
33358 :
33359 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33360 : {
33361 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33362 0 : PyObject *bigendian_obj = NULL;
33363 0 : PyObject *ndr64_obj = NULL;
33364 0 : libndr_flags ndr_push_flags = 0;
33365 :
33366 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
33367 : discard_const_p(char *, kwnames),
33368 : &bigendian_obj,
33369 : &ndr64_obj)) {
33370 0 : return NULL;
33371 : }
33372 :
33373 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33374 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33375 : }
33376 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33377 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33378 : }
33379 :
33380 0 : return py_svcctl_EnumServicesStatusExA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
33381 : }
33382 :
33383 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
33384 : {
33385 0 : const struct ndr_interface_call *call = NULL;
33386 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
33387 0 : struct ndr_pull *pull = NULL;
33388 0 : enum ndr_err_code err;
33389 :
33390 0 : if (ndr_table_svcctl.num_calls < 42) {
33391 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusExA_ndr_unpack");
33392 0 : return NULL;
33393 : }
33394 0 : call = &ndr_table_svcctl.calls[41];
33395 :
33396 0 : pull = ndr_pull_init_blob(blob, object);
33397 0 : if (pull == NULL) {
33398 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33399 0 : return NULL;
33400 : }
33401 :
33402 0 : pull->flags |= ndr_pull_flags;
33403 :
33404 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
33405 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33406 0 : TALLOC_FREE(pull);
33407 0 : PyErr_SetNdrError(err);
33408 0 : return NULL;
33409 : }
33410 0 : if (!allow_remaining) {
33411 0 : uint32_t highest_ofs;
33412 :
33413 0 : if (pull->offset > pull->relative_highest_offset) {
33414 0 : highest_ofs = pull->offset;
33415 : } else {
33416 0 : highest_ofs = pull->relative_highest_offset;
33417 : }
33418 0 : if (highest_ofs < pull->data_size) {
33419 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33420 : "not all bytes consumed ofs[%u] size[%u]",
33421 : highest_ofs, pull->data_size);
33422 0 : TALLOC_FREE(pull);
33423 0 : PyErr_SetNdrError(err);
33424 0 : return NULL;
33425 : }
33426 : }
33427 :
33428 0 : TALLOC_FREE(pull);
33429 0 : Py_RETURN_NONE;
33430 : }
33431 :
33432 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33433 : {
33434 0 : DATA_BLOB blob;
33435 0 : Py_ssize_t blob_length = 0;
33436 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33437 0 : PyObject *bigendian_obj = NULL;
33438 0 : PyObject *ndr64_obj = NULL;
33439 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33440 0 : PyObject *allow_remaining_obj = NULL;
33441 0 : bool allow_remaining = false;
33442 :
33443 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33444 : discard_const_p(char *, kwnames),
33445 : &blob.data, &blob_length,
33446 : &bigendian_obj,
33447 : &ndr64_obj,
33448 : &allow_remaining_obj)) {
33449 0 : return NULL;
33450 : }
33451 0 : blob.length = blob_length;
33452 :
33453 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33454 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33455 : }
33456 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33457 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33458 : }
33459 :
33460 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33461 0 : allow_remaining = true;
33462 : }
33463 :
33464 0 : return py_svcctl_EnumServicesStatusExA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33465 : }
33466 :
33467 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33468 : {
33469 0 : DATA_BLOB blob;
33470 0 : Py_ssize_t blob_length = 0;
33471 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33472 0 : PyObject *bigendian_obj = NULL;
33473 0 : PyObject *ndr64_obj = NULL;
33474 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33475 0 : PyObject *allow_remaining_obj = NULL;
33476 0 : bool allow_remaining = false;
33477 :
33478 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33479 : discard_const_p(char *, kwnames),
33480 : &blob.data, &blob_length,
33481 : &bigendian_obj,
33482 : &ndr64_obj,
33483 : &allow_remaining_obj)) {
33484 0 : return NULL;
33485 : }
33486 0 : blob.length = blob_length;
33487 :
33488 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33489 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33490 : }
33491 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33492 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33493 : }
33494 :
33495 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33496 0 : allow_remaining = true;
33497 : }
33498 :
33499 0 : return py_svcctl_EnumServicesStatusExA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33500 : }
33501 :
33502 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
33503 : {
33504 0 : const struct ndr_interface_call *call = NULL;
33505 0 : struct svcctl_EnumServicesStatusExA *object = (struct svcctl_EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
33506 0 : PyObject *ret;
33507 0 : char *retstr;
33508 :
33509 0 : if (ndr_table_svcctl.num_calls < 42) {
33510 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusExA_ndr_print");
33511 0 : return NULL;
33512 : }
33513 0 : call = &ndr_table_svcctl.calls[41];
33514 :
33515 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33516 0 : ret = PyUnicode_FromString(retstr);
33517 0 : TALLOC_FREE(retstr);
33518 :
33519 0 : return ret;
33520 : }
33521 :
33522 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33523 : {
33524 0 : return py_svcctl_EnumServicesStatusExA_ndr_print(py_obj, "svcctl_EnumServicesStatusExA_in", NDR_IN);
33525 : }
33526 :
33527 0 : static PyObject *py_svcctl_EnumServicesStatusExA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33528 : {
33529 0 : return py_svcctl_EnumServicesStatusExA_ndr_print(py_obj, "svcctl_EnumServicesStatusExA_out", NDR_OUT);
33530 : }
33531 :
33532 : static PyMethodDef py_svcctl_EnumServicesStatusExA_methods[] = {
33533 : { "opnum", (PyCFunction)py_svcctl_EnumServicesStatusExA_ndr_opnum, METH_NOARGS|METH_CLASS,
33534 : "svcctl.EnumServicesStatusExA.opnum() -> 41 (0x29) " },
33535 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33536 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33537 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33538 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33539 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33540 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33541 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33542 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33543 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumServicesStatusExA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33544 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumServicesStatusExA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33545 : { NULL, NULL, 0, NULL }
33546 : };
33547 :
33548 :
33549 : static PyTypeObject svcctl_EnumServicesStatusExA_Type = {
33550 : PyVarObject_HEAD_INIT(NULL, 0)
33551 : .tp_name = "svcctl.EnumServicesStatusExA",
33552 : .tp_getset = py_svcctl_EnumServicesStatusExA_getsetters,
33553 : .tp_methods = py_svcctl_EnumServicesStatusExA_methods,
33554 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33555 : .tp_new = py_svcctl_EnumServicesStatusExA_new,
33556 : };
33557 :
33558 0 : static bool pack_py_svcctl_EnumServicesStatusExA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumServicesStatusExA *r)
33559 : {
33560 0 : PyObject *py_scmanager;
33561 0 : PyObject *py_info_level;
33562 0 : PyObject *py_type;
33563 0 : PyObject *py_state;
33564 0 : PyObject *py_offered;
33565 0 : PyObject *py_resume_handle;
33566 0 : const char *kwnames[] = {
33567 : "scmanager", "info_level", "type", "state", "offered", "resume_handle", NULL
33568 : };
33569 :
33570 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:svcctl_EnumServicesStatusExA", discard_const_p(char *, kwnames), &py_scmanager, &py_info_level, &py_type, &py_state, &py_offered, &py_resume_handle)) {
33571 0 : return false;
33572 : }
33573 :
33574 0 : if (py_scmanager == NULL) {
33575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager");
33576 0 : return false;
33577 : }
33578 0 : r->in.scmanager = talloc_ptrtype(r, r->in.scmanager);
33579 0 : if (r->in.scmanager == NULL) {
33580 0 : PyErr_NoMemory();
33581 0 : return false;
33582 : }
33583 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager, return false;);
33584 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager)) == NULL) {
33585 0 : PyErr_NoMemory();
33586 0 : return false;
33587 : }
33588 0 : r->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(py_scmanager);
33589 0 : if (py_info_level == NULL) {
33590 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
33591 0 : return false;
33592 : }
33593 : {
33594 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
33595 0 : if (PyLong_Check(py_info_level)) {
33596 0 : unsigned long long test_var;
33597 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
33598 0 : if (PyErr_Occurred() != NULL) {
33599 0 : return false;
33600 : }
33601 0 : if (test_var > uint_max) {
33602 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33603 : PyLong_Type.tp_name, uint_max, test_var);
33604 0 : return false;
33605 : }
33606 0 : r->in.info_level = test_var;
33607 : } else {
33608 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33609 : PyLong_Type.tp_name);
33610 0 : return false;
33611 : }
33612 : }
33613 0 : if (py_type == NULL) {
33614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
33615 0 : return false;
33616 : }
33617 : {
33618 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
33619 0 : if (PyLong_Check(py_type)) {
33620 0 : unsigned long long test_var;
33621 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
33622 0 : if (PyErr_Occurred() != NULL) {
33623 0 : return false;
33624 : }
33625 0 : if (test_var > uint_max) {
33626 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33627 : PyLong_Type.tp_name, uint_max, test_var);
33628 0 : return false;
33629 : }
33630 0 : r->in.type = test_var;
33631 : } else {
33632 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33633 : PyLong_Type.tp_name);
33634 0 : return false;
33635 : }
33636 : }
33637 0 : if (py_state == NULL) {
33638 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
33639 0 : return false;
33640 : }
33641 : {
33642 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
33643 0 : if (PyLong_Check(py_state)) {
33644 0 : unsigned long long test_var;
33645 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
33646 0 : if (PyErr_Occurred() != NULL) {
33647 0 : return false;
33648 : }
33649 0 : if (test_var > uint_max) {
33650 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33651 : PyLong_Type.tp_name, uint_max, test_var);
33652 0 : return false;
33653 : }
33654 0 : r->in.state = test_var;
33655 : } else {
33656 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33657 : PyLong_Type.tp_name);
33658 0 : return false;
33659 : }
33660 : }
33661 0 : if (py_offered == NULL) {
33662 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
33663 0 : return false;
33664 : }
33665 : {
33666 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
33667 0 : if (PyLong_Check(py_offered)) {
33668 0 : unsigned long long test_var;
33669 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
33670 0 : if (PyErr_Occurred() != NULL) {
33671 0 : return false;
33672 : }
33673 0 : if (test_var > uint_max) {
33674 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33675 : PyLong_Type.tp_name, uint_max, test_var);
33676 0 : return false;
33677 : }
33678 0 : r->in.offered = test_var;
33679 : } else {
33680 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33681 : PyLong_Type.tp_name);
33682 0 : return false;
33683 : }
33684 : }
33685 0 : if (py_resume_handle == NULL) {
33686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
33687 0 : return false;
33688 : }
33689 0 : if (py_resume_handle == Py_None) {
33690 0 : r->in.resume_handle = NULL;
33691 : } else {
33692 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
33693 0 : if (r->in.resume_handle == NULL) {
33694 0 : PyErr_NoMemory();
33695 0 : return false;
33696 : }
33697 : {
33698 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
33699 0 : if (PyLong_Check(py_resume_handle)) {
33700 0 : unsigned long long test_var;
33701 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
33702 0 : if (PyErr_Occurred() != NULL) {
33703 0 : return false;
33704 : }
33705 0 : if (test_var > uint_max) {
33706 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33707 : PyLong_Type.tp_name, uint_max, test_var);
33708 0 : return false;
33709 : }
33710 0 : *r->in.resume_handle = test_var;
33711 : } else {
33712 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33713 : PyLong_Type.tp_name);
33714 0 : return false;
33715 : }
33716 : }
33717 : }
33718 0 : return true;
33719 : }
33720 :
33721 0 : static PyObject *unpack_py_svcctl_EnumServicesStatusExA_args_out(struct svcctl_EnumServicesStatusExA *r)
33722 : {
33723 0 : PyObject *result;
33724 0 : PyObject *py_services;
33725 0 : PyObject *py_needed;
33726 0 : PyObject *py_service_returned;
33727 0 : PyObject *py_resume_handle;
33728 0 : PyObject *py_group_name;
33729 0 : result = PyTuple_New(5);
33730 0 : py_services = PyList_New(r->in.offered);
33731 0 : if (py_services == NULL) {
33732 0 : return NULL;
33733 : }
33734 : {
33735 : int services_cntr_0;
33736 0 : for (services_cntr_0 = 0; services_cntr_0 < (r->in.offered); services_cntr_0++) {
33737 0 : PyObject *py_services_0;
33738 0 : py_services_0 = PyLong_FromLong((uint16_t)r->out.services[services_cntr_0]);
33739 0 : PyList_SetItem(py_services, services_cntr_0, py_services_0);
33740 : }
33741 : }
33742 0 : PyTuple_SetItem(result, 0, py_services);
33743 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
33744 0 : PyTuple_SetItem(result, 1, py_needed);
33745 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.service_returned);
33746 0 : PyTuple_SetItem(result, 2, py_service_returned);
33747 0 : if (r->out.resume_handle == NULL) {
33748 0 : py_resume_handle = Py_None;
33749 0 : Py_INCREF(py_resume_handle);
33750 : } else {
33751 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
33752 : }
33753 0 : PyTuple_SetItem(result, 3, py_resume_handle);
33754 0 : if (*r->out.group_name == NULL) {
33755 0 : py_group_name = Py_None;
33756 0 : Py_INCREF(py_group_name);
33757 : } else {
33758 0 : if (*r->out.group_name == NULL) {
33759 0 : py_group_name = Py_None;
33760 0 : Py_INCREF(py_group_name);
33761 : } else {
33762 0 : py_group_name = PyUnicode_Decode(*r->out.group_name, strlen(*r->out.group_name), "utf-8", "ignore");
33763 : }
33764 : }
33765 0 : PyTuple_SetItem(result, 4, py_group_name);
33766 0 : if (!W_ERROR_IS_OK(r->out.result)) {
33767 0 : PyErr_SetWERROR(r->out.result);
33768 0 : return NULL;
33769 : }
33770 :
33771 0 : return result;
33772 : }
33773 :
33774 :
33775 0 : static PyObject *py_svcctl_EnumServicesStatusExW_in_get_scmanager(PyObject *obj, void *closure)
33776 : {
33777 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
33778 0 : PyObject *py_scmanager;
33779 0 : if (object->in.scmanager == NULL) {
33780 0 : Py_RETURN_NONE;
33781 : }
33782 0 : py_scmanager = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager, object->in.scmanager);
33783 0 : return py_scmanager;
33784 : }
33785 :
33786 0 : static int py_svcctl_EnumServicesStatusExW_in_set_scmanager(PyObject *py_obj, PyObject *value, void *closure)
33787 : {
33788 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
33789 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager));
33790 0 : if (value == NULL) {
33791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager");
33792 0 : return -1;
33793 : }
33794 0 : object->in.scmanager = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager);
33795 0 : if (object->in.scmanager == NULL) {
33796 0 : PyErr_NoMemory();
33797 0 : return -1;
33798 : }
33799 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33800 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33801 0 : PyErr_NoMemory();
33802 0 : return -1;
33803 : }
33804 0 : object->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(value);
33805 0 : return 0;
33806 : }
33807 :
33808 0 : static PyObject *py_svcctl_EnumServicesStatusExW_in_get_info_level(PyObject *obj, void *closure)
33809 : {
33810 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
33811 0 : PyObject *py_info_level;
33812 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
33813 0 : return py_info_level;
33814 : }
33815 :
33816 0 : static int py_svcctl_EnumServicesStatusExW_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
33817 : {
33818 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
33819 0 : if (value == NULL) {
33820 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
33821 0 : return -1;
33822 : }
33823 : {
33824 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
33825 0 : if (PyLong_Check(value)) {
33826 0 : unsigned long long test_var;
33827 0 : test_var = PyLong_AsUnsignedLongLong(value);
33828 0 : if (PyErr_Occurred() != NULL) {
33829 0 : return -1;
33830 : }
33831 0 : if (test_var > uint_max) {
33832 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33833 : PyLong_Type.tp_name, uint_max, test_var);
33834 0 : return -1;
33835 : }
33836 0 : object->in.info_level = test_var;
33837 : } else {
33838 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33839 : PyLong_Type.tp_name);
33840 0 : return -1;
33841 : }
33842 : }
33843 0 : return 0;
33844 : }
33845 :
33846 0 : static PyObject *py_svcctl_EnumServicesStatusExW_in_get_type(PyObject *obj, void *closure)
33847 : {
33848 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
33849 0 : PyObject *py_type;
33850 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
33851 0 : return py_type;
33852 : }
33853 :
33854 0 : static int py_svcctl_EnumServicesStatusExW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
33855 : {
33856 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
33857 0 : if (value == NULL) {
33858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
33859 0 : return -1;
33860 : }
33861 : {
33862 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
33863 0 : if (PyLong_Check(value)) {
33864 0 : unsigned long long test_var;
33865 0 : test_var = PyLong_AsUnsignedLongLong(value);
33866 0 : if (PyErr_Occurred() != NULL) {
33867 0 : return -1;
33868 : }
33869 0 : if (test_var > uint_max) {
33870 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33871 : PyLong_Type.tp_name, uint_max, test_var);
33872 0 : return -1;
33873 : }
33874 0 : object->in.type = test_var;
33875 : } else {
33876 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33877 : PyLong_Type.tp_name);
33878 0 : return -1;
33879 : }
33880 : }
33881 0 : return 0;
33882 : }
33883 :
33884 0 : static PyObject *py_svcctl_EnumServicesStatusExW_in_get_state(PyObject *obj, void *closure)
33885 : {
33886 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
33887 0 : PyObject *py_state;
33888 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
33889 0 : return py_state;
33890 : }
33891 :
33892 0 : static int py_svcctl_EnumServicesStatusExW_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
33893 : {
33894 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
33895 0 : if (value == NULL) {
33896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
33897 0 : return -1;
33898 : }
33899 : {
33900 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
33901 0 : if (PyLong_Check(value)) {
33902 0 : unsigned long long test_var;
33903 0 : test_var = PyLong_AsUnsignedLongLong(value);
33904 0 : if (PyErr_Occurred() != NULL) {
33905 0 : return -1;
33906 : }
33907 0 : if (test_var > uint_max) {
33908 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33909 : PyLong_Type.tp_name, uint_max, test_var);
33910 0 : return -1;
33911 : }
33912 0 : object->in.state = test_var;
33913 : } else {
33914 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33915 : PyLong_Type.tp_name);
33916 0 : return -1;
33917 : }
33918 : }
33919 0 : return 0;
33920 : }
33921 :
33922 0 : static PyObject *py_svcctl_EnumServicesStatusExW_out_get_services(PyObject *obj, void *closure)
33923 : {
33924 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
33925 0 : PyObject *py_services;
33926 0 : if (object->out.services == NULL) {
33927 0 : Py_RETURN_NONE;
33928 : }
33929 0 : py_services = PyList_New(object->in.offered);
33930 0 : if (py_services == NULL) {
33931 0 : return NULL;
33932 : }
33933 : {
33934 : int services_cntr_1;
33935 0 : for (services_cntr_1 = 0; services_cntr_1 < (object->in.offered); services_cntr_1++) {
33936 0 : PyObject *py_services_1;
33937 0 : py_services_1 = PyLong_FromLong((uint16_t)object->out.services[services_cntr_1]);
33938 0 : PyList_SetItem(py_services, services_cntr_1, py_services_1);
33939 : }
33940 : }
33941 0 : return py_services;
33942 : }
33943 :
33944 0 : static int py_svcctl_EnumServicesStatusExW_out_set_services(PyObject *py_obj, PyObject *value, void *closure)
33945 : {
33946 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
33947 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services));
33948 0 : if (value == NULL) {
33949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services");
33950 0 : return -1;
33951 : }
33952 0 : object->out.services = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services);
33953 0 : if (object->out.services == NULL) {
33954 0 : PyErr_NoMemory();
33955 0 : return -1;
33956 : }
33957 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
33958 : {
33959 0 : int services_cntr_1;
33960 0 : object->out.services = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services, PyList_GET_SIZE(value));
33961 0 : if (!object->out.services) { return -1; }
33962 0 : talloc_set_name_const(object->out.services, "ARRAY: object->out.services");
33963 0 : for (services_cntr_1 = 0; services_cntr_1 < PyList_GET_SIZE(value); services_cntr_1++) {
33964 0 : if (PyList_GET_ITEM(value, services_cntr_1) == NULL) {
33965 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services[services_cntr_1]");
33966 0 : return -1;
33967 : }
33968 : {
33969 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.services[services_cntr_1]));
33970 0 : if (PyLong_Check(PyList_GET_ITEM(value, services_cntr_1))) {
33971 0 : unsigned long long test_var;
33972 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, services_cntr_1));
33973 0 : if (PyErr_Occurred() != NULL) {
33974 0 : return -1;
33975 : }
33976 0 : if (test_var > uint_max) {
33977 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33978 : PyLong_Type.tp_name, uint_max, test_var);
33979 0 : return -1;
33980 : }
33981 0 : object->out.services[services_cntr_1] = test_var;
33982 : } else {
33983 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33984 : PyLong_Type.tp_name);
33985 0 : return -1;
33986 : }
33987 : }
33988 : }
33989 : }
33990 0 : return 0;
33991 : }
33992 :
33993 0 : static PyObject *py_svcctl_EnumServicesStatusExW_in_get_offered(PyObject *obj, void *closure)
33994 : {
33995 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
33996 0 : PyObject *py_offered;
33997 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
33998 0 : return py_offered;
33999 : }
34000 :
34001 0 : static int py_svcctl_EnumServicesStatusExW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
34002 : {
34003 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34004 0 : if (value == NULL) {
34005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
34006 0 : return -1;
34007 : }
34008 : {
34009 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
34010 0 : if (PyLong_Check(value)) {
34011 0 : unsigned long long test_var;
34012 0 : test_var = PyLong_AsUnsignedLongLong(value);
34013 0 : if (PyErr_Occurred() != NULL) {
34014 0 : return -1;
34015 : }
34016 0 : if (test_var > uint_max) {
34017 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34018 : PyLong_Type.tp_name, uint_max, test_var);
34019 0 : return -1;
34020 : }
34021 0 : object->in.offered = test_var;
34022 : } else {
34023 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34024 : PyLong_Type.tp_name);
34025 0 : return -1;
34026 : }
34027 : }
34028 0 : return 0;
34029 : }
34030 :
34031 0 : static PyObject *py_svcctl_EnumServicesStatusExW_out_get_needed(PyObject *obj, void *closure)
34032 : {
34033 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
34034 0 : PyObject *py_needed;
34035 0 : if (object->out.needed == NULL) {
34036 0 : Py_RETURN_NONE;
34037 : }
34038 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
34039 0 : return py_needed;
34040 : }
34041 :
34042 0 : static int py_svcctl_EnumServicesStatusExW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
34043 : {
34044 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34045 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
34046 0 : if (value == NULL) {
34047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
34048 0 : return -1;
34049 : }
34050 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
34051 0 : if (object->out.needed == NULL) {
34052 0 : PyErr_NoMemory();
34053 0 : return -1;
34054 : }
34055 : {
34056 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
34057 0 : if (PyLong_Check(value)) {
34058 0 : unsigned long long test_var;
34059 0 : test_var = PyLong_AsUnsignedLongLong(value);
34060 0 : if (PyErr_Occurred() != NULL) {
34061 0 : return -1;
34062 : }
34063 0 : if (test_var > uint_max) {
34064 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34065 : PyLong_Type.tp_name, uint_max, test_var);
34066 0 : return -1;
34067 : }
34068 0 : *object->out.needed = test_var;
34069 : } else {
34070 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34071 : PyLong_Type.tp_name);
34072 0 : return -1;
34073 : }
34074 : }
34075 0 : return 0;
34076 : }
34077 :
34078 0 : static PyObject *py_svcctl_EnumServicesStatusExW_out_get_service_returned(PyObject *obj, void *closure)
34079 : {
34080 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
34081 0 : PyObject *py_service_returned;
34082 0 : if (object->out.service_returned == NULL) {
34083 0 : Py_RETURN_NONE;
34084 : }
34085 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.service_returned);
34086 0 : return py_service_returned;
34087 : }
34088 :
34089 0 : static int py_svcctl_EnumServicesStatusExW_out_set_service_returned(PyObject *py_obj, PyObject *value, void *closure)
34090 : {
34091 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34092 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_returned));
34093 0 : if (value == NULL) {
34094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_returned");
34095 0 : return -1;
34096 : }
34097 0 : object->out.service_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_returned);
34098 0 : if (object->out.service_returned == NULL) {
34099 0 : PyErr_NoMemory();
34100 0 : return -1;
34101 : }
34102 : {
34103 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.service_returned));
34104 0 : if (PyLong_Check(value)) {
34105 0 : unsigned long long test_var;
34106 0 : test_var = PyLong_AsUnsignedLongLong(value);
34107 0 : if (PyErr_Occurred() != NULL) {
34108 0 : return -1;
34109 : }
34110 0 : if (test_var > uint_max) {
34111 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34112 : PyLong_Type.tp_name, uint_max, test_var);
34113 0 : return -1;
34114 : }
34115 0 : *object->out.service_returned = test_var;
34116 : } else {
34117 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34118 : PyLong_Type.tp_name);
34119 0 : return -1;
34120 : }
34121 : }
34122 0 : return 0;
34123 : }
34124 :
34125 0 : static PyObject *py_svcctl_EnumServicesStatusExW_in_get_resume_handle(PyObject *obj, void *closure)
34126 : {
34127 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
34128 0 : PyObject *py_resume_handle;
34129 0 : if (object->in.resume_handle == NULL) {
34130 0 : Py_RETURN_NONE;
34131 : }
34132 0 : if (object->in.resume_handle == NULL) {
34133 0 : py_resume_handle = Py_None;
34134 0 : Py_INCREF(py_resume_handle);
34135 : } else {
34136 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
34137 : }
34138 0 : return py_resume_handle;
34139 : }
34140 :
34141 0 : static int py_svcctl_EnumServicesStatusExW_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
34142 : {
34143 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34144 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
34145 0 : if (value == NULL) {
34146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
34147 0 : return -1;
34148 : }
34149 0 : if (value == Py_None) {
34150 0 : object->in.resume_handle = NULL;
34151 : } else {
34152 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
34153 0 : if (object->in.resume_handle == NULL) {
34154 0 : PyErr_NoMemory();
34155 0 : return -1;
34156 : }
34157 : {
34158 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
34159 0 : if (PyLong_Check(value)) {
34160 0 : unsigned long long test_var;
34161 0 : test_var = PyLong_AsUnsignedLongLong(value);
34162 0 : if (PyErr_Occurred() != NULL) {
34163 0 : return -1;
34164 : }
34165 0 : if (test_var > uint_max) {
34166 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34167 : PyLong_Type.tp_name, uint_max, test_var);
34168 0 : return -1;
34169 : }
34170 0 : *object->in.resume_handle = test_var;
34171 : } else {
34172 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34173 : PyLong_Type.tp_name);
34174 0 : return -1;
34175 : }
34176 : }
34177 : }
34178 0 : return 0;
34179 : }
34180 :
34181 0 : static PyObject *py_svcctl_EnumServicesStatusExW_out_get_resume_handle(PyObject *obj, void *closure)
34182 : {
34183 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
34184 0 : PyObject *py_resume_handle;
34185 0 : if (object->out.resume_handle == NULL) {
34186 0 : Py_RETURN_NONE;
34187 : }
34188 0 : if (object->out.resume_handle == NULL) {
34189 0 : py_resume_handle = Py_None;
34190 0 : Py_INCREF(py_resume_handle);
34191 : } else {
34192 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
34193 : }
34194 0 : return py_resume_handle;
34195 : }
34196 :
34197 0 : static int py_svcctl_EnumServicesStatusExW_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
34198 : {
34199 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34200 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
34201 0 : if (value == NULL) {
34202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
34203 0 : return -1;
34204 : }
34205 0 : if (value == Py_None) {
34206 0 : object->out.resume_handle = NULL;
34207 : } else {
34208 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
34209 0 : if (object->out.resume_handle == NULL) {
34210 0 : PyErr_NoMemory();
34211 0 : return -1;
34212 : }
34213 : {
34214 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
34215 0 : if (PyLong_Check(value)) {
34216 0 : unsigned long long test_var;
34217 0 : test_var = PyLong_AsUnsignedLongLong(value);
34218 0 : if (PyErr_Occurred() != NULL) {
34219 0 : return -1;
34220 : }
34221 0 : if (test_var > uint_max) {
34222 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34223 : PyLong_Type.tp_name, uint_max, test_var);
34224 0 : return -1;
34225 : }
34226 0 : *object->out.resume_handle = test_var;
34227 : } else {
34228 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34229 : PyLong_Type.tp_name);
34230 0 : return -1;
34231 : }
34232 : }
34233 : }
34234 0 : return 0;
34235 : }
34236 :
34237 0 : static PyObject *py_svcctl_EnumServicesStatusExW_in_get_group_name(PyObject *obj, void *closure)
34238 : {
34239 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
34240 0 : PyObject *py_group_name;
34241 0 : if (object->in.group_name == NULL) {
34242 0 : Py_RETURN_NONE;
34243 : }
34244 0 : if (object->in.group_name == NULL) {
34245 0 : py_group_name = Py_None;
34246 0 : Py_INCREF(py_group_name);
34247 : } else {
34248 0 : if (object->in.group_name == NULL) {
34249 0 : py_group_name = Py_None;
34250 0 : Py_INCREF(py_group_name);
34251 : } else {
34252 0 : py_group_name = PyUnicode_Decode(object->in.group_name, strlen(object->in.group_name), "utf-8", "ignore");
34253 : }
34254 : }
34255 0 : return py_group_name;
34256 : }
34257 :
34258 0 : static int py_svcctl_EnumServicesStatusExW_in_set_group_name(PyObject *py_obj, PyObject *value, void *closure)
34259 : {
34260 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34261 0 : if (value == NULL) {
34262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_name");
34263 0 : return -1;
34264 : }
34265 0 : if (value == Py_None) {
34266 0 : object->in.group_name = NULL;
34267 : } else {
34268 0 : object->in.group_name = NULL;
34269 : {
34270 0 : const char *test_str;
34271 0 : const char *talloc_str;
34272 0 : PyObject *unicode = NULL;
34273 0 : if (PyUnicode_Check(value)) {
34274 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
34275 0 : if (unicode == NULL) {
34276 0 : return -1;
34277 : }
34278 0 : test_str = PyBytes_AS_STRING(unicode);
34279 0 : } else if (PyBytes_Check(value)) {
34280 0 : test_str = PyBytes_AS_STRING(value);
34281 : } else {
34282 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
34283 0 : return -1;
34284 : }
34285 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
34286 0 : if (unicode != NULL) {
34287 0 : Py_DECREF(unicode);
34288 : }
34289 0 : if (talloc_str == NULL) {
34290 0 : PyErr_NoMemory();
34291 0 : return -1;
34292 : }
34293 0 : object->in.group_name = talloc_str;
34294 : }
34295 : }
34296 0 : return 0;
34297 : }
34298 :
34299 0 : static PyObject *py_svcctl_EnumServicesStatusExW_get_result(PyObject *obj, void *closure)
34300 : {
34301 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(obj);
34302 0 : PyObject *py_result;
34303 0 : py_result = PyErr_FromWERROR(object->out.result);
34304 0 : return py_result;
34305 : }
34306 :
34307 0 : static int py_svcctl_EnumServicesStatusExW_set_result(PyObject *py_obj, PyObject *value, void *closure)
34308 : {
34309 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34310 0 : if (value == NULL) {
34311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
34312 0 : return -1;
34313 : }
34314 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
34315 0 : return 0;
34316 : }
34317 :
34318 : static PyGetSetDef py_svcctl_EnumServicesStatusExW_getsetters[] = {
34319 : {
34320 : .name = discard_const_p(char, "in_scmanager"),
34321 : .get = py_svcctl_EnumServicesStatusExW_in_get_scmanager,
34322 : .set = py_svcctl_EnumServicesStatusExW_in_set_scmanager,
34323 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
34324 : },
34325 : {
34326 : .name = discard_const_p(char, "in_info_level"),
34327 : .get = py_svcctl_EnumServicesStatusExW_in_get_info_level,
34328 : .set = py_svcctl_EnumServicesStatusExW_in_set_info_level,
34329 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34330 : },
34331 : {
34332 : .name = discard_const_p(char, "in_type"),
34333 : .get = py_svcctl_EnumServicesStatusExW_in_get_type,
34334 : .set = py_svcctl_EnumServicesStatusExW_in_set_type,
34335 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34336 : },
34337 : {
34338 : .name = discard_const_p(char, "in_state"),
34339 : .get = py_svcctl_EnumServicesStatusExW_in_get_state,
34340 : .set = py_svcctl_EnumServicesStatusExW_in_set_state,
34341 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
34342 : },
34343 : {
34344 : .name = discard_const_p(char, "out_services"),
34345 : .get = py_svcctl_EnumServicesStatusExW_out_get_services,
34346 : .set = py_svcctl_EnumServicesStatusExW_out_set_services,
34347 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
34348 : },
34349 : {
34350 : .name = discard_const_p(char, "in_offered"),
34351 : .get = py_svcctl_EnumServicesStatusExW_in_get_offered,
34352 : .set = py_svcctl_EnumServicesStatusExW_in_set_offered,
34353 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34354 : },
34355 : {
34356 : .name = discard_const_p(char, "out_needed"),
34357 : .get = py_svcctl_EnumServicesStatusExW_out_get_needed,
34358 : .set = py_svcctl_EnumServicesStatusExW_out_set_needed,
34359 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34360 : },
34361 : {
34362 : .name = discard_const_p(char, "out_service_returned"),
34363 : .get = py_svcctl_EnumServicesStatusExW_out_get_service_returned,
34364 : .set = py_svcctl_EnumServicesStatusExW_out_set_service_returned,
34365 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34366 : },
34367 : {
34368 : .name = discard_const_p(char, "in_resume_handle"),
34369 : .get = py_svcctl_EnumServicesStatusExW_in_get_resume_handle,
34370 : .set = py_svcctl_EnumServicesStatusExW_in_set_resume_handle,
34371 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34372 : },
34373 : {
34374 : .name = discard_const_p(char, "out_resume_handle"),
34375 : .get = py_svcctl_EnumServicesStatusExW_out_get_resume_handle,
34376 : .set = py_svcctl_EnumServicesStatusExW_out_set_resume_handle,
34377 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34378 : },
34379 : {
34380 : .name = discard_const_p(char, "in_group_name"),
34381 : .get = py_svcctl_EnumServicesStatusExW_in_get_group_name,
34382 : .set = py_svcctl_EnumServicesStatusExW_in_set_group_name,
34383 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
34384 : },
34385 : {
34386 : .name = discard_const_p(char, "result"),
34387 : .get = py_svcctl_EnumServicesStatusExW_get_result,
34388 : .set = py_svcctl_EnumServicesStatusExW_set_result,
34389 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
34390 : },
34391 : { .name = NULL }
34392 : };
34393 :
34394 0 : static PyObject *py_svcctl_EnumServicesStatusExW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34395 : {
34396 0 : PyObject *self = pytalloc_new(struct svcctl_EnumServicesStatusExW, type);
34397 0 : struct svcctl_EnumServicesStatusExW *_self = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(self);
34398 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34399 0 : _self->in.scmanager = talloc_zero(mem_ctx, struct policy_handle);
34400 0 : _self->out.services = talloc_zero(mem_ctx, uint8_t);
34401 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
34402 0 : _self->out.service_returned = talloc_zero(mem_ctx, uint32_t);
34403 0 : return self;
34404 : }
34405 :
34406 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34407 : {
34408 :
34409 :
34410 0 : return PyLong_FromLong(42);
34411 : }
34412 :
34413 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
34414 : {
34415 0 : const struct ndr_interface_call *call = NULL;
34416 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34417 0 : PyObject *ret = NULL;
34418 0 : struct ndr_push *push = NULL;
34419 0 : DATA_BLOB blob;
34420 0 : enum ndr_err_code err;
34421 :
34422 0 : if (ndr_table_svcctl.num_calls < 43) {
34423 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusExW_ndr_pack");
34424 0 : return NULL;
34425 : }
34426 0 : call = &ndr_table_svcctl.calls[42];
34427 :
34428 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34429 0 : if (push == NULL) {
34430 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34431 0 : return NULL;
34432 : }
34433 :
34434 0 : push->flags |= ndr_push_flags;
34435 :
34436 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34437 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34438 0 : TALLOC_FREE(push);
34439 0 : PyErr_SetNdrError(err);
34440 0 : return NULL;
34441 : }
34442 0 : blob = ndr_push_blob(push);
34443 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34444 0 : TALLOC_FREE(push);
34445 0 : return ret;
34446 : }
34447 :
34448 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34449 : {
34450 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34451 0 : PyObject *bigendian_obj = NULL;
34452 0 : PyObject *ndr64_obj = NULL;
34453 0 : libndr_flags ndr_push_flags = 0;
34454 :
34455 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34456 : discard_const_p(char *, kwnames),
34457 : &bigendian_obj,
34458 : &ndr64_obj)) {
34459 0 : return NULL;
34460 : }
34461 :
34462 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34463 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34464 : }
34465 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34466 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34467 : }
34468 :
34469 0 : return py_svcctl_EnumServicesStatusExW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34470 : }
34471 :
34472 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34473 : {
34474 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34475 0 : PyObject *bigendian_obj = NULL;
34476 0 : PyObject *ndr64_obj = NULL;
34477 0 : libndr_flags ndr_push_flags = 0;
34478 :
34479 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34480 : discard_const_p(char *, kwnames),
34481 : &bigendian_obj,
34482 : &ndr64_obj)) {
34483 0 : return NULL;
34484 : }
34485 :
34486 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34487 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34488 : }
34489 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34490 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34491 : }
34492 :
34493 0 : return py_svcctl_EnumServicesStatusExW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34494 : }
34495 :
34496 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
34497 : {
34498 0 : const struct ndr_interface_call *call = NULL;
34499 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34500 0 : struct ndr_pull *pull = NULL;
34501 0 : enum ndr_err_code err;
34502 :
34503 0 : if (ndr_table_svcctl.num_calls < 43) {
34504 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusExW_ndr_unpack");
34505 0 : return NULL;
34506 : }
34507 0 : call = &ndr_table_svcctl.calls[42];
34508 :
34509 0 : pull = ndr_pull_init_blob(blob, object);
34510 0 : if (pull == NULL) {
34511 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34512 0 : return NULL;
34513 : }
34514 :
34515 0 : pull->flags |= ndr_pull_flags;
34516 :
34517 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34518 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34519 0 : TALLOC_FREE(pull);
34520 0 : PyErr_SetNdrError(err);
34521 0 : return NULL;
34522 : }
34523 0 : if (!allow_remaining) {
34524 0 : uint32_t highest_ofs;
34525 :
34526 0 : if (pull->offset > pull->relative_highest_offset) {
34527 0 : highest_ofs = pull->offset;
34528 : } else {
34529 0 : highest_ofs = pull->relative_highest_offset;
34530 : }
34531 0 : if (highest_ofs < pull->data_size) {
34532 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34533 : "not all bytes consumed ofs[%u] size[%u]",
34534 : highest_ofs, pull->data_size);
34535 0 : TALLOC_FREE(pull);
34536 0 : PyErr_SetNdrError(err);
34537 0 : return NULL;
34538 : }
34539 : }
34540 :
34541 0 : TALLOC_FREE(pull);
34542 0 : Py_RETURN_NONE;
34543 : }
34544 :
34545 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34546 : {
34547 0 : DATA_BLOB blob;
34548 0 : Py_ssize_t blob_length = 0;
34549 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34550 0 : PyObject *bigendian_obj = NULL;
34551 0 : PyObject *ndr64_obj = NULL;
34552 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34553 0 : PyObject *allow_remaining_obj = NULL;
34554 0 : bool allow_remaining = false;
34555 :
34556 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34557 : discard_const_p(char *, kwnames),
34558 : &blob.data, &blob_length,
34559 : &bigendian_obj,
34560 : &ndr64_obj,
34561 : &allow_remaining_obj)) {
34562 0 : return NULL;
34563 : }
34564 0 : blob.length = blob_length;
34565 :
34566 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34567 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34568 : }
34569 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34570 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34571 : }
34572 :
34573 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34574 0 : allow_remaining = true;
34575 : }
34576 :
34577 0 : return py_svcctl_EnumServicesStatusExW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34578 : }
34579 :
34580 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34581 : {
34582 0 : DATA_BLOB blob;
34583 0 : Py_ssize_t blob_length = 0;
34584 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34585 0 : PyObject *bigendian_obj = NULL;
34586 0 : PyObject *ndr64_obj = NULL;
34587 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34588 0 : PyObject *allow_remaining_obj = NULL;
34589 0 : bool allow_remaining = false;
34590 :
34591 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34592 : discard_const_p(char *, kwnames),
34593 : &blob.data, &blob_length,
34594 : &bigendian_obj,
34595 : &ndr64_obj,
34596 : &allow_remaining_obj)) {
34597 0 : return NULL;
34598 : }
34599 0 : blob.length = blob_length;
34600 :
34601 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34602 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34603 : }
34604 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34605 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34606 : }
34607 :
34608 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34609 0 : allow_remaining = true;
34610 : }
34611 :
34612 0 : return py_svcctl_EnumServicesStatusExW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34613 : }
34614 :
34615 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
34616 : {
34617 0 : const struct ndr_interface_call *call = NULL;
34618 0 : struct svcctl_EnumServicesStatusExW *object = (struct svcctl_EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
34619 0 : PyObject *ret;
34620 0 : char *retstr;
34621 :
34622 0 : if (ndr_table_svcctl.num_calls < 43) {
34623 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusExW_ndr_print");
34624 0 : return NULL;
34625 : }
34626 0 : call = &ndr_table_svcctl.calls[42];
34627 :
34628 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34629 0 : ret = PyUnicode_FromString(retstr);
34630 0 : TALLOC_FREE(retstr);
34631 :
34632 0 : return ret;
34633 : }
34634 :
34635 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34636 : {
34637 0 : return py_svcctl_EnumServicesStatusExW_ndr_print(py_obj, "svcctl_EnumServicesStatusExW_in", NDR_IN);
34638 : }
34639 :
34640 0 : static PyObject *py_svcctl_EnumServicesStatusExW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34641 : {
34642 0 : return py_svcctl_EnumServicesStatusExW_ndr_print(py_obj, "svcctl_EnumServicesStatusExW_out", NDR_OUT);
34643 : }
34644 :
34645 : static PyMethodDef py_svcctl_EnumServicesStatusExW_methods[] = {
34646 : { "opnum", (PyCFunction)py_svcctl_EnumServicesStatusExW_ndr_opnum, METH_NOARGS|METH_CLASS,
34647 : "svcctl.EnumServicesStatusExW.opnum() -> 42 (0x2a) " },
34648 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34649 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34650 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34651 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34652 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34653 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34654 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusExW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34655 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34656 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumServicesStatusExW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34657 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumServicesStatusExW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34658 : { NULL, NULL, 0, NULL }
34659 : };
34660 :
34661 :
34662 : static PyTypeObject svcctl_EnumServicesStatusExW_Type = {
34663 : PyVarObject_HEAD_INIT(NULL, 0)
34664 : .tp_name = "svcctl.EnumServicesStatusExW",
34665 : .tp_getset = py_svcctl_EnumServicesStatusExW_getsetters,
34666 : .tp_methods = py_svcctl_EnumServicesStatusExW_methods,
34667 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34668 : .tp_new = py_svcctl_EnumServicesStatusExW_new,
34669 : };
34670 :
34671 0 : static bool pack_py_svcctl_EnumServicesStatusExW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumServicesStatusExW *r)
34672 : {
34673 0 : PyObject *py_scmanager;
34674 0 : PyObject *py_info_level;
34675 0 : PyObject *py_type;
34676 0 : PyObject *py_state;
34677 0 : PyObject *py_offered;
34678 0 : PyObject *py_resume_handle;
34679 0 : PyObject *py_group_name;
34680 0 : const char *kwnames[] = {
34681 : "scmanager", "info_level", "type", "state", "offered", "resume_handle", "group_name", NULL
34682 : };
34683 :
34684 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:svcctl_EnumServicesStatusExW", discard_const_p(char *, kwnames), &py_scmanager, &py_info_level, &py_type, &py_state, &py_offered, &py_resume_handle, &py_group_name)) {
34685 0 : return false;
34686 : }
34687 :
34688 0 : if (py_scmanager == NULL) {
34689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager");
34690 0 : return false;
34691 : }
34692 0 : r->in.scmanager = talloc_ptrtype(r, r->in.scmanager);
34693 0 : if (r->in.scmanager == NULL) {
34694 0 : PyErr_NoMemory();
34695 0 : return false;
34696 : }
34697 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager, return false;);
34698 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager)) == NULL) {
34699 0 : PyErr_NoMemory();
34700 0 : return false;
34701 : }
34702 0 : r->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(py_scmanager);
34703 0 : if (py_info_level == NULL) {
34704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
34705 0 : return false;
34706 : }
34707 : {
34708 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
34709 0 : if (PyLong_Check(py_info_level)) {
34710 0 : unsigned long long test_var;
34711 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
34712 0 : if (PyErr_Occurred() != NULL) {
34713 0 : return false;
34714 : }
34715 0 : if (test_var > uint_max) {
34716 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34717 : PyLong_Type.tp_name, uint_max, test_var);
34718 0 : return false;
34719 : }
34720 0 : r->in.info_level = test_var;
34721 : } else {
34722 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34723 : PyLong_Type.tp_name);
34724 0 : return false;
34725 : }
34726 : }
34727 0 : if (py_type == NULL) {
34728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
34729 0 : return false;
34730 : }
34731 : {
34732 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
34733 0 : if (PyLong_Check(py_type)) {
34734 0 : unsigned long long test_var;
34735 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
34736 0 : if (PyErr_Occurred() != NULL) {
34737 0 : return false;
34738 : }
34739 0 : if (test_var > uint_max) {
34740 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34741 : PyLong_Type.tp_name, uint_max, test_var);
34742 0 : return false;
34743 : }
34744 0 : r->in.type = test_var;
34745 : } else {
34746 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34747 : PyLong_Type.tp_name);
34748 0 : return false;
34749 : }
34750 : }
34751 0 : if (py_state == NULL) {
34752 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
34753 0 : return false;
34754 : }
34755 : {
34756 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
34757 0 : if (PyLong_Check(py_state)) {
34758 0 : unsigned long long test_var;
34759 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
34760 0 : if (PyErr_Occurred() != NULL) {
34761 0 : return false;
34762 : }
34763 0 : if (test_var > uint_max) {
34764 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34765 : PyLong_Type.tp_name, uint_max, test_var);
34766 0 : return false;
34767 : }
34768 0 : r->in.state = test_var;
34769 : } else {
34770 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34771 : PyLong_Type.tp_name);
34772 0 : return false;
34773 : }
34774 : }
34775 0 : if (py_offered == NULL) {
34776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
34777 0 : return false;
34778 : }
34779 : {
34780 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
34781 0 : if (PyLong_Check(py_offered)) {
34782 0 : unsigned long long test_var;
34783 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
34784 0 : if (PyErr_Occurred() != NULL) {
34785 0 : return false;
34786 : }
34787 0 : if (test_var > uint_max) {
34788 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34789 : PyLong_Type.tp_name, uint_max, test_var);
34790 0 : return false;
34791 : }
34792 0 : r->in.offered = test_var;
34793 : } else {
34794 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34795 : PyLong_Type.tp_name);
34796 0 : return false;
34797 : }
34798 : }
34799 0 : if (py_resume_handle == NULL) {
34800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
34801 0 : return false;
34802 : }
34803 0 : if (py_resume_handle == Py_None) {
34804 0 : r->in.resume_handle = NULL;
34805 : } else {
34806 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
34807 0 : if (r->in.resume_handle == NULL) {
34808 0 : PyErr_NoMemory();
34809 0 : return false;
34810 : }
34811 : {
34812 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
34813 0 : if (PyLong_Check(py_resume_handle)) {
34814 0 : unsigned long long test_var;
34815 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
34816 0 : if (PyErr_Occurred() != NULL) {
34817 0 : return false;
34818 : }
34819 0 : if (test_var > uint_max) {
34820 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34821 : PyLong_Type.tp_name, uint_max, test_var);
34822 0 : return false;
34823 : }
34824 0 : *r->in.resume_handle = test_var;
34825 : } else {
34826 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34827 : PyLong_Type.tp_name);
34828 0 : return false;
34829 : }
34830 : }
34831 : }
34832 0 : if (py_group_name == NULL) {
34833 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_name");
34834 0 : return false;
34835 : }
34836 0 : if (py_group_name == Py_None) {
34837 0 : r->in.group_name = NULL;
34838 : } else {
34839 0 : r->in.group_name = NULL;
34840 : {
34841 0 : const char *test_str;
34842 0 : const char *talloc_str;
34843 0 : PyObject *unicode = NULL;
34844 0 : if (PyUnicode_Check(py_group_name)) {
34845 0 : unicode = PyUnicode_AsEncodedString(py_group_name, "utf-8", "ignore");
34846 0 : if (unicode == NULL) {
34847 0 : return false;
34848 : }
34849 0 : test_str = PyBytes_AS_STRING(unicode);
34850 0 : } else if (PyBytes_Check(py_group_name)) {
34851 0 : test_str = PyBytes_AS_STRING(py_group_name);
34852 : } else {
34853 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_group_name)->tp_name);
34854 0 : return false;
34855 : }
34856 0 : talloc_str = talloc_strdup(r, test_str);
34857 0 : if (unicode != NULL) {
34858 0 : Py_DECREF(unicode);
34859 : }
34860 0 : if (talloc_str == NULL) {
34861 0 : PyErr_NoMemory();
34862 0 : return false;
34863 : }
34864 0 : r->in.group_name = talloc_str;
34865 : }
34866 : }
34867 0 : return true;
34868 : }
34869 :
34870 0 : static PyObject *unpack_py_svcctl_EnumServicesStatusExW_args_out(struct svcctl_EnumServicesStatusExW *r)
34871 : {
34872 0 : PyObject *result;
34873 0 : PyObject *py_services;
34874 0 : PyObject *py_needed;
34875 0 : PyObject *py_service_returned;
34876 0 : PyObject *py_resume_handle;
34877 0 : result = PyTuple_New(4);
34878 0 : py_services = PyList_New(r->in.offered);
34879 0 : if (py_services == NULL) {
34880 0 : return NULL;
34881 : }
34882 : {
34883 : int services_cntr_1;
34884 0 : for (services_cntr_1 = 0; services_cntr_1 < (r->in.offered); services_cntr_1++) {
34885 0 : PyObject *py_services_1;
34886 0 : py_services_1 = PyLong_FromLong((uint16_t)r->out.services[services_cntr_1]);
34887 0 : PyList_SetItem(py_services, services_cntr_1, py_services_1);
34888 : }
34889 : }
34890 0 : PyTuple_SetItem(result, 0, py_services);
34891 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
34892 0 : PyTuple_SetItem(result, 1, py_needed);
34893 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.service_returned);
34894 0 : PyTuple_SetItem(result, 2, py_service_returned);
34895 0 : if (r->out.resume_handle == NULL) {
34896 0 : py_resume_handle = Py_None;
34897 0 : Py_INCREF(py_resume_handle);
34898 : } else {
34899 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
34900 : }
34901 0 : PyTuple_SetItem(result, 3, py_resume_handle);
34902 0 : if (!W_ERROR_IS_OK(r->out.result)) {
34903 0 : PyErr_SetWERROR(r->out.result);
34904 0 : return NULL;
34905 : }
34906 :
34907 0 : return result;
34908 : }
34909 :
34910 :
34911 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_hSCManager(PyObject *obj, void *closure)
34912 : {
34913 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
34914 0 : PyObject *py_hSCManager;
34915 0 : py_hSCManager = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hSCManager);
34916 0 : return py_hSCManager;
34917 : }
34918 :
34919 0 : static int py_svcctl_CreateServiceWOW64A_in_set_hSCManager(PyObject *py_obj, PyObject *value, void *closure)
34920 : {
34921 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
34922 0 : if (value == NULL) {
34923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hSCManager");
34924 0 : return -1;
34925 : }
34926 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
34927 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34928 0 : PyErr_NoMemory();
34929 0 : return -1;
34930 : }
34931 0 : object->in.hSCManager = *(struct policy_handle *)pytalloc_get_ptr(value);
34932 0 : return 0;
34933 : }
34934 :
34935 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpServiceName(PyObject *obj, void *closure)
34936 : {
34937 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
34938 0 : PyObject *py_lpServiceName;
34939 0 : if (object->in.lpServiceName == NULL) {
34940 0 : Py_RETURN_NONE;
34941 : }
34942 0 : if (object->in.lpServiceName == NULL) {
34943 0 : py_lpServiceName = Py_None;
34944 0 : Py_INCREF(py_lpServiceName);
34945 : } else {
34946 0 : py_lpServiceName = PyUnicode_Decode(object->in.lpServiceName, strlen(object->in.lpServiceName), "utf-8", "ignore");
34947 : }
34948 0 : return py_lpServiceName;
34949 : }
34950 :
34951 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpServiceName(PyObject *py_obj, PyObject *value, void *closure)
34952 : {
34953 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
34954 0 : if (value == NULL) {
34955 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpServiceName");
34956 0 : return -1;
34957 : }
34958 0 : object->in.lpServiceName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpServiceName);
34959 0 : if (object->in.lpServiceName == NULL) {
34960 0 : PyErr_NoMemory();
34961 0 : return -1;
34962 : }
34963 : {
34964 0 : const char *test_str;
34965 0 : const char *talloc_str;
34966 0 : PyObject *unicode = NULL;
34967 0 : if (PyUnicode_Check(value)) {
34968 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
34969 0 : if (unicode == NULL) {
34970 0 : return -1;
34971 : }
34972 0 : test_str = PyBytes_AS_STRING(unicode);
34973 0 : } else if (PyBytes_Check(value)) {
34974 0 : test_str = PyBytes_AS_STRING(value);
34975 : } else {
34976 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
34977 0 : return -1;
34978 : }
34979 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
34980 0 : if (unicode != NULL) {
34981 0 : Py_DECREF(unicode);
34982 : }
34983 0 : if (talloc_str == NULL) {
34984 0 : PyErr_NoMemory();
34985 0 : return -1;
34986 : }
34987 0 : object->in.lpServiceName = talloc_str;
34988 : }
34989 0 : return 0;
34990 : }
34991 :
34992 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpDisplayName(PyObject *obj, void *closure)
34993 : {
34994 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
34995 0 : PyObject *py_lpDisplayName;
34996 0 : if (object->in.lpDisplayName == NULL) {
34997 0 : Py_RETURN_NONE;
34998 : }
34999 0 : if (object->in.lpDisplayName == NULL) {
35000 0 : py_lpDisplayName = Py_None;
35001 0 : Py_INCREF(py_lpDisplayName);
35002 : } else {
35003 0 : if (object->in.lpDisplayName == NULL) {
35004 0 : py_lpDisplayName = Py_None;
35005 0 : Py_INCREF(py_lpDisplayName);
35006 : } else {
35007 0 : py_lpDisplayName = PyUnicode_Decode(object->in.lpDisplayName, strlen(object->in.lpDisplayName), "utf-8", "ignore");
35008 : }
35009 : }
35010 0 : return py_lpDisplayName;
35011 : }
35012 :
35013 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpDisplayName(PyObject *py_obj, PyObject *value, void *closure)
35014 : {
35015 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35016 0 : if (value == NULL) {
35017 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDisplayName");
35018 0 : return -1;
35019 : }
35020 0 : if (value == Py_None) {
35021 0 : object->in.lpDisplayName = NULL;
35022 : } else {
35023 0 : object->in.lpDisplayName = NULL;
35024 : {
35025 0 : const char *test_str;
35026 0 : const char *talloc_str;
35027 0 : PyObject *unicode = NULL;
35028 0 : if (PyUnicode_Check(value)) {
35029 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35030 0 : if (unicode == NULL) {
35031 0 : return -1;
35032 : }
35033 0 : test_str = PyBytes_AS_STRING(unicode);
35034 0 : } else if (PyBytes_Check(value)) {
35035 0 : test_str = PyBytes_AS_STRING(value);
35036 : } else {
35037 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35038 0 : return -1;
35039 : }
35040 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35041 0 : if (unicode != NULL) {
35042 0 : Py_DECREF(unicode);
35043 : }
35044 0 : if (talloc_str == NULL) {
35045 0 : PyErr_NoMemory();
35046 0 : return -1;
35047 : }
35048 0 : object->in.lpDisplayName = talloc_str;
35049 : }
35050 : }
35051 0 : return 0;
35052 : }
35053 :
35054 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_dwDesiredAccess(PyObject *obj, void *closure)
35055 : {
35056 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35057 0 : PyObject *py_dwDesiredAccess;
35058 0 : py_dwDesiredAccess = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDesiredAccess);
35059 0 : return py_dwDesiredAccess;
35060 : }
35061 :
35062 0 : static int py_svcctl_CreateServiceWOW64A_in_set_dwDesiredAccess(PyObject *py_obj, PyObject *value, void *closure)
35063 : {
35064 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35065 0 : if (value == NULL) {
35066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDesiredAccess");
35067 0 : return -1;
35068 : }
35069 : {
35070 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDesiredAccess));
35071 0 : if (PyLong_Check(value)) {
35072 0 : unsigned long long test_var;
35073 0 : test_var = PyLong_AsUnsignedLongLong(value);
35074 0 : if (PyErr_Occurred() != NULL) {
35075 0 : return -1;
35076 : }
35077 0 : if (test_var > uint_max) {
35078 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35079 : PyLong_Type.tp_name, uint_max, test_var);
35080 0 : return -1;
35081 : }
35082 0 : object->in.dwDesiredAccess = test_var;
35083 : } else {
35084 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35085 : PyLong_Type.tp_name);
35086 0 : return -1;
35087 : }
35088 : }
35089 0 : return 0;
35090 : }
35091 :
35092 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_dwServiceType(PyObject *obj, void *closure)
35093 : {
35094 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35095 0 : PyObject *py_dwServiceType;
35096 0 : py_dwServiceType = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwServiceType);
35097 0 : return py_dwServiceType;
35098 : }
35099 :
35100 0 : static int py_svcctl_CreateServiceWOW64A_in_set_dwServiceType(PyObject *py_obj, PyObject *value, void *closure)
35101 : {
35102 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35103 0 : if (value == NULL) {
35104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwServiceType");
35105 0 : return -1;
35106 : }
35107 : {
35108 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwServiceType));
35109 0 : if (PyLong_Check(value)) {
35110 0 : unsigned long long test_var;
35111 0 : test_var = PyLong_AsUnsignedLongLong(value);
35112 0 : if (PyErr_Occurred() != NULL) {
35113 0 : return -1;
35114 : }
35115 0 : if (test_var > uint_max) {
35116 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35117 : PyLong_Type.tp_name, uint_max, test_var);
35118 0 : return -1;
35119 : }
35120 0 : object->in.dwServiceType = test_var;
35121 : } else {
35122 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35123 : PyLong_Type.tp_name);
35124 0 : return -1;
35125 : }
35126 : }
35127 0 : return 0;
35128 : }
35129 :
35130 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_dwStartType(PyObject *obj, void *closure)
35131 : {
35132 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35133 0 : PyObject *py_dwStartType;
35134 0 : py_dwStartType = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwStartType);
35135 0 : return py_dwStartType;
35136 : }
35137 :
35138 0 : static int py_svcctl_CreateServiceWOW64A_in_set_dwStartType(PyObject *py_obj, PyObject *value, void *closure)
35139 : {
35140 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35141 0 : if (value == NULL) {
35142 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwStartType");
35143 0 : return -1;
35144 : }
35145 : {
35146 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwStartType));
35147 0 : if (PyLong_Check(value)) {
35148 0 : unsigned long long test_var;
35149 0 : test_var = PyLong_AsUnsignedLongLong(value);
35150 0 : if (PyErr_Occurred() != NULL) {
35151 0 : return -1;
35152 : }
35153 0 : if (test_var > uint_max) {
35154 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35155 : PyLong_Type.tp_name, uint_max, test_var);
35156 0 : return -1;
35157 : }
35158 0 : object->in.dwStartType = test_var;
35159 : } else {
35160 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35161 : PyLong_Type.tp_name);
35162 0 : return -1;
35163 : }
35164 : }
35165 0 : return 0;
35166 : }
35167 :
35168 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_dwErrorControl(PyObject *obj, void *closure)
35169 : {
35170 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35171 0 : PyObject *py_dwErrorControl;
35172 0 : py_dwErrorControl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwErrorControl);
35173 0 : return py_dwErrorControl;
35174 : }
35175 :
35176 0 : static int py_svcctl_CreateServiceWOW64A_in_set_dwErrorControl(PyObject *py_obj, PyObject *value, void *closure)
35177 : {
35178 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35179 0 : if (value == NULL) {
35180 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwErrorControl");
35181 0 : return -1;
35182 : }
35183 : {
35184 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwErrorControl));
35185 0 : if (PyLong_Check(value)) {
35186 0 : unsigned long long test_var;
35187 0 : test_var = PyLong_AsUnsignedLongLong(value);
35188 0 : if (PyErr_Occurred() != NULL) {
35189 0 : return -1;
35190 : }
35191 0 : if (test_var > uint_max) {
35192 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35193 : PyLong_Type.tp_name, uint_max, test_var);
35194 0 : return -1;
35195 : }
35196 0 : object->in.dwErrorControl = test_var;
35197 : } else {
35198 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35199 : PyLong_Type.tp_name);
35200 0 : return -1;
35201 : }
35202 : }
35203 0 : return 0;
35204 : }
35205 :
35206 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpBinaryPathName(PyObject *obj, void *closure)
35207 : {
35208 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35209 0 : PyObject *py_lpBinaryPathName;
35210 0 : if (object->in.lpBinaryPathName == NULL) {
35211 0 : Py_RETURN_NONE;
35212 : }
35213 0 : if (object->in.lpBinaryPathName == NULL) {
35214 0 : py_lpBinaryPathName = Py_None;
35215 0 : Py_INCREF(py_lpBinaryPathName);
35216 : } else {
35217 0 : py_lpBinaryPathName = PyUnicode_Decode(object->in.lpBinaryPathName, strlen(object->in.lpBinaryPathName), "utf-8", "ignore");
35218 : }
35219 0 : return py_lpBinaryPathName;
35220 : }
35221 :
35222 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpBinaryPathName(PyObject *py_obj, PyObject *value, void *closure)
35223 : {
35224 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35225 0 : if (value == NULL) {
35226 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpBinaryPathName");
35227 0 : return -1;
35228 : }
35229 0 : object->in.lpBinaryPathName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpBinaryPathName);
35230 0 : if (object->in.lpBinaryPathName == NULL) {
35231 0 : PyErr_NoMemory();
35232 0 : return -1;
35233 : }
35234 : {
35235 0 : const char *test_str;
35236 0 : const char *talloc_str;
35237 0 : PyObject *unicode = NULL;
35238 0 : if (PyUnicode_Check(value)) {
35239 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35240 0 : if (unicode == NULL) {
35241 0 : return -1;
35242 : }
35243 0 : test_str = PyBytes_AS_STRING(unicode);
35244 0 : } else if (PyBytes_Check(value)) {
35245 0 : test_str = PyBytes_AS_STRING(value);
35246 : } else {
35247 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35248 0 : return -1;
35249 : }
35250 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35251 0 : if (unicode != NULL) {
35252 0 : Py_DECREF(unicode);
35253 : }
35254 0 : if (talloc_str == NULL) {
35255 0 : PyErr_NoMemory();
35256 0 : return -1;
35257 : }
35258 0 : object->in.lpBinaryPathName = talloc_str;
35259 : }
35260 0 : return 0;
35261 : }
35262 :
35263 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpLoadOrderGroup(PyObject *obj, void *closure)
35264 : {
35265 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35266 0 : PyObject *py_lpLoadOrderGroup;
35267 0 : if (object->in.lpLoadOrderGroup == NULL) {
35268 0 : Py_RETURN_NONE;
35269 : }
35270 0 : if (object->in.lpLoadOrderGroup == NULL) {
35271 0 : py_lpLoadOrderGroup = Py_None;
35272 0 : Py_INCREF(py_lpLoadOrderGroup);
35273 : } else {
35274 0 : if (object->in.lpLoadOrderGroup == NULL) {
35275 0 : py_lpLoadOrderGroup = Py_None;
35276 0 : Py_INCREF(py_lpLoadOrderGroup);
35277 : } else {
35278 0 : py_lpLoadOrderGroup = PyUnicode_Decode(object->in.lpLoadOrderGroup, strlen(object->in.lpLoadOrderGroup), "utf-8", "ignore");
35279 : }
35280 : }
35281 0 : return py_lpLoadOrderGroup;
35282 : }
35283 :
35284 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpLoadOrderGroup(PyObject *py_obj, PyObject *value, void *closure)
35285 : {
35286 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35287 0 : if (value == NULL) {
35288 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpLoadOrderGroup");
35289 0 : return -1;
35290 : }
35291 0 : if (value == Py_None) {
35292 0 : object->in.lpLoadOrderGroup = NULL;
35293 : } else {
35294 0 : object->in.lpLoadOrderGroup = NULL;
35295 : {
35296 0 : const char *test_str;
35297 0 : const char *talloc_str;
35298 0 : PyObject *unicode = NULL;
35299 0 : if (PyUnicode_Check(value)) {
35300 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35301 0 : if (unicode == NULL) {
35302 0 : return -1;
35303 : }
35304 0 : test_str = PyBytes_AS_STRING(unicode);
35305 0 : } else if (PyBytes_Check(value)) {
35306 0 : test_str = PyBytes_AS_STRING(value);
35307 : } else {
35308 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35309 0 : return -1;
35310 : }
35311 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35312 0 : if (unicode != NULL) {
35313 0 : Py_DECREF(unicode);
35314 : }
35315 0 : if (talloc_str == NULL) {
35316 0 : PyErr_NoMemory();
35317 0 : return -1;
35318 : }
35319 0 : object->in.lpLoadOrderGroup = talloc_str;
35320 : }
35321 : }
35322 0 : return 0;
35323 : }
35324 :
35325 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpdwTagId(PyObject *obj, void *closure)
35326 : {
35327 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35328 0 : PyObject *py_lpdwTagId;
35329 0 : if (object->in.lpdwTagId == NULL) {
35330 0 : Py_RETURN_NONE;
35331 : }
35332 0 : if (object->in.lpdwTagId == NULL) {
35333 0 : py_lpdwTagId = Py_None;
35334 0 : Py_INCREF(py_lpdwTagId);
35335 : } else {
35336 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*object->in.lpdwTagId);
35337 : }
35338 0 : return py_lpdwTagId;
35339 : }
35340 :
35341 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpdwTagId(PyObject *py_obj, PyObject *value, void *closure)
35342 : {
35343 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35344 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpdwTagId));
35345 0 : if (value == NULL) {
35346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpdwTagId");
35347 0 : return -1;
35348 : }
35349 0 : if (value == Py_None) {
35350 0 : object->in.lpdwTagId = NULL;
35351 : } else {
35352 0 : object->in.lpdwTagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpdwTagId);
35353 0 : if (object->in.lpdwTagId == NULL) {
35354 0 : PyErr_NoMemory();
35355 0 : return -1;
35356 : }
35357 : {
35358 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.lpdwTagId));
35359 0 : if (PyLong_Check(value)) {
35360 0 : unsigned long long test_var;
35361 0 : test_var = PyLong_AsUnsignedLongLong(value);
35362 0 : if (PyErr_Occurred() != NULL) {
35363 0 : return -1;
35364 : }
35365 0 : if (test_var > uint_max) {
35366 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35367 : PyLong_Type.tp_name, uint_max, test_var);
35368 0 : return -1;
35369 : }
35370 0 : *object->in.lpdwTagId = test_var;
35371 : } else {
35372 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35373 : PyLong_Type.tp_name);
35374 0 : return -1;
35375 : }
35376 : }
35377 : }
35378 0 : return 0;
35379 : }
35380 :
35381 0 : static PyObject *py_svcctl_CreateServiceWOW64A_out_get_lpdwTagId(PyObject *obj, void *closure)
35382 : {
35383 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35384 0 : PyObject *py_lpdwTagId;
35385 0 : if (object->out.lpdwTagId == NULL) {
35386 0 : Py_RETURN_NONE;
35387 : }
35388 0 : if (object->out.lpdwTagId == NULL) {
35389 0 : py_lpdwTagId = Py_None;
35390 0 : Py_INCREF(py_lpdwTagId);
35391 : } else {
35392 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.lpdwTagId);
35393 : }
35394 0 : return py_lpdwTagId;
35395 : }
35396 :
35397 0 : static int py_svcctl_CreateServiceWOW64A_out_set_lpdwTagId(PyObject *py_obj, PyObject *value, void *closure)
35398 : {
35399 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35400 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lpdwTagId));
35401 0 : if (value == NULL) {
35402 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lpdwTagId");
35403 0 : return -1;
35404 : }
35405 0 : if (value == Py_None) {
35406 0 : object->out.lpdwTagId = NULL;
35407 : } else {
35408 0 : object->out.lpdwTagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lpdwTagId);
35409 0 : if (object->out.lpdwTagId == NULL) {
35410 0 : PyErr_NoMemory();
35411 0 : return -1;
35412 : }
35413 : {
35414 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.lpdwTagId));
35415 0 : if (PyLong_Check(value)) {
35416 0 : unsigned long long test_var;
35417 0 : test_var = PyLong_AsUnsignedLongLong(value);
35418 0 : if (PyErr_Occurred() != NULL) {
35419 0 : return -1;
35420 : }
35421 0 : if (test_var > uint_max) {
35422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35423 : PyLong_Type.tp_name, uint_max, test_var);
35424 0 : return -1;
35425 : }
35426 0 : *object->out.lpdwTagId = test_var;
35427 : } else {
35428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35429 : PyLong_Type.tp_name);
35430 0 : return -1;
35431 : }
35432 : }
35433 : }
35434 0 : return 0;
35435 : }
35436 :
35437 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpDependencies(PyObject *obj, void *closure)
35438 : {
35439 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35440 0 : PyObject *py_lpDependencies;
35441 0 : if (object->in.lpDependencies == NULL) {
35442 0 : Py_RETURN_NONE;
35443 : }
35444 0 : if (object->in.lpDependencies == NULL) {
35445 0 : py_lpDependencies = Py_None;
35446 0 : Py_INCREF(py_lpDependencies);
35447 : } else {
35448 0 : py_lpDependencies = PyList_New(object->in.dwDependSize);
35449 0 : if (py_lpDependencies == NULL) {
35450 0 : return NULL;
35451 : }
35452 : {
35453 : int lpDependencies_cntr_1;
35454 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < (object->in.dwDependSize); lpDependencies_cntr_1++) {
35455 0 : PyObject *py_lpDependencies_1;
35456 0 : py_lpDependencies_1 = PyLong_FromLong((uint16_t)object->in.lpDependencies[lpDependencies_cntr_1]);
35457 0 : PyList_SetItem(py_lpDependencies, lpDependencies_cntr_1, py_lpDependencies_1);
35458 : }
35459 : }
35460 : }
35461 0 : return py_lpDependencies;
35462 : }
35463 :
35464 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpDependencies(PyObject *py_obj, PyObject *value, void *closure)
35465 : {
35466 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35467 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpDependencies));
35468 0 : if (value == NULL) {
35469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDependencies");
35470 0 : return -1;
35471 : }
35472 0 : if (value == Py_None) {
35473 0 : object->in.lpDependencies = NULL;
35474 : } else {
35475 0 : object->in.lpDependencies = NULL;
35476 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
35477 : {
35478 0 : int lpDependencies_cntr_1;
35479 0 : object->in.lpDependencies = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpDependencies, PyList_GET_SIZE(value));
35480 0 : if (!object->in.lpDependencies) { return -1; }
35481 0 : talloc_set_name_const(object->in.lpDependencies, "ARRAY: object->in.lpDependencies");
35482 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < PyList_GET_SIZE(value); lpDependencies_cntr_1++) {
35483 0 : if (PyList_GET_ITEM(value, lpDependencies_cntr_1) == NULL) {
35484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDependencies[lpDependencies_cntr_1]");
35485 0 : return -1;
35486 : }
35487 : {
35488 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lpDependencies[lpDependencies_cntr_1]));
35489 0 : if (PyLong_Check(PyList_GET_ITEM(value, lpDependencies_cntr_1))) {
35490 0 : unsigned long long test_var;
35491 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lpDependencies_cntr_1));
35492 0 : if (PyErr_Occurred() != NULL) {
35493 0 : return -1;
35494 : }
35495 0 : if (test_var > uint_max) {
35496 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35497 : PyLong_Type.tp_name, uint_max, test_var);
35498 0 : return -1;
35499 : }
35500 0 : object->in.lpDependencies[lpDependencies_cntr_1] = test_var;
35501 : } else {
35502 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35503 : PyLong_Type.tp_name);
35504 0 : return -1;
35505 : }
35506 : }
35507 : }
35508 : }
35509 : }
35510 0 : return 0;
35511 : }
35512 :
35513 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_dwDependSize(PyObject *obj, void *closure)
35514 : {
35515 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35516 0 : PyObject *py_dwDependSize;
35517 0 : py_dwDependSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDependSize);
35518 0 : return py_dwDependSize;
35519 : }
35520 :
35521 0 : static int py_svcctl_CreateServiceWOW64A_in_set_dwDependSize(PyObject *py_obj, PyObject *value, void *closure)
35522 : {
35523 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35524 0 : if (value == NULL) {
35525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDependSize");
35526 0 : return -1;
35527 : }
35528 : {
35529 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDependSize));
35530 0 : if (PyLong_Check(value)) {
35531 0 : unsigned long long test_var;
35532 0 : test_var = PyLong_AsUnsignedLongLong(value);
35533 0 : if (PyErr_Occurred() != NULL) {
35534 0 : return -1;
35535 : }
35536 0 : if (test_var > uint_max) {
35537 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35538 : PyLong_Type.tp_name, uint_max, test_var);
35539 0 : return -1;
35540 : }
35541 0 : object->in.dwDependSize = test_var;
35542 : } else {
35543 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35544 : PyLong_Type.tp_name);
35545 0 : return -1;
35546 : }
35547 : }
35548 0 : return 0;
35549 : }
35550 :
35551 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpServiceStartName(PyObject *obj, void *closure)
35552 : {
35553 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35554 0 : PyObject *py_lpServiceStartName;
35555 0 : if (object->in.lpServiceStartName == NULL) {
35556 0 : Py_RETURN_NONE;
35557 : }
35558 0 : if (object->in.lpServiceStartName == NULL) {
35559 0 : py_lpServiceStartName = Py_None;
35560 0 : Py_INCREF(py_lpServiceStartName);
35561 : } else {
35562 0 : if (object->in.lpServiceStartName == NULL) {
35563 0 : py_lpServiceStartName = Py_None;
35564 0 : Py_INCREF(py_lpServiceStartName);
35565 : } else {
35566 0 : py_lpServiceStartName = PyUnicode_Decode(object->in.lpServiceStartName, strlen(object->in.lpServiceStartName), "utf-8", "ignore");
35567 : }
35568 : }
35569 0 : return py_lpServiceStartName;
35570 : }
35571 :
35572 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpServiceStartName(PyObject *py_obj, PyObject *value, void *closure)
35573 : {
35574 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35575 0 : if (value == NULL) {
35576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpServiceStartName");
35577 0 : return -1;
35578 : }
35579 0 : if (value == Py_None) {
35580 0 : object->in.lpServiceStartName = NULL;
35581 : } else {
35582 0 : object->in.lpServiceStartName = NULL;
35583 : {
35584 0 : const char *test_str;
35585 0 : const char *talloc_str;
35586 0 : PyObject *unicode = NULL;
35587 0 : if (PyUnicode_Check(value)) {
35588 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35589 0 : if (unicode == NULL) {
35590 0 : return -1;
35591 : }
35592 0 : test_str = PyBytes_AS_STRING(unicode);
35593 0 : } else if (PyBytes_Check(value)) {
35594 0 : test_str = PyBytes_AS_STRING(value);
35595 : } else {
35596 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35597 0 : return -1;
35598 : }
35599 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35600 0 : if (unicode != NULL) {
35601 0 : Py_DECREF(unicode);
35602 : }
35603 0 : if (talloc_str == NULL) {
35604 0 : PyErr_NoMemory();
35605 0 : return -1;
35606 : }
35607 0 : object->in.lpServiceStartName = talloc_str;
35608 : }
35609 : }
35610 0 : return 0;
35611 : }
35612 :
35613 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_lpPassword(PyObject *obj, void *closure)
35614 : {
35615 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35616 0 : PyObject *py_lpPassword;
35617 0 : if (object->in.lpPassword == NULL) {
35618 0 : Py_RETURN_NONE;
35619 : }
35620 0 : if (object->in.lpPassword == NULL) {
35621 0 : py_lpPassword = Py_None;
35622 0 : Py_INCREF(py_lpPassword);
35623 : } else {
35624 0 : py_lpPassword = PyList_New(object->in.dwPwSize);
35625 0 : if (py_lpPassword == NULL) {
35626 0 : return NULL;
35627 : }
35628 : {
35629 : int lpPassword_cntr_1;
35630 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < (object->in.dwPwSize); lpPassword_cntr_1++) {
35631 0 : PyObject *py_lpPassword_1;
35632 0 : py_lpPassword_1 = PyLong_FromLong((uint16_t)object->in.lpPassword[lpPassword_cntr_1]);
35633 0 : PyList_SetItem(py_lpPassword, lpPassword_cntr_1, py_lpPassword_1);
35634 : }
35635 : }
35636 : }
35637 0 : return py_lpPassword;
35638 : }
35639 :
35640 0 : static int py_svcctl_CreateServiceWOW64A_in_set_lpPassword(PyObject *py_obj, PyObject *value, void *closure)
35641 : {
35642 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35643 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpPassword));
35644 0 : if (value == NULL) {
35645 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpPassword");
35646 0 : return -1;
35647 : }
35648 0 : if (value == Py_None) {
35649 0 : object->in.lpPassword = NULL;
35650 : } else {
35651 0 : object->in.lpPassword = NULL;
35652 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
35653 : {
35654 0 : int lpPassword_cntr_1;
35655 0 : object->in.lpPassword = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpPassword, PyList_GET_SIZE(value));
35656 0 : if (!object->in.lpPassword) { return -1; }
35657 0 : talloc_set_name_const(object->in.lpPassword, "ARRAY: object->in.lpPassword");
35658 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < PyList_GET_SIZE(value); lpPassword_cntr_1++) {
35659 0 : if (PyList_GET_ITEM(value, lpPassword_cntr_1) == NULL) {
35660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpPassword[lpPassword_cntr_1]");
35661 0 : return -1;
35662 : }
35663 : {
35664 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lpPassword[lpPassword_cntr_1]));
35665 0 : if (PyLong_Check(PyList_GET_ITEM(value, lpPassword_cntr_1))) {
35666 0 : unsigned long long test_var;
35667 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lpPassword_cntr_1));
35668 0 : if (PyErr_Occurred() != NULL) {
35669 0 : return -1;
35670 : }
35671 0 : if (test_var > uint_max) {
35672 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35673 : PyLong_Type.tp_name, uint_max, test_var);
35674 0 : return -1;
35675 : }
35676 0 : object->in.lpPassword[lpPassword_cntr_1] = test_var;
35677 : } else {
35678 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35679 : PyLong_Type.tp_name);
35680 0 : return -1;
35681 : }
35682 : }
35683 : }
35684 : }
35685 : }
35686 0 : return 0;
35687 : }
35688 :
35689 0 : static PyObject *py_svcctl_CreateServiceWOW64A_in_get_dwPwSize(PyObject *obj, void *closure)
35690 : {
35691 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35692 0 : PyObject *py_dwPwSize;
35693 0 : py_dwPwSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwPwSize);
35694 0 : return py_dwPwSize;
35695 : }
35696 :
35697 0 : static int py_svcctl_CreateServiceWOW64A_in_set_dwPwSize(PyObject *py_obj, PyObject *value, void *closure)
35698 : {
35699 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35700 0 : if (value == NULL) {
35701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwPwSize");
35702 0 : return -1;
35703 : }
35704 : {
35705 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwPwSize));
35706 0 : if (PyLong_Check(value)) {
35707 0 : unsigned long long test_var;
35708 0 : test_var = PyLong_AsUnsignedLongLong(value);
35709 0 : if (PyErr_Occurred() != NULL) {
35710 0 : return -1;
35711 : }
35712 0 : if (test_var > uint_max) {
35713 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35714 : PyLong_Type.tp_name, uint_max, test_var);
35715 0 : return -1;
35716 : }
35717 0 : object->in.dwPwSize = test_var;
35718 : } else {
35719 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35720 : PyLong_Type.tp_name);
35721 0 : return -1;
35722 : }
35723 : }
35724 0 : return 0;
35725 : }
35726 :
35727 0 : static PyObject *py_svcctl_CreateServiceWOW64A_out_get_lpServiceHandle(PyObject *obj, void *closure)
35728 : {
35729 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35730 0 : PyObject *py_lpServiceHandle;
35731 0 : if (object->out.lpServiceHandle == NULL) {
35732 0 : Py_RETURN_NONE;
35733 : }
35734 0 : py_lpServiceHandle = pytalloc_reference_ex(policy_handle_Type, object->out.lpServiceHandle, object->out.lpServiceHandle);
35735 0 : return py_lpServiceHandle;
35736 : }
35737 :
35738 0 : static int py_svcctl_CreateServiceWOW64A_out_set_lpServiceHandle(PyObject *py_obj, PyObject *value, void *closure)
35739 : {
35740 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35741 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lpServiceHandle));
35742 0 : if (value == NULL) {
35743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lpServiceHandle");
35744 0 : return -1;
35745 : }
35746 0 : object->out.lpServiceHandle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lpServiceHandle);
35747 0 : if (object->out.lpServiceHandle == NULL) {
35748 0 : PyErr_NoMemory();
35749 0 : return -1;
35750 : }
35751 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35752 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35753 0 : PyErr_NoMemory();
35754 0 : return -1;
35755 : }
35756 0 : object->out.lpServiceHandle = (struct policy_handle *)pytalloc_get_ptr(value);
35757 0 : return 0;
35758 : }
35759 :
35760 0 : static PyObject *py_svcctl_CreateServiceWOW64A_get_result(PyObject *obj, void *closure)
35761 : {
35762 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(obj);
35763 0 : PyObject *py_result;
35764 0 : py_result = PyErr_FromWERROR(object->out.result);
35765 0 : return py_result;
35766 : }
35767 :
35768 0 : static int py_svcctl_CreateServiceWOW64A_set_result(PyObject *py_obj, PyObject *value, void *closure)
35769 : {
35770 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35771 0 : if (value == NULL) {
35772 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
35773 0 : return -1;
35774 : }
35775 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
35776 0 : return 0;
35777 : }
35778 :
35779 : static PyGetSetDef py_svcctl_CreateServiceWOW64A_getsetters[] = {
35780 : {
35781 : .name = discard_const_p(char, "in_hSCManager"),
35782 : .get = py_svcctl_CreateServiceWOW64A_in_get_hSCManager,
35783 : .set = py_svcctl_CreateServiceWOW64A_in_set_hSCManager,
35784 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35785 : },
35786 : {
35787 : .name = discard_const_p(char, "in_lpServiceName"),
35788 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpServiceName,
35789 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpServiceName,
35790 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
35791 : },
35792 : {
35793 : .name = discard_const_p(char, "in_lpDisplayName"),
35794 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpDisplayName,
35795 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpDisplayName,
35796 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
35797 : },
35798 : {
35799 : .name = discard_const_p(char, "in_dwDesiredAccess"),
35800 : .get = py_svcctl_CreateServiceWOW64A_in_get_dwDesiredAccess,
35801 : .set = py_svcctl_CreateServiceWOW64A_in_set_dwDesiredAccess,
35802 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35803 : },
35804 : {
35805 : .name = discard_const_p(char, "in_dwServiceType"),
35806 : .get = py_svcctl_CreateServiceWOW64A_in_get_dwServiceType,
35807 : .set = py_svcctl_CreateServiceWOW64A_in_set_dwServiceType,
35808 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35809 : },
35810 : {
35811 : .name = discard_const_p(char, "in_dwStartType"),
35812 : .get = py_svcctl_CreateServiceWOW64A_in_get_dwStartType,
35813 : .set = py_svcctl_CreateServiceWOW64A_in_set_dwStartType,
35814 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35815 : },
35816 : {
35817 : .name = discard_const_p(char, "in_dwErrorControl"),
35818 : .get = py_svcctl_CreateServiceWOW64A_in_get_dwErrorControl,
35819 : .set = py_svcctl_CreateServiceWOW64A_in_set_dwErrorControl,
35820 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35821 : },
35822 : {
35823 : .name = discard_const_p(char, "in_lpBinaryPathName"),
35824 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpBinaryPathName,
35825 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpBinaryPathName,
35826 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
35827 : },
35828 : {
35829 : .name = discard_const_p(char, "in_lpLoadOrderGroup"),
35830 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpLoadOrderGroup,
35831 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpLoadOrderGroup,
35832 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
35833 : },
35834 : {
35835 : .name = discard_const_p(char, "in_lpdwTagId"),
35836 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpdwTagId,
35837 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpdwTagId,
35838 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35839 : },
35840 : {
35841 : .name = discard_const_p(char, "out_lpdwTagId"),
35842 : .get = py_svcctl_CreateServiceWOW64A_out_get_lpdwTagId,
35843 : .set = py_svcctl_CreateServiceWOW64A_out_set_lpdwTagId,
35844 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35845 : },
35846 : {
35847 : .name = discard_const_p(char, "in_lpDependencies"),
35848 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpDependencies,
35849 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpDependencies,
35850 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
35851 : },
35852 : {
35853 : .name = discard_const_p(char, "in_dwDependSize"),
35854 : .get = py_svcctl_CreateServiceWOW64A_in_get_dwDependSize,
35855 : .set = py_svcctl_CreateServiceWOW64A_in_set_dwDependSize,
35856 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35857 : },
35858 : {
35859 : .name = discard_const_p(char, "in_lpServiceStartName"),
35860 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpServiceStartName,
35861 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpServiceStartName,
35862 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
35863 : },
35864 : {
35865 : .name = discard_const_p(char, "in_lpPassword"),
35866 : .get = py_svcctl_CreateServiceWOW64A_in_get_lpPassword,
35867 : .set = py_svcctl_CreateServiceWOW64A_in_set_lpPassword,
35868 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
35869 : },
35870 : {
35871 : .name = discard_const_p(char, "in_dwPwSize"),
35872 : .get = py_svcctl_CreateServiceWOW64A_in_get_dwPwSize,
35873 : .set = py_svcctl_CreateServiceWOW64A_in_set_dwPwSize,
35874 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35875 : },
35876 : {
35877 : .name = discard_const_p(char, "out_lpServiceHandle"),
35878 : .get = py_svcctl_CreateServiceWOW64A_out_get_lpServiceHandle,
35879 : .set = py_svcctl_CreateServiceWOW64A_out_set_lpServiceHandle,
35880 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35881 : },
35882 : {
35883 : .name = discard_const_p(char, "result"),
35884 : .get = py_svcctl_CreateServiceWOW64A_get_result,
35885 : .set = py_svcctl_CreateServiceWOW64A_set_result,
35886 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
35887 : },
35888 : { .name = NULL }
35889 : };
35890 :
35891 0 : static PyObject *py_svcctl_CreateServiceWOW64A_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35892 : {
35893 0 : PyObject *self = pytalloc_new(struct svcctl_CreateServiceWOW64A, type);
35894 0 : struct svcctl_CreateServiceWOW64A *_self = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(self);
35895 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35896 0 : _self->out.lpServiceHandle = talloc_zero(mem_ctx, struct policy_handle);
35897 0 : return self;
35898 : }
35899 :
35900 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35901 : {
35902 :
35903 :
35904 0 : return PyLong_FromLong(44);
35905 : }
35906 :
35907 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
35908 : {
35909 0 : const struct ndr_interface_call *call = NULL;
35910 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35911 0 : PyObject *ret = NULL;
35912 0 : struct ndr_push *push = NULL;
35913 0 : DATA_BLOB blob;
35914 0 : enum ndr_err_code err;
35915 :
35916 0 : if (ndr_table_svcctl.num_calls < 45) {
35917 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceWOW64A_ndr_pack");
35918 0 : return NULL;
35919 : }
35920 0 : call = &ndr_table_svcctl.calls[44];
35921 :
35922 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35923 0 : if (push == NULL) {
35924 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35925 0 : return NULL;
35926 : }
35927 :
35928 0 : push->flags |= ndr_push_flags;
35929 :
35930 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35931 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35932 0 : TALLOC_FREE(push);
35933 0 : PyErr_SetNdrError(err);
35934 0 : return NULL;
35935 : }
35936 0 : blob = ndr_push_blob(push);
35937 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35938 0 : TALLOC_FREE(push);
35939 0 : return ret;
35940 : }
35941 :
35942 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35943 : {
35944 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35945 0 : PyObject *bigendian_obj = NULL;
35946 0 : PyObject *ndr64_obj = NULL;
35947 0 : libndr_flags ndr_push_flags = 0;
35948 :
35949 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35950 : discard_const_p(char *, kwnames),
35951 : &bigendian_obj,
35952 : &ndr64_obj)) {
35953 0 : return NULL;
35954 : }
35955 :
35956 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35957 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35958 : }
35959 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35960 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35961 : }
35962 :
35963 0 : return py_svcctl_CreateServiceWOW64A_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35964 : }
35965 :
35966 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35967 : {
35968 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35969 0 : PyObject *bigendian_obj = NULL;
35970 0 : PyObject *ndr64_obj = NULL;
35971 0 : libndr_flags ndr_push_flags = 0;
35972 :
35973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35974 : discard_const_p(char *, kwnames),
35975 : &bigendian_obj,
35976 : &ndr64_obj)) {
35977 0 : return NULL;
35978 : }
35979 :
35980 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35981 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35982 : }
35983 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35984 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35985 : }
35986 :
35987 0 : return py_svcctl_CreateServiceWOW64A_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35988 : }
35989 :
35990 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
35991 : {
35992 0 : const struct ndr_interface_call *call = NULL;
35993 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
35994 0 : struct ndr_pull *pull = NULL;
35995 0 : enum ndr_err_code err;
35996 :
35997 0 : if (ndr_table_svcctl.num_calls < 45) {
35998 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceWOW64A_ndr_unpack");
35999 0 : return NULL;
36000 : }
36001 0 : call = &ndr_table_svcctl.calls[44];
36002 :
36003 0 : pull = ndr_pull_init_blob(blob, object);
36004 0 : if (pull == NULL) {
36005 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36006 0 : return NULL;
36007 : }
36008 :
36009 0 : pull->flags |= ndr_pull_flags;
36010 :
36011 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36012 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36013 0 : TALLOC_FREE(pull);
36014 0 : PyErr_SetNdrError(err);
36015 0 : return NULL;
36016 : }
36017 0 : if (!allow_remaining) {
36018 0 : uint32_t highest_ofs;
36019 :
36020 0 : if (pull->offset > pull->relative_highest_offset) {
36021 0 : highest_ofs = pull->offset;
36022 : } else {
36023 0 : highest_ofs = pull->relative_highest_offset;
36024 : }
36025 0 : if (highest_ofs < pull->data_size) {
36026 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36027 : "not all bytes consumed ofs[%u] size[%u]",
36028 : highest_ofs, pull->data_size);
36029 0 : TALLOC_FREE(pull);
36030 0 : PyErr_SetNdrError(err);
36031 0 : return NULL;
36032 : }
36033 : }
36034 :
36035 0 : TALLOC_FREE(pull);
36036 0 : Py_RETURN_NONE;
36037 : }
36038 :
36039 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36040 : {
36041 0 : DATA_BLOB blob;
36042 0 : Py_ssize_t blob_length = 0;
36043 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36044 0 : PyObject *bigendian_obj = NULL;
36045 0 : PyObject *ndr64_obj = NULL;
36046 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36047 0 : PyObject *allow_remaining_obj = NULL;
36048 0 : bool allow_remaining = false;
36049 :
36050 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36051 : discard_const_p(char *, kwnames),
36052 : &blob.data, &blob_length,
36053 : &bigendian_obj,
36054 : &ndr64_obj,
36055 : &allow_remaining_obj)) {
36056 0 : return NULL;
36057 : }
36058 0 : blob.length = blob_length;
36059 :
36060 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36061 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36062 : }
36063 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36064 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36065 : }
36066 :
36067 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36068 0 : allow_remaining = true;
36069 : }
36070 :
36071 0 : return py_svcctl_CreateServiceWOW64A_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36072 : }
36073 :
36074 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36075 : {
36076 0 : DATA_BLOB blob;
36077 0 : Py_ssize_t blob_length = 0;
36078 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36079 0 : PyObject *bigendian_obj = NULL;
36080 0 : PyObject *ndr64_obj = NULL;
36081 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36082 0 : PyObject *allow_remaining_obj = NULL;
36083 0 : bool allow_remaining = false;
36084 :
36085 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36086 : discard_const_p(char *, kwnames),
36087 : &blob.data, &blob_length,
36088 : &bigendian_obj,
36089 : &ndr64_obj,
36090 : &allow_remaining_obj)) {
36091 0 : return NULL;
36092 : }
36093 0 : blob.length = blob_length;
36094 :
36095 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36096 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36097 : }
36098 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36099 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36100 : }
36101 :
36102 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36103 0 : allow_remaining = true;
36104 : }
36105 :
36106 0 : return py_svcctl_CreateServiceWOW64A_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36107 : }
36108 :
36109 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
36110 : {
36111 0 : const struct ndr_interface_call *call = NULL;
36112 0 : struct svcctl_CreateServiceWOW64A *object = (struct svcctl_CreateServiceWOW64A *)pytalloc_get_ptr(py_obj);
36113 0 : PyObject *ret;
36114 0 : char *retstr;
36115 :
36116 0 : if (ndr_table_svcctl.num_calls < 45) {
36117 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceWOW64A_ndr_print");
36118 0 : return NULL;
36119 : }
36120 0 : call = &ndr_table_svcctl.calls[44];
36121 :
36122 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36123 0 : ret = PyUnicode_FromString(retstr);
36124 0 : TALLOC_FREE(retstr);
36125 :
36126 0 : return ret;
36127 : }
36128 :
36129 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36130 : {
36131 0 : return py_svcctl_CreateServiceWOW64A_ndr_print(py_obj, "svcctl_CreateServiceWOW64A_in", NDR_IN);
36132 : }
36133 :
36134 0 : static PyObject *py_svcctl_CreateServiceWOW64A_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36135 : {
36136 0 : return py_svcctl_CreateServiceWOW64A_ndr_print(py_obj, "svcctl_CreateServiceWOW64A_out", NDR_OUT);
36137 : }
36138 :
36139 : static PyMethodDef py_svcctl_CreateServiceWOW64A_methods[] = {
36140 : { "opnum", (PyCFunction)py_svcctl_CreateServiceWOW64A_ndr_opnum, METH_NOARGS|METH_CLASS,
36141 : "svcctl.CreateServiceWOW64A.opnum() -> 44 (0x2c) " },
36142 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64A_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36143 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36144 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64A_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36145 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36146 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64A_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36147 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36148 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64A_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36149 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36150 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CreateServiceWOW64A_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36151 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CreateServiceWOW64A_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36152 : { NULL, NULL, 0, NULL }
36153 : };
36154 :
36155 :
36156 : static PyTypeObject svcctl_CreateServiceWOW64A_Type = {
36157 : PyVarObject_HEAD_INIT(NULL, 0)
36158 : .tp_name = "svcctl.CreateServiceWOW64A",
36159 : .tp_getset = py_svcctl_CreateServiceWOW64A_getsetters,
36160 : .tp_methods = py_svcctl_CreateServiceWOW64A_methods,
36161 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36162 : .tp_new = py_svcctl_CreateServiceWOW64A_new,
36163 : };
36164 :
36165 0 : static bool pack_py_svcctl_CreateServiceWOW64A_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CreateServiceWOW64A *r)
36166 : {
36167 0 : PyObject *py_hSCManager;
36168 0 : PyObject *py_lpServiceName;
36169 0 : PyObject *py_lpDisplayName;
36170 0 : PyObject *py_dwDesiredAccess;
36171 0 : PyObject *py_dwServiceType;
36172 0 : PyObject *py_dwStartType;
36173 0 : PyObject *py_dwErrorControl;
36174 0 : PyObject *py_lpBinaryPathName;
36175 0 : PyObject *py_lpLoadOrderGroup;
36176 0 : PyObject *py_lpdwTagId;
36177 0 : PyObject *py_lpDependencies;
36178 0 : PyObject *py_lpServiceStartName;
36179 0 : PyObject *py_lpPassword;
36180 0 : const char *kwnames[] = {
36181 : "hSCManager", "lpServiceName", "lpDisplayName", "dwDesiredAccess", "dwServiceType", "dwStartType", "dwErrorControl", "lpBinaryPathName", "lpLoadOrderGroup", "lpdwTagId", "lpDependencies", "lpServiceStartName", "lpPassword", NULL
36182 : };
36183 :
36184 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOOOO:svcctl_CreateServiceWOW64A", discard_const_p(char *, kwnames), &py_hSCManager, &py_lpServiceName, &py_lpDisplayName, &py_dwDesiredAccess, &py_dwServiceType, &py_dwStartType, &py_dwErrorControl, &py_lpBinaryPathName, &py_lpLoadOrderGroup, &py_lpdwTagId, &py_lpDependencies, &py_lpServiceStartName, &py_lpPassword)) {
36185 0 : return false;
36186 : }
36187 :
36188 0 : if (py_hSCManager == NULL) {
36189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hSCManager");
36190 0 : return false;
36191 : }
36192 0 : PY_CHECK_TYPE(policy_handle_Type, py_hSCManager, return false;);
36193 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hSCManager)) == NULL) {
36194 0 : PyErr_NoMemory();
36195 0 : return false;
36196 : }
36197 0 : r->in.hSCManager = *(struct policy_handle *)pytalloc_get_ptr(py_hSCManager);
36198 0 : if (py_lpServiceName == NULL) {
36199 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpServiceName");
36200 0 : return false;
36201 : }
36202 0 : r->in.lpServiceName = talloc_ptrtype(r, r->in.lpServiceName);
36203 0 : if (r->in.lpServiceName == NULL) {
36204 0 : PyErr_NoMemory();
36205 0 : return false;
36206 : }
36207 : {
36208 0 : const char *test_str;
36209 0 : const char *talloc_str;
36210 0 : PyObject *unicode = NULL;
36211 0 : if (PyUnicode_Check(py_lpServiceName)) {
36212 0 : unicode = PyUnicode_AsEncodedString(py_lpServiceName, "utf-8", "ignore");
36213 0 : if (unicode == NULL) {
36214 0 : return false;
36215 : }
36216 0 : test_str = PyBytes_AS_STRING(unicode);
36217 0 : } else if (PyBytes_Check(py_lpServiceName)) {
36218 0 : test_str = PyBytes_AS_STRING(py_lpServiceName);
36219 : } else {
36220 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpServiceName)->tp_name);
36221 0 : return false;
36222 : }
36223 0 : talloc_str = talloc_strdup(r, test_str);
36224 0 : if (unicode != NULL) {
36225 0 : Py_DECREF(unicode);
36226 : }
36227 0 : if (talloc_str == NULL) {
36228 0 : PyErr_NoMemory();
36229 0 : return false;
36230 : }
36231 0 : r->in.lpServiceName = talloc_str;
36232 : }
36233 0 : if (py_lpDisplayName == NULL) {
36234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDisplayName");
36235 0 : return false;
36236 : }
36237 0 : if (py_lpDisplayName == Py_None) {
36238 0 : r->in.lpDisplayName = NULL;
36239 : } else {
36240 0 : r->in.lpDisplayName = NULL;
36241 : {
36242 0 : const char *test_str;
36243 0 : const char *talloc_str;
36244 0 : PyObject *unicode = NULL;
36245 0 : if (PyUnicode_Check(py_lpDisplayName)) {
36246 0 : unicode = PyUnicode_AsEncodedString(py_lpDisplayName, "utf-8", "ignore");
36247 0 : if (unicode == NULL) {
36248 0 : return false;
36249 : }
36250 0 : test_str = PyBytes_AS_STRING(unicode);
36251 0 : } else if (PyBytes_Check(py_lpDisplayName)) {
36252 0 : test_str = PyBytes_AS_STRING(py_lpDisplayName);
36253 : } else {
36254 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpDisplayName)->tp_name);
36255 0 : return false;
36256 : }
36257 0 : talloc_str = talloc_strdup(r, test_str);
36258 0 : if (unicode != NULL) {
36259 0 : Py_DECREF(unicode);
36260 : }
36261 0 : if (talloc_str == NULL) {
36262 0 : PyErr_NoMemory();
36263 0 : return false;
36264 : }
36265 0 : r->in.lpDisplayName = talloc_str;
36266 : }
36267 : }
36268 0 : if (py_dwDesiredAccess == NULL) {
36269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwDesiredAccess");
36270 0 : return false;
36271 : }
36272 : {
36273 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwDesiredAccess));
36274 0 : if (PyLong_Check(py_dwDesiredAccess)) {
36275 0 : unsigned long long test_var;
36276 0 : test_var = PyLong_AsUnsignedLongLong(py_dwDesiredAccess);
36277 0 : if (PyErr_Occurred() != NULL) {
36278 0 : return false;
36279 : }
36280 0 : if (test_var > uint_max) {
36281 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36282 : PyLong_Type.tp_name, uint_max, test_var);
36283 0 : return false;
36284 : }
36285 0 : r->in.dwDesiredAccess = test_var;
36286 : } else {
36287 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36288 : PyLong_Type.tp_name);
36289 0 : return false;
36290 : }
36291 : }
36292 0 : if (py_dwServiceType == NULL) {
36293 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwServiceType");
36294 0 : return false;
36295 : }
36296 : {
36297 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwServiceType));
36298 0 : if (PyLong_Check(py_dwServiceType)) {
36299 0 : unsigned long long test_var;
36300 0 : test_var = PyLong_AsUnsignedLongLong(py_dwServiceType);
36301 0 : if (PyErr_Occurred() != NULL) {
36302 0 : return false;
36303 : }
36304 0 : if (test_var > uint_max) {
36305 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36306 : PyLong_Type.tp_name, uint_max, test_var);
36307 0 : return false;
36308 : }
36309 0 : r->in.dwServiceType = test_var;
36310 : } else {
36311 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36312 : PyLong_Type.tp_name);
36313 0 : return false;
36314 : }
36315 : }
36316 0 : if (py_dwStartType == NULL) {
36317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwStartType");
36318 0 : return false;
36319 : }
36320 : {
36321 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwStartType));
36322 0 : if (PyLong_Check(py_dwStartType)) {
36323 0 : unsigned long long test_var;
36324 0 : test_var = PyLong_AsUnsignedLongLong(py_dwStartType);
36325 0 : if (PyErr_Occurred() != NULL) {
36326 0 : return false;
36327 : }
36328 0 : if (test_var > uint_max) {
36329 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36330 : PyLong_Type.tp_name, uint_max, test_var);
36331 0 : return false;
36332 : }
36333 0 : r->in.dwStartType = test_var;
36334 : } else {
36335 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36336 : PyLong_Type.tp_name);
36337 0 : return false;
36338 : }
36339 : }
36340 0 : if (py_dwErrorControl == NULL) {
36341 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwErrorControl");
36342 0 : return false;
36343 : }
36344 : {
36345 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwErrorControl));
36346 0 : if (PyLong_Check(py_dwErrorControl)) {
36347 0 : unsigned long long test_var;
36348 0 : test_var = PyLong_AsUnsignedLongLong(py_dwErrorControl);
36349 0 : if (PyErr_Occurred() != NULL) {
36350 0 : return false;
36351 : }
36352 0 : if (test_var > uint_max) {
36353 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36354 : PyLong_Type.tp_name, uint_max, test_var);
36355 0 : return false;
36356 : }
36357 0 : r->in.dwErrorControl = test_var;
36358 : } else {
36359 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36360 : PyLong_Type.tp_name);
36361 0 : return false;
36362 : }
36363 : }
36364 0 : if (py_lpBinaryPathName == NULL) {
36365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpBinaryPathName");
36366 0 : return false;
36367 : }
36368 0 : r->in.lpBinaryPathName = talloc_ptrtype(r, r->in.lpBinaryPathName);
36369 0 : if (r->in.lpBinaryPathName == NULL) {
36370 0 : PyErr_NoMemory();
36371 0 : return false;
36372 : }
36373 : {
36374 0 : const char *test_str;
36375 0 : const char *talloc_str;
36376 0 : PyObject *unicode = NULL;
36377 0 : if (PyUnicode_Check(py_lpBinaryPathName)) {
36378 0 : unicode = PyUnicode_AsEncodedString(py_lpBinaryPathName, "utf-8", "ignore");
36379 0 : if (unicode == NULL) {
36380 0 : return false;
36381 : }
36382 0 : test_str = PyBytes_AS_STRING(unicode);
36383 0 : } else if (PyBytes_Check(py_lpBinaryPathName)) {
36384 0 : test_str = PyBytes_AS_STRING(py_lpBinaryPathName);
36385 : } else {
36386 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpBinaryPathName)->tp_name);
36387 0 : return false;
36388 : }
36389 0 : talloc_str = talloc_strdup(r, test_str);
36390 0 : if (unicode != NULL) {
36391 0 : Py_DECREF(unicode);
36392 : }
36393 0 : if (talloc_str == NULL) {
36394 0 : PyErr_NoMemory();
36395 0 : return false;
36396 : }
36397 0 : r->in.lpBinaryPathName = talloc_str;
36398 : }
36399 0 : if (py_lpLoadOrderGroup == NULL) {
36400 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpLoadOrderGroup");
36401 0 : return false;
36402 : }
36403 0 : if (py_lpLoadOrderGroup == Py_None) {
36404 0 : r->in.lpLoadOrderGroup = NULL;
36405 : } else {
36406 0 : r->in.lpLoadOrderGroup = NULL;
36407 : {
36408 0 : const char *test_str;
36409 0 : const char *talloc_str;
36410 0 : PyObject *unicode = NULL;
36411 0 : if (PyUnicode_Check(py_lpLoadOrderGroup)) {
36412 0 : unicode = PyUnicode_AsEncodedString(py_lpLoadOrderGroup, "utf-8", "ignore");
36413 0 : if (unicode == NULL) {
36414 0 : return false;
36415 : }
36416 0 : test_str = PyBytes_AS_STRING(unicode);
36417 0 : } else if (PyBytes_Check(py_lpLoadOrderGroup)) {
36418 0 : test_str = PyBytes_AS_STRING(py_lpLoadOrderGroup);
36419 : } else {
36420 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpLoadOrderGroup)->tp_name);
36421 0 : return false;
36422 : }
36423 0 : talloc_str = talloc_strdup(r, test_str);
36424 0 : if (unicode != NULL) {
36425 0 : Py_DECREF(unicode);
36426 : }
36427 0 : if (talloc_str == NULL) {
36428 0 : PyErr_NoMemory();
36429 0 : return false;
36430 : }
36431 0 : r->in.lpLoadOrderGroup = talloc_str;
36432 : }
36433 : }
36434 0 : if (py_lpdwTagId == NULL) {
36435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpdwTagId");
36436 0 : return false;
36437 : }
36438 0 : if (py_lpdwTagId == Py_None) {
36439 0 : r->in.lpdwTagId = NULL;
36440 : } else {
36441 0 : r->in.lpdwTagId = talloc_ptrtype(r, r->in.lpdwTagId);
36442 0 : if (r->in.lpdwTagId == NULL) {
36443 0 : PyErr_NoMemory();
36444 0 : return false;
36445 : }
36446 : {
36447 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.lpdwTagId));
36448 0 : if (PyLong_Check(py_lpdwTagId)) {
36449 0 : unsigned long long test_var;
36450 0 : test_var = PyLong_AsUnsignedLongLong(py_lpdwTagId);
36451 0 : if (PyErr_Occurred() != NULL) {
36452 0 : return false;
36453 : }
36454 0 : if (test_var > uint_max) {
36455 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36456 : PyLong_Type.tp_name, uint_max, test_var);
36457 0 : return false;
36458 : }
36459 0 : *r->in.lpdwTagId = test_var;
36460 : } else {
36461 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36462 : PyLong_Type.tp_name);
36463 0 : return false;
36464 : }
36465 : }
36466 : }
36467 0 : if (py_lpDependencies == NULL) {
36468 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDependencies");
36469 0 : return false;
36470 : }
36471 0 : if (py_lpDependencies == Py_None) {
36472 0 : r->in.lpDependencies = NULL;
36473 : } else {
36474 0 : r->in.lpDependencies = NULL;
36475 0 : PY_CHECK_TYPE(&PyList_Type, py_lpDependencies, return false;);
36476 : {
36477 0 : int lpDependencies_cntr_1;
36478 0 : r->in.lpDependencies = talloc_array_ptrtype(r, r->in.lpDependencies, PyList_GET_SIZE(py_lpDependencies));
36479 0 : if (!r->in.lpDependencies) { return false; }
36480 0 : talloc_set_name_const(r->in.lpDependencies, "ARRAY: r->in.lpDependencies");
36481 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < PyList_GET_SIZE(py_lpDependencies); lpDependencies_cntr_1++) {
36482 0 : if (PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1) == NULL) {
36483 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDependencies[lpDependencies_cntr_1]");
36484 0 : return false;
36485 : }
36486 : {
36487 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lpDependencies[lpDependencies_cntr_1]));
36488 0 : if (PyLong_Check(PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1))) {
36489 0 : unsigned long long test_var;
36490 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1));
36491 0 : if (PyErr_Occurred() != NULL) {
36492 0 : return false;
36493 : }
36494 0 : if (test_var > uint_max) {
36495 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36496 : PyLong_Type.tp_name, uint_max, test_var);
36497 0 : return false;
36498 : }
36499 0 : r->in.lpDependencies[lpDependencies_cntr_1] = test_var;
36500 : } else {
36501 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36502 : PyLong_Type.tp_name);
36503 0 : return false;
36504 : }
36505 : }
36506 : }
36507 : }
36508 : }
36509 0 : PY_CHECK_TYPE(&PyList_Type, py_lpDependencies, return false;);
36510 0 : r->in.dwDependSize = PyList_GET_SIZE(py_lpDependencies);
36511 0 : if (py_lpServiceStartName == NULL) {
36512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpServiceStartName");
36513 0 : return false;
36514 : }
36515 0 : if (py_lpServiceStartName == Py_None) {
36516 0 : r->in.lpServiceStartName = NULL;
36517 : } else {
36518 0 : r->in.lpServiceStartName = NULL;
36519 : {
36520 0 : const char *test_str;
36521 0 : const char *talloc_str;
36522 0 : PyObject *unicode = NULL;
36523 0 : if (PyUnicode_Check(py_lpServiceStartName)) {
36524 0 : unicode = PyUnicode_AsEncodedString(py_lpServiceStartName, "utf-8", "ignore");
36525 0 : if (unicode == NULL) {
36526 0 : return false;
36527 : }
36528 0 : test_str = PyBytes_AS_STRING(unicode);
36529 0 : } else if (PyBytes_Check(py_lpServiceStartName)) {
36530 0 : test_str = PyBytes_AS_STRING(py_lpServiceStartName);
36531 : } else {
36532 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpServiceStartName)->tp_name);
36533 0 : return false;
36534 : }
36535 0 : talloc_str = talloc_strdup(r, test_str);
36536 0 : if (unicode != NULL) {
36537 0 : Py_DECREF(unicode);
36538 : }
36539 0 : if (talloc_str == NULL) {
36540 0 : PyErr_NoMemory();
36541 0 : return false;
36542 : }
36543 0 : r->in.lpServiceStartName = talloc_str;
36544 : }
36545 : }
36546 0 : if (py_lpPassword == NULL) {
36547 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpPassword");
36548 0 : return false;
36549 : }
36550 0 : if (py_lpPassword == Py_None) {
36551 0 : r->in.lpPassword = NULL;
36552 : } else {
36553 0 : r->in.lpPassword = NULL;
36554 0 : PY_CHECK_TYPE(&PyList_Type, py_lpPassword, return false;);
36555 : {
36556 0 : int lpPassword_cntr_1;
36557 0 : r->in.lpPassword = talloc_array_ptrtype(r, r->in.lpPassword, PyList_GET_SIZE(py_lpPassword));
36558 0 : if (!r->in.lpPassword) { return false; }
36559 0 : talloc_set_name_const(r->in.lpPassword, "ARRAY: r->in.lpPassword");
36560 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < PyList_GET_SIZE(py_lpPassword); lpPassword_cntr_1++) {
36561 0 : if (PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1) == NULL) {
36562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpPassword[lpPassword_cntr_1]");
36563 0 : return false;
36564 : }
36565 : {
36566 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lpPassword[lpPassword_cntr_1]));
36567 0 : if (PyLong_Check(PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1))) {
36568 0 : unsigned long long test_var;
36569 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1));
36570 0 : if (PyErr_Occurred() != NULL) {
36571 0 : return false;
36572 : }
36573 0 : if (test_var > uint_max) {
36574 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36575 : PyLong_Type.tp_name, uint_max, test_var);
36576 0 : return false;
36577 : }
36578 0 : r->in.lpPassword[lpPassword_cntr_1] = test_var;
36579 : } else {
36580 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36581 : PyLong_Type.tp_name);
36582 0 : return false;
36583 : }
36584 : }
36585 : }
36586 : }
36587 : }
36588 0 : PY_CHECK_TYPE(&PyList_Type, py_lpPassword, return false;);
36589 0 : r->in.dwPwSize = PyList_GET_SIZE(py_lpPassword);
36590 0 : return true;
36591 : }
36592 :
36593 0 : static PyObject *unpack_py_svcctl_CreateServiceWOW64A_args_out(struct svcctl_CreateServiceWOW64A *r)
36594 : {
36595 0 : PyObject *result;
36596 0 : PyObject *py_lpdwTagId;
36597 0 : PyObject *py_lpServiceHandle;
36598 0 : result = PyTuple_New(2);
36599 0 : if (r->out.lpdwTagId == NULL) {
36600 0 : py_lpdwTagId = Py_None;
36601 0 : Py_INCREF(py_lpdwTagId);
36602 : } else {
36603 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*r->out.lpdwTagId);
36604 : }
36605 0 : PyTuple_SetItem(result, 0, py_lpdwTagId);
36606 0 : py_lpServiceHandle = pytalloc_reference_ex(policy_handle_Type, r->out.lpServiceHandle, r->out.lpServiceHandle);
36607 0 : PyTuple_SetItem(result, 1, py_lpServiceHandle);
36608 0 : if (!W_ERROR_IS_OK(r->out.result)) {
36609 0 : PyErr_SetWERROR(r->out.result);
36610 0 : return NULL;
36611 : }
36612 :
36613 0 : return result;
36614 : }
36615 :
36616 :
36617 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_hSCManager(PyObject *obj, void *closure)
36618 : {
36619 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36620 0 : PyObject *py_hSCManager;
36621 0 : py_hSCManager = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hSCManager);
36622 0 : return py_hSCManager;
36623 : }
36624 :
36625 0 : static int py_svcctl_CreateServiceWOW64W_in_set_hSCManager(PyObject *py_obj, PyObject *value, void *closure)
36626 : {
36627 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36628 0 : if (value == NULL) {
36629 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hSCManager");
36630 0 : return -1;
36631 : }
36632 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36633 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36634 0 : PyErr_NoMemory();
36635 0 : return -1;
36636 : }
36637 0 : object->in.hSCManager = *(struct policy_handle *)pytalloc_get_ptr(value);
36638 0 : return 0;
36639 : }
36640 :
36641 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpServiceName(PyObject *obj, void *closure)
36642 : {
36643 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36644 0 : PyObject *py_lpServiceName;
36645 0 : if (object->in.lpServiceName == NULL) {
36646 0 : Py_RETURN_NONE;
36647 : }
36648 0 : if (object->in.lpServiceName == NULL) {
36649 0 : py_lpServiceName = Py_None;
36650 0 : Py_INCREF(py_lpServiceName);
36651 : } else {
36652 0 : py_lpServiceName = PyUnicode_Decode(object->in.lpServiceName, strlen(object->in.lpServiceName), "utf-8", "ignore");
36653 : }
36654 0 : return py_lpServiceName;
36655 : }
36656 :
36657 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpServiceName(PyObject *py_obj, PyObject *value, void *closure)
36658 : {
36659 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36660 0 : if (value == NULL) {
36661 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpServiceName");
36662 0 : return -1;
36663 : }
36664 0 : object->in.lpServiceName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpServiceName);
36665 0 : if (object->in.lpServiceName == NULL) {
36666 0 : PyErr_NoMemory();
36667 0 : return -1;
36668 : }
36669 : {
36670 0 : const char *test_str;
36671 0 : const char *talloc_str;
36672 0 : PyObject *unicode = NULL;
36673 0 : if (PyUnicode_Check(value)) {
36674 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
36675 0 : if (unicode == NULL) {
36676 0 : return -1;
36677 : }
36678 0 : test_str = PyBytes_AS_STRING(unicode);
36679 0 : } else if (PyBytes_Check(value)) {
36680 0 : test_str = PyBytes_AS_STRING(value);
36681 : } else {
36682 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
36683 0 : return -1;
36684 : }
36685 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
36686 0 : if (unicode != NULL) {
36687 0 : Py_DECREF(unicode);
36688 : }
36689 0 : if (talloc_str == NULL) {
36690 0 : PyErr_NoMemory();
36691 0 : return -1;
36692 : }
36693 0 : object->in.lpServiceName = talloc_str;
36694 : }
36695 0 : return 0;
36696 : }
36697 :
36698 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpDisplayName(PyObject *obj, void *closure)
36699 : {
36700 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36701 0 : PyObject *py_lpDisplayName;
36702 0 : if (object->in.lpDisplayName == NULL) {
36703 0 : Py_RETURN_NONE;
36704 : }
36705 0 : if (object->in.lpDisplayName == NULL) {
36706 0 : py_lpDisplayName = Py_None;
36707 0 : Py_INCREF(py_lpDisplayName);
36708 : } else {
36709 0 : if (object->in.lpDisplayName == NULL) {
36710 0 : py_lpDisplayName = Py_None;
36711 0 : Py_INCREF(py_lpDisplayName);
36712 : } else {
36713 0 : py_lpDisplayName = PyUnicode_Decode(object->in.lpDisplayName, strlen(object->in.lpDisplayName), "utf-8", "ignore");
36714 : }
36715 : }
36716 0 : return py_lpDisplayName;
36717 : }
36718 :
36719 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpDisplayName(PyObject *py_obj, PyObject *value, void *closure)
36720 : {
36721 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36722 0 : if (value == NULL) {
36723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDisplayName");
36724 0 : return -1;
36725 : }
36726 0 : if (value == Py_None) {
36727 0 : object->in.lpDisplayName = NULL;
36728 : } else {
36729 0 : object->in.lpDisplayName = NULL;
36730 : {
36731 0 : const char *test_str;
36732 0 : const char *talloc_str;
36733 0 : PyObject *unicode = NULL;
36734 0 : if (PyUnicode_Check(value)) {
36735 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
36736 0 : if (unicode == NULL) {
36737 0 : return -1;
36738 : }
36739 0 : test_str = PyBytes_AS_STRING(unicode);
36740 0 : } else if (PyBytes_Check(value)) {
36741 0 : test_str = PyBytes_AS_STRING(value);
36742 : } else {
36743 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
36744 0 : return -1;
36745 : }
36746 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
36747 0 : if (unicode != NULL) {
36748 0 : Py_DECREF(unicode);
36749 : }
36750 0 : if (talloc_str == NULL) {
36751 0 : PyErr_NoMemory();
36752 0 : return -1;
36753 : }
36754 0 : object->in.lpDisplayName = talloc_str;
36755 : }
36756 : }
36757 0 : return 0;
36758 : }
36759 :
36760 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_dwDesiredAccess(PyObject *obj, void *closure)
36761 : {
36762 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36763 0 : PyObject *py_dwDesiredAccess;
36764 0 : py_dwDesiredAccess = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDesiredAccess);
36765 0 : return py_dwDesiredAccess;
36766 : }
36767 :
36768 0 : static int py_svcctl_CreateServiceWOW64W_in_set_dwDesiredAccess(PyObject *py_obj, PyObject *value, void *closure)
36769 : {
36770 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36771 0 : if (value == NULL) {
36772 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDesiredAccess");
36773 0 : return -1;
36774 : }
36775 : {
36776 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDesiredAccess));
36777 0 : if (PyLong_Check(value)) {
36778 0 : unsigned long long test_var;
36779 0 : test_var = PyLong_AsUnsignedLongLong(value);
36780 0 : if (PyErr_Occurred() != NULL) {
36781 0 : return -1;
36782 : }
36783 0 : if (test_var > uint_max) {
36784 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36785 : PyLong_Type.tp_name, uint_max, test_var);
36786 0 : return -1;
36787 : }
36788 0 : object->in.dwDesiredAccess = test_var;
36789 : } else {
36790 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36791 : PyLong_Type.tp_name);
36792 0 : return -1;
36793 : }
36794 : }
36795 0 : return 0;
36796 : }
36797 :
36798 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_dwServiceType(PyObject *obj, void *closure)
36799 : {
36800 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36801 0 : PyObject *py_dwServiceType;
36802 0 : py_dwServiceType = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwServiceType);
36803 0 : return py_dwServiceType;
36804 : }
36805 :
36806 0 : static int py_svcctl_CreateServiceWOW64W_in_set_dwServiceType(PyObject *py_obj, PyObject *value, void *closure)
36807 : {
36808 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36809 0 : if (value == NULL) {
36810 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwServiceType");
36811 0 : return -1;
36812 : }
36813 : {
36814 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwServiceType));
36815 0 : if (PyLong_Check(value)) {
36816 0 : unsigned long long test_var;
36817 0 : test_var = PyLong_AsUnsignedLongLong(value);
36818 0 : if (PyErr_Occurred() != NULL) {
36819 0 : return -1;
36820 : }
36821 0 : if (test_var > uint_max) {
36822 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36823 : PyLong_Type.tp_name, uint_max, test_var);
36824 0 : return -1;
36825 : }
36826 0 : object->in.dwServiceType = test_var;
36827 : } else {
36828 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36829 : PyLong_Type.tp_name);
36830 0 : return -1;
36831 : }
36832 : }
36833 0 : return 0;
36834 : }
36835 :
36836 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_dwStartType(PyObject *obj, void *closure)
36837 : {
36838 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36839 0 : PyObject *py_dwStartType;
36840 0 : py_dwStartType = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwStartType);
36841 0 : return py_dwStartType;
36842 : }
36843 :
36844 0 : static int py_svcctl_CreateServiceWOW64W_in_set_dwStartType(PyObject *py_obj, PyObject *value, void *closure)
36845 : {
36846 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36847 0 : if (value == NULL) {
36848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwStartType");
36849 0 : return -1;
36850 : }
36851 : {
36852 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwStartType));
36853 0 : if (PyLong_Check(value)) {
36854 0 : unsigned long long test_var;
36855 0 : test_var = PyLong_AsUnsignedLongLong(value);
36856 0 : if (PyErr_Occurred() != NULL) {
36857 0 : return -1;
36858 : }
36859 0 : if (test_var > uint_max) {
36860 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36861 : PyLong_Type.tp_name, uint_max, test_var);
36862 0 : return -1;
36863 : }
36864 0 : object->in.dwStartType = test_var;
36865 : } else {
36866 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36867 : PyLong_Type.tp_name);
36868 0 : return -1;
36869 : }
36870 : }
36871 0 : return 0;
36872 : }
36873 :
36874 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_dwErrorControl(PyObject *obj, void *closure)
36875 : {
36876 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36877 0 : PyObject *py_dwErrorControl;
36878 0 : py_dwErrorControl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwErrorControl);
36879 0 : return py_dwErrorControl;
36880 : }
36881 :
36882 0 : static int py_svcctl_CreateServiceWOW64W_in_set_dwErrorControl(PyObject *py_obj, PyObject *value, void *closure)
36883 : {
36884 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36885 0 : if (value == NULL) {
36886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwErrorControl");
36887 0 : return -1;
36888 : }
36889 : {
36890 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwErrorControl));
36891 0 : if (PyLong_Check(value)) {
36892 0 : unsigned long long test_var;
36893 0 : test_var = PyLong_AsUnsignedLongLong(value);
36894 0 : if (PyErr_Occurred() != NULL) {
36895 0 : return -1;
36896 : }
36897 0 : if (test_var > uint_max) {
36898 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36899 : PyLong_Type.tp_name, uint_max, test_var);
36900 0 : return -1;
36901 : }
36902 0 : object->in.dwErrorControl = test_var;
36903 : } else {
36904 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36905 : PyLong_Type.tp_name);
36906 0 : return -1;
36907 : }
36908 : }
36909 0 : return 0;
36910 : }
36911 :
36912 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpBinaryPathName(PyObject *obj, void *closure)
36913 : {
36914 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36915 0 : PyObject *py_lpBinaryPathName;
36916 0 : if (object->in.lpBinaryPathName == NULL) {
36917 0 : Py_RETURN_NONE;
36918 : }
36919 0 : if (object->in.lpBinaryPathName == NULL) {
36920 0 : py_lpBinaryPathName = Py_None;
36921 0 : Py_INCREF(py_lpBinaryPathName);
36922 : } else {
36923 0 : py_lpBinaryPathName = PyUnicode_Decode(object->in.lpBinaryPathName, strlen(object->in.lpBinaryPathName), "utf-8", "ignore");
36924 : }
36925 0 : return py_lpBinaryPathName;
36926 : }
36927 :
36928 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpBinaryPathName(PyObject *py_obj, PyObject *value, void *closure)
36929 : {
36930 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36931 0 : if (value == NULL) {
36932 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpBinaryPathName");
36933 0 : return -1;
36934 : }
36935 0 : object->in.lpBinaryPathName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpBinaryPathName);
36936 0 : if (object->in.lpBinaryPathName == NULL) {
36937 0 : PyErr_NoMemory();
36938 0 : return -1;
36939 : }
36940 : {
36941 0 : const char *test_str;
36942 0 : const char *talloc_str;
36943 0 : PyObject *unicode = NULL;
36944 0 : if (PyUnicode_Check(value)) {
36945 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
36946 0 : if (unicode == NULL) {
36947 0 : return -1;
36948 : }
36949 0 : test_str = PyBytes_AS_STRING(unicode);
36950 0 : } else if (PyBytes_Check(value)) {
36951 0 : test_str = PyBytes_AS_STRING(value);
36952 : } else {
36953 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
36954 0 : return -1;
36955 : }
36956 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
36957 0 : if (unicode != NULL) {
36958 0 : Py_DECREF(unicode);
36959 : }
36960 0 : if (talloc_str == NULL) {
36961 0 : PyErr_NoMemory();
36962 0 : return -1;
36963 : }
36964 0 : object->in.lpBinaryPathName = talloc_str;
36965 : }
36966 0 : return 0;
36967 : }
36968 :
36969 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpLoadOrderGroup(PyObject *obj, void *closure)
36970 : {
36971 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
36972 0 : PyObject *py_lpLoadOrderGroup;
36973 0 : if (object->in.lpLoadOrderGroup == NULL) {
36974 0 : Py_RETURN_NONE;
36975 : }
36976 0 : if (object->in.lpLoadOrderGroup == NULL) {
36977 0 : py_lpLoadOrderGroup = Py_None;
36978 0 : Py_INCREF(py_lpLoadOrderGroup);
36979 : } else {
36980 0 : if (object->in.lpLoadOrderGroup == NULL) {
36981 0 : py_lpLoadOrderGroup = Py_None;
36982 0 : Py_INCREF(py_lpLoadOrderGroup);
36983 : } else {
36984 0 : py_lpLoadOrderGroup = PyUnicode_Decode(object->in.lpLoadOrderGroup, strlen(object->in.lpLoadOrderGroup), "utf-8", "ignore");
36985 : }
36986 : }
36987 0 : return py_lpLoadOrderGroup;
36988 : }
36989 :
36990 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpLoadOrderGroup(PyObject *py_obj, PyObject *value, void *closure)
36991 : {
36992 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
36993 0 : if (value == NULL) {
36994 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpLoadOrderGroup");
36995 0 : return -1;
36996 : }
36997 0 : if (value == Py_None) {
36998 0 : object->in.lpLoadOrderGroup = NULL;
36999 : } else {
37000 0 : object->in.lpLoadOrderGroup = NULL;
37001 : {
37002 0 : const char *test_str;
37003 0 : const char *talloc_str;
37004 0 : PyObject *unicode = NULL;
37005 0 : if (PyUnicode_Check(value)) {
37006 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
37007 0 : if (unicode == NULL) {
37008 0 : return -1;
37009 : }
37010 0 : test_str = PyBytes_AS_STRING(unicode);
37011 0 : } else if (PyBytes_Check(value)) {
37012 0 : test_str = PyBytes_AS_STRING(value);
37013 : } else {
37014 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
37015 0 : return -1;
37016 : }
37017 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
37018 0 : if (unicode != NULL) {
37019 0 : Py_DECREF(unicode);
37020 : }
37021 0 : if (talloc_str == NULL) {
37022 0 : PyErr_NoMemory();
37023 0 : return -1;
37024 : }
37025 0 : object->in.lpLoadOrderGroup = talloc_str;
37026 : }
37027 : }
37028 0 : return 0;
37029 : }
37030 :
37031 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpdwTagId(PyObject *obj, void *closure)
37032 : {
37033 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37034 0 : PyObject *py_lpdwTagId;
37035 0 : if (object->in.lpdwTagId == NULL) {
37036 0 : Py_RETURN_NONE;
37037 : }
37038 0 : if (object->in.lpdwTagId == NULL) {
37039 0 : py_lpdwTagId = Py_None;
37040 0 : Py_INCREF(py_lpdwTagId);
37041 : } else {
37042 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*object->in.lpdwTagId);
37043 : }
37044 0 : return py_lpdwTagId;
37045 : }
37046 :
37047 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpdwTagId(PyObject *py_obj, PyObject *value, void *closure)
37048 : {
37049 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37050 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpdwTagId));
37051 0 : if (value == NULL) {
37052 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpdwTagId");
37053 0 : return -1;
37054 : }
37055 0 : if (value == Py_None) {
37056 0 : object->in.lpdwTagId = NULL;
37057 : } else {
37058 0 : object->in.lpdwTagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpdwTagId);
37059 0 : if (object->in.lpdwTagId == NULL) {
37060 0 : PyErr_NoMemory();
37061 0 : return -1;
37062 : }
37063 : {
37064 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.lpdwTagId));
37065 0 : if (PyLong_Check(value)) {
37066 0 : unsigned long long test_var;
37067 0 : test_var = PyLong_AsUnsignedLongLong(value);
37068 0 : if (PyErr_Occurred() != NULL) {
37069 0 : return -1;
37070 : }
37071 0 : if (test_var > uint_max) {
37072 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37073 : PyLong_Type.tp_name, uint_max, test_var);
37074 0 : return -1;
37075 : }
37076 0 : *object->in.lpdwTagId = test_var;
37077 : } else {
37078 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37079 : PyLong_Type.tp_name);
37080 0 : return -1;
37081 : }
37082 : }
37083 : }
37084 0 : return 0;
37085 : }
37086 :
37087 0 : static PyObject *py_svcctl_CreateServiceWOW64W_out_get_lpdwTagId(PyObject *obj, void *closure)
37088 : {
37089 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37090 0 : PyObject *py_lpdwTagId;
37091 0 : if (object->out.lpdwTagId == NULL) {
37092 0 : Py_RETURN_NONE;
37093 : }
37094 0 : if (object->out.lpdwTagId == NULL) {
37095 0 : py_lpdwTagId = Py_None;
37096 0 : Py_INCREF(py_lpdwTagId);
37097 : } else {
37098 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.lpdwTagId);
37099 : }
37100 0 : return py_lpdwTagId;
37101 : }
37102 :
37103 0 : static int py_svcctl_CreateServiceWOW64W_out_set_lpdwTagId(PyObject *py_obj, PyObject *value, void *closure)
37104 : {
37105 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37106 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lpdwTagId));
37107 0 : if (value == NULL) {
37108 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lpdwTagId");
37109 0 : return -1;
37110 : }
37111 0 : if (value == Py_None) {
37112 0 : object->out.lpdwTagId = NULL;
37113 : } else {
37114 0 : object->out.lpdwTagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lpdwTagId);
37115 0 : if (object->out.lpdwTagId == NULL) {
37116 0 : PyErr_NoMemory();
37117 0 : return -1;
37118 : }
37119 : {
37120 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.lpdwTagId));
37121 0 : if (PyLong_Check(value)) {
37122 0 : unsigned long long test_var;
37123 0 : test_var = PyLong_AsUnsignedLongLong(value);
37124 0 : if (PyErr_Occurred() != NULL) {
37125 0 : return -1;
37126 : }
37127 0 : if (test_var > uint_max) {
37128 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37129 : PyLong_Type.tp_name, uint_max, test_var);
37130 0 : return -1;
37131 : }
37132 0 : *object->out.lpdwTagId = test_var;
37133 : } else {
37134 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37135 : PyLong_Type.tp_name);
37136 0 : return -1;
37137 : }
37138 : }
37139 : }
37140 0 : return 0;
37141 : }
37142 :
37143 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpDependencies(PyObject *obj, void *closure)
37144 : {
37145 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37146 0 : PyObject *py_lpDependencies;
37147 0 : if (object->in.lpDependencies == NULL) {
37148 0 : Py_RETURN_NONE;
37149 : }
37150 0 : if (object->in.lpDependencies == NULL) {
37151 0 : py_lpDependencies = Py_None;
37152 0 : Py_INCREF(py_lpDependencies);
37153 : } else {
37154 0 : py_lpDependencies = PyList_New(object->in.dwDependSize);
37155 0 : if (py_lpDependencies == NULL) {
37156 0 : return NULL;
37157 : }
37158 : {
37159 : int lpDependencies_cntr_1;
37160 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < (object->in.dwDependSize); lpDependencies_cntr_1++) {
37161 0 : PyObject *py_lpDependencies_1;
37162 0 : py_lpDependencies_1 = PyLong_FromLong((uint16_t)object->in.lpDependencies[lpDependencies_cntr_1]);
37163 0 : PyList_SetItem(py_lpDependencies, lpDependencies_cntr_1, py_lpDependencies_1);
37164 : }
37165 : }
37166 : }
37167 0 : return py_lpDependencies;
37168 : }
37169 :
37170 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpDependencies(PyObject *py_obj, PyObject *value, void *closure)
37171 : {
37172 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37173 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpDependencies));
37174 0 : if (value == NULL) {
37175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDependencies");
37176 0 : return -1;
37177 : }
37178 0 : if (value == Py_None) {
37179 0 : object->in.lpDependencies = NULL;
37180 : } else {
37181 0 : object->in.lpDependencies = NULL;
37182 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
37183 : {
37184 0 : int lpDependencies_cntr_1;
37185 0 : object->in.lpDependencies = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpDependencies, PyList_GET_SIZE(value));
37186 0 : if (!object->in.lpDependencies) { return -1; }
37187 0 : talloc_set_name_const(object->in.lpDependencies, "ARRAY: object->in.lpDependencies");
37188 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < PyList_GET_SIZE(value); lpDependencies_cntr_1++) {
37189 0 : if (PyList_GET_ITEM(value, lpDependencies_cntr_1) == NULL) {
37190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDependencies[lpDependencies_cntr_1]");
37191 0 : return -1;
37192 : }
37193 : {
37194 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lpDependencies[lpDependencies_cntr_1]));
37195 0 : if (PyLong_Check(PyList_GET_ITEM(value, lpDependencies_cntr_1))) {
37196 0 : unsigned long long test_var;
37197 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lpDependencies_cntr_1));
37198 0 : if (PyErr_Occurred() != NULL) {
37199 0 : return -1;
37200 : }
37201 0 : if (test_var > uint_max) {
37202 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37203 : PyLong_Type.tp_name, uint_max, test_var);
37204 0 : return -1;
37205 : }
37206 0 : object->in.lpDependencies[lpDependencies_cntr_1] = test_var;
37207 : } else {
37208 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37209 : PyLong_Type.tp_name);
37210 0 : return -1;
37211 : }
37212 : }
37213 : }
37214 : }
37215 : }
37216 0 : return 0;
37217 : }
37218 :
37219 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_dwDependSize(PyObject *obj, void *closure)
37220 : {
37221 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37222 0 : PyObject *py_dwDependSize;
37223 0 : py_dwDependSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDependSize);
37224 0 : return py_dwDependSize;
37225 : }
37226 :
37227 0 : static int py_svcctl_CreateServiceWOW64W_in_set_dwDependSize(PyObject *py_obj, PyObject *value, void *closure)
37228 : {
37229 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37230 0 : if (value == NULL) {
37231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDependSize");
37232 0 : return -1;
37233 : }
37234 : {
37235 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDependSize));
37236 0 : if (PyLong_Check(value)) {
37237 0 : unsigned long long test_var;
37238 0 : test_var = PyLong_AsUnsignedLongLong(value);
37239 0 : if (PyErr_Occurred() != NULL) {
37240 0 : return -1;
37241 : }
37242 0 : if (test_var > uint_max) {
37243 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37244 : PyLong_Type.tp_name, uint_max, test_var);
37245 0 : return -1;
37246 : }
37247 0 : object->in.dwDependSize = test_var;
37248 : } else {
37249 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37250 : PyLong_Type.tp_name);
37251 0 : return -1;
37252 : }
37253 : }
37254 0 : return 0;
37255 : }
37256 :
37257 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpServiceStartName(PyObject *obj, void *closure)
37258 : {
37259 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37260 0 : PyObject *py_lpServiceStartName;
37261 0 : if (object->in.lpServiceStartName == NULL) {
37262 0 : Py_RETURN_NONE;
37263 : }
37264 0 : if (object->in.lpServiceStartName == NULL) {
37265 0 : py_lpServiceStartName = Py_None;
37266 0 : Py_INCREF(py_lpServiceStartName);
37267 : } else {
37268 0 : if (object->in.lpServiceStartName == NULL) {
37269 0 : py_lpServiceStartName = Py_None;
37270 0 : Py_INCREF(py_lpServiceStartName);
37271 : } else {
37272 0 : py_lpServiceStartName = PyUnicode_Decode(object->in.lpServiceStartName, strlen(object->in.lpServiceStartName), "utf-8", "ignore");
37273 : }
37274 : }
37275 0 : return py_lpServiceStartName;
37276 : }
37277 :
37278 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpServiceStartName(PyObject *py_obj, PyObject *value, void *closure)
37279 : {
37280 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37281 0 : if (value == NULL) {
37282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpServiceStartName");
37283 0 : return -1;
37284 : }
37285 0 : if (value == Py_None) {
37286 0 : object->in.lpServiceStartName = NULL;
37287 : } else {
37288 0 : object->in.lpServiceStartName = NULL;
37289 : {
37290 0 : const char *test_str;
37291 0 : const char *talloc_str;
37292 0 : PyObject *unicode = NULL;
37293 0 : if (PyUnicode_Check(value)) {
37294 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
37295 0 : if (unicode == NULL) {
37296 0 : return -1;
37297 : }
37298 0 : test_str = PyBytes_AS_STRING(unicode);
37299 0 : } else if (PyBytes_Check(value)) {
37300 0 : test_str = PyBytes_AS_STRING(value);
37301 : } else {
37302 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
37303 0 : return -1;
37304 : }
37305 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
37306 0 : if (unicode != NULL) {
37307 0 : Py_DECREF(unicode);
37308 : }
37309 0 : if (talloc_str == NULL) {
37310 0 : PyErr_NoMemory();
37311 0 : return -1;
37312 : }
37313 0 : object->in.lpServiceStartName = talloc_str;
37314 : }
37315 : }
37316 0 : return 0;
37317 : }
37318 :
37319 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_lpPassword(PyObject *obj, void *closure)
37320 : {
37321 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37322 0 : PyObject *py_lpPassword;
37323 0 : if (object->in.lpPassword == NULL) {
37324 0 : Py_RETURN_NONE;
37325 : }
37326 0 : if (object->in.lpPassword == NULL) {
37327 0 : py_lpPassword = Py_None;
37328 0 : Py_INCREF(py_lpPassword);
37329 : } else {
37330 0 : py_lpPassword = PyList_New(object->in.dwPwSize);
37331 0 : if (py_lpPassword == NULL) {
37332 0 : return NULL;
37333 : }
37334 : {
37335 : int lpPassword_cntr_1;
37336 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < (object->in.dwPwSize); lpPassword_cntr_1++) {
37337 0 : PyObject *py_lpPassword_1;
37338 0 : py_lpPassword_1 = PyLong_FromLong((uint16_t)object->in.lpPassword[lpPassword_cntr_1]);
37339 0 : PyList_SetItem(py_lpPassword, lpPassword_cntr_1, py_lpPassword_1);
37340 : }
37341 : }
37342 : }
37343 0 : return py_lpPassword;
37344 : }
37345 :
37346 0 : static int py_svcctl_CreateServiceWOW64W_in_set_lpPassword(PyObject *py_obj, PyObject *value, void *closure)
37347 : {
37348 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37349 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpPassword));
37350 0 : if (value == NULL) {
37351 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpPassword");
37352 0 : return -1;
37353 : }
37354 0 : if (value == Py_None) {
37355 0 : object->in.lpPassword = NULL;
37356 : } else {
37357 0 : object->in.lpPassword = NULL;
37358 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
37359 : {
37360 0 : int lpPassword_cntr_1;
37361 0 : object->in.lpPassword = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpPassword, PyList_GET_SIZE(value));
37362 0 : if (!object->in.lpPassword) { return -1; }
37363 0 : talloc_set_name_const(object->in.lpPassword, "ARRAY: object->in.lpPassword");
37364 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < PyList_GET_SIZE(value); lpPassword_cntr_1++) {
37365 0 : if (PyList_GET_ITEM(value, lpPassword_cntr_1) == NULL) {
37366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpPassword[lpPassword_cntr_1]");
37367 0 : return -1;
37368 : }
37369 : {
37370 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lpPassword[lpPassword_cntr_1]));
37371 0 : if (PyLong_Check(PyList_GET_ITEM(value, lpPassword_cntr_1))) {
37372 0 : unsigned long long test_var;
37373 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lpPassword_cntr_1));
37374 0 : if (PyErr_Occurred() != NULL) {
37375 0 : return -1;
37376 : }
37377 0 : if (test_var > uint_max) {
37378 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37379 : PyLong_Type.tp_name, uint_max, test_var);
37380 0 : return -1;
37381 : }
37382 0 : object->in.lpPassword[lpPassword_cntr_1] = test_var;
37383 : } else {
37384 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37385 : PyLong_Type.tp_name);
37386 0 : return -1;
37387 : }
37388 : }
37389 : }
37390 : }
37391 : }
37392 0 : return 0;
37393 : }
37394 :
37395 0 : static PyObject *py_svcctl_CreateServiceWOW64W_in_get_dwPwSize(PyObject *obj, void *closure)
37396 : {
37397 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37398 0 : PyObject *py_dwPwSize;
37399 0 : py_dwPwSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwPwSize);
37400 0 : return py_dwPwSize;
37401 : }
37402 :
37403 0 : static int py_svcctl_CreateServiceWOW64W_in_set_dwPwSize(PyObject *py_obj, PyObject *value, void *closure)
37404 : {
37405 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37406 0 : if (value == NULL) {
37407 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwPwSize");
37408 0 : return -1;
37409 : }
37410 : {
37411 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwPwSize));
37412 0 : if (PyLong_Check(value)) {
37413 0 : unsigned long long test_var;
37414 0 : test_var = PyLong_AsUnsignedLongLong(value);
37415 0 : if (PyErr_Occurred() != NULL) {
37416 0 : return -1;
37417 : }
37418 0 : if (test_var > uint_max) {
37419 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37420 : PyLong_Type.tp_name, uint_max, test_var);
37421 0 : return -1;
37422 : }
37423 0 : object->in.dwPwSize = test_var;
37424 : } else {
37425 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37426 : PyLong_Type.tp_name);
37427 0 : return -1;
37428 : }
37429 : }
37430 0 : return 0;
37431 : }
37432 :
37433 0 : static PyObject *py_svcctl_CreateServiceWOW64W_out_get_lpServiceHandle(PyObject *obj, void *closure)
37434 : {
37435 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37436 0 : PyObject *py_lpServiceHandle;
37437 0 : if (object->out.lpServiceHandle == NULL) {
37438 0 : Py_RETURN_NONE;
37439 : }
37440 0 : py_lpServiceHandle = pytalloc_reference_ex(policy_handle_Type, object->out.lpServiceHandle, object->out.lpServiceHandle);
37441 0 : return py_lpServiceHandle;
37442 : }
37443 :
37444 0 : static int py_svcctl_CreateServiceWOW64W_out_set_lpServiceHandle(PyObject *py_obj, PyObject *value, void *closure)
37445 : {
37446 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37447 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lpServiceHandle));
37448 0 : if (value == NULL) {
37449 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lpServiceHandle");
37450 0 : return -1;
37451 : }
37452 0 : object->out.lpServiceHandle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lpServiceHandle);
37453 0 : if (object->out.lpServiceHandle == NULL) {
37454 0 : PyErr_NoMemory();
37455 0 : return -1;
37456 : }
37457 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37458 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37459 0 : PyErr_NoMemory();
37460 0 : return -1;
37461 : }
37462 0 : object->out.lpServiceHandle = (struct policy_handle *)pytalloc_get_ptr(value);
37463 0 : return 0;
37464 : }
37465 :
37466 0 : static PyObject *py_svcctl_CreateServiceWOW64W_get_result(PyObject *obj, void *closure)
37467 : {
37468 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(obj);
37469 0 : PyObject *py_result;
37470 0 : py_result = PyErr_FromWERROR(object->out.result);
37471 0 : return py_result;
37472 : }
37473 :
37474 0 : static int py_svcctl_CreateServiceWOW64W_set_result(PyObject *py_obj, PyObject *value, void *closure)
37475 : {
37476 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37477 0 : if (value == NULL) {
37478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
37479 0 : return -1;
37480 : }
37481 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
37482 0 : return 0;
37483 : }
37484 :
37485 : static PyGetSetDef py_svcctl_CreateServiceWOW64W_getsetters[] = {
37486 : {
37487 : .name = discard_const_p(char, "in_hSCManager"),
37488 : .get = py_svcctl_CreateServiceWOW64W_in_get_hSCManager,
37489 : .set = py_svcctl_CreateServiceWOW64W_in_set_hSCManager,
37490 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37491 : },
37492 : {
37493 : .name = discard_const_p(char, "in_lpServiceName"),
37494 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpServiceName,
37495 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpServiceName,
37496 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37497 : },
37498 : {
37499 : .name = discard_const_p(char, "in_lpDisplayName"),
37500 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpDisplayName,
37501 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpDisplayName,
37502 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37503 : },
37504 : {
37505 : .name = discard_const_p(char, "in_dwDesiredAccess"),
37506 : .get = py_svcctl_CreateServiceWOW64W_in_get_dwDesiredAccess,
37507 : .set = py_svcctl_CreateServiceWOW64W_in_set_dwDesiredAccess,
37508 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37509 : },
37510 : {
37511 : .name = discard_const_p(char, "in_dwServiceType"),
37512 : .get = py_svcctl_CreateServiceWOW64W_in_get_dwServiceType,
37513 : .set = py_svcctl_CreateServiceWOW64W_in_set_dwServiceType,
37514 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37515 : },
37516 : {
37517 : .name = discard_const_p(char, "in_dwStartType"),
37518 : .get = py_svcctl_CreateServiceWOW64W_in_get_dwStartType,
37519 : .set = py_svcctl_CreateServiceWOW64W_in_set_dwStartType,
37520 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37521 : },
37522 : {
37523 : .name = discard_const_p(char, "in_dwErrorControl"),
37524 : .get = py_svcctl_CreateServiceWOW64W_in_get_dwErrorControl,
37525 : .set = py_svcctl_CreateServiceWOW64W_in_set_dwErrorControl,
37526 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37527 : },
37528 : {
37529 : .name = discard_const_p(char, "in_lpBinaryPathName"),
37530 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpBinaryPathName,
37531 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpBinaryPathName,
37532 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37533 : },
37534 : {
37535 : .name = discard_const_p(char, "in_lpLoadOrderGroup"),
37536 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpLoadOrderGroup,
37537 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpLoadOrderGroup,
37538 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37539 : },
37540 : {
37541 : .name = discard_const_p(char, "in_lpdwTagId"),
37542 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpdwTagId,
37543 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpdwTagId,
37544 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37545 : },
37546 : {
37547 : .name = discard_const_p(char, "out_lpdwTagId"),
37548 : .get = py_svcctl_CreateServiceWOW64W_out_get_lpdwTagId,
37549 : .set = py_svcctl_CreateServiceWOW64W_out_set_lpdwTagId,
37550 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37551 : },
37552 : {
37553 : .name = discard_const_p(char, "in_lpDependencies"),
37554 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpDependencies,
37555 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpDependencies,
37556 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
37557 : },
37558 : {
37559 : .name = discard_const_p(char, "in_dwDependSize"),
37560 : .get = py_svcctl_CreateServiceWOW64W_in_get_dwDependSize,
37561 : .set = py_svcctl_CreateServiceWOW64W_in_set_dwDependSize,
37562 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37563 : },
37564 : {
37565 : .name = discard_const_p(char, "in_lpServiceStartName"),
37566 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpServiceStartName,
37567 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpServiceStartName,
37568 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37569 : },
37570 : {
37571 : .name = discard_const_p(char, "in_lpPassword"),
37572 : .get = py_svcctl_CreateServiceWOW64W_in_get_lpPassword,
37573 : .set = py_svcctl_CreateServiceWOW64W_in_set_lpPassword,
37574 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
37575 : },
37576 : {
37577 : .name = discard_const_p(char, "in_dwPwSize"),
37578 : .get = py_svcctl_CreateServiceWOW64W_in_get_dwPwSize,
37579 : .set = py_svcctl_CreateServiceWOW64W_in_set_dwPwSize,
37580 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37581 : },
37582 : {
37583 : .name = discard_const_p(char, "out_lpServiceHandle"),
37584 : .get = py_svcctl_CreateServiceWOW64W_out_get_lpServiceHandle,
37585 : .set = py_svcctl_CreateServiceWOW64W_out_set_lpServiceHandle,
37586 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37587 : },
37588 : {
37589 : .name = discard_const_p(char, "result"),
37590 : .get = py_svcctl_CreateServiceWOW64W_get_result,
37591 : .set = py_svcctl_CreateServiceWOW64W_set_result,
37592 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
37593 : },
37594 : { .name = NULL }
37595 : };
37596 :
37597 0 : static PyObject *py_svcctl_CreateServiceWOW64W_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37598 : {
37599 0 : PyObject *self = pytalloc_new(struct svcctl_CreateServiceWOW64W, type);
37600 0 : struct svcctl_CreateServiceWOW64W *_self = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(self);
37601 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37602 0 : _self->out.lpServiceHandle = talloc_zero(mem_ctx, struct policy_handle);
37603 0 : return self;
37604 : }
37605 :
37606 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37607 : {
37608 :
37609 :
37610 0 : return PyLong_FromLong(45);
37611 : }
37612 :
37613 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
37614 : {
37615 0 : const struct ndr_interface_call *call = NULL;
37616 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37617 0 : PyObject *ret = NULL;
37618 0 : struct ndr_push *push = NULL;
37619 0 : DATA_BLOB blob;
37620 0 : enum ndr_err_code err;
37621 :
37622 0 : if (ndr_table_svcctl.num_calls < 46) {
37623 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceWOW64W_ndr_pack");
37624 0 : return NULL;
37625 : }
37626 0 : call = &ndr_table_svcctl.calls[45];
37627 :
37628 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37629 0 : if (push == NULL) {
37630 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37631 0 : return NULL;
37632 : }
37633 :
37634 0 : push->flags |= ndr_push_flags;
37635 :
37636 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37637 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37638 0 : TALLOC_FREE(push);
37639 0 : PyErr_SetNdrError(err);
37640 0 : return NULL;
37641 : }
37642 0 : blob = ndr_push_blob(push);
37643 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37644 0 : TALLOC_FREE(push);
37645 0 : return ret;
37646 : }
37647 :
37648 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37649 : {
37650 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37651 0 : PyObject *bigendian_obj = NULL;
37652 0 : PyObject *ndr64_obj = NULL;
37653 0 : libndr_flags ndr_push_flags = 0;
37654 :
37655 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37656 : discard_const_p(char *, kwnames),
37657 : &bigendian_obj,
37658 : &ndr64_obj)) {
37659 0 : return NULL;
37660 : }
37661 :
37662 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37663 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37664 : }
37665 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37666 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37667 : }
37668 :
37669 0 : return py_svcctl_CreateServiceWOW64W_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37670 : }
37671 :
37672 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37673 : {
37674 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37675 0 : PyObject *bigendian_obj = NULL;
37676 0 : PyObject *ndr64_obj = NULL;
37677 0 : libndr_flags ndr_push_flags = 0;
37678 :
37679 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37680 : discard_const_p(char *, kwnames),
37681 : &bigendian_obj,
37682 : &ndr64_obj)) {
37683 0 : return NULL;
37684 : }
37685 :
37686 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37687 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37688 : }
37689 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37690 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37691 : }
37692 :
37693 0 : return py_svcctl_CreateServiceWOW64W_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37694 : }
37695 :
37696 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
37697 : {
37698 0 : const struct ndr_interface_call *call = NULL;
37699 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37700 0 : struct ndr_pull *pull = NULL;
37701 0 : enum ndr_err_code err;
37702 :
37703 0 : if (ndr_table_svcctl.num_calls < 46) {
37704 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceWOW64W_ndr_unpack");
37705 0 : return NULL;
37706 : }
37707 0 : call = &ndr_table_svcctl.calls[45];
37708 :
37709 0 : pull = ndr_pull_init_blob(blob, object);
37710 0 : if (pull == NULL) {
37711 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37712 0 : return NULL;
37713 : }
37714 :
37715 0 : pull->flags |= ndr_pull_flags;
37716 :
37717 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37718 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37719 0 : TALLOC_FREE(pull);
37720 0 : PyErr_SetNdrError(err);
37721 0 : return NULL;
37722 : }
37723 0 : if (!allow_remaining) {
37724 0 : uint32_t highest_ofs;
37725 :
37726 0 : if (pull->offset > pull->relative_highest_offset) {
37727 0 : highest_ofs = pull->offset;
37728 : } else {
37729 0 : highest_ofs = pull->relative_highest_offset;
37730 : }
37731 0 : if (highest_ofs < pull->data_size) {
37732 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37733 : "not all bytes consumed ofs[%u] size[%u]",
37734 : highest_ofs, pull->data_size);
37735 0 : TALLOC_FREE(pull);
37736 0 : PyErr_SetNdrError(err);
37737 0 : return NULL;
37738 : }
37739 : }
37740 :
37741 0 : TALLOC_FREE(pull);
37742 0 : Py_RETURN_NONE;
37743 : }
37744 :
37745 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37746 : {
37747 0 : DATA_BLOB blob;
37748 0 : Py_ssize_t blob_length = 0;
37749 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37750 0 : PyObject *bigendian_obj = NULL;
37751 0 : PyObject *ndr64_obj = NULL;
37752 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37753 0 : PyObject *allow_remaining_obj = NULL;
37754 0 : bool allow_remaining = false;
37755 :
37756 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37757 : discard_const_p(char *, kwnames),
37758 : &blob.data, &blob_length,
37759 : &bigendian_obj,
37760 : &ndr64_obj,
37761 : &allow_remaining_obj)) {
37762 0 : return NULL;
37763 : }
37764 0 : blob.length = blob_length;
37765 :
37766 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37767 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37768 : }
37769 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37770 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37771 : }
37772 :
37773 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37774 0 : allow_remaining = true;
37775 : }
37776 :
37777 0 : return py_svcctl_CreateServiceWOW64W_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37778 : }
37779 :
37780 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37781 : {
37782 0 : DATA_BLOB blob;
37783 0 : Py_ssize_t blob_length = 0;
37784 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37785 0 : PyObject *bigendian_obj = NULL;
37786 0 : PyObject *ndr64_obj = NULL;
37787 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37788 0 : PyObject *allow_remaining_obj = NULL;
37789 0 : bool allow_remaining = false;
37790 :
37791 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37792 : discard_const_p(char *, kwnames),
37793 : &blob.data, &blob_length,
37794 : &bigendian_obj,
37795 : &ndr64_obj,
37796 : &allow_remaining_obj)) {
37797 0 : return NULL;
37798 : }
37799 0 : blob.length = blob_length;
37800 :
37801 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37802 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37803 : }
37804 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37805 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37806 : }
37807 :
37808 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37809 0 : allow_remaining = true;
37810 : }
37811 :
37812 0 : return py_svcctl_CreateServiceWOW64W_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37813 : }
37814 :
37815 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
37816 : {
37817 0 : const struct ndr_interface_call *call = NULL;
37818 0 : struct svcctl_CreateServiceWOW64W *object = (struct svcctl_CreateServiceWOW64W *)pytalloc_get_ptr(py_obj);
37819 0 : PyObject *ret;
37820 0 : char *retstr;
37821 :
37822 0 : if (ndr_table_svcctl.num_calls < 46) {
37823 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceWOW64W_ndr_print");
37824 0 : return NULL;
37825 : }
37826 0 : call = &ndr_table_svcctl.calls[45];
37827 :
37828 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37829 0 : ret = PyUnicode_FromString(retstr);
37830 0 : TALLOC_FREE(retstr);
37831 :
37832 0 : return ret;
37833 : }
37834 :
37835 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37836 : {
37837 0 : return py_svcctl_CreateServiceWOW64W_ndr_print(py_obj, "svcctl_CreateServiceWOW64W_in", NDR_IN);
37838 : }
37839 :
37840 0 : static PyObject *py_svcctl_CreateServiceWOW64W_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37841 : {
37842 0 : return py_svcctl_CreateServiceWOW64W_ndr_print(py_obj, "svcctl_CreateServiceWOW64W_out", NDR_OUT);
37843 : }
37844 :
37845 : static PyMethodDef py_svcctl_CreateServiceWOW64W_methods[] = {
37846 : { "opnum", (PyCFunction)py_svcctl_CreateServiceWOW64W_ndr_opnum, METH_NOARGS|METH_CLASS,
37847 : "svcctl.CreateServiceWOW64W.opnum() -> 45 (0x2d) " },
37848 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64W_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37849 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37850 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64W_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37851 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37852 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64W_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37853 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37854 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceWOW64W_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37855 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37856 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CreateServiceWOW64W_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37857 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CreateServiceWOW64W_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37858 : { NULL, NULL, 0, NULL }
37859 : };
37860 :
37861 :
37862 : static PyTypeObject svcctl_CreateServiceWOW64W_Type = {
37863 : PyVarObject_HEAD_INIT(NULL, 0)
37864 : .tp_name = "svcctl.CreateServiceWOW64W",
37865 : .tp_getset = py_svcctl_CreateServiceWOW64W_getsetters,
37866 : .tp_methods = py_svcctl_CreateServiceWOW64W_methods,
37867 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37868 : .tp_new = py_svcctl_CreateServiceWOW64W_new,
37869 : };
37870 :
37871 0 : static bool pack_py_svcctl_CreateServiceWOW64W_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CreateServiceWOW64W *r)
37872 : {
37873 0 : PyObject *py_hSCManager;
37874 0 : PyObject *py_lpServiceName;
37875 0 : PyObject *py_lpDisplayName;
37876 0 : PyObject *py_dwDesiredAccess;
37877 0 : PyObject *py_dwServiceType;
37878 0 : PyObject *py_dwStartType;
37879 0 : PyObject *py_dwErrorControl;
37880 0 : PyObject *py_lpBinaryPathName;
37881 0 : PyObject *py_lpLoadOrderGroup;
37882 0 : PyObject *py_lpdwTagId;
37883 0 : PyObject *py_lpDependencies;
37884 0 : PyObject *py_lpServiceStartName;
37885 0 : PyObject *py_lpPassword;
37886 0 : const char *kwnames[] = {
37887 : "hSCManager", "lpServiceName", "lpDisplayName", "dwDesiredAccess", "dwServiceType", "dwStartType", "dwErrorControl", "lpBinaryPathName", "lpLoadOrderGroup", "lpdwTagId", "lpDependencies", "lpServiceStartName", "lpPassword", NULL
37888 : };
37889 :
37890 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOOOO:svcctl_CreateServiceWOW64W", discard_const_p(char *, kwnames), &py_hSCManager, &py_lpServiceName, &py_lpDisplayName, &py_dwDesiredAccess, &py_dwServiceType, &py_dwStartType, &py_dwErrorControl, &py_lpBinaryPathName, &py_lpLoadOrderGroup, &py_lpdwTagId, &py_lpDependencies, &py_lpServiceStartName, &py_lpPassword)) {
37891 0 : return false;
37892 : }
37893 :
37894 0 : if (py_hSCManager == NULL) {
37895 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hSCManager");
37896 0 : return false;
37897 : }
37898 0 : PY_CHECK_TYPE(policy_handle_Type, py_hSCManager, return false;);
37899 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hSCManager)) == NULL) {
37900 0 : PyErr_NoMemory();
37901 0 : return false;
37902 : }
37903 0 : r->in.hSCManager = *(struct policy_handle *)pytalloc_get_ptr(py_hSCManager);
37904 0 : if (py_lpServiceName == NULL) {
37905 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpServiceName");
37906 0 : return false;
37907 : }
37908 0 : r->in.lpServiceName = talloc_ptrtype(r, r->in.lpServiceName);
37909 0 : if (r->in.lpServiceName == NULL) {
37910 0 : PyErr_NoMemory();
37911 0 : return false;
37912 : }
37913 : {
37914 0 : const char *test_str;
37915 0 : const char *talloc_str;
37916 0 : PyObject *unicode = NULL;
37917 0 : if (PyUnicode_Check(py_lpServiceName)) {
37918 0 : unicode = PyUnicode_AsEncodedString(py_lpServiceName, "utf-8", "ignore");
37919 0 : if (unicode == NULL) {
37920 0 : return false;
37921 : }
37922 0 : test_str = PyBytes_AS_STRING(unicode);
37923 0 : } else if (PyBytes_Check(py_lpServiceName)) {
37924 0 : test_str = PyBytes_AS_STRING(py_lpServiceName);
37925 : } else {
37926 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpServiceName)->tp_name);
37927 0 : return false;
37928 : }
37929 0 : talloc_str = talloc_strdup(r, test_str);
37930 0 : if (unicode != NULL) {
37931 0 : Py_DECREF(unicode);
37932 : }
37933 0 : if (talloc_str == NULL) {
37934 0 : PyErr_NoMemory();
37935 0 : return false;
37936 : }
37937 0 : r->in.lpServiceName = talloc_str;
37938 : }
37939 0 : if (py_lpDisplayName == NULL) {
37940 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDisplayName");
37941 0 : return false;
37942 : }
37943 0 : if (py_lpDisplayName == Py_None) {
37944 0 : r->in.lpDisplayName = NULL;
37945 : } else {
37946 0 : r->in.lpDisplayName = NULL;
37947 : {
37948 0 : const char *test_str;
37949 0 : const char *talloc_str;
37950 0 : PyObject *unicode = NULL;
37951 0 : if (PyUnicode_Check(py_lpDisplayName)) {
37952 0 : unicode = PyUnicode_AsEncodedString(py_lpDisplayName, "utf-8", "ignore");
37953 0 : if (unicode == NULL) {
37954 0 : return false;
37955 : }
37956 0 : test_str = PyBytes_AS_STRING(unicode);
37957 0 : } else if (PyBytes_Check(py_lpDisplayName)) {
37958 0 : test_str = PyBytes_AS_STRING(py_lpDisplayName);
37959 : } else {
37960 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpDisplayName)->tp_name);
37961 0 : return false;
37962 : }
37963 0 : talloc_str = talloc_strdup(r, test_str);
37964 0 : if (unicode != NULL) {
37965 0 : Py_DECREF(unicode);
37966 : }
37967 0 : if (talloc_str == NULL) {
37968 0 : PyErr_NoMemory();
37969 0 : return false;
37970 : }
37971 0 : r->in.lpDisplayName = talloc_str;
37972 : }
37973 : }
37974 0 : if (py_dwDesiredAccess == NULL) {
37975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwDesiredAccess");
37976 0 : return false;
37977 : }
37978 : {
37979 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwDesiredAccess));
37980 0 : if (PyLong_Check(py_dwDesiredAccess)) {
37981 0 : unsigned long long test_var;
37982 0 : test_var = PyLong_AsUnsignedLongLong(py_dwDesiredAccess);
37983 0 : if (PyErr_Occurred() != NULL) {
37984 0 : return false;
37985 : }
37986 0 : if (test_var > uint_max) {
37987 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37988 : PyLong_Type.tp_name, uint_max, test_var);
37989 0 : return false;
37990 : }
37991 0 : r->in.dwDesiredAccess = test_var;
37992 : } else {
37993 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37994 : PyLong_Type.tp_name);
37995 0 : return false;
37996 : }
37997 : }
37998 0 : if (py_dwServiceType == NULL) {
37999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwServiceType");
38000 0 : return false;
38001 : }
38002 : {
38003 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwServiceType));
38004 0 : if (PyLong_Check(py_dwServiceType)) {
38005 0 : unsigned long long test_var;
38006 0 : test_var = PyLong_AsUnsignedLongLong(py_dwServiceType);
38007 0 : if (PyErr_Occurred() != NULL) {
38008 0 : return false;
38009 : }
38010 0 : if (test_var > uint_max) {
38011 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38012 : PyLong_Type.tp_name, uint_max, test_var);
38013 0 : return false;
38014 : }
38015 0 : r->in.dwServiceType = test_var;
38016 : } else {
38017 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38018 : PyLong_Type.tp_name);
38019 0 : return false;
38020 : }
38021 : }
38022 0 : if (py_dwStartType == NULL) {
38023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwStartType");
38024 0 : return false;
38025 : }
38026 : {
38027 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwStartType));
38028 0 : if (PyLong_Check(py_dwStartType)) {
38029 0 : unsigned long long test_var;
38030 0 : test_var = PyLong_AsUnsignedLongLong(py_dwStartType);
38031 0 : if (PyErr_Occurred() != NULL) {
38032 0 : return false;
38033 : }
38034 0 : if (test_var > uint_max) {
38035 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38036 : PyLong_Type.tp_name, uint_max, test_var);
38037 0 : return false;
38038 : }
38039 0 : r->in.dwStartType = test_var;
38040 : } else {
38041 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38042 : PyLong_Type.tp_name);
38043 0 : return false;
38044 : }
38045 : }
38046 0 : if (py_dwErrorControl == NULL) {
38047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwErrorControl");
38048 0 : return false;
38049 : }
38050 : {
38051 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwErrorControl));
38052 0 : if (PyLong_Check(py_dwErrorControl)) {
38053 0 : unsigned long long test_var;
38054 0 : test_var = PyLong_AsUnsignedLongLong(py_dwErrorControl);
38055 0 : if (PyErr_Occurred() != NULL) {
38056 0 : return false;
38057 : }
38058 0 : if (test_var > uint_max) {
38059 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38060 : PyLong_Type.tp_name, uint_max, test_var);
38061 0 : return false;
38062 : }
38063 0 : r->in.dwErrorControl = test_var;
38064 : } else {
38065 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38066 : PyLong_Type.tp_name);
38067 0 : return false;
38068 : }
38069 : }
38070 0 : if (py_lpBinaryPathName == NULL) {
38071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpBinaryPathName");
38072 0 : return false;
38073 : }
38074 0 : r->in.lpBinaryPathName = talloc_ptrtype(r, r->in.lpBinaryPathName);
38075 0 : if (r->in.lpBinaryPathName == NULL) {
38076 0 : PyErr_NoMemory();
38077 0 : return false;
38078 : }
38079 : {
38080 0 : const char *test_str;
38081 0 : const char *talloc_str;
38082 0 : PyObject *unicode = NULL;
38083 0 : if (PyUnicode_Check(py_lpBinaryPathName)) {
38084 0 : unicode = PyUnicode_AsEncodedString(py_lpBinaryPathName, "utf-8", "ignore");
38085 0 : if (unicode == NULL) {
38086 0 : return false;
38087 : }
38088 0 : test_str = PyBytes_AS_STRING(unicode);
38089 0 : } else if (PyBytes_Check(py_lpBinaryPathName)) {
38090 0 : test_str = PyBytes_AS_STRING(py_lpBinaryPathName);
38091 : } else {
38092 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpBinaryPathName)->tp_name);
38093 0 : return false;
38094 : }
38095 0 : talloc_str = talloc_strdup(r, test_str);
38096 0 : if (unicode != NULL) {
38097 0 : Py_DECREF(unicode);
38098 : }
38099 0 : if (talloc_str == NULL) {
38100 0 : PyErr_NoMemory();
38101 0 : return false;
38102 : }
38103 0 : r->in.lpBinaryPathName = talloc_str;
38104 : }
38105 0 : if (py_lpLoadOrderGroup == NULL) {
38106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpLoadOrderGroup");
38107 0 : return false;
38108 : }
38109 0 : if (py_lpLoadOrderGroup == Py_None) {
38110 0 : r->in.lpLoadOrderGroup = NULL;
38111 : } else {
38112 0 : r->in.lpLoadOrderGroup = NULL;
38113 : {
38114 0 : const char *test_str;
38115 0 : const char *talloc_str;
38116 0 : PyObject *unicode = NULL;
38117 0 : if (PyUnicode_Check(py_lpLoadOrderGroup)) {
38118 0 : unicode = PyUnicode_AsEncodedString(py_lpLoadOrderGroup, "utf-8", "ignore");
38119 0 : if (unicode == NULL) {
38120 0 : return false;
38121 : }
38122 0 : test_str = PyBytes_AS_STRING(unicode);
38123 0 : } else if (PyBytes_Check(py_lpLoadOrderGroup)) {
38124 0 : test_str = PyBytes_AS_STRING(py_lpLoadOrderGroup);
38125 : } else {
38126 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpLoadOrderGroup)->tp_name);
38127 0 : return false;
38128 : }
38129 0 : talloc_str = talloc_strdup(r, test_str);
38130 0 : if (unicode != NULL) {
38131 0 : Py_DECREF(unicode);
38132 : }
38133 0 : if (talloc_str == NULL) {
38134 0 : PyErr_NoMemory();
38135 0 : return false;
38136 : }
38137 0 : r->in.lpLoadOrderGroup = talloc_str;
38138 : }
38139 : }
38140 0 : if (py_lpdwTagId == NULL) {
38141 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpdwTagId");
38142 0 : return false;
38143 : }
38144 0 : if (py_lpdwTagId == Py_None) {
38145 0 : r->in.lpdwTagId = NULL;
38146 : } else {
38147 0 : r->in.lpdwTagId = talloc_ptrtype(r, r->in.lpdwTagId);
38148 0 : if (r->in.lpdwTagId == NULL) {
38149 0 : PyErr_NoMemory();
38150 0 : return false;
38151 : }
38152 : {
38153 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.lpdwTagId));
38154 0 : if (PyLong_Check(py_lpdwTagId)) {
38155 0 : unsigned long long test_var;
38156 0 : test_var = PyLong_AsUnsignedLongLong(py_lpdwTagId);
38157 0 : if (PyErr_Occurred() != NULL) {
38158 0 : return false;
38159 : }
38160 0 : if (test_var > uint_max) {
38161 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38162 : PyLong_Type.tp_name, uint_max, test_var);
38163 0 : return false;
38164 : }
38165 0 : *r->in.lpdwTagId = test_var;
38166 : } else {
38167 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38168 : PyLong_Type.tp_name);
38169 0 : return false;
38170 : }
38171 : }
38172 : }
38173 0 : if (py_lpDependencies == NULL) {
38174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDependencies");
38175 0 : return false;
38176 : }
38177 0 : if (py_lpDependencies == Py_None) {
38178 0 : r->in.lpDependencies = NULL;
38179 : } else {
38180 0 : r->in.lpDependencies = NULL;
38181 0 : PY_CHECK_TYPE(&PyList_Type, py_lpDependencies, return false;);
38182 : {
38183 0 : int lpDependencies_cntr_1;
38184 0 : r->in.lpDependencies = talloc_array_ptrtype(r, r->in.lpDependencies, PyList_GET_SIZE(py_lpDependencies));
38185 0 : if (!r->in.lpDependencies) { return false; }
38186 0 : talloc_set_name_const(r->in.lpDependencies, "ARRAY: r->in.lpDependencies");
38187 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < PyList_GET_SIZE(py_lpDependencies); lpDependencies_cntr_1++) {
38188 0 : if (PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1) == NULL) {
38189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDependencies[lpDependencies_cntr_1]");
38190 0 : return false;
38191 : }
38192 : {
38193 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lpDependencies[lpDependencies_cntr_1]));
38194 0 : if (PyLong_Check(PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1))) {
38195 0 : unsigned long long test_var;
38196 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1));
38197 0 : if (PyErr_Occurred() != NULL) {
38198 0 : return false;
38199 : }
38200 0 : if (test_var > uint_max) {
38201 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38202 : PyLong_Type.tp_name, uint_max, test_var);
38203 0 : return false;
38204 : }
38205 0 : r->in.lpDependencies[lpDependencies_cntr_1] = test_var;
38206 : } else {
38207 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38208 : PyLong_Type.tp_name);
38209 0 : return false;
38210 : }
38211 : }
38212 : }
38213 : }
38214 : }
38215 0 : PY_CHECK_TYPE(&PyList_Type, py_lpDependencies, return false;);
38216 0 : r->in.dwDependSize = PyList_GET_SIZE(py_lpDependencies);
38217 0 : if (py_lpServiceStartName == NULL) {
38218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpServiceStartName");
38219 0 : return false;
38220 : }
38221 0 : if (py_lpServiceStartName == Py_None) {
38222 0 : r->in.lpServiceStartName = NULL;
38223 : } else {
38224 0 : r->in.lpServiceStartName = NULL;
38225 : {
38226 0 : const char *test_str;
38227 0 : const char *talloc_str;
38228 0 : PyObject *unicode = NULL;
38229 0 : if (PyUnicode_Check(py_lpServiceStartName)) {
38230 0 : unicode = PyUnicode_AsEncodedString(py_lpServiceStartName, "utf-8", "ignore");
38231 0 : if (unicode == NULL) {
38232 0 : return false;
38233 : }
38234 0 : test_str = PyBytes_AS_STRING(unicode);
38235 0 : } else if (PyBytes_Check(py_lpServiceStartName)) {
38236 0 : test_str = PyBytes_AS_STRING(py_lpServiceStartName);
38237 : } else {
38238 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpServiceStartName)->tp_name);
38239 0 : return false;
38240 : }
38241 0 : talloc_str = talloc_strdup(r, test_str);
38242 0 : if (unicode != NULL) {
38243 0 : Py_DECREF(unicode);
38244 : }
38245 0 : if (talloc_str == NULL) {
38246 0 : PyErr_NoMemory();
38247 0 : return false;
38248 : }
38249 0 : r->in.lpServiceStartName = talloc_str;
38250 : }
38251 : }
38252 0 : if (py_lpPassword == NULL) {
38253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpPassword");
38254 0 : return false;
38255 : }
38256 0 : if (py_lpPassword == Py_None) {
38257 0 : r->in.lpPassword = NULL;
38258 : } else {
38259 0 : r->in.lpPassword = NULL;
38260 0 : PY_CHECK_TYPE(&PyList_Type, py_lpPassword, return false;);
38261 : {
38262 0 : int lpPassword_cntr_1;
38263 0 : r->in.lpPassword = talloc_array_ptrtype(r, r->in.lpPassword, PyList_GET_SIZE(py_lpPassword));
38264 0 : if (!r->in.lpPassword) { return false; }
38265 0 : talloc_set_name_const(r->in.lpPassword, "ARRAY: r->in.lpPassword");
38266 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < PyList_GET_SIZE(py_lpPassword); lpPassword_cntr_1++) {
38267 0 : if (PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1) == NULL) {
38268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpPassword[lpPassword_cntr_1]");
38269 0 : return false;
38270 : }
38271 : {
38272 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lpPassword[lpPassword_cntr_1]));
38273 0 : if (PyLong_Check(PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1))) {
38274 0 : unsigned long long test_var;
38275 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1));
38276 0 : if (PyErr_Occurred() != NULL) {
38277 0 : return false;
38278 : }
38279 0 : if (test_var > uint_max) {
38280 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38281 : PyLong_Type.tp_name, uint_max, test_var);
38282 0 : return false;
38283 : }
38284 0 : r->in.lpPassword[lpPassword_cntr_1] = test_var;
38285 : } else {
38286 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38287 : PyLong_Type.tp_name);
38288 0 : return false;
38289 : }
38290 : }
38291 : }
38292 : }
38293 : }
38294 0 : PY_CHECK_TYPE(&PyList_Type, py_lpPassword, return false;);
38295 0 : r->in.dwPwSize = PyList_GET_SIZE(py_lpPassword);
38296 0 : return true;
38297 : }
38298 :
38299 0 : static PyObject *unpack_py_svcctl_CreateServiceWOW64W_args_out(struct svcctl_CreateServiceWOW64W *r)
38300 : {
38301 0 : PyObject *result;
38302 0 : PyObject *py_lpdwTagId;
38303 0 : PyObject *py_lpServiceHandle;
38304 0 : result = PyTuple_New(2);
38305 0 : if (r->out.lpdwTagId == NULL) {
38306 0 : py_lpdwTagId = Py_None;
38307 0 : Py_INCREF(py_lpdwTagId);
38308 : } else {
38309 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*r->out.lpdwTagId);
38310 : }
38311 0 : PyTuple_SetItem(result, 0, py_lpdwTagId);
38312 0 : py_lpServiceHandle = pytalloc_reference_ex(policy_handle_Type, r->out.lpServiceHandle, r->out.lpServiceHandle);
38313 0 : PyTuple_SetItem(result, 1, py_lpServiceHandle);
38314 0 : if (!W_ERROR_IS_OK(r->out.result)) {
38315 0 : PyErr_SetWERROR(r->out.result);
38316 0 : return NULL;
38317 : }
38318 :
38319 0 : return result;
38320 : }
38321 :
38322 :
38323 : static PyGetSetDef py_Opnum46NotUsedOnWire_getsetters[] = {
38324 : { .name = NULL }
38325 : };
38326 :
38327 0 : static PyObject *py_Opnum46NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38328 : {
38329 0 : PyObject *self = pytalloc_new(struct Opnum46NotUsedOnWire, type);
38330 0 : return self;
38331 : }
38332 :
38333 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38334 : {
38335 :
38336 :
38337 0 : return PyLong_FromLong(46);
38338 : }
38339 :
38340 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38341 : {
38342 0 : const struct ndr_interface_call *call = NULL;
38343 0 : struct Opnum46NotUsedOnWire *object = (struct Opnum46NotUsedOnWire *)pytalloc_get_ptr(py_obj);
38344 0 : PyObject *ret = NULL;
38345 0 : struct ndr_push *push = NULL;
38346 0 : DATA_BLOB blob;
38347 0 : enum ndr_err_code err;
38348 :
38349 0 : if (ndr_table_svcctl.num_calls < 47) {
38350 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum46NotUsedOnWire_ndr_pack");
38351 0 : return NULL;
38352 : }
38353 0 : call = &ndr_table_svcctl.calls[46];
38354 :
38355 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38356 0 : if (push == NULL) {
38357 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38358 0 : return NULL;
38359 : }
38360 :
38361 0 : push->flags |= ndr_push_flags;
38362 :
38363 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38364 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38365 0 : TALLOC_FREE(push);
38366 0 : PyErr_SetNdrError(err);
38367 0 : return NULL;
38368 : }
38369 0 : blob = ndr_push_blob(push);
38370 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38371 0 : TALLOC_FREE(push);
38372 0 : return ret;
38373 : }
38374 :
38375 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38376 : {
38377 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38378 0 : PyObject *bigendian_obj = NULL;
38379 0 : PyObject *ndr64_obj = NULL;
38380 0 : libndr_flags ndr_push_flags = 0;
38381 :
38382 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38383 : discard_const_p(char *, kwnames),
38384 : &bigendian_obj,
38385 : &ndr64_obj)) {
38386 0 : return NULL;
38387 : }
38388 :
38389 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38390 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38391 : }
38392 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38393 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38394 : }
38395 :
38396 0 : return py_Opnum46NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38397 : }
38398 :
38399 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38400 : {
38401 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38402 0 : PyObject *bigendian_obj = NULL;
38403 0 : PyObject *ndr64_obj = NULL;
38404 0 : libndr_flags ndr_push_flags = 0;
38405 :
38406 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38407 : discard_const_p(char *, kwnames),
38408 : &bigendian_obj,
38409 : &ndr64_obj)) {
38410 0 : return NULL;
38411 : }
38412 :
38413 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38414 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38415 : }
38416 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38417 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38418 : }
38419 :
38420 0 : return py_Opnum46NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38421 : }
38422 :
38423 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
38424 : {
38425 0 : const struct ndr_interface_call *call = NULL;
38426 0 : struct Opnum46NotUsedOnWire *object = (struct Opnum46NotUsedOnWire *)pytalloc_get_ptr(py_obj);
38427 0 : struct ndr_pull *pull = NULL;
38428 0 : enum ndr_err_code err;
38429 :
38430 0 : if (ndr_table_svcctl.num_calls < 47) {
38431 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum46NotUsedOnWire_ndr_unpack");
38432 0 : return NULL;
38433 : }
38434 0 : call = &ndr_table_svcctl.calls[46];
38435 :
38436 0 : pull = ndr_pull_init_blob(blob, object);
38437 0 : if (pull == NULL) {
38438 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38439 0 : return NULL;
38440 : }
38441 :
38442 0 : pull->flags |= ndr_pull_flags;
38443 :
38444 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38445 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38446 0 : TALLOC_FREE(pull);
38447 0 : PyErr_SetNdrError(err);
38448 0 : return NULL;
38449 : }
38450 0 : if (!allow_remaining) {
38451 0 : uint32_t highest_ofs;
38452 :
38453 0 : if (pull->offset > pull->relative_highest_offset) {
38454 0 : highest_ofs = pull->offset;
38455 : } else {
38456 0 : highest_ofs = pull->relative_highest_offset;
38457 : }
38458 0 : if (highest_ofs < pull->data_size) {
38459 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38460 : "not all bytes consumed ofs[%u] size[%u]",
38461 : highest_ofs, pull->data_size);
38462 0 : TALLOC_FREE(pull);
38463 0 : PyErr_SetNdrError(err);
38464 0 : return NULL;
38465 : }
38466 : }
38467 :
38468 0 : TALLOC_FREE(pull);
38469 0 : Py_RETURN_NONE;
38470 : }
38471 :
38472 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38473 : {
38474 0 : DATA_BLOB blob;
38475 0 : Py_ssize_t blob_length = 0;
38476 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38477 0 : PyObject *bigendian_obj = NULL;
38478 0 : PyObject *ndr64_obj = NULL;
38479 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38480 0 : PyObject *allow_remaining_obj = NULL;
38481 0 : bool allow_remaining = false;
38482 :
38483 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38484 : discard_const_p(char *, kwnames),
38485 : &blob.data, &blob_length,
38486 : &bigendian_obj,
38487 : &ndr64_obj,
38488 : &allow_remaining_obj)) {
38489 0 : return NULL;
38490 : }
38491 0 : blob.length = blob_length;
38492 :
38493 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38494 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38495 : }
38496 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38497 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38498 : }
38499 :
38500 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38501 0 : allow_remaining = true;
38502 : }
38503 :
38504 0 : return py_Opnum46NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38505 : }
38506 :
38507 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38508 : {
38509 0 : DATA_BLOB blob;
38510 0 : Py_ssize_t blob_length = 0;
38511 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38512 0 : PyObject *bigendian_obj = NULL;
38513 0 : PyObject *ndr64_obj = NULL;
38514 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38515 0 : PyObject *allow_remaining_obj = NULL;
38516 0 : bool allow_remaining = false;
38517 :
38518 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38519 : discard_const_p(char *, kwnames),
38520 : &blob.data, &blob_length,
38521 : &bigendian_obj,
38522 : &ndr64_obj,
38523 : &allow_remaining_obj)) {
38524 0 : return NULL;
38525 : }
38526 0 : blob.length = blob_length;
38527 :
38528 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38529 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38530 : }
38531 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38532 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38533 : }
38534 :
38535 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38536 0 : allow_remaining = true;
38537 : }
38538 :
38539 0 : return py_Opnum46NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38540 : }
38541 :
38542 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
38543 : {
38544 0 : const struct ndr_interface_call *call = NULL;
38545 0 : struct Opnum46NotUsedOnWire *object = (struct Opnum46NotUsedOnWire *)pytalloc_get_ptr(py_obj);
38546 0 : PyObject *ret;
38547 0 : char *retstr;
38548 :
38549 0 : if (ndr_table_svcctl.num_calls < 47) {
38550 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum46NotUsedOnWire_ndr_print");
38551 0 : return NULL;
38552 : }
38553 0 : call = &ndr_table_svcctl.calls[46];
38554 :
38555 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38556 0 : ret = PyUnicode_FromString(retstr);
38557 0 : TALLOC_FREE(retstr);
38558 :
38559 0 : return ret;
38560 : }
38561 :
38562 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38563 : {
38564 0 : return py_Opnum46NotUsedOnWire_ndr_print(py_obj, "Opnum46NotUsedOnWire_in", NDR_IN);
38565 : }
38566 :
38567 0 : static PyObject *py_Opnum46NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38568 : {
38569 0 : return py_Opnum46NotUsedOnWire_ndr_print(py_obj, "Opnum46NotUsedOnWire_out", NDR_OUT);
38570 : }
38571 :
38572 : static PyMethodDef py_Opnum46NotUsedOnWire_methods[] = {
38573 : { "opnum", (PyCFunction)py_Opnum46NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
38574 : "svcctl.Opnum46NotUsedOnWire.opnum() -> 46 (0x2e) " },
38575 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum46NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38576 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38577 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum46NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38578 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38579 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum46NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38580 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38581 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum46NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38582 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38583 : { "__ndr_print_in__", (PyCFunction)py_Opnum46NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38584 : { "__ndr_print_out__", (PyCFunction)py_Opnum46NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38585 : { NULL, NULL, 0, NULL }
38586 : };
38587 :
38588 :
38589 : static PyTypeObject Opnum46NotUsedOnWire_Type = {
38590 : PyVarObject_HEAD_INIT(NULL, 0)
38591 : .tp_name = "svcctl.Opnum46NotUsedOnWire",
38592 : .tp_getset = py_Opnum46NotUsedOnWire_getsetters,
38593 : .tp_methods = py_Opnum46NotUsedOnWire_methods,
38594 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38595 : .tp_new = py_Opnum46NotUsedOnWire_new,
38596 : };
38597 :
38598 0 : static bool pack_py_Opnum46NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum46NotUsedOnWire *r)
38599 : {
38600 0 : const char *kwnames[] = {
38601 : NULL
38602 : };
38603 :
38604 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum46NotUsedOnWire", discard_const_p(char *, kwnames))) {
38605 0 : return false;
38606 : }
38607 :
38608 0 : return true;
38609 : }
38610 :
38611 0 : static PyObject *unpack_py_Opnum46NotUsedOnWire_args_out(struct Opnum46NotUsedOnWire *r)
38612 : {
38613 0 : PyObject *result;
38614 0 : result = Py_None;
38615 0 : Py_INCREF(result);
38616 0 : return result;
38617 : }
38618 :
38619 :
38620 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_in_get_hService(PyObject *obj, void *closure)
38621 : {
38622 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(obj);
38623 0 : PyObject *py_hService;
38624 0 : py_hService = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hService);
38625 0 : return py_hService;
38626 : }
38627 :
38628 0 : static int py_svcctl_NotifyServiceStatusChange_in_set_hService(PyObject *py_obj, PyObject *value, void *closure)
38629 : {
38630 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38631 0 : if (value == NULL) {
38632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hService");
38633 0 : return -1;
38634 : }
38635 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38636 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38637 0 : PyErr_NoMemory();
38638 0 : return -1;
38639 : }
38640 0 : object->in.hService = *(struct policy_handle *)pytalloc_get_ptr(value);
38641 0 : return 0;
38642 : }
38643 :
38644 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_in_get_NotifyParams(PyObject *obj, void *closure)
38645 : {
38646 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(obj);
38647 0 : PyObject *py_NotifyParams;
38648 0 : py_NotifyParams = pytalloc_reference_ex(&SC_RPC_NOTIFY_PARAMS_Type, pytalloc_get_mem_ctx(obj), &object->in.NotifyParams);
38649 0 : return py_NotifyParams;
38650 : }
38651 :
38652 0 : static int py_svcctl_NotifyServiceStatusChange_in_set_NotifyParams(PyObject *py_obj, PyObject *value, void *closure)
38653 : {
38654 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38655 0 : if (value == NULL) {
38656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.NotifyParams");
38657 0 : return -1;
38658 : }
38659 0 : PY_CHECK_TYPE(&SC_RPC_NOTIFY_PARAMS_Type, value, return -1;);
38660 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38661 0 : PyErr_NoMemory();
38662 0 : return -1;
38663 : }
38664 0 : object->in.NotifyParams = *(struct SC_RPC_NOTIFY_PARAMS *)pytalloc_get_ptr(value);
38665 0 : return 0;
38666 : }
38667 :
38668 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_in_get_pClientProcessGuid(PyObject *obj, void *closure)
38669 : {
38670 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(obj);
38671 0 : PyObject *py_pClientProcessGuid;
38672 0 : if (object->in.pClientProcessGuid == NULL) {
38673 0 : Py_RETURN_NONE;
38674 : }
38675 0 : py_pClientProcessGuid = pytalloc_reference_ex(GUID_Type, object->in.pClientProcessGuid, object->in.pClientProcessGuid);
38676 0 : return py_pClientProcessGuid;
38677 : }
38678 :
38679 0 : static int py_svcctl_NotifyServiceStatusChange_in_set_pClientProcessGuid(PyObject *py_obj, PyObject *value, void *closure)
38680 : {
38681 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38682 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.pClientProcessGuid));
38683 0 : if (value == NULL) {
38684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.pClientProcessGuid");
38685 0 : return -1;
38686 : }
38687 0 : object->in.pClientProcessGuid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pClientProcessGuid);
38688 0 : if (object->in.pClientProcessGuid == NULL) {
38689 0 : PyErr_NoMemory();
38690 0 : return -1;
38691 : }
38692 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
38693 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38694 0 : PyErr_NoMemory();
38695 0 : return -1;
38696 : }
38697 0 : object->in.pClientProcessGuid = (struct GUID *)pytalloc_get_ptr(value);
38698 0 : return 0;
38699 : }
38700 :
38701 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_out_get_pSCMProcessGuid(PyObject *obj, void *closure)
38702 : {
38703 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(obj);
38704 0 : PyObject *py_pSCMProcessGuid;
38705 0 : if (object->out.pSCMProcessGuid == NULL) {
38706 0 : Py_RETURN_NONE;
38707 : }
38708 0 : py_pSCMProcessGuid = pytalloc_reference_ex(GUID_Type, object->out.pSCMProcessGuid, object->out.pSCMProcessGuid);
38709 0 : return py_pSCMProcessGuid;
38710 : }
38711 :
38712 0 : static int py_svcctl_NotifyServiceStatusChange_out_set_pSCMProcessGuid(PyObject *py_obj, PyObject *value, void *closure)
38713 : {
38714 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38715 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pSCMProcessGuid));
38716 0 : if (value == NULL) {
38717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pSCMProcessGuid");
38718 0 : return -1;
38719 : }
38720 0 : object->out.pSCMProcessGuid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pSCMProcessGuid);
38721 0 : if (object->out.pSCMProcessGuid == NULL) {
38722 0 : PyErr_NoMemory();
38723 0 : return -1;
38724 : }
38725 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
38726 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38727 0 : PyErr_NoMemory();
38728 0 : return -1;
38729 : }
38730 0 : object->out.pSCMProcessGuid = (struct GUID *)pytalloc_get_ptr(value);
38731 0 : return 0;
38732 : }
38733 :
38734 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_out_get_pfCreateRemoteQueue(PyObject *obj, void *closure)
38735 : {
38736 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(obj);
38737 0 : PyObject *py_pfCreateRemoteQueue;
38738 0 : if (object->out.pfCreateRemoteQueue == NULL) {
38739 0 : Py_RETURN_NONE;
38740 : }
38741 0 : py_pfCreateRemoteQueue = PyLong_FromUnsignedLongLong((uint32_t)*object->out.pfCreateRemoteQueue);
38742 0 : return py_pfCreateRemoteQueue;
38743 : }
38744 :
38745 0 : static int py_svcctl_NotifyServiceStatusChange_out_set_pfCreateRemoteQueue(PyObject *py_obj, PyObject *value, void *closure)
38746 : {
38747 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38748 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pfCreateRemoteQueue));
38749 0 : if (value == NULL) {
38750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pfCreateRemoteQueue");
38751 0 : return -1;
38752 : }
38753 0 : object->out.pfCreateRemoteQueue = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pfCreateRemoteQueue);
38754 0 : if (object->out.pfCreateRemoteQueue == NULL) {
38755 0 : PyErr_NoMemory();
38756 0 : return -1;
38757 : }
38758 : {
38759 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.pfCreateRemoteQueue));
38760 0 : if (PyLong_Check(value)) {
38761 0 : unsigned long long test_var;
38762 0 : test_var = PyLong_AsUnsignedLongLong(value);
38763 0 : if (PyErr_Occurred() != NULL) {
38764 0 : return -1;
38765 : }
38766 0 : if (test_var > uint_max) {
38767 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38768 : PyLong_Type.tp_name, uint_max, test_var);
38769 0 : return -1;
38770 : }
38771 0 : *object->out.pfCreateRemoteQueue = test_var;
38772 : } else {
38773 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38774 : PyLong_Type.tp_name);
38775 0 : return -1;
38776 : }
38777 : }
38778 0 : return 0;
38779 : }
38780 :
38781 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_out_get_phNotify(PyObject *obj, void *closure)
38782 : {
38783 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(obj);
38784 0 : PyObject *py_phNotify;
38785 0 : if (object->out.phNotify == NULL) {
38786 0 : Py_RETURN_NONE;
38787 : }
38788 0 : py_phNotify = pytalloc_reference_ex(policy_handle_Type, object->out.phNotify, object->out.phNotify);
38789 0 : return py_phNotify;
38790 : }
38791 :
38792 0 : static int py_svcctl_NotifyServiceStatusChange_out_set_phNotify(PyObject *py_obj, PyObject *value, void *closure)
38793 : {
38794 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38795 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.phNotify));
38796 0 : if (value == NULL) {
38797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.phNotify");
38798 0 : return -1;
38799 : }
38800 0 : object->out.phNotify = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.phNotify);
38801 0 : if (object->out.phNotify == NULL) {
38802 0 : PyErr_NoMemory();
38803 0 : return -1;
38804 : }
38805 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38806 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38807 0 : PyErr_NoMemory();
38808 0 : return -1;
38809 : }
38810 0 : object->out.phNotify = (struct policy_handle *)pytalloc_get_ptr(value);
38811 0 : return 0;
38812 : }
38813 :
38814 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_get_result(PyObject *obj, void *closure)
38815 : {
38816 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(obj);
38817 0 : PyObject *py_result;
38818 0 : py_result = PyErr_FromWERROR(object->out.result);
38819 0 : return py_result;
38820 : }
38821 :
38822 0 : static int py_svcctl_NotifyServiceStatusChange_set_result(PyObject *py_obj, PyObject *value, void *closure)
38823 : {
38824 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38825 0 : if (value == NULL) {
38826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38827 0 : return -1;
38828 : }
38829 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
38830 0 : return 0;
38831 : }
38832 :
38833 : static PyGetSetDef py_svcctl_NotifyServiceStatusChange_getsetters[] = {
38834 : {
38835 : .name = discard_const_p(char, "in_hService"),
38836 : .get = py_svcctl_NotifyServiceStatusChange_in_get_hService,
38837 : .set = py_svcctl_NotifyServiceStatusChange_in_set_hService,
38838 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38839 : },
38840 : {
38841 : .name = discard_const_p(char, "in_NotifyParams"),
38842 : .get = py_svcctl_NotifyServiceStatusChange_in_get_NotifyParams,
38843 : .set = py_svcctl_NotifyServiceStatusChange_in_set_NotifyParams,
38844 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_NOTIFY_PARAMS")
38845 : },
38846 : {
38847 : .name = discard_const_p(char, "in_pClientProcessGuid"),
38848 : .get = py_svcctl_NotifyServiceStatusChange_in_get_pClientProcessGuid,
38849 : .set = py_svcctl_NotifyServiceStatusChange_in_set_pClientProcessGuid,
38850 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
38851 : },
38852 : {
38853 : .name = discard_const_p(char, "out_pSCMProcessGuid"),
38854 : .get = py_svcctl_NotifyServiceStatusChange_out_get_pSCMProcessGuid,
38855 : .set = py_svcctl_NotifyServiceStatusChange_out_set_pSCMProcessGuid,
38856 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
38857 : },
38858 : {
38859 : .name = discard_const_p(char, "out_pfCreateRemoteQueue"),
38860 : .get = py_svcctl_NotifyServiceStatusChange_out_get_pfCreateRemoteQueue,
38861 : .set = py_svcctl_NotifyServiceStatusChange_out_set_pfCreateRemoteQueue,
38862 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
38863 : },
38864 : {
38865 : .name = discard_const_p(char, "out_phNotify"),
38866 : .get = py_svcctl_NotifyServiceStatusChange_out_get_phNotify,
38867 : .set = py_svcctl_NotifyServiceStatusChange_out_set_phNotify,
38868 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38869 : },
38870 : {
38871 : .name = discard_const_p(char, "result"),
38872 : .get = py_svcctl_NotifyServiceStatusChange_get_result,
38873 : .set = py_svcctl_NotifyServiceStatusChange_set_result,
38874 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
38875 : },
38876 : { .name = NULL }
38877 : };
38878 :
38879 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38880 : {
38881 0 : PyObject *self = pytalloc_new(struct svcctl_NotifyServiceStatusChange, type);
38882 0 : struct svcctl_NotifyServiceStatusChange *_self = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(self);
38883 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38884 0 : _self->in.pClientProcessGuid = talloc_zero(mem_ctx, struct GUID);
38885 0 : _self->out.pSCMProcessGuid = talloc_zero(mem_ctx, struct GUID);
38886 0 : _self->out.pfCreateRemoteQueue = talloc_zero(mem_ctx, uint32_t);
38887 0 : _self->out.phNotify = talloc_zero(mem_ctx, struct policy_handle);
38888 0 : return self;
38889 : }
38890 :
38891 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38892 : {
38893 :
38894 :
38895 0 : return PyLong_FromLong(47);
38896 : }
38897 :
38898 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38899 : {
38900 0 : const struct ndr_interface_call *call = NULL;
38901 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38902 0 : PyObject *ret = NULL;
38903 0 : struct ndr_push *push = NULL;
38904 0 : DATA_BLOB blob;
38905 0 : enum ndr_err_code err;
38906 :
38907 0 : if (ndr_table_svcctl.num_calls < 48) {
38908 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_NotifyServiceStatusChange_ndr_pack");
38909 0 : return NULL;
38910 : }
38911 0 : call = &ndr_table_svcctl.calls[47];
38912 :
38913 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38914 0 : if (push == NULL) {
38915 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38916 0 : return NULL;
38917 : }
38918 :
38919 0 : push->flags |= ndr_push_flags;
38920 :
38921 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38922 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38923 0 : TALLOC_FREE(push);
38924 0 : PyErr_SetNdrError(err);
38925 0 : return NULL;
38926 : }
38927 0 : blob = ndr_push_blob(push);
38928 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38929 0 : TALLOC_FREE(push);
38930 0 : return ret;
38931 : }
38932 :
38933 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38934 : {
38935 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38936 0 : PyObject *bigendian_obj = NULL;
38937 0 : PyObject *ndr64_obj = NULL;
38938 0 : libndr_flags ndr_push_flags = 0;
38939 :
38940 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38941 : discard_const_p(char *, kwnames),
38942 : &bigendian_obj,
38943 : &ndr64_obj)) {
38944 0 : return NULL;
38945 : }
38946 :
38947 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38948 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38949 : }
38950 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38951 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38952 : }
38953 :
38954 0 : return py_svcctl_NotifyServiceStatusChange_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38955 : }
38956 :
38957 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38958 : {
38959 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38960 0 : PyObject *bigendian_obj = NULL;
38961 0 : PyObject *ndr64_obj = NULL;
38962 0 : libndr_flags ndr_push_flags = 0;
38963 :
38964 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38965 : discard_const_p(char *, kwnames),
38966 : &bigendian_obj,
38967 : &ndr64_obj)) {
38968 0 : return NULL;
38969 : }
38970 :
38971 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38972 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38973 : }
38974 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38975 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38976 : }
38977 :
38978 0 : return py_svcctl_NotifyServiceStatusChange_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38979 : }
38980 :
38981 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
38982 : {
38983 0 : const struct ndr_interface_call *call = NULL;
38984 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
38985 0 : struct ndr_pull *pull = NULL;
38986 0 : enum ndr_err_code err;
38987 :
38988 0 : if (ndr_table_svcctl.num_calls < 48) {
38989 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_NotifyServiceStatusChange_ndr_unpack");
38990 0 : return NULL;
38991 : }
38992 0 : call = &ndr_table_svcctl.calls[47];
38993 :
38994 0 : pull = ndr_pull_init_blob(blob, object);
38995 0 : if (pull == NULL) {
38996 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38997 0 : return NULL;
38998 : }
38999 :
39000 0 : pull->flags |= ndr_pull_flags;
39001 :
39002 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39003 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39004 0 : TALLOC_FREE(pull);
39005 0 : PyErr_SetNdrError(err);
39006 0 : return NULL;
39007 : }
39008 0 : if (!allow_remaining) {
39009 0 : uint32_t highest_ofs;
39010 :
39011 0 : if (pull->offset > pull->relative_highest_offset) {
39012 0 : highest_ofs = pull->offset;
39013 : } else {
39014 0 : highest_ofs = pull->relative_highest_offset;
39015 : }
39016 0 : if (highest_ofs < pull->data_size) {
39017 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39018 : "not all bytes consumed ofs[%u] size[%u]",
39019 : highest_ofs, pull->data_size);
39020 0 : TALLOC_FREE(pull);
39021 0 : PyErr_SetNdrError(err);
39022 0 : return NULL;
39023 : }
39024 : }
39025 :
39026 0 : TALLOC_FREE(pull);
39027 0 : Py_RETURN_NONE;
39028 : }
39029 :
39030 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39031 : {
39032 0 : DATA_BLOB blob;
39033 0 : Py_ssize_t blob_length = 0;
39034 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39035 0 : PyObject *bigendian_obj = NULL;
39036 0 : PyObject *ndr64_obj = NULL;
39037 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39038 0 : PyObject *allow_remaining_obj = NULL;
39039 0 : bool allow_remaining = false;
39040 :
39041 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39042 : discard_const_p(char *, kwnames),
39043 : &blob.data, &blob_length,
39044 : &bigendian_obj,
39045 : &ndr64_obj,
39046 : &allow_remaining_obj)) {
39047 0 : return NULL;
39048 : }
39049 0 : blob.length = blob_length;
39050 :
39051 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39052 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39053 : }
39054 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39055 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39056 : }
39057 :
39058 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39059 0 : allow_remaining = true;
39060 : }
39061 :
39062 0 : return py_svcctl_NotifyServiceStatusChange_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39063 : }
39064 :
39065 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39066 : {
39067 0 : DATA_BLOB blob;
39068 0 : Py_ssize_t blob_length = 0;
39069 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39070 0 : PyObject *bigendian_obj = NULL;
39071 0 : PyObject *ndr64_obj = NULL;
39072 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39073 0 : PyObject *allow_remaining_obj = NULL;
39074 0 : bool allow_remaining = false;
39075 :
39076 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39077 : discard_const_p(char *, kwnames),
39078 : &blob.data, &blob_length,
39079 : &bigendian_obj,
39080 : &ndr64_obj,
39081 : &allow_remaining_obj)) {
39082 0 : return NULL;
39083 : }
39084 0 : blob.length = blob_length;
39085 :
39086 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39087 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39088 : }
39089 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39090 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39091 : }
39092 :
39093 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39094 0 : allow_remaining = true;
39095 : }
39096 :
39097 0 : return py_svcctl_NotifyServiceStatusChange_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39098 : }
39099 :
39100 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39101 : {
39102 0 : const struct ndr_interface_call *call = NULL;
39103 0 : struct svcctl_NotifyServiceStatusChange *object = (struct svcctl_NotifyServiceStatusChange *)pytalloc_get_ptr(py_obj);
39104 0 : PyObject *ret;
39105 0 : char *retstr;
39106 :
39107 0 : if (ndr_table_svcctl.num_calls < 48) {
39108 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_NotifyServiceStatusChange_ndr_print");
39109 0 : return NULL;
39110 : }
39111 0 : call = &ndr_table_svcctl.calls[47];
39112 :
39113 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39114 0 : ret = PyUnicode_FromString(retstr);
39115 0 : TALLOC_FREE(retstr);
39116 :
39117 0 : return ret;
39118 : }
39119 :
39120 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39121 : {
39122 0 : return py_svcctl_NotifyServiceStatusChange_ndr_print(py_obj, "svcctl_NotifyServiceStatusChange_in", NDR_IN);
39123 : }
39124 :
39125 0 : static PyObject *py_svcctl_NotifyServiceStatusChange_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39126 : {
39127 0 : return py_svcctl_NotifyServiceStatusChange_ndr_print(py_obj, "svcctl_NotifyServiceStatusChange_out", NDR_OUT);
39128 : }
39129 :
39130 : static PyMethodDef py_svcctl_NotifyServiceStatusChange_methods[] = {
39131 : { "opnum", (PyCFunction)py_svcctl_NotifyServiceStatusChange_ndr_opnum, METH_NOARGS|METH_CLASS,
39132 : "svcctl.NotifyServiceStatusChange.opnum() -> 47 (0x2f) " },
39133 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_NotifyServiceStatusChange_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39134 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39135 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_NotifyServiceStatusChange_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39136 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39137 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_NotifyServiceStatusChange_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39138 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39139 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_NotifyServiceStatusChange_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39140 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39141 : { "__ndr_print_in__", (PyCFunction)py_svcctl_NotifyServiceStatusChange_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39142 : { "__ndr_print_out__", (PyCFunction)py_svcctl_NotifyServiceStatusChange_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39143 : { NULL, NULL, 0, NULL }
39144 : };
39145 :
39146 :
39147 : static PyTypeObject svcctl_NotifyServiceStatusChange_Type = {
39148 : PyVarObject_HEAD_INIT(NULL, 0)
39149 : .tp_name = "svcctl.NotifyServiceStatusChange",
39150 : .tp_getset = py_svcctl_NotifyServiceStatusChange_getsetters,
39151 : .tp_methods = py_svcctl_NotifyServiceStatusChange_methods,
39152 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39153 : .tp_new = py_svcctl_NotifyServiceStatusChange_new,
39154 : };
39155 :
39156 0 : static bool pack_py_svcctl_NotifyServiceStatusChange_args_in(PyObject *args, PyObject *kwargs, struct svcctl_NotifyServiceStatusChange *r)
39157 : {
39158 0 : PyObject *py_hService;
39159 0 : PyObject *py_NotifyParams;
39160 0 : PyObject *py_pClientProcessGuid;
39161 0 : const char *kwnames[] = {
39162 : "hService", "NotifyParams", "pClientProcessGuid", NULL
39163 : };
39164 :
39165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_NotifyServiceStatusChange", discard_const_p(char *, kwnames), &py_hService, &py_NotifyParams, &py_pClientProcessGuid)) {
39166 0 : return false;
39167 : }
39168 :
39169 0 : if (py_hService == NULL) {
39170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hService");
39171 0 : return false;
39172 : }
39173 0 : PY_CHECK_TYPE(policy_handle_Type, py_hService, return false;);
39174 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hService)) == NULL) {
39175 0 : PyErr_NoMemory();
39176 0 : return false;
39177 : }
39178 0 : r->in.hService = *(struct policy_handle *)pytalloc_get_ptr(py_hService);
39179 0 : if (py_NotifyParams == NULL) {
39180 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.NotifyParams");
39181 0 : return false;
39182 : }
39183 0 : PY_CHECK_TYPE(&SC_RPC_NOTIFY_PARAMS_Type, py_NotifyParams, return false;);
39184 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_NotifyParams)) == NULL) {
39185 0 : PyErr_NoMemory();
39186 0 : return false;
39187 : }
39188 0 : r->in.NotifyParams = *(struct SC_RPC_NOTIFY_PARAMS *)pytalloc_get_ptr(py_NotifyParams);
39189 0 : if (py_pClientProcessGuid == NULL) {
39190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.pClientProcessGuid");
39191 0 : return false;
39192 : }
39193 0 : r->in.pClientProcessGuid = talloc_ptrtype(r, r->in.pClientProcessGuid);
39194 0 : if (r->in.pClientProcessGuid == NULL) {
39195 0 : PyErr_NoMemory();
39196 0 : return false;
39197 : }
39198 0 : PY_CHECK_TYPE(GUID_Type, py_pClientProcessGuid, return false;);
39199 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_pClientProcessGuid)) == NULL) {
39200 0 : PyErr_NoMemory();
39201 0 : return false;
39202 : }
39203 0 : r->in.pClientProcessGuid = (struct GUID *)pytalloc_get_ptr(py_pClientProcessGuid);
39204 0 : return true;
39205 : }
39206 :
39207 0 : static PyObject *unpack_py_svcctl_NotifyServiceStatusChange_args_out(struct svcctl_NotifyServiceStatusChange *r)
39208 : {
39209 0 : PyObject *result;
39210 0 : PyObject *py_pSCMProcessGuid;
39211 0 : PyObject *py_pfCreateRemoteQueue;
39212 0 : PyObject *py_phNotify;
39213 0 : result = PyTuple_New(3);
39214 0 : py_pSCMProcessGuid = pytalloc_reference_ex(GUID_Type, r->out.pSCMProcessGuid, r->out.pSCMProcessGuid);
39215 0 : PyTuple_SetItem(result, 0, py_pSCMProcessGuid);
39216 0 : py_pfCreateRemoteQueue = PyLong_FromUnsignedLongLong((uint32_t)*r->out.pfCreateRemoteQueue);
39217 0 : PyTuple_SetItem(result, 1, py_pfCreateRemoteQueue);
39218 0 : py_phNotify = pytalloc_reference_ex(policy_handle_Type, r->out.phNotify, r->out.phNotify);
39219 0 : PyTuple_SetItem(result, 2, py_phNotify);
39220 0 : if (!W_ERROR_IS_OK(r->out.result)) {
39221 0 : PyErr_SetWERROR(r->out.result);
39222 0 : return NULL;
39223 : }
39224 :
39225 0 : return result;
39226 : }
39227 :
39228 :
39229 0 : static PyObject *py_svcctl_GetNotifyResults_in_get_hNotify(PyObject *obj, void *closure)
39230 : {
39231 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(obj);
39232 0 : PyObject *py_hNotify;
39233 0 : py_hNotify = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hNotify);
39234 0 : return py_hNotify;
39235 : }
39236 :
39237 0 : static int py_svcctl_GetNotifyResults_in_set_hNotify(PyObject *py_obj, PyObject *value, void *closure)
39238 : {
39239 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(py_obj);
39240 0 : if (value == NULL) {
39241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hNotify");
39242 0 : return -1;
39243 : }
39244 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39245 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39246 0 : PyErr_NoMemory();
39247 0 : return -1;
39248 : }
39249 0 : object->in.hNotify = *(struct policy_handle *)pytalloc_get_ptr(value);
39250 0 : return 0;
39251 : }
39252 :
39253 0 : static PyObject *py_svcctl_GetNotifyResults_out_get_ppNotifyParams(PyObject *obj, void *closure)
39254 : {
39255 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(obj);
39256 0 : PyObject *py_ppNotifyParams;
39257 0 : if (object->out.ppNotifyParams == NULL) {
39258 0 : Py_RETURN_NONE;
39259 : }
39260 0 : py_ppNotifyParams = pytalloc_reference_ex(&SC_RPC_NOTIFY_PARAMS_LIST_Type, object->out.ppNotifyParams, object->out.ppNotifyParams);
39261 0 : return py_ppNotifyParams;
39262 : }
39263 :
39264 0 : static int py_svcctl_GetNotifyResults_out_set_ppNotifyParams(PyObject *py_obj, PyObject *value, void *closure)
39265 : {
39266 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(py_obj);
39267 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ppNotifyParams));
39268 0 : if (value == NULL) {
39269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ppNotifyParams");
39270 0 : return -1;
39271 : }
39272 0 : object->out.ppNotifyParams = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ppNotifyParams);
39273 0 : if (object->out.ppNotifyParams == NULL) {
39274 0 : PyErr_NoMemory();
39275 0 : return -1;
39276 : }
39277 0 : PY_CHECK_TYPE(&SC_RPC_NOTIFY_PARAMS_LIST_Type, value, return -1;);
39278 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39279 0 : PyErr_NoMemory();
39280 0 : return -1;
39281 : }
39282 0 : object->out.ppNotifyParams = (struct SC_RPC_NOTIFY_PARAMS_LIST *)pytalloc_get_ptr(value);
39283 0 : return 0;
39284 : }
39285 :
39286 0 : static PyObject *py_svcctl_GetNotifyResults_get_result(PyObject *obj, void *closure)
39287 : {
39288 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(obj);
39289 0 : PyObject *py_result;
39290 0 : py_result = PyErr_FromWERROR(object->out.result);
39291 0 : return py_result;
39292 : }
39293 :
39294 0 : static int py_svcctl_GetNotifyResults_set_result(PyObject *py_obj, PyObject *value, void *closure)
39295 : {
39296 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(py_obj);
39297 0 : if (value == NULL) {
39298 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39299 0 : return -1;
39300 : }
39301 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
39302 0 : return 0;
39303 : }
39304 :
39305 : static PyGetSetDef py_svcctl_GetNotifyResults_getsetters[] = {
39306 : {
39307 : .name = discard_const_p(char, "in_hNotify"),
39308 : .get = py_svcctl_GetNotifyResults_in_get_hNotify,
39309 : .set = py_svcctl_GetNotifyResults_in_set_hNotify,
39310 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39311 : },
39312 : {
39313 : .name = discard_const_p(char, "out_ppNotifyParams"),
39314 : .get = py_svcctl_GetNotifyResults_out_get_ppNotifyParams,
39315 : .set = py_svcctl_GetNotifyResults_out_set_ppNotifyParams,
39316 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_NOTIFY_PARAMS_LIST")
39317 : },
39318 : {
39319 : .name = discard_const_p(char, "result"),
39320 : .get = py_svcctl_GetNotifyResults_get_result,
39321 : .set = py_svcctl_GetNotifyResults_set_result,
39322 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
39323 : },
39324 : { .name = NULL }
39325 : };
39326 :
39327 0 : static PyObject *py_svcctl_GetNotifyResults_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39328 : {
39329 0 : PyObject *self = pytalloc_new(struct svcctl_GetNotifyResults, type);
39330 0 : struct svcctl_GetNotifyResults *_self = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(self);
39331 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39332 0 : _self->out.ppNotifyParams = talloc_zero(mem_ctx, struct SC_RPC_NOTIFY_PARAMS_LIST);
39333 0 : return self;
39334 : }
39335 :
39336 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39337 : {
39338 :
39339 :
39340 0 : return PyLong_FromLong(48);
39341 : }
39342 :
39343 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
39344 : {
39345 0 : const struct ndr_interface_call *call = NULL;
39346 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(py_obj);
39347 0 : PyObject *ret = NULL;
39348 0 : struct ndr_push *push = NULL;
39349 0 : DATA_BLOB blob;
39350 0 : enum ndr_err_code err;
39351 :
39352 0 : if (ndr_table_svcctl.num_calls < 49) {
39353 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetNotifyResults_ndr_pack");
39354 0 : return NULL;
39355 : }
39356 0 : call = &ndr_table_svcctl.calls[48];
39357 :
39358 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39359 0 : if (push == NULL) {
39360 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39361 0 : return NULL;
39362 : }
39363 :
39364 0 : push->flags |= ndr_push_flags;
39365 :
39366 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39367 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39368 0 : TALLOC_FREE(push);
39369 0 : PyErr_SetNdrError(err);
39370 0 : return NULL;
39371 : }
39372 0 : blob = ndr_push_blob(push);
39373 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39374 0 : TALLOC_FREE(push);
39375 0 : return ret;
39376 : }
39377 :
39378 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39379 : {
39380 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39381 0 : PyObject *bigendian_obj = NULL;
39382 0 : PyObject *ndr64_obj = NULL;
39383 0 : libndr_flags ndr_push_flags = 0;
39384 :
39385 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39386 : discard_const_p(char *, kwnames),
39387 : &bigendian_obj,
39388 : &ndr64_obj)) {
39389 0 : return NULL;
39390 : }
39391 :
39392 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39393 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39394 : }
39395 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39396 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39397 : }
39398 :
39399 0 : return py_svcctl_GetNotifyResults_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39400 : }
39401 :
39402 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39403 : {
39404 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39405 0 : PyObject *bigendian_obj = NULL;
39406 0 : PyObject *ndr64_obj = NULL;
39407 0 : libndr_flags ndr_push_flags = 0;
39408 :
39409 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39410 : discard_const_p(char *, kwnames),
39411 : &bigendian_obj,
39412 : &ndr64_obj)) {
39413 0 : return NULL;
39414 : }
39415 :
39416 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39417 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39418 : }
39419 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39420 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39421 : }
39422 :
39423 0 : return py_svcctl_GetNotifyResults_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39424 : }
39425 :
39426 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
39427 : {
39428 0 : const struct ndr_interface_call *call = NULL;
39429 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(py_obj);
39430 0 : struct ndr_pull *pull = NULL;
39431 0 : enum ndr_err_code err;
39432 :
39433 0 : if (ndr_table_svcctl.num_calls < 49) {
39434 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetNotifyResults_ndr_unpack");
39435 0 : return NULL;
39436 : }
39437 0 : call = &ndr_table_svcctl.calls[48];
39438 :
39439 0 : pull = ndr_pull_init_blob(blob, object);
39440 0 : if (pull == NULL) {
39441 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39442 0 : return NULL;
39443 : }
39444 :
39445 0 : pull->flags |= ndr_pull_flags;
39446 :
39447 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39448 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39449 0 : TALLOC_FREE(pull);
39450 0 : PyErr_SetNdrError(err);
39451 0 : return NULL;
39452 : }
39453 0 : if (!allow_remaining) {
39454 0 : uint32_t highest_ofs;
39455 :
39456 0 : if (pull->offset > pull->relative_highest_offset) {
39457 0 : highest_ofs = pull->offset;
39458 : } else {
39459 0 : highest_ofs = pull->relative_highest_offset;
39460 : }
39461 0 : if (highest_ofs < pull->data_size) {
39462 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39463 : "not all bytes consumed ofs[%u] size[%u]",
39464 : highest_ofs, pull->data_size);
39465 0 : TALLOC_FREE(pull);
39466 0 : PyErr_SetNdrError(err);
39467 0 : return NULL;
39468 : }
39469 : }
39470 :
39471 0 : TALLOC_FREE(pull);
39472 0 : Py_RETURN_NONE;
39473 : }
39474 :
39475 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39476 : {
39477 0 : DATA_BLOB blob;
39478 0 : Py_ssize_t blob_length = 0;
39479 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39480 0 : PyObject *bigendian_obj = NULL;
39481 0 : PyObject *ndr64_obj = NULL;
39482 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39483 0 : PyObject *allow_remaining_obj = NULL;
39484 0 : bool allow_remaining = false;
39485 :
39486 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39487 : discard_const_p(char *, kwnames),
39488 : &blob.data, &blob_length,
39489 : &bigendian_obj,
39490 : &ndr64_obj,
39491 : &allow_remaining_obj)) {
39492 0 : return NULL;
39493 : }
39494 0 : blob.length = blob_length;
39495 :
39496 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39497 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39498 : }
39499 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39500 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39501 : }
39502 :
39503 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39504 0 : allow_remaining = true;
39505 : }
39506 :
39507 0 : return py_svcctl_GetNotifyResults_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39508 : }
39509 :
39510 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39511 : {
39512 0 : DATA_BLOB blob;
39513 0 : Py_ssize_t blob_length = 0;
39514 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39515 0 : PyObject *bigendian_obj = NULL;
39516 0 : PyObject *ndr64_obj = NULL;
39517 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39518 0 : PyObject *allow_remaining_obj = NULL;
39519 0 : bool allow_remaining = false;
39520 :
39521 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39522 : discard_const_p(char *, kwnames),
39523 : &blob.data, &blob_length,
39524 : &bigendian_obj,
39525 : &ndr64_obj,
39526 : &allow_remaining_obj)) {
39527 0 : return NULL;
39528 : }
39529 0 : blob.length = blob_length;
39530 :
39531 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39532 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39533 : }
39534 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39535 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39536 : }
39537 :
39538 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39539 0 : allow_remaining = true;
39540 : }
39541 :
39542 0 : return py_svcctl_GetNotifyResults_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39543 : }
39544 :
39545 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39546 : {
39547 0 : const struct ndr_interface_call *call = NULL;
39548 0 : struct svcctl_GetNotifyResults *object = (struct svcctl_GetNotifyResults *)pytalloc_get_ptr(py_obj);
39549 0 : PyObject *ret;
39550 0 : char *retstr;
39551 :
39552 0 : if (ndr_table_svcctl.num_calls < 49) {
39553 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetNotifyResults_ndr_print");
39554 0 : return NULL;
39555 : }
39556 0 : call = &ndr_table_svcctl.calls[48];
39557 :
39558 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39559 0 : ret = PyUnicode_FromString(retstr);
39560 0 : TALLOC_FREE(retstr);
39561 :
39562 0 : return ret;
39563 : }
39564 :
39565 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39566 : {
39567 0 : return py_svcctl_GetNotifyResults_ndr_print(py_obj, "svcctl_GetNotifyResults_in", NDR_IN);
39568 : }
39569 :
39570 0 : static PyObject *py_svcctl_GetNotifyResults_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39571 : {
39572 0 : return py_svcctl_GetNotifyResults_ndr_print(py_obj, "svcctl_GetNotifyResults_out", NDR_OUT);
39573 : }
39574 :
39575 : static PyMethodDef py_svcctl_GetNotifyResults_methods[] = {
39576 : { "opnum", (PyCFunction)py_svcctl_GetNotifyResults_ndr_opnum, METH_NOARGS|METH_CLASS,
39577 : "svcctl.GetNotifyResults.opnum() -> 48 (0x30) " },
39578 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetNotifyResults_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39579 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39580 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetNotifyResults_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39581 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39582 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetNotifyResults_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39583 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39584 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetNotifyResults_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39585 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39586 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetNotifyResults_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39587 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetNotifyResults_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39588 : { NULL, NULL, 0, NULL }
39589 : };
39590 :
39591 :
39592 : static PyTypeObject svcctl_GetNotifyResults_Type = {
39593 : PyVarObject_HEAD_INIT(NULL, 0)
39594 : .tp_name = "svcctl.GetNotifyResults",
39595 : .tp_getset = py_svcctl_GetNotifyResults_getsetters,
39596 : .tp_methods = py_svcctl_GetNotifyResults_methods,
39597 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39598 : .tp_new = py_svcctl_GetNotifyResults_new,
39599 : };
39600 :
39601 0 : static bool pack_py_svcctl_GetNotifyResults_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetNotifyResults *r)
39602 : {
39603 0 : PyObject *py_hNotify;
39604 0 : const char *kwnames[] = {
39605 : "hNotify", NULL
39606 : };
39607 :
39608 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_GetNotifyResults", discard_const_p(char *, kwnames), &py_hNotify)) {
39609 0 : return false;
39610 : }
39611 :
39612 0 : if (py_hNotify == NULL) {
39613 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hNotify");
39614 0 : return false;
39615 : }
39616 0 : PY_CHECK_TYPE(policy_handle_Type, py_hNotify, return false;);
39617 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hNotify)) == NULL) {
39618 0 : PyErr_NoMemory();
39619 0 : return false;
39620 : }
39621 0 : r->in.hNotify = *(struct policy_handle *)pytalloc_get_ptr(py_hNotify);
39622 0 : return true;
39623 : }
39624 :
39625 0 : static PyObject *unpack_py_svcctl_GetNotifyResults_args_out(struct svcctl_GetNotifyResults *r)
39626 : {
39627 0 : PyObject *result;
39628 0 : PyObject *py_ppNotifyParams;
39629 0 : py_ppNotifyParams = pytalloc_reference_ex(&SC_RPC_NOTIFY_PARAMS_LIST_Type, r->out.ppNotifyParams, r->out.ppNotifyParams);
39630 0 : result = py_ppNotifyParams;
39631 0 : if (!W_ERROR_IS_OK(r->out.result)) {
39632 0 : PyErr_SetWERROR(r->out.result);
39633 0 : return NULL;
39634 : }
39635 :
39636 0 : return result;
39637 : }
39638 :
39639 :
39640 0 : static PyObject *py_svcctl_CloseNotifyHandle_in_get_phNotify(PyObject *obj, void *closure)
39641 : {
39642 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(obj);
39643 0 : PyObject *py_phNotify;
39644 0 : if (object->in.phNotify == NULL) {
39645 0 : Py_RETURN_NONE;
39646 : }
39647 0 : py_phNotify = pytalloc_reference_ex(policy_handle_Type, object->in.phNotify, object->in.phNotify);
39648 0 : return py_phNotify;
39649 : }
39650 :
39651 0 : static int py_svcctl_CloseNotifyHandle_in_set_phNotify(PyObject *py_obj, PyObject *value, void *closure)
39652 : {
39653 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(py_obj);
39654 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.phNotify));
39655 0 : if (value == NULL) {
39656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.phNotify");
39657 0 : return -1;
39658 : }
39659 0 : object->in.phNotify = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.phNotify);
39660 0 : if (object->in.phNotify == NULL) {
39661 0 : PyErr_NoMemory();
39662 0 : return -1;
39663 : }
39664 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39665 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39666 0 : PyErr_NoMemory();
39667 0 : return -1;
39668 : }
39669 0 : object->in.phNotify = (struct policy_handle *)pytalloc_get_ptr(value);
39670 0 : return 0;
39671 : }
39672 :
39673 0 : static PyObject *py_svcctl_CloseNotifyHandle_out_get_phNotify(PyObject *obj, void *closure)
39674 : {
39675 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(obj);
39676 0 : PyObject *py_phNotify;
39677 0 : if (object->out.phNotify == NULL) {
39678 0 : Py_RETURN_NONE;
39679 : }
39680 0 : py_phNotify = pytalloc_reference_ex(policy_handle_Type, object->out.phNotify, object->out.phNotify);
39681 0 : return py_phNotify;
39682 : }
39683 :
39684 0 : static int py_svcctl_CloseNotifyHandle_out_set_phNotify(PyObject *py_obj, PyObject *value, void *closure)
39685 : {
39686 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(py_obj);
39687 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.phNotify));
39688 0 : if (value == NULL) {
39689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.phNotify");
39690 0 : return -1;
39691 : }
39692 0 : object->out.phNotify = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.phNotify);
39693 0 : if (object->out.phNotify == NULL) {
39694 0 : PyErr_NoMemory();
39695 0 : return -1;
39696 : }
39697 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39698 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39699 0 : PyErr_NoMemory();
39700 0 : return -1;
39701 : }
39702 0 : object->out.phNotify = (struct policy_handle *)pytalloc_get_ptr(value);
39703 0 : return 0;
39704 : }
39705 :
39706 0 : static PyObject *py_svcctl_CloseNotifyHandle_out_get_pfApcFired(PyObject *obj, void *closure)
39707 : {
39708 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(obj);
39709 0 : PyObject *py_pfApcFired;
39710 0 : if (object->out.pfApcFired == NULL) {
39711 0 : Py_RETURN_NONE;
39712 : }
39713 0 : py_pfApcFired = PyLong_FromUnsignedLongLong((uint32_t)*object->out.pfApcFired);
39714 0 : return py_pfApcFired;
39715 : }
39716 :
39717 0 : static int py_svcctl_CloseNotifyHandle_out_set_pfApcFired(PyObject *py_obj, PyObject *value, void *closure)
39718 : {
39719 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(py_obj);
39720 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pfApcFired));
39721 0 : if (value == NULL) {
39722 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pfApcFired");
39723 0 : return -1;
39724 : }
39725 0 : object->out.pfApcFired = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pfApcFired);
39726 0 : if (object->out.pfApcFired == NULL) {
39727 0 : PyErr_NoMemory();
39728 0 : return -1;
39729 : }
39730 : {
39731 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.pfApcFired));
39732 0 : if (PyLong_Check(value)) {
39733 0 : unsigned long long test_var;
39734 0 : test_var = PyLong_AsUnsignedLongLong(value);
39735 0 : if (PyErr_Occurred() != NULL) {
39736 0 : return -1;
39737 : }
39738 0 : if (test_var > uint_max) {
39739 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39740 : PyLong_Type.tp_name, uint_max, test_var);
39741 0 : return -1;
39742 : }
39743 0 : *object->out.pfApcFired = test_var;
39744 : } else {
39745 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39746 : PyLong_Type.tp_name);
39747 0 : return -1;
39748 : }
39749 : }
39750 0 : return 0;
39751 : }
39752 :
39753 0 : static PyObject *py_svcctl_CloseNotifyHandle_get_result(PyObject *obj, void *closure)
39754 : {
39755 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(obj);
39756 0 : PyObject *py_result;
39757 0 : py_result = PyErr_FromWERROR(object->out.result);
39758 0 : return py_result;
39759 : }
39760 :
39761 0 : static int py_svcctl_CloseNotifyHandle_set_result(PyObject *py_obj, PyObject *value, void *closure)
39762 : {
39763 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(py_obj);
39764 0 : if (value == NULL) {
39765 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39766 0 : return -1;
39767 : }
39768 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
39769 0 : return 0;
39770 : }
39771 :
39772 : static PyGetSetDef py_svcctl_CloseNotifyHandle_getsetters[] = {
39773 : {
39774 : .name = discard_const_p(char, "in_phNotify"),
39775 : .get = py_svcctl_CloseNotifyHandle_in_get_phNotify,
39776 : .set = py_svcctl_CloseNotifyHandle_in_set_phNotify,
39777 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39778 : },
39779 : {
39780 : .name = discard_const_p(char, "out_phNotify"),
39781 : .get = py_svcctl_CloseNotifyHandle_out_get_phNotify,
39782 : .set = py_svcctl_CloseNotifyHandle_out_set_phNotify,
39783 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39784 : },
39785 : {
39786 : .name = discard_const_p(char, "out_pfApcFired"),
39787 : .get = py_svcctl_CloseNotifyHandle_out_get_pfApcFired,
39788 : .set = py_svcctl_CloseNotifyHandle_out_set_pfApcFired,
39789 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
39790 : },
39791 : {
39792 : .name = discard_const_p(char, "result"),
39793 : .get = py_svcctl_CloseNotifyHandle_get_result,
39794 : .set = py_svcctl_CloseNotifyHandle_set_result,
39795 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
39796 : },
39797 : { .name = NULL }
39798 : };
39799 :
39800 0 : static PyObject *py_svcctl_CloseNotifyHandle_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39801 : {
39802 0 : PyObject *self = pytalloc_new(struct svcctl_CloseNotifyHandle, type);
39803 0 : struct svcctl_CloseNotifyHandle *_self = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(self);
39804 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39805 0 : _self->in.phNotify = talloc_zero(mem_ctx, struct policy_handle);
39806 0 : _self->out.phNotify = talloc_zero(mem_ctx, struct policy_handle);
39807 0 : _self->out.pfApcFired = talloc_zero(mem_ctx, uint32_t);
39808 0 : return self;
39809 : }
39810 :
39811 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39812 : {
39813 :
39814 :
39815 0 : return PyLong_FromLong(49);
39816 : }
39817 :
39818 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
39819 : {
39820 0 : const struct ndr_interface_call *call = NULL;
39821 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(py_obj);
39822 0 : PyObject *ret = NULL;
39823 0 : struct ndr_push *push = NULL;
39824 0 : DATA_BLOB blob;
39825 0 : enum ndr_err_code err;
39826 :
39827 0 : if (ndr_table_svcctl.num_calls < 50) {
39828 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseNotifyHandle_ndr_pack");
39829 0 : return NULL;
39830 : }
39831 0 : call = &ndr_table_svcctl.calls[49];
39832 :
39833 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39834 0 : if (push == NULL) {
39835 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39836 0 : return NULL;
39837 : }
39838 :
39839 0 : push->flags |= ndr_push_flags;
39840 :
39841 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39842 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39843 0 : TALLOC_FREE(push);
39844 0 : PyErr_SetNdrError(err);
39845 0 : return NULL;
39846 : }
39847 0 : blob = ndr_push_blob(push);
39848 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39849 0 : TALLOC_FREE(push);
39850 0 : return ret;
39851 : }
39852 :
39853 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39854 : {
39855 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39856 0 : PyObject *bigendian_obj = NULL;
39857 0 : PyObject *ndr64_obj = NULL;
39858 0 : libndr_flags ndr_push_flags = 0;
39859 :
39860 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39861 : discard_const_p(char *, kwnames),
39862 : &bigendian_obj,
39863 : &ndr64_obj)) {
39864 0 : return NULL;
39865 : }
39866 :
39867 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39868 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39869 : }
39870 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39871 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39872 : }
39873 :
39874 0 : return py_svcctl_CloseNotifyHandle_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39875 : }
39876 :
39877 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39878 : {
39879 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39880 0 : PyObject *bigendian_obj = NULL;
39881 0 : PyObject *ndr64_obj = NULL;
39882 0 : libndr_flags ndr_push_flags = 0;
39883 :
39884 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39885 : discard_const_p(char *, kwnames),
39886 : &bigendian_obj,
39887 : &ndr64_obj)) {
39888 0 : return NULL;
39889 : }
39890 :
39891 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39892 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39893 : }
39894 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39895 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39896 : }
39897 :
39898 0 : return py_svcctl_CloseNotifyHandle_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39899 : }
39900 :
39901 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
39902 : {
39903 0 : const struct ndr_interface_call *call = NULL;
39904 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(py_obj);
39905 0 : struct ndr_pull *pull = NULL;
39906 0 : enum ndr_err_code err;
39907 :
39908 0 : if (ndr_table_svcctl.num_calls < 50) {
39909 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseNotifyHandle_ndr_unpack");
39910 0 : return NULL;
39911 : }
39912 0 : call = &ndr_table_svcctl.calls[49];
39913 :
39914 0 : pull = ndr_pull_init_blob(blob, object);
39915 0 : if (pull == NULL) {
39916 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39917 0 : return NULL;
39918 : }
39919 :
39920 0 : pull->flags |= ndr_pull_flags;
39921 :
39922 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39923 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39924 0 : TALLOC_FREE(pull);
39925 0 : PyErr_SetNdrError(err);
39926 0 : return NULL;
39927 : }
39928 0 : if (!allow_remaining) {
39929 0 : uint32_t highest_ofs;
39930 :
39931 0 : if (pull->offset > pull->relative_highest_offset) {
39932 0 : highest_ofs = pull->offset;
39933 : } else {
39934 0 : highest_ofs = pull->relative_highest_offset;
39935 : }
39936 0 : if (highest_ofs < pull->data_size) {
39937 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39938 : "not all bytes consumed ofs[%u] size[%u]",
39939 : highest_ofs, pull->data_size);
39940 0 : TALLOC_FREE(pull);
39941 0 : PyErr_SetNdrError(err);
39942 0 : return NULL;
39943 : }
39944 : }
39945 :
39946 0 : TALLOC_FREE(pull);
39947 0 : Py_RETURN_NONE;
39948 : }
39949 :
39950 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39951 : {
39952 0 : DATA_BLOB blob;
39953 0 : Py_ssize_t blob_length = 0;
39954 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39955 0 : PyObject *bigendian_obj = NULL;
39956 0 : PyObject *ndr64_obj = NULL;
39957 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39958 0 : PyObject *allow_remaining_obj = NULL;
39959 0 : bool allow_remaining = false;
39960 :
39961 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39962 : discard_const_p(char *, kwnames),
39963 : &blob.data, &blob_length,
39964 : &bigendian_obj,
39965 : &ndr64_obj,
39966 : &allow_remaining_obj)) {
39967 0 : return NULL;
39968 : }
39969 0 : blob.length = blob_length;
39970 :
39971 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39972 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39973 : }
39974 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39975 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39976 : }
39977 :
39978 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39979 0 : allow_remaining = true;
39980 : }
39981 :
39982 0 : return py_svcctl_CloseNotifyHandle_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39983 : }
39984 :
39985 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39986 : {
39987 0 : DATA_BLOB blob;
39988 0 : Py_ssize_t blob_length = 0;
39989 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39990 0 : PyObject *bigendian_obj = NULL;
39991 0 : PyObject *ndr64_obj = NULL;
39992 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39993 0 : PyObject *allow_remaining_obj = NULL;
39994 0 : bool allow_remaining = false;
39995 :
39996 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39997 : discard_const_p(char *, kwnames),
39998 : &blob.data, &blob_length,
39999 : &bigendian_obj,
40000 : &ndr64_obj,
40001 : &allow_remaining_obj)) {
40002 0 : return NULL;
40003 : }
40004 0 : blob.length = blob_length;
40005 :
40006 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40007 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40008 : }
40009 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40010 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40011 : }
40012 :
40013 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40014 0 : allow_remaining = true;
40015 : }
40016 :
40017 0 : return py_svcctl_CloseNotifyHandle_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40018 : }
40019 :
40020 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
40021 : {
40022 0 : const struct ndr_interface_call *call = NULL;
40023 0 : struct svcctl_CloseNotifyHandle *object = (struct svcctl_CloseNotifyHandle *)pytalloc_get_ptr(py_obj);
40024 0 : PyObject *ret;
40025 0 : char *retstr;
40026 :
40027 0 : if (ndr_table_svcctl.num_calls < 50) {
40028 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseNotifyHandle_ndr_print");
40029 0 : return NULL;
40030 : }
40031 0 : call = &ndr_table_svcctl.calls[49];
40032 :
40033 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40034 0 : ret = PyUnicode_FromString(retstr);
40035 0 : TALLOC_FREE(retstr);
40036 :
40037 0 : return ret;
40038 : }
40039 :
40040 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40041 : {
40042 0 : return py_svcctl_CloseNotifyHandle_ndr_print(py_obj, "svcctl_CloseNotifyHandle_in", NDR_IN);
40043 : }
40044 :
40045 0 : static PyObject *py_svcctl_CloseNotifyHandle_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40046 : {
40047 0 : return py_svcctl_CloseNotifyHandle_ndr_print(py_obj, "svcctl_CloseNotifyHandle_out", NDR_OUT);
40048 : }
40049 :
40050 : static PyMethodDef py_svcctl_CloseNotifyHandle_methods[] = {
40051 : { "opnum", (PyCFunction)py_svcctl_CloseNotifyHandle_ndr_opnum, METH_NOARGS|METH_CLASS,
40052 : "svcctl.CloseNotifyHandle.opnum() -> 49 (0x31) " },
40053 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseNotifyHandle_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40054 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40055 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseNotifyHandle_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40056 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40057 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseNotifyHandle_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40058 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40059 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseNotifyHandle_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40060 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40061 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CloseNotifyHandle_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40062 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CloseNotifyHandle_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40063 : { NULL, NULL, 0, NULL }
40064 : };
40065 :
40066 :
40067 : static PyTypeObject svcctl_CloseNotifyHandle_Type = {
40068 : PyVarObject_HEAD_INIT(NULL, 0)
40069 : .tp_name = "svcctl.CloseNotifyHandle",
40070 : .tp_getset = py_svcctl_CloseNotifyHandle_getsetters,
40071 : .tp_methods = py_svcctl_CloseNotifyHandle_methods,
40072 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40073 : .tp_new = py_svcctl_CloseNotifyHandle_new,
40074 : };
40075 :
40076 0 : static bool pack_py_svcctl_CloseNotifyHandle_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CloseNotifyHandle *r)
40077 : {
40078 0 : PyObject *py_phNotify;
40079 0 : const char *kwnames[] = {
40080 : "phNotify", NULL
40081 : };
40082 :
40083 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_CloseNotifyHandle", discard_const_p(char *, kwnames), &py_phNotify)) {
40084 0 : return false;
40085 : }
40086 :
40087 0 : if (py_phNotify == NULL) {
40088 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.phNotify");
40089 0 : return false;
40090 : }
40091 0 : r->in.phNotify = talloc_ptrtype(r, r->in.phNotify);
40092 0 : if (r->in.phNotify == NULL) {
40093 0 : PyErr_NoMemory();
40094 0 : return false;
40095 : }
40096 0 : PY_CHECK_TYPE(policy_handle_Type, py_phNotify, return false;);
40097 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_phNotify)) == NULL) {
40098 0 : PyErr_NoMemory();
40099 0 : return false;
40100 : }
40101 0 : r->in.phNotify = (struct policy_handle *)pytalloc_get_ptr(py_phNotify);
40102 0 : return true;
40103 : }
40104 :
40105 0 : static PyObject *unpack_py_svcctl_CloseNotifyHandle_args_out(struct svcctl_CloseNotifyHandle *r)
40106 : {
40107 0 : PyObject *result;
40108 0 : PyObject *py_phNotify;
40109 0 : PyObject *py_pfApcFired;
40110 0 : result = PyTuple_New(2);
40111 0 : py_phNotify = pytalloc_reference_ex(policy_handle_Type, r->out.phNotify, r->out.phNotify);
40112 0 : PyTuple_SetItem(result, 0, py_phNotify);
40113 0 : py_pfApcFired = PyLong_FromUnsignedLongLong((uint32_t)*r->out.pfApcFired);
40114 0 : PyTuple_SetItem(result, 1, py_pfApcFired);
40115 0 : if (!W_ERROR_IS_OK(r->out.result)) {
40116 0 : PyErr_SetWERROR(r->out.result);
40117 0 : return NULL;
40118 : }
40119 :
40120 0 : return result;
40121 : }
40122 :
40123 :
40124 0 : static PyObject *py_svcctl_ControlServiceExA_in_get_hService(PyObject *obj, void *closure)
40125 : {
40126 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(obj);
40127 0 : PyObject *py_hService;
40128 0 : py_hService = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hService);
40129 0 : return py_hService;
40130 : }
40131 :
40132 0 : static int py_svcctl_ControlServiceExA_in_set_hService(PyObject *py_obj, PyObject *value, void *closure)
40133 : {
40134 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40135 0 : if (value == NULL) {
40136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hService");
40137 0 : return -1;
40138 : }
40139 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40140 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40141 0 : PyErr_NoMemory();
40142 0 : return -1;
40143 : }
40144 0 : object->in.hService = *(struct policy_handle *)pytalloc_get_ptr(value);
40145 0 : return 0;
40146 : }
40147 :
40148 0 : static PyObject *py_svcctl_ControlServiceExA_in_get_dwControl(PyObject *obj, void *closure)
40149 : {
40150 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(obj);
40151 0 : PyObject *py_dwControl;
40152 0 : py_dwControl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwControl);
40153 0 : return py_dwControl;
40154 : }
40155 :
40156 0 : static int py_svcctl_ControlServiceExA_in_set_dwControl(PyObject *py_obj, PyObject *value, void *closure)
40157 : {
40158 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40159 0 : if (value == NULL) {
40160 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwControl");
40161 0 : return -1;
40162 : }
40163 : {
40164 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwControl));
40165 0 : if (PyLong_Check(value)) {
40166 0 : unsigned long long test_var;
40167 0 : test_var = PyLong_AsUnsignedLongLong(value);
40168 0 : if (PyErr_Occurred() != NULL) {
40169 0 : return -1;
40170 : }
40171 0 : if (test_var > uint_max) {
40172 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40173 : PyLong_Type.tp_name, uint_max, test_var);
40174 0 : return -1;
40175 : }
40176 0 : object->in.dwControl = test_var;
40177 : } else {
40178 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40179 : PyLong_Type.tp_name);
40180 0 : return -1;
40181 : }
40182 : }
40183 0 : return 0;
40184 : }
40185 :
40186 0 : static PyObject *py_svcctl_ControlServiceExA_in_get_dwInfoLevel(PyObject *obj, void *closure)
40187 : {
40188 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(obj);
40189 0 : PyObject *py_dwInfoLevel;
40190 0 : py_dwInfoLevel = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwInfoLevel);
40191 0 : return py_dwInfoLevel;
40192 : }
40193 :
40194 0 : static int py_svcctl_ControlServiceExA_in_set_dwInfoLevel(PyObject *py_obj, PyObject *value, void *closure)
40195 : {
40196 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40197 0 : if (value == NULL) {
40198 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwInfoLevel");
40199 0 : return -1;
40200 : }
40201 : {
40202 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwInfoLevel));
40203 0 : if (PyLong_Check(value)) {
40204 0 : unsigned long long test_var;
40205 0 : test_var = PyLong_AsUnsignedLongLong(value);
40206 0 : if (PyErr_Occurred() != NULL) {
40207 0 : return -1;
40208 : }
40209 0 : if (test_var > uint_max) {
40210 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40211 : PyLong_Type.tp_name, uint_max, test_var);
40212 0 : return -1;
40213 : }
40214 0 : object->in.dwInfoLevel = test_var;
40215 : } else {
40216 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40217 : PyLong_Type.tp_name);
40218 0 : return -1;
40219 : }
40220 : }
40221 0 : return 0;
40222 : }
40223 :
40224 0 : static PyObject *py_svcctl_ControlServiceExA_in_get_pControlInParams(PyObject *obj, void *closure)
40225 : {
40226 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(obj);
40227 0 : PyObject *py_pControlInParams;
40228 0 : if (object->in.pControlInParams == NULL) {
40229 0 : Py_RETURN_NONE;
40230 : }
40231 0 : py_pControlInParams = pyrpc_import_union(&SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type, object->in.pControlInParams, object->in.dwInfoLevel, object->in.pControlInParams, "union SC_RPC_SERVICE_CONTROL_IN_PARAMSA");
40232 0 : if (py_pControlInParams == NULL) {
40233 0 : return NULL;
40234 : }
40235 0 : return py_pControlInParams;
40236 : }
40237 :
40238 0 : static int py_svcctl_ControlServiceExA_in_set_pControlInParams(PyObject *py_obj, PyObject *value, void *closure)
40239 : {
40240 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40241 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.pControlInParams));
40242 0 : if (value == NULL) {
40243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.pControlInParams");
40244 0 : return -1;
40245 : }
40246 0 : object->in.pControlInParams = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pControlInParams);
40247 0 : if (object->in.pControlInParams == NULL) {
40248 0 : PyErr_NoMemory();
40249 0 : return -1;
40250 : }
40251 : {
40252 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *pControlInParams_switch_1;
40253 0 : pControlInParams_switch_1 = (union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *)pyrpc_export_union(&SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type, pytalloc_get_mem_ctx(py_obj), object->in.dwInfoLevel, value, "union SC_RPC_SERVICE_CONTROL_IN_PARAMSA");
40254 0 : if (pControlInParams_switch_1 == NULL) {
40255 0 : return -1;
40256 : }
40257 0 : object->in.pControlInParams = pControlInParams_switch_1;
40258 : }
40259 0 : return 0;
40260 : }
40261 :
40262 0 : static PyObject *py_svcctl_ControlServiceExA_out_get_pControlOutParams(PyObject *obj, void *closure)
40263 : {
40264 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(obj);
40265 0 : PyObject *py_pControlOutParams;
40266 0 : if (object->out.pControlOutParams == NULL) {
40267 0 : Py_RETURN_NONE;
40268 : }
40269 0 : py_pControlOutParams = pyrpc_import_union(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type, object->out.pControlOutParams, object->in.dwInfoLevel, object->out.pControlOutParams, "union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA");
40270 0 : if (py_pControlOutParams == NULL) {
40271 0 : return NULL;
40272 : }
40273 0 : return py_pControlOutParams;
40274 : }
40275 :
40276 0 : static int py_svcctl_ControlServiceExA_out_set_pControlOutParams(PyObject *py_obj, PyObject *value, void *closure)
40277 : {
40278 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40279 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pControlOutParams));
40280 0 : if (value == NULL) {
40281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pControlOutParams");
40282 0 : return -1;
40283 : }
40284 0 : object->out.pControlOutParams = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pControlOutParams);
40285 0 : if (object->out.pControlOutParams == NULL) {
40286 0 : PyErr_NoMemory();
40287 0 : return -1;
40288 : }
40289 : {
40290 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *pControlOutParams_switch_1;
40291 0 : pControlOutParams_switch_1 = (union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA *)pyrpc_export_union(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type, pytalloc_get_mem_ctx(py_obj), object->in.dwInfoLevel, value, "union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA");
40292 0 : if (pControlOutParams_switch_1 == NULL) {
40293 0 : return -1;
40294 : }
40295 0 : object->out.pControlOutParams = pControlOutParams_switch_1;
40296 : }
40297 0 : return 0;
40298 : }
40299 :
40300 0 : static PyObject *py_svcctl_ControlServiceExA_get_result(PyObject *obj, void *closure)
40301 : {
40302 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(obj);
40303 0 : PyObject *py_result;
40304 0 : py_result = PyErr_FromWERROR(object->out.result);
40305 0 : return py_result;
40306 : }
40307 :
40308 0 : static int py_svcctl_ControlServiceExA_set_result(PyObject *py_obj, PyObject *value, void *closure)
40309 : {
40310 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40311 0 : if (value == NULL) {
40312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40313 0 : return -1;
40314 : }
40315 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
40316 0 : return 0;
40317 : }
40318 :
40319 : static PyGetSetDef py_svcctl_ControlServiceExA_getsetters[] = {
40320 : {
40321 : .name = discard_const_p(char, "in_hService"),
40322 : .get = py_svcctl_ControlServiceExA_in_get_hService,
40323 : .set = py_svcctl_ControlServiceExA_in_set_hService,
40324 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40325 : },
40326 : {
40327 : .name = discard_const_p(char, "in_dwControl"),
40328 : .get = py_svcctl_ControlServiceExA_in_get_dwControl,
40329 : .set = py_svcctl_ControlServiceExA_in_set_dwControl,
40330 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_CONTROL")
40331 : },
40332 : {
40333 : .name = discard_const_p(char, "in_dwInfoLevel"),
40334 : .get = py_svcctl_ControlServiceExA_in_get_dwInfoLevel,
40335 : .set = py_svcctl_ControlServiceExA_in_set_dwInfoLevel,
40336 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40337 : },
40338 : {
40339 : .name = discard_const_p(char, "in_pControlInParams"),
40340 : .get = py_svcctl_ControlServiceExA_in_get_pControlInParams,
40341 : .set = py_svcctl_ControlServiceExA_in_set_pControlInParams,
40342 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_SERVICE_CONTROL_IN_PARAMSA")
40343 : },
40344 : {
40345 : .name = discard_const_p(char, "out_pControlOutParams"),
40346 : .get = py_svcctl_ControlServiceExA_out_get_pControlOutParams,
40347 : .set = py_svcctl_ControlServiceExA_out_set_pControlOutParams,
40348 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_SERVICE_CONTROL_OUT_PARAMSA")
40349 : },
40350 : {
40351 : .name = discard_const_p(char, "result"),
40352 : .get = py_svcctl_ControlServiceExA_get_result,
40353 : .set = py_svcctl_ControlServiceExA_set_result,
40354 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
40355 : },
40356 : { .name = NULL }
40357 : };
40358 :
40359 0 : static PyObject *py_svcctl_ControlServiceExA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40360 : {
40361 0 : PyObject *self = pytalloc_new(struct svcctl_ControlServiceExA, type);
40362 0 : struct svcctl_ControlServiceExA *_self = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(self);
40363 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40364 0 : _self->in.pControlInParams = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_IN_PARAMSA);
40365 0 : _self->out.pControlOutParams = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA);
40366 0 : return self;
40367 : }
40368 :
40369 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40370 : {
40371 :
40372 :
40373 0 : return PyLong_FromLong(50);
40374 : }
40375 :
40376 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
40377 : {
40378 0 : const struct ndr_interface_call *call = NULL;
40379 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40380 0 : PyObject *ret = NULL;
40381 0 : struct ndr_push *push = NULL;
40382 0 : DATA_BLOB blob;
40383 0 : enum ndr_err_code err;
40384 :
40385 0 : if (ndr_table_svcctl.num_calls < 51) {
40386 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlServiceExA_ndr_pack");
40387 0 : return NULL;
40388 : }
40389 0 : call = &ndr_table_svcctl.calls[50];
40390 :
40391 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40392 0 : if (push == NULL) {
40393 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40394 0 : return NULL;
40395 : }
40396 :
40397 0 : push->flags |= ndr_push_flags;
40398 :
40399 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40400 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40401 0 : TALLOC_FREE(push);
40402 0 : PyErr_SetNdrError(err);
40403 0 : return NULL;
40404 : }
40405 0 : blob = ndr_push_blob(push);
40406 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40407 0 : TALLOC_FREE(push);
40408 0 : return ret;
40409 : }
40410 :
40411 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40412 : {
40413 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40414 0 : PyObject *bigendian_obj = NULL;
40415 0 : PyObject *ndr64_obj = NULL;
40416 0 : libndr_flags ndr_push_flags = 0;
40417 :
40418 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40419 : discard_const_p(char *, kwnames),
40420 : &bigendian_obj,
40421 : &ndr64_obj)) {
40422 0 : return NULL;
40423 : }
40424 :
40425 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40426 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40427 : }
40428 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40429 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40430 : }
40431 :
40432 0 : return py_svcctl_ControlServiceExA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40433 : }
40434 :
40435 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40436 : {
40437 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40438 0 : PyObject *bigendian_obj = NULL;
40439 0 : PyObject *ndr64_obj = NULL;
40440 0 : libndr_flags ndr_push_flags = 0;
40441 :
40442 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40443 : discard_const_p(char *, kwnames),
40444 : &bigendian_obj,
40445 : &ndr64_obj)) {
40446 0 : return NULL;
40447 : }
40448 :
40449 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40450 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40451 : }
40452 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40453 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40454 : }
40455 :
40456 0 : return py_svcctl_ControlServiceExA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
40457 : }
40458 :
40459 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
40460 : {
40461 0 : const struct ndr_interface_call *call = NULL;
40462 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40463 0 : struct ndr_pull *pull = NULL;
40464 0 : enum ndr_err_code err;
40465 :
40466 0 : if (ndr_table_svcctl.num_calls < 51) {
40467 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlServiceExA_ndr_unpack");
40468 0 : return NULL;
40469 : }
40470 0 : call = &ndr_table_svcctl.calls[50];
40471 :
40472 0 : pull = ndr_pull_init_blob(blob, object);
40473 0 : if (pull == NULL) {
40474 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40475 0 : return NULL;
40476 : }
40477 :
40478 0 : pull->flags |= ndr_pull_flags;
40479 :
40480 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
40481 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40482 0 : TALLOC_FREE(pull);
40483 0 : PyErr_SetNdrError(err);
40484 0 : return NULL;
40485 : }
40486 0 : if (!allow_remaining) {
40487 0 : uint32_t highest_ofs;
40488 :
40489 0 : if (pull->offset > pull->relative_highest_offset) {
40490 0 : highest_ofs = pull->offset;
40491 : } else {
40492 0 : highest_ofs = pull->relative_highest_offset;
40493 : }
40494 0 : if (highest_ofs < pull->data_size) {
40495 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
40496 : "not all bytes consumed ofs[%u] size[%u]",
40497 : highest_ofs, pull->data_size);
40498 0 : TALLOC_FREE(pull);
40499 0 : PyErr_SetNdrError(err);
40500 0 : return NULL;
40501 : }
40502 : }
40503 :
40504 0 : TALLOC_FREE(pull);
40505 0 : Py_RETURN_NONE;
40506 : }
40507 :
40508 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40509 : {
40510 0 : DATA_BLOB blob;
40511 0 : Py_ssize_t blob_length = 0;
40512 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40513 0 : PyObject *bigendian_obj = NULL;
40514 0 : PyObject *ndr64_obj = NULL;
40515 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40516 0 : PyObject *allow_remaining_obj = NULL;
40517 0 : bool allow_remaining = false;
40518 :
40519 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
40520 : discard_const_p(char *, kwnames),
40521 : &blob.data, &blob_length,
40522 : &bigendian_obj,
40523 : &ndr64_obj,
40524 : &allow_remaining_obj)) {
40525 0 : return NULL;
40526 : }
40527 0 : blob.length = blob_length;
40528 :
40529 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40530 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40531 : }
40532 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40533 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40534 : }
40535 :
40536 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40537 0 : allow_remaining = true;
40538 : }
40539 :
40540 0 : return py_svcctl_ControlServiceExA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
40541 : }
40542 :
40543 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40544 : {
40545 0 : DATA_BLOB blob;
40546 0 : Py_ssize_t blob_length = 0;
40547 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40548 0 : PyObject *bigendian_obj = NULL;
40549 0 : PyObject *ndr64_obj = NULL;
40550 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40551 0 : PyObject *allow_remaining_obj = NULL;
40552 0 : bool allow_remaining = false;
40553 :
40554 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
40555 : discard_const_p(char *, kwnames),
40556 : &blob.data, &blob_length,
40557 : &bigendian_obj,
40558 : &ndr64_obj,
40559 : &allow_remaining_obj)) {
40560 0 : return NULL;
40561 : }
40562 0 : blob.length = blob_length;
40563 :
40564 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40565 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40566 : }
40567 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40568 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40569 : }
40570 :
40571 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40572 0 : allow_remaining = true;
40573 : }
40574 :
40575 0 : return py_svcctl_ControlServiceExA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40576 : }
40577 :
40578 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
40579 : {
40580 0 : const struct ndr_interface_call *call = NULL;
40581 0 : struct svcctl_ControlServiceExA *object = (struct svcctl_ControlServiceExA *)pytalloc_get_ptr(py_obj);
40582 0 : PyObject *ret;
40583 0 : char *retstr;
40584 :
40585 0 : if (ndr_table_svcctl.num_calls < 51) {
40586 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlServiceExA_ndr_print");
40587 0 : return NULL;
40588 : }
40589 0 : call = &ndr_table_svcctl.calls[50];
40590 :
40591 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40592 0 : ret = PyUnicode_FromString(retstr);
40593 0 : TALLOC_FREE(retstr);
40594 :
40595 0 : return ret;
40596 : }
40597 :
40598 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40599 : {
40600 0 : return py_svcctl_ControlServiceExA_ndr_print(py_obj, "svcctl_ControlServiceExA_in", NDR_IN);
40601 : }
40602 :
40603 0 : static PyObject *py_svcctl_ControlServiceExA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40604 : {
40605 0 : return py_svcctl_ControlServiceExA_ndr_print(py_obj, "svcctl_ControlServiceExA_out", NDR_OUT);
40606 : }
40607 :
40608 : static PyMethodDef py_svcctl_ControlServiceExA_methods[] = {
40609 : { "opnum", (PyCFunction)py_svcctl_ControlServiceExA_ndr_opnum, METH_NOARGS|METH_CLASS,
40610 : "svcctl.ControlServiceExA.opnum() -> 50 (0x32) " },
40611 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40612 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40613 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40614 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40615 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40616 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40617 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40618 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40619 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ControlServiceExA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40620 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ControlServiceExA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40621 : { NULL, NULL, 0, NULL }
40622 : };
40623 :
40624 :
40625 : static PyTypeObject svcctl_ControlServiceExA_Type = {
40626 : PyVarObject_HEAD_INIT(NULL, 0)
40627 : .tp_name = "svcctl.ControlServiceExA",
40628 : .tp_getset = py_svcctl_ControlServiceExA_getsetters,
40629 : .tp_methods = py_svcctl_ControlServiceExA_methods,
40630 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40631 : .tp_new = py_svcctl_ControlServiceExA_new,
40632 : };
40633 :
40634 0 : static bool pack_py_svcctl_ControlServiceExA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ControlServiceExA *r)
40635 : {
40636 0 : PyObject *py_hService;
40637 0 : PyObject *py_dwControl;
40638 0 : PyObject *py_dwInfoLevel;
40639 0 : PyObject *py_pControlInParams;
40640 0 : const char *kwnames[] = {
40641 : "hService", "dwControl", "dwInfoLevel", "pControlInParams", NULL
40642 : };
40643 :
40644 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:svcctl_ControlServiceExA", discard_const_p(char *, kwnames), &py_hService, &py_dwControl, &py_dwInfoLevel, &py_pControlInParams)) {
40645 0 : return false;
40646 : }
40647 :
40648 0 : if (py_hService == NULL) {
40649 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hService");
40650 0 : return false;
40651 : }
40652 0 : PY_CHECK_TYPE(policy_handle_Type, py_hService, return false;);
40653 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hService)) == NULL) {
40654 0 : PyErr_NoMemory();
40655 0 : return false;
40656 : }
40657 0 : r->in.hService = *(struct policy_handle *)pytalloc_get_ptr(py_hService);
40658 0 : if (py_dwControl == NULL) {
40659 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwControl");
40660 0 : return false;
40661 : }
40662 : {
40663 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwControl));
40664 0 : if (PyLong_Check(py_dwControl)) {
40665 0 : unsigned long long test_var;
40666 0 : test_var = PyLong_AsUnsignedLongLong(py_dwControl);
40667 0 : if (PyErr_Occurred() != NULL) {
40668 0 : return false;
40669 : }
40670 0 : if (test_var > uint_max) {
40671 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40672 : PyLong_Type.tp_name, uint_max, test_var);
40673 0 : return false;
40674 : }
40675 0 : r->in.dwControl = test_var;
40676 : } else {
40677 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40678 : PyLong_Type.tp_name);
40679 0 : return false;
40680 : }
40681 : }
40682 0 : if (py_dwInfoLevel == NULL) {
40683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwInfoLevel");
40684 0 : return false;
40685 : }
40686 : {
40687 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwInfoLevel));
40688 0 : if (PyLong_Check(py_dwInfoLevel)) {
40689 0 : unsigned long long test_var;
40690 0 : test_var = PyLong_AsUnsignedLongLong(py_dwInfoLevel);
40691 0 : if (PyErr_Occurred() != NULL) {
40692 0 : return false;
40693 : }
40694 0 : if (test_var > uint_max) {
40695 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40696 : PyLong_Type.tp_name, uint_max, test_var);
40697 0 : return false;
40698 : }
40699 0 : r->in.dwInfoLevel = test_var;
40700 : } else {
40701 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40702 : PyLong_Type.tp_name);
40703 0 : return false;
40704 : }
40705 : }
40706 0 : if (py_pControlInParams == NULL) {
40707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.pControlInParams");
40708 0 : return false;
40709 : }
40710 0 : r->in.pControlInParams = talloc_ptrtype(r, r->in.pControlInParams);
40711 0 : if (r->in.pControlInParams == NULL) {
40712 0 : PyErr_NoMemory();
40713 0 : return false;
40714 : }
40715 : {
40716 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *pControlInParams_switch_1;
40717 0 : pControlInParams_switch_1 = (union SC_RPC_SERVICE_CONTROL_IN_PARAMSA *)pyrpc_export_union(&SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type, r, r->in.dwInfoLevel, py_pControlInParams, "union SC_RPC_SERVICE_CONTROL_IN_PARAMSA");
40718 0 : if (pControlInParams_switch_1 == NULL) {
40719 0 : return false;
40720 : }
40721 0 : r->in.pControlInParams = pControlInParams_switch_1;
40722 : }
40723 0 : return true;
40724 : }
40725 :
40726 0 : static PyObject *unpack_py_svcctl_ControlServiceExA_args_out(struct svcctl_ControlServiceExA *r)
40727 : {
40728 0 : PyObject *result;
40729 0 : PyObject *py_pControlOutParams;
40730 0 : py_pControlOutParams = pyrpc_import_union(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type, r->out.pControlOutParams, r->in.dwInfoLevel, r->out.pControlOutParams, "union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA");
40731 0 : if (py_pControlOutParams == NULL) {
40732 0 : return NULL;
40733 : }
40734 0 : result = py_pControlOutParams;
40735 0 : if (!W_ERROR_IS_OK(r->out.result)) {
40736 0 : PyErr_SetWERROR(r->out.result);
40737 0 : return NULL;
40738 : }
40739 :
40740 0 : return result;
40741 : }
40742 :
40743 :
40744 0 : static PyObject *py_svcctl_ControlServiceExW_in_get_hService(PyObject *obj, void *closure)
40745 : {
40746 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(obj);
40747 0 : PyObject *py_hService;
40748 0 : py_hService = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hService);
40749 0 : return py_hService;
40750 : }
40751 :
40752 0 : static int py_svcctl_ControlServiceExW_in_set_hService(PyObject *py_obj, PyObject *value, void *closure)
40753 : {
40754 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
40755 0 : if (value == NULL) {
40756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hService");
40757 0 : return -1;
40758 : }
40759 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40760 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40761 0 : PyErr_NoMemory();
40762 0 : return -1;
40763 : }
40764 0 : object->in.hService = *(struct policy_handle *)pytalloc_get_ptr(value);
40765 0 : return 0;
40766 : }
40767 :
40768 0 : static PyObject *py_svcctl_ControlServiceExW_in_get_dwControl(PyObject *obj, void *closure)
40769 : {
40770 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(obj);
40771 0 : PyObject *py_dwControl;
40772 0 : py_dwControl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwControl);
40773 0 : return py_dwControl;
40774 : }
40775 :
40776 0 : static int py_svcctl_ControlServiceExW_in_set_dwControl(PyObject *py_obj, PyObject *value, void *closure)
40777 : {
40778 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
40779 0 : if (value == NULL) {
40780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwControl");
40781 0 : return -1;
40782 : }
40783 : {
40784 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwControl));
40785 0 : if (PyLong_Check(value)) {
40786 0 : unsigned long long test_var;
40787 0 : test_var = PyLong_AsUnsignedLongLong(value);
40788 0 : if (PyErr_Occurred() != NULL) {
40789 0 : return -1;
40790 : }
40791 0 : if (test_var > uint_max) {
40792 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40793 : PyLong_Type.tp_name, uint_max, test_var);
40794 0 : return -1;
40795 : }
40796 0 : object->in.dwControl = test_var;
40797 : } else {
40798 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40799 : PyLong_Type.tp_name);
40800 0 : return -1;
40801 : }
40802 : }
40803 0 : return 0;
40804 : }
40805 :
40806 0 : static PyObject *py_svcctl_ControlServiceExW_in_get_dwInfoLevel(PyObject *obj, void *closure)
40807 : {
40808 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(obj);
40809 0 : PyObject *py_dwInfoLevel;
40810 0 : py_dwInfoLevel = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwInfoLevel);
40811 0 : return py_dwInfoLevel;
40812 : }
40813 :
40814 0 : static int py_svcctl_ControlServiceExW_in_set_dwInfoLevel(PyObject *py_obj, PyObject *value, void *closure)
40815 : {
40816 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
40817 0 : if (value == NULL) {
40818 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwInfoLevel");
40819 0 : return -1;
40820 : }
40821 : {
40822 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwInfoLevel));
40823 0 : if (PyLong_Check(value)) {
40824 0 : unsigned long long test_var;
40825 0 : test_var = PyLong_AsUnsignedLongLong(value);
40826 0 : if (PyErr_Occurred() != NULL) {
40827 0 : return -1;
40828 : }
40829 0 : if (test_var > uint_max) {
40830 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40831 : PyLong_Type.tp_name, uint_max, test_var);
40832 0 : return -1;
40833 : }
40834 0 : object->in.dwInfoLevel = test_var;
40835 : } else {
40836 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40837 : PyLong_Type.tp_name);
40838 0 : return -1;
40839 : }
40840 : }
40841 0 : return 0;
40842 : }
40843 :
40844 0 : static PyObject *py_svcctl_ControlServiceExW_in_get_pControlInParams(PyObject *obj, void *closure)
40845 : {
40846 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(obj);
40847 0 : PyObject *py_pControlInParams;
40848 0 : if (object->in.pControlInParams == NULL) {
40849 0 : Py_RETURN_NONE;
40850 : }
40851 0 : py_pControlInParams = pyrpc_import_union(&SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type, object->in.pControlInParams, object->in.dwInfoLevel, object->in.pControlInParams, "union SC_RPC_SERVICE_CONTROL_IN_PARAMSW");
40852 0 : if (py_pControlInParams == NULL) {
40853 0 : return NULL;
40854 : }
40855 0 : return py_pControlInParams;
40856 : }
40857 :
40858 0 : static int py_svcctl_ControlServiceExW_in_set_pControlInParams(PyObject *py_obj, PyObject *value, void *closure)
40859 : {
40860 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
40861 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.pControlInParams));
40862 0 : if (value == NULL) {
40863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.pControlInParams");
40864 0 : return -1;
40865 : }
40866 0 : object->in.pControlInParams = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pControlInParams);
40867 0 : if (object->in.pControlInParams == NULL) {
40868 0 : PyErr_NoMemory();
40869 0 : return -1;
40870 : }
40871 : {
40872 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *pControlInParams_switch_1;
40873 0 : pControlInParams_switch_1 = (union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *)pyrpc_export_union(&SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type, pytalloc_get_mem_ctx(py_obj), object->in.dwInfoLevel, value, "union SC_RPC_SERVICE_CONTROL_IN_PARAMSW");
40874 0 : if (pControlInParams_switch_1 == NULL) {
40875 0 : return -1;
40876 : }
40877 0 : object->in.pControlInParams = pControlInParams_switch_1;
40878 : }
40879 0 : return 0;
40880 : }
40881 :
40882 0 : static PyObject *py_svcctl_ControlServiceExW_out_get_pControlOutParams(PyObject *obj, void *closure)
40883 : {
40884 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(obj);
40885 0 : PyObject *py_pControlOutParams;
40886 0 : if (object->out.pControlOutParams == NULL) {
40887 0 : Py_RETURN_NONE;
40888 : }
40889 0 : py_pControlOutParams = pyrpc_import_union(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type, object->out.pControlOutParams, object->in.dwInfoLevel, object->out.pControlOutParams, "union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW");
40890 0 : if (py_pControlOutParams == NULL) {
40891 0 : return NULL;
40892 : }
40893 0 : return py_pControlOutParams;
40894 : }
40895 :
40896 0 : static int py_svcctl_ControlServiceExW_out_set_pControlOutParams(PyObject *py_obj, PyObject *value, void *closure)
40897 : {
40898 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
40899 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pControlOutParams));
40900 0 : if (value == NULL) {
40901 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pControlOutParams");
40902 0 : return -1;
40903 : }
40904 0 : object->out.pControlOutParams = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pControlOutParams);
40905 0 : if (object->out.pControlOutParams == NULL) {
40906 0 : PyErr_NoMemory();
40907 0 : return -1;
40908 : }
40909 : {
40910 0 : union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *pControlOutParams_switch_1;
40911 0 : pControlOutParams_switch_1 = (union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW *)pyrpc_export_union(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type, pytalloc_get_mem_ctx(py_obj), object->in.dwInfoLevel, value, "union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW");
40912 0 : if (pControlOutParams_switch_1 == NULL) {
40913 0 : return -1;
40914 : }
40915 0 : object->out.pControlOutParams = pControlOutParams_switch_1;
40916 : }
40917 0 : return 0;
40918 : }
40919 :
40920 0 : static PyObject *py_svcctl_ControlServiceExW_get_result(PyObject *obj, void *closure)
40921 : {
40922 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(obj);
40923 0 : PyObject *py_result;
40924 0 : py_result = PyErr_FromWERROR(object->out.result);
40925 0 : return py_result;
40926 : }
40927 :
40928 0 : static int py_svcctl_ControlServiceExW_set_result(PyObject *py_obj, PyObject *value, void *closure)
40929 : {
40930 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
40931 0 : if (value == NULL) {
40932 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40933 0 : return -1;
40934 : }
40935 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
40936 0 : return 0;
40937 : }
40938 :
40939 : static PyGetSetDef py_svcctl_ControlServiceExW_getsetters[] = {
40940 : {
40941 : .name = discard_const_p(char, "in_hService"),
40942 : .get = py_svcctl_ControlServiceExW_in_get_hService,
40943 : .set = py_svcctl_ControlServiceExW_in_set_hService,
40944 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40945 : },
40946 : {
40947 : .name = discard_const_p(char, "in_dwControl"),
40948 : .get = py_svcctl_ControlServiceExW_in_get_dwControl,
40949 : .set = py_svcctl_ControlServiceExW_in_set_dwControl,
40950 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_CONTROL")
40951 : },
40952 : {
40953 : .name = discard_const_p(char, "in_dwInfoLevel"),
40954 : .get = py_svcctl_ControlServiceExW_in_get_dwInfoLevel,
40955 : .set = py_svcctl_ControlServiceExW_in_set_dwInfoLevel,
40956 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40957 : },
40958 : {
40959 : .name = discard_const_p(char, "in_pControlInParams"),
40960 : .get = py_svcctl_ControlServiceExW_in_get_pControlInParams,
40961 : .set = py_svcctl_ControlServiceExW_in_set_pControlInParams,
40962 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_SERVICE_CONTROL_IN_PARAMSW")
40963 : },
40964 : {
40965 : .name = discard_const_p(char, "out_pControlOutParams"),
40966 : .get = py_svcctl_ControlServiceExW_out_get_pControlOutParams,
40967 : .set = py_svcctl_ControlServiceExW_out_set_pControlOutParams,
40968 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_SERVICE_CONTROL_OUT_PARAMSW")
40969 : },
40970 : {
40971 : .name = discard_const_p(char, "result"),
40972 : .get = py_svcctl_ControlServiceExW_get_result,
40973 : .set = py_svcctl_ControlServiceExW_set_result,
40974 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
40975 : },
40976 : { .name = NULL }
40977 : };
40978 :
40979 0 : static PyObject *py_svcctl_ControlServiceExW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40980 : {
40981 0 : PyObject *self = pytalloc_new(struct svcctl_ControlServiceExW, type);
40982 0 : struct svcctl_ControlServiceExW *_self = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(self);
40983 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40984 0 : _self->in.pControlInParams = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_IN_PARAMSW);
40985 0 : _self->out.pControlOutParams = talloc_zero(mem_ctx, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW);
40986 0 : return self;
40987 : }
40988 :
40989 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40990 : {
40991 :
40992 :
40993 0 : return PyLong_FromLong(51);
40994 : }
40995 :
40996 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
40997 : {
40998 0 : const struct ndr_interface_call *call = NULL;
40999 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
41000 0 : PyObject *ret = NULL;
41001 0 : struct ndr_push *push = NULL;
41002 0 : DATA_BLOB blob;
41003 0 : enum ndr_err_code err;
41004 :
41005 0 : if (ndr_table_svcctl.num_calls < 52) {
41006 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlServiceExW_ndr_pack");
41007 0 : return NULL;
41008 : }
41009 0 : call = &ndr_table_svcctl.calls[51];
41010 :
41011 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41012 0 : if (push == NULL) {
41013 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41014 0 : return NULL;
41015 : }
41016 :
41017 0 : push->flags |= ndr_push_flags;
41018 :
41019 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41020 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41021 0 : TALLOC_FREE(push);
41022 0 : PyErr_SetNdrError(err);
41023 0 : return NULL;
41024 : }
41025 0 : blob = ndr_push_blob(push);
41026 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41027 0 : TALLOC_FREE(push);
41028 0 : return ret;
41029 : }
41030 :
41031 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41032 : {
41033 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41034 0 : PyObject *bigendian_obj = NULL;
41035 0 : PyObject *ndr64_obj = NULL;
41036 0 : libndr_flags ndr_push_flags = 0;
41037 :
41038 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41039 : discard_const_p(char *, kwnames),
41040 : &bigendian_obj,
41041 : &ndr64_obj)) {
41042 0 : return NULL;
41043 : }
41044 :
41045 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41046 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41047 : }
41048 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41049 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41050 : }
41051 :
41052 0 : return py_svcctl_ControlServiceExW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41053 : }
41054 :
41055 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41056 : {
41057 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41058 0 : PyObject *bigendian_obj = NULL;
41059 0 : PyObject *ndr64_obj = NULL;
41060 0 : libndr_flags ndr_push_flags = 0;
41061 :
41062 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41063 : discard_const_p(char *, kwnames),
41064 : &bigendian_obj,
41065 : &ndr64_obj)) {
41066 0 : return NULL;
41067 : }
41068 :
41069 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41070 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41071 : }
41072 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41073 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41074 : }
41075 :
41076 0 : return py_svcctl_ControlServiceExW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41077 : }
41078 :
41079 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
41080 : {
41081 0 : const struct ndr_interface_call *call = NULL;
41082 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
41083 0 : struct ndr_pull *pull = NULL;
41084 0 : enum ndr_err_code err;
41085 :
41086 0 : if (ndr_table_svcctl.num_calls < 52) {
41087 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlServiceExW_ndr_unpack");
41088 0 : return NULL;
41089 : }
41090 0 : call = &ndr_table_svcctl.calls[51];
41091 :
41092 0 : pull = ndr_pull_init_blob(blob, object);
41093 0 : if (pull == NULL) {
41094 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41095 0 : return NULL;
41096 : }
41097 :
41098 0 : pull->flags |= ndr_pull_flags;
41099 :
41100 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41101 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41102 0 : TALLOC_FREE(pull);
41103 0 : PyErr_SetNdrError(err);
41104 0 : return NULL;
41105 : }
41106 0 : if (!allow_remaining) {
41107 0 : uint32_t highest_ofs;
41108 :
41109 0 : if (pull->offset > pull->relative_highest_offset) {
41110 0 : highest_ofs = pull->offset;
41111 : } else {
41112 0 : highest_ofs = pull->relative_highest_offset;
41113 : }
41114 0 : if (highest_ofs < pull->data_size) {
41115 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41116 : "not all bytes consumed ofs[%u] size[%u]",
41117 : highest_ofs, pull->data_size);
41118 0 : TALLOC_FREE(pull);
41119 0 : PyErr_SetNdrError(err);
41120 0 : return NULL;
41121 : }
41122 : }
41123 :
41124 0 : TALLOC_FREE(pull);
41125 0 : Py_RETURN_NONE;
41126 : }
41127 :
41128 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41129 : {
41130 0 : DATA_BLOB blob;
41131 0 : Py_ssize_t blob_length = 0;
41132 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41133 0 : PyObject *bigendian_obj = NULL;
41134 0 : PyObject *ndr64_obj = NULL;
41135 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41136 0 : PyObject *allow_remaining_obj = NULL;
41137 0 : bool allow_remaining = false;
41138 :
41139 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41140 : discard_const_p(char *, kwnames),
41141 : &blob.data, &blob_length,
41142 : &bigendian_obj,
41143 : &ndr64_obj,
41144 : &allow_remaining_obj)) {
41145 0 : return NULL;
41146 : }
41147 0 : blob.length = blob_length;
41148 :
41149 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41150 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41151 : }
41152 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41153 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41154 : }
41155 :
41156 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41157 0 : allow_remaining = true;
41158 : }
41159 :
41160 0 : return py_svcctl_ControlServiceExW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41161 : }
41162 :
41163 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41164 : {
41165 0 : DATA_BLOB blob;
41166 0 : Py_ssize_t blob_length = 0;
41167 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41168 0 : PyObject *bigendian_obj = NULL;
41169 0 : PyObject *ndr64_obj = NULL;
41170 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41171 0 : PyObject *allow_remaining_obj = NULL;
41172 0 : bool allow_remaining = false;
41173 :
41174 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41175 : discard_const_p(char *, kwnames),
41176 : &blob.data, &blob_length,
41177 : &bigendian_obj,
41178 : &ndr64_obj,
41179 : &allow_remaining_obj)) {
41180 0 : return NULL;
41181 : }
41182 0 : blob.length = blob_length;
41183 :
41184 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41185 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41186 : }
41187 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41188 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41189 : }
41190 :
41191 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41192 0 : allow_remaining = true;
41193 : }
41194 :
41195 0 : return py_svcctl_ControlServiceExW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41196 : }
41197 :
41198 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41199 : {
41200 0 : const struct ndr_interface_call *call = NULL;
41201 0 : struct svcctl_ControlServiceExW *object = (struct svcctl_ControlServiceExW *)pytalloc_get_ptr(py_obj);
41202 0 : PyObject *ret;
41203 0 : char *retstr;
41204 :
41205 0 : if (ndr_table_svcctl.num_calls < 52) {
41206 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlServiceExW_ndr_print");
41207 0 : return NULL;
41208 : }
41209 0 : call = &ndr_table_svcctl.calls[51];
41210 :
41211 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41212 0 : ret = PyUnicode_FromString(retstr);
41213 0 : TALLOC_FREE(retstr);
41214 :
41215 0 : return ret;
41216 : }
41217 :
41218 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41219 : {
41220 0 : return py_svcctl_ControlServiceExW_ndr_print(py_obj, "svcctl_ControlServiceExW_in", NDR_IN);
41221 : }
41222 :
41223 0 : static PyObject *py_svcctl_ControlServiceExW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41224 : {
41225 0 : return py_svcctl_ControlServiceExW_ndr_print(py_obj, "svcctl_ControlServiceExW_out", NDR_OUT);
41226 : }
41227 :
41228 : static PyMethodDef py_svcctl_ControlServiceExW_methods[] = {
41229 : { "opnum", (PyCFunction)py_svcctl_ControlServiceExW_ndr_opnum, METH_NOARGS|METH_CLASS,
41230 : "svcctl.ControlServiceExW.opnum() -> 51 (0x33) " },
41231 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41232 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41233 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41234 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41235 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41236 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41237 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlServiceExW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41238 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41239 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ControlServiceExW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41240 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ControlServiceExW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41241 : { NULL, NULL, 0, NULL }
41242 : };
41243 :
41244 :
41245 : static PyTypeObject svcctl_ControlServiceExW_Type = {
41246 : PyVarObject_HEAD_INIT(NULL, 0)
41247 : .tp_name = "svcctl.ControlServiceExW",
41248 : .tp_getset = py_svcctl_ControlServiceExW_getsetters,
41249 : .tp_methods = py_svcctl_ControlServiceExW_methods,
41250 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41251 : .tp_new = py_svcctl_ControlServiceExW_new,
41252 : };
41253 :
41254 0 : static bool pack_py_svcctl_ControlServiceExW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ControlServiceExW *r)
41255 : {
41256 0 : PyObject *py_hService;
41257 0 : PyObject *py_dwControl;
41258 0 : PyObject *py_dwInfoLevel;
41259 0 : PyObject *py_pControlInParams;
41260 0 : const char *kwnames[] = {
41261 : "hService", "dwControl", "dwInfoLevel", "pControlInParams", NULL
41262 : };
41263 :
41264 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:svcctl_ControlServiceExW", discard_const_p(char *, kwnames), &py_hService, &py_dwControl, &py_dwInfoLevel, &py_pControlInParams)) {
41265 0 : return false;
41266 : }
41267 :
41268 0 : if (py_hService == NULL) {
41269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hService");
41270 0 : return false;
41271 : }
41272 0 : PY_CHECK_TYPE(policy_handle_Type, py_hService, return false;);
41273 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hService)) == NULL) {
41274 0 : PyErr_NoMemory();
41275 0 : return false;
41276 : }
41277 0 : r->in.hService = *(struct policy_handle *)pytalloc_get_ptr(py_hService);
41278 0 : if (py_dwControl == NULL) {
41279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwControl");
41280 0 : return false;
41281 : }
41282 : {
41283 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwControl));
41284 0 : if (PyLong_Check(py_dwControl)) {
41285 0 : unsigned long long test_var;
41286 0 : test_var = PyLong_AsUnsignedLongLong(py_dwControl);
41287 0 : if (PyErr_Occurred() != NULL) {
41288 0 : return false;
41289 : }
41290 0 : if (test_var > uint_max) {
41291 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41292 : PyLong_Type.tp_name, uint_max, test_var);
41293 0 : return false;
41294 : }
41295 0 : r->in.dwControl = test_var;
41296 : } else {
41297 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41298 : PyLong_Type.tp_name);
41299 0 : return false;
41300 : }
41301 : }
41302 0 : if (py_dwInfoLevel == NULL) {
41303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwInfoLevel");
41304 0 : return false;
41305 : }
41306 : {
41307 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwInfoLevel));
41308 0 : if (PyLong_Check(py_dwInfoLevel)) {
41309 0 : unsigned long long test_var;
41310 0 : test_var = PyLong_AsUnsignedLongLong(py_dwInfoLevel);
41311 0 : if (PyErr_Occurred() != NULL) {
41312 0 : return false;
41313 : }
41314 0 : if (test_var > uint_max) {
41315 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41316 : PyLong_Type.tp_name, uint_max, test_var);
41317 0 : return false;
41318 : }
41319 0 : r->in.dwInfoLevel = test_var;
41320 : } else {
41321 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41322 : PyLong_Type.tp_name);
41323 0 : return false;
41324 : }
41325 : }
41326 0 : if (py_pControlInParams == NULL) {
41327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.pControlInParams");
41328 0 : return false;
41329 : }
41330 0 : r->in.pControlInParams = talloc_ptrtype(r, r->in.pControlInParams);
41331 0 : if (r->in.pControlInParams == NULL) {
41332 0 : PyErr_NoMemory();
41333 0 : return false;
41334 : }
41335 : {
41336 0 : union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *pControlInParams_switch_1;
41337 0 : pControlInParams_switch_1 = (union SC_RPC_SERVICE_CONTROL_IN_PARAMSW *)pyrpc_export_union(&SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type, r, r->in.dwInfoLevel, py_pControlInParams, "union SC_RPC_SERVICE_CONTROL_IN_PARAMSW");
41338 0 : if (pControlInParams_switch_1 == NULL) {
41339 0 : return false;
41340 : }
41341 0 : r->in.pControlInParams = pControlInParams_switch_1;
41342 : }
41343 0 : return true;
41344 : }
41345 :
41346 0 : static PyObject *unpack_py_svcctl_ControlServiceExW_args_out(struct svcctl_ControlServiceExW *r)
41347 : {
41348 0 : PyObject *result;
41349 0 : PyObject *py_pControlOutParams;
41350 0 : py_pControlOutParams = pyrpc_import_union(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type, r->out.pControlOutParams, r->in.dwInfoLevel, r->out.pControlOutParams, "union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW");
41351 0 : if (py_pControlOutParams == NULL) {
41352 0 : return NULL;
41353 : }
41354 0 : result = py_pControlOutParams;
41355 0 : if (!W_ERROR_IS_OK(r->out.result)) {
41356 0 : PyErr_SetWERROR(r->out.result);
41357 0 : return NULL;
41358 : }
41359 :
41360 0 : return result;
41361 : }
41362 :
41363 :
41364 : static PyGetSetDef py_Opnum52NotUsedOnWire_getsetters[] = {
41365 : { .name = NULL }
41366 : };
41367 :
41368 0 : static PyObject *py_Opnum52NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41369 : {
41370 0 : PyObject *self = pytalloc_new(struct Opnum52NotUsedOnWire, type);
41371 0 : return self;
41372 : }
41373 :
41374 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41375 : {
41376 :
41377 :
41378 0 : return PyLong_FromLong(52);
41379 : }
41380 :
41381 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
41382 : {
41383 0 : const struct ndr_interface_call *call = NULL;
41384 0 : struct Opnum52NotUsedOnWire *object = (struct Opnum52NotUsedOnWire *)pytalloc_get_ptr(py_obj);
41385 0 : PyObject *ret = NULL;
41386 0 : struct ndr_push *push = NULL;
41387 0 : DATA_BLOB blob;
41388 0 : enum ndr_err_code err;
41389 :
41390 0 : if (ndr_table_svcctl.num_calls < 53) {
41391 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum52NotUsedOnWire_ndr_pack");
41392 0 : return NULL;
41393 : }
41394 0 : call = &ndr_table_svcctl.calls[52];
41395 :
41396 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41397 0 : if (push == NULL) {
41398 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41399 0 : return NULL;
41400 : }
41401 :
41402 0 : push->flags |= ndr_push_flags;
41403 :
41404 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41405 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41406 0 : TALLOC_FREE(push);
41407 0 : PyErr_SetNdrError(err);
41408 0 : return NULL;
41409 : }
41410 0 : blob = ndr_push_blob(push);
41411 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41412 0 : TALLOC_FREE(push);
41413 0 : return ret;
41414 : }
41415 :
41416 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41417 : {
41418 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41419 0 : PyObject *bigendian_obj = NULL;
41420 0 : PyObject *ndr64_obj = NULL;
41421 0 : libndr_flags ndr_push_flags = 0;
41422 :
41423 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41424 : discard_const_p(char *, kwnames),
41425 : &bigendian_obj,
41426 : &ndr64_obj)) {
41427 0 : return NULL;
41428 : }
41429 :
41430 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41431 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41432 : }
41433 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41434 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41435 : }
41436 :
41437 0 : return py_Opnum52NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41438 : }
41439 :
41440 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41441 : {
41442 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41443 0 : PyObject *bigendian_obj = NULL;
41444 0 : PyObject *ndr64_obj = NULL;
41445 0 : libndr_flags ndr_push_flags = 0;
41446 :
41447 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41448 : discard_const_p(char *, kwnames),
41449 : &bigendian_obj,
41450 : &ndr64_obj)) {
41451 0 : return NULL;
41452 : }
41453 :
41454 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41455 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41456 : }
41457 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41458 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41459 : }
41460 :
41461 0 : return py_Opnum52NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41462 : }
41463 :
41464 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
41465 : {
41466 0 : const struct ndr_interface_call *call = NULL;
41467 0 : struct Opnum52NotUsedOnWire *object = (struct Opnum52NotUsedOnWire *)pytalloc_get_ptr(py_obj);
41468 0 : struct ndr_pull *pull = NULL;
41469 0 : enum ndr_err_code err;
41470 :
41471 0 : if (ndr_table_svcctl.num_calls < 53) {
41472 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum52NotUsedOnWire_ndr_unpack");
41473 0 : return NULL;
41474 : }
41475 0 : call = &ndr_table_svcctl.calls[52];
41476 :
41477 0 : pull = ndr_pull_init_blob(blob, object);
41478 0 : if (pull == NULL) {
41479 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41480 0 : return NULL;
41481 : }
41482 :
41483 0 : pull->flags |= ndr_pull_flags;
41484 :
41485 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41486 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41487 0 : TALLOC_FREE(pull);
41488 0 : PyErr_SetNdrError(err);
41489 0 : return NULL;
41490 : }
41491 0 : if (!allow_remaining) {
41492 0 : uint32_t highest_ofs;
41493 :
41494 0 : if (pull->offset > pull->relative_highest_offset) {
41495 0 : highest_ofs = pull->offset;
41496 : } else {
41497 0 : highest_ofs = pull->relative_highest_offset;
41498 : }
41499 0 : if (highest_ofs < pull->data_size) {
41500 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41501 : "not all bytes consumed ofs[%u] size[%u]",
41502 : highest_ofs, pull->data_size);
41503 0 : TALLOC_FREE(pull);
41504 0 : PyErr_SetNdrError(err);
41505 0 : return NULL;
41506 : }
41507 : }
41508 :
41509 0 : TALLOC_FREE(pull);
41510 0 : Py_RETURN_NONE;
41511 : }
41512 :
41513 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41514 : {
41515 0 : DATA_BLOB blob;
41516 0 : Py_ssize_t blob_length = 0;
41517 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41518 0 : PyObject *bigendian_obj = NULL;
41519 0 : PyObject *ndr64_obj = NULL;
41520 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41521 0 : PyObject *allow_remaining_obj = NULL;
41522 0 : bool allow_remaining = false;
41523 :
41524 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41525 : discard_const_p(char *, kwnames),
41526 : &blob.data, &blob_length,
41527 : &bigendian_obj,
41528 : &ndr64_obj,
41529 : &allow_remaining_obj)) {
41530 0 : return NULL;
41531 : }
41532 0 : blob.length = blob_length;
41533 :
41534 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41535 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41536 : }
41537 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41538 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41539 : }
41540 :
41541 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41542 0 : allow_remaining = true;
41543 : }
41544 :
41545 0 : return py_Opnum52NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41546 : }
41547 :
41548 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41549 : {
41550 0 : DATA_BLOB blob;
41551 0 : Py_ssize_t blob_length = 0;
41552 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41553 0 : PyObject *bigendian_obj = NULL;
41554 0 : PyObject *ndr64_obj = NULL;
41555 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41556 0 : PyObject *allow_remaining_obj = NULL;
41557 0 : bool allow_remaining = false;
41558 :
41559 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41560 : discard_const_p(char *, kwnames),
41561 : &blob.data, &blob_length,
41562 : &bigendian_obj,
41563 : &ndr64_obj,
41564 : &allow_remaining_obj)) {
41565 0 : return NULL;
41566 : }
41567 0 : blob.length = blob_length;
41568 :
41569 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41570 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41571 : }
41572 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41573 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41574 : }
41575 :
41576 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41577 0 : allow_remaining = true;
41578 : }
41579 :
41580 0 : return py_Opnum52NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41581 : }
41582 :
41583 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41584 : {
41585 0 : const struct ndr_interface_call *call = NULL;
41586 0 : struct Opnum52NotUsedOnWire *object = (struct Opnum52NotUsedOnWire *)pytalloc_get_ptr(py_obj);
41587 0 : PyObject *ret;
41588 0 : char *retstr;
41589 :
41590 0 : if (ndr_table_svcctl.num_calls < 53) {
41591 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum52NotUsedOnWire_ndr_print");
41592 0 : return NULL;
41593 : }
41594 0 : call = &ndr_table_svcctl.calls[52];
41595 :
41596 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41597 0 : ret = PyUnicode_FromString(retstr);
41598 0 : TALLOC_FREE(retstr);
41599 :
41600 0 : return ret;
41601 : }
41602 :
41603 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41604 : {
41605 0 : return py_Opnum52NotUsedOnWire_ndr_print(py_obj, "Opnum52NotUsedOnWire_in", NDR_IN);
41606 : }
41607 :
41608 0 : static PyObject *py_Opnum52NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41609 : {
41610 0 : return py_Opnum52NotUsedOnWire_ndr_print(py_obj, "Opnum52NotUsedOnWire_out", NDR_OUT);
41611 : }
41612 :
41613 : static PyMethodDef py_Opnum52NotUsedOnWire_methods[] = {
41614 : { "opnum", (PyCFunction)py_Opnum52NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
41615 : "svcctl.Opnum52NotUsedOnWire.opnum() -> 52 (0x34) " },
41616 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum52NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41617 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41618 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum52NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41619 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41620 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum52NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41621 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41622 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum52NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41623 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41624 : { "__ndr_print_in__", (PyCFunction)py_Opnum52NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41625 : { "__ndr_print_out__", (PyCFunction)py_Opnum52NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41626 : { NULL, NULL, 0, NULL }
41627 : };
41628 :
41629 :
41630 : static PyTypeObject Opnum52NotUsedOnWire_Type = {
41631 : PyVarObject_HEAD_INIT(NULL, 0)
41632 : .tp_name = "svcctl.Opnum52NotUsedOnWire",
41633 : .tp_getset = py_Opnum52NotUsedOnWire_getsetters,
41634 : .tp_methods = py_Opnum52NotUsedOnWire_methods,
41635 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41636 : .tp_new = py_Opnum52NotUsedOnWire_new,
41637 : };
41638 :
41639 0 : static bool pack_py_Opnum52NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum52NotUsedOnWire *r)
41640 : {
41641 0 : const char *kwnames[] = {
41642 : NULL
41643 : };
41644 :
41645 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum52NotUsedOnWire", discard_const_p(char *, kwnames))) {
41646 0 : return false;
41647 : }
41648 :
41649 0 : return true;
41650 : }
41651 :
41652 0 : static PyObject *unpack_py_Opnum52NotUsedOnWire_args_out(struct Opnum52NotUsedOnWire *r)
41653 : {
41654 0 : PyObject *result;
41655 0 : result = Py_None;
41656 0 : Py_INCREF(result);
41657 0 : return result;
41658 : }
41659 :
41660 :
41661 : static PyGetSetDef py_Opnum53NotUsedOnWire_getsetters[] = {
41662 : { .name = NULL }
41663 : };
41664 :
41665 0 : static PyObject *py_Opnum53NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41666 : {
41667 0 : PyObject *self = pytalloc_new(struct Opnum53NotUsedOnWire, type);
41668 0 : return self;
41669 : }
41670 :
41671 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41672 : {
41673 :
41674 :
41675 0 : return PyLong_FromLong(53);
41676 : }
41677 :
41678 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
41679 : {
41680 0 : const struct ndr_interface_call *call = NULL;
41681 0 : struct Opnum53NotUsedOnWire *object = (struct Opnum53NotUsedOnWire *)pytalloc_get_ptr(py_obj);
41682 0 : PyObject *ret = NULL;
41683 0 : struct ndr_push *push = NULL;
41684 0 : DATA_BLOB blob;
41685 0 : enum ndr_err_code err;
41686 :
41687 0 : if (ndr_table_svcctl.num_calls < 54) {
41688 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum53NotUsedOnWire_ndr_pack");
41689 0 : return NULL;
41690 : }
41691 0 : call = &ndr_table_svcctl.calls[53];
41692 :
41693 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41694 0 : if (push == NULL) {
41695 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41696 0 : return NULL;
41697 : }
41698 :
41699 0 : push->flags |= ndr_push_flags;
41700 :
41701 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41702 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41703 0 : TALLOC_FREE(push);
41704 0 : PyErr_SetNdrError(err);
41705 0 : return NULL;
41706 : }
41707 0 : blob = ndr_push_blob(push);
41708 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41709 0 : TALLOC_FREE(push);
41710 0 : return ret;
41711 : }
41712 :
41713 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41714 : {
41715 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41716 0 : PyObject *bigendian_obj = NULL;
41717 0 : PyObject *ndr64_obj = NULL;
41718 0 : libndr_flags ndr_push_flags = 0;
41719 :
41720 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41721 : discard_const_p(char *, kwnames),
41722 : &bigendian_obj,
41723 : &ndr64_obj)) {
41724 0 : return NULL;
41725 : }
41726 :
41727 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41728 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41729 : }
41730 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41731 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41732 : }
41733 :
41734 0 : return py_Opnum53NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41735 : }
41736 :
41737 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41738 : {
41739 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41740 0 : PyObject *bigendian_obj = NULL;
41741 0 : PyObject *ndr64_obj = NULL;
41742 0 : libndr_flags ndr_push_flags = 0;
41743 :
41744 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41745 : discard_const_p(char *, kwnames),
41746 : &bigendian_obj,
41747 : &ndr64_obj)) {
41748 0 : return NULL;
41749 : }
41750 :
41751 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41752 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41753 : }
41754 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41755 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41756 : }
41757 :
41758 0 : return py_Opnum53NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41759 : }
41760 :
41761 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
41762 : {
41763 0 : const struct ndr_interface_call *call = NULL;
41764 0 : struct Opnum53NotUsedOnWire *object = (struct Opnum53NotUsedOnWire *)pytalloc_get_ptr(py_obj);
41765 0 : struct ndr_pull *pull = NULL;
41766 0 : enum ndr_err_code err;
41767 :
41768 0 : if (ndr_table_svcctl.num_calls < 54) {
41769 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum53NotUsedOnWire_ndr_unpack");
41770 0 : return NULL;
41771 : }
41772 0 : call = &ndr_table_svcctl.calls[53];
41773 :
41774 0 : pull = ndr_pull_init_blob(blob, object);
41775 0 : if (pull == NULL) {
41776 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41777 0 : return NULL;
41778 : }
41779 :
41780 0 : pull->flags |= ndr_pull_flags;
41781 :
41782 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41783 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41784 0 : TALLOC_FREE(pull);
41785 0 : PyErr_SetNdrError(err);
41786 0 : return NULL;
41787 : }
41788 0 : if (!allow_remaining) {
41789 0 : uint32_t highest_ofs;
41790 :
41791 0 : if (pull->offset > pull->relative_highest_offset) {
41792 0 : highest_ofs = pull->offset;
41793 : } else {
41794 0 : highest_ofs = pull->relative_highest_offset;
41795 : }
41796 0 : if (highest_ofs < pull->data_size) {
41797 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41798 : "not all bytes consumed ofs[%u] size[%u]",
41799 : highest_ofs, pull->data_size);
41800 0 : TALLOC_FREE(pull);
41801 0 : PyErr_SetNdrError(err);
41802 0 : return NULL;
41803 : }
41804 : }
41805 :
41806 0 : TALLOC_FREE(pull);
41807 0 : Py_RETURN_NONE;
41808 : }
41809 :
41810 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41811 : {
41812 0 : DATA_BLOB blob;
41813 0 : Py_ssize_t blob_length = 0;
41814 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41815 0 : PyObject *bigendian_obj = NULL;
41816 0 : PyObject *ndr64_obj = NULL;
41817 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41818 0 : PyObject *allow_remaining_obj = NULL;
41819 0 : bool allow_remaining = false;
41820 :
41821 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41822 : discard_const_p(char *, kwnames),
41823 : &blob.data, &blob_length,
41824 : &bigendian_obj,
41825 : &ndr64_obj,
41826 : &allow_remaining_obj)) {
41827 0 : return NULL;
41828 : }
41829 0 : blob.length = blob_length;
41830 :
41831 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41832 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41833 : }
41834 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41835 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41836 : }
41837 :
41838 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41839 0 : allow_remaining = true;
41840 : }
41841 :
41842 0 : return py_Opnum53NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41843 : }
41844 :
41845 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41846 : {
41847 0 : DATA_BLOB blob;
41848 0 : Py_ssize_t blob_length = 0;
41849 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41850 0 : PyObject *bigendian_obj = NULL;
41851 0 : PyObject *ndr64_obj = NULL;
41852 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41853 0 : PyObject *allow_remaining_obj = NULL;
41854 0 : bool allow_remaining = false;
41855 :
41856 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41857 : discard_const_p(char *, kwnames),
41858 : &blob.data, &blob_length,
41859 : &bigendian_obj,
41860 : &ndr64_obj,
41861 : &allow_remaining_obj)) {
41862 0 : return NULL;
41863 : }
41864 0 : blob.length = blob_length;
41865 :
41866 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41867 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41868 : }
41869 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41870 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41871 : }
41872 :
41873 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41874 0 : allow_remaining = true;
41875 : }
41876 :
41877 0 : return py_Opnum53NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41878 : }
41879 :
41880 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41881 : {
41882 0 : const struct ndr_interface_call *call = NULL;
41883 0 : struct Opnum53NotUsedOnWire *object = (struct Opnum53NotUsedOnWire *)pytalloc_get_ptr(py_obj);
41884 0 : PyObject *ret;
41885 0 : char *retstr;
41886 :
41887 0 : if (ndr_table_svcctl.num_calls < 54) {
41888 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum53NotUsedOnWire_ndr_print");
41889 0 : return NULL;
41890 : }
41891 0 : call = &ndr_table_svcctl.calls[53];
41892 :
41893 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41894 0 : ret = PyUnicode_FromString(retstr);
41895 0 : TALLOC_FREE(retstr);
41896 :
41897 0 : return ret;
41898 : }
41899 :
41900 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41901 : {
41902 0 : return py_Opnum53NotUsedOnWire_ndr_print(py_obj, "Opnum53NotUsedOnWire_in", NDR_IN);
41903 : }
41904 :
41905 0 : static PyObject *py_Opnum53NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41906 : {
41907 0 : return py_Opnum53NotUsedOnWire_ndr_print(py_obj, "Opnum53NotUsedOnWire_out", NDR_OUT);
41908 : }
41909 :
41910 : static PyMethodDef py_Opnum53NotUsedOnWire_methods[] = {
41911 : { "opnum", (PyCFunction)py_Opnum53NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
41912 : "svcctl.Opnum53NotUsedOnWire.opnum() -> 53 (0x35) " },
41913 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum53NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41914 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41915 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum53NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41916 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41917 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum53NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41918 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41919 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum53NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41920 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41921 : { "__ndr_print_in__", (PyCFunction)py_Opnum53NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41922 : { "__ndr_print_out__", (PyCFunction)py_Opnum53NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41923 : { NULL, NULL, 0, NULL }
41924 : };
41925 :
41926 :
41927 : static PyTypeObject Opnum53NotUsedOnWire_Type = {
41928 : PyVarObject_HEAD_INIT(NULL, 0)
41929 : .tp_name = "svcctl.Opnum53NotUsedOnWire",
41930 : .tp_getset = py_Opnum53NotUsedOnWire_getsetters,
41931 : .tp_methods = py_Opnum53NotUsedOnWire_methods,
41932 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41933 : .tp_new = py_Opnum53NotUsedOnWire_new,
41934 : };
41935 :
41936 0 : static bool pack_py_Opnum53NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum53NotUsedOnWire *r)
41937 : {
41938 0 : const char *kwnames[] = {
41939 : NULL
41940 : };
41941 :
41942 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum53NotUsedOnWire", discard_const_p(char *, kwnames))) {
41943 0 : return false;
41944 : }
41945 :
41946 0 : return true;
41947 : }
41948 :
41949 0 : static PyObject *unpack_py_Opnum53NotUsedOnWire_args_out(struct Opnum53NotUsedOnWire *r)
41950 : {
41951 0 : PyObject *result;
41952 0 : result = Py_None;
41953 0 : Py_INCREF(result);
41954 0 : return result;
41955 : }
41956 :
41957 :
41958 : static PyGetSetDef py_Opnum54NotUsedOnWire_getsetters[] = {
41959 : { .name = NULL }
41960 : };
41961 :
41962 0 : static PyObject *py_Opnum54NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41963 : {
41964 0 : PyObject *self = pytalloc_new(struct Opnum54NotUsedOnWire, type);
41965 0 : return self;
41966 : }
41967 :
41968 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41969 : {
41970 :
41971 :
41972 0 : return PyLong_FromLong(54);
41973 : }
41974 :
41975 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
41976 : {
41977 0 : const struct ndr_interface_call *call = NULL;
41978 0 : struct Opnum54NotUsedOnWire *object = (struct Opnum54NotUsedOnWire *)pytalloc_get_ptr(py_obj);
41979 0 : PyObject *ret = NULL;
41980 0 : struct ndr_push *push = NULL;
41981 0 : DATA_BLOB blob;
41982 0 : enum ndr_err_code err;
41983 :
41984 0 : if (ndr_table_svcctl.num_calls < 55) {
41985 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum54NotUsedOnWire_ndr_pack");
41986 0 : return NULL;
41987 : }
41988 0 : call = &ndr_table_svcctl.calls[54];
41989 :
41990 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41991 0 : if (push == NULL) {
41992 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41993 0 : return NULL;
41994 : }
41995 :
41996 0 : push->flags |= ndr_push_flags;
41997 :
41998 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41999 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42000 0 : TALLOC_FREE(push);
42001 0 : PyErr_SetNdrError(err);
42002 0 : return NULL;
42003 : }
42004 0 : blob = ndr_push_blob(push);
42005 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42006 0 : TALLOC_FREE(push);
42007 0 : return ret;
42008 : }
42009 :
42010 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42011 : {
42012 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42013 0 : PyObject *bigendian_obj = NULL;
42014 0 : PyObject *ndr64_obj = NULL;
42015 0 : libndr_flags ndr_push_flags = 0;
42016 :
42017 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42018 : discard_const_p(char *, kwnames),
42019 : &bigendian_obj,
42020 : &ndr64_obj)) {
42021 0 : return NULL;
42022 : }
42023 :
42024 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42025 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42026 : }
42027 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42028 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42029 : }
42030 :
42031 0 : return py_Opnum54NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42032 : }
42033 :
42034 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42035 : {
42036 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42037 0 : PyObject *bigendian_obj = NULL;
42038 0 : PyObject *ndr64_obj = NULL;
42039 0 : libndr_flags ndr_push_flags = 0;
42040 :
42041 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42042 : discard_const_p(char *, kwnames),
42043 : &bigendian_obj,
42044 : &ndr64_obj)) {
42045 0 : return NULL;
42046 : }
42047 :
42048 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42049 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42050 : }
42051 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42052 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42053 : }
42054 :
42055 0 : return py_Opnum54NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42056 : }
42057 :
42058 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
42059 : {
42060 0 : const struct ndr_interface_call *call = NULL;
42061 0 : struct Opnum54NotUsedOnWire *object = (struct Opnum54NotUsedOnWire *)pytalloc_get_ptr(py_obj);
42062 0 : struct ndr_pull *pull = NULL;
42063 0 : enum ndr_err_code err;
42064 :
42065 0 : if (ndr_table_svcctl.num_calls < 55) {
42066 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum54NotUsedOnWire_ndr_unpack");
42067 0 : return NULL;
42068 : }
42069 0 : call = &ndr_table_svcctl.calls[54];
42070 :
42071 0 : pull = ndr_pull_init_blob(blob, object);
42072 0 : if (pull == NULL) {
42073 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42074 0 : return NULL;
42075 : }
42076 :
42077 0 : pull->flags |= ndr_pull_flags;
42078 :
42079 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42080 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42081 0 : TALLOC_FREE(pull);
42082 0 : PyErr_SetNdrError(err);
42083 0 : return NULL;
42084 : }
42085 0 : if (!allow_remaining) {
42086 0 : uint32_t highest_ofs;
42087 :
42088 0 : if (pull->offset > pull->relative_highest_offset) {
42089 0 : highest_ofs = pull->offset;
42090 : } else {
42091 0 : highest_ofs = pull->relative_highest_offset;
42092 : }
42093 0 : if (highest_ofs < pull->data_size) {
42094 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42095 : "not all bytes consumed ofs[%u] size[%u]",
42096 : highest_ofs, pull->data_size);
42097 0 : TALLOC_FREE(pull);
42098 0 : PyErr_SetNdrError(err);
42099 0 : return NULL;
42100 : }
42101 : }
42102 :
42103 0 : TALLOC_FREE(pull);
42104 0 : Py_RETURN_NONE;
42105 : }
42106 :
42107 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42108 : {
42109 0 : DATA_BLOB blob;
42110 0 : Py_ssize_t blob_length = 0;
42111 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42112 0 : PyObject *bigendian_obj = NULL;
42113 0 : PyObject *ndr64_obj = NULL;
42114 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42115 0 : PyObject *allow_remaining_obj = NULL;
42116 0 : bool allow_remaining = false;
42117 :
42118 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42119 : discard_const_p(char *, kwnames),
42120 : &blob.data, &blob_length,
42121 : &bigendian_obj,
42122 : &ndr64_obj,
42123 : &allow_remaining_obj)) {
42124 0 : return NULL;
42125 : }
42126 0 : blob.length = blob_length;
42127 :
42128 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42129 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42130 : }
42131 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42132 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42133 : }
42134 :
42135 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42136 0 : allow_remaining = true;
42137 : }
42138 :
42139 0 : return py_Opnum54NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42140 : }
42141 :
42142 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42143 : {
42144 0 : DATA_BLOB blob;
42145 0 : Py_ssize_t blob_length = 0;
42146 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42147 0 : PyObject *bigendian_obj = NULL;
42148 0 : PyObject *ndr64_obj = NULL;
42149 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42150 0 : PyObject *allow_remaining_obj = NULL;
42151 0 : bool allow_remaining = false;
42152 :
42153 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42154 : discard_const_p(char *, kwnames),
42155 : &blob.data, &blob_length,
42156 : &bigendian_obj,
42157 : &ndr64_obj,
42158 : &allow_remaining_obj)) {
42159 0 : return NULL;
42160 : }
42161 0 : blob.length = blob_length;
42162 :
42163 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42164 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42165 : }
42166 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42167 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42168 : }
42169 :
42170 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42171 0 : allow_remaining = true;
42172 : }
42173 :
42174 0 : return py_Opnum54NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42175 : }
42176 :
42177 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42178 : {
42179 0 : const struct ndr_interface_call *call = NULL;
42180 0 : struct Opnum54NotUsedOnWire *object = (struct Opnum54NotUsedOnWire *)pytalloc_get_ptr(py_obj);
42181 0 : PyObject *ret;
42182 0 : char *retstr;
42183 :
42184 0 : if (ndr_table_svcctl.num_calls < 55) {
42185 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum54NotUsedOnWire_ndr_print");
42186 0 : return NULL;
42187 : }
42188 0 : call = &ndr_table_svcctl.calls[54];
42189 :
42190 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42191 0 : ret = PyUnicode_FromString(retstr);
42192 0 : TALLOC_FREE(retstr);
42193 :
42194 0 : return ret;
42195 : }
42196 :
42197 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42198 : {
42199 0 : return py_Opnum54NotUsedOnWire_ndr_print(py_obj, "Opnum54NotUsedOnWire_in", NDR_IN);
42200 : }
42201 :
42202 0 : static PyObject *py_Opnum54NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42203 : {
42204 0 : return py_Opnum54NotUsedOnWire_ndr_print(py_obj, "Opnum54NotUsedOnWire_out", NDR_OUT);
42205 : }
42206 :
42207 : static PyMethodDef py_Opnum54NotUsedOnWire_methods[] = {
42208 : { "opnum", (PyCFunction)py_Opnum54NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
42209 : "svcctl.Opnum54NotUsedOnWire.opnum() -> 54 (0x36) " },
42210 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum54NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42211 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42212 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum54NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42213 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42214 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum54NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42215 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42216 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum54NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42217 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42218 : { "__ndr_print_in__", (PyCFunction)py_Opnum54NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42219 : { "__ndr_print_out__", (PyCFunction)py_Opnum54NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42220 : { NULL, NULL, 0, NULL }
42221 : };
42222 :
42223 :
42224 : static PyTypeObject Opnum54NotUsedOnWire_Type = {
42225 : PyVarObject_HEAD_INIT(NULL, 0)
42226 : .tp_name = "svcctl.Opnum54NotUsedOnWire",
42227 : .tp_getset = py_Opnum54NotUsedOnWire_getsetters,
42228 : .tp_methods = py_Opnum54NotUsedOnWire_methods,
42229 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42230 : .tp_new = py_Opnum54NotUsedOnWire_new,
42231 : };
42232 :
42233 0 : static bool pack_py_Opnum54NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum54NotUsedOnWire *r)
42234 : {
42235 0 : const char *kwnames[] = {
42236 : NULL
42237 : };
42238 :
42239 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum54NotUsedOnWire", discard_const_p(char *, kwnames))) {
42240 0 : return false;
42241 : }
42242 :
42243 0 : return true;
42244 : }
42245 :
42246 0 : static PyObject *unpack_py_Opnum54NotUsedOnWire_args_out(struct Opnum54NotUsedOnWire *r)
42247 : {
42248 0 : PyObject *result;
42249 0 : result = Py_None;
42250 0 : Py_INCREF(result);
42251 0 : return result;
42252 : }
42253 :
42254 :
42255 : static PyGetSetDef py_Opnum55NotUsedOnWire_getsetters[] = {
42256 : { .name = NULL }
42257 : };
42258 :
42259 0 : static PyObject *py_Opnum55NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42260 : {
42261 0 : PyObject *self = pytalloc_new(struct Opnum55NotUsedOnWire, type);
42262 0 : return self;
42263 : }
42264 :
42265 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42266 : {
42267 :
42268 :
42269 0 : return PyLong_FromLong(55);
42270 : }
42271 :
42272 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
42273 : {
42274 0 : const struct ndr_interface_call *call = NULL;
42275 0 : struct Opnum55NotUsedOnWire *object = (struct Opnum55NotUsedOnWire *)pytalloc_get_ptr(py_obj);
42276 0 : PyObject *ret = NULL;
42277 0 : struct ndr_push *push = NULL;
42278 0 : DATA_BLOB blob;
42279 0 : enum ndr_err_code err;
42280 :
42281 0 : if (ndr_table_svcctl.num_calls < 56) {
42282 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum55NotUsedOnWire_ndr_pack");
42283 0 : return NULL;
42284 : }
42285 0 : call = &ndr_table_svcctl.calls[55];
42286 :
42287 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42288 0 : if (push == NULL) {
42289 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42290 0 : return NULL;
42291 : }
42292 :
42293 0 : push->flags |= ndr_push_flags;
42294 :
42295 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42296 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42297 0 : TALLOC_FREE(push);
42298 0 : PyErr_SetNdrError(err);
42299 0 : return NULL;
42300 : }
42301 0 : blob = ndr_push_blob(push);
42302 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42303 0 : TALLOC_FREE(push);
42304 0 : return ret;
42305 : }
42306 :
42307 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42308 : {
42309 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42310 0 : PyObject *bigendian_obj = NULL;
42311 0 : PyObject *ndr64_obj = NULL;
42312 0 : libndr_flags ndr_push_flags = 0;
42313 :
42314 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42315 : discard_const_p(char *, kwnames),
42316 : &bigendian_obj,
42317 : &ndr64_obj)) {
42318 0 : return NULL;
42319 : }
42320 :
42321 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42322 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42323 : }
42324 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42325 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42326 : }
42327 :
42328 0 : return py_Opnum55NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42329 : }
42330 :
42331 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42332 : {
42333 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42334 0 : PyObject *bigendian_obj = NULL;
42335 0 : PyObject *ndr64_obj = NULL;
42336 0 : libndr_flags ndr_push_flags = 0;
42337 :
42338 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42339 : discard_const_p(char *, kwnames),
42340 : &bigendian_obj,
42341 : &ndr64_obj)) {
42342 0 : return NULL;
42343 : }
42344 :
42345 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42346 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42347 : }
42348 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42349 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42350 : }
42351 :
42352 0 : return py_Opnum55NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42353 : }
42354 :
42355 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
42356 : {
42357 0 : const struct ndr_interface_call *call = NULL;
42358 0 : struct Opnum55NotUsedOnWire *object = (struct Opnum55NotUsedOnWire *)pytalloc_get_ptr(py_obj);
42359 0 : struct ndr_pull *pull = NULL;
42360 0 : enum ndr_err_code err;
42361 :
42362 0 : if (ndr_table_svcctl.num_calls < 56) {
42363 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum55NotUsedOnWire_ndr_unpack");
42364 0 : return NULL;
42365 : }
42366 0 : call = &ndr_table_svcctl.calls[55];
42367 :
42368 0 : pull = ndr_pull_init_blob(blob, object);
42369 0 : if (pull == NULL) {
42370 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42371 0 : return NULL;
42372 : }
42373 :
42374 0 : pull->flags |= ndr_pull_flags;
42375 :
42376 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42377 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42378 0 : TALLOC_FREE(pull);
42379 0 : PyErr_SetNdrError(err);
42380 0 : return NULL;
42381 : }
42382 0 : if (!allow_remaining) {
42383 0 : uint32_t highest_ofs;
42384 :
42385 0 : if (pull->offset > pull->relative_highest_offset) {
42386 0 : highest_ofs = pull->offset;
42387 : } else {
42388 0 : highest_ofs = pull->relative_highest_offset;
42389 : }
42390 0 : if (highest_ofs < pull->data_size) {
42391 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42392 : "not all bytes consumed ofs[%u] size[%u]",
42393 : highest_ofs, pull->data_size);
42394 0 : TALLOC_FREE(pull);
42395 0 : PyErr_SetNdrError(err);
42396 0 : return NULL;
42397 : }
42398 : }
42399 :
42400 0 : TALLOC_FREE(pull);
42401 0 : Py_RETURN_NONE;
42402 : }
42403 :
42404 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42405 : {
42406 0 : DATA_BLOB blob;
42407 0 : Py_ssize_t blob_length = 0;
42408 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42409 0 : PyObject *bigendian_obj = NULL;
42410 0 : PyObject *ndr64_obj = NULL;
42411 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42412 0 : PyObject *allow_remaining_obj = NULL;
42413 0 : bool allow_remaining = false;
42414 :
42415 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42416 : discard_const_p(char *, kwnames),
42417 : &blob.data, &blob_length,
42418 : &bigendian_obj,
42419 : &ndr64_obj,
42420 : &allow_remaining_obj)) {
42421 0 : return NULL;
42422 : }
42423 0 : blob.length = blob_length;
42424 :
42425 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42426 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42427 : }
42428 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42429 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42430 : }
42431 :
42432 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42433 0 : allow_remaining = true;
42434 : }
42435 :
42436 0 : return py_Opnum55NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42437 : }
42438 :
42439 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42440 : {
42441 0 : DATA_BLOB blob;
42442 0 : Py_ssize_t blob_length = 0;
42443 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42444 0 : PyObject *bigendian_obj = NULL;
42445 0 : PyObject *ndr64_obj = NULL;
42446 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42447 0 : PyObject *allow_remaining_obj = NULL;
42448 0 : bool allow_remaining = false;
42449 :
42450 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42451 : discard_const_p(char *, kwnames),
42452 : &blob.data, &blob_length,
42453 : &bigendian_obj,
42454 : &ndr64_obj,
42455 : &allow_remaining_obj)) {
42456 0 : return NULL;
42457 : }
42458 0 : blob.length = blob_length;
42459 :
42460 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42461 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42462 : }
42463 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42464 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42465 : }
42466 :
42467 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42468 0 : allow_remaining = true;
42469 : }
42470 :
42471 0 : return py_Opnum55NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42472 : }
42473 :
42474 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42475 : {
42476 0 : const struct ndr_interface_call *call = NULL;
42477 0 : struct Opnum55NotUsedOnWire *object = (struct Opnum55NotUsedOnWire *)pytalloc_get_ptr(py_obj);
42478 0 : PyObject *ret;
42479 0 : char *retstr;
42480 :
42481 0 : if (ndr_table_svcctl.num_calls < 56) {
42482 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum55NotUsedOnWire_ndr_print");
42483 0 : return NULL;
42484 : }
42485 0 : call = &ndr_table_svcctl.calls[55];
42486 :
42487 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42488 0 : ret = PyUnicode_FromString(retstr);
42489 0 : TALLOC_FREE(retstr);
42490 :
42491 0 : return ret;
42492 : }
42493 :
42494 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42495 : {
42496 0 : return py_Opnum55NotUsedOnWire_ndr_print(py_obj, "Opnum55NotUsedOnWire_in", NDR_IN);
42497 : }
42498 :
42499 0 : static PyObject *py_Opnum55NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42500 : {
42501 0 : return py_Opnum55NotUsedOnWire_ndr_print(py_obj, "Opnum55NotUsedOnWire_out", NDR_OUT);
42502 : }
42503 :
42504 : static PyMethodDef py_Opnum55NotUsedOnWire_methods[] = {
42505 : { "opnum", (PyCFunction)py_Opnum55NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
42506 : "svcctl.Opnum55NotUsedOnWire.opnum() -> 55 (0x37) " },
42507 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum55NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42508 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42509 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum55NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42510 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42511 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum55NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42512 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42513 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum55NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42514 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42515 : { "__ndr_print_in__", (PyCFunction)py_Opnum55NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42516 : { "__ndr_print_out__", (PyCFunction)py_Opnum55NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42517 : { NULL, NULL, 0, NULL }
42518 : };
42519 :
42520 :
42521 : static PyTypeObject Opnum55NotUsedOnWire_Type = {
42522 : PyVarObject_HEAD_INIT(NULL, 0)
42523 : .tp_name = "svcctl.Opnum55NotUsedOnWire",
42524 : .tp_getset = py_Opnum55NotUsedOnWire_getsetters,
42525 : .tp_methods = py_Opnum55NotUsedOnWire_methods,
42526 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42527 : .tp_new = py_Opnum55NotUsedOnWire_new,
42528 : };
42529 :
42530 0 : static bool pack_py_Opnum55NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum55NotUsedOnWire *r)
42531 : {
42532 0 : const char *kwnames[] = {
42533 : NULL
42534 : };
42535 :
42536 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum55NotUsedOnWire", discard_const_p(char *, kwnames))) {
42537 0 : return false;
42538 : }
42539 :
42540 0 : return true;
42541 : }
42542 :
42543 0 : static PyObject *unpack_py_Opnum55NotUsedOnWire_args_out(struct Opnum55NotUsedOnWire *r)
42544 : {
42545 0 : PyObject *result;
42546 0 : result = Py_None;
42547 0 : Py_INCREF(result);
42548 0 : return result;
42549 : }
42550 :
42551 :
42552 0 : static PyObject *py_svcctl_QueryServiceConfigEx_in_get_hService(PyObject *obj, void *closure)
42553 : {
42554 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(obj);
42555 0 : PyObject *py_hService;
42556 0 : py_hService = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hService);
42557 0 : return py_hService;
42558 : }
42559 :
42560 0 : static int py_svcctl_QueryServiceConfigEx_in_set_hService(PyObject *py_obj, PyObject *value, void *closure)
42561 : {
42562 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(py_obj);
42563 0 : if (value == NULL) {
42564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hService");
42565 0 : return -1;
42566 : }
42567 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42568 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42569 0 : PyErr_NoMemory();
42570 0 : return -1;
42571 : }
42572 0 : object->in.hService = *(struct policy_handle *)pytalloc_get_ptr(value);
42573 0 : return 0;
42574 : }
42575 :
42576 0 : static PyObject *py_svcctl_QueryServiceConfigEx_in_get_dwInfoLevel(PyObject *obj, void *closure)
42577 : {
42578 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(obj);
42579 0 : PyObject *py_dwInfoLevel;
42580 0 : py_dwInfoLevel = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwInfoLevel);
42581 0 : return py_dwInfoLevel;
42582 : }
42583 :
42584 0 : static int py_svcctl_QueryServiceConfigEx_in_set_dwInfoLevel(PyObject *py_obj, PyObject *value, void *closure)
42585 : {
42586 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(py_obj);
42587 0 : if (value == NULL) {
42588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwInfoLevel");
42589 0 : return -1;
42590 : }
42591 : {
42592 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwInfoLevel));
42593 0 : if (PyLong_Check(value)) {
42594 0 : unsigned long long test_var;
42595 0 : test_var = PyLong_AsUnsignedLongLong(value);
42596 0 : if (PyErr_Occurred() != NULL) {
42597 0 : return -1;
42598 : }
42599 0 : if (test_var > uint_max) {
42600 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42601 : PyLong_Type.tp_name, uint_max, test_var);
42602 0 : return -1;
42603 : }
42604 0 : object->in.dwInfoLevel = test_var;
42605 : } else {
42606 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42607 : PyLong_Type.tp_name);
42608 0 : return -1;
42609 : }
42610 : }
42611 0 : return 0;
42612 : }
42613 :
42614 0 : static PyObject *py_svcctl_QueryServiceConfigEx_out_get_pInfo(PyObject *obj, void *closure)
42615 : {
42616 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(obj);
42617 0 : PyObject *py_pInfo;
42618 0 : if (object->out.pInfo == NULL) {
42619 0 : Py_RETURN_NONE;
42620 : }
42621 0 : py_pInfo = pytalloc_reference_ex(&SC_RPC_CONFIG_INFOW_Type, object->out.pInfo, object->out.pInfo);
42622 0 : return py_pInfo;
42623 : }
42624 :
42625 0 : static int py_svcctl_QueryServiceConfigEx_out_set_pInfo(PyObject *py_obj, PyObject *value, void *closure)
42626 : {
42627 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(py_obj);
42628 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pInfo));
42629 0 : if (value == NULL) {
42630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pInfo");
42631 0 : return -1;
42632 : }
42633 0 : object->out.pInfo = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pInfo);
42634 0 : if (object->out.pInfo == NULL) {
42635 0 : PyErr_NoMemory();
42636 0 : return -1;
42637 : }
42638 0 : PY_CHECK_TYPE(&SC_RPC_CONFIG_INFOW_Type, value, return -1;);
42639 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42640 0 : PyErr_NoMemory();
42641 0 : return -1;
42642 : }
42643 0 : object->out.pInfo = (struct SC_RPC_CONFIG_INFOW *)pytalloc_get_ptr(value);
42644 0 : return 0;
42645 : }
42646 :
42647 0 : static PyObject *py_svcctl_QueryServiceConfigEx_get_result(PyObject *obj, void *closure)
42648 : {
42649 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(obj);
42650 0 : PyObject *py_result;
42651 0 : py_result = PyErr_FromWERROR(object->out.result);
42652 0 : return py_result;
42653 : }
42654 :
42655 0 : static int py_svcctl_QueryServiceConfigEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
42656 : {
42657 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(py_obj);
42658 0 : if (value == NULL) {
42659 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
42660 0 : return -1;
42661 : }
42662 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
42663 0 : return 0;
42664 : }
42665 :
42666 : static PyGetSetDef py_svcctl_QueryServiceConfigEx_getsetters[] = {
42667 : {
42668 : .name = discard_const_p(char, "in_hService"),
42669 : .get = py_svcctl_QueryServiceConfigEx_in_get_hService,
42670 : .set = py_svcctl_QueryServiceConfigEx_in_set_hService,
42671 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42672 : },
42673 : {
42674 : .name = discard_const_p(char, "in_dwInfoLevel"),
42675 : .get = py_svcctl_QueryServiceConfigEx_in_get_dwInfoLevel,
42676 : .set = py_svcctl_QueryServiceConfigEx_in_set_dwInfoLevel,
42677 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
42678 : },
42679 : {
42680 : .name = discard_const_p(char, "out_pInfo"),
42681 : .get = py_svcctl_QueryServiceConfigEx_out_get_pInfo,
42682 : .set = py_svcctl_QueryServiceConfigEx_out_set_pInfo,
42683 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_RPC_CONFIG_INFOW")
42684 : },
42685 : {
42686 : .name = discard_const_p(char, "result"),
42687 : .get = py_svcctl_QueryServiceConfigEx_get_result,
42688 : .set = py_svcctl_QueryServiceConfigEx_set_result,
42689 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
42690 : },
42691 : { .name = NULL }
42692 : };
42693 :
42694 0 : static PyObject *py_svcctl_QueryServiceConfigEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42695 : {
42696 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfigEx, type);
42697 0 : struct svcctl_QueryServiceConfigEx *_self = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(self);
42698 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42699 0 : _self->out.pInfo = talloc_zero(mem_ctx, struct SC_RPC_CONFIG_INFOW);
42700 0 : return self;
42701 : }
42702 :
42703 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42704 : {
42705 :
42706 :
42707 0 : return PyLong_FromLong(56);
42708 : }
42709 :
42710 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
42711 : {
42712 0 : const struct ndr_interface_call *call = NULL;
42713 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(py_obj);
42714 0 : PyObject *ret = NULL;
42715 0 : struct ndr_push *push = NULL;
42716 0 : DATA_BLOB blob;
42717 0 : enum ndr_err_code err;
42718 :
42719 0 : if (ndr_table_svcctl.num_calls < 57) {
42720 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigEx_ndr_pack");
42721 0 : return NULL;
42722 : }
42723 0 : call = &ndr_table_svcctl.calls[56];
42724 :
42725 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42726 0 : if (push == NULL) {
42727 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42728 0 : return NULL;
42729 : }
42730 :
42731 0 : push->flags |= ndr_push_flags;
42732 :
42733 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42734 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42735 0 : TALLOC_FREE(push);
42736 0 : PyErr_SetNdrError(err);
42737 0 : return NULL;
42738 : }
42739 0 : blob = ndr_push_blob(push);
42740 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42741 0 : TALLOC_FREE(push);
42742 0 : return ret;
42743 : }
42744 :
42745 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42746 : {
42747 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42748 0 : PyObject *bigendian_obj = NULL;
42749 0 : PyObject *ndr64_obj = NULL;
42750 0 : libndr_flags ndr_push_flags = 0;
42751 :
42752 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42753 : discard_const_p(char *, kwnames),
42754 : &bigendian_obj,
42755 : &ndr64_obj)) {
42756 0 : return NULL;
42757 : }
42758 :
42759 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42760 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42761 : }
42762 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42763 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42764 : }
42765 :
42766 0 : return py_svcctl_QueryServiceConfigEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42767 : }
42768 :
42769 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42770 : {
42771 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42772 0 : PyObject *bigendian_obj = NULL;
42773 0 : PyObject *ndr64_obj = NULL;
42774 0 : libndr_flags ndr_push_flags = 0;
42775 :
42776 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42777 : discard_const_p(char *, kwnames),
42778 : &bigendian_obj,
42779 : &ndr64_obj)) {
42780 0 : return NULL;
42781 : }
42782 :
42783 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42784 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42785 : }
42786 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42787 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42788 : }
42789 :
42790 0 : return py_svcctl_QueryServiceConfigEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42791 : }
42792 :
42793 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
42794 : {
42795 0 : const struct ndr_interface_call *call = NULL;
42796 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(py_obj);
42797 0 : struct ndr_pull *pull = NULL;
42798 0 : enum ndr_err_code err;
42799 :
42800 0 : if (ndr_table_svcctl.num_calls < 57) {
42801 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigEx_ndr_unpack");
42802 0 : return NULL;
42803 : }
42804 0 : call = &ndr_table_svcctl.calls[56];
42805 :
42806 0 : pull = ndr_pull_init_blob(blob, object);
42807 0 : if (pull == NULL) {
42808 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42809 0 : return NULL;
42810 : }
42811 :
42812 0 : pull->flags |= ndr_pull_flags;
42813 :
42814 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42815 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42816 0 : TALLOC_FREE(pull);
42817 0 : PyErr_SetNdrError(err);
42818 0 : return NULL;
42819 : }
42820 0 : if (!allow_remaining) {
42821 0 : uint32_t highest_ofs;
42822 :
42823 0 : if (pull->offset > pull->relative_highest_offset) {
42824 0 : highest_ofs = pull->offset;
42825 : } else {
42826 0 : highest_ofs = pull->relative_highest_offset;
42827 : }
42828 0 : if (highest_ofs < pull->data_size) {
42829 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42830 : "not all bytes consumed ofs[%u] size[%u]",
42831 : highest_ofs, pull->data_size);
42832 0 : TALLOC_FREE(pull);
42833 0 : PyErr_SetNdrError(err);
42834 0 : return NULL;
42835 : }
42836 : }
42837 :
42838 0 : TALLOC_FREE(pull);
42839 0 : Py_RETURN_NONE;
42840 : }
42841 :
42842 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42843 : {
42844 0 : DATA_BLOB blob;
42845 0 : Py_ssize_t blob_length = 0;
42846 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42847 0 : PyObject *bigendian_obj = NULL;
42848 0 : PyObject *ndr64_obj = NULL;
42849 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42850 0 : PyObject *allow_remaining_obj = NULL;
42851 0 : bool allow_remaining = false;
42852 :
42853 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42854 : discard_const_p(char *, kwnames),
42855 : &blob.data, &blob_length,
42856 : &bigendian_obj,
42857 : &ndr64_obj,
42858 : &allow_remaining_obj)) {
42859 0 : return NULL;
42860 : }
42861 0 : blob.length = blob_length;
42862 :
42863 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42864 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42865 : }
42866 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42867 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42868 : }
42869 :
42870 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42871 0 : allow_remaining = true;
42872 : }
42873 :
42874 0 : return py_svcctl_QueryServiceConfigEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42875 : }
42876 :
42877 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42878 : {
42879 0 : DATA_BLOB blob;
42880 0 : Py_ssize_t blob_length = 0;
42881 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42882 0 : PyObject *bigendian_obj = NULL;
42883 0 : PyObject *ndr64_obj = NULL;
42884 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42885 0 : PyObject *allow_remaining_obj = NULL;
42886 0 : bool allow_remaining = false;
42887 :
42888 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42889 : discard_const_p(char *, kwnames),
42890 : &blob.data, &blob_length,
42891 : &bigendian_obj,
42892 : &ndr64_obj,
42893 : &allow_remaining_obj)) {
42894 0 : return NULL;
42895 : }
42896 0 : blob.length = blob_length;
42897 :
42898 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42899 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42900 : }
42901 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42902 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42903 : }
42904 :
42905 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42906 0 : allow_remaining = true;
42907 : }
42908 :
42909 0 : return py_svcctl_QueryServiceConfigEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42910 : }
42911 :
42912 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42913 : {
42914 0 : const struct ndr_interface_call *call = NULL;
42915 0 : struct svcctl_QueryServiceConfigEx *object = (struct svcctl_QueryServiceConfigEx *)pytalloc_get_ptr(py_obj);
42916 0 : PyObject *ret;
42917 0 : char *retstr;
42918 :
42919 0 : if (ndr_table_svcctl.num_calls < 57) {
42920 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigEx_ndr_print");
42921 0 : return NULL;
42922 : }
42923 0 : call = &ndr_table_svcctl.calls[56];
42924 :
42925 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42926 0 : ret = PyUnicode_FromString(retstr);
42927 0 : TALLOC_FREE(retstr);
42928 :
42929 0 : return ret;
42930 : }
42931 :
42932 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42933 : {
42934 0 : return py_svcctl_QueryServiceConfigEx_ndr_print(py_obj, "svcctl_QueryServiceConfigEx_in", NDR_IN);
42935 : }
42936 :
42937 0 : static PyObject *py_svcctl_QueryServiceConfigEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42938 : {
42939 0 : return py_svcctl_QueryServiceConfigEx_ndr_print(py_obj, "svcctl_QueryServiceConfigEx_out", NDR_OUT);
42940 : }
42941 :
42942 : static PyMethodDef py_svcctl_QueryServiceConfigEx_methods[] = {
42943 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfigEx_ndr_opnum, METH_NOARGS|METH_CLASS,
42944 : "svcctl.QueryServiceConfigEx.opnum() -> 56 (0x38) " },
42945 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42946 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42947 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42948 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42949 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42950 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42951 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42952 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42953 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfigEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42954 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfigEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42955 : { NULL, NULL, 0, NULL }
42956 : };
42957 :
42958 :
42959 : static PyTypeObject svcctl_QueryServiceConfigEx_Type = {
42960 : PyVarObject_HEAD_INIT(NULL, 0)
42961 : .tp_name = "svcctl.QueryServiceConfigEx",
42962 : .tp_getset = py_svcctl_QueryServiceConfigEx_getsetters,
42963 : .tp_methods = py_svcctl_QueryServiceConfigEx_methods,
42964 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42965 : .tp_new = py_svcctl_QueryServiceConfigEx_new,
42966 : };
42967 :
42968 0 : static bool pack_py_svcctl_QueryServiceConfigEx_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfigEx *r)
42969 : {
42970 0 : PyObject *py_hService;
42971 0 : PyObject *py_dwInfoLevel;
42972 0 : const char *kwnames[] = {
42973 : "hService", "dwInfoLevel", NULL
42974 : };
42975 :
42976 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceConfigEx", discard_const_p(char *, kwnames), &py_hService, &py_dwInfoLevel)) {
42977 0 : return false;
42978 : }
42979 :
42980 0 : if (py_hService == NULL) {
42981 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hService");
42982 0 : return false;
42983 : }
42984 0 : PY_CHECK_TYPE(policy_handle_Type, py_hService, return false;);
42985 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hService)) == NULL) {
42986 0 : PyErr_NoMemory();
42987 0 : return false;
42988 : }
42989 0 : r->in.hService = *(struct policy_handle *)pytalloc_get_ptr(py_hService);
42990 0 : if (py_dwInfoLevel == NULL) {
42991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwInfoLevel");
42992 0 : return false;
42993 : }
42994 : {
42995 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwInfoLevel));
42996 0 : if (PyLong_Check(py_dwInfoLevel)) {
42997 0 : unsigned long long test_var;
42998 0 : test_var = PyLong_AsUnsignedLongLong(py_dwInfoLevel);
42999 0 : if (PyErr_Occurred() != NULL) {
43000 0 : return false;
43001 : }
43002 0 : if (test_var > uint_max) {
43003 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43004 : PyLong_Type.tp_name, uint_max, test_var);
43005 0 : return false;
43006 : }
43007 0 : r->in.dwInfoLevel = test_var;
43008 : } else {
43009 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43010 : PyLong_Type.tp_name);
43011 0 : return false;
43012 : }
43013 : }
43014 0 : return true;
43015 : }
43016 :
43017 0 : static PyObject *unpack_py_svcctl_QueryServiceConfigEx_args_out(struct svcctl_QueryServiceConfigEx *r)
43018 : {
43019 0 : PyObject *result;
43020 0 : PyObject *py_pInfo;
43021 0 : py_pInfo = pytalloc_reference_ex(&SC_RPC_CONFIG_INFOW_Type, r->out.pInfo, r->out.pInfo);
43022 0 : result = py_pInfo;
43023 0 : if (!W_ERROR_IS_OK(r->out.result)) {
43024 0 : PyErr_SetWERROR(r->out.result);
43025 0 : return NULL;
43026 : }
43027 :
43028 0 : return result;
43029 : }
43030 :
43031 :
43032 : static PyGetSetDef py_Opnum57NotUsedOnWire_getsetters[] = {
43033 : { .name = NULL }
43034 : };
43035 :
43036 0 : static PyObject *py_Opnum57NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43037 : {
43038 0 : PyObject *self = pytalloc_new(struct Opnum57NotUsedOnWire, type);
43039 0 : return self;
43040 : }
43041 :
43042 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43043 : {
43044 :
43045 :
43046 0 : return PyLong_FromLong(57);
43047 : }
43048 :
43049 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
43050 : {
43051 0 : const struct ndr_interface_call *call = NULL;
43052 0 : struct Opnum57NotUsedOnWire *object = (struct Opnum57NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43053 0 : PyObject *ret = NULL;
43054 0 : struct ndr_push *push = NULL;
43055 0 : DATA_BLOB blob;
43056 0 : enum ndr_err_code err;
43057 :
43058 0 : if (ndr_table_svcctl.num_calls < 58) {
43059 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum57NotUsedOnWire_ndr_pack");
43060 0 : return NULL;
43061 : }
43062 0 : call = &ndr_table_svcctl.calls[57];
43063 :
43064 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43065 0 : if (push == NULL) {
43066 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43067 0 : return NULL;
43068 : }
43069 :
43070 0 : push->flags |= ndr_push_flags;
43071 :
43072 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43073 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43074 0 : TALLOC_FREE(push);
43075 0 : PyErr_SetNdrError(err);
43076 0 : return NULL;
43077 : }
43078 0 : blob = ndr_push_blob(push);
43079 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43080 0 : TALLOC_FREE(push);
43081 0 : return ret;
43082 : }
43083 :
43084 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43085 : {
43086 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43087 0 : PyObject *bigendian_obj = NULL;
43088 0 : PyObject *ndr64_obj = NULL;
43089 0 : libndr_flags ndr_push_flags = 0;
43090 :
43091 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43092 : discard_const_p(char *, kwnames),
43093 : &bigendian_obj,
43094 : &ndr64_obj)) {
43095 0 : return NULL;
43096 : }
43097 :
43098 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43099 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43100 : }
43101 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43102 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43103 : }
43104 :
43105 0 : return py_Opnum57NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43106 : }
43107 :
43108 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43109 : {
43110 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43111 0 : PyObject *bigendian_obj = NULL;
43112 0 : PyObject *ndr64_obj = NULL;
43113 0 : libndr_flags ndr_push_flags = 0;
43114 :
43115 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43116 : discard_const_p(char *, kwnames),
43117 : &bigendian_obj,
43118 : &ndr64_obj)) {
43119 0 : return NULL;
43120 : }
43121 :
43122 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43123 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43124 : }
43125 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43126 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43127 : }
43128 :
43129 0 : return py_Opnum57NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43130 : }
43131 :
43132 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
43133 : {
43134 0 : const struct ndr_interface_call *call = NULL;
43135 0 : struct Opnum57NotUsedOnWire *object = (struct Opnum57NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43136 0 : struct ndr_pull *pull = NULL;
43137 0 : enum ndr_err_code err;
43138 :
43139 0 : if (ndr_table_svcctl.num_calls < 58) {
43140 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum57NotUsedOnWire_ndr_unpack");
43141 0 : return NULL;
43142 : }
43143 0 : call = &ndr_table_svcctl.calls[57];
43144 :
43145 0 : pull = ndr_pull_init_blob(blob, object);
43146 0 : if (pull == NULL) {
43147 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43148 0 : return NULL;
43149 : }
43150 :
43151 0 : pull->flags |= ndr_pull_flags;
43152 :
43153 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43154 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43155 0 : TALLOC_FREE(pull);
43156 0 : PyErr_SetNdrError(err);
43157 0 : return NULL;
43158 : }
43159 0 : if (!allow_remaining) {
43160 0 : uint32_t highest_ofs;
43161 :
43162 0 : if (pull->offset > pull->relative_highest_offset) {
43163 0 : highest_ofs = pull->offset;
43164 : } else {
43165 0 : highest_ofs = pull->relative_highest_offset;
43166 : }
43167 0 : if (highest_ofs < pull->data_size) {
43168 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43169 : "not all bytes consumed ofs[%u] size[%u]",
43170 : highest_ofs, pull->data_size);
43171 0 : TALLOC_FREE(pull);
43172 0 : PyErr_SetNdrError(err);
43173 0 : return NULL;
43174 : }
43175 : }
43176 :
43177 0 : TALLOC_FREE(pull);
43178 0 : Py_RETURN_NONE;
43179 : }
43180 :
43181 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43182 : {
43183 0 : DATA_BLOB blob;
43184 0 : Py_ssize_t blob_length = 0;
43185 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43186 0 : PyObject *bigendian_obj = NULL;
43187 0 : PyObject *ndr64_obj = NULL;
43188 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43189 0 : PyObject *allow_remaining_obj = NULL;
43190 0 : bool allow_remaining = false;
43191 :
43192 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43193 : discard_const_p(char *, kwnames),
43194 : &blob.data, &blob_length,
43195 : &bigendian_obj,
43196 : &ndr64_obj,
43197 : &allow_remaining_obj)) {
43198 0 : return NULL;
43199 : }
43200 0 : blob.length = blob_length;
43201 :
43202 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43203 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43204 : }
43205 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43206 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43207 : }
43208 :
43209 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43210 0 : allow_remaining = true;
43211 : }
43212 :
43213 0 : return py_Opnum57NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43214 : }
43215 :
43216 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43217 : {
43218 0 : DATA_BLOB blob;
43219 0 : Py_ssize_t blob_length = 0;
43220 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43221 0 : PyObject *bigendian_obj = NULL;
43222 0 : PyObject *ndr64_obj = NULL;
43223 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43224 0 : PyObject *allow_remaining_obj = NULL;
43225 0 : bool allow_remaining = false;
43226 :
43227 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43228 : discard_const_p(char *, kwnames),
43229 : &blob.data, &blob_length,
43230 : &bigendian_obj,
43231 : &ndr64_obj,
43232 : &allow_remaining_obj)) {
43233 0 : return NULL;
43234 : }
43235 0 : blob.length = blob_length;
43236 :
43237 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43238 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43239 : }
43240 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43241 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43242 : }
43243 :
43244 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43245 0 : allow_remaining = true;
43246 : }
43247 :
43248 0 : return py_Opnum57NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43249 : }
43250 :
43251 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
43252 : {
43253 0 : const struct ndr_interface_call *call = NULL;
43254 0 : struct Opnum57NotUsedOnWire *object = (struct Opnum57NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43255 0 : PyObject *ret;
43256 0 : char *retstr;
43257 :
43258 0 : if (ndr_table_svcctl.num_calls < 58) {
43259 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum57NotUsedOnWire_ndr_print");
43260 0 : return NULL;
43261 : }
43262 0 : call = &ndr_table_svcctl.calls[57];
43263 :
43264 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43265 0 : ret = PyUnicode_FromString(retstr);
43266 0 : TALLOC_FREE(retstr);
43267 :
43268 0 : return ret;
43269 : }
43270 :
43271 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43272 : {
43273 0 : return py_Opnum57NotUsedOnWire_ndr_print(py_obj, "Opnum57NotUsedOnWire_in", NDR_IN);
43274 : }
43275 :
43276 0 : static PyObject *py_Opnum57NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43277 : {
43278 0 : return py_Opnum57NotUsedOnWire_ndr_print(py_obj, "Opnum57NotUsedOnWire_out", NDR_OUT);
43279 : }
43280 :
43281 : static PyMethodDef py_Opnum57NotUsedOnWire_methods[] = {
43282 : { "opnum", (PyCFunction)py_Opnum57NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
43283 : "svcctl.Opnum57NotUsedOnWire.opnum() -> 57 (0x39) " },
43284 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum57NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43285 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43286 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum57NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43287 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43288 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum57NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43289 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43290 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum57NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43291 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43292 : { "__ndr_print_in__", (PyCFunction)py_Opnum57NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43293 : { "__ndr_print_out__", (PyCFunction)py_Opnum57NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43294 : { NULL, NULL, 0, NULL }
43295 : };
43296 :
43297 :
43298 : static PyTypeObject Opnum57NotUsedOnWire_Type = {
43299 : PyVarObject_HEAD_INIT(NULL, 0)
43300 : .tp_name = "svcctl.Opnum57NotUsedOnWire",
43301 : .tp_getset = py_Opnum57NotUsedOnWire_getsetters,
43302 : .tp_methods = py_Opnum57NotUsedOnWire_methods,
43303 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43304 : .tp_new = py_Opnum57NotUsedOnWire_new,
43305 : };
43306 :
43307 0 : static bool pack_py_Opnum57NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum57NotUsedOnWire *r)
43308 : {
43309 0 : const char *kwnames[] = {
43310 : NULL
43311 : };
43312 :
43313 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum57NotUsedOnWire", discard_const_p(char *, kwnames))) {
43314 0 : return false;
43315 : }
43316 :
43317 0 : return true;
43318 : }
43319 :
43320 0 : static PyObject *unpack_py_Opnum57NotUsedOnWire_args_out(struct Opnum57NotUsedOnWire *r)
43321 : {
43322 0 : PyObject *result;
43323 0 : result = Py_None;
43324 0 : Py_INCREF(result);
43325 0 : return result;
43326 : }
43327 :
43328 :
43329 : static PyGetSetDef py_Opnum58NotUsedOnWire_getsetters[] = {
43330 : { .name = NULL }
43331 : };
43332 :
43333 0 : static PyObject *py_Opnum58NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43334 : {
43335 0 : PyObject *self = pytalloc_new(struct Opnum58NotUsedOnWire, type);
43336 0 : return self;
43337 : }
43338 :
43339 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43340 : {
43341 :
43342 :
43343 0 : return PyLong_FromLong(58);
43344 : }
43345 :
43346 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
43347 : {
43348 0 : const struct ndr_interface_call *call = NULL;
43349 0 : struct Opnum58NotUsedOnWire *object = (struct Opnum58NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43350 0 : PyObject *ret = NULL;
43351 0 : struct ndr_push *push = NULL;
43352 0 : DATA_BLOB blob;
43353 0 : enum ndr_err_code err;
43354 :
43355 0 : if (ndr_table_svcctl.num_calls < 59) {
43356 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum58NotUsedOnWire_ndr_pack");
43357 0 : return NULL;
43358 : }
43359 0 : call = &ndr_table_svcctl.calls[58];
43360 :
43361 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43362 0 : if (push == NULL) {
43363 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43364 0 : return NULL;
43365 : }
43366 :
43367 0 : push->flags |= ndr_push_flags;
43368 :
43369 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43370 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43371 0 : TALLOC_FREE(push);
43372 0 : PyErr_SetNdrError(err);
43373 0 : return NULL;
43374 : }
43375 0 : blob = ndr_push_blob(push);
43376 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43377 0 : TALLOC_FREE(push);
43378 0 : return ret;
43379 : }
43380 :
43381 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43382 : {
43383 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43384 0 : PyObject *bigendian_obj = NULL;
43385 0 : PyObject *ndr64_obj = NULL;
43386 0 : libndr_flags ndr_push_flags = 0;
43387 :
43388 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43389 : discard_const_p(char *, kwnames),
43390 : &bigendian_obj,
43391 : &ndr64_obj)) {
43392 0 : return NULL;
43393 : }
43394 :
43395 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43396 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43397 : }
43398 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43399 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43400 : }
43401 :
43402 0 : return py_Opnum58NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43403 : }
43404 :
43405 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43406 : {
43407 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43408 0 : PyObject *bigendian_obj = NULL;
43409 0 : PyObject *ndr64_obj = NULL;
43410 0 : libndr_flags ndr_push_flags = 0;
43411 :
43412 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43413 : discard_const_p(char *, kwnames),
43414 : &bigendian_obj,
43415 : &ndr64_obj)) {
43416 0 : return NULL;
43417 : }
43418 :
43419 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43420 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43421 : }
43422 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43423 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43424 : }
43425 :
43426 0 : return py_Opnum58NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43427 : }
43428 :
43429 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
43430 : {
43431 0 : const struct ndr_interface_call *call = NULL;
43432 0 : struct Opnum58NotUsedOnWire *object = (struct Opnum58NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43433 0 : struct ndr_pull *pull = NULL;
43434 0 : enum ndr_err_code err;
43435 :
43436 0 : if (ndr_table_svcctl.num_calls < 59) {
43437 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum58NotUsedOnWire_ndr_unpack");
43438 0 : return NULL;
43439 : }
43440 0 : call = &ndr_table_svcctl.calls[58];
43441 :
43442 0 : pull = ndr_pull_init_blob(blob, object);
43443 0 : if (pull == NULL) {
43444 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43445 0 : return NULL;
43446 : }
43447 :
43448 0 : pull->flags |= ndr_pull_flags;
43449 :
43450 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43451 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43452 0 : TALLOC_FREE(pull);
43453 0 : PyErr_SetNdrError(err);
43454 0 : return NULL;
43455 : }
43456 0 : if (!allow_remaining) {
43457 0 : uint32_t highest_ofs;
43458 :
43459 0 : if (pull->offset > pull->relative_highest_offset) {
43460 0 : highest_ofs = pull->offset;
43461 : } else {
43462 0 : highest_ofs = pull->relative_highest_offset;
43463 : }
43464 0 : if (highest_ofs < pull->data_size) {
43465 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43466 : "not all bytes consumed ofs[%u] size[%u]",
43467 : highest_ofs, pull->data_size);
43468 0 : TALLOC_FREE(pull);
43469 0 : PyErr_SetNdrError(err);
43470 0 : return NULL;
43471 : }
43472 : }
43473 :
43474 0 : TALLOC_FREE(pull);
43475 0 : Py_RETURN_NONE;
43476 : }
43477 :
43478 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43479 : {
43480 0 : DATA_BLOB blob;
43481 0 : Py_ssize_t blob_length = 0;
43482 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43483 0 : PyObject *bigendian_obj = NULL;
43484 0 : PyObject *ndr64_obj = NULL;
43485 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43486 0 : PyObject *allow_remaining_obj = NULL;
43487 0 : bool allow_remaining = false;
43488 :
43489 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43490 : discard_const_p(char *, kwnames),
43491 : &blob.data, &blob_length,
43492 : &bigendian_obj,
43493 : &ndr64_obj,
43494 : &allow_remaining_obj)) {
43495 0 : return NULL;
43496 : }
43497 0 : blob.length = blob_length;
43498 :
43499 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43500 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43501 : }
43502 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43503 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43504 : }
43505 :
43506 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43507 0 : allow_remaining = true;
43508 : }
43509 :
43510 0 : return py_Opnum58NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43511 : }
43512 :
43513 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43514 : {
43515 0 : DATA_BLOB blob;
43516 0 : Py_ssize_t blob_length = 0;
43517 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43518 0 : PyObject *bigendian_obj = NULL;
43519 0 : PyObject *ndr64_obj = NULL;
43520 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43521 0 : PyObject *allow_remaining_obj = NULL;
43522 0 : bool allow_remaining = false;
43523 :
43524 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43525 : discard_const_p(char *, kwnames),
43526 : &blob.data, &blob_length,
43527 : &bigendian_obj,
43528 : &ndr64_obj,
43529 : &allow_remaining_obj)) {
43530 0 : return NULL;
43531 : }
43532 0 : blob.length = blob_length;
43533 :
43534 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43535 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43536 : }
43537 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43538 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43539 : }
43540 :
43541 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43542 0 : allow_remaining = true;
43543 : }
43544 :
43545 0 : return py_Opnum58NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43546 : }
43547 :
43548 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
43549 : {
43550 0 : const struct ndr_interface_call *call = NULL;
43551 0 : struct Opnum58NotUsedOnWire *object = (struct Opnum58NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43552 0 : PyObject *ret;
43553 0 : char *retstr;
43554 :
43555 0 : if (ndr_table_svcctl.num_calls < 59) {
43556 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum58NotUsedOnWire_ndr_print");
43557 0 : return NULL;
43558 : }
43559 0 : call = &ndr_table_svcctl.calls[58];
43560 :
43561 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43562 0 : ret = PyUnicode_FromString(retstr);
43563 0 : TALLOC_FREE(retstr);
43564 :
43565 0 : return ret;
43566 : }
43567 :
43568 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43569 : {
43570 0 : return py_Opnum58NotUsedOnWire_ndr_print(py_obj, "Opnum58NotUsedOnWire_in", NDR_IN);
43571 : }
43572 :
43573 0 : static PyObject *py_Opnum58NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43574 : {
43575 0 : return py_Opnum58NotUsedOnWire_ndr_print(py_obj, "Opnum58NotUsedOnWire_out", NDR_OUT);
43576 : }
43577 :
43578 : static PyMethodDef py_Opnum58NotUsedOnWire_methods[] = {
43579 : { "opnum", (PyCFunction)py_Opnum58NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
43580 : "svcctl.Opnum58NotUsedOnWire.opnum() -> 58 (0x3a) " },
43581 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum58NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43582 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43583 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum58NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43584 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43585 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum58NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43586 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43587 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum58NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43588 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43589 : { "__ndr_print_in__", (PyCFunction)py_Opnum58NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43590 : { "__ndr_print_out__", (PyCFunction)py_Opnum58NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43591 : { NULL, NULL, 0, NULL }
43592 : };
43593 :
43594 :
43595 : static PyTypeObject Opnum58NotUsedOnWire_Type = {
43596 : PyVarObject_HEAD_INIT(NULL, 0)
43597 : .tp_name = "svcctl.Opnum58NotUsedOnWire",
43598 : .tp_getset = py_Opnum58NotUsedOnWire_getsetters,
43599 : .tp_methods = py_Opnum58NotUsedOnWire_methods,
43600 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43601 : .tp_new = py_Opnum58NotUsedOnWire_new,
43602 : };
43603 :
43604 0 : static bool pack_py_Opnum58NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum58NotUsedOnWire *r)
43605 : {
43606 0 : const char *kwnames[] = {
43607 : NULL
43608 : };
43609 :
43610 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum58NotUsedOnWire", discard_const_p(char *, kwnames))) {
43611 0 : return false;
43612 : }
43613 :
43614 0 : return true;
43615 : }
43616 :
43617 0 : static PyObject *unpack_py_Opnum58NotUsedOnWire_args_out(struct Opnum58NotUsedOnWire *r)
43618 : {
43619 0 : PyObject *result;
43620 0 : result = Py_None;
43621 0 : Py_INCREF(result);
43622 0 : return result;
43623 : }
43624 :
43625 :
43626 : static PyGetSetDef py_Opnum59NotUsedOnWire_getsetters[] = {
43627 : { .name = NULL }
43628 : };
43629 :
43630 0 : static PyObject *py_Opnum59NotUsedOnWire_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43631 : {
43632 0 : PyObject *self = pytalloc_new(struct Opnum59NotUsedOnWire, type);
43633 0 : return self;
43634 : }
43635 :
43636 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43637 : {
43638 :
43639 :
43640 0 : return PyLong_FromLong(59);
43641 : }
43642 :
43643 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
43644 : {
43645 0 : const struct ndr_interface_call *call = NULL;
43646 0 : struct Opnum59NotUsedOnWire *object = (struct Opnum59NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43647 0 : PyObject *ret = NULL;
43648 0 : struct ndr_push *push = NULL;
43649 0 : DATA_BLOB blob;
43650 0 : enum ndr_err_code err;
43651 :
43652 0 : if (ndr_table_svcctl.num_calls < 60) {
43653 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum59NotUsedOnWire_ndr_pack");
43654 0 : return NULL;
43655 : }
43656 0 : call = &ndr_table_svcctl.calls[59];
43657 :
43658 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43659 0 : if (push == NULL) {
43660 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43661 0 : return NULL;
43662 : }
43663 :
43664 0 : push->flags |= ndr_push_flags;
43665 :
43666 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43667 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43668 0 : TALLOC_FREE(push);
43669 0 : PyErr_SetNdrError(err);
43670 0 : return NULL;
43671 : }
43672 0 : blob = ndr_push_blob(push);
43673 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43674 0 : TALLOC_FREE(push);
43675 0 : return ret;
43676 : }
43677 :
43678 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43679 : {
43680 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43681 0 : PyObject *bigendian_obj = NULL;
43682 0 : PyObject *ndr64_obj = NULL;
43683 0 : libndr_flags ndr_push_flags = 0;
43684 :
43685 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43686 : discard_const_p(char *, kwnames),
43687 : &bigendian_obj,
43688 : &ndr64_obj)) {
43689 0 : return NULL;
43690 : }
43691 :
43692 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43693 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43694 : }
43695 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43696 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43697 : }
43698 :
43699 0 : return py_Opnum59NotUsedOnWire_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43700 : }
43701 :
43702 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43703 : {
43704 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43705 0 : PyObject *bigendian_obj = NULL;
43706 0 : PyObject *ndr64_obj = NULL;
43707 0 : libndr_flags ndr_push_flags = 0;
43708 :
43709 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43710 : discard_const_p(char *, kwnames),
43711 : &bigendian_obj,
43712 : &ndr64_obj)) {
43713 0 : return NULL;
43714 : }
43715 :
43716 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43717 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43718 : }
43719 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43720 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43721 : }
43722 :
43723 0 : return py_Opnum59NotUsedOnWire_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43724 : }
43725 :
43726 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
43727 : {
43728 0 : const struct ndr_interface_call *call = NULL;
43729 0 : struct Opnum59NotUsedOnWire *object = (struct Opnum59NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43730 0 : struct ndr_pull *pull = NULL;
43731 0 : enum ndr_err_code err;
43732 :
43733 0 : if (ndr_table_svcctl.num_calls < 60) {
43734 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum59NotUsedOnWire_ndr_unpack");
43735 0 : return NULL;
43736 : }
43737 0 : call = &ndr_table_svcctl.calls[59];
43738 :
43739 0 : pull = ndr_pull_init_blob(blob, object);
43740 0 : if (pull == NULL) {
43741 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43742 0 : return NULL;
43743 : }
43744 :
43745 0 : pull->flags |= ndr_pull_flags;
43746 :
43747 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43748 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43749 0 : TALLOC_FREE(pull);
43750 0 : PyErr_SetNdrError(err);
43751 0 : return NULL;
43752 : }
43753 0 : if (!allow_remaining) {
43754 0 : uint32_t highest_ofs;
43755 :
43756 0 : if (pull->offset > pull->relative_highest_offset) {
43757 0 : highest_ofs = pull->offset;
43758 : } else {
43759 0 : highest_ofs = pull->relative_highest_offset;
43760 : }
43761 0 : if (highest_ofs < pull->data_size) {
43762 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43763 : "not all bytes consumed ofs[%u] size[%u]",
43764 : highest_ofs, pull->data_size);
43765 0 : TALLOC_FREE(pull);
43766 0 : PyErr_SetNdrError(err);
43767 0 : return NULL;
43768 : }
43769 : }
43770 :
43771 0 : TALLOC_FREE(pull);
43772 0 : Py_RETURN_NONE;
43773 : }
43774 :
43775 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43776 : {
43777 0 : DATA_BLOB blob;
43778 0 : Py_ssize_t blob_length = 0;
43779 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43780 0 : PyObject *bigendian_obj = NULL;
43781 0 : PyObject *ndr64_obj = NULL;
43782 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43783 0 : PyObject *allow_remaining_obj = NULL;
43784 0 : bool allow_remaining = false;
43785 :
43786 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43787 : discard_const_p(char *, kwnames),
43788 : &blob.data, &blob_length,
43789 : &bigendian_obj,
43790 : &ndr64_obj,
43791 : &allow_remaining_obj)) {
43792 0 : return NULL;
43793 : }
43794 0 : blob.length = blob_length;
43795 :
43796 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43797 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43798 : }
43799 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43800 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43801 : }
43802 :
43803 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43804 0 : allow_remaining = true;
43805 : }
43806 :
43807 0 : return py_Opnum59NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43808 : }
43809 :
43810 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43811 : {
43812 0 : DATA_BLOB blob;
43813 0 : Py_ssize_t blob_length = 0;
43814 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43815 0 : PyObject *bigendian_obj = NULL;
43816 0 : PyObject *ndr64_obj = NULL;
43817 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43818 0 : PyObject *allow_remaining_obj = NULL;
43819 0 : bool allow_remaining = false;
43820 :
43821 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43822 : discard_const_p(char *, kwnames),
43823 : &blob.data, &blob_length,
43824 : &bigendian_obj,
43825 : &ndr64_obj,
43826 : &allow_remaining_obj)) {
43827 0 : return NULL;
43828 : }
43829 0 : blob.length = blob_length;
43830 :
43831 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43832 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43833 : }
43834 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43835 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43836 : }
43837 :
43838 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43839 0 : allow_remaining = true;
43840 : }
43841 :
43842 0 : return py_Opnum59NotUsedOnWire_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43843 : }
43844 :
43845 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
43846 : {
43847 0 : const struct ndr_interface_call *call = NULL;
43848 0 : struct Opnum59NotUsedOnWire *object = (struct Opnum59NotUsedOnWire *)pytalloc_get_ptr(py_obj);
43849 0 : PyObject *ret;
43850 0 : char *retstr;
43851 :
43852 0 : if (ndr_table_svcctl.num_calls < 60) {
43853 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_Opnum59NotUsedOnWire_ndr_print");
43854 0 : return NULL;
43855 : }
43856 0 : call = &ndr_table_svcctl.calls[59];
43857 :
43858 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43859 0 : ret = PyUnicode_FromString(retstr);
43860 0 : TALLOC_FREE(retstr);
43861 :
43862 0 : return ret;
43863 : }
43864 :
43865 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43866 : {
43867 0 : return py_Opnum59NotUsedOnWire_ndr_print(py_obj, "Opnum59NotUsedOnWire_in", NDR_IN);
43868 : }
43869 :
43870 0 : static PyObject *py_Opnum59NotUsedOnWire_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43871 : {
43872 0 : return py_Opnum59NotUsedOnWire_ndr_print(py_obj, "Opnum59NotUsedOnWire_out", NDR_OUT);
43873 : }
43874 :
43875 : static PyMethodDef py_Opnum59NotUsedOnWire_methods[] = {
43876 : { "opnum", (PyCFunction)py_Opnum59NotUsedOnWire_ndr_opnum, METH_NOARGS|METH_CLASS,
43877 : "svcctl.Opnum59NotUsedOnWire.opnum() -> 59 (0x3b) " },
43878 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum59NotUsedOnWire_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43879 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43880 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum59NotUsedOnWire_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43881 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43882 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum59NotUsedOnWire_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43883 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43884 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_Opnum59NotUsedOnWire_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43885 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43886 : { "__ndr_print_in__", (PyCFunction)py_Opnum59NotUsedOnWire_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43887 : { "__ndr_print_out__", (PyCFunction)py_Opnum59NotUsedOnWire_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43888 : { NULL, NULL, 0, NULL }
43889 : };
43890 :
43891 :
43892 : static PyTypeObject Opnum59NotUsedOnWire_Type = {
43893 : PyVarObject_HEAD_INIT(NULL, 0)
43894 : .tp_name = "svcctl.Opnum59NotUsedOnWire",
43895 : .tp_getset = py_Opnum59NotUsedOnWire_getsetters,
43896 : .tp_methods = py_Opnum59NotUsedOnWire_methods,
43897 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43898 : .tp_new = py_Opnum59NotUsedOnWire_new,
43899 : };
43900 :
43901 0 : static bool pack_py_Opnum59NotUsedOnWire_args_in(PyObject *args, PyObject *kwargs, struct Opnum59NotUsedOnWire *r)
43902 : {
43903 0 : const char *kwnames[] = {
43904 : NULL
43905 : };
43906 :
43907 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":Opnum59NotUsedOnWire", discard_const_p(char *, kwnames))) {
43908 0 : return false;
43909 : }
43910 :
43911 0 : return true;
43912 : }
43913 :
43914 0 : static PyObject *unpack_py_Opnum59NotUsedOnWire_args_out(struct Opnum59NotUsedOnWire *r)
43915 : {
43916 0 : PyObject *result;
43917 0 : result = Py_None;
43918 0 : Py_INCREF(result);
43919 0 : return result;
43920 : }
43921 :
43922 :
43923 0 : static PyObject *py_svcctl_CreateWowService_in_get_hSCManager(PyObject *obj, void *closure)
43924 : {
43925 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
43926 0 : PyObject *py_hSCManager;
43927 0 : py_hSCManager = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hSCManager);
43928 0 : return py_hSCManager;
43929 : }
43930 :
43931 0 : static int py_svcctl_CreateWowService_in_set_hSCManager(PyObject *py_obj, PyObject *value, void *closure)
43932 : {
43933 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
43934 0 : if (value == NULL) {
43935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hSCManager");
43936 0 : return -1;
43937 : }
43938 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
43939 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43940 0 : PyErr_NoMemory();
43941 0 : return -1;
43942 : }
43943 0 : object->in.hSCManager = *(struct policy_handle *)pytalloc_get_ptr(value);
43944 0 : return 0;
43945 : }
43946 :
43947 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpServiceName(PyObject *obj, void *closure)
43948 : {
43949 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
43950 0 : PyObject *py_lpServiceName;
43951 0 : if (object->in.lpServiceName == NULL) {
43952 0 : Py_RETURN_NONE;
43953 : }
43954 0 : if (object->in.lpServiceName == NULL) {
43955 0 : py_lpServiceName = Py_None;
43956 0 : Py_INCREF(py_lpServiceName);
43957 : } else {
43958 0 : py_lpServiceName = PyUnicode_Decode(object->in.lpServiceName, strlen(object->in.lpServiceName), "utf-8", "ignore");
43959 : }
43960 0 : return py_lpServiceName;
43961 : }
43962 :
43963 0 : static int py_svcctl_CreateWowService_in_set_lpServiceName(PyObject *py_obj, PyObject *value, void *closure)
43964 : {
43965 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
43966 0 : if (value == NULL) {
43967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpServiceName");
43968 0 : return -1;
43969 : }
43970 0 : object->in.lpServiceName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpServiceName);
43971 0 : if (object->in.lpServiceName == NULL) {
43972 0 : PyErr_NoMemory();
43973 0 : return -1;
43974 : }
43975 : {
43976 0 : const char *test_str;
43977 0 : const char *talloc_str;
43978 0 : PyObject *unicode = NULL;
43979 0 : if (PyUnicode_Check(value)) {
43980 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
43981 0 : if (unicode == NULL) {
43982 0 : return -1;
43983 : }
43984 0 : test_str = PyBytes_AS_STRING(unicode);
43985 0 : } else if (PyBytes_Check(value)) {
43986 0 : test_str = PyBytes_AS_STRING(value);
43987 : } else {
43988 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
43989 0 : return -1;
43990 : }
43991 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
43992 0 : if (unicode != NULL) {
43993 0 : Py_DECREF(unicode);
43994 : }
43995 0 : if (talloc_str == NULL) {
43996 0 : PyErr_NoMemory();
43997 0 : return -1;
43998 : }
43999 0 : object->in.lpServiceName = talloc_str;
44000 : }
44001 0 : return 0;
44002 : }
44003 :
44004 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpDisplayName(PyObject *obj, void *closure)
44005 : {
44006 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44007 0 : PyObject *py_lpDisplayName;
44008 0 : if (object->in.lpDisplayName == NULL) {
44009 0 : Py_RETURN_NONE;
44010 : }
44011 0 : if (object->in.lpDisplayName == NULL) {
44012 0 : py_lpDisplayName = Py_None;
44013 0 : Py_INCREF(py_lpDisplayName);
44014 : } else {
44015 0 : if (object->in.lpDisplayName == NULL) {
44016 0 : py_lpDisplayName = Py_None;
44017 0 : Py_INCREF(py_lpDisplayName);
44018 : } else {
44019 0 : py_lpDisplayName = PyUnicode_Decode(object->in.lpDisplayName, strlen(object->in.lpDisplayName), "utf-8", "ignore");
44020 : }
44021 : }
44022 0 : return py_lpDisplayName;
44023 : }
44024 :
44025 0 : static int py_svcctl_CreateWowService_in_set_lpDisplayName(PyObject *py_obj, PyObject *value, void *closure)
44026 : {
44027 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44028 0 : if (value == NULL) {
44029 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDisplayName");
44030 0 : return -1;
44031 : }
44032 0 : if (value == Py_None) {
44033 0 : object->in.lpDisplayName = NULL;
44034 : } else {
44035 0 : object->in.lpDisplayName = NULL;
44036 : {
44037 0 : const char *test_str;
44038 0 : const char *talloc_str;
44039 0 : PyObject *unicode = NULL;
44040 0 : if (PyUnicode_Check(value)) {
44041 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
44042 0 : if (unicode == NULL) {
44043 0 : return -1;
44044 : }
44045 0 : test_str = PyBytes_AS_STRING(unicode);
44046 0 : } else if (PyBytes_Check(value)) {
44047 0 : test_str = PyBytes_AS_STRING(value);
44048 : } else {
44049 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
44050 0 : return -1;
44051 : }
44052 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
44053 0 : if (unicode != NULL) {
44054 0 : Py_DECREF(unicode);
44055 : }
44056 0 : if (talloc_str == NULL) {
44057 0 : PyErr_NoMemory();
44058 0 : return -1;
44059 : }
44060 0 : object->in.lpDisplayName = talloc_str;
44061 : }
44062 : }
44063 0 : return 0;
44064 : }
44065 :
44066 0 : static PyObject *py_svcctl_CreateWowService_in_get_dwDesiredAccess(PyObject *obj, void *closure)
44067 : {
44068 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44069 0 : PyObject *py_dwDesiredAccess;
44070 0 : py_dwDesiredAccess = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDesiredAccess);
44071 0 : return py_dwDesiredAccess;
44072 : }
44073 :
44074 0 : static int py_svcctl_CreateWowService_in_set_dwDesiredAccess(PyObject *py_obj, PyObject *value, void *closure)
44075 : {
44076 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44077 0 : if (value == NULL) {
44078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDesiredAccess");
44079 0 : return -1;
44080 : }
44081 : {
44082 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDesiredAccess));
44083 0 : if (PyLong_Check(value)) {
44084 0 : unsigned long long test_var;
44085 0 : test_var = PyLong_AsUnsignedLongLong(value);
44086 0 : if (PyErr_Occurred() != NULL) {
44087 0 : return -1;
44088 : }
44089 0 : if (test_var > uint_max) {
44090 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44091 : PyLong_Type.tp_name, uint_max, test_var);
44092 0 : return -1;
44093 : }
44094 0 : object->in.dwDesiredAccess = test_var;
44095 : } else {
44096 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44097 : PyLong_Type.tp_name);
44098 0 : return -1;
44099 : }
44100 : }
44101 0 : return 0;
44102 : }
44103 :
44104 0 : static PyObject *py_svcctl_CreateWowService_in_get_dwServiceType(PyObject *obj, void *closure)
44105 : {
44106 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44107 0 : PyObject *py_dwServiceType;
44108 0 : py_dwServiceType = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwServiceType);
44109 0 : return py_dwServiceType;
44110 : }
44111 :
44112 0 : static int py_svcctl_CreateWowService_in_set_dwServiceType(PyObject *py_obj, PyObject *value, void *closure)
44113 : {
44114 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44115 0 : if (value == NULL) {
44116 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwServiceType");
44117 0 : return -1;
44118 : }
44119 : {
44120 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwServiceType));
44121 0 : if (PyLong_Check(value)) {
44122 0 : unsigned long long test_var;
44123 0 : test_var = PyLong_AsUnsignedLongLong(value);
44124 0 : if (PyErr_Occurred() != NULL) {
44125 0 : return -1;
44126 : }
44127 0 : if (test_var > uint_max) {
44128 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44129 : PyLong_Type.tp_name, uint_max, test_var);
44130 0 : return -1;
44131 : }
44132 0 : object->in.dwServiceType = test_var;
44133 : } else {
44134 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44135 : PyLong_Type.tp_name);
44136 0 : return -1;
44137 : }
44138 : }
44139 0 : return 0;
44140 : }
44141 :
44142 0 : static PyObject *py_svcctl_CreateWowService_in_get_dwStartType(PyObject *obj, void *closure)
44143 : {
44144 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44145 0 : PyObject *py_dwStartType;
44146 0 : py_dwStartType = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwStartType);
44147 0 : return py_dwStartType;
44148 : }
44149 :
44150 0 : static int py_svcctl_CreateWowService_in_set_dwStartType(PyObject *py_obj, PyObject *value, void *closure)
44151 : {
44152 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44153 0 : if (value == NULL) {
44154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwStartType");
44155 0 : return -1;
44156 : }
44157 : {
44158 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwStartType));
44159 0 : if (PyLong_Check(value)) {
44160 0 : unsigned long long test_var;
44161 0 : test_var = PyLong_AsUnsignedLongLong(value);
44162 0 : if (PyErr_Occurred() != NULL) {
44163 0 : return -1;
44164 : }
44165 0 : if (test_var > uint_max) {
44166 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44167 : PyLong_Type.tp_name, uint_max, test_var);
44168 0 : return -1;
44169 : }
44170 0 : object->in.dwStartType = test_var;
44171 : } else {
44172 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44173 : PyLong_Type.tp_name);
44174 0 : return -1;
44175 : }
44176 : }
44177 0 : return 0;
44178 : }
44179 :
44180 0 : static PyObject *py_svcctl_CreateWowService_in_get_dwErrorControl(PyObject *obj, void *closure)
44181 : {
44182 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44183 0 : PyObject *py_dwErrorControl;
44184 0 : py_dwErrorControl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwErrorControl);
44185 0 : return py_dwErrorControl;
44186 : }
44187 :
44188 0 : static int py_svcctl_CreateWowService_in_set_dwErrorControl(PyObject *py_obj, PyObject *value, void *closure)
44189 : {
44190 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44191 0 : if (value == NULL) {
44192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwErrorControl");
44193 0 : return -1;
44194 : }
44195 : {
44196 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwErrorControl));
44197 0 : if (PyLong_Check(value)) {
44198 0 : unsigned long long test_var;
44199 0 : test_var = PyLong_AsUnsignedLongLong(value);
44200 0 : if (PyErr_Occurred() != NULL) {
44201 0 : return -1;
44202 : }
44203 0 : if (test_var > uint_max) {
44204 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44205 : PyLong_Type.tp_name, uint_max, test_var);
44206 0 : return -1;
44207 : }
44208 0 : object->in.dwErrorControl = test_var;
44209 : } else {
44210 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44211 : PyLong_Type.tp_name);
44212 0 : return -1;
44213 : }
44214 : }
44215 0 : return 0;
44216 : }
44217 :
44218 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpBinaryPathName(PyObject *obj, void *closure)
44219 : {
44220 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44221 0 : PyObject *py_lpBinaryPathName;
44222 0 : if (object->in.lpBinaryPathName == NULL) {
44223 0 : Py_RETURN_NONE;
44224 : }
44225 0 : if (object->in.lpBinaryPathName == NULL) {
44226 0 : py_lpBinaryPathName = Py_None;
44227 0 : Py_INCREF(py_lpBinaryPathName);
44228 : } else {
44229 0 : py_lpBinaryPathName = PyUnicode_Decode(object->in.lpBinaryPathName, strlen(object->in.lpBinaryPathName), "utf-8", "ignore");
44230 : }
44231 0 : return py_lpBinaryPathName;
44232 : }
44233 :
44234 0 : static int py_svcctl_CreateWowService_in_set_lpBinaryPathName(PyObject *py_obj, PyObject *value, void *closure)
44235 : {
44236 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44237 0 : if (value == NULL) {
44238 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpBinaryPathName");
44239 0 : return -1;
44240 : }
44241 0 : object->in.lpBinaryPathName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpBinaryPathName);
44242 0 : if (object->in.lpBinaryPathName == NULL) {
44243 0 : PyErr_NoMemory();
44244 0 : return -1;
44245 : }
44246 : {
44247 0 : const char *test_str;
44248 0 : const char *talloc_str;
44249 0 : PyObject *unicode = NULL;
44250 0 : if (PyUnicode_Check(value)) {
44251 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
44252 0 : if (unicode == NULL) {
44253 0 : return -1;
44254 : }
44255 0 : test_str = PyBytes_AS_STRING(unicode);
44256 0 : } else if (PyBytes_Check(value)) {
44257 0 : test_str = PyBytes_AS_STRING(value);
44258 : } else {
44259 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
44260 0 : return -1;
44261 : }
44262 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
44263 0 : if (unicode != NULL) {
44264 0 : Py_DECREF(unicode);
44265 : }
44266 0 : if (talloc_str == NULL) {
44267 0 : PyErr_NoMemory();
44268 0 : return -1;
44269 : }
44270 0 : object->in.lpBinaryPathName = talloc_str;
44271 : }
44272 0 : return 0;
44273 : }
44274 :
44275 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpLoadOrderGroup(PyObject *obj, void *closure)
44276 : {
44277 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44278 0 : PyObject *py_lpLoadOrderGroup;
44279 0 : if (object->in.lpLoadOrderGroup == NULL) {
44280 0 : Py_RETURN_NONE;
44281 : }
44282 0 : if (object->in.lpLoadOrderGroup == NULL) {
44283 0 : py_lpLoadOrderGroup = Py_None;
44284 0 : Py_INCREF(py_lpLoadOrderGroup);
44285 : } else {
44286 0 : if (object->in.lpLoadOrderGroup == NULL) {
44287 0 : py_lpLoadOrderGroup = Py_None;
44288 0 : Py_INCREF(py_lpLoadOrderGroup);
44289 : } else {
44290 0 : py_lpLoadOrderGroup = PyUnicode_Decode(object->in.lpLoadOrderGroup, strlen(object->in.lpLoadOrderGroup), "utf-8", "ignore");
44291 : }
44292 : }
44293 0 : return py_lpLoadOrderGroup;
44294 : }
44295 :
44296 0 : static int py_svcctl_CreateWowService_in_set_lpLoadOrderGroup(PyObject *py_obj, PyObject *value, void *closure)
44297 : {
44298 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44299 0 : if (value == NULL) {
44300 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpLoadOrderGroup");
44301 0 : return -1;
44302 : }
44303 0 : if (value == Py_None) {
44304 0 : object->in.lpLoadOrderGroup = NULL;
44305 : } else {
44306 0 : object->in.lpLoadOrderGroup = NULL;
44307 : {
44308 0 : const char *test_str;
44309 0 : const char *talloc_str;
44310 0 : PyObject *unicode = NULL;
44311 0 : if (PyUnicode_Check(value)) {
44312 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
44313 0 : if (unicode == NULL) {
44314 0 : return -1;
44315 : }
44316 0 : test_str = PyBytes_AS_STRING(unicode);
44317 0 : } else if (PyBytes_Check(value)) {
44318 0 : test_str = PyBytes_AS_STRING(value);
44319 : } else {
44320 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
44321 0 : return -1;
44322 : }
44323 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
44324 0 : if (unicode != NULL) {
44325 0 : Py_DECREF(unicode);
44326 : }
44327 0 : if (talloc_str == NULL) {
44328 0 : PyErr_NoMemory();
44329 0 : return -1;
44330 : }
44331 0 : object->in.lpLoadOrderGroup = talloc_str;
44332 : }
44333 : }
44334 0 : return 0;
44335 : }
44336 :
44337 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpdwTagId(PyObject *obj, void *closure)
44338 : {
44339 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44340 0 : PyObject *py_lpdwTagId;
44341 0 : if (object->in.lpdwTagId == NULL) {
44342 0 : Py_RETURN_NONE;
44343 : }
44344 0 : if (object->in.lpdwTagId == NULL) {
44345 0 : py_lpdwTagId = Py_None;
44346 0 : Py_INCREF(py_lpdwTagId);
44347 : } else {
44348 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*object->in.lpdwTagId);
44349 : }
44350 0 : return py_lpdwTagId;
44351 : }
44352 :
44353 0 : static int py_svcctl_CreateWowService_in_set_lpdwTagId(PyObject *py_obj, PyObject *value, void *closure)
44354 : {
44355 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44356 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpdwTagId));
44357 0 : if (value == NULL) {
44358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpdwTagId");
44359 0 : return -1;
44360 : }
44361 0 : if (value == Py_None) {
44362 0 : object->in.lpdwTagId = NULL;
44363 : } else {
44364 0 : object->in.lpdwTagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpdwTagId);
44365 0 : if (object->in.lpdwTagId == NULL) {
44366 0 : PyErr_NoMemory();
44367 0 : return -1;
44368 : }
44369 : {
44370 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.lpdwTagId));
44371 0 : if (PyLong_Check(value)) {
44372 0 : unsigned long long test_var;
44373 0 : test_var = PyLong_AsUnsignedLongLong(value);
44374 0 : if (PyErr_Occurred() != NULL) {
44375 0 : return -1;
44376 : }
44377 0 : if (test_var > uint_max) {
44378 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44379 : PyLong_Type.tp_name, uint_max, test_var);
44380 0 : return -1;
44381 : }
44382 0 : *object->in.lpdwTagId = test_var;
44383 : } else {
44384 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44385 : PyLong_Type.tp_name);
44386 0 : return -1;
44387 : }
44388 : }
44389 : }
44390 0 : return 0;
44391 : }
44392 :
44393 0 : static PyObject *py_svcctl_CreateWowService_out_get_lpdwTagId(PyObject *obj, void *closure)
44394 : {
44395 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44396 0 : PyObject *py_lpdwTagId;
44397 0 : if (object->out.lpdwTagId == NULL) {
44398 0 : Py_RETURN_NONE;
44399 : }
44400 0 : if (object->out.lpdwTagId == NULL) {
44401 0 : py_lpdwTagId = Py_None;
44402 0 : Py_INCREF(py_lpdwTagId);
44403 : } else {
44404 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.lpdwTagId);
44405 : }
44406 0 : return py_lpdwTagId;
44407 : }
44408 :
44409 0 : static int py_svcctl_CreateWowService_out_set_lpdwTagId(PyObject *py_obj, PyObject *value, void *closure)
44410 : {
44411 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44412 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lpdwTagId));
44413 0 : if (value == NULL) {
44414 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lpdwTagId");
44415 0 : return -1;
44416 : }
44417 0 : if (value == Py_None) {
44418 0 : object->out.lpdwTagId = NULL;
44419 : } else {
44420 0 : object->out.lpdwTagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lpdwTagId);
44421 0 : if (object->out.lpdwTagId == NULL) {
44422 0 : PyErr_NoMemory();
44423 0 : return -1;
44424 : }
44425 : {
44426 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.lpdwTagId));
44427 0 : if (PyLong_Check(value)) {
44428 0 : unsigned long long test_var;
44429 0 : test_var = PyLong_AsUnsignedLongLong(value);
44430 0 : if (PyErr_Occurred() != NULL) {
44431 0 : return -1;
44432 : }
44433 0 : if (test_var > uint_max) {
44434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44435 : PyLong_Type.tp_name, uint_max, test_var);
44436 0 : return -1;
44437 : }
44438 0 : *object->out.lpdwTagId = test_var;
44439 : } else {
44440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44441 : PyLong_Type.tp_name);
44442 0 : return -1;
44443 : }
44444 : }
44445 : }
44446 0 : return 0;
44447 : }
44448 :
44449 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpDependencies(PyObject *obj, void *closure)
44450 : {
44451 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44452 0 : PyObject *py_lpDependencies;
44453 0 : if (object->in.lpDependencies == NULL) {
44454 0 : Py_RETURN_NONE;
44455 : }
44456 0 : if (object->in.lpDependencies == NULL) {
44457 0 : py_lpDependencies = Py_None;
44458 0 : Py_INCREF(py_lpDependencies);
44459 : } else {
44460 0 : py_lpDependencies = PyList_New(object->in.dwDependSize);
44461 0 : if (py_lpDependencies == NULL) {
44462 0 : return NULL;
44463 : }
44464 : {
44465 : int lpDependencies_cntr_1;
44466 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < (object->in.dwDependSize); lpDependencies_cntr_1++) {
44467 0 : PyObject *py_lpDependencies_1;
44468 0 : py_lpDependencies_1 = PyLong_FromLong((uint16_t)object->in.lpDependencies[lpDependencies_cntr_1]);
44469 0 : PyList_SetItem(py_lpDependencies, lpDependencies_cntr_1, py_lpDependencies_1);
44470 : }
44471 : }
44472 : }
44473 0 : return py_lpDependencies;
44474 : }
44475 :
44476 0 : static int py_svcctl_CreateWowService_in_set_lpDependencies(PyObject *py_obj, PyObject *value, void *closure)
44477 : {
44478 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44479 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpDependencies));
44480 0 : if (value == NULL) {
44481 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDependencies");
44482 0 : return -1;
44483 : }
44484 0 : if (value == Py_None) {
44485 0 : object->in.lpDependencies = NULL;
44486 : } else {
44487 0 : object->in.lpDependencies = NULL;
44488 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
44489 : {
44490 0 : int lpDependencies_cntr_1;
44491 0 : object->in.lpDependencies = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpDependencies, PyList_GET_SIZE(value));
44492 0 : if (!object->in.lpDependencies) { return -1; }
44493 0 : talloc_set_name_const(object->in.lpDependencies, "ARRAY: object->in.lpDependencies");
44494 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < PyList_GET_SIZE(value); lpDependencies_cntr_1++) {
44495 0 : if (PyList_GET_ITEM(value, lpDependencies_cntr_1) == NULL) {
44496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpDependencies[lpDependencies_cntr_1]");
44497 0 : return -1;
44498 : }
44499 : {
44500 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lpDependencies[lpDependencies_cntr_1]));
44501 0 : if (PyLong_Check(PyList_GET_ITEM(value, lpDependencies_cntr_1))) {
44502 0 : unsigned long long test_var;
44503 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lpDependencies_cntr_1));
44504 0 : if (PyErr_Occurred() != NULL) {
44505 0 : return -1;
44506 : }
44507 0 : if (test_var > uint_max) {
44508 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44509 : PyLong_Type.tp_name, uint_max, test_var);
44510 0 : return -1;
44511 : }
44512 0 : object->in.lpDependencies[lpDependencies_cntr_1] = test_var;
44513 : } else {
44514 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44515 : PyLong_Type.tp_name);
44516 0 : return -1;
44517 : }
44518 : }
44519 : }
44520 : }
44521 : }
44522 0 : return 0;
44523 : }
44524 :
44525 0 : static PyObject *py_svcctl_CreateWowService_in_get_dwDependSize(PyObject *obj, void *closure)
44526 : {
44527 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44528 0 : PyObject *py_dwDependSize;
44529 0 : py_dwDependSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDependSize);
44530 0 : return py_dwDependSize;
44531 : }
44532 :
44533 0 : static int py_svcctl_CreateWowService_in_set_dwDependSize(PyObject *py_obj, PyObject *value, void *closure)
44534 : {
44535 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44536 0 : if (value == NULL) {
44537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDependSize");
44538 0 : return -1;
44539 : }
44540 : {
44541 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDependSize));
44542 0 : if (PyLong_Check(value)) {
44543 0 : unsigned long long test_var;
44544 0 : test_var = PyLong_AsUnsignedLongLong(value);
44545 0 : if (PyErr_Occurred() != NULL) {
44546 0 : return -1;
44547 : }
44548 0 : if (test_var > uint_max) {
44549 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44550 : PyLong_Type.tp_name, uint_max, test_var);
44551 0 : return -1;
44552 : }
44553 0 : object->in.dwDependSize = test_var;
44554 : } else {
44555 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44556 : PyLong_Type.tp_name);
44557 0 : return -1;
44558 : }
44559 : }
44560 0 : return 0;
44561 : }
44562 :
44563 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpServiceStartName(PyObject *obj, void *closure)
44564 : {
44565 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44566 0 : PyObject *py_lpServiceStartName;
44567 0 : if (object->in.lpServiceStartName == NULL) {
44568 0 : Py_RETURN_NONE;
44569 : }
44570 0 : if (object->in.lpServiceStartName == NULL) {
44571 0 : py_lpServiceStartName = Py_None;
44572 0 : Py_INCREF(py_lpServiceStartName);
44573 : } else {
44574 0 : if (object->in.lpServiceStartName == NULL) {
44575 0 : py_lpServiceStartName = Py_None;
44576 0 : Py_INCREF(py_lpServiceStartName);
44577 : } else {
44578 0 : py_lpServiceStartName = PyUnicode_Decode(object->in.lpServiceStartName, strlen(object->in.lpServiceStartName), "utf-8", "ignore");
44579 : }
44580 : }
44581 0 : return py_lpServiceStartName;
44582 : }
44583 :
44584 0 : static int py_svcctl_CreateWowService_in_set_lpServiceStartName(PyObject *py_obj, PyObject *value, void *closure)
44585 : {
44586 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44587 0 : if (value == NULL) {
44588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpServiceStartName");
44589 0 : return -1;
44590 : }
44591 0 : if (value == Py_None) {
44592 0 : object->in.lpServiceStartName = NULL;
44593 : } else {
44594 0 : object->in.lpServiceStartName = NULL;
44595 : {
44596 0 : const char *test_str;
44597 0 : const char *talloc_str;
44598 0 : PyObject *unicode = NULL;
44599 0 : if (PyUnicode_Check(value)) {
44600 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
44601 0 : if (unicode == NULL) {
44602 0 : return -1;
44603 : }
44604 0 : test_str = PyBytes_AS_STRING(unicode);
44605 0 : } else if (PyBytes_Check(value)) {
44606 0 : test_str = PyBytes_AS_STRING(value);
44607 : } else {
44608 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
44609 0 : return -1;
44610 : }
44611 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
44612 0 : if (unicode != NULL) {
44613 0 : Py_DECREF(unicode);
44614 : }
44615 0 : if (talloc_str == NULL) {
44616 0 : PyErr_NoMemory();
44617 0 : return -1;
44618 : }
44619 0 : object->in.lpServiceStartName = talloc_str;
44620 : }
44621 : }
44622 0 : return 0;
44623 : }
44624 :
44625 0 : static PyObject *py_svcctl_CreateWowService_in_get_lpPassword(PyObject *obj, void *closure)
44626 : {
44627 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44628 0 : PyObject *py_lpPassword;
44629 0 : if (object->in.lpPassword == NULL) {
44630 0 : Py_RETURN_NONE;
44631 : }
44632 0 : if (object->in.lpPassword == NULL) {
44633 0 : py_lpPassword = Py_None;
44634 0 : Py_INCREF(py_lpPassword);
44635 : } else {
44636 0 : py_lpPassword = PyList_New(object->in.dwPwSize);
44637 0 : if (py_lpPassword == NULL) {
44638 0 : return NULL;
44639 : }
44640 : {
44641 : int lpPassword_cntr_1;
44642 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < (object->in.dwPwSize); lpPassword_cntr_1++) {
44643 0 : PyObject *py_lpPassword_1;
44644 0 : py_lpPassword_1 = PyLong_FromLong((uint16_t)object->in.lpPassword[lpPassword_cntr_1]);
44645 0 : PyList_SetItem(py_lpPassword, lpPassword_cntr_1, py_lpPassword_1);
44646 : }
44647 : }
44648 : }
44649 0 : return py_lpPassword;
44650 : }
44651 :
44652 0 : static int py_svcctl_CreateWowService_in_set_lpPassword(PyObject *py_obj, PyObject *value, void *closure)
44653 : {
44654 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44655 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lpPassword));
44656 0 : if (value == NULL) {
44657 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpPassword");
44658 0 : return -1;
44659 : }
44660 0 : if (value == Py_None) {
44661 0 : object->in.lpPassword = NULL;
44662 : } else {
44663 0 : object->in.lpPassword = NULL;
44664 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
44665 : {
44666 0 : int lpPassword_cntr_1;
44667 0 : object->in.lpPassword = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lpPassword, PyList_GET_SIZE(value));
44668 0 : if (!object->in.lpPassword) { return -1; }
44669 0 : talloc_set_name_const(object->in.lpPassword, "ARRAY: object->in.lpPassword");
44670 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < PyList_GET_SIZE(value); lpPassword_cntr_1++) {
44671 0 : if (PyList_GET_ITEM(value, lpPassword_cntr_1) == NULL) {
44672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lpPassword[lpPassword_cntr_1]");
44673 0 : return -1;
44674 : }
44675 : {
44676 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lpPassword[lpPassword_cntr_1]));
44677 0 : if (PyLong_Check(PyList_GET_ITEM(value, lpPassword_cntr_1))) {
44678 0 : unsigned long long test_var;
44679 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lpPassword_cntr_1));
44680 0 : if (PyErr_Occurred() != NULL) {
44681 0 : return -1;
44682 : }
44683 0 : if (test_var > uint_max) {
44684 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44685 : PyLong_Type.tp_name, uint_max, test_var);
44686 0 : return -1;
44687 : }
44688 0 : object->in.lpPassword[lpPassword_cntr_1] = test_var;
44689 : } else {
44690 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44691 : PyLong_Type.tp_name);
44692 0 : return -1;
44693 : }
44694 : }
44695 : }
44696 : }
44697 : }
44698 0 : return 0;
44699 : }
44700 :
44701 0 : static PyObject *py_svcctl_CreateWowService_in_get_dwPwSize(PyObject *obj, void *closure)
44702 : {
44703 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44704 0 : PyObject *py_dwPwSize;
44705 0 : py_dwPwSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwPwSize);
44706 0 : return py_dwPwSize;
44707 : }
44708 :
44709 0 : static int py_svcctl_CreateWowService_in_set_dwPwSize(PyObject *py_obj, PyObject *value, void *closure)
44710 : {
44711 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44712 0 : if (value == NULL) {
44713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwPwSize");
44714 0 : return -1;
44715 : }
44716 : {
44717 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwPwSize));
44718 0 : if (PyLong_Check(value)) {
44719 0 : unsigned long long test_var;
44720 0 : test_var = PyLong_AsUnsignedLongLong(value);
44721 0 : if (PyErr_Occurred() != NULL) {
44722 0 : return -1;
44723 : }
44724 0 : if (test_var > uint_max) {
44725 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44726 : PyLong_Type.tp_name, uint_max, test_var);
44727 0 : return -1;
44728 : }
44729 0 : object->in.dwPwSize = test_var;
44730 : } else {
44731 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44732 : PyLong_Type.tp_name);
44733 0 : return -1;
44734 : }
44735 : }
44736 0 : return 0;
44737 : }
44738 :
44739 0 : static PyObject *py_svcctl_CreateWowService_in_get_dwServiceWowType(PyObject *obj, void *closure)
44740 : {
44741 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44742 0 : PyObject *py_dwServiceWowType;
44743 0 : py_dwServiceWowType = PyLong_FromLong((uint16_t)object->in.dwServiceWowType);
44744 0 : return py_dwServiceWowType;
44745 : }
44746 :
44747 0 : static int py_svcctl_CreateWowService_in_set_dwServiceWowType(PyObject *py_obj, PyObject *value, void *closure)
44748 : {
44749 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44750 0 : if (value == NULL) {
44751 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwServiceWowType");
44752 0 : return -1;
44753 : }
44754 : {
44755 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwServiceWowType));
44756 0 : if (PyLong_Check(value)) {
44757 0 : unsigned long long test_var;
44758 0 : test_var = PyLong_AsUnsignedLongLong(value);
44759 0 : if (PyErr_Occurred() != NULL) {
44760 0 : return -1;
44761 : }
44762 0 : if (test_var > uint_max) {
44763 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44764 : PyLong_Type.tp_name, uint_max, test_var);
44765 0 : return -1;
44766 : }
44767 0 : object->in.dwServiceWowType = test_var;
44768 : } else {
44769 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44770 : PyLong_Type.tp_name);
44771 0 : return -1;
44772 : }
44773 : }
44774 0 : return 0;
44775 : }
44776 :
44777 0 : static PyObject *py_svcctl_CreateWowService_out_get_lpServiceHandle(PyObject *obj, void *closure)
44778 : {
44779 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44780 0 : PyObject *py_lpServiceHandle;
44781 0 : if (object->out.lpServiceHandle == NULL) {
44782 0 : Py_RETURN_NONE;
44783 : }
44784 0 : py_lpServiceHandle = pytalloc_reference_ex(policy_handle_Type, object->out.lpServiceHandle, object->out.lpServiceHandle);
44785 0 : return py_lpServiceHandle;
44786 : }
44787 :
44788 0 : static int py_svcctl_CreateWowService_out_set_lpServiceHandle(PyObject *py_obj, PyObject *value, void *closure)
44789 : {
44790 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44791 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lpServiceHandle));
44792 0 : if (value == NULL) {
44793 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lpServiceHandle");
44794 0 : return -1;
44795 : }
44796 0 : object->out.lpServiceHandle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lpServiceHandle);
44797 0 : if (object->out.lpServiceHandle == NULL) {
44798 0 : PyErr_NoMemory();
44799 0 : return -1;
44800 : }
44801 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
44802 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44803 0 : PyErr_NoMemory();
44804 0 : return -1;
44805 : }
44806 0 : object->out.lpServiceHandle = (struct policy_handle *)pytalloc_get_ptr(value);
44807 0 : return 0;
44808 : }
44809 :
44810 0 : static PyObject *py_svcctl_CreateWowService_get_result(PyObject *obj, void *closure)
44811 : {
44812 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(obj);
44813 0 : PyObject *py_result;
44814 0 : py_result = PyErr_FromWERROR(object->out.result);
44815 0 : return py_result;
44816 : }
44817 :
44818 0 : static int py_svcctl_CreateWowService_set_result(PyObject *py_obj, PyObject *value, void *closure)
44819 : {
44820 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44821 0 : if (value == NULL) {
44822 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44823 0 : return -1;
44824 : }
44825 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
44826 0 : return 0;
44827 : }
44828 :
44829 : static PyGetSetDef py_svcctl_CreateWowService_getsetters[] = {
44830 : {
44831 : .name = discard_const_p(char, "in_hSCManager"),
44832 : .get = py_svcctl_CreateWowService_in_get_hSCManager,
44833 : .set = py_svcctl_CreateWowService_in_set_hSCManager,
44834 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44835 : },
44836 : {
44837 : .name = discard_const_p(char, "in_lpServiceName"),
44838 : .get = py_svcctl_CreateWowService_in_get_lpServiceName,
44839 : .set = py_svcctl_CreateWowService_in_set_lpServiceName,
44840 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44841 : },
44842 : {
44843 : .name = discard_const_p(char, "in_lpDisplayName"),
44844 : .get = py_svcctl_CreateWowService_in_get_lpDisplayName,
44845 : .set = py_svcctl_CreateWowService_in_set_lpDisplayName,
44846 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44847 : },
44848 : {
44849 : .name = discard_const_p(char, "in_dwDesiredAccess"),
44850 : .get = py_svcctl_CreateWowService_in_get_dwDesiredAccess,
44851 : .set = py_svcctl_CreateWowService_in_set_dwDesiredAccess,
44852 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44853 : },
44854 : {
44855 : .name = discard_const_p(char, "in_dwServiceType"),
44856 : .get = py_svcctl_CreateWowService_in_get_dwServiceType,
44857 : .set = py_svcctl_CreateWowService_in_set_dwServiceType,
44858 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44859 : },
44860 : {
44861 : .name = discard_const_p(char, "in_dwStartType"),
44862 : .get = py_svcctl_CreateWowService_in_get_dwStartType,
44863 : .set = py_svcctl_CreateWowService_in_set_dwStartType,
44864 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44865 : },
44866 : {
44867 : .name = discard_const_p(char, "in_dwErrorControl"),
44868 : .get = py_svcctl_CreateWowService_in_get_dwErrorControl,
44869 : .set = py_svcctl_CreateWowService_in_set_dwErrorControl,
44870 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44871 : },
44872 : {
44873 : .name = discard_const_p(char, "in_lpBinaryPathName"),
44874 : .get = py_svcctl_CreateWowService_in_get_lpBinaryPathName,
44875 : .set = py_svcctl_CreateWowService_in_set_lpBinaryPathName,
44876 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44877 : },
44878 : {
44879 : .name = discard_const_p(char, "in_lpLoadOrderGroup"),
44880 : .get = py_svcctl_CreateWowService_in_get_lpLoadOrderGroup,
44881 : .set = py_svcctl_CreateWowService_in_set_lpLoadOrderGroup,
44882 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44883 : },
44884 : {
44885 : .name = discard_const_p(char, "in_lpdwTagId"),
44886 : .get = py_svcctl_CreateWowService_in_get_lpdwTagId,
44887 : .set = py_svcctl_CreateWowService_in_set_lpdwTagId,
44888 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44889 : },
44890 : {
44891 : .name = discard_const_p(char, "out_lpdwTagId"),
44892 : .get = py_svcctl_CreateWowService_out_get_lpdwTagId,
44893 : .set = py_svcctl_CreateWowService_out_set_lpdwTagId,
44894 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44895 : },
44896 : {
44897 : .name = discard_const_p(char, "in_lpDependencies"),
44898 : .get = py_svcctl_CreateWowService_in_get_lpDependencies,
44899 : .set = py_svcctl_CreateWowService_in_set_lpDependencies,
44900 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
44901 : },
44902 : {
44903 : .name = discard_const_p(char, "in_dwDependSize"),
44904 : .get = py_svcctl_CreateWowService_in_get_dwDependSize,
44905 : .set = py_svcctl_CreateWowService_in_set_dwDependSize,
44906 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44907 : },
44908 : {
44909 : .name = discard_const_p(char, "in_lpServiceStartName"),
44910 : .get = py_svcctl_CreateWowService_in_get_lpServiceStartName,
44911 : .set = py_svcctl_CreateWowService_in_set_lpServiceStartName,
44912 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44913 : },
44914 : {
44915 : .name = discard_const_p(char, "in_lpPassword"),
44916 : .get = py_svcctl_CreateWowService_in_get_lpPassword,
44917 : .set = py_svcctl_CreateWowService_in_set_lpPassword,
44918 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
44919 : },
44920 : {
44921 : .name = discard_const_p(char, "in_dwPwSize"),
44922 : .get = py_svcctl_CreateWowService_in_get_dwPwSize,
44923 : .set = py_svcctl_CreateWowService_in_set_dwPwSize,
44924 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44925 : },
44926 : {
44927 : .name = discard_const_p(char, "in_dwServiceWowType"),
44928 : .get = py_svcctl_CreateWowService_in_get_dwServiceWowType,
44929 : .set = py_svcctl_CreateWowService_in_set_dwServiceWowType,
44930 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44931 : },
44932 : {
44933 : .name = discard_const_p(char, "out_lpServiceHandle"),
44934 : .get = py_svcctl_CreateWowService_out_get_lpServiceHandle,
44935 : .set = py_svcctl_CreateWowService_out_set_lpServiceHandle,
44936 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44937 : },
44938 : {
44939 : .name = discard_const_p(char, "result"),
44940 : .get = py_svcctl_CreateWowService_get_result,
44941 : .set = py_svcctl_CreateWowService_set_result,
44942 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
44943 : },
44944 : { .name = NULL }
44945 : };
44946 :
44947 0 : static PyObject *py_svcctl_CreateWowService_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44948 : {
44949 0 : PyObject *self = pytalloc_new(struct svcctl_CreateWowService, type);
44950 0 : struct svcctl_CreateWowService *_self = (struct svcctl_CreateWowService *)pytalloc_get_ptr(self);
44951 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44952 0 : _self->out.lpServiceHandle = talloc_zero(mem_ctx, struct policy_handle);
44953 0 : return self;
44954 : }
44955 :
44956 0 : static PyObject *py_svcctl_CreateWowService_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44957 : {
44958 :
44959 :
44960 0 : return PyLong_FromLong(60);
44961 : }
44962 :
44963 0 : static PyObject *py_svcctl_CreateWowService_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
44964 : {
44965 0 : const struct ndr_interface_call *call = NULL;
44966 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
44967 0 : PyObject *ret = NULL;
44968 0 : struct ndr_push *push = NULL;
44969 0 : DATA_BLOB blob;
44970 0 : enum ndr_err_code err;
44971 :
44972 0 : if (ndr_table_svcctl.num_calls < 61) {
44973 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateWowService_ndr_pack");
44974 0 : return NULL;
44975 : }
44976 0 : call = &ndr_table_svcctl.calls[60];
44977 :
44978 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44979 0 : if (push == NULL) {
44980 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44981 0 : return NULL;
44982 : }
44983 :
44984 0 : push->flags |= ndr_push_flags;
44985 :
44986 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44987 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44988 0 : TALLOC_FREE(push);
44989 0 : PyErr_SetNdrError(err);
44990 0 : return NULL;
44991 : }
44992 0 : blob = ndr_push_blob(push);
44993 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44994 0 : TALLOC_FREE(push);
44995 0 : return ret;
44996 : }
44997 :
44998 0 : static PyObject *py_svcctl_CreateWowService_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44999 : {
45000 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45001 0 : PyObject *bigendian_obj = NULL;
45002 0 : PyObject *ndr64_obj = NULL;
45003 0 : libndr_flags ndr_push_flags = 0;
45004 :
45005 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45006 : discard_const_p(char *, kwnames),
45007 : &bigendian_obj,
45008 : &ndr64_obj)) {
45009 0 : return NULL;
45010 : }
45011 :
45012 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45013 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45014 : }
45015 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45016 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45017 : }
45018 :
45019 0 : return py_svcctl_CreateWowService_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45020 : }
45021 :
45022 0 : static PyObject *py_svcctl_CreateWowService_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45023 : {
45024 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45025 0 : PyObject *bigendian_obj = NULL;
45026 0 : PyObject *ndr64_obj = NULL;
45027 0 : libndr_flags ndr_push_flags = 0;
45028 :
45029 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45030 : discard_const_p(char *, kwnames),
45031 : &bigendian_obj,
45032 : &ndr64_obj)) {
45033 0 : return NULL;
45034 : }
45035 :
45036 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45037 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45038 : }
45039 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45040 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45041 : }
45042 :
45043 0 : return py_svcctl_CreateWowService_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45044 : }
45045 :
45046 0 : static PyObject *py_svcctl_CreateWowService_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
45047 : {
45048 0 : const struct ndr_interface_call *call = NULL;
45049 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
45050 0 : struct ndr_pull *pull = NULL;
45051 0 : enum ndr_err_code err;
45052 :
45053 0 : if (ndr_table_svcctl.num_calls < 61) {
45054 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateWowService_ndr_unpack");
45055 0 : return NULL;
45056 : }
45057 0 : call = &ndr_table_svcctl.calls[60];
45058 :
45059 0 : pull = ndr_pull_init_blob(blob, object);
45060 0 : if (pull == NULL) {
45061 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45062 0 : return NULL;
45063 : }
45064 :
45065 0 : pull->flags |= ndr_pull_flags;
45066 :
45067 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45068 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45069 0 : TALLOC_FREE(pull);
45070 0 : PyErr_SetNdrError(err);
45071 0 : return NULL;
45072 : }
45073 0 : if (!allow_remaining) {
45074 0 : uint32_t highest_ofs;
45075 :
45076 0 : if (pull->offset > pull->relative_highest_offset) {
45077 0 : highest_ofs = pull->offset;
45078 : } else {
45079 0 : highest_ofs = pull->relative_highest_offset;
45080 : }
45081 0 : if (highest_ofs < pull->data_size) {
45082 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45083 : "not all bytes consumed ofs[%u] size[%u]",
45084 : highest_ofs, pull->data_size);
45085 0 : TALLOC_FREE(pull);
45086 0 : PyErr_SetNdrError(err);
45087 0 : return NULL;
45088 : }
45089 : }
45090 :
45091 0 : TALLOC_FREE(pull);
45092 0 : Py_RETURN_NONE;
45093 : }
45094 :
45095 0 : static PyObject *py_svcctl_CreateWowService_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45096 : {
45097 0 : DATA_BLOB blob;
45098 0 : Py_ssize_t blob_length = 0;
45099 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45100 0 : PyObject *bigendian_obj = NULL;
45101 0 : PyObject *ndr64_obj = NULL;
45102 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45103 0 : PyObject *allow_remaining_obj = NULL;
45104 0 : bool allow_remaining = false;
45105 :
45106 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45107 : discard_const_p(char *, kwnames),
45108 : &blob.data, &blob_length,
45109 : &bigendian_obj,
45110 : &ndr64_obj,
45111 : &allow_remaining_obj)) {
45112 0 : return NULL;
45113 : }
45114 0 : blob.length = blob_length;
45115 :
45116 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45117 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45118 : }
45119 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45120 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45121 : }
45122 :
45123 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45124 0 : allow_remaining = true;
45125 : }
45126 :
45127 0 : return py_svcctl_CreateWowService_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45128 : }
45129 :
45130 0 : static PyObject *py_svcctl_CreateWowService_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45131 : {
45132 0 : DATA_BLOB blob;
45133 0 : Py_ssize_t blob_length = 0;
45134 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45135 0 : PyObject *bigendian_obj = NULL;
45136 0 : PyObject *ndr64_obj = NULL;
45137 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45138 0 : PyObject *allow_remaining_obj = NULL;
45139 0 : bool allow_remaining = false;
45140 :
45141 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45142 : discard_const_p(char *, kwnames),
45143 : &blob.data, &blob_length,
45144 : &bigendian_obj,
45145 : &ndr64_obj,
45146 : &allow_remaining_obj)) {
45147 0 : return NULL;
45148 : }
45149 0 : blob.length = blob_length;
45150 :
45151 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45152 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45153 : }
45154 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45155 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45156 : }
45157 :
45158 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45159 0 : allow_remaining = true;
45160 : }
45161 :
45162 0 : return py_svcctl_CreateWowService_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45163 : }
45164 :
45165 0 : static PyObject *py_svcctl_CreateWowService_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
45166 : {
45167 0 : const struct ndr_interface_call *call = NULL;
45168 0 : struct svcctl_CreateWowService *object = (struct svcctl_CreateWowService *)pytalloc_get_ptr(py_obj);
45169 0 : PyObject *ret;
45170 0 : char *retstr;
45171 :
45172 0 : if (ndr_table_svcctl.num_calls < 61) {
45173 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateWowService_ndr_print");
45174 0 : return NULL;
45175 : }
45176 0 : call = &ndr_table_svcctl.calls[60];
45177 :
45178 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45179 0 : ret = PyUnicode_FromString(retstr);
45180 0 : TALLOC_FREE(retstr);
45181 :
45182 0 : return ret;
45183 : }
45184 :
45185 0 : static PyObject *py_svcctl_CreateWowService_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45186 : {
45187 0 : return py_svcctl_CreateWowService_ndr_print(py_obj, "svcctl_CreateWowService_in", NDR_IN);
45188 : }
45189 :
45190 0 : static PyObject *py_svcctl_CreateWowService_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45191 : {
45192 0 : return py_svcctl_CreateWowService_ndr_print(py_obj, "svcctl_CreateWowService_out", NDR_OUT);
45193 : }
45194 :
45195 : static PyMethodDef py_svcctl_CreateWowService_methods[] = {
45196 : { "opnum", (PyCFunction)py_svcctl_CreateWowService_ndr_opnum, METH_NOARGS|METH_CLASS,
45197 : "svcctl.CreateWowService.opnum() -> 60 (0x3c) " },
45198 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateWowService_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45199 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45200 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateWowService_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45201 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45202 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateWowService_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45203 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45204 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateWowService_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45205 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45206 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CreateWowService_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45207 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CreateWowService_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45208 : { NULL, NULL, 0, NULL }
45209 : };
45210 :
45211 :
45212 : static PyTypeObject svcctl_CreateWowService_Type = {
45213 : PyVarObject_HEAD_INIT(NULL, 0)
45214 : .tp_name = "svcctl.CreateWowService",
45215 : .tp_getset = py_svcctl_CreateWowService_getsetters,
45216 : .tp_methods = py_svcctl_CreateWowService_methods,
45217 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45218 : .tp_new = py_svcctl_CreateWowService_new,
45219 : };
45220 :
45221 0 : static bool pack_py_svcctl_CreateWowService_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CreateWowService *r)
45222 : {
45223 0 : PyObject *py_hSCManager;
45224 0 : PyObject *py_lpServiceName;
45225 0 : PyObject *py_lpDisplayName;
45226 0 : PyObject *py_dwDesiredAccess;
45227 0 : PyObject *py_dwServiceType;
45228 0 : PyObject *py_dwStartType;
45229 0 : PyObject *py_dwErrorControl;
45230 0 : PyObject *py_lpBinaryPathName;
45231 0 : PyObject *py_lpLoadOrderGroup;
45232 0 : PyObject *py_lpdwTagId;
45233 0 : PyObject *py_lpDependencies;
45234 0 : PyObject *py_lpServiceStartName;
45235 0 : PyObject *py_lpPassword;
45236 0 : PyObject *py_dwServiceWowType;
45237 0 : const char *kwnames[] = {
45238 : "hSCManager", "lpServiceName", "lpDisplayName", "dwDesiredAccess", "dwServiceType", "dwStartType", "dwErrorControl", "lpBinaryPathName", "lpLoadOrderGroup", "lpdwTagId", "lpDependencies", "lpServiceStartName", "lpPassword", "dwServiceWowType", NULL
45239 : };
45240 :
45241 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOOOOO:svcctl_CreateWowService", discard_const_p(char *, kwnames), &py_hSCManager, &py_lpServiceName, &py_lpDisplayName, &py_dwDesiredAccess, &py_dwServiceType, &py_dwStartType, &py_dwErrorControl, &py_lpBinaryPathName, &py_lpLoadOrderGroup, &py_lpdwTagId, &py_lpDependencies, &py_lpServiceStartName, &py_lpPassword, &py_dwServiceWowType)) {
45242 0 : return false;
45243 : }
45244 :
45245 0 : if (py_hSCManager == NULL) {
45246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hSCManager");
45247 0 : return false;
45248 : }
45249 0 : PY_CHECK_TYPE(policy_handle_Type, py_hSCManager, return false;);
45250 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hSCManager)) == NULL) {
45251 0 : PyErr_NoMemory();
45252 0 : return false;
45253 : }
45254 0 : r->in.hSCManager = *(struct policy_handle *)pytalloc_get_ptr(py_hSCManager);
45255 0 : if (py_lpServiceName == NULL) {
45256 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpServiceName");
45257 0 : return false;
45258 : }
45259 0 : r->in.lpServiceName = talloc_ptrtype(r, r->in.lpServiceName);
45260 0 : if (r->in.lpServiceName == NULL) {
45261 0 : PyErr_NoMemory();
45262 0 : return false;
45263 : }
45264 : {
45265 0 : const char *test_str;
45266 0 : const char *talloc_str;
45267 0 : PyObject *unicode = NULL;
45268 0 : if (PyUnicode_Check(py_lpServiceName)) {
45269 0 : unicode = PyUnicode_AsEncodedString(py_lpServiceName, "utf-8", "ignore");
45270 0 : if (unicode == NULL) {
45271 0 : return false;
45272 : }
45273 0 : test_str = PyBytes_AS_STRING(unicode);
45274 0 : } else if (PyBytes_Check(py_lpServiceName)) {
45275 0 : test_str = PyBytes_AS_STRING(py_lpServiceName);
45276 : } else {
45277 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpServiceName)->tp_name);
45278 0 : return false;
45279 : }
45280 0 : talloc_str = talloc_strdup(r, test_str);
45281 0 : if (unicode != NULL) {
45282 0 : Py_DECREF(unicode);
45283 : }
45284 0 : if (talloc_str == NULL) {
45285 0 : PyErr_NoMemory();
45286 0 : return false;
45287 : }
45288 0 : r->in.lpServiceName = talloc_str;
45289 : }
45290 0 : if (py_lpDisplayName == NULL) {
45291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDisplayName");
45292 0 : return false;
45293 : }
45294 0 : if (py_lpDisplayName == Py_None) {
45295 0 : r->in.lpDisplayName = NULL;
45296 : } else {
45297 0 : r->in.lpDisplayName = NULL;
45298 : {
45299 0 : const char *test_str;
45300 0 : const char *talloc_str;
45301 0 : PyObject *unicode = NULL;
45302 0 : if (PyUnicode_Check(py_lpDisplayName)) {
45303 0 : unicode = PyUnicode_AsEncodedString(py_lpDisplayName, "utf-8", "ignore");
45304 0 : if (unicode == NULL) {
45305 0 : return false;
45306 : }
45307 0 : test_str = PyBytes_AS_STRING(unicode);
45308 0 : } else if (PyBytes_Check(py_lpDisplayName)) {
45309 0 : test_str = PyBytes_AS_STRING(py_lpDisplayName);
45310 : } else {
45311 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpDisplayName)->tp_name);
45312 0 : return false;
45313 : }
45314 0 : talloc_str = talloc_strdup(r, test_str);
45315 0 : if (unicode != NULL) {
45316 0 : Py_DECREF(unicode);
45317 : }
45318 0 : if (talloc_str == NULL) {
45319 0 : PyErr_NoMemory();
45320 0 : return false;
45321 : }
45322 0 : r->in.lpDisplayName = talloc_str;
45323 : }
45324 : }
45325 0 : if (py_dwDesiredAccess == NULL) {
45326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwDesiredAccess");
45327 0 : return false;
45328 : }
45329 : {
45330 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwDesiredAccess));
45331 0 : if (PyLong_Check(py_dwDesiredAccess)) {
45332 0 : unsigned long long test_var;
45333 0 : test_var = PyLong_AsUnsignedLongLong(py_dwDesiredAccess);
45334 0 : if (PyErr_Occurred() != NULL) {
45335 0 : return false;
45336 : }
45337 0 : if (test_var > uint_max) {
45338 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45339 : PyLong_Type.tp_name, uint_max, test_var);
45340 0 : return false;
45341 : }
45342 0 : r->in.dwDesiredAccess = test_var;
45343 : } else {
45344 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45345 : PyLong_Type.tp_name);
45346 0 : return false;
45347 : }
45348 : }
45349 0 : if (py_dwServiceType == NULL) {
45350 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwServiceType");
45351 0 : return false;
45352 : }
45353 : {
45354 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwServiceType));
45355 0 : if (PyLong_Check(py_dwServiceType)) {
45356 0 : unsigned long long test_var;
45357 0 : test_var = PyLong_AsUnsignedLongLong(py_dwServiceType);
45358 0 : if (PyErr_Occurred() != NULL) {
45359 0 : return false;
45360 : }
45361 0 : if (test_var > uint_max) {
45362 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45363 : PyLong_Type.tp_name, uint_max, test_var);
45364 0 : return false;
45365 : }
45366 0 : r->in.dwServiceType = test_var;
45367 : } else {
45368 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45369 : PyLong_Type.tp_name);
45370 0 : return false;
45371 : }
45372 : }
45373 0 : if (py_dwStartType == NULL) {
45374 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwStartType");
45375 0 : return false;
45376 : }
45377 : {
45378 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwStartType));
45379 0 : if (PyLong_Check(py_dwStartType)) {
45380 0 : unsigned long long test_var;
45381 0 : test_var = PyLong_AsUnsignedLongLong(py_dwStartType);
45382 0 : if (PyErr_Occurred() != NULL) {
45383 0 : return false;
45384 : }
45385 0 : if (test_var > uint_max) {
45386 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45387 : PyLong_Type.tp_name, uint_max, test_var);
45388 0 : return false;
45389 : }
45390 0 : r->in.dwStartType = test_var;
45391 : } else {
45392 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45393 : PyLong_Type.tp_name);
45394 0 : return false;
45395 : }
45396 : }
45397 0 : if (py_dwErrorControl == NULL) {
45398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwErrorControl");
45399 0 : return false;
45400 : }
45401 : {
45402 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwErrorControl));
45403 0 : if (PyLong_Check(py_dwErrorControl)) {
45404 0 : unsigned long long test_var;
45405 0 : test_var = PyLong_AsUnsignedLongLong(py_dwErrorControl);
45406 0 : if (PyErr_Occurred() != NULL) {
45407 0 : return false;
45408 : }
45409 0 : if (test_var > uint_max) {
45410 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45411 : PyLong_Type.tp_name, uint_max, test_var);
45412 0 : return false;
45413 : }
45414 0 : r->in.dwErrorControl = test_var;
45415 : } else {
45416 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45417 : PyLong_Type.tp_name);
45418 0 : return false;
45419 : }
45420 : }
45421 0 : if (py_lpBinaryPathName == NULL) {
45422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpBinaryPathName");
45423 0 : return false;
45424 : }
45425 0 : r->in.lpBinaryPathName = talloc_ptrtype(r, r->in.lpBinaryPathName);
45426 0 : if (r->in.lpBinaryPathName == NULL) {
45427 0 : PyErr_NoMemory();
45428 0 : return false;
45429 : }
45430 : {
45431 0 : const char *test_str;
45432 0 : const char *talloc_str;
45433 0 : PyObject *unicode = NULL;
45434 0 : if (PyUnicode_Check(py_lpBinaryPathName)) {
45435 0 : unicode = PyUnicode_AsEncodedString(py_lpBinaryPathName, "utf-8", "ignore");
45436 0 : if (unicode == NULL) {
45437 0 : return false;
45438 : }
45439 0 : test_str = PyBytes_AS_STRING(unicode);
45440 0 : } else if (PyBytes_Check(py_lpBinaryPathName)) {
45441 0 : test_str = PyBytes_AS_STRING(py_lpBinaryPathName);
45442 : } else {
45443 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpBinaryPathName)->tp_name);
45444 0 : return false;
45445 : }
45446 0 : talloc_str = talloc_strdup(r, test_str);
45447 0 : if (unicode != NULL) {
45448 0 : Py_DECREF(unicode);
45449 : }
45450 0 : if (talloc_str == NULL) {
45451 0 : PyErr_NoMemory();
45452 0 : return false;
45453 : }
45454 0 : r->in.lpBinaryPathName = talloc_str;
45455 : }
45456 0 : if (py_lpLoadOrderGroup == NULL) {
45457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpLoadOrderGroup");
45458 0 : return false;
45459 : }
45460 0 : if (py_lpLoadOrderGroup == Py_None) {
45461 0 : r->in.lpLoadOrderGroup = NULL;
45462 : } else {
45463 0 : r->in.lpLoadOrderGroup = NULL;
45464 : {
45465 0 : const char *test_str;
45466 0 : const char *talloc_str;
45467 0 : PyObject *unicode = NULL;
45468 0 : if (PyUnicode_Check(py_lpLoadOrderGroup)) {
45469 0 : unicode = PyUnicode_AsEncodedString(py_lpLoadOrderGroup, "utf-8", "ignore");
45470 0 : if (unicode == NULL) {
45471 0 : return false;
45472 : }
45473 0 : test_str = PyBytes_AS_STRING(unicode);
45474 0 : } else if (PyBytes_Check(py_lpLoadOrderGroup)) {
45475 0 : test_str = PyBytes_AS_STRING(py_lpLoadOrderGroup);
45476 : } else {
45477 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpLoadOrderGroup)->tp_name);
45478 0 : return false;
45479 : }
45480 0 : talloc_str = talloc_strdup(r, test_str);
45481 0 : if (unicode != NULL) {
45482 0 : Py_DECREF(unicode);
45483 : }
45484 0 : if (talloc_str == NULL) {
45485 0 : PyErr_NoMemory();
45486 0 : return false;
45487 : }
45488 0 : r->in.lpLoadOrderGroup = talloc_str;
45489 : }
45490 : }
45491 0 : if (py_lpdwTagId == NULL) {
45492 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpdwTagId");
45493 0 : return false;
45494 : }
45495 0 : if (py_lpdwTagId == Py_None) {
45496 0 : r->in.lpdwTagId = NULL;
45497 : } else {
45498 0 : r->in.lpdwTagId = talloc_ptrtype(r, r->in.lpdwTagId);
45499 0 : if (r->in.lpdwTagId == NULL) {
45500 0 : PyErr_NoMemory();
45501 0 : return false;
45502 : }
45503 : {
45504 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.lpdwTagId));
45505 0 : if (PyLong_Check(py_lpdwTagId)) {
45506 0 : unsigned long long test_var;
45507 0 : test_var = PyLong_AsUnsignedLongLong(py_lpdwTagId);
45508 0 : if (PyErr_Occurred() != NULL) {
45509 0 : return false;
45510 : }
45511 0 : if (test_var > uint_max) {
45512 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45513 : PyLong_Type.tp_name, uint_max, test_var);
45514 0 : return false;
45515 : }
45516 0 : *r->in.lpdwTagId = test_var;
45517 : } else {
45518 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45519 : PyLong_Type.tp_name);
45520 0 : return false;
45521 : }
45522 : }
45523 : }
45524 0 : if (py_lpDependencies == NULL) {
45525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDependencies");
45526 0 : return false;
45527 : }
45528 0 : if (py_lpDependencies == Py_None) {
45529 0 : r->in.lpDependencies = NULL;
45530 : } else {
45531 0 : r->in.lpDependencies = NULL;
45532 0 : PY_CHECK_TYPE(&PyList_Type, py_lpDependencies, return false;);
45533 : {
45534 0 : int lpDependencies_cntr_1;
45535 0 : r->in.lpDependencies = talloc_array_ptrtype(r, r->in.lpDependencies, PyList_GET_SIZE(py_lpDependencies));
45536 0 : if (!r->in.lpDependencies) { return false; }
45537 0 : talloc_set_name_const(r->in.lpDependencies, "ARRAY: r->in.lpDependencies");
45538 0 : for (lpDependencies_cntr_1 = 0; lpDependencies_cntr_1 < PyList_GET_SIZE(py_lpDependencies); lpDependencies_cntr_1++) {
45539 0 : if (PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1) == NULL) {
45540 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpDependencies[lpDependencies_cntr_1]");
45541 0 : return false;
45542 : }
45543 : {
45544 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lpDependencies[lpDependencies_cntr_1]));
45545 0 : if (PyLong_Check(PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1))) {
45546 0 : unsigned long long test_var;
45547 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_lpDependencies, lpDependencies_cntr_1));
45548 0 : if (PyErr_Occurred() != NULL) {
45549 0 : return false;
45550 : }
45551 0 : if (test_var > uint_max) {
45552 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45553 : PyLong_Type.tp_name, uint_max, test_var);
45554 0 : return false;
45555 : }
45556 0 : r->in.lpDependencies[lpDependencies_cntr_1] = test_var;
45557 : } else {
45558 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45559 : PyLong_Type.tp_name);
45560 0 : return false;
45561 : }
45562 : }
45563 : }
45564 : }
45565 : }
45566 0 : PY_CHECK_TYPE(&PyList_Type, py_lpDependencies, return false;);
45567 0 : r->in.dwDependSize = PyList_GET_SIZE(py_lpDependencies);
45568 0 : if (py_lpServiceStartName == NULL) {
45569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpServiceStartName");
45570 0 : return false;
45571 : }
45572 0 : if (py_lpServiceStartName == Py_None) {
45573 0 : r->in.lpServiceStartName = NULL;
45574 : } else {
45575 0 : r->in.lpServiceStartName = NULL;
45576 : {
45577 0 : const char *test_str;
45578 0 : const char *talloc_str;
45579 0 : PyObject *unicode = NULL;
45580 0 : if (PyUnicode_Check(py_lpServiceStartName)) {
45581 0 : unicode = PyUnicode_AsEncodedString(py_lpServiceStartName, "utf-8", "ignore");
45582 0 : if (unicode == NULL) {
45583 0 : return false;
45584 : }
45585 0 : test_str = PyBytes_AS_STRING(unicode);
45586 0 : } else if (PyBytes_Check(py_lpServiceStartName)) {
45587 0 : test_str = PyBytes_AS_STRING(py_lpServiceStartName);
45588 : } else {
45589 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_lpServiceStartName)->tp_name);
45590 0 : return false;
45591 : }
45592 0 : talloc_str = talloc_strdup(r, test_str);
45593 0 : if (unicode != NULL) {
45594 0 : Py_DECREF(unicode);
45595 : }
45596 0 : if (talloc_str == NULL) {
45597 0 : PyErr_NoMemory();
45598 0 : return false;
45599 : }
45600 0 : r->in.lpServiceStartName = talloc_str;
45601 : }
45602 : }
45603 0 : if (py_lpPassword == NULL) {
45604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpPassword");
45605 0 : return false;
45606 : }
45607 0 : if (py_lpPassword == Py_None) {
45608 0 : r->in.lpPassword = NULL;
45609 : } else {
45610 0 : r->in.lpPassword = NULL;
45611 0 : PY_CHECK_TYPE(&PyList_Type, py_lpPassword, return false;);
45612 : {
45613 0 : int lpPassword_cntr_1;
45614 0 : r->in.lpPassword = talloc_array_ptrtype(r, r->in.lpPassword, PyList_GET_SIZE(py_lpPassword));
45615 0 : if (!r->in.lpPassword) { return false; }
45616 0 : talloc_set_name_const(r->in.lpPassword, "ARRAY: r->in.lpPassword");
45617 0 : for (lpPassword_cntr_1 = 0; lpPassword_cntr_1 < PyList_GET_SIZE(py_lpPassword); lpPassword_cntr_1++) {
45618 0 : if (PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1) == NULL) {
45619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lpPassword[lpPassword_cntr_1]");
45620 0 : return false;
45621 : }
45622 : {
45623 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lpPassword[lpPassword_cntr_1]));
45624 0 : if (PyLong_Check(PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1))) {
45625 0 : unsigned long long test_var;
45626 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_lpPassword, lpPassword_cntr_1));
45627 0 : if (PyErr_Occurred() != NULL) {
45628 0 : return false;
45629 : }
45630 0 : if (test_var > uint_max) {
45631 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45632 : PyLong_Type.tp_name, uint_max, test_var);
45633 0 : return false;
45634 : }
45635 0 : r->in.lpPassword[lpPassword_cntr_1] = test_var;
45636 : } else {
45637 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45638 : PyLong_Type.tp_name);
45639 0 : return false;
45640 : }
45641 : }
45642 : }
45643 : }
45644 : }
45645 0 : PY_CHECK_TYPE(&PyList_Type, py_lpPassword, return false;);
45646 0 : r->in.dwPwSize = PyList_GET_SIZE(py_lpPassword);
45647 0 : if (py_dwServiceWowType == NULL) {
45648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dwServiceWowType");
45649 0 : return false;
45650 : }
45651 : {
45652 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dwServiceWowType));
45653 0 : if (PyLong_Check(py_dwServiceWowType)) {
45654 0 : unsigned long long test_var;
45655 0 : test_var = PyLong_AsUnsignedLongLong(py_dwServiceWowType);
45656 0 : if (PyErr_Occurred() != NULL) {
45657 0 : return false;
45658 : }
45659 0 : if (test_var > uint_max) {
45660 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45661 : PyLong_Type.tp_name, uint_max, test_var);
45662 0 : return false;
45663 : }
45664 0 : r->in.dwServiceWowType = test_var;
45665 : } else {
45666 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45667 : PyLong_Type.tp_name);
45668 0 : return false;
45669 : }
45670 : }
45671 0 : return true;
45672 : }
45673 :
45674 0 : static PyObject *unpack_py_svcctl_CreateWowService_args_out(struct svcctl_CreateWowService *r)
45675 : {
45676 0 : PyObject *result;
45677 0 : PyObject *py_lpdwTagId;
45678 0 : PyObject *py_lpServiceHandle;
45679 0 : result = PyTuple_New(2);
45680 0 : if (r->out.lpdwTagId == NULL) {
45681 0 : py_lpdwTagId = Py_None;
45682 0 : Py_INCREF(py_lpdwTagId);
45683 : } else {
45684 0 : py_lpdwTagId = PyLong_FromUnsignedLongLong((uint32_t)*r->out.lpdwTagId);
45685 : }
45686 0 : PyTuple_SetItem(result, 0, py_lpdwTagId);
45687 0 : py_lpServiceHandle = pytalloc_reference_ex(policy_handle_Type, r->out.lpServiceHandle, r->out.lpServiceHandle);
45688 0 : PyTuple_SetItem(result, 1, py_lpServiceHandle);
45689 0 : if (!W_ERROR_IS_OK(r->out.result)) {
45690 0 : PyErr_SetWERROR(r->out.result);
45691 0 : return NULL;
45692 : }
45693 :
45694 0 : return result;
45695 : }
45696 :
45697 :
45698 0 : static PyObject *py_svcctl_OpenSCManager2_in_get_BindingHandle(PyObject *obj, void *closure)
45699 : {
45700 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(obj);
45701 0 : PyObject *py_BindingHandle;
45702 0 : py_BindingHandle = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.BindingHandle);
45703 0 : return py_BindingHandle;
45704 : }
45705 :
45706 0 : static int py_svcctl_OpenSCManager2_in_set_BindingHandle(PyObject *py_obj, PyObject *value, void *closure)
45707 : {
45708 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
45709 0 : if (value == NULL) {
45710 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.BindingHandle");
45711 0 : return -1;
45712 : }
45713 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
45714 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45715 0 : PyErr_NoMemory();
45716 0 : return -1;
45717 : }
45718 0 : object->in.BindingHandle = *(struct policy_handle *)pytalloc_get_ptr(value);
45719 0 : return 0;
45720 : }
45721 :
45722 0 : static PyObject *py_svcctl_OpenSCManager2_in_get_DatabaseName(PyObject *obj, void *closure)
45723 : {
45724 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(obj);
45725 0 : PyObject *py_DatabaseName;
45726 0 : if (object->in.DatabaseName == NULL) {
45727 0 : Py_RETURN_NONE;
45728 : }
45729 0 : if (object->in.DatabaseName == NULL) {
45730 0 : py_DatabaseName = Py_None;
45731 0 : Py_INCREF(py_DatabaseName);
45732 : } else {
45733 0 : if (object->in.DatabaseName == NULL) {
45734 0 : py_DatabaseName = Py_None;
45735 0 : Py_INCREF(py_DatabaseName);
45736 : } else {
45737 0 : py_DatabaseName = PyUnicode_Decode(object->in.DatabaseName, strlen(object->in.DatabaseName), "utf-8", "ignore");
45738 : }
45739 : }
45740 0 : return py_DatabaseName;
45741 : }
45742 :
45743 0 : static int py_svcctl_OpenSCManager2_in_set_DatabaseName(PyObject *py_obj, PyObject *value, void *closure)
45744 : {
45745 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
45746 0 : if (value == NULL) {
45747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DatabaseName");
45748 0 : return -1;
45749 : }
45750 0 : if (value == Py_None) {
45751 0 : object->in.DatabaseName = NULL;
45752 : } else {
45753 0 : object->in.DatabaseName = NULL;
45754 : {
45755 0 : const char *test_str;
45756 0 : const char *talloc_str;
45757 0 : PyObject *unicode = NULL;
45758 0 : if (PyUnicode_Check(value)) {
45759 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
45760 0 : if (unicode == NULL) {
45761 0 : return -1;
45762 : }
45763 0 : test_str = PyBytes_AS_STRING(unicode);
45764 0 : } else if (PyBytes_Check(value)) {
45765 0 : test_str = PyBytes_AS_STRING(value);
45766 : } else {
45767 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
45768 0 : return -1;
45769 : }
45770 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
45771 0 : if (unicode != NULL) {
45772 0 : Py_DECREF(unicode);
45773 : }
45774 0 : if (talloc_str == NULL) {
45775 0 : PyErr_NoMemory();
45776 0 : return -1;
45777 : }
45778 0 : object->in.DatabaseName = talloc_str;
45779 : }
45780 : }
45781 0 : return 0;
45782 : }
45783 :
45784 0 : static PyObject *py_svcctl_OpenSCManager2_in_get_DesiredAccess(PyObject *obj, void *closure)
45785 : {
45786 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(obj);
45787 0 : PyObject *py_DesiredAccess;
45788 0 : py_DesiredAccess = PyLong_FromUnsignedLongLong((uint32_t)object->in.DesiredAccess);
45789 0 : return py_DesiredAccess;
45790 : }
45791 :
45792 0 : static int py_svcctl_OpenSCManager2_in_set_DesiredAccess(PyObject *py_obj, PyObject *value, void *closure)
45793 : {
45794 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
45795 0 : if (value == NULL) {
45796 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DesiredAccess");
45797 0 : return -1;
45798 : }
45799 : {
45800 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.DesiredAccess));
45801 0 : if (PyLong_Check(value)) {
45802 0 : unsigned long long test_var;
45803 0 : test_var = PyLong_AsUnsignedLongLong(value);
45804 0 : if (PyErr_Occurred() != NULL) {
45805 0 : return -1;
45806 : }
45807 0 : if (test_var > uint_max) {
45808 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45809 : PyLong_Type.tp_name, uint_max, test_var);
45810 0 : return -1;
45811 : }
45812 0 : object->in.DesiredAccess = test_var;
45813 : } else {
45814 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45815 : PyLong_Type.tp_name);
45816 0 : return -1;
45817 : }
45818 : }
45819 0 : return 0;
45820 : }
45821 :
45822 0 : static PyObject *py_svcctl_OpenSCManager2_out_get_ScmHandle(PyObject *obj, void *closure)
45823 : {
45824 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(obj);
45825 0 : PyObject *py_ScmHandle;
45826 0 : if (object->out.ScmHandle == NULL) {
45827 0 : Py_RETURN_NONE;
45828 : }
45829 0 : py_ScmHandle = pytalloc_reference_ex(policy_handle_Type, object->out.ScmHandle, object->out.ScmHandle);
45830 0 : return py_ScmHandle;
45831 : }
45832 :
45833 0 : static int py_svcctl_OpenSCManager2_out_set_ScmHandle(PyObject *py_obj, PyObject *value, void *closure)
45834 : {
45835 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
45836 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ScmHandle));
45837 0 : if (value == NULL) {
45838 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ScmHandle");
45839 0 : return -1;
45840 : }
45841 0 : object->out.ScmHandle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ScmHandle);
45842 0 : if (object->out.ScmHandle == NULL) {
45843 0 : PyErr_NoMemory();
45844 0 : return -1;
45845 : }
45846 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
45847 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45848 0 : PyErr_NoMemory();
45849 0 : return -1;
45850 : }
45851 0 : object->out.ScmHandle = (struct policy_handle *)pytalloc_get_ptr(value);
45852 0 : return 0;
45853 : }
45854 :
45855 0 : static PyObject *py_svcctl_OpenSCManager2_get_result(PyObject *obj, void *closure)
45856 : {
45857 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(obj);
45858 0 : PyObject *py_result;
45859 0 : py_result = PyErr_FromWERROR(object->out.result);
45860 0 : return py_result;
45861 : }
45862 :
45863 0 : static int py_svcctl_OpenSCManager2_set_result(PyObject *py_obj, PyObject *value, void *closure)
45864 : {
45865 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
45866 0 : if (value == NULL) {
45867 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
45868 0 : return -1;
45869 : }
45870 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
45871 0 : return 0;
45872 : }
45873 :
45874 : static PyGetSetDef py_svcctl_OpenSCManager2_getsetters[] = {
45875 : {
45876 : .name = discard_const_p(char, "in_BindingHandle"),
45877 : .get = py_svcctl_OpenSCManager2_in_get_BindingHandle,
45878 : .set = py_svcctl_OpenSCManager2_in_set_BindingHandle,
45879 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
45880 : },
45881 : {
45882 : .name = discard_const_p(char, "in_DatabaseName"),
45883 : .get = py_svcctl_OpenSCManager2_in_get_DatabaseName,
45884 : .set = py_svcctl_OpenSCManager2_in_set_DatabaseName,
45885 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
45886 : },
45887 : {
45888 : .name = discard_const_p(char, "in_DesiredAccess"),
45889 : .get = py_svcctl_OpenSCManager2_in_get_DesiredAccess,
45890 : .set = py_svcctl_OpenSCManager2_in_set_DesiredAccess,
45891 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
45892 : },
45893 : {
45894 : .name = discard_const_p(char, "out_ScmHandle"),
45895 : .get = py_svcctl_OpenSCManager2_out_get_ScmHandle,
45896 : .set = py_svcctl_OpenSCManager2_out_set_ScmHandle,
45897 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
45898 : },
45899 : {
45900 : .name = discard_const_p(char, "result"),
45901 : .get = py_svcctl_OpenSCManager2_get_result,
45902 : .set = py_svcctl_OpenSCManager2_set_result,
45903 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
45904 : },
45905 : { .name = NULL }
45906 : };
45907 :
45908 0 : static PyObject *py_svcctl_OpenSCManager2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
45909 : {
45910 0 : PyObject *self = pytalloc_new(struct svcctl_OpenSCManager2, type);
45911 0 : struct svcctl_OpenSCManager2 *_self = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(self);
45912 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
45913 0 : _self->out.ScmHandle = talloc_zero(mem_ctx, struct policy_handle);
45914 0 : return self;
45915 : }
45916 :
45917 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
45918 : {
45919 :
45920 :
45921 0 : return PyLong_FromLong(61);
45922 : }
45923 :
45924 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
45925 : {
45926 0 : const struct ndr_interface_call *call = NULL;
45927 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
45928 0 : PyObject *ret = NULL;
45929 0 : struct ndr_push *push = NULL;
45930 0 : DATA_BLOB blob;
45931 0 : enum ndr_err_code err;
45932 :
45933 0 : if (ndr_table_svcctl.num_calls < 62) {
45934 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManager2_ndr_pack");
45935 0 : return NULL;
45936 : }
45937 0 : call = &ndr_table_svcctl.calls[61];
45938 :
45939 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45940 0 : if (push == NULL) {
45941 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45942 0 : return NULL;
45943 : }
45944 :
45945 0 : push->flags |= ndr_push_flags;
45946 :
45947 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45948 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45949 0 : TALLOC_FREE(push);
45950 0 : PyErr_SetNdrError(err);
45951 0 : return NULL;
45952 : }
45953 0 : blob = ndr_push_blob(push);
45954 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45955 0 : TALLOC_FREE(push);
45956 0 : return ret;
45957 : }
45958 :
45959 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45960 : {
45961 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45962 0 : PyObject *bigendian_obj = NULL;
45963 0 : PyObject *ndr64_obj = NULL;
45964 0 : libndr_flags ndr_push_flags = 0;
45965 :
45966 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45967 : discard_const_p(char *, kwnames),
45968 : &bigendian_obj,
45969 : &ndr64_obj)) {
45970 0 : return NULL;
45971 : }
45972 :
45973 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45974 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45975 : }
45976 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45977 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45978 : }
45979 :
45980 0 : return py_svcctl_OpenSCManager2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45981 : }
45982 :
45983 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45984 : {
45985 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45986 0 : PyObject *bigendian_obj = NULL;
45987 0 : PyObject *ndr64_obj = NULL;
45988 0 : libndr_flags ndr_push_flags = 0;
45989 :
45990 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45991 : discard_const_p(char *, kwnames),
45992 : &bigendian_obj,
45993 : &ndr64_obj)) {
45994 0 : return NULL;
45995 : }
45996 :
45997 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45998 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45999 : }
46000 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46001 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46002 : }
46003 :
46004 0 : return py_svcctl_OpenSCManager2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
46005 : }
46006 :
46007 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
46008 : {
46009 0 : const struct ndr_interface_call *call = NULL;
46010 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
46011 0 : struct ndr_pull *pull = NULL;
46012 0 : enum ndr_err_code err;
46013 :
46014 0 : if (ndr_table_svcctl.num_calls < 62) {
46015 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManager2_ndr_unpack");
46016 0 : return NULL;
46017 : }
46018 0 : call = &ndr_table_svcctl.calls[61];
46019 :
46020 0 : pull = ndr_pull_init_blob(blob, object);
46021 0 : if (pull == NULL) {
46022 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46023 0 : return NULL;
46024 : }
46025 :
46026 0 : pull->flags |= ndr_pull_flags;
46027 :
46028 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
46029 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46030 0 : TALLOC_FREE(pull);
46031 0 : PyErr_SetNdrError(err);
46032 0 : return NULL;
46033 : }
46034 0 : if (!allow_remaining) {
46035 0 : uint32_t highest_ofs;
46036 :
46037 0 : if (pull->offset > pull->relative_highest_offset) {
46038 0 : highest_ofs = pull->offset;
46039 : } else {
46040 0 : highest_ofs = pull->relative_highest_offset;
46041 : }
46042 0 : if (highest_ofs < pull->data_size) {
46043 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
46044 : "not all bytes consumed ofs[%u] size[%u]",
46045 : highest_ofs, pull->data_size);
46046 0 : TALLOC_FREE(pull);
46047 0 : PyErr_SetNdrError(err);
46048 0 : return NULL;
46049 : }
46050 : }
46051 :
46052 0 : TALLOC_FREE(pull);
46053 0 : Py_RETURN_NONE;
46054 : }
46055 :
46056 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46057 : {
46058 0 : DATA_BLOB blob;
46059 0 : Py_ssize_t blob_length = 0;
46060 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46061 0 : PyObject *bigendian_obj = NULL;
46062 0 : PyObject *ndr64_obj = NULL;
46063 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46064 0 : PyObject *allow_remaining_obj = NULL;
46065 0 : bool allow_remaining = false;
46066 :
46067 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46068 : discard_const_p(char *, kwnames),
46069 : &blob.data, &blob_length,
46070 : &bigendian_obj,
46071 : &ndr64_obj,
46072 : &allow_remaining_obj)) {
46073 0 : return NULL;
46074 : }
46075 0 : blob.length = blob_length;
46076 :
46077 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46078 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46079 : }
46080 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46081 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46082 : }
46083 :
46084 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46085 0 : allow_remaining = true;
46086 : }
46087 :
46088 0 : return py_svcctl_OpenSCManager2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46089 : }
46090 :
46091 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46092 : {
46093 0 : DATA_BLOB blob;
46094 0 : Py_ssize_t blob_length = 0;
46095 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46096 0 : PyObject *bigendian_obj = NULL;
46097 0 : PyObject *ndr64_obj = NULL;
46098 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46099 0 : PyObject *allow_remaining_obj = NULL;
46100 0 : bool allow_remaining = false;
46101 :
46102 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46103 : discard_const_p(char *, kwnames),
46104 : &blob.data, &blob_length,
46105 : &bigendian_obj,
46106 : &ndr64_obj,
46107 : &allow_remaining_obj)) {
46108 0 : return NULL;
46109 : }
46110 0 : blob.length = blob_length;
46111 :
46112 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46113 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46114 : }
46115 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46116 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46117 : }
46118 :
46119 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46120 0 : allow_remaining = true;
46121 : }
46122 :
46123 0 : return py_svcctl_OpenSCManager2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46124 : }
46125 :
46126 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
46127 : {
46128 0 : const struct ndr_interface_call *call = NULL;
46129 0 : struct svcctl_OpenSCManager2 *object = (struct svcctl_OpenSCManager2 *)pytalloc_get_ptr(py_obj);
46130 0 : PyObject *ret;
46131 0 : char *retstr;
46132 :
46133 0 : if (ndr_table_svcctl.num_calls < 62) {
46134 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManager2_ndr_print");
46135 0 : return NULL;
46136 : }
46137 0 : call = &ndr_table_svcctl.calls[61];
46138 :
46139 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
46140 0 : ret = PyUnicode_FromString(retstr);
46141 0 : TALLOC_FREE(retstr);
46142 :
46143 0 : return ret;
46144 : }
46145 :
46146 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46147 : {
46148 0 : return py_svcctl_OpenSCManager2_ndr_print(py_obj, "svcctl_OpenSCManager2_in", NDR_IN);
46149 : }
46150 :
46151 0 : static PyObject *py_svcctl_OpenSCManager2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46152 : {
46153 0 : return py_svcctl_OpenSCManager2_ndr_print(py_obj, "svcctl_OpenSCManager2_out", NDR_OUT);
46154 : }
46155 :
46156 : static PyMethodDef py_svcctl_OpenSCManager2_methods[] = {
46157 : { "opnum", (PyCFunction)py_svcctl_OpenSCManager2_ndr_opnum, METH_NOARGS|METH_CLASS,
46158 : "svcctl.OpenSCManager2.opnum() -> 61 (0x3d) " },
46159 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManager2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
46160 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
46161 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManager2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
46162 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
46163 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManager2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
46164 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
46165 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManager2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
46166 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
46167 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenSCManager2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
46168 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenSCManager2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
46169 : { NULL, NULL, 0, NULL }
46170 : };
46171 :
46172 :
46173 : static PyTypeObject svcctl_OpenSCManager2_Type = {
46174 : PyVarObject_HEAD_INIT(NULL, 0)
46175 : .tp_name = "svcctl.OpenSCManager2",
46176 : .tp_getset = py_svcctl_OpenSCManager2_getsetters,
46177 : .tp_methods = py_svcctl_OpenSCManager2_methods,
46178 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46179 : .tp_new = py_svcctl_OpenSCManager2_new,
46180 : };
46181 :
46182 0 : static bool pack_py_svcctl_OpenSCManager2_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenSCManager2 *r)
46183 : {
46184 0 : PyObject *py_BindingHandle;
46185 0 : PyObject *py_DatabaseName;
46186 0 : PyObject *py_DesiredAccess;
46187 0 : const char *kwnames[] = {
46188 : "BindingHandle", "DatabaseName", "DesiredAccess", NULL
46189 : };
46190 :
46191 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenSCManager2", discard_const_p(char *, kwnames), &py_BindingHandle, &py_DatabaseName, &py_DesiredAccess)) {
46192 0 : return false;
46193 : }
46194 :
46195 0 : if (py_BindingHandle == NULL) {
46196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.BindingHandle");
46197 0 : return false;
46198 : }
46199 0 : PY_CHECK_TYPE(policy_handle_Type, py_BindingHandle, return false;);
46200 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_BindingHandle)) == NULL) {
46201 0 : PyErr_NoMemory();
46202 0 : return false;
46203 : }
46204 0 : r->in.BindingHandle = *(struct policy_handle *)pytalloc_get_ptr(py_BindingHandle);
46205 0 : if (py_DatabaseName == NULL) {
46206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DatabaseName");
46207 0 : return false;
46208 : }
46209 0 : if (py_DatabaseName == Py_None) {
46210 0 : r->in.DatabaseName = NULL;
46211 : } else {
46212 0 : r->in.DatabaseName = NULL;
46213 : {
46214 0 : const char *test_str;
46215 0 : const char *talloc_str;
46216 0 : PyObject *unicode = NULL;
46217 0 : if (PyUnicode_Check(py_DatabaseName)) {
46218 0 : unicode = PyUnicode_AsEncodedString(py_DatabaseName, "utf-8", "ignore");
46219 0 : if (unicode == NULL) {
46220 0 : return false;
46221 : }
46222 0 : test_str = PyBytes_AS_STRING(unicode);
46223 0 : } else if (PyBytes_Check(py_DatabaseName)) {
46224 0 : test_str = PyBytes_AS_STRING(py_DatabaseName);
46225 : } else {
46226 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DatabaseName)->tp_name);
46227 0 : return false;
46228 : }
46229 0 : talloc_str = talloc_strdup(r, test_str);
46230 0 : if (unicode != NULL) {
46231 0 : Py_DECREF(unicode);
46232 : }
46233 0 : if (talloc_str == NULL) {
46234 0 : PyErr_NoMemory();
46235 0 : return false;
46236 : }
46237 0 : r->in.DatabaseName = talloc_str;
46238 : }
46239 : }
46240 0 : if (py_DesiredAccess == NULL) {
46241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DesiredAccess");
46242 0 : return false;
46243 : }
46244 : {
46245 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.DesiredAccess));
46246 0 : if (PyLong_Check(py_DesiredAccess)) {
46247 0 : unsigned long long test_var;
46248 0 : test_var = PyLong_AsUnsignedLongLong(py_DesiredAccess);
46249 0 : if (PyErr_Occurred() != NULL) {
46250 0 : return false;
46251 : }
46252 0 : if (test_var > uint_max) {
46253 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46254 : PyLong_Type.tp_name, uint_max, test_var);
46255 0 : return false;
46256 : }
46257 0 : r->in.DesiredAccess = test_var;
46258 : } else {
46259 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46260 : PyLong_Type.tp_name);
46261 0 : return false;
46262 : }
46263 : }
46264 0 : return true;
46265 : }
46266 :
46267 0 : static PyObject *unpack_py_svcctl_OpenSCManager2_args_out(struct svcctl_OpenSCManager2 *r)
46268 : {
46269 0 : PyObject *result;
46270 0 : PyObject *py_ScmHandle;
46271 0 : py_ScmHandle = pytalloc_reference_ex(policy_handle_Type, r->out.ScmHandle, r->out.ScmHandle);
46272 0 : result = py_ScmHandle;
46273 0 : if (!W_ERROR_IS_OK(r->out.result)) {
46274 0 : PyErr_SetWERROR(r->out.result);
46275 0 : return NULL;
46276 : }
46277 :
46278 0 : return result;
46279 : }
46280 :
46281 : const struct PyNdrRpcMethodDef py_ndr_svcctl_methods[] = {
46282 : { "CloseServiceHandle", "S.CloseServiceHandle(handle) -> handle", (py_dcerpc_call_fn)dcerpc_svcctl_CloseServiceHandle_r, (py_data_pack_fn)pack_py_svcctl_CloseServiceHandle_args_in, (py_data_unpack_fn)unpack_py_svcctl_CloseServiceHandle_args_out, 0, &ndr_table_svcctl },
46283 : { "ControlService", "S.ControlService(handle, control) -> service_status", (py_dcerpc_call_fn)dcerpc_svcctl_ControlService_r, (py_data_pack_fn)pack_py_svcctl_ControlService_args_in, (py_data_unpack_fn)unpack_py_svcctl_ControlService_args_out, 1, &ndr_table_svcctl },
46284 : { "DeleteService", "S.DeleteService(handle) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_DeleteService_r, (py_data_pack_fn)pack_py_svcctl_DeleteService_args_in, (py_data_unpack_fn)unpack_py_svcctl_DeleteService_args_out, 2, &ndr_table_svcctl },
46285 : { "LockServiceDatabase", "S.LockServiceDatabase(handle) -> lock", (py_dcerpc_call_fn)dcerpc_svcctl_LockServiceDatabase_r, (py_data_pack_fn)pack_py_svcctl_LockServiceDatabase_args_in, (py_data_unpack_fn)unpack_py_svcctl_LockServiceDatabase_args_out, 3, &ndr_table_svcctl },
46286 : { "QueryServiceObjectSecurity", "S.QueryServiceObjectSecurity(handle, security_flags, offered) -> (buffer, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceObjectSecurity_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceObjectSecurity_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceObjectSecurity_args_out, 4, &ndr_table_svcctl },
46287 : { "SetServiceObjectSecurity", "S.SetServiceObjectSecurity(handle, security_flags, buffer) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_SetServiceObjectSecurity_r, (py_data_pack_fn)pack_py_svcctl_SetServiceObjectSecurity_args_in, (py_data_unpack_fn)unpack_py_svcctl_SetServiceObjectSecurity_args_out, 5, &ndr_table_svcctl },
46288 : { "QueryServiceStatus", "S.QueryServiceStatus(handle) -> service_status", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceStatus_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceStatus_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceStatus_args_out, 6, &ndr_table_svcctl },
46289 : { "UnlockServiceDatabase", "S.UnlockServiceDatabase(lock) -> lock", (py_dcerpc_call_fn)dcerpc_svcctl_UnlockServiceDatabase_r, (py_data_pack_fn)pack_py_svcctl_UnlockServiceDatabase_args_in, (py_data_unpack_fn)unpack_py_svcctl_UnlockServiceDatabase_args_out, 8, &ndr_table_svcctl },
46290 : { "SCSetServiceBitsW", "S.SCSetServiceBitsW(handle, bits, bitson, immediate) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_SCSetServiceBitsW_r, (py_data_pack_fn)pack_py_svcctl_SCSetServiceBitsW_args_in, (py_data_unpack_fn)unpack_py_svcctl_SCSetServiceBitsW_args_out, 10, &ndr_table_svcctl },
46291 : { "ChangeServiceConfigW", "S.ChangeServiceConfigW(handle, type, start_type, error_control, binary_path, load_order_group, tag_id, dependencies, service_start_name, password, display_name) -> tag_id", (py_dcerpc_call_fn)dcerpc_svcctl_ChangeServiceConfigW_r, (py_data_pack_fn)pack_py_svcctl_ChangeServiceConfigW_args_in, (py_data_unpack_fn)unpack_py_svcctl_ChangeServiceConfigW_args_out, 11, &ndr_table_svcctl },
46292 : { "CreateServiceW", "S.CreateServiceW(scmanager_handle, ServiceName, DisplayName, desired_access, type, start_type, error_control, binary_path, LoadOrderGroupKey, TagId, dependencies, service_start_name, password) -> (TagId, handle)", (py_dcerpc_call_fn)dcerpc_svcctl_CreateServiceW_r, (py_data_pack_fn)pack_py_svcctl_CreateServiceW_args_in, (py_data_unpack_fn)unpack_py_svcctl_CreateServiceW_args_out, 12, &ndr_table_svcctl },
46293 : { "EnumDependentServicesW", "S.EnumDependentServicesW(service, state, offered) -> (service_status, needed, services_returned)", (py_dcerpc_call_fn)dcerpc_svcctl_EnumDependentServicesW_r, (py_data_pack_fn)pack_py_svcctl_EnumDependentServicesW_args_in, (py_data_unpack_fn)unpack_py_svcctl_EnumDependentServicesW_args_out, 13, &ndr_table_svcctl },
46294 : { "EnumServicesStatusW", "S.EnumServicesStatusW(handle, type, state, offered, resume_handle) -> (service, needed, services_returned, resume_handle)", (py_dcerpc_call_fn)dcerpc_svcctl_EnumServicesStatusW_r, (py_data_pack_fn)pack_py_svcctl_EnumServicesStatusW_args_in, (py_data_unpack_fn)unpack_py_svcctl_EnumServicesStatusW_args_out, 14, &ndr_table_svcctl },
46295 : { "OpenSCManagerW", "S.OpenSCManagerW(MachineName, DatabaseName, access_mask) -> handle", (py_dcerpc_call_fn)dcerpc_svcctl_OpenSCManagerW_r, (py_data_pack_fn)pack_py_svcctl_OpenSCManagerW_args_in, (py_data_unpack_fn)unpack_py_svcctl_OpenSCManagerW_args_out, 15, &ndr_table_svcctl },
46296 : { "OpenServiceW", "S.OpenServiceW(scmanager_handle, ServiceName, access_mask) -> handle", (py_dcerpc_call_fn)dcerpc_svcctl_OpenServiceW_r, (py_data_pack_fn)pack_py_svcctl_OpenServiceW_args_in, (py_data_unpack_fn)unpack_py_svcctl_OpenServiceW_args_out, 16, &ndr_table_svcctl },
46297 : { "QueryServiceConfigW", "S.QueryServiceConfigW(handle, offered) -> (query, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceConfigW_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceConfigW_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceConfigW_args_out, 17, &ndr_table_svcctl },
46298 : { "QueryServiceLockStatusW", "S.QueryServiceLockStatusW(handle, offered) -> (lock_status, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceLockStatusW_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceLockStatusW_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceLockStatusW_args_out, 18, &ndr_table_svcctl },
46299 : { "StartServiceW", "S.StartServiceW(handle, Arguments) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_StartServiceW_r, (py_data_pack_fn)pack_py_svcctl_StartServiceW_args_in, (py_data_unpack_fn)unpack_py_svcctl_StartServiceW_args_out, 19, &ndr_table_svcctl },
46300 : { "GetServiceDisplayNameW", "S.GetServiceDisplayNameW(handle, service_name, display_name_length) -> (display_name, display_name_length)", (py_dcerpc_call_fn)dcerpc_svcctl_GetServiceDisplayNameW_r, (py_data_pack_fn)pack_py_svcctl_GetServiceDisplayNameW_args_in, (py_data_unpack_fn)unpack_py_svcctl_GetServiceDisplayNameW_args_out, 20, &ndr_table_svcctl },
46301 : { "GetServiceKeyNameW", "S.GetServiceKeyNameW(handle, service_name, display_name_length) -> (key_name, display_name_length)", (py_dcerpc_call_fn)dcerpc_svcctl_GetServiceKeyNameW_r, (py_data_pack_fn)pack_py_svcctl_GetServiceKeyNameW_args_in, (py_data_unpack_fn)unpack_py_svcctl_GetServiceKeyNameW_args_out, 21, &ndr_table_svcctl },
46302 : { "SCSetServiceBitsA", "S.SCSetServiceBitsA(handle, bits, bitson, immediate) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_SCSetServiceBitsA_r, (py_data_pack_fn)pack_py_svcctl_SCSetServiceBitsA_args_in, (py_data_unpack_fn)unpack_py_svcctl_SCSetServiceBitsA_args_out, 22, &ndr_table_svcctl },
46303 : { "ChangeServiceConfigA", "S.ChangeServiceConfigA(handle, type, start_type, error_control, binary_path, load_order_group, dependencies, service_start_name, password, display_name) -> tag_id", (py_dcerpc_call_fn)dcerpc_svcctl_ChangeServiceConfigA_r, (py_data_pack_fn)pack_py_svcctl_ChangeServiceConfigA_args_in, (py_data_unpack_fn)unpack_py_svcctl_ChangeServiceConfigA_args_out, 23, &ndr_table_svcctl },
46304 : { "CreateServiceA", "S.CreateServiceA(handle, ServiceName, DisplayName, desired_access, type, start_type, error_control, binary_path, LoadOrderGroupKey, dependencies, service_start_name, password) -> TagId", (py_dcerpc_call_fn)dcerpc_svcctl_CreateServiceA_r, (py_data_pack_fn)pack_py_svcctl_CreateServiceA_args_in, (py_data_unpack_fn)unpack_py_svcctl_CreateServiceA_args_out, 24, &ndr_table_svcctl },
46305 : { "EnumDependentServicesA", "S.EnumDependentServicesA(service, state, offered) -> (service_status, needed, services_returned)", (py_dcerpc_call_fn)dcerpc_svcctl_EnumDependentServicesA_r, (py_data_pack_fn)pack_py_svcctl_EnumDependentServicesA_args_in, (py_data_unpack_fn)unpack_py_svcctl_EnumDependentServicesA_args_out, 25, &ndr_table_svcctl },
46306 : { "EnumServicesStatusA", "S.EnumServicesStatusA(handle, type, state, offered, resume_handle) -> (service, needed, services_returned, resume_handle)", (py_dcerpc_call_fn)dcerpc_svcctl_EnumServicesStatusA_r, (py_data_pack_fn)pack_py_svcctl_EnumServicesStatusA_args_in, (py_data_unpack_fn)unpack_py_svcctl_EnumServicesStatusA_args_out, 26, &ndr_table_svcctl },
46307 : { "OpenSCManagerA", "S.OpenSCManagerA(MachineName, DatabaseName, access_mask) -> handle", (py_dcerpc_call_fn)dcerpc_svcctl_OpenSCManagerA_r, (py_data_pack_fn)pack_py_svcctl_OpenSCManagerA_args_in, (py_data_unpack_fn)unpack_py_svcctl_OpenSCManagerA_args_out, 27, &ndr_table_svcctl },
46308 : { "OpenServiceA", "S.OpenServiceA(scmanager_handle, ServiceName, access_mask) -> handle", (py_dcerpc_call_fn)dcerpc_svcctl_OpenServiceA_r, (py_data_pack_fn)pack_py_svcctl_OpenServiceA_args_in, (py_data_unpack_fn)unpack_py_svcctl_OpenServiceA_args_out, 28, &ndr_table_svcctl },
46309 : { "QueryServiceConfigA", "S.QueryServiceConfigA(handle, offered) -> (query, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceConfigA_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceConfigA_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceConfigA_args_out, 29, &ndr_table_svcctl },
46310 : { "QueryServiceLockStatusA", "S.QueryServiceLockStatusA(handle, offered) -> (lock_status, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceLockStatusA_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceLockStatusA_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceLockStatusA_args_out, 30, &ndr_table_svcctl },
46311 : { "StartServiceA", "S.StartServiceA(handle, NumArgs, Arguments) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_StartServiceA_r, (py_data_pack_fn)pack_py_svcctl_StartServiceA_args_in, (py_data_unpack_fn)unpack_py_svcctl_StartServiceA_args_out, 31, &ndr_table_svcctl },
46312 : { "GetServiceDisplayNameA", "S.GetServiceDisplayNameA(handle, service_name, display_name_length) -> (display_name, display_name_length)", (py_dcerpc_call_fn)dcerpc_svcctl_GetServiceDisplayNameA_r, (py_data_pack_fn)pack_py_svcctl_GetServiceDisplayNameA_args_in, (py_data_unpack_fn)unpack_py_svcctl_GetServiceDisplayNameA_args_out, 32, &ndr_table_svcctl },
46313 : { "GetServiceKeyNameA", "S.GetServiceKeyNameA(handle, service_name, display_name_length) -> (key_name, display_name_length)", (py_dcerpc_call_fn)dcerpc_svcctl_GetServiceKeyNameA_r, (py_data_pack_fn)pack_py_svcctl_GetServiceKeyNameA_args_in, (py_data_unpack_fn)unpack_py_svcctl_GetServiceKeyNameA_args_out, 33, &ndr_table_svcctl },
46314 : { "ChangeServiceConfig2A", "S.ChangeServiceConfig2A(handle, info_level, info) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_ChangeServiceConfig2A_r, (py_data_pack_fn)pack_py_svcctl_ChangeServiceConfig2A_args_in, (py_data_unpack_fn)unpack_py_svcctl_ChangeServiceConfig2A_args_out, 36, &ndr_table_svcctl },
46315 : { "ChangeServiceConfig2W", "S.ChangeServiceConfig2W(handle, info_level, info) -> None", (py_dcerpc_call_fn)dcerpc_svcctl_ChangeServiceConfig2W_r, (py_data_pack_fn)pack_py_svcctl_ChangeServiceConfig2W_args_in, (py_data_unpack_fn)unpack_py_svcctl_ChangeServiceConfig2W_args_out, 37, &ndr_table_svcctl },
46316 : { "QueryServiceConfig2A", "S.QueryServiceConfig2A(handle, info_level, offered) -> (buffer, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceConfig2A_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceConfig2A_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceConfig2A_args_out, 38, &ndr_table_svcctl },
46317 : { "QueryServiceConfig2W", "S.QueryServiceConfig2W(handle, info_level, offered) -> (buffer, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceConfig2W_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceConfig2W_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceConfig2W_args_out, 39, &ndr_table_svcctl },
46318 : { "QueryServiceStatusEx", "S.QueryServiceStatusEx(handle, info_level, offered) -> (buffer, needed)", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceStatusEx_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceStatusEx_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceStatusEx_args_out, 40, &ndr_table_svcctl },
46319 : { "EnumServicesStatusExA", "S.EnumServicesStatusExA(scmanager, info_level, type, state, offered, resume_handle) -> (services, needed, service_returned, resume_handle, group_name)", (py_dcerpc_call_fn)dcerpc_svcctl_EnumServicesStatusExA_r, (py_data_pack_fn)pack_py_svcctl_EnumServicesStatusExA_args_in, (py_data_unpack_fn)unpack_py_svcctl_EnumServicesStatusExA_args_out, 41, &ndr_table_svcctl },
46320 : { "EnumServicesStatusExW", "S.EnumServicesStatusExW(scmanager, info_level, type, state, offered, resume_handle, group_name) -> (services, needed, service_returned, resume_handle)", (py_dcerpc_call_fn)dcerpc_svcctl_EnumServicesStatusExW_r, (py_data_pack_fn)pack_py_svcctl_EnumServicesStatusExW_args_in, (py_data_unpack_fn)unpack_py_svcctl_EnumServicesStatusExW_args_out, 42, &ndr_table_svcctl },
46321 : { "CreateServiceWOW64A", "S.CreateServiceWOW64A(hSCManager, lpServiceName, lpDisplayName, dwDesiredAccess, dwServiceType, dwStartType, dwErrorControl, lpBinaryPathName, lpLoadOrderGroup, lpdwTagId, lpDependencies, lpServiceStartName, lpPassword) -> (lpdwTagId, lpServiceHandle)", (py_dcerpc_call_fn)dcerpc_svcctl_CreateServiceWOW64A_r, (py_data_pack_fn)pack_py_svcctl_CreateServiceWOW64A_args_in, (py_data_unpack_fn)unpack_py_svcctl_CreateServiceWOW64A_args_out, 44, &ndr_table_svcctl },
46322 : { "CreateServiceWOW64W", "S.CreateServiceWOW64W(hSCManager, lpServiceName, lpDisplayName, dwDesiredAccess, dwServiceType, dwStartType, dwErrorControl, lpBinaryPathName, lpLoadOrderGroup, lpdwTagId, lpDependencies, lpServiceStartName, lpPassword) -> (lpdwTagId, lpServiceHandle)", (py_dcerpc_call_fn)dcerpc_svcctl_CreateServiceWOW64W_r, (py_data_pack_fn)pack_py_svcctl_CreateServiceWOW64W_args_in, (py_data_unpack_fn)unpack_py_svcctl_CreateServiceWOW64W_args_out, 45, &ndr_table_svcctl },
46323 : { "Opnum46NotUsedOnWire", "S.Opnum46NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum46NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum46NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum46NotUsedOnWire_args_out, 46, &ndr_table_svcctl },
46324 : { "NotifyServiceStatusChange", "S.NotifyServiceStatusChange(hService, NotifyParams, pClientProcessGuid) -> (pSCMProcessGuid, pfCreateRemoteQueue, phNotify)", (py_dcerpc_call_fn)dcerpc_svcctl_NotifyServiceStatusChange_r, (py_data_pack_fn)pack_py_svcctl_NotifyServiceStatusChange_args_in, (py_data_unpack_fn)unpack_py_svcctl_NotifyServiceStatusChange_args_out, 47, &ndr_table_svcctl },
46325 : { "GetNotifyResults", "S.GetNotifyResults(hNotify) -> ppNotifyParams", (py_dcerpc_call_fn)dcerpc_svcctl_GetNotifyResults_r, (py_data_pack_fn)pack_py_svcctl_GetNotifyResults_args_in, (py_data_unpack_fn)unpack_py_svcctl_GetNotifyResults_args_out, 48, &ndr_table_svcctl },
46326 : { "CloseNotifyHandle", "S.CloseNotifyHandle(phNotify) -> (phNotify, pfApcFired)", (py_dcerpc_call_fn)dcerpc_svcctl_CloseNotifyHandle_r, (py_data_pack_fn)pack_py_svcctl_CloseNotifyHandle_args_in, (py_data_unpack_fn)unpack_py_svcctl_CloseNotifyHandle_args_out, 49, &ndr_table_svcctl },
46327 : { "ControlServiceExA", "S.ControlServiceExA(hService, dwControl, dwInfoLevel, pControlInParams) -> pControlOutParams", (py_dcerpc_call_fn)dcerpc_svcctl_ControlServiceExA_r, (py_data_pack_fn)pack_py_svcctl_ControlServiceExA_args_in, (py_data_unpack_fn)unpack_py_svcctl_ControlServiceExA_args_out, 50, &ndr_table_svcctl },
46328 : { "ControlServiceExW", "S.ControlServiceExW(hService, dwControl, dwInfoLevel, pControlInParams) -> pControlOutParams", (py_dcerpc_call_fn)dcerpc_svcctl_ControlServiceExW_r, (py_data_pack_fn)pack_py_svcctl_ControlServiceExW_args_in, (py_data_unpack_fn)unpack_py_svcctl_ControlServiceExW_args_out, 51, &ndr_table_svcctl },
46329 : { "Opnum52NotUsedOnWire", "S.Opnum52NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum52NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum52NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum52NotUsedOnWire_args_out, 52, &ndr_table_svcctl },
46330 : { "Opnum53NotUsedOnWire", "S.Opnum53NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum53NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum53NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum53NotUsedOnWire_args_out, 53, &ndr_table_svcctl },
46331 : { "Opnum54NotUsedOnWire", "S.Opnum54NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum54NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum54NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum54NotUsedOnWire_args_out, 54, &ndr_table_svcctl },
46332 : { "Opnum55NotUsedOnWire", "S.Opnum55NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum55NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum55NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum55NotUsedOnWire_args_out, 55, &ndr_table_svcctl },
46333 : { "QueryServiceConfigEx", "S.QueryServiceConfigEx(hService, dwInfoLevel) -> pInfo", (py_dcerpc_call_fn)dcerpc_svcctl_QueryServiceConfigEx_r, (py_data_pack_fn)pack_py_svcctl_QueryServiceConfigEx_args_in, (py_data_unpack_fn)unpack_py_svcctl_QueryServiceConfigEx_args_out, 56, &ndr_table_svcctl },
46334 : { "Opnum57NotUsedOnWire", "S.Opnum57NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum57NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum57NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum57NotUsedOnWire_args_out, 57, &ndr_table_svcctl },
46335 : { "Opnum58NotUsedOnWire", "S.Opnum58NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum58NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum58NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum58NotUsedOnWire_args_out, 58, &ndr_table_svcctl },
46336 : { "Opnum59NotUsedOnWire", "S.Opnum59NotUsedOnWire() -> None", (py_dcerpc_call_fn)dcerpc_Opnum59NotUsedOnWire_r, (py_data_pack_fn)pack_py_Opnum59NotUsedOnWire_args_in, (py_data_unpack_fn)unpack_py_Opnum59NotUsedOnWire_args_out, 59, &ndr_table_svcctl },
46337 : { "CreateWowService", "S.CreateWowService(hSCManager, lpServiceName, lpDisplayName, dwDesiredAccess, dwServiceType, dwStartType, dwErrorControl, lpBinaryPathName, lpLoadOrderGroup, lpdwTagId, lpDependencies, lpServiceStartName, lpPassword, dwServiceWowType) -> (lpdwTagId, lpServiceHandle)", (py_dcerpc_call_fn)dcerpc_svcctl_CreateWowService_r, (py_data_pack_fn)pack_py_svcctl_CreateWowService_args_in, (py_data_unpack_fn)unpack_py_svcctl_CreateWowService_args_out, 60, &ndr_table_svcctl },
46338 : { "OpenSCManager2", "S.OpenSCManager2(BindingHandle, DatabaseName, DesiredAccess) -> ScmHandle", (py_dcerpc_call_fn)dcerpc_svcctl_OpenSCManager2_r, (py_data_pack_fn)pack_py_svcctl_OpenSCManager2_args_in, (py_data_unpack_fn)unpack_py_svcctl_OpenSCManager2_args_out, 61, &ndr_table_svcctl },
46339 : {0}
46340 : };
46341 :
46342 0 : static PyObject *interface_svcctl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46343 : {
46344 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_svcctl);
46345 : }
46346 :
46347 : #define PY_DOC_SVCCTL "Service Control"
46348 : static PyTypeObject svcctl_InterfaceType = {
46349 : PyVarObject_HEAD_INIT(NULL, 0)
46350 : .tp_name = "svcctl.svcctl",
46351 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
46352 : .tp_doc = "svcctl(binding, lp_ctx=None, credentials=None) -> connection\n"
46353 : "\n"
46354 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
46355 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
46356 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_SVCCTL,
46357 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46358 : .tp_new = interface_svcctl_new,
46359 : };
46360 :
46361 0 : static PyObject *syntax_svcctl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46362 : {
46363 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_svcctl.syntax_id);
46364 : }
46365 :
46366 : #define PY_DOC_SVCCTL_SYNTAX "Service Control"
46367 : static PyTypeObject svcctl_SyntaxType = {
46368 : PyVarObject_HEAD_INIT(NULL, 0)
46369 : .tp_name = "svcctl.svcctl_abstract_syntax",
46370 : .tp_doc = "svcctl_abstract_syntax()\n"PY_DOC_SVCCTL_SYNTAX,
46371 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46372 : .tp_new = syntax_svcctl_new,
46373 : };
46374 :
46375 : static PyMethodDef svcctl_methods[] = {
46376 : { NULL, NULL, 0, NULL }
46377 : };
46378 :
46379 : static struct PyModuleDef moduledef = {
46380 : PyModuleDef_HEAD_INIT,
46381 : .m_name = "svcctl",
46382 : .m_doc = "svcctl DCE/RPC",
46383 : .m_size = -1,
46384 : .m_methods = svcctl_methods,
46385 : };
46386 40 : MODULE_INIT_FUNC(svcctl)
46387 : {
46388 40 : PyObject *m = NULL;
46389 40 : PyObject *dep_samba_dcerpc_misc = NULL;
46390 40 : PyObject *dep_samba_dcerpc_security = NULL;
46391 40 : PyObject *dep_talloc = NULL;
46392 40 : PyObject *dep_samba_dcerpc_base = NULL;
46393 :
46394 40 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
46395 40 : if (dep_samba_dcerpc_misc == NULL)
46396 0 : goto out;
46397 :
46398 40 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
46399 40 : if (dep_samba_dcerpc_security == NULL)
46400 0 : goto out;
46401 :
46402 40 : dep_talloc = PyImport_ImportModule("talloc");
46403 40 : if (dep_talloc == NULL)
46404 0 : goto out;
46405 :
46406 40 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
46407 40 : if (dep_samba_dcerpc_base == NULL)
46408 0 : goto out;
46409 :
46410 40 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
46411 40 : if (BaseObject_Type == NULL)
46412 0 : goto out;
46413 :
46414 40 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
46415 40 : if (GUID_Type == NULL)
46416 0 : goto out;
46417 :
46418 40 : policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
46419 40 : if (policy_handle_Type == NULL)
46420 0 : goto out;
46421 :
46422 40 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
46423 40 : if (ClientConnection_Type == NULL)
46424 0 : goto out;
46425 :
46426 40 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
46427 40 : if (ndr_syntax_id_Type == NULL)
46428 0 : goto out;
46429 :
46430 40 : SERVICE_LOCK_STATUS_Type.tp_base = BaseObject_Type;
46431 40 : SERVICE_LOCK_STATUS_Type.tp_basicsize = pytalloc_BaseObject_size();
46432 :
46433 40 : SERVICE_STATUS_Type.tp_base = BaseObject_Type;
46434 40 : SERVICE_STATUS_Type.tp_basicsize = pytalloc_BaseObject_size();
46435 :
46436 40 : SERVICE_STATUS_PROCESS_Type.tp_base = BaseObject_Type;
46437 40 : SERVICE_STATUS_PROCESS_Type.tp_basicsize = pytalloc_BaseObject_size();
46438 :
46439 40 : ENUM_SERVICE_STATUSW_Type.tp_base = BaseObject_Type;
46440 40 : ENUM_SERVICE_STATUSW_Type.tp_basicsize = pytalloc_BaseObject_size();
46441 :
46442 40 : ENUM_SERVICE_STATUSA_Type.tp_base = BaseObject_Type;
46443 40 : ENUM_SERVICE_STATUSA_Type.tp_basicsize = pytalloc_BaseObject_size();
46444 :
46445 40 : QUERY_SERVICE_CONFIG_Type.tp_base = BaseObject_Type;
46446 40 : QUERY_SERVICE_CONFIG_Type.tp_basicsize = pytalloc_BaseObject_size();
46447 :
46448 40 : svcctl_ArgumentString_Type.tp_base = BaseObject_Type;
46449 40 : svcctl_ArgumentString_Type.tp_basicsize = pytalloc_BaseObject_size();
46450 :
46451 40 : SERVICE_DESCRIPTION_Type.tp_base = BaseObject_Type;
46452 40 : SERVICE_DESCRIPTION_Type.tp_basicsize = pytalloc_BaseObject_size();
46453 :
46454 40 : SC_ACTION_Type.tp_base = BaseObject_Type;
46455 40 : SC_ACTION_Type.tp_basicsize = pytalloc_BaseObject_size();
46456 :
46457 40 : SERVICE_FAILURE_ACTIONSW_Type.tp_base = BaseObject_Type;
46458 40 : SERVICE_FAILURE_ACTIONSW_Type.tp_basicsize = pytalloc_BaseObject_size();
46459 :
46460 40 : SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type.tp_base = BaseObject_Type;
46461 40 : SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type.tp_basicsize = pytalloc_BaseObject_size();
46462 :
46463 40 : SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type.tp_base = BaseObject_Type;
46464 40 : SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type.tp_basicsize = pytalloc_BaseObject_size();
46465 :
46466 40 : SC_RPC_NOTIFY_PARAMS_u_Type.tp_base = BaseObject_Type;
46467 40 : SC_RPC_NOTIFY_PARAMS_u_Type.tp_basicsize = pytalloc_BaseObject_size();
46468 :
46469 40 : SC_RPC_NOTIFY_PARAMS_Type.tp_base = BaseObject_Type;
46470 40 : SC_RPC_NOTIFY_PARAMS_Type.tp_basicsize = pytalloc_BaseObject_size();
46471 :
46472 40 : SC_RPC_NOTIFY_PARAMS_LIST_Type.tp_base = BaseObject_Type;
46473 40 : SC_RPC_NOTIFY_PARAMS_LIST_Type.tp_basicsize = pytalloc_BaseObject_size();
46474 :
46475 40 : SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type.tp_base = BaseObject_Type;
46476 40 : SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type.tp_basicsize = pytalloc_BaseObject_size();
46477 :
46478 40 : SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type.tp_base = BaseObject_Type;
46479 40 : SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type.tp_basicsize = pytalloc_BaseObject_size();
46480 :
46481 40 : SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type.tp_base = BaseObject_Type;
46482 40 : SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type.tp_basicsize = pytalloc_BaseObject_size();
46483 :
46484 40 : SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type.tp_base = BaseObject_Type;
46485 40 : SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type.tp_basicsize = pytalloc_BaseObject_size();
46486 :
46487 40 : SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type.tp_base = BaseObject_Type;
46488 40 : SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type.tp_basicsize = pytalloc_BaseObject_size();
46489 :
46490 40 : SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type.tp_base = BaseObject_Type;
46491 40 : SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type.tp_basicsize = pytalloc_BaseObject_size();
46492 :
46493 40 : SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type.tp_base = BaseObject_Type;
46494 40 : SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type.tp_basicsize = pytalloc_BaseObject_size();
46495 :
46496 40 : SERVICE_DESCRIPTIONW_Type.tp_base = BaseObject_Type;
46497 40 : SERVICE_DESCRIPTIONW_Type.tp_basicsize = pytalloc_BaseObject_size();
46498 :
46499 40 : SERVICE_DELAYED_AUTO_START_INFO_Type.tp_base = BaseObject_Type;
46500 40 : SERVICE_DELAYED_AUTO_START_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
46501 :
46502 40 : SERVICE_FAILURE_ACTIONS_FLAG_Type.tp_base = BaseObject_Type;
46503 40 : SERVICE_FAILURE_ACTIONS_FLAG_Type.tp_basicsize = pytalloc_BaseObject_size();
46504 :
46505 40 : SERVICE_SID_INFO_Type.tp_base = BaseObject_Type;
46506 40 : SERVICE_SID_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
46507 :
46508 40 : SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type.tp_base = BaseObject_Type;
46509 40 : SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
46510 :
46511 40 : SERVICE_PRESHUTDOWN_INFO_Type.tp_base = BaseObject_Type;
46512 40 : SERVICE_PRESHUTDOWN_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
46513 :
46514 40 : SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type.tp_base = BaseObject_Type;
46515 40 : SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type.tp_basicsize = pytalloc_BaseObject_size();
46516 :
46517 40 : SERVICE_TRIGGER_Type.tp_base = BaseObject_Type;
46518 40 : SERVICE_TRIGGER_Type.tp_basicsize = pytalloc_BaseObject_size();
46519 :
46520 40 : SERVICE_TRIGGER_INFO_Type.tp_base = BaseObject_Type;
46521 40 : SERVICE_TRIGGER_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
46522 :
46523 40 : SERVICE_PREFERRED_NODE_INFO_Type.tp_base = BaseObject_Type;
46524 40 : SERVICE_PREFERRED_NODE_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
46525 :
46526 40 : SC_RPC_CONFIG_INFOW_u_Type.tp_base = BaseObject_Type;
46527 40 : SC_RPC_CONFIG_INFOW_u_Type.tp_basicsize = pytalloc_BaseObject_size();
46528 :
46529 40 : SC_RPC_CONFIG_INFOW_Type.tp_base = BaseObject_Type;
46530 40 : SC_RPC_CONFIG_INFOW_Type.tp_basicsize = pytalloc_BaseObject_size();
46531 :
46532 40 : svcctl_CloseServiceHandle_Type.tp_base = BaseObject_Type;
46533 40 : svcctl_CloseServiceHandle_Type.tp_basicsize = pytalloc_BaseObject_size();
46534 :
46535 40 : svcctl_ControlService_Type.tp_base = BaseObject_Type;
46536 40 : svcctl_ControlService_Type.tp_basicsize = pytalloc_BaseObject_size();
46537 :
46538 40 : svcctl_DeleteService_Type.tp_base = BaseObject_Type;
46539 40 : svcctl_DeleteService_Type.tp_basicsize = pytalloc_BaseObject_size();
46540 :
46541 40 : svcctl_LockServiceDatabase_Type.tp_base = BaseObject_Type;
46542 40 : svcctl_LockServiceDatabase_Type.tp_basicsize = pytalloc_BaseObject_size();
46543 :
46544 40 : svcctl_QueryServiceObjectSecurity_Type.tp_base = BaseObject_Type;
46545 40 : svcctl_QueryServiceObjectSecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
46546 :
46547 40 : svcctl_SetServiceObjectSecurity_Type.tp_base = BaseObject_Type;
46548 40 : svcctl_SetServiceObjectSecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
46549 :
46550 40 : svcctl_QueryServiceStatus_Type.tp_base = BaseObject_Type;
46551 40 : svcctl_QueryServiceStatus_Type.tp_basicsize = pytalloc_BaseObject_size();
46552 :
46553 40 : svcctl_UnlockServiceDatabase_Type.tp_base = BaseObject_Type;
46554 40 : svcctl_UnlockServiceDatabase_Type.tp_basicsize = pytalloc_BaseObject_size();
46555 :
46556 40 : svcctl_SCSetServiceBitsW_Type.tp_base = BaseObject_Type;
46557 40 : svcctl_SCSetServiceBitsW_Type.tp_basicsize = pytalloc_BaseObject_size();
46558 :
46559 40 : svcctl_ChangeServiceConfigW_Type.tp_base = BaseObject_Type;
46560 40 : svcctl_ChangeServiceConfigW_Type.tp_basicsize = pytalloc_BaseObject_size();
46561 :
46562 40 : svcctl_CreateServiceW_Type.tp_base = BaseObject_Type;
46563 40 : svcctl_CreateServiceW_Type.tp_basicsize = pytalloc_BaseObject_size();
46564 :
46565 40 : svcctl_EnumDependentServicesW_Type.tp_base = BaseObject_Type;
46566 40 : svcctl_EnumDependentServicesW_Type.tp_basicsize = pytalloc_BaseObject_size();
46567 :
46568 40 : svcctl_EnumServicesStatusW_Type.tp_base = BaseObject_Type;
46569 40 : svcctl_EnumServicesStatusW_Type.tp_basicsize = pytalloc_BaseObject_size();
46570 :
46571 40 : svcctl_OpenSCManagerW_Type.tp_base = BaseObject_Type;
46572 40 : svcctl_OpenSCManagerW_Type.tp_basicsize = pytalloc_BaseObject_size();
46573 :
46574 40 : svcctl_OpenServiceW_Type.tp_base = BaseObject_Type;
46575 40 : svcctl_OpenServiceW_Type.tp_basicsize = pytalloc_BaseObject_size();
46576 :
46577 40 : svcctl_QueryServiceConfigW_Type.tp_base = BaseObject_Type;
46578 40 : svcctl_QueryServiceConfigW_Type.tp_basicsize = pytalloc_BaseObject_size();
46579 :
46580 40 : svcctl_QueryServiceLockStatusW_Type.tp_base = BaseObject_Type;
46581 40 : svcctl_QueryServiceLockStatusW_Type.tp_basicsize = pytalloc_BaseObject_size();
46582 :
46583 40 : svcctl_StartServiceW_Type.tp_base = BaseObject_Type;
46584 40 : svcctl_StartServiceW_Type.tp_basicsize = pytalloc_BaseObject_size();
46585 :
46586 40 : svcctl_GetServiceDisplayNameW_Type.tp_base = BaseObject_Type;
46587 40 : svcctl_GetServiceDisplayNameW_Type.tp_basicsize = pytalloc_BaseObject_size();
46588 :
46589 40 : svcctl_GetServiceKeyNameW_Type.tp_base = BaseObject_Type;
46590 40 : svcctl_GetServiceKeyNameW_Type.tp_basicsize = pytalloc_BaseObject_size();
46591 :
46592 40 : svcctl_SCSetServiceBitsA_Type.tp_base = BaseObject_Type;
46593 40 : svcctl_SCSetServiceBitsA_Type.tp_basicsize = pytalloc_BaseObject_size();
46594 :
46595 40 : svcctl_ChangeServiceConfigA_Type.tp_base = BaseObject_Type;
46596 40 : svcctl_ChangeServiceConfigA_Type.tp_basicsize = pytalloc_BaseObject_size();
46597 :
46598 40 : svcctl_CreateServiceA_Type.tp_base = BaseObject_Type;
46599 40 : svcctl_CreateServiceA_Type.tp_basicsize = pytalloc_BaseObject_size();
46600 :
46601 40 : svcctl_EnumDependentServicesA_Type.tp_base = BaseObject_Type;
46602 40 : svcctl_EnumDependentServicesA_Type.tp_basicsize = pytalloc_BaseObject_size();
46603 :
46604 40 : svcctl_EnumServicesStatusA_Type.tp_base = BaseObject_Type;
46605 40 : svcctl_EnumServicesStatusA_Type.tp_basicsize = pytalloc_BaseObject_size();
46606 :
46607 40 : svcctl_OpenSCManagerA_Type.tp_base = BaseObject_Type;
46608 40 : svcctl_OpenSCManagerA_Type.tp_basicsize = pytalloc_BaseObject_size();
46609 :
46610 40 : svcctl_OpenServiceA_Type.tp_base = BaseObject_Type;
46611 40 : svcctl_OpenServiceA_Type.tp_basicsize = pytalloc_BaseObject_size();
46612 :
46613 40 : svcctl_QueryServiceConfigA_Type.tp_base = BaseObject_Type;
46614 40 : svcctl_QueryServiceConfigA_Type.tp_basicsize = pytalloc_BaseObject_size();
46615 :
46616 40 : svcctl_QueryServiceLockStatusA_Type.tp_base = BaseObject_Type;
46617 40 : svcctl_QueryServiceLockStatusA_Type.tp_basicsize = pytalloc_BaseObject_size();
46618 :
46619 40 : svcctl_StartServiceA_Type.tp_base = BaseObject_Type;
46620 40 : svcctl_StartServiceA_Type.tp_basicsize = pytalloc_BaseObject_size();
46621 :
46622 40 : svcctl_GetServiceDisplayNameA_Type.tp_base = BaseObject_Type;
46623 40 : svcctl_GetServiceDisplayNameA_Type.tp_basicsize = pytalloc_BaseObject_size();
46624 :
46625 40 : svcctl_GetServiceKeyNameA_Type.tp_base = BaseObject_Type;
46626 40 : svcctl_GetServiceKeyNameA_Type.tp_basicsize = pytalloc_BaseObject_size();
46627 :
46628 40 : svcctl_ChangeServiceConfig2A_Type.tp_base = BaseObject_Type;
46629 40 : svcctl_ChangeServiceConfig2A_Type.tp_basicsize = pytalloc_BaseObject_size();
46630 :
46631 40 : svcctl_ChangeServiceConfig2W_Type.tp_base = BaseObject_Type;
46632 40 : svcctl_ChangeServiceConfig2W_Type.tp_basicsize = pytalloc_BaseObject_size();
46633 :
46634 40 : svcctl_QueryServiceConfig2A_Type.tp_base = BaseObject_Type;
46635 40 : svcctl_QueryServiceConfig2A_Type.tp_basicsize = pytalloc_BaseObject_size();
46636 :
46637 40 : svcctl_QueryServiceConfig2W_Type.tp_base = BaseObject_Type;
46638 40 : svcctl_QueryServiceConfig2W_Type.tp_basicsize = pytalloc_BaseObject_size();
46639 :
46640 40 : svcctl_QueryServiceStatusEx_Type.tp_base = BaseObject_Type;
46641 40 : svcctl_QueryServiceStatusEx_Type.tp_basicsize = pytalloc_BaseObject_size();
46642 :
46643 40 : svcctl_EnumServicesStatusExA_Type.tp_base = BaseObject_Type;
46644 40 : svcctl_EnumServicesStatusExA_Type.tp_basicsize = pytalloc_BaseObject_size();
46645 :
46646 40 : svcctl_EnumServicesStatusExW_Type.tp_base = BaseObject_Type;
46647 40 : svcctl_EnumServicesStatusExW_Type.tp_basicsize = pytalloc_BaseObject_size();
46648 :
46649 40 : svcctl_CreateServiceWOW64A_Type.tp_base = BaseObject_Type;
46650 40 : svcctl_CreateServiceWOW64A_Type.tp_basicsize = pytalloc_BaseObject_size();
46651 :
46652 40 : svcctl_CreateServiceWOW64W_Type.tp_base = BaseObject_Type;
46653 40 : svcctl_CreateServiceWOW64W_Type.tp_basicsize = pytalloc_BaseObject_size();
46654 :
46655 40 : Opnum46NotUsedOnWire_Type.tp_base = BaseObject_Type;
46656 40 : Opnum46NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46657 :
46658 40 : svcctl_NotifyServiceStatusChange_Type.tp_base = BaseObject_Type;
46659 40 : svcctl_NotifyServiceStatusChange_Type.tp_basicsize = pytalloc_BaseObject_size();
46660 :
46661 40 : svcctl_GetNotifyResults_Type.tp_base = BaseObject_Type;
46662 40 : svcctl_GetNotifyResults_Type.tp_basicsize = pytalloc_BaseObject_size();
46663 :
46664 40 : svcctl_CloseNotifyHandle_Type.tp_base = BaseObject_Type;
46665 40 : svcctl_CloseNotifyHandle_Type.tp_basicsize = pytalloc_BaseObject_size();
46666 :
46667 40 : svcctl_ControlServiceExA_Type.tp_base = BaseObject_Type;
46668 40 : svcctl_ControlServiceExA_Type.tp_basicsize = pytalloc_BaseObject_size();
46669 :
46670 40 : svcctl_ControlServiceExW_Type.tp_base = BaseObject_Type;
46671 40 : svcctl_ControlServiceExW_Type.tp_basicsize = pytalloc_BaseObject_size();
46672 :
46673 40 : Opnum52NotUsedOnWire_Type.tp_base = BaseObject_Type;
46674 40 : Opnum52NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46675 :
46676 40 : Opnum53NotUsedOnWire_Type.tp_base = BaseObject_Type;
46677 40 : Opnum53NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46678 :
46679 40 : Opnum54NotUsedOnWire_Type.tp_base = BaseObject_Type;
46680 40 : Opnum54NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46681 :
46682 40 : Opnum55NotUsedOnWire_Type.tp_base = BaseObject_Type;
46683 40 : Opnum55NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46684 :
46685 40 : svcctl_QueryServiceConfigEx_Type.tp_base = BaseObject_Type;
46686 40 : svcctl_QueryServiceConfigEx_Type.tp_basicsize = pytalloc_BaseObject_size();
46687 :
46688 40 : Opnum57NotUsedOnWire_Type.tp_base = BaseObject_Type;
46689 40 : Opnum57NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46690 :
46691 40 : Opnum58NotUsedOnWire_Type.tp_base = BaseObject_Type;
46692 40 : Opnum58NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46693 :
46694 40 : Opnum59NotUsedOnWire_Type.tp_base = BaseObject_Type;
46695 40 : Opnum59NotUsedOnWire_Type.tp_basicsize = pytalloc_BaseObject_size();
46696 :
46697 40 : svcctl_CreateWowService_Type.tp_base = BaseObject_Type;
46698 40 : svcctl_CreateWowService_Type.tp_basicsize = pytalloc_BaseObject_size();
46699 :
46700 40 : svcctl_OpenSCManager2_Type.tp_base = BaseObject_Type;
46701 40 : svcctl_OpenSCManager2_Type.tp_basicsize = pytalloc_BaseObject_size();
46702 :
46703 40 : svcctl_InterfaceType.tp_base = ClientConnection_Type;
46704 :
46705 40 : svcctl_SyntaxType.tp_base = ndr_syntax_id_Type;
46706 40 : svcctl_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
46707 :
46708 40 : if (PyType_Ready(&SERVICE_LOCK_STATUS_Type) < 0)
46709 0 : goto out;
46710 40 : if (PyType_Ready(&SERVICE_STATUS_Type) < 0)
46711 0 : goto out;
46712 40 : if (PyType_Ready(&SERVICE_STATUS_PROCESS_Type) < 0)
46713 0 : goto out;
46714 40 : if (PyType_Ready(&ENUM_SERVICE_STATUSW_Type) < 0)
46715 0 : goto out;
46716 40 : if (PyType_Ready(&ENUM_SERVICE_STATUSA_Type) < 0)
46717 0 : goto out;
46718 40 : if (PyType_Ready(&QUERY_SERVICE_CONFIG_Type) < 0)
46719 0 : goto out;
46720 40 : if (PyType_Ready(&svcctl_ArgumentString_Type) < 0)
46721 0 : goto out;
46722 40 : if (PyType_Ready(&SERVICE_DESCRIPTION_Type) < 0)
46723 0 : goto out;
46724 40 : if (PyType_Ready(&SC_ACTION_Type) < 0)
46725 0 : goto out;
46726 40 : if (PyType_Ready(&SERVICE_FAILURE_ACTIONSW_Type) < 0)
46727 0 : goto out;
46728 40 : if (PyType_Ready(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type) < 0)
46729 0 : goto out;
46730 40 : if (PyType_Ready(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type) < 0)
46731 0 : goto out;
46732 40 : if (PyType_Ready(&SC_RPC_NOTIFY_PARAMS_u_Type) < 0)
46733 0 : goto out;
46734 40 : if (PyType_Ready(&SC_RPC_NOTIFY_PARAMS_Type) < 0)
46735 0 : goto out;
46736 40 : if (PyType_Ready(&SC_RPC_NOTIFY_PARAMS_LIST_Type) < 0)
46737 0 : goto out;
46738 40 : if (PyType_Ready(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type) < 0)
46739 0 : goto out;
46740 40 : if (PyType_Ready(&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type) < 0)
46741 0 : goto out;
46742 40 : if (PyType_Ready(&SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type) < 0)
46743 0 : goto out;
46744 40 : if (PyType_Ready(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type) < 0)
46745 0 : goto out;
46746 40 : if (PyType_Ready(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type) < 0)
46747 0 : goto out;
46748 40 : if (PyType_Ready(&SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type) < 0)
46749 0 : goto out;
46750 40 : if (PyType_Ready(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type) < 0)
46751 0 : goto out;
46752 40 : if (PyType_Ready(&SERVICE_DESCRIPTIONW_Type) < 0)
46753 0 : goto out;
46754 40 : if (PyType_Ready(&SERVICE_DELAYED_AUTO_START_INFO_Type) < 0)
46755 0 : goto out;
46756 40 : if (PyType_Ready(&SERVICE_FAILURE_ACTIONS_FLAG_Type) < 0)
46757 0 : goto out;
46758 40 : if (PyType_Ready(&SERVICE_SID_INFO_Type) < 0)
46759 0 : goto out;
46760 40 : if (PyType_Ready(&SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type) < 0)
46761 0 : goto out;
46762 40 : if (PyType_Ready(&SERVICE_PRESHUTDOWN_INFO_Type) < 0)
46763 0 : goto out;
46764 40 : if (PyType_Ready(&SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type) < 0)
46765 0 : goto out;
46766 40 : if (PyType_Ready(&SERVICE_TRIGGER_Type) < 0)
46767 0 : goto out;
46768 40 : if (PyType_Ready(&SERVICE_TRIGGER_INFO_Type) < 0)
46769 0 : goto out;
46770 40 : if (PyType_Ready(&SERVICE_PREFERRED_NODE_INFO_Type) < 0)
46771 0 : goto out;
46772 40 : if (PyType_Ready(&SC_RPC_CONFIG_INFOW_u_Type) < 0)
46773 0 : goto out;
46774 40 : if (PyType_Ready(&SC_RPC_CONFIG_INFOW_Type) < 0)
46775 0 : goto out;
46776 40 : if (PyType_Ready(&svcctl_CloseServiceHandle_Type) < 0)
46777 0 : goto out;
46778 40 : if (PyType_Ready(&svcctl_ControlService_Type) < 0)
46779 0 : goto out;
46780 40 : if (PyType_Ready(&svcctl_DeleteService_Type) < 0)
46781 0 : goto out;
46782 40 : if (PyType_Ready(&svcctl_LockServiceDatabase_Type) < 0)
46783 0 : goto out;
46784 40 : if (PyType_Ready(&svcctl_QueryServiceObjectSecurity_Type) < 0)
46785 0 : goto out;
46786 40 : if (PyType_Ready(&svcctl_SetServiceObjectSecurity_Type) < 0)
46787 0 : goto out;
46788 40 : if (PyType_Ready(&svcctl_QueryServiceStatus_Type) < 0)
46789 0 : goto out;
46790 40 : if (PyType_Ready(&svcctl_UnlockServiceDatabase_Type) < 0)
46791 0 : goto out;
46792 40 : if (PyType_Ready(&svcctl_SCSetServiceBitsW_Type) < 0)
46793 0 : goto out;
46794 40 : if (PyType_Ready(&svcctl_ChangeServiceConfigW_Type) < 0)
46795 0 : goto out;
46796 40 : if (PyType_Ready(&svcctl_CreateServiceW_Type) < 0)
46797 0 : goto out;
46798 40 : if (PyType_Ready(&svcctl_EnumDependentServicesW_Type) < 0)
46799 0 : goto out;
46800 40 : if (PyType_Ready(&svcctl_EnumServicesStatusW_Type) < 0)
46801 0 : goto out;
46802 40 : if (PyType_Ready(&svcctl_OpenSCManagerW_Type) < 0)
46803 0 : goto out;
46804 40 : if (PyType_Ready(&svcctl_OpenServiceW_Type) < 0)
46805 0 : goto out;
46806 40 : if (PyType_Ready(&svcctl_QueryServiceConfigW_Type) < 0)
46807 0 : goto out;
46808 40 : if (PyType_Ready(&svcctl_QueryServiceLockStatusW_Type) < 0)
46809 0 : goto out;
46810 40 : if (PyType_Ready(&svcctl_StartServiceW_Type) < 0)
46811 0 : goto out;
46812 40 : if (PyType_Ready(&svcctl_GetServiceDisplayNameW_Type) < 0)
46813 0 : goto out;
46814 40 : if (PyType_Ready(&svcctl_GetServiceKeyNameW_Type) < 0)
46815 0 : goto out;
46816 40 : if (PyType_Ready(&svcctl_SCSetServiceBitsA_Type) < 0)
46817 0 : goto out;
46818 40 : if (PyType_Ready(&svcctl_ChangeServiceConfigA_Type) < 0)
46819 0 : goto out;
46820 40 : if (PyType_Ready(&svcctl_CreateServiceA_Type) < 0)
46821 0 : goto out;
46822 40 : if (PyType_Ready(&svcctl_EnumDependentServicesA_Type) < 0)
46823 0 : goto out;
46824 40 : if (PyType_Ready(&svcctl_EnumServicesStatusA_Type) < 0)
46825 0 : goto out;
46826 40 : if (PyType_Ready(&svcctl_OpenSCManagerA_Type) < 0)
46827 0 : goto out;
46828 40 : if (PyType_Ready(&svcctl_OpenServiceA_Type) < 0)
46829 0 : goto out;
46830 40 : if (PyType_Ready(&svcctl_QueryServiceConfigA_Type) < 0)
46831 0 : goto out;
46832 40 : if (PyType_Ready(&svcctl_QueryServiceLockStatusA_Type) < 0)
46833 0 : goto out;
46834 40 : if (PyType_Ready(&svcctl_StartServiceA_Type) < 0)
46835 0 : goto out;
46836 40 : if (PyType_Ready(&svcctl_GetServiceDisplayNameA_Type) < 0)
46837 0 : goto out;
46838 40 : if (PyType_Ready(&svcctl_GetServiceKeyNameA_Type) < 0)
46839 0 : goto out;
46840 40 : if (PyType_Ready(&svcctl_ChangeServiceConfig2A_Type) < 0)
46841 0 : goto out;
46842 40 : if (PyType_Ready(&svcctl_ChangeServiceConfig2W_Type) < 0)
46843 0 : goto out;
46844 40 : if (PyType_Ready(&svcctl_QueryServiceConfig2A_Type) < 0)
46845 0 : goto out;
46846 40 : if (PyType_Ready(&svcctl_QueryServiceConfig2W_Type) < 0)
46847 0 : goto out;
46848 40 : if (PyType_Ready(&svcctl_QueryServiceStatusEx_Type) < 0)
46849 0 : goto out;
46850 40 : if (PyType_Ready(&svcctl_EnumServicesStatusExA_Type) < 0)
46851 0 : goto out;
46852 40 : if (PyType_Ready(&svcctl_EnumServicesStatusExW_Type) < 0)
46853 0 : goto out;
46854 40 : if (PyType_Ready(&svcctl_CreateServiceWOW64A_Type) < 0)
46855 0 : goto out;
46856 40 : if (PyType_Ready(&svcctl_CreateServiceWOW64W_Type) < 0)
46857 0 : goto out;
46858 40 : if (PyType_Ready(&Opnum46NotUsedOnWire_Type) < 0)
46859 0 : goto out;
46860 40 : if (PyType_Ready(&svcctl_NotifyServiceStatusChange_Type) < 0)
46861 0 : goto out;
46862 40 : if (PyType_Ready(&svcctl_GetNotifyResults_Type) < 0)
46863 0 : goto out;
46864 40 : if (PyType_Ready(&svcctl_CloseNotifyHandle_Type) < 0)
46865 0 : goto out;
46866 40 : if (PyType_Ready(&svcctl_ControlServiceExA_Type) < 0)
46867 0 : goto out;
46868 40 : if (PyType_Ready(&svcctl_ControlServiceExW_Type) < 0)
46869 0 : goto out;
46870 40 : if (PyType_Ready(&Opnum52NotUsedOnWire_Type) < 0)
46871 0 : goto out;
46872 40 : if (PyType_Ready(&Opnum53NotUsedOnWire_Type) < 0)
46873 0 : goto out;
46874 40 : if (PyType_Ready(&Opnum54NotUsedOnWire_Type) < 0)
46875 0 : goto out;
46876 40 : if (PyType_Ready(&Opnum55NotUsedOnWire_Type) < 0)
46877 0 : goto out;
46878 40 : if (PyType_Ready(&svcctl_QueryServiceConfigEx_Type) < 0)
46879 0 : goto out;
46880 40 : if (PyType_Ready(&Opnum57NotUsedOnWire_Type) < 0)
46881 0 : goto out;
46882 40 : if (PyType_Ready(&Opnum58NotUsedOnWire_Type) < 0)
46883 0 : goto out;
46884 40 : if (PyType_Ready(&Opnum59NotUsedOnWire_Type) < 0)
46885 0 : goto out;
46886 40 : if (PyType_Ready(&svcctl_CreateWowService_Type) < 0)
46887 0 : goto out;
46888 40 : if (PyType_Ready(&svcctl_OpenSCManager2_Type) < 0)
46889 0 : goto out;
46890 40 : if (PyType_Ready(&svcctl_InterfaceType) < 0)
46891 0 : goto out;
46892 40 : if (PyType_Ready(&svcctl_SyntaxType) < 0)
46893 0 : goto out;
46894 40 : if (!PyInterface_AddNdrRpcMethods(&svcctl_InterfaceType, py_ndr_svcctl_methods))
46895 0 : return NULL;
46896 :
46897 : #ifdef PY_SERVICE_LOCK_STATUS_PATCH
46898 : PY_SERVICE_LOCK_STATUS_PATCH(&SERVICE_LOCK_STATUS_Type);
46899 : #endif
46900 : #ifdef PY_SERVICE_STATUS_PATCH
46901 : PY_SERVICE_STATUS_PATCH(&SERVICE_STATUS_Type);
46902 : #endif
46903 : #ifdef PY_SERVICE_STATUS_PROCESS_PATCH
46904 : PY_SERVICE_STATUS_PROCESS_PATCH(&SERVICE_STATUS_PROCESS_Type);
46905 : #endif
46906 : #ifdef PY_ENUM_SERVICE_STATUSW_PATCH
46907 : PY_ENUM_SERVICE_STATUSW_PATCH(&ENUM_SERVICE_STATUSW_Type);
46908 : #endif
46909 : #ifdef PY_ENUM_SERVICE_STATUSA_PATCH
46910 : PY_ENUM_SERVICE_STATUSA_PATCH(&ENUM_SERVICE_STATUSA_Type);
46911 : #endif
46912 : #ifdef PY_QUERY_SERVICE_CONFIG_PATCH
46913 : PY_QUERY_SERVICE_CONFIG_PATCH(&QUERY_SERVICE_CONFIG_Type);
46914 : #endif
46915 : #ifdef PY_ARGUMENTSTRING_PATCH
46916 : PY_ARGUMENTSTRING_PATCH(&svcctl_ArgumentString_Type);
46917 : #endif
46918 : #ifdef PY_SERVICE_DESCRIPTION_PATCH
46919 : PY_SERVICE_DESCRIPTION_PATCH(&SERVICE_DESCRIPTION_Type);
46920 : #endif
46921 : #ifdef PY_SC_ACTION_PATCH
46922 : PY_SC_ACTION_PATCH(&SC_ACTION_Type);
46923 : #endif
46924 : #ifdef PY_SERVICE_FAILURE_ACTIONSW_PATCH
46925 : PY_SERVICE_FAILURE_ACTIONSW_PATCH(&SERVICE_FAILURE_ACTIONSW_Type);
46926 : #endif
46927 : #ifdef PY_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_PATCH
46928 : PY_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_PATCH(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type);
46929 : #endif
46930 : #ifdef PY_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_PATCH
46931 : PY_SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_PATCH(&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type);
46932 : #endif
46933 : #ifdef PY_SC_RPC_NOTIFY_PARAMS_U_PATCH
46934 : PY_SC_RPC_NOTIFY_PARAMS_U_PATCH(&SC_RPC_NOTIFY_PARAMS_u_Type);
46935 : #endif
46936 : #ifdef PY_SC_RPC_NOTIFY_PARAMS_PATCH
46937 : PY_SC_RPC_NOTIFY_PARAMS_PATCH(&SC_RPC_NOTIFY_PARAMS_Type);
46938 : #endif
46939 : #ifdef PY_SC_RPC_NOTIFY_PARAMS_LIST_PATCH
46940 : PY_SC_RPC_NOTIFY_PARAMS_LIST_PATCH(&SC_RPC_NOTIFY_PARAMS_LIST_Type);
46941 : #endif
46942 : #ifdef PY_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_PATCH
46943 : PY_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_PATCH(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type);
46944 : #endif
46945 : #ifdef PY_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_PATCH
46946 : PY_SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_PATCH(&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type);
46947 : #endif
46948 : #ifdef PY_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_PATCH
46949 : PY_SC_RPC_SERVICE_CONTROL_IN_PARAMSA_PATCH(&SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type);
46950 : #endif
46951 : #ifdef PY_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_PATCH
46952 : PY_SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_PATCH(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type);
46953 : #endif
46954 : #ifdef PY_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_PATCH
46955 : PY_SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_PATCH(&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type);
46956 : #endif
46957 : #ifdef PY_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_PATCH
46958 : PY_SC_RPC_SERVICE_CONTROL_IN_PARAMSW_PATCH(&SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type);
46959 : #endif
46960 : #ifdef PY_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_PATCH
46961 : PY_SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_PATCH(&SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type);
46962 : #endif
46963 : #ifdef PY_SERVICE_DESCRIPTIONW_PATCH
46964 : PY_SERVICE_DESCRIPTIONW_PATCH(&SERVICE_DESCRIPTIONW_Type);
46965 : #endif
46966 : #ifdef PY_SERVICE_DELAYED_AUTO_START_INFO_PATCH
46967 : PY_SERVICE_DELAYED_AUTO_START_INFO_PATCH(&SERVICE_DELAYED_AUTO_START_INFO_Type);
46968 : #endif
46969 : #ifdef PY_SERVICE_FAILURE_ACTIONS_FLAG_PATCH
46970 : PY_SERVICE_FAILURE_ACTIONS_FLAG_PATCH(&SERVICE_FAILURE_ACTIONS_FLAG_Type);
46971 : #endif
46972 : #ifdef PY_SERVICE_SID_INFO_PATCH
46973 : PY_SERVICE_SID_INFO_PATCH(&SERVICE_SID_INFO_Type);
46974 : #endif
46975 : #ifdef PY_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_PATCH
46976 : PY_SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_PATCH(&SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type);
46977 : #endif
46978 : #ifdef PY_SERVICE_PRESHUTDOWN_INFO_PATCH
46979 : PY_SERVICE_PRESHUTDOWN_INFO_PATCH(&SERVICE_PRESHUTDOWN_INFO_Type);
46980 : #endif
46981 : #ifdef PY_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_PATCH
46982 : PY_SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_PATCH(&SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type);
46983 : #endif
46984 : #ifdef PY_SERVICE_TRIGGER_PATCH
46985 : PY_SERVICE_TRIGGER_PATCH(&SERVICE_TRIGGER_Type);
46986 : #endif
46987 : #ifdef PY_SERVICE_TRIGGER_INFO_PATCH
46988 : PY_SERVICE_TRIGGER_INFO_PATCH(&SERVICE_TRIGGER_INFO_Type);
46989 : #endif
46990 : #ifdef PY_SERVICE_PREFERRED_NODE_INFO_PATCH
46991 : PY_SERVICE_PREFERRED_NODE_INFO_PATCH(&SERVICE_PREFERRED_NODE_INFO_Type);
46992 : #endif
46993 : #ifdef PY_SC_RPC_CONFIG_INFOW_U_PATCH
46994 : PY_SC_RPC_CONFIG_INFOW_U_PATCH(&SC_RPC_CONFIG_INFOW_u_Type);
46995 : #endif
46996 : #ifdef PY_SC_RPC_CONFIG_INFOW_PATCH
46997 : PY_SC_RPC_CONFIG_INFOW_PATCH(&SC_RPC_CONFIG_INFOW_Type);
46998 : #endif
46999 : #ifdef PY_CLOSESERVICEHANDLE_PATCH
47000 : PY_CLOSESERVICEHANDLE_PATCH(&svcctl_CloseServiceHandle_Type);
47001 : #endif
47002 : #ifdef PY_CONTROLSERVICE_PATCH
47003 : PY_CONTROLSERVICE_PATCH(&svcctl_ControlService_Type);
47004 : #endif
47005 : #ifdef PY_DELETESERVICE_PATCH
47006 : PY_DELETESERVICE_PATCH(&svcctl_DeleteService_Type);
47007 : #endif
47008 : #ifdef PY_LOCKSERVICEDATABASE_PATCH
47009 : PY_LOCKSERVICEDATABASE_PATCH(&svcctl_LockServiceDatabase_Type);
47010 : #endif
47011 : #ifdef PY_QUERYSERVICEOBJECTSECURITY_PATCH
47012 : PY_QUERYSERVICEOBJECTSECURITY_PATCH(&svcctl_QueryServiceObjectSecurity_Type);
47013 : #endif
47014 : #ifdef PY_SETSERVICEOBJECTSECURITY_PATCH
47015 : PY_SETSERVICEOBJECTSECURITY_PATCH(&svcctl_SetServiceObjectSecurity_Type);
47016 : #endif
47017 : #ifdef PY_QUERYSERVICESTATUS_PATCH
47018 : PY_QUERYSERVICESTATUS_PATCH(&svcctl_QueryServiceStatus_Type);
47019 : #endif
47020 : #ifdef PY_UNLOCKSERVICEDATABASE_PATCH
47021 : PY_UNLOCKSERVICEDATABASE_PATCH(&svcctl_UnlockServiceDatabase_Type);
47022 : #endif
47023 : #ifdef PY_SCSETSERVICEBITSW_PATCH
47024 : PY_SCSETSERVICEBITSW_PATCH(&svcctl_SCSetServiceBitsW_Type);
47025 : #endif
47026 : #ifdef PY_CHANGESERVICECONFIGW_PATCH
47027 : PY_CHANGESERVICECONFIGW_PATCH(&svcctl_ChangeServiceConfigW_Type);
47028 : #endif
47029 : #ifdef PY_CREATESERVICEW_PATCH
47030 : PY_CREATESERVICEW_PATCH(&svcctl_CreateServiceW_Type);
47031 : #endif
47032 : #ifdef PY_ENUMDEPENDENTSERVICESW_PATCH
47033 : PY_ENUMDEPENDENTSERVICESW_PATCH(&svcctl_EnumDependentServicesW_Type);
47034 : #endif
47035 : #ifdef PY_ENUMSERVICESSTATUSW_PATCH
47036 : PY_ENUMSERVICESSTATUSW_PATCH(&svcctl_EnumServicesStatusW_Type);
47037 : #endif
47038 : #ifdef PY_OPENSCMANAGERW_PATCH
47039 : PY_OPENSCMANAGERW_PATCH(&svcctl_OpenSCManagerW_Type);
47040 : #endif
47041 : #ifdef PY_OPENSERVICEW_PATCH
47042 : PY_OPENSERVICEW_PATCH(&svcctl_OpenServiceW_Type);
47043 : #endif
47044 : #ifdef PY_QUERYSERVICECONFIGW_PATCH
47045 : PY_QUERYSERVICECONFIGW_PATCH(&svcctl_QueryServiceConfigW_Type);
47046 : #endif
47047 : #ifdef PY_QUERYSERVICELOCKSTATUSW_PATCH
47048 : PY_QUERYSERVICELOCKSTATUSW_PATCH(&svcctl_QueryServiceLockStatusW_Type);
47049 : #endif
47050 : #ifdef PY_STARTSERVICEW_PATCH
47051 : PY_STARTSERVICEW_PATCH(&svcctl_StartServiceW_Type);
47052 : #endif
47053 : #ifdef PY_GETSERVICEDISPLAYNAMEW_PATCH
47054 : PY_GETSERVICEDISPLAYNAMEW_PATCH(&svcctl_GetServiceDisplayNameW_Type);
47055 : #endif
47056 : #ifdef PY_GETSERVICEKEYNAMEW_PATCH
47057 : PY_GETSERVICEKEYNAMEW_PATCH(&svcctl_GetServiceKeyNameW_Type);
47058 : #endif
47059 : #ifdef PY_SCSETSERVICEBITSA_PATCH
47060 : PY_SCSETSERVICEBITSA_PATCH(&svcctl_SCSetServiceBitsA_Type);
47061 : #endif
47062 : #ifdef PY_CHANGESERVICECONFIGA_PATCH
47063 : PY_CHANGESERVICECONFIGA_PATCH(&svcctl_ChangeServiceConfigA_Type);
47064 : #endif
47065 : #ifdef PY_CREATESERVICEA_PATCH
47066 : PY_CREATESERVICEA_PATCH(&svcctl_CreateServiceA_Type);
47067 : #endif
47068 : #ifdef PY_ENUMDEPENDENTSERVICESA_PATCH
47069 : PY_ENUMDEPENDENTSERVICESA_PATCH(&svcctl_EnumDependentServicesA_Type);
47070 : #endif
47071 : #ifdef PY_ENUMSERVICESSTATUSA_PATCH
47072 : PY_ENUMSERVICESSTATUSA_PATCH(&svcctl_EnumServicesStatusA_Type);
47073 : #endif
47074 : #ifdef PY_OPENSCMANAGERA_PATCH
47075 : PY_OPENSCMANAGERA_PATCH(&svcctl_OpenSCManagerA_Type);
47076 : #endif
47077 : #ifdef PY_OPENSERVICEA_PATCH
47078 : PY_OPENSERVICEA_PATCH(&svcctl_OpenServiceA_Type);
47079 : #endif
47080 : #ifdef PY_QUERYSERVICECONFIGA_PATCH
47081 : PY_QUERYSERVICECONFIGA_PATCH(&svcctl_QueryServiceConfigA_Type);
47082 : #endif
47083 : #ifdef PY_QUERYSERVICELOCKSTATUSA_PATCH
47084 : PY_QUERYSERVICELOCKSTATUSA_PATCH(&svcctl_QueryServiceLockStatusA_Type);
47085 : #endif
47086 : #ifdef PY_STARTSERVICEA_PATCH
47087 : PY_STARTSERVICEA_PATCH(&svcctl_StartServiceA_Type);
47088 : #endif
47089 : #ifdef PY_GETSERVICEDISPLAYNAMEA_PATCH
47090 : PY_GETSERVICEDISPLAYNAMEA_PATCH(&svcctl_GetServiceDisplayNameA_Type);
47091 : #endif
47092 : #ifdef PY_GETSERVICEKEYNAMEA_PATCH
47093 : PY_GETSERVICEKEYNAMEA_PATCH(&svcctl_GetServiceKeyNameA_Type);
47094 : #endif
47095 : #ifdef PY_CHANGESERVICECONFIG2A_PATCH
47096 : PY_CHANGESERVICECONFIG2A_PATCH(&svcctl_ChangeServiceConfig2A_Type);
47097 : #endif
47098 : #ifdef PY_CHANGESERVICECONFIG2W_PATCH
47099 : PY_CHANGESERVICECONFIG2W_PATCH(&svcctl_ChangeServiceConfig2W_Type);
47100 : #endif
47101 : #ifdef PY_QUERYSERVICECONFIG2A_PATCH
47102 : PY_QUERYSERVICECONFIG2A_PATCH(&svcctl_QueryServiceConfig2A_Type);
47103 : #endif
47104 : #ifdef PY_QUERYSERVICECONFIG2W_PATCH
47105 : PY_QUERYSERVICECONFIG2W_PATCH(&svcctl_QueryServiceConfig2W_Type);
47106 : #endif
47107 : #ifdef PY_QUERYSERVICESTATUSEX_PATCH
47108 : PY_QUERYSERVICESTATUSEX_PATCH(&svcctl_QueryServiceStatusEx_Type);
47109 : #endif
47110 : #ifdef PY_ENUMSERVICESSTATUSEXA_PATCH
47111 : PY_ENUMSERVICESSTATUSEXA_PATCH(&svcctl_EnumServicesStatusExA_Type);
47112 : #endif
47113 : #ifdef PY_ENUMSERVICESSTATUSEXW_PATCH
47114 : PY_ENUMSERVICESSTATUSEXW_PATCH(&svcctl_EnumServicesStatusExW_Type);
47115 : #endif
47116 : #ifdef PY_CREATESERVICEWOW64A_PATCH
47117 : PY_CREATESERVICEWOW64A_PATCH(&svcctl_CreateServiceWOW64A_Type);
47118 : #endif
47119 : #ifdef PY_CREATESERVICEWOW64W_PATCH
47120 : PY_CREATESERVICEWOW64W_PATCH(&svcctl_CreateServiceWOW64W_Type);
47121 : #endif
47122 : #ifdef PY_OPNUM46NOTUSEDONWIRE_PATCH
47123 : PY_OPNUM46NOTUSEDONWIRE_PATCH(&Opnum46NotUsedOnWire_Type);
47124 : #endif
47125 : #ifdef PY_NOTIFYSERVICESTATUSCHANGE_PATCH
47126 : PY_NOTIFYSERVICESTATUSCHANGE_PATCH(&svcctl_NotifyServiceStatusChange_Type);
47127 : #endif
47128 : #ifdef PY_GETNOTIFYRESULTS_PATCH
47129 : PY_GETNOTIFYRESULTS_PATCH(&svcctl_GetNotifyResults_Type);
47130 : #endif
47131 : #ifdef PY_CLOSENOTIFYHANDLE_PATCH
47132 : PY_CLOSENOTIFYHANDLE_PATCH(&svcctl_CloseNotifyHandle_Type);
47133 : #endif
47134 : #ifdef PY_CONTROLSERVICEEXA_PATCH
47135 : PY_CONTROLSERVICEEXA_PATCH(&svcctl_ControlServiceExA_Type);
47136 : #endif
47137 : #ifdef PY_CONTROLSERVICEEXW_PATCH
47138 : PY_CONTROLSERVICEEXW_PATCH(&svcctl_ControlServiceExW_Type);
47139 : #endif
47140 : #ifdef PY_OPNUM52NOTUSEDONWIRE_PATCH
47141 : PY_OPNUM52NOTUSEDONWIRE_PATCH(&Opnum52NotUsedOnWire_Type);
47142 : #endif
47143 : #ifdef PY_OPNUM53NOTUSEDONWIRE_PATCH
47144 : PY_OPNUM53NOTUSEDONWIRE_PATCH(&Opnum53NotUsedOnWire_Type);
47145 : #endif
47146 : #ifdef PY_OPNUM54NOTUSEDONWIRE_PATCH
47147 : PY_OPNUM54NOTUSEDONWIRE_PATCH(&Opnum54NotUsedOnWire_Type);
47148 : #endif
47149 : #ifdef PY_OPNUM55NOTUSEDONWIRE_PATCH
47150 : PY_OPNUM55NOTUSEDONWIRE_PATCH(&Opnum55NotUsedOnWire_Type);
47151 : #endif
47152 : #ifdef PY_QUERYSERVICECONFIGEX_PATCH
47153 : PY_QUERYSERVICECONFIGEX_PATCH(&svcctl_QueryServiceConfigEx_Type);
47154 : #endif
47155 : #ifdef PY_OPNUM57NOTUSEDONWIRE_PATCH
47156 : PY_OPNUM57NOTUSEDONWIRE_PATCH(&Opnum57NotUsedOnWire_Type);
47157 : #endif
47158 : #ifdef PY_OPNUM58NOTUSEDONWIRE_PATCH
47159 : PY_OPNUM58NOTUSEDONWIRE_PATCH(&Opnum58NotUsedOnWire_Type);
47160 : #endif
47161 : #ifdef PY_OPNUM59NOTUSEDONWIRE_PATCH
47162 : PY_OPNUM59NOTUSEDONWIRE_PATCH(&Opnum59NotUsedOnWire_Type);
47163 : #endif
47164 : #ifdef PY_CREATEWOWSERVICE_PATCH
47165 : PY_CREATEWOWSERVICE_PATCH(&svcctl_CreateWowService_Type);
47166 : #endif
47167 : #ifdef PY_OPENSCMANAGER2_PATCH
47168 : PY_OPENSCMANAGER2_PATCH(&svcctl_OpenSCManager2_Type);
47169 : #endif
47170 : #ifdef PY_SVCCTL_PATCH
47171 : PY_SVCCTL_PATCH(&svcctl_InterfaceType);
47172 : #endif
47173 : #ifdef PY_SVCCTL_ABSTRACT_SYNTAX_PATCH
47174 : PY_SVCCTL_ABSTRACT_SYNTAX_PATCH(&svcctl_SyntaxType);
47175 : #endif
47176 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
47177 : PY_ABSTRACT_SYNTAX_PATCH(&svcctl_SyntaxType);
47178 : #endif
47179 :
47180 40 : m = PyModule_Create(&moduledef);
47181 40 : if (m == NULL)
47182 0 : goto out;
47183 :
47184 40 : PyModule_AddObject(m, "MAX_SERVICE_NAME_LENGTH", PyLong_FromUnsignedLongLong(256));
47185 40 : PyModule_AddObject(m, "SC_MAX_DEPEND_SIZE", PyLong_FromLong(4*1024));
47186 40 : PyModule_AddObject(m, "SC_MAX_NAME_LENGTH", PyLong_FromLong(MAX_SERVICE_NAME_LENGTH+1));
47187 40 : PyModule_AddObject(m, "SC_MAX_PATH_LENGTH", PyLong_FromLong(32*1024));
47188 40 : PyModule_AddObject(m, "SC_MAX_PWD_SIZE", PyLong_FromUnsignedLongLong(514));
47189 40 : PyModule_AddObject(m, "SC_MAX_COMPUTER_NAME_LENGTH", PyLong_FromUnsignedLongLong(1024));
47190 40 : PyModule_AddObject(m, "SC_MAX_ACCOUNT_NAME_LENGTH", PyLong_FromLong(2*1024));
47191 40 : PyModule_AddObject(m, "SC_MAX_COMMENT_LENGTH", PyLong_FromUnsignedLongLong(128));
47192 40 : PyModule_AddObject(m, "SC_MAX_ARGUMENT_LENGTH", PyLong_FromUnsignedLongLong(1024));
47193 40 : PyModule_AddObject(m, "SC_MAX_ARGUMENTS", PyLong_FromUnsignedLongLong(1024));
47194 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_NONE", PyLong_FromUnsignedLongLong(0x00000000));
47195 40 : PyModule_AddObject(m, "SERVICE_TYPE_KERNEL_DRIVER", PyLong_FromUnsignedLongLong(0x01));
47196 40 : PyModule_AddObject(m, "SERVICE_TYPE_FS_DRIVER", PyLong_FromUnsignedLongLong(0x02));
47197 40 : PyModule_AddObject(m, "SERVICE_TYPE_ADAPTER", PyLong_FromUnsignedLongLong(0x04));
47198 40 : PyModule_AddObject(m, "SERVICE_TYPE_RECOGNIZER_DRIVER", PyLong_FromUnsignedLongLong(0x08));
47199 40 : PyModule_AddObject(m, "SERVICE_TYPE_DRIVER", PyLong_FromLong(SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER));
47200 40 : PyModule_AddObject(m, "SERVICE_TYPE_WIN32_OWN_PROCESS", PyLong_FromUnsignedLongLong(0x10));
47201 40 : PyModule_AddObject(m, "SERVICE_TYPE_WIN32_SHARE_PROCESS", PyLong_FromUnsignedLongLong(0x20));
47202 40 : PyModule_AddObject(m, "SERVICE_TYPE_WIN32", PyLong_FromLong(SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS));
47203 40 : PyModule_AddObject(m, "SERVICE_TYPE_INTERACTIVE_PROCESS", PyLong_FromUnsignedLongLong(0x100));
47204 40 : PyModule_AddObject(m, "SC_MANAGER_READ_ACCESS", PyLong_FromLong((SEC_STD_READ_CONTROL|SC_RIGHT_MGR_CONNECT|SC_RIGHT_MGR_ENUMERATE_SERVICE|SC_RIGHT_MGR_QUERY_LOCK_STATUS)));
47205 40 : PyModule_AddObject(m, "SC_MANAGER_EXECUTE_ACCESS", PyLong_FromLong(SC_MANAGER_READ_ACCESS));
47206 40 : PyModule_AddObject(m, "SC_MANAGER_WRITE_ACCESS", PyLong_FromLong((SEC_STD_REQUIRED|SC_MANAGER_READ_ACCESS|SC_RIGHT_MGR_CREATE_SERVICE|SC_RIGHT_MGR_LOCK|SC_RIGHT_MGR_MODIFY_BOOT_CONFIG)));
47207 40 : PyModule_AddObject(m, "SC_MANAGER_ALL_ACCESS", PyLong_FromLong(SC_MANAGER_WRITE_ACCESS));
47208 40 : PyModule_AddObject(m, "SERVICE_READ_ACCESS", PyLong_FromLong((SEC_STD_READ_CONTROL|SC_RIGHT_SVC_ENUMERATE_DEPENDENTS|SC_RIGHT_SVC_INTERROGATE|SC_RIGHT_SVC_QUERY_CONFIG|SC_RIGHT_SVC_QUERY_STATUS|SC_RIGHT_SVC_USER_DEFINED_CONTROL)));
47209 40 : PyModule_AddObject(m, "SERVICE_EXECUTE_ACCESS", PyLong_FromLong((SERVICE_READ_ACCESS|SC_RIGHT_SVC_START|SC_RIGHT_SVC_STOP|SC_RIGHT_SVC_PAUSE_CONTINUE)));
47210 40 : PyModule_AddObject(m, "SERVICE_WRITE_ACCESS", PyLong_FromLong((SEC_STD_REQUIRED|SERVICE_READ_ACCESS|SERVICE_EXECUTE_ACCESS|SC_RIGHT_SVC_CHANGE_CONFIG)));
47211 40 : PyModule_AddObject(m, "SERVICE_ALL_ACCESS", PyLong_FromLong(SERVICE_WRITE_ACCESS));
47212 40 : PyModule_AddObject(m, "SVCCTL_STATE_UNKNOWN", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_STATE_UNKNOWN));
47213 40 : PyModule_AddObject(m, "SVCCTL_STOPPED", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_STOPPED));
47214 40 : PyModule_AddObject(m, "SVCCTL_START_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_START_PENDING));
47215 40 : PyModule_AddObject(m, "SVCCTL_STOP_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_STOP_PENDING));
47216 40 : PyModule_AddObject(m, "SVCCTL_RUNNING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_RUNNING));
47217 40 : PyModule_AddObject(m, "SVCCTL_CONTINUE_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTINUE_PENDING));
47218 40 : PyModule_AddObject(m, "SVCCTL_PAUSE_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_PAUSE_PENDING));
47219 40 : PyModule_AddObject(m, "SVCCTL_PAUSED", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_PAUSED));
47220 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_STOP", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_STOP));
47221 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_PAUSE_CONTINUE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_PAUSE_CONTINUE));
47222 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_SHUTDOWN", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_SHUTDOWN));
47223 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_PARAMCHANGE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_PARAMCHANGE));
47224 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_NETBINDCHANGE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_NETBINDCHANGE));
47225 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_HARDWAREPROFILECHANGE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_HARDWAREPROFILECHANGE));
47226 40 : PyModule_AddObject(m, "SVCCTL_ACCEPT_POWEREVENT", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_POWEREVENT));
47227 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_STOP", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_STOP));
47228 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_PAUSE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_PAUSE));
47229 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_CONTINUE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_CONTINUE));
47230 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_INTERROGATE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_INTERROGATE));
47231 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_SHUTDOWN", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_SHUTDOWN));
47232 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_PARAMCHANGE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_PARAMCHANGE));
47233 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_NETBINDADD", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_NETBINDADD));
47234 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_NETBINDREMOVE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_NETBINDREMOVE));
47235 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_NETBINDENABLE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_NETBINDENABLE));
47236 40 : PyModule_AddObject(m, "SVCCTL_CONTROL_NETBINDDISABLE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_NETBINDDISABLE));
47237 40 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_IGNORE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_IGNORE));
47238 40 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_NORMAL", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_NORMAL));
47239 40 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_CRITICAL", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_CRITICAL));
47240 40 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_SEVERE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_SEVERE));
47241 40 : PyModule_AddObject(m, "SVCCTL_BOOT_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_BOOT_START));
47242 40 : PyModule_AddObject(m, "SVCCTL_SYSTEM_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SYSTEM_START));
47243 40 : PyModule_AddObject(m, "SVCCTL_AUTO_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_AUTO_START));
47244 40 : PyModule_AddObject(m, "SVCCTL_DEMAND_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_DEMAND_START));
47245 40 : PyModule_AddObject(m, "SVCCTL_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_DISABLED));
47246 40 : PyModule_AddObject(m, "SERVICE_STATE_ACTIVE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STATE_ACTIVE));
47247 40 : PyModule_AddObject(m, "SERVICE_STATE_INACTIVE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STATE_INACTIVE));
47248 40 : PyModule_AddObject(m, "SERVICE_STATE_ALL", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STATE_ALL));
47249 40 : PyModule_AddObject(m, "SC_RIGHT_MGR_CONNECT", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_CONNECT));
47250 40 : PyModule_AddObject(m, "SC_RIGHT_MGR_CREATE_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_CREATE_SERVICE));
47251 40 : PyModule_AddObject(m, "SC_RIGHT_MGR_ENUMERATE_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_ENUMERATE_SERVICE));
47252 40 : PyModule_AddObject(m, "SC_RIGHT_MGR_LOCK", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_LOCK));
47253 40 : PyModule_AddObject(m, "SC_RIGHT_MGR_QUERY_LOCK_STATUS", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_QUERY_LOCK_STATUS));
47254 40 : PyModule_AddObject(m, "SC_RIGHT_MGR_MODIFY_BOOT_CONFIG", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_MODIFY_BOOT_CONFIG));
47255 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_QUERY_CONFIG", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_QUERY_CONFIG));
47256 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_CHANGE_CONFIG", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_CHANGE_CONFIG));
47257 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_QUERY_STATUS", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_QUERY_STATUS));
47258 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_ENUMERATE_DEPENDENTS", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_ENUMERATE_DEPENDENTS));
47259 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_START", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_START));
47260 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_STOP", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_STOP));
47261 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_PAUSE_CONTINUE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_PAUSE_CONTINUE));
47262 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_INTERROGATE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_INTERROGATE));
47263 40 : PyModule_AddObject(m, "SC_RIGHT_SVC_USER_DEFINED_CONTROL", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_USER_DEFINED_CONTROL));
47264 40 : PyModule_AddObject(m, "SERVICE_CONFIG_DESCRIPTION", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_CONFIG_DESCRIPTION));
47265 40 : PyModule_AddObject(m, "SERVICE_CONFIG_FAILURE_ACTIONS", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_CONFIG_FAILURE_ACTIONS));
47266 40 : PyModule_AddObject(m, "SC_ACTION_NONE", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_NONE));
47267 40 : PyModule_AddObject(m, "SC_ACTION_RESTART", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_RESTART));
47268 40 : PyModule_AddObject(m, "SC_ACTION_REBOOT", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_REBOOT));
47269 40 : PyModule_AddObject(m, "SC_ACTION_RUN_COMMAND", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_RUN_COMMAND));
47270 40 : PyModule_AddObject(m, "SVC_STATUS_PROCESS_INFO", PyLong_FromUnsignedLongLong((uint32_t)SVC_STATUS_PROCESS_INFO));
47271 40 : PyModule_AddObject(m, "SERVICE_STOP_UNPLANNED", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_UNPLANNED));
47272 40 : PyModule_AddObject(m, "SERVICE_STOP_CUSTOM", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_CUSTOM));
47273 40 : PyModule_AddObject(m, "SERVICE_STOP_PLANNED", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_PLANNED));
47274 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MAJOR_OTHER", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MAJOR_OTHER));
47275 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MAJOR_HARDWARE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MAJOR_HARDWARE));
47276 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM));
47277 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MAJOR_SOFTWARE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MAJOR_SOFTWARE));
47278 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MAJOR_APPLICATION", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MAJOR_APPLICATION));
47279 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MAJOR_NONE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MAJOR_NONE));
47280 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_OTHER", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_OTHER));
47281 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_MAINTENANCE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_MAINTENANCE));
47282 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_INSTALLATION", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_INSTALLATION));
47283 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_UPGRADE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_UPGRADE));
47284 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_RECONFIG", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_RECONFIG));
47285 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_HUNG", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_HUNG));
47286 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_UNSTABLE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_UNSTABLE));
47287 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_DISK", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_DISK));
47288 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_NETWORKCARD", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_NETWORKCARD));
47289 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_ENVIRONMENT", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_ENVIRONMENT));
47290 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER));
47291 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_OTHERDRIVER", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_OTHERDRIVER));
47292 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_SERVICEPACK", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_SERVICEPACK));
47293 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE));
47294 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_SECURITYFIX", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_SECURITYFIX));
47295 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_SECURITY", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_SECURITY));
47296 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY));
47297 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_WMI", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_WMI));
47298 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL));
47299 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL));
47300 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL));
47301 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_MMC", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_MMC));
47302 40 : PyModule_AddObject(m, "SERVICE_STOP_REASON_MINOR_NONE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STOP_REASON_MINOR_NONE));
47303 37 : Py_INCREF((PyObject *)(void *)&SERVICE_LOCK_STATUS_Type);
47304 40 : PyModule_AddObject(m, "SERVICE_LOCK_STATUS", (PyObject *)(void *)&SERVICE_LOCK_STATUS_Type);
47305 37 : Py_INCREF((PyObject *)(void *)&SERVICE_STATUS_Type);
47306 40 : PyModule_AddObject(m, "SERVICE_STATUS", (PyObject *)(void *)&SERVICE_STATUS_Type);
47307 37 : Py_INCREF((PyObject *)(void *)&SERVICE_STATUS_PROCESS_Type);
47308 40 : PyModule_AddObject(m, "SERVICE_STATUS_PROCESS", (PyObject *)(void *)&SERVICE_STATUS_PROCESS_Type);
47309 37 : Py_INCREF((PyObject *)(void *)&ENUM_SERVICE_STATUSW_Type);
47310 40 : PyModule_AddObject(m, "ENUM_SERVICE_STATUSW", (PyObject *)(void *)&ENUM_SERVICE_STATUSW_Type);
47311 37 : Py_INCREF((PyObject *)(void *)&ENUM_SERVICE_STATUSA_Type);
47312 40 : PyModule_AddObject(m, "ENUM_SERVICE_STATUSA", (PyObject *)(void *)&ENUM_SERVICE_STATUSA_Type);
47313 37 : Py_INCREF((PyObject *)(void *)&QUERY_SERVICE_CONFIG_Type);
47314 40 : PyModule_AddObject(m, "QUERY_SERVICE_CONFIG", (PyObject *)(void *)&QUERY_SERVICE_CONFIG_Type);
47315 37 : Py_INCREF((PyObject *)(void *)&svcctl_ArgumentString_Type);
47316 40 : PyModule_AddObject(m, "ArgumentString", (PyObject *)(void *)&svcctl_ArgumentString_Type);
47317 37 : Py_INCREF((PyObject *)(void *)&SERVICE_DESCRIPTION_Type);
47318 40 : PyModule_AddObject(m, "SERVICE_DESCRIPTION", (PyObject *)(void *)&SERVICE_DESCRIPTION_Type);
47319 37 : Py_INCREF((PyObject *)(void *)&SC_ACTION_Type);
47320 40 : PyModule_AddObject(m, "SC_ACTION", (PyObject *)(void *)&SC_ACTION_Type);
47321 37 : Py_INCREF((PyObject *)(void *)&SERVICE_FAILURE_ACTIONSW_Type);
47322 40 : PyModule_AddObject(m, "SERVICE_FAILURE_ACTIONSW", (PyObject *)(void *)&SERVICE_FAILURE_ACTIONSW_Type);
47323 37 : Py_INCREF((PyObject *)(void *)&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type);
47324 40 : PyModule_AddObject(m, "SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1", (PyObject *)(void *)&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1_Type);
47325 37 : Py_INCREF((PyObject *)(void *)&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type);
47326 40 : PyModule_AddObject(m, "SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2", (PyObject *)(void *)&SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2_Type);
47327 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_NOTIFY_PARAMS_u_Type);
47328 40 : PyModule_AddObject(m, "SC_RPC_NOTIFY_PARAMS_u", (PyObject *)(void *)&SC_RPC_NOTIFY_PARAMS_u_Type);
47329 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_NOTIFY_PARAMS_Type);
47330 40 : PyModule_AddObject(m, "SC_RPC_NOTIFY_PARAMS", (PyObject *)(void *)&SC_RPC_NOTIFY_PARAMS_Type);
47331 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_NOTIFY_PARAMS_LIST_Type);
47332 40 : PyModule_AddObject(m, "SC_RPC_NOTIFY_PARAMS_LIST", (PyObject *)(void *)&SC_RPC_NOTIFY_PARAMS_LIST_Type);
47333 37 : Py_INCREF((PyObject *)(void *)&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type);
47334 40 : PyModule_AddObject(m, "SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA", (PyObject *)(void *)&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA_Type);
47335 37 : Py_INCREF((PyObject *)(void *)&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type);
47336 40 : PyModule_AddObject(m, "SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS", (PyObject *)(void *)&SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS_Type);
47337 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type);
47338 40 : PyModule_AddObject(m, "SC_RPC_SERVICE_CONTROL_IN_PARAMSA", (PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_IN_PARAMSA_Type);
47339 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type);
47340 40 : PyModule_AddObject(m, "SC_RPC_SERVICE_CONTROL_OUT_PARAMSA", (PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_OUT_PARAMSA_Type);
47341 37 : Py_INCREF((PyObject *)(void *)&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type);
47342 40 : PyModule_AddObject(m, "SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW", (PyObject *)(void *)&SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW_Type);
47343 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type);
47344 40 : PyModule_AddObject(m, "SC_RPC_SERVICE_CONTROL_IN_PARAMSW", (PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_IN_PARAMSW_Type);
47345 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type);
47346 40 : PyModule_AddObject(m, "SC_RPC_SERVICE_CONTROL_OUT_PARAMSW", (PyObject *)(void *)&SC_RPC_SERVICE_CONTROL_OUT_PARAMSW_Type);
47347 37 : Py_INCREF((PyObject *)(void *)&SERVICE_DESCRIPTIONW_Type);
47348 40 : PyModule_AddObject(m, "SERVICE_DESCRIPTIONW", (PyObject *)(void *)&SERVICE_DESCRIPTIONW_Type);
47349 37 : Py_INCREF((PyObject *)(void *)&SERVICE_DELAYED_AUTO_START_INFO_Type);
47350 40 : PyModule_AddObject(m, "SERVICE_DELAYED_AUTO_START_INFO", (PyObject *)(void *)&SERVICE_DELAYED_AUTO_START_INFO_Type);
47351 37 : Py_INCREF((PyObject *)(void *)&SERVICE_FAILURE_ACTIONS_FLAG_Type);
47352 40 : PyModule_AddObject(m, "SERVICE_FAILURE_ACTIONS_FLAG", (PyObject *)(void *)&SERVICE_FAILURE_ACTIONS_FLAG_Type);
47353 37 : Py_INCREF((PyObject *)(void *)&SERVICE_SID_INFO_Type);
47354 40 : PyModule_AddObject(m, "SERVICE_SID_INFO", (PyObject *)(void *)&SERVICE_SID_INFO_Type);
47355 37 : Py_INCREF((PyObject *)(void *)&SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type);
47356 40 : PyModule_AddObject(m, "SERVICE_RPC_REQUIRED_PRIVILEGES_INFO", (PyObject *)(void *)&SERVICE_RPC_REQUIRED_PRIVILEGES_INFO_Type);
47357 37 : Py_INCREF((PyObject *)(void *)&SERVICE_PRESHUTDOWN_INFO_Type);
47358 40 : PyModule_AddObject(m, "SERVICE_PRESHUTDOWN_INFO", (PyObject *)(void *)&SERVICE_PRESHUTDOWN_INFO_Type);
47359 37 : Py_INCREF((PyObject *)(void *)&SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type);
47360 40 : PyModule_AddObject(m, "SERVICE_TRIGGER_SPECIFIC_DATA_ITEM", (PyObject *)(void *)&SERVICE_TRIGGER_SPECIFIC_DATA_ITEM_Type);
47361 37 : Py_INCREF((PyObject *)(void *)&SERVICE_TRIGGER_Type);
47362 40 : PyModule_AddObject(m, "SERVICE_TRIGGER", (PyObject *)(void *)&SERVICE_TRIGGER_Type);
47363 37 : Py_INCREF((PyObject *)(void *)&SERVICE_TRIGGER_INFO_Type);
47364 40 : PyModule_AddObject(m, "SERVICE_TRIGGER_INFO", (PyObject *)(void *)&SERVICE_TRIGGER_INFO_Type);
47365 37 : Py_INCREF((PyObject *)(void *)&SERVICE_PREFERRED_NODE_INFO_Type);
47366 40 : PyModule_AddObject(m, "SERVICE_PREFERRED_NODE_INFO", (PyObject *)(void *)&SERVICE_PREFERRED_NODE_INFO_Type);
47367 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_CONFIG_INFOW_u_Type);
47368 40 : PyModule_AddObject(m, "SC_RPC_CONFIG_INFOW_u", (PyObject *)(void *)&SC_RPC_CONFIG_INFOW_u_Type);
47369 37 : Py_INCREF((PyObject *)(void *)&SC_RPC_CONFIG_INFOW_Type);
47370 40 : PyModule_AddObject(m, "SC_RPC_CONFIG_INFOW", (PyObject *)(void *)&SC_RPC_CONFIG_INFOW_Type);
47371 37 : Py_INCREF((PyObject *)(void *)&svcctl_CloseServiceHandle_Type);
47372 40 : PyModule_AddObject(m, "CloseServiceHandle", (PyObject *)(void *)&svcctl_CloseServiceHandle_Type);
47373 37 : Py_INCREF((PyObject *)(void *)&svcctl_ControlService_Type);
47374 40 : PyModule_AddObject(m, "ControlService", (PyObject *)(void *)&svcctl_ControlService_Type);
47375 37 : Py_INCREF((PyObject *)(void *)&svcctl_DeleteService_Type);
47376 40 : PyModule_AddObject(m, "DeleteService", (PyObject *)(void *)&svcctl_DeleteService_Type);
47377 37 : Py_INCREF((PyObject *)(void *)&svcctl_LockServiceDatabase_Type);
47378 40 : PyModule_AddObject(m, "LockServiceDatabase", (PyObject *)(void *)&svcctl_LockServiceDatabase_Type);
47379 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceObjectSecurity_Type);
47380 40 : PyModule_AddObject(m, "QueryServiceObjectSecurity", (PyObject *)(void *)&svcctl_QueryServiceObjectSecurity_Type);
47381 37 : Py_INCREF((PyObject *)(void *)&svcctl_SetServiceObjectSecurity_Type);
47382 40 : PyModule_AddObject(m, "SetServiceObjectSecurity", (PyObject *)(void *)&svcctl_SetServiceObjectSecurity_Type);
47383 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceStatus_Type);
47384 40 : PyModule_AddObject(m, "QueryServiceStatus", (PyObject *)(void *)&svcctl_QueryServiceStatus_Type);
47385 37 : Py_INCREF((PyObject *)(void *)&svcctl_UnlockServiceDatabase_Type);
47386 40 : PyModule_AddObject(m, "UnlockServiceDatabase", (PyObject *)(void *)&svcctl_UnlockServiceDatabase_Type);
47387 37 : Py_INCREF((PyObject *)(void *)&svcctl_SCSetServiceBitsW_Type);
47388 40 : PyModule_AddObject(m, "SCSetServiceBitsW", (PyObject *)(void *)&svcctl_SCSetServiceBitsW_Type);
47389 37 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfigW_Type);
47390 40 : PyModule_AddObject(m, "ChangeServiceConfigW", (PyObject *)(void *)&svcctl_ChangeServiceConfigW_Type);
47391 37 : Py_INCREF((PyObject *)(void *)&svcctl_CreateServiceW_Type);
47392 40 : PyModule_AddObject(m, "CreateServiceW", (PyObject *)(void *)&svcctl_CreateServiceW_Type);
47393 37 : Py_INCREF((PyObject *)(void *)&svcctl_EnumDependentServicesW_Type);
47394 40 : PyModule_AddObject(m, "EnumDependentServicesW", (PyObject *)(void *)&svcctl_EnumDependentServicesW_Type);
47395 37 : Py_INCREF((PyObject *)(void *)&svcctl_EnumServicesStatusW_Type);
47396 40 : PyModule_AddObject(m, "EnumServicesStatusW", (PyObject *)(void *)&svcctl_EnumServicesStatusW_Type);
47397 37 : Py_INCREF((PyObject *)(void *)&svcctl_OpenSCManagerW_Type);
47398 40 : PyModule_AddObject(m, "OpenSCManagerW", (PyObject *)(void *)&svcctl_OpenSCManagerW_Type);
47399 37 : Py_INCREF((PyObject *)(void *)&svcctl_OpenServiceW_Type);
47400 40 : PyModule_AddObject(m, "OpenServiceW", (PyObject *)(void *)&svcctl_OpenServiceW_Type);
47401 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfigW_Type);
47402 40 : PyModule_AddObject(m, "QueryServiceConfigW", (PyObject *)(void *)&svcctl_QueryServiceConfigW_Type);
47403 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceLockStatusW_Type);
47404 40 : PyModule_AddObject(m, "QueryServiceLockStatusW", (PyObject *)(void *)&svcctl_QueryServiceLockStatusW_Type);
47405 37 : Py_INCREF((PyObject *)(void *)&svcctl_StartServiceW_Type);
47406 40 : PyModule_AddObject(m, "StartServiceW", (PyObject *)(void *)&svcctl_StartServiceW_Type);
47407 37 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceDisplayNameW_Type);
47408 40 : PyModule_AddObject(m, "GetServiceDisplayNameW", (PyObject *)(void *)&svcctl_GetServiceDisplayNameW_Type);
47409 37 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceKeyNameW_Type);
47410 40 : PyModule_AddObject(m, "GetServiceKeyNameW", (PyObject *)(void *)&svcctl_GetServiceKeyNameW_Type);
47411 37 : Py_INCREF((PyObject *)(void *)&svcctl_SCSetServiceBitsA_Type);
47412 40 : PyModule_AddObject(m, "SCSetServiceBitsA", (PyObject *)(void *)&svcctl_SCSetServiceBitsA_Type);
47413 37 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfigA_Type);
47414 40 : PyModule_AddObject(m, "ChangeServiceConfigA", (PyObject *)(void *)&svcctl_ChangeServiceConfigA_Type);
47415 37 : Py_INCREF((PyObject *)(void *)&svcctl_CreateServiceA_Type);
47416 40 : PyModule_AddObject(m, "CreateServiceA", (PyObject *)(void *)&svcctl_CreateServiceA_Type);
47417 37 : Py_INCREF((PyObject *)(void *)&svcctl_EnumDependentServicesA_Type);
47418 40 : PyModule_AddObject(m, "EnumDependentServicesA", (PyObject *)(void *)&svcctl_EnumDependentServicesA_Type);
47419 37 : Py_INCREF((PyObject *)(void *)&svcctl_EnumServicesStatusA_Type);
47420 40 : PyModule_AddObject(m, "EnumServicesStatusA", (PyObject *)(void *)&svcctl_EnumServicesStatusA_Type);
47421 37 : Py_INCREF((PyObject *)(void *)&svcctl_OpenSCManagerA_Type);
47422 40 : PyModule_AddObject(m, "OpenSCManagerA", (PyObject *)(void *)&svcctl_OpenSCManagerA_Type);
47423 37 : Py_INCREF((PyObject *)(void *)&svcctl_OpenServiceA_Type);
47424 40 : PyModule_AddObject(m, "OpenServiceA", (PyObject *)(void *)&svcctl_OpenServiceA_Type);
47425 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfigA_Type);
47426 40 : PyModule_AddObject(m, "QueryServiceConfigA", (PyObject *)(void *)&svcctl_QueryServiceConfigA_Type);
47427 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceLockStatusA_Type);
47428 40 : PyModule_AddObject(m, "QueryServiceLockStatusA", (PyObject *)(void *)&svcctl_QueryServiceLockStatusA_Type);
47429 37 : Py_INCREF((PyObject *)(void *)&svcctl_StartServiceA_Type);
47430 40 : PyModule_AddObject(m, "StartServiceA", (PyObject *)(void *)&svcctl_StartServiceA_Type);
47431 37 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceDisplayNameA_Type);
47432 40 : PyModule_AddObject(m, "GetServiceDisplayNameA", (PyObject *)(void *)&svcctl_GetServiceDisplayNameA_Type);
47433 37 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceKeyNameA_Type);
47434 40 : PyModule_AddObject(m, "GetServiceKeyNameA", (PyObject *)(void *)&svcctl_GetServiceKeyNameA_Type);
47435 37 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfig2A_Type);
47436 40 : PyModule_AddObject(m, "ChangeServiceConfig2A", (PyObject *)(void *)&svcctl_ChangeServiceConfig2A_Type);
47437 37 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfig2W_Type);
47438 40 : PyModule_AddObject(m, "ChangeServiceConfig2W", (PyObject *)(void *)&svcctl_ChangeServiceConfig2W_Type);
47439 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfig2A_Type);
47440 40 : PyModule_AddObject(m, "QueryServiceConfig2A", (PyObject *)(void *)&svcctl_QueryServiceConfig2A_Type);
47441 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfig2W_Type);
47442 40 : PyModule_AddObject(m, "QueryServiceConfig2W", (PyObject *)(void *)&svcctl_QueryServiceConfig2W_Type);
47443 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceStatusEx_Type);
47444 40 : PyModule_AddObject(m, "QueryServiceStatusEx", (PyObject *)(void *)&svcctl_QueryServiceStatusEx_Type);
47445 37 : Py_INCREF((PyObject *)(void *)&svcctl_EnumServicesStatusExA_Type);
47446 40 : PyModule_AddObject(m, "EnumServicesStatusExA", (PyObject *)(void *)&svcctl_EnumServicesStatusExA_Type);
47447 37 : Py_INCREF((PyObject *)(void *)&svcctl_EnumServicesStatusExW_Type);
47448 40 : PyModule_AddObject(m, "EnumServicesStatusExW", (PyObject *)(void *)&svcctl_EnumServicesStatusExW_Type);
47449 37 : Py_INCREF((PyObject *)(void *)&svcctl_CreateServiceWOW64A_Type);
47450 40 : PyModule_AddObject(m, "CreateServiceWOW64A", (PyObject *)(void *)&svcctl_CreateServiceWOW64A_Type);
47451 37 : Py_INCREF((PyObject *)(void *)&svcctl_CreateServiceWOW64W_Type);
47452 40 : PyModule_AddObject(m, "CreateServiceWOW64W", (PyObject *)(void *)&svcctl_CreateServiceWOW64W_Type);
47453 37 : Py_INCREF((PyObject *)(void *)&Opnum46NotUsedOnWire_Type);
47454 40 : PyModule_AddObject(m, "Opnum46NotUsedOnWire", (PyObject *)(void *)&Opnum46NotUsedOnWire_Type);
47455 37 : Py_INCREF((PyObject *)(void *)&svcctl_NotifyServiceStatusChange_Type);
47456 40 : PyModule_AddObject(m, "NotifyServiceStatusChange", (PyObject *)(void *)&svcctl_NotifyServiceStatusChange_Type);
47457 37 : Py_INCREF((PyObject *)(void *)&svcctl_GetNotifyResults_Type);
47458 40 : PyModule_AddObject(m, "GetNotifyResults", (PyObject *)(void *)&svcctl_GetNotifyResults_Type);
47459 37 : Py_INCREF((PyObject *)(void *)&svcctl_CloseNotifyHandle_Type);
47460 40 : PyModule_AddObject(m, "CloseNotifyHandle", (PyObject *)(void *)&svcctl_CloseNotifyHandle_Type);
47461 37 : Py_INCREF((PyObject *)(void *)&svcctl_ControlServiceExA_Type);
47462 40 : PyModule_AddObject(m, "ControlServiceExA", (PyObject *)(void *)&svcctl_ControlServiceExA_Type);
47463 37 : Py_INCREF((PyObject *)(void *)&svcctl_ControlServiceExW_Type);
47464 40 : PyModule_AddObject(m, "ControlServiceExW", (PyObject *)(void *)&svcctl_ControlServiceExW_Type);
47465 37 : Py_INCREF((PyObject *)(void *)&Opnum52NotUsedOnWire_Type);
47466 40 : PyModule_AddObject(m, "Opnum52NotUsedOnWire", (PyObject *)(void *)&Opnum52NotUsedOnWire_Type);
47467 37 : Py_INCREF((PyObject *)(void *)&Opnum53NotUsedOnWire_Type);
47468 40 : PyModule_AddObject(m, "Opnum53NotUsedOnWire", (PyObject *)(void *)&Opnum53NotUsedOnWire_Type);
47469 37 : Py_INCREF((PyObject *)(void *)&Opnum54NotUsedOnWire_Type);
47470 40 : PyModule_AddObject(m, "Opnum54NotUsedOnWire", (PyObject *)(void *)&Opnum54NotUsedOnWire_Type);
47471 37 : Py_INCREF((PyObject *)(void *)&Opnum55NotUsedOnWire_Type);
47472 40 : PyModule_AddObject(m, "Opnum55NotUsedOnWire", (PyObject *)(void *)&Opnum55NotUsedOnWire_Type);
47473 37 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfigEx_Type);
47474 40 : PyModule_AddObject(m, "QueryServiceConfigEx", (PyObject *)(void *)&svcctl_QueryServiceConfigEx_Type);
47475 37 : Py_INCREF((PyObject *)(void *)&Opnum57NotUsedOnWire_Type);
47476 40 : PyModule_AddObject(m, "Opnum57NotUsedOnWire", (PyObject *)(void *)&Opnum57NotUsedOnWire_Type);
47477 37 : Py_INCREF((PyObject *)(void *)&Opnum58NotUsedOnWire_Type);
47478 40 : PyModule_AddObject(m, "Opnum58NotUsedOnWire", (PyObject *)(void *)&Opnum58NotUsedOnWire_Type);
47479 37 : Py_INCREF((PyObject *)(void *)&Opnum59NotUsedOnWire_Type);
47480 40 : PyModule_AddObject(m, "Opnum59NotUsedOnWire", (PyObject *)(void *)&Opnum59NotUsedOnWire_Type);
47481 37 : Py_INCREF((PyObject *)(void *)&svcctl_CreateWowService_Type);
47482 40 : PyModule_AddObject(m, "CreateWowService", (PyObject *)(void *)&svcctl_CreateWowService_Type);
47483 37 : Py_INCREF((PyObject *)(void *)&svcctl_OpenSCManager2_Type);
47484 40 : PyModule_AddObject(m, "OpenSCManager2", (PyObject *)(void *)&svcctl_OpenSCManager2_Type);
47485 37 : Py_INCREF((PyObject *)(void *)&svcctl_InterfaceType);
47486 40 : PyModule_AddObject(m, "svcctl", (PyObject *)(void *)&svcctl_InterfaceType);
47487 37 : Py_INCREF((PyObject *)(void *)&svcctl_SyntaxType);
47488 40 : PyModule_AddObject(m, "svcctl_abstract_syntax", (PyObject *)(void *)&svcctl_SyntaxType);
47489 37 : Py_INCREF((PyObject *)(void *)&svcctl_SyntaxType);
47490 40 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&svcctl_SyntaxType);
47491 : #ifdef PY_MOD_SVCCTL_PATCH
47492 : PY_MOD_SVCCTL_PATCH(m);
47493 : #endif
47494 40 : out:
47495 40 : Py_XDECREF(dep_samba_dcerpc_misc);
47496 40 : Py_XDECREF(dep_samba_dcerpc_security);
47497 40 : Py_XDECREF(dep_talloc);
47498 40 : Py_XDECREF(dep_samba_dcerpc_base);
47499 39 : return m;
47500 :
47501 : }
|