Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include <Python.h>
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_svcctl.h"
12 : #include "bin/default/librpc/gen_ndr/ndr_svcctl_c.h"
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 0 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 0 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 0 : case 4:
38 0 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 0 : case 1:
42 0 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 : switch (var_size) {
51 : case 8:
52 : return INT64_MAX;
53 : case 4:
54 : return INT32_MAX;
55 : case 2:
56 : return INT16_MAX;
57 : case 1:
58 : return INT8_MAX;
59 : }
60 :
61 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/misc.h"
65 : #include "librpc/gen_ndr/security.h"
66 : static PyTypeObject SERVICE_LOCK_STATUS_Type;
67 : static PyTypeObject SERVICE_STATUS_Type;
68 : static PyTypeObject SERVICE_STATUS_PROCESS_Type;
69 : static PyTypeObject ENUM_SERVICE_STATUSW_Type;
70 : static PyTypeObject ENUM_SERVICE_STATUSA_Type;
71 : static PyTypeObject QUERY_SERVICE_CONFIG_Type;
72 : static PyTypeObject svcctl_ArgumentString_Type;
73 : static PyTypeObject SERVICE_DESCRIPTION_Type;
74 : static PyTypeObject SC_ACTION_Type;
75 : static PyTypeObject SERVICE_FAILURE_ACTIONS_Type;
76 : static PyTypeObject svcctl_InterfaceType;
77 : static PyTypeObject svcctl_CloseServiceHandle_Type;
78 : static PyTypeObject svcctl_ControlService_Type;
79 : static PyTypeObject svcctl_DeleteService_Type;
80 : static PyTypeObject svcctl_LockServiceDatabase_Type;
81 : static PyTypeObject svcctl_QueryServiceObjectSecurity_Type;
82 : static PyTypeObject svcctl_SetServiceObjectSecurity_Type;
83 : static PyTypeObject svcctl_QueryServiceStatus_Type;
84 : static PyTypeObject svcctl_UnlockServiceDatabase_Type;
85 : static PyTypeObject svcctl_SCSetServiceBitsW_Type;
86 : static PyTypeObject svcctl_ChangeServiceConfigW_Type;
87 : static PyTypeObject svcctl_CreateServiceW_Type;
88 : static PyTypeObject svcctl_EnumDependentServicesW_Type;
89 : static PyTypeObject svcctl_EnumServicesStatusW_Type;
90 : static PyTypeObject svcctl_OpenSCManagerW_Type;
91 : static PyTypeObject svcctl_OpenServiceW_Type;
92 : static PyTypeObject svcctl_QueryServiceConfigW_Type;
93 : static PyTypeObject svcctl_QueryServiceLockStatusW_Type;
94 : static PyTypeObject svcctl_StartServiceW_Type;
95 : static PyTypeObject svcctl_GetServiceDisplayNameW_Type;
96 : static PyTypeObject svcctl_GetServiceKeyNameW_Type;
97 : static PyTypeObject svcctl_SCSetServiceBitsA_Type;
98 : static PyTypeObject svcctl_ChangeServiceConfigA_Type;
99 : static PyTypeObject svcctl_CreateServiceA_Type;
100 : static PyTypeObject svcctl_EnumDependentServicesA_Type;
101 : static PyTypeObject svcctl_EnumServicesStatusA_Type;
102 : static PyTypeObject svcctl_OpenSCManagerA_Type;
103 : static PyTypeObject svcctl_OpenServiceA_Type;
104 : static PyTypeObject svcctl_QueryServiceConfigA_Type;
105 : static PyTypeObject svcctl_QueryServiceLockStatusA_Type;
106 : static PyTypeObject svcctl_StartServiceA_Type;
107 : static PyTypeObject svcctl_GetServiceDisplayNameA_Type;
108 : static PyTypeObject svcctl_GetServiceKeyNameA_Type;
109 : static PyTypeObject svcctl_ChangeServiceConfig2A_Type;
110 : static PyTypeObject svcctl_ChangeServiceConfig2W_Type;
111 : static PyTypeObject svcctl_QueryServiceConfig2A_Type;
112 : static PyTypeObject svcctl_QueryServiceConfig2W_Type;
113 : static PyTypeObject svcctl_QueryServiceStatusEx_Type;
114 : static PyTypeObject EnumServicesStatusExA_Type;
115 : static PyTypeObject EnumServicesStatusExW_Type;
116 :
117 : static PyTypeObject *BaseObject_Type;
118 : static PyTypeObject *policy_handle_Type;
119 : static PyTypeObject *ClientConnection_Type;
120 : static PyTypeObject *ndr_syntax_id_Type;
121 :
122 0 : static PyObject *py_SERVICE_LOCK_STATUS_get_is_locked(PyObject *obj, void *closure)
123 : {
124 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
125 : PyObject *py_is_locked;
126 0 : py_is_locked = PyLong_FromUnsignedLongLong((uint32_t)object->is_locked);
127 0 : return py_is_locked;
128 : }
129 :
130 0 : static int py_SERVICE_LOCK_STATUS_set_is_locked(PyObject *py_obj, PyObject *value, void *closure)
131 : {
132 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
133 0 : if (value == NULL) {
134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->is_locked");
135 0 : return -1;
136 : }
137 : {
138 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->is_locked));
139 0 : if (PyLong_Check(value)) {
140 : unsigned long long test_var;
141 0 : test_var = PyLong_AsUnsignedLongLong(value);
142 0 : if (PyErr_Occurred() != NULL) {
143 0 : return -1;
144 : }
145 0 : if (test_var > uint_max) {
146 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
147 : PyLong_Type.tp_name, uint_max, test_var);
148 0 : return -1;
149 : }
150 0 : object->is_locked = test_var;
151 : } else {
152 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
153 : PyLong_Type.tp_name);
154 0 : return -1;
155 : }
156 : }
157 0 : return 0;
158 : }
159 :
160 0 : static PyObject *py_SERVICE_LOCK_STATUS_get_lock_owner(PyObject *obj, void *closure)
161 : {
162 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
163 : PyObject *py_lock_owner;
164 0 : if (object->lock_owner == NULL) {
165 0 : Py_RETURN_NONE;
166 : }
167 0 : if (object->lock_owner == NULL) {
168 0 : py_lock_owner = Py_None;
169 0 : Py_INCREF(py_lock_owner);
170 : } else {
171 0 : if (object->lock_owner == NULL) {
172 0 : py_lock_owner = Py_None;
173 0 : Py_INCREF(py_lock_owner);
174 : } else {
175 0 : py_lock_owner = PyUnicode_Decode(object->lock_owner, strlen(object->lock_owner), "utf-8", "ignore");
176 : }
177 : }
178 0 : return py_lock_owner;
179 : }
180 :
181 0 : static int py_SERVICE_LOCK_STATUS_set_lock_owner(PyObject *py_obj, PyObject *value, void *closure)
182 : {
183 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
184 0 : if (value == NULL) {
185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lock_owner");
186 0 : return -1;
187 : }
188 0 : if (value == Py_None) {
189 0 : object->lock_owner = NULL;
190 : } else {
191 0 : object->lock_owner = NULL;
192 : {
193 : const char *test_str;
194 : const char *talloc_str;
195 0 : PyObject *unicode = NULL;
196 0 : if (PyUnicode_Check(value)) {
197 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
198 0 : if (unicode == NULL) {
199 0 : PyErr_NoMemory();
200 0 : return -1;
201 : }
202 0 : test_str = PyBytes_AS_STRING(unicode);
203 0 : } else if (PyBytes_Check(value)) {
204 0 : test_str = PyBytes_AS_STRING(value);
205 : } else {
206 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
207 0 : return -1;
208 : }
209 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
210 0 : if (unicode != NULL) {
211 0 : Py_DECREF(unicode);
212 : }
213 0 : if (talloc_str == NULL) {
214 0 : PyErr_NoMemory();
215 0 : return -1;
216 : }
217 0 : object->lock_owner = talloc_str;
218 : }
219 : }
220 0 : return 0;
221 : }
222 :
223 0 : static PyObject *py_SERVICE_LOCK_STATUS_get_lock_duration(PyObject *obj, void *closure)
224 : {
225 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(obj);
226 : PyObject *py_lock_duration;
227 0 : py_lock_duration = PyLong_FromUnsignedLongLong((uint32_t)object->lock_duration);
228 0 : return py_lock_duration;
229 : }
230 :
231 0 : static int py_SERVICE_LOCK_STATUS_set_lock_duration(PyObject *py_obj, PyObject *value, void *closure)
232 : {
233 0 : struct SERVICE_LOCK_STATUS *object = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(py_obj);
234 0 : if (value == NULL) {
235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lock_duration");
236 0 : return -1;
237 : }
238 : {
239 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lock_duration));
240 0 : if (PyLong_Check(value)) {
241 : unsigned long long test_var;
242 0 : test_var = PyLong_AsUnsignedLongLong(value);
243 0 : if (PyErr_Occurred() != NULL) {
244 0 : return -1;
245 : }
246 0 : if (test_var > uint_max) {
247 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
248 : PyLong_Type.tp_name, uint_max, test_var);
249 0 : return -1;
250 : }
251 0 : object->lock_duration = test_var;
252 : } else {
253 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
254 : PyLong_Type.tp_name);
255 0 : return -1;
256 : }
257 : }
258 0 : return 0;
259 : }
260 :
261 : static PyGetSetDef py_SERVICE_LOCK_STATUS_getsetters[] = {
262 : {
263 : .name = discard_const_p(char, "is_locked"),
264 : .get = py_SERVICE_LOCK_STATUS_get_is_locked,
265 : .set = py_SERVICE_LOCK_STATUS_set_is_locked,
266 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
267 : },
268 : {
269 : .name = discard_const_p(char, "lock_owner"),
270 : .get = py_SERVICE_LOCK_STATUS_get_lock_owner,
271 : .set = py_SERVICE_LOCK_STATUS_set_lock_owner,
272 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
273 : },
274 : {
275 : .name = discard_const_p(char, "lock_duration"),
276 : .get = py_SERVICE_LOCK_STATUS_get_lock_duration,
277 : .set = py_SERVICE_LOCK_STATUS_set_lock_duration,
278 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
279 : },
280 : { .name = NULL }
281 : };
282 :
283 0 : static PyObject *py_SERVICE_LOCK_STATUS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
284 : {
285 0 : return pytalloc_new(struct SERVICE_LOCK_STATUS, type);
286 : }
287 :
288 :
289 : static PyTypeObject SERVICE_LOCK_STATUS_Type = {
290 : PyVarObject_HEAD_INIT(NULL, 0)
291 : .tp_name = "svcctl.SERVICE_LOCK_STATUS",
292 : .tp_getset = py_SERVICE_LOCK_STATUS_getsetters,
293 : .tp_methods = NULL,
294 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
295 : .tp_new = py_SERVICE_LOCK_STATUS_new,
296 : };
297 :
298 :
299 0 : static PyObject *py_SERVICE_STATUS_get_type(PyObject *obj, void *closure)
300 : {
301 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
302 : PyObject *py_type;
303 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
304 0 : return py_type;
305 : }
306 :
307 0 : static int py_SERVICE_STATUS_set_type(PyObject *py_obj, PyObject *value, void *closure)
308 : {
309 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
310 0 : if (value == NULL) {
311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
312 0 : return -1;
313 : }
314 : {
315 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
316 0 : if (PyLong_Check(value)) {
317 : unsigned long long test_var;
318 0 : test_var = PyLong_AsUnsignedLongLong(value);
319 0 : if (PyErr_Occurred() != NULL) {
320 0 : return -1;
321 : }
322 0 : if (test_var > uint_max) {
323 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
324 : PyLong_Type.tp_name, uint_max, test_var);
325 0 : return -1;
326 : }
327 0 : object->type = test_var;
328 : } else {
329 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
330 : PyLong_Type.tp_name);
331 0 : return -1;
332 : }
333 : }
334 0 : return 0;
335 : }
336 :
337 0 : static PyObject *py_SERVICE_STATUS_get_state(PyObject *obj, void *closure)
338 : {
339 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
340 : PyObject *py_state;
341 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->state);
342 0 : return py_state;
343 : }
344 :
345 0 : static int py_SERVICE_STATUS_set_state(PyObject *py_obj, PyObject *value, void *closure)
346 : {
347 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
348 0 : if (value == NULL) {
349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->state");
350 0 : return -1;
351 : }
352 : {
353 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->state));
354 0 : if (PyLong_Check(value)) {
355 : unsigned long long test_var;
356 0 : test_var = PyLong_AsUnsignedLongLong(value);
357 0 : if (PyErr_Occurred() != NULL) {
358 0 : return -1;
359 : }
360 0 : if (test_var > uint_max) {
361 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
362 : PyLong_Type.tp_name, uint_max, test_var);
363 0 : return -1;
364 : }
365 0 : object->state = test_var;
366 : } else {
367 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
368 : PyLong_Type.tp_name);
369 0 : return -1;
370 : }
371 : }
372 0 : return 0;
373 : }
374 :
375 0 : static PyObject *py_SERVICE_STATUS_get_controls_accepted(PyObject *obj, void *closure)
376 : {
377 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
378 : PyObject *py_controls_accepted;
379 0 : py_controls_accepted = PyLong_FromUnsignedLongLong((uint32_t)object->controls_accepted);
380 0 : return py_controls_accepted;
381 : }
382 :
383 0 : static int py_SERVICE_STATUS_set_controls_accepted(PyObject *py_obj, PyObject *value, void *closure)
384 : {
385 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
386 0 : if (value == NULL) {
387 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->controls_accepted");
388 0 : return -1;
389 : }
390 : {
391 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->controls_accepted));
392 0 : if (PyLong_Check(value)) {
393 : unsigned long long test_var;
394 0 : test_var = PyLong_AsUnsignedLongLong(value);
395 0 : if (PyErr_Occurred() != NULL) {
396 0 : return -1;
397 : }
398 0 : if (test_var > uint_max) {
399 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
400 : PyLong_Type.tp_name, uint_max, test_var);
401 0 : return -1;
402 : }
403 0 : object->controls_accepted = test_var;
404 : } else {
405 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
406 : PyLong_Type.tp_name);
407 0 : return -1;
408 : }
409 : }
410 0 : return 0;
411 : }
412 :
413 0 : static PyObject *py_SERVICE_STATUS_get_win32_exit_code(PyObject *obj, void *closure)
414 : {
415 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
416 : PyObject *py_win32_exit_code;
417 0 : py_win32_exit_code = PyErr_FromWERROR(object->win32_exit_code);
418 0 : return py_win32_exit_code;
419 : }
420 :
421 0 : static int py_SERVICE_STATUS_set_win32_exit_code(PyObject *py_obj, PyObject *value, void *closure)
422 : {
423 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
424 0 : if (value == NULL) {
425 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->win32_exit_code");
426 0 : return -1;
427 : }
428 0 : object->win32_exit_code = W_ERROR(PyLong_AsLong(value));
429 0 : return 0;
430 : }
431 :
432 0 : static PyObject *py_SERVICE_STATUS_get_service_exit_code(PyObject *obj, void *closure)
433 : {
434 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
435 : PyObject *py_service_exit_code;
436 0 : py_service_exit_code = PyLong_FromUnsignedLongLong((uint32_t)object->service_exit_code);
437 0 : return py_service_exit_code;
438 : }
439 :
440 0 : static int py_SERVICE_STATUS_set_service_exit_code(PyObject *py_obj, PyObject *value, void *closure)
441 : {
442 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
443 0 : if (value == NULL) {
444 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_exit_code");
445 0 : return -1;
446 : }
447 : {
448 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_exit_code));
449 0 : if (PyLong_Check(value)) {
450 : unsigned long long test_var;
451 0 : test_var = PyLong_AsUnsignedLongLong(value);
452 0 : if (PyErr_Occurred() != NULL) {
453 0 : return -1;
454 : }
455 0 : if (test_var > uint_max) {
456 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
457 : PyLong_Type.tp_name, uint_max, test_var);
458 0 : return -1;
459 : }
460 0 : object->service_exit_code = test_var;
461 : } else {
462 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
463 : PyLong_Type.tp_name);
464 0 : return -1;
465 : }
466 : }
467 0 : return 0;
468 : }
469 :
470 0 : static PyObject *py_SERVICE_STATUS_get_check_point(PyObject *obj, void *closure)
471 : {
472 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
473 : PyObject *py_check_point;
474 0 : py_check_point = PyLong_FromUnsignedLongLong((uint32_t)object->check_point);
475 0 : return py_check_point;
476 : }
477 :
478 0 : static int py_SERVICE_STATUS_set_check_point(PyObject *py_obj, PyObject *value, void *closure)
479 : {
480 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
481 0 : if (value == NULL) {
482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->check_point");
483 0 : return -1;
484 : }
485 : {
486 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->check_point));
487 0 : if (PyLong_Check(value)) {
488 : unsigned long long test_var;
489 0 : test_var = PyLong_AsUnsignedLongLong(value);
490 0 : if (PyErr_Occurred() != NULL) {
491 0 : return -1;
492 : }
493 0 : if (test_var > uint_max) {
494 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
495 : PyLong_Type.tp_name, uint_max, test_var);
496 0 : return -1;
497 : }
498 0 : object->check_point = test_var;
499 : } else {
500 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
501 : PyLong_Type.tp_name);
502 0 : return -1;
503 : }
504 : }
505 0 : return 0;
506 : }
507 :
508 0 : static PyObject *py_SERVICE_STATUS_get_wait_hint(PyObject *obj, void *closure)
509 : {
510 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(obj);
511 : PyObject *py_wait_hint;
512 0 : py_wait_hint = PyLong_FromUnsignedLongLong((uint32_t)object->wait_hint);
513 0 : return py_wait_hint;
514 : }
515 :
516 0 : static int py_SERVICE_STATUS_set_wait_hint(PyObject *py_obj, PyObject *value, void *closure)
517 : {
518 0 : struct SERVICE_STATUS *object = (struct SERVICE_STATUS *)pytalloc_get_ptr(py_obj);
519 0 : if (value == NULL) {
520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->wait_hint");
521 0 : return -1;
522 : }
523 : {
524 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wait_hint));
525 0 : if (PyLong_Check(value)) {
526 : unsigned long long test_var;
527 0 : test_var = PyLong_AsUnsignedLongLong(value);
528 0 : if (PyErr_Occurred() != NULL) {
529 0 : return -1;
530 : }
531 0 : if (test_var > uint_max) {
532 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
533 : PyLong_Type.tp_name, uint_max, test_var);
534 0 : return -1;
535 : }
536 0 : object->wait_hint = test_var;
537 : } else {
538 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
539 : PyLong_Type.tp_name);
540 0 : return -1;
541 : }
542 : }
543 0 : return 0;
544 : }
545 :
546 : static PyGetSetDef py_SERVICE_STATUS_getsetters[] = {
547 : {
548 : .name = discard_const_p(char, "type"),
549 : .get = py_SERVICE_STATUS_get_type,
550 : .set = py_SERVICE_STATUS_set_type,
551 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
552 : },
553 : {
554 : .name = discard_const_p(char, "state"),
555 : .get = py_SERVICE_STATUS_get_state,
556 : .set = py_SERVICE_STATUS_set_state,
557 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceStatus")
558 : },
559 : {
560 : .name = discard_const_p(char, "controls_accepted"),
561 : .get = py_SERVICE_STATUS_get_controls_accepted,
562 : .set = py_SERVICE_STATUS_set_controls_accepted,
563 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ControlsAccepted")
564 : },
565 : {
566 : .name = discard_const_p(char, "win32_exit_code"),
567 : .get = py_SERVICE_STATUS_get_win32_exit_code,
568 : .set = py_SERVICE_STATUS_set_win32_exit_code,
569 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
570 : },
571 : {
572 : .name = discard_const_p(char, "service_exit_code"),
573 : .get = py_SERVICE_STATUS_get_service_exit_code,
574 : .set = py_SERVICE_STATUS_set_service_exit_code,
575 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
576 : },
577 : {
578 : .name = discard_const_p(char, "check_point"),
579 : .get = py_SERVICE_STATUS_get_check_point,
580 : .set = py_SERVICE_STATUS_set_check_point,
581 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
582 : },
583 : {
584 : .name = discard_const_p(char, "wait_hint"),
585 : .get = py_SERVICE_STATUS_get_wait_hint,
586 : .set = py_SERVICE_STATUS_set_wait_hint,
587 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
588 : },
589 : { .name = NULL }
590 : };
591 :
592 0 : static PyObject *py_SERVICE_STATUS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
593 : {
594 0 : return pytalloc_new(struct SERVICE_STATUS, type);
595 : }
596 :
597 :
598 : static PyTypeObject SERVICE_STATUS_Type = {
599 : PyVarObject_HEAD_INIT(NULL, 0)
600 : .tp_name = "svcctl.SERVICE_STATUS",
601 : .tp_getset = py_SERVICE_STATUS_getsetters,
602 : .tp_methods = NULL,
603 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
604 : .tp_new = py_SERVICE_STATUS_new,
605 : };
606 :
607 :
608 0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_status(PyObject *obj, void *closure)
609 : {
610 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
611 : PyObject *py_status;
612 0 : py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
613 0 : return py_status;
614 : }
615 :
616 0 : static int py_SERVICE_STATUS_PROCESS_set_status(PyObject *py_obj, PyObject *value, void *closure)
617 : {
618 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
619 0 : if (value == NULL) {
620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
621 0 : return -1;
622 : }
623 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
624 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
625 0 : PyErr_NoMemory();
626 0 : return -1;
627 : }
628 0 : object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
629 0 : return 0;
630 : }
631 :
632 0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_process_id(PyObject *obj, void *closure)
633 : {
634 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
635 : PyObject *py_process_id;
636 0 : py_process_id = PyLong_FromUnsignedLongLong((uint32_t)object->process_id);
637 0 : return py_process_id;
638 : }
639 :
640 0 : static int py_SERVICE_STATUS_PROCESS_set_process_id(PyObject *py_obj, PyObject *value, void *closure)
641 : {
642 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
643 0 : if (value == NULL) {
644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->process_id");
645 0 : return -1;
646 : }
647 : {
648 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->process_id));
649 0 : if (PyLong_Check(value)) {
650 : unsigned long long test_var;
651 0 : test_var = PyLong_AsUnsignedLongLong(value);
652 0 : if (PyErr_Occurred() != NULL) {
653 0 : return -1;
654 : }
655 0 : if (test_var > uint_max) {
656 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
657 : PyLong_Type.tp_name, uint_max, test_var);
658 0 : return -1;
659 : }
660 0 : object->process_id = test_var;
661 : } else {
662 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
663 : PyLong_Type.tp_name);
664 0 : return -1;
665 : }
666 : }
667 0 : return 0;
668 : }
669 :
670 0 : static PyObject *py_SERVICE_STATUS_PROCESS_get_service_flags(PyObject *obj, void *closure)
671 : {
672 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(obj);
673 : PyObject *py_service_flags;
674 0 : py_service_flags = PyLong_FromUnsignedLongLong((uint32_t)object->service_flags);
675 0 : return py_service_flags;
676 : }
677 :
678 0 : static int py_SERVICE_STATUS_PROCESS_set_service_flags(PyObject *py_obj, PyObject *value, void *closure)
679 : {
680 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
681 0 : if (value == NULL) {
682 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_flags");
683 0 : return -1;
684 : }
685 : {
686 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_flags));
687 0 : if (PyLong_Check(value)) {
688 : unsigned long long test_var;
689 0 : test_var = PyLong_AsUnsignedLongLong(value);
690 0 : if (PyErr_Occurred() != NULL) {
691 0 : return -1;
692 : }
693 0 : if (test_var > uint_max) {
694 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
695 : PyLong_Type.tp_name, uint_max, test_var);
696 0 : return -1;
697 : }
698 0 : object->service_flags = test_var;
699 : } else {
700 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
701 : PyLong_Type.tp_name);
702 0 : return -1;
703 : }
704 : }
705 0 : return 0;
706 : }
707 :
708 : static PyGetSetDef py_SERVICE_STATUS_PROCESS_getsetters[] = {
709 : {
710 : .name = discard_const_p(char, "status"),
711 : .get = py_SERVICE_STATUS_PROCESS_get_status,
712 : .set = py_SERVICE_STATUS_PROCESS_set_status,
713 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
714 : },
715 : {
716 : .name = discard_const_p(char, "process_id"),
717 : .get = py_SERVICE_STATUS_PROCESS_get_process_id,
718 : .set = py_SERVICE_STATUS_PROCESS_set_process_id,
719 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
720 : },
721 : {
722 : .name = discard_const_p(char, "service_flags"),
723 : .get = py_SERVICE_STATUS_PROCESS_get_service_flags,
724 : .set = py_SERVICE_STATUS_PROCESS_set_service_flags,
725 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
726 : },
727 : { .name = NULL }
728 : };
729 :
730 0 : static PyObject *py_SERVICE_STATUS_PROCESS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
731 : {
732 0 : return pytalloc_new(struct SERVICE_STATUS_PROCESS, type);
733 : }
734 :
735 0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
736 : {
737 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
738 0 : PyObject *ret = NULL;
739 : DATA_BLOB blob;
740 : enum ndr_err_code err;
741 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
742 0 : if (tmp_ctx == NULL) {
743 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
744 0 : return NULL;
745 : }
746 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_STATUS_PROCESS);
747 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
748 0 : TALLOC_FREE(tmp_ctx);
749 0 : PyErr_SetNdrError(err);
750 0 : return NULL;
751 : }
752 :
753 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
754 0 : TALLOC_FREE(tmp_ctx);
755 0 : return ret;
756 : }
757 :
758 0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
759 : {
760 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
761 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
762 0 : Py_ssize_t blob_length = 0;
763 : enum ndr_err_code err;
764 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
765 0 : PyObject *allow_remaining_obj = NULL;
766 0 : bool allow_remaining = false;
767 :
768 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
769 : discard_const_p(char *, kwnames),
770 : &blob.data, &blob_length,
771 : &allow_remaining_obj)) {
772 0 : return NULL;
773 : }
774 0 : blob.length = blob_length;
775 :
776 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
777 0 : allow_remaining = true;
778 : }
779 :
780 0 : if (allow_remaining) {
781 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_STATUS_PROCESS);
782 : } else {
783 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_STATUS_PROCESS);
784 : }
785 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
786 0 : PyErr_SetNdrError(err);
787 0 : return NULL;
788 : }
789 :
790 0 : Py_RETURN_NONE;
791 : }
792 :
793 0 : static PyObject *py_SERVICE_STATUS_PROCESS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
794 : {
795 0 : struct SERVICE_STATUS_PROCESS *object = (struct SERVICE_STATUS_PROCESS *)pytalloc_get_ptr(py_obj);
796 : PyObject *ret;
797 : char *retstr;
798 :
799 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_STATUS_PROCESS, "SERVICE_STATUS_PROCESS", object);
800 0 : ret = PyUnicode_FromString(retstr);
801 0 : talloc_free(retstr);
802 :
803 0 : return ret;
804 : }
805 :
806 : static PyMethodDef py_SERVICE_STATUS_PROCESS_methods[] = {
807 : { "__ndr_pack__", (PyCFunction)py_SERVICE_STATUS_PROCESS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
808 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SERVICE_STATUS_PROCESS_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
809 : { "__ndr_print__", (PyCFunction)py_SERVICE_STATUS_PROCESS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
810 : { NULL, NULL, 0, NULL }
811 : };
812 :
813 :
814 : static PyTypeObject SERVICE_STATUS_PROCESS_Type = {
815 : PyVarObject_HEAD_INIT(NULL, 0)
816 : .tp_name = "svcctl.SERVICE_STATUS_PROCESS",
817 : .tp_getset = py_SERVICE_STATUS_PROCESS_getsetters,
818 : .tp_methods = py_SERVICE_STATUS_PROCESS_methods,
819 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
820 : .tp_new = py_SERVICE_STATUS_PROCESS_new,
821 : };
822 :
823 :
824 0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_service_name(PyObject *obj, void *closure)
825 : {
826 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
827 : PyObject *py_service_name;
828 0 : if (object->service_name == NULL) {
829 0 : Py_RETURN_NONE;
830 : }
831 0 : if (object->service_name == NULL) {
832 0 : py_service_name = Py_None;
833 0 : Py_INCREF(py_service_name);
834 : } else {
835 0 : py_service_name = PyString_FromStringOrNULL(object->service_name);
836 : }
837 0 : return py_service_name;
838 : }
839 :
840 0 : static int py_ENUM_SERVICE_STATUSW_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
841 : {
842 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
843 0 : if (value == NULL) {
844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_name");
845 0 : return -1;
846 : }
847 0 : if (value == Py_None) {
848 0 : object->service_name = NULL;
849 : } else {
850 0 : object->service_name = NULL;
851 : {
852 : const char *test_str;
853 : const char *talloc_str;
854 0 : PyObject *unicode = NULL;
855 0 : if (PyUnicode_Check(value)) {
856 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
857 0 : if (unicode == NULL) {
858 0 : PyErr_NoMemory();
859 0 : return -1;
860 : }
861 0 : test_str = PyBytes_AS_STRING(unicode);
862 0 : } else if (PyBytes_Check(value)) {
863 0 : test_str = PyBytes_AS_STRING(value);
864 : } else {
865 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
866 0 : return -1;
867 : }
868 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
869 0 : if (unicode != NULL) {
870 0 : Py_DECREF(unicode);
871 : }
872 0 : if (talloc_str == NULL) {
873 0 : PyErr_NoMemory();
874 0 : return -1;
875 : }
876 0 : object->service_name = talloc_str;
877 : }
878 : }
879 0 : return 0;
880 : }
881 :
882 0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_display_name(PyObject *obj, void *closure)
883 : {
884 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
885 : PyObject *py_display_name;
886 0 : if (object->display_name == NULL) {
887 0 : Py_RETURN_NONE;
888 : }
889 0 : if (object->display_name == NULL) {
890 0 : py_display_name = Py_None;
891 0 : Py_INCREF(py_display_name);
892 : } else {
893 0 : py_display_name = PyString_FromStringOrNULL(object->display_name);
894 : }
895 0 : return py_display_name;
896 : }
897 :
898 0 : static int py_ENUM_SERVICE_STATUSW_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
899 : {
900 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
901 0 : if (value == NULL) {
902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->display_name");
903 0 : return -1;
904 : }
905 0 : if (value == Py_None) {
906 0 : object->display_name = NULL;
907 : } else {
908 0 : object->display_name = NULL;
909 : {
910 : const char *test_str;
911 : const char *talloc_str;
912 0 : PyObject *unicode = NULL;
913 0 : if (PyUnicode_Check(value)) {
914 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
915 0 : if (unicode == NULL) {
916 0 : PyErr_NoMemory();
917 0 : return -1;
918 : }
919 0 : test_str = PyBytes_AS_STRING(unicode);
920 0 : } else if (PyBytes_Check(value)) {
921 0 : test_str = PyBytes_AS_STRING(value);
922 : } else {
923 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
924 0 : return -1;
925 : }
926 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
927 0 : if (unicode != NULL) {
928 0 : Py_DECREF(unicode);
929 : }
930 0 : if (talloc_str == NULL) {
931 0 : PyErr_NoMemory();
932 0 : return -1;
933 : }
934 0 : object->display_name = talloc_str;
935 : }
936 : }
937 0 : return 0;
938 : }
939 :
940 0 : static PyObject *py_ENUM_SERVICE_STATUSW_get_status(PyObject *obj, void *closure)
941 : {
942 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(obj);
943 : PyObject *py_status;
944 0 : py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
945 0 : return py_status;
946 : }
947 :
948 0 : static int py_ENUM_SERVICE_STATUSW_set_status(PyObject *py_obj, PyObject *value, void *closure)
949 : {
950 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
951 0 : if (value == NULL) {
952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
953 0 : return -1;
954 : }
955 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
956 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
957 0 : PyErr_NoMemory();
958 0 : return -1;
959 : }
960 0 : object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
961 0 : return 0;
962 : }
963 :
964 : static PyGetSetDef py_ENUM_SERVICE_STATUSW_getsetters[] = {
965 : {
966 : .name = discard_const_p(char, "service_name"),
967 : .get = py_ENUM_SERVICE_STATUSW_get_service_name,
968 : .set = py_ENUM_SERVICE_STATUSW_set_service_name,
969 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
970 : },
971 : {
972 : .name = discard_const_p(char, "display_name"),
973 : .get = py_ENUM_SERVICE_STATUSW_get_display_name,
974 : .set = py_ENUM_SERVICE_STATUSW_set_display_name,
975 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
976 : },
977 : {
978 : .name = discard_const_p(char, "status"),
979 : .get = py_ENUM_SERVICE_STATUSW_get_status,
980 : .set = py_ENUM_SERVICE_STATUSW_set_status,
981 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
982 : },
983 : { .name = NULL }
984 : };
985 :
986 0 : static PyObject *py_ENUM_SERVICE_STATUSW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
987 : {
988 0 : return pytalloc_new(struct ENUM_SERVICE_STATUSW, type);
989 : }
990 :
991 0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
992 : {
993 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
994 0 : PyObject *ret = NULL;
995 : DATA_BLOB blob;
996 : enum ndr_err_code err;
997 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
998 0 : if (tmp_ctx == NULL) {
999 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1000 0 : return NULL;
1001 : }
1002 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSW);
1003 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1004 0 : TALLOC_FREE(tmp_ctx);
1005 0 : PyErr_SetNdrError(err);
1006 0 : return NULL;
1007 : }
1008 :
1009 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1010 0 : TALLOC_FREE(tmp_ctx);
1011 0 : return ret;
1012 : }
1013 :
1014 0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1015 : {
1016 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
1017 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1018 0 : Py_ssize_t blob_length = 0;
1019 : enum ndr_err_code err;
1020 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1021 0 : PyObject *allow_remaining_obj = NULL;
1022 0 : bool allow_remaining = false;
1023 :
1024 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1025 : discard_const_p(char *, kwnames),
1026 : &blob.data, &blob_length,
1027 : &allow_remaining_obj)) {
1028 0 : return NULL;
1029 : }
1030 0 : blob.length = blob_length;
1031 :
1032 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1033 0 : allow_remaining = true;
1034 : }
1035 :
1036 0 : if (allow_remaining) {
1037 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSW);
1038 : } else {
1039 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSW);
1040 : }
1041 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1042 0 : PyErr_SetNdrError(err);
1043 0 : return NULL;
1044 : }
1045 :
1046 0 : Py_RETURN_NONE;
1047 : }
1048 :
1049 0 : static PyObject *py_ENUM_SERVICE_STATUSW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1050 : {
1051 0 : struct ENUM_SERVICE_STATUSW *object = (struct ENUM_SERVICE_STATUSW *)pytalloc_get_ptr(py_obj);
1052 : PyObject *ret;
1053 : char *retstr;
1054 :
1055 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ENUM_SERVICE_STATUSW, "ENUM_SERVICE_STATUSW", object);
1056 0 : ret = PyUnicode_FromString(retstr);
1057 0 : talloc_free(retstr);
1058 :
1059 0 : return ret;
1060 : }
1061 :
1062 : static PyMethodDef py_ENUM_SERVICE_STATUSW_methods[] = {
1063 : { "__ndr_pack__", (PyCFunction)py_ENUM_SERVICE_STATUSW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1064 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ENUM_SERVICE_STATUSW_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1065 : { "__ndr_print__", (PyCFunction)py_ENUM_SERVICE_STATUSW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1066 : { NULL, NULL, 0, NULL }
1067 : };
1068 :
1069 :
1070 : static PyTypeObject ENUM_SERVICE_STATUSW_Type = {
1071 : PyVarObject_HEAD_INIT(NULL, 0)
1072 : .tp_name = "svcctl.ENUM_SERVICE_STATUSW",
1073 : .tp_getset = py_ENUM_SERVICE_STATUSW_getsetters,
1074 : .tp_methods = py_ENUM_SERVICE_STATUSW_methods,
1075 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1076 : .tp_new = py_ENUM_SERVICE_STATUSW_new,
1077 : };
1078 :
1079 :
1080 0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_service_name(PyObject *obj, void *closure)
1081 : {
1082 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
1083 : PyObject *py_service_name;
1084 0 : if (object->service_name == NULL) {
1085 0 : Py_RETURN_NONE;
1086 : }
1087 0 : if (object->service_name == NULL) {
1088 0 : py_service_name = Py_None;
1089 0 : Py_INCREF(py_service_name);
1090 : } else {
1091 0 : py_service_name = PyString_FromStringOrNULL(object->service_name);
1092 : }
1093 0 : return py_service_name;
1094 : }
1095 :
1096 0 : static int py_ENUM_SERVICE_STATUSA_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
1097 : {
1098 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1099 0 : if (value == NULL) {
1100 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_name");
1101 0 : return -1;
1102 : }
1103 0 : if (value == Py_None) {
1104 0 : object->service_name = NULL;
1105 : } else {
1106 0 : object->service_name = NULL;
1107 : {
1108 : const char *test_str;
1109 : const char *talloc_str;
1110 0 : PyObject *unicode = NULL;
1111 0 : if (PyUnicode_Check(value)) {
1112 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1113 0 : if (unicode == NULL) {
1114 0 : PyErr_NoMemory();
1115 0 : return -1;
1116 : }
1117 0 : test_str = PyBytes_AS_STRING(unicode);
1118 0 : } else if (PyBytes_Check(value)) {
1119 0 : test_str = PyBytes_AS_STRING(value);
1120 : } else {
1121 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1122 0 : return -1;
1123 : }
1124 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1125 0 : if (unicode != NULL) {
1126 0 : Py_DECREF(unicode);
1127 : }
1128 0 : if (talloc_str == NULL) {
1129 0 : PyErr_NoMemory();
1130 0 : return -1;
1131 : }
1132 0 : object->service_name = talloc_str;
1133 : }
1134 : }
1135 0 : return 0;
1136 : }
1137 :
1138 0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_display_name(PyObject *obj, void *closure)
1139 : {
1140 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
1141 : PyObject *py_display_name;
1142 0 : if (object->display_name == NULL) {
1143 0 : Py_RETURN_NONE;
1144 : }
1145 0 : if (object->display_name == NULL) {
1146 0 : py_display_name = Py_None;
1147 0 : Py_INCREF(py_display_name);
1148 : } else {
1149 0 : py_display_name = PyString_FromStringOrNULL(object->display_name);
1150 : }
1151 0 : return py_display_name;
1152 : }
1153 :
1154 0 : static int py_ENUM_SERVICE_STATUSA_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
1155 : {
1156 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1157 0 : if (value == NULL) {
1158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->display_name");
1159 0 : return -1;
1160 : }
1161 0 : if (value == Py_None) {
1162 0 : object->display_name = NULL;
1163 : } else {
1164 0 : object->display_name = NULL;
1165 : {
1166 : const char *test_str;
1167 : const char *talloc_str;
1168 0 : PyObject *unicode = NULL;
1169 0 : if (PyUnicode_Check(value)) {
1170 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1171 0 : if (unicode == NULL) {
1172 0 : PyErr_NoMemory();
1173 0 : return -1;
1174 : }
1175 0 : test_str = PyBytes_AS_STRING(unicode);
1176 0 : } else if (PyBytes_Check(value)) {
1177 0 : test_str = PyBytes_AS_STRING(value);
1178 : } else {
1179 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1180 0 : return -1;
1181 : }
1182 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1183 0 : if (unicode != NULL) {
1184 0 : Py_DECREF(unicode);
1185 : }
1186 0 : if (talloc_str == NULL) {
1187 0 : PyErr_NoMemory();
1188 0 : return -1;
1189 : }
1190 0 : object->display_name = talloc_str;
1191 : }
1192 : }
1193 0 : return 0;
1194 : }
1195 :
1196 0 : static PyObject *py_ENUM_SERVICE_STATUSA_get_status(PyObject *obj, void *closure)
1197 : {
1198 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(obj);
1199 : PyObject *py_status;
1200 0 : py_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, pytalloc_get_mem_ctx(obj), &object->status);
1201 0 : return py_status;
1202 : }
1203 :
1204 0 : static int py_ENUM_SERVICE_STATUSA_set_status(PyObject *py_obj, PyObject *value, void *closure)
1205 : {
1206 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1207 0 : if (value == NULL) {
1208 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
1209 0 : return -1;
1210 : }
1211 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
1212 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1213 0 : PyErr_NoMemory();
1214 0 : return -1;
1215 : }
1216 0 : object->status = *(struct SERVICE_STATUS *)pytalloc_get_ptr(value);
1217 0 : return 0;
1218 : }
1219 :
1220 : static PyGetSetDef py_ENUM_SERVICE_STATUSA_getsetters[] = {
1221 : {
1222 : .name = discard_const_p(char, "service_name"),
1223 : .get = py_ENUM_SERVICE_STATUSA_get_service_name,
1224 : .set = py_ENUM_SERVICE_STATUSA_set_service_name,
1225 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1226 : },
1227 : {
1228 : .name = discard_const_p(char, "display_name"),
1229 : .get = py_ENUM_SERVICE_STATUSA_get_display_name,
1230 : .set = py_ENUM_SERVICE_STATUSA_set_display_name,
1231 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1232 : },
1233 : {
1234 : .name = discard_const_p(char, "status"),
1235 : .get = py_ENUM_SERVICE_STATUSA_get_status,
1236 : .set = py_ENUM_SERVICE_STATUSA_set_status,
1237 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
1238 : },
1239 : { .name = NULL }
1240 : };
1241 :
1242 0 : static PyObject *py_ENUM_SERVICE_STATUSA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1243 : {
1244 0 : return pytalloc_new(struct ENUM_SERVICE_STATUSA, type);
1245 : }
1246 :
1247 0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1248 : {
1249 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1250 0 : PyObject *ret = NULL;
1251 : DATA_BLOB blob;
1252 : enum ndr_err_code err;
1253 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1254 0 : if (tmp_ctx == NULL) {
1255 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1256 0 : return NULL;
1257 : }
1258 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSA);
1259 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1260 0 : TALLOC_FREE(tmp_ctx);
1261 0 : PyErr_SetNdrError(err);
1262 0 : return NULL;
1263 : }
1264 :
1265 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1266 0 : TALLOC_FREE(tmp_ctx);
1267 0 : return ret;
1268 : }
1269 :
1270 0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1271 : {
1272 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1273 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1274 0 : Py_ssize_t blob_length = 0;
1275 : enum ndr_err_code err;
1276 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1277 0 : PyObject *allow_remaining_obj = NULL;
1278 0 : bool allow_remaining = false;
1279 :
1280 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1281 : discard_const_p(char *, kwnames),
1282 : &blob.data, &blob_length,
1283 : &allow_remaining_obj)) {
1284 0 : return NULL;
1285 : }
1286 0 : blob.length = blob_length;
1287 :
1288 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1289 0 : allow_remaining = true;
1290 : }
1291 :
1292 0 : if (allow_remaining) {
1293 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSA);
1294 : } else {
1295 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ENUM_SERVICE_STATUSA);
1296 : }
1297 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1298 0 : PyErr_SetNdrError(err);
1299 0 : return NULL;
1300 : }
1301 :
1302 0 : Py_RETURN_NONE;
1303 : }
1304 :
1305 0 : static PyObject *py_ENUM_SERVICE_STATUSA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1306 : {
1307 0 : struct ENUM_SERVICE_STATUSA *object = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(py_obj);
1308 : PyObject *ret;
1309 : char *retstr;
1310 :
1311 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ENUM_SERVICE_STATUSA, "ENUM_SERVICE_STATUSA", object);
1312 0 : ret = PyUnicode_FromString(retstr);
1313 0 : talloc_free(retstr);
1314 :
1315 0 : return ret;
1316 : }
1317 :
1318 : static PyMethodDef py_ENUM_SERVICE_STATUSA_methods[] = {
1319 : { "__ndr_pack__", (PyCFunction)py_ENUM_SERVICE_STATUSA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1320 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ENUM_SERVICE_STATUSA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1321 : { "__ndr_print__", (PyCFunction)py_ENUM_SERVICE_STATUSA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1322 : { NULL, NULL, 0, NULL }
1323 : };
1324 :
1325 :
1326 : static PyTypeObject ENUM_SERVICE_STATUSA_Type = {
1327 : PyVarObject_HEAD_INIT(NULL, 0)
1328 : .tp_name = "svcctl.ENUM_SERVICE_STATUSA",
1329 : .tp_getset = py_ENUM_SERVICE_STATUSA_getsetters,
1330 : .tp_methods = py_ENUM_SERVICE_STATUSA_methods,
1331 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1332 : .tp_new = py_ENUM_SERVICE_STATUSA_new,
1333 : };
1334 :
1335 :
1336 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_service_type(PyObject *obj, void *closure)
1337 : {
1338 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1339 : PyObject *py_service_type;
1340 0 : py_service_type = PyLong_FromUnsignedLongLong((uint32_t)object->service_type);
1341 0 : return py_service_type;
1342 : }
1343 :
1344 0 : static int py_QUERY_SERVICE_CONFIG_set_service_type(PyObject *py_obj, PyObject *value, void *closure)
1345 : {
1346 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1347 0 : if (value == NULL) {
1348 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_type");
1349 0 : return -1;
1350 : }
1351 : {
1352 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_type));
1353 0 : if (PyLong_Check(value)) {
1354 : unsigned long long test_var;
1355 0 : test_var = PyLong_AsUnsignedLongLong(value);
1356 0 : if (PyErr_Occurred() != NULL) {
1357 0 : return -1;
1358 : }
1359 0 : if (test_var > uint_max) {
1360 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1361 : PyLong_Type.tp_name, uint_max, test_var);
1362 0 : return -1;
1363 : }
1364 0 : object->service_type = test_var;
1365 : } else {
1366 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1367 : PyLong_Type.tp_name);
1368 0 : return -1;
1369 : }
1370 : }
1371 0 : return 0;
1372 : }
1373 :
1374 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_start_type(PyObject *obj, void *closure)
1375 : {
1376 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1377 : PyObject *py_start_type;
1378 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->start_type);
1379 0 : return py_start_type;
1380 : }
1381 :
1382 0 : static int py_QUERY_SERVICE_CONFIG_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
1383 : {
1384 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1385 0 : if (value == NULL) {
1386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->start_type");
1387 0 : return -1;
1388 : }
1389 : {
1390 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start_type));
1391 0 : if (PyLong_Check(value)) {
1392 : unsigned long long test_var;
1393 0 : test_var = PyLong_AsUnsignedLongLong(value);
1394 0 : if (PyErr_Occurred() != NULL) {
1395 0 : return -1;
1396 : }
1397 0 : if (test_var > uint_max) {
1398 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1399 : PyLong_Type.tp_name, uint_max, test_var);
1400 0 : return -1;
1401 : }
1402 0 : object->start_type = test_var;
1403 : } else {
1404 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1405 : PyLong_Type.tp_name);
1406 0 : return -1;
1407 : }
1408 : }
1409 0 : return 0;
1410 : }
1411 :
1412 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_error_control(PyObject *obj, void *closure)
1413 : {
1414 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1415 : PyObject *py_error_control;
1416 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->error_control);
1417 0 : return py_error_control;
1418 : }
1419 :
1420 0 : static int py_QUERY_SERVICE_CONFIG_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
1421 : {
1422 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1423 0 : if (value == NULL) {
1424 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->error_control");
1425 0 : return -1;
1426 : }
1427 : {
1428 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->error_control));
1429 0 : if (PyLong_Check(value)) {
1430 : unsigned long long test_var;
1431 0 : test_var = PyLong_AsUnsignedLongLong(value);
1432 0 : if (PyErr_Occurred() != NULL) {
1433 0 : return -1;
1434 : }
1435 0 : if (test_var > uint_max) {
1436 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1437 : PyLong_Type.tp_name, uint_max, test_var);
1438 0 : return -1;
1439 : }
1440 0 : object->error_control = test_var;
1441 : } else {
1442 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1443 : PyLong_Type.tp_name);
1444 0 : return -1;
1445 : }
1446 : }
1447 0 : return 0;
1448 : }
1449 :
1450 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_executablepath(PyObject *obj, void *closure)
1451 : {
1452 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1453 : PyObject *py_executablepath;
1454 0 : if (object->executablepath == NULL) {
1455 0 : Py_RETURN_NONE;
1456 : }
1457 0 : if (object->executablepath == NULL) {
1458 0 : py_executablepath = Py_None;
1459 0 : Py_INCREF(py_executablepath);
1460 : } else {
1461 0 : if (object->executablepath == NULL) {
1462 0 : py_executablepath = Py_None;
1463 0 : Py_INCREF(py_executablepath);
1464 : } else {
1465 0 : py_executablepath = PyUnicode_Decode(object->executablepath, strlen(object->executablepath), "utf-8", "ignore");
1466 : }
1467 : }
1468 0 : return py_executablepath;
1469 : }
1470 :
1471 0 : static int py_QUERY_SERVICE_CONFIG_set_executablepath(PyObject *py_obj, PyObject *value, void *closure)
1472 : {
1473 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1474 0 : if (value == NULL) {
1475 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->executablepath");
1476 0 : return -1;
1477 : }
1478 0 : if (value == Py_None) {
1479 0 : object->executablepath = NULL;
1480 : } else {
1481 0 : object->executablepath = NULL;
1482 : {
1483 : const char *test_str;
1484 : const char *talloc_str;
1485 0 : PyObject *unicode = NULL;
1486 0 : if (PyUnicode_Check(value)) {
1487 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1488 0 : if (unicode == NULL) {
1489 0 : PyErr_NoMemory();
1490 0 : return -1;
1491 : }
1492 0 : test_str = PyBytes_AS_STRING(unicode);
1493 0 : } else if (PyBytes_Check(value)) {
1494 0 : test_str = PyBytes_AS_STRING(value);
1495 : } else {
1496 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1497 0 : return -1;
1498 : }
1499 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1500 0 : if (unicode != NULL) {
1501 0 : Py_DECREF(unicode);
1502 : }
1503 0 : if (talloc_str == NULL) {
1504 0 : PyErr_NoMemory();
1505 0 : return -1;
1506 : }
1507 0 : object->executablepath = talloc_str;
1508 : }
1509 : }
1510 0 : return 0;
1511 : }
1512 :
1513 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_loadordergroup(PyObject *obj, void *closure)
1514 : {
1515 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1516 : PyObject *py_loadordergroup;
1517 0 : if (object->loadordergroup == NULL) {
1518 0 : Py_RETURN_NONE;
1519 : }
1520 0 : if (object->loadordergroup == NULL) {
1521 0 : py_loadordergroup = Py_None;
1522 0 : Py_INCREF(py_loadordergroup);
1523 : } else {
1524 0 : if (object->loadordergroup == NULL) {
1525 0 : py_loadordergroup = Py_None;
1526 0 : Py_INCREF(py_loadordergroup);
1527 : } else {
1528 0 : py_loadordergroup = PyUnicode_Decode(object->loadordergroup, strlen(object->loadordergroup), "utf-8", "ignore");
1529 : }
1530 : }
1531 0 : return py_loadordergroup;
1532 : }
1533 :
1534 0 : static int py_QUERY_SERVICE_CONFIG_set_loadordergroup(PyObject *py_obj, PyObject *value, void *closure)
1535 : {
1536 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1537 0 : if (value == NULL) {
1538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->loadordergroup");
1539 0 : return -1;
1540 : }
1541 0 : if (value == Py_None) {
1542 0 : object->loadordergroup = NULL;
1543 : } else {
1544 0 : object->loadordergroup = NULL;
1545 : {
1546 : const char *test_str;
1547 : const char *talloc_str;
1548 0 : PyObject *unicode = NULL;
1549 0 : if (PyUnicode_Check(value)) {
1550 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1551 0 : if (unicode == NULL) {
1552 0 : PyErr_NoMemory();
1553 0 : return -1;
1554 : }
1555 0 : test_str = PyBytes_AS_STRING(unicode);
1556 0 : } else if (PyBytes_Check(value)) {
1557 0 : test_str = PyBytes_AS_STRING(value);
1558 : } else {
1559 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1560 0 : return -1;
1561 : }
1562 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1563 0 : if (unicode != NULL) {
1564 0 : Py_DECREF(unicode);
1565 : }
1566 0 : if (talloc_str == NULL) {
1567 0 : PyErr_NoMemory();
1568 0 : return -1;
1569 : }
1570 0 : object->loadordergroup = talloc_str;
1571 : }
1572 : }
1573 0 : return 0;
1574 : }
1575 :
1576 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_tag_id(PyObject *obj, void *closure)
1577 : {
1578 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1579 : PyObject *py_tag_id;
1580 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)object->tag_id);
1581 0 : return py_tag_id;
1582 : }
1583 :
1584 0 : static int py_QUERY_SERVICE_CONFIG_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
1585 : {
1586 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1587 0 : if (value == NULL) {
1588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tag_id");
1589 0 : return -1;
1590 : }
1591 : {
1592 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tag_id));
1593 0 : if (PyLong_Check(value)) {
1594 : unsigned long long test_var;
1595 0 : test_var = PyLong_AsUnsignedLongLong(value);
1596 0 : if (PyErr_Occurred() != NULL) {
1597 0 : return -1;
1598 : }
1599 0 : if (test_var > uint_max) {
1600 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1601 : PyLong_Type.tp_name, uint_max, test_var);
1602 0 : return -1;
1603 : }
1604 0 : object->tag_id = test_var;
1605 : } else {
1606 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1607 : PyLong_Type.tp_name);
1608 0 : return -1;
1609 : }
1610 : }
1611 0 : return 0;
1612 : }
1613 :
1614 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_dependencies(PyObject *obj, void *closure)
1615 : {
1616 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1617 : PyObject *py_dependencies;
1618 0 : if (object->dependencies == NULL) {
1619 0 : Py_RETURN_NONE;
1620 : }
1621 0 : if (object->dependencies == NULL) {
1622 0 : py_dependencies = Py_None;
1623 0 : Py_INCREF(py_dependencies);
1624 : } else {
1625 0 : if (object->dependencies == NULL) {
1626 0 : py_dependencies = Py_None;
1627 0 : Py_INCREF(py_dependencies);
1628 : } else {
1629 0 : py_dependencies = PyUnicode_Decode(object->dependencies, strlen(object->dependencies), "utf-8", "ignore");
1630 : }
1631 : }
1632 0 : return py_dependencies;
1633 : }
1634 :
1635 0 : static int py_QUERY_SERVICE_CONFIG_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
1636 : {
1637 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1638 0 : if (value == NULL) {
1639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dependencies");
1640 0 : return -1;
1641 : }
1642 0 : if (value == Py_None) {
1643 0 : object->dependencies = NULL;
1644 : } else {
1645 0 : object->dependencies = NULL;
1646 : {
1647 : const char *test_str;
1648 : const char *talloc_str;
1649 0 : PyObject *unicode = NULL;
1650 0 : if (PyUnicode_Check(value)) {
1651 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1652 0 : if (unicode == NULL) {
1653 0 : PyErr_NoMemory();
1654 0 : return -1;
1655 : }
1656 0 : test_str = PyBytes_AS_STRING(unicode);
1657 0 : } else if (PyBytes_Check(value)) {
1658 0 : test_str = PyBytes_AS_STRING(value);
1659 : } else {
1660 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1661 0 : return -1;
1662 : }
1663 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1664 0 : if (unicode != NULL) {
1665 0 : Py_DECREF(unicode);
1666 : }
1667 0 : if (talloc_str == NULL) {
1668 0 : PyErr_NoMemory();
1669 0 : return -1;
1670 : }
1671 0 : object->dependencies = talloc_str;
1672 : }
1673 : }
1674 0 : return 0;
1675 : }
1676 :
1677 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_startname(PyObject *obj, void *closure)
1678 : {
1679 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1680 : PyObject *py_startname;
1681 0 : if (object->startname == NULL) {
1682 0 : Py_RETURN_NONE;
1683 : }
1684 0 : if (object->startname == NULL) {
1685 0 : py_startname = Py_None;
1686 0 : Py_INCREF(py_startname);
1687 : } else {
1688 0 : if (object->startname == NULL) {
1689 0 : py_startname = Py_None;
1690 0 : Py_INCREF(py_startname);
1691 : } else {
1692 0 : py_startname = PyUnicode_Decode(object->startname, strlen(object->startname), "utf-8", "ignore");
1693 : }
1694 : }
1695 0 : return py_startname;
1696 : }
1697 :
1698 0 : static int py_QUERY_SERVICE_CONFIG_set_startname(PyObject *py_obj, PyObject *value, void *closure)
1699 : {
1700 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1701 0 : if (value == NULL) {
1702 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->startname");
1703 0 : return -1;
1704 : }
1705 0 : if (value == Py_None) {
1706 0 : object->startname = NULL;
1707 : } else {
1708 0 : object->startname = NULL;
1709 : {
1710 : const char *test_str;
1711 : const char *talloc_str;
1712 0 : PyObject *unicode = NULL;
1713 0 : if (PyUnicode_Check(value)) {
1714 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1715 0 : if (unicode == NULL) {
1716 0 : PyErr_NoMemory();
1717 0 : return -1;
1718 : }
1719 0 : test_str = PyBytes_AS_STRING(unicode);
1720 0 : } else if (PyBytes_Check(value)) {
1721 0 : test_str = PyBytes_AS_STRING(value);
1722 : } else {
1723 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1724 0 : return -1;
1725 : }
1726 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1727 0 : if (unicode != NULL) {
1728 0 : Py_DECREF(unicode);
1729 : }
1730 0 : if (talloc_str == NULL) {
1731 0 : PyErr_NoMemory();
1732 0 : return -1;
1733 : }
1734 0 : object->startname = talloc_str;
1735 : }
1736 : }
1737 0 : return 0;
1738 : }
1739 :
1740 0 : static PyObject *py_QUERY_SERVICE_CONFIG_get_displayname(PyObject *obj, void *closure)
1741 : {
1742 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(obj);
1743 : PyObject *py_displayname;
1744 0 : if (object->displayname == NULL) {
1745 0 : Py_RETURN_NONE;
1746 : }
1747 0 : if (object->displayname == NULL) {
1748 0 : py_displayname = Py_None;
1749 0 : Py_INCREF(py_displayname);
1750 : } else {
1751 0 : if (object->displayname == NULL) {
1752 0 : py_displayname = Py_None;
1753 0 : Py_INCREF(py_displayname);
1754 : } else {
1755 0 : py_displayname = PyUnicode_Decode(object->displayname, strlen(object->displayname), "utf-8", "ignore");
1756 : }
1757 : }
1758 0 : return py_displayname;
1759 : }
1760 :
1761 0 : static int py_QUERY_SERVICE_CONFIG_set_displayname(PyObject *py_obj, PyObject *value, void *closure)
1762 : {
1763 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1764 0 : if (value == NULL) {
1765 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->displayname");
1766 0 : return -1;
1767 : }
1768 0 : if (value == Py_None) {
1769 0 : object->displayname = NULL;
1770 : } else {
1771 0 : object->displayname = NULL;
1772 : {
1773 : const char *test_str;
1774 : const char *talloc_str;
1775 0 : PyObject *unicode = NULL;
1776 0 : if (PyUnicode_Check(value)) {
1777 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1778 0 : if (unicode == NULL) {
1779 0 : PyErr_NoMemory();
1780 0 : return -1;
1781 : }
1782 0 : test_str = PyBytes_AS_STRING(unicode);
1783 0 : } else if (PyBytes_Check(value)) {
1784 0 : test_str = PyBytes_AS_STRING(value);
1785 : } else {
1786 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1787 0 : return -1;
1788 : }
1789 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1790 0 : if (unicode != NULL) {
1791 0 : Py_DECREF(unicode);
1792 : }
1793 0 : if (talloc_str == NULL) {
1794 0 : PyErr_NoMemory();
1795 0 : return -1;
1796 : }
1797 0 : object->displayname = talloc_str;
1798 : }
1799 : }
1800 0 : return 0;
1801 : }
1802 :
1803 : static PyGetSetDef py_QUERY_SERVICE_CONFIG_getsetters[] = {
1804 : {
1805 : .name = discard_const_p(char, "service_type"),
1806 : .get = py_QUERY_SERVICE_CONFIG_get_service_type,
1807 : .set = py_QUERY_SERVICE_CONFIG_set_service_type,
1808 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1809 : },
1810 : {
1811 : .name = discard_const_p(char, "start_type"),
1812 : .get = py_QUERY_SERVICE_CONFIG_get_start_type,
1813 : .set = py_QUERY_SERVICE_CONFIG_set_start_type,
1814 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
1815 : },
1816 : {
1817 : .name = discard_const_p(char, "error_control"),
1818 : .get = py_QUERY_SERVICE_CONFIG_get_error_control,
1819 : .set = py_QUERY_SERVICE_CONFIG_set_error_control,
1820 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
1821 : },
1822 : {
1823 : .name = discard_const_p(char, "executablepath"),
1824 : .get = py_QUERY_SERVICE_CONFIG_get_executablepath,
1825 : .set = py_QUERY_SERVICE_CONFIG_set_executablepath,
1826 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1827 : },
1828 : {
1829 : .name = discard_const_p(char, "loadordergroup"),
1830 : .get = py_QUERY_SERVICE_CONFIG_get_loadordergroup,
1831 : .set = py_QUERY_SERVICE_CONFIG_set_loadordergroup,
1832 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1833 : },
1834 : {
1835 : .name = discard_const_p(char, "tag_id"),
1836 : .get = py_QUERY_SERVICE_CONFIG_get_tag_id,
1837 : .set = py_QUERY_SERVICE_CONFIG_set_tag_id,
1838 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1839 : },
1840 : {
1841 : .name = discard_const_p(char, "dependencies"),
1842 : .get = py_QUERY_SERVICE_CONFIG_get_dependencies,
1843 : .set = py_QUERY_SERVICE_CONFIG_set_dependencies,
1844 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1845 : },
1846 : {
1847 : .name = discard_const_p(char, "startname"),
1848 : .get = py_QUERY_SERVICE_CONFIG_get_startname,
1849 : .set = py_QUERY_SERVICE_CONFIG_set_startname,
1850 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1851 : },
1852 : {
1853 : .name = discard_const_p(char, "displayname"),
1854 : .get = py_QUERY_SERVICE_CONFIG_get_displayname,
1855 : .set = py_QUERY_SERVICE_CONFIG_set_displayname,
1856 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1857 : },
1858 : { .name = NULL }
1859 : };
1860 :
1861 0 : static PyObject *py_QUERY_SERVICE_CONFIG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1862 : {
1863 0 : return pytalloc_new(struct QUERY_SERVICE_CONFIG, type);
1864 : }
1865 :
1866 0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1867 : {
1868 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1869 0 : PyObject *ret = NULL;
1870 : DATA_BLOB blob;
1871 : enum ndr_err_code err;
1872 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1873 0 : if (tmp_ctx == NULL) {
1874 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1875 0 : return NULL;
1876 : }
1877 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG);
1878 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1879 0 : TALLOC_FREE(tmp_ctx);
1880 0 : PyErr_SetNdrError(err);
1881 0 : return NULL;
1882 : }
1883 :
1884 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1885 0 : TALLOC_FREE(tmp_ctx);
1886 0 : return ret;
1887 : }
1888 :
1889 0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1890 : {
1891 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1892 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1893 0 : Py_ssize_t blob_length = 0;
1894 : enum ndr_err_code err;
1895 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1896 0 : PyObject *allow_remaining_obj = NULL;
1897 0 : bool allow_remaining = false;
1898 :
1899 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1900 : discard_const_p(char *, kwnames),
1901 : &blob.data, &blob_length,
1902 : &allow_remaining_obj)) {
1903 0 : return NULL;
1904 : }
1905 0 : blob.length = blob_length;
1906 :
1907 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1908 0 : allow_remaining = true;
1909 : }
1910 :
1911 0 : if (allow_remaining) {
1912 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_QUERY_SERVICE_CONFIG);
1913 : } else {
1914 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_QUERY_SERVICE_CONFIG);
1915 : }
1916 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1917 0 : PyErr_SetNdrError(err);
1918 0 : return NULL;
1919 : }
1920 :
1921 0 : Py_RETURN_NONE;
1922 : }
1923 :
1924 0 : static PyObject *py_QUERY_SERVICE_CONFIG_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1925 : {
1926 0 : struct QUERY_SERVICE_CONFIG *object = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(py_obj);
1927 : PyObject *ret;
1928 : char *retstr;
1929 :
1930 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_QUERY_SERVICE_CONFIG, "QUERY_SERVICE_CONFIG", object);
1931 0 : ret = PyUnicode_FromString(retstr);
1932 0 : talloc_free(retstr);
1933 :
1934 0 : return ret;
1935 : }
1936 :
1937 : static PyMethodDef py_QUERY_SERVICE_CONFIG_methods[] = {
1938 : { "__ndr_pack__", (PyCFunction)py_QUERY_SERVICE_CONFIG_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1939 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_QUERY_SERVICE_CONFIG_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1940 : { "__ndr_print__", (PyCFunction)py_QUERY_SERVICE_CONFIG_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1941 : { NULL, NULL, 0, NULL }
1942 : };
1943 :
1944 :
1945 : static PyTypeObject QUERY_SERVICE_CONFIG_Type = {
1946 : PyVarObject_HEAD_INIT(NULL, 0)
1947 : .tp_name = "svcctl.QUERY_SERVICE_CONFIG",
1948 : .tp_getset = py_QUERY_SERVICE_CONFIG_getsetters,
1949 : .tp_methods = py_QUERY_SERVICE_CONFIG_methods,
1950 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1951 : .tp_new = py_QUERY_SERVICE_CONFIG_new,
1952 : };
1953 :
1954 :
1955 0 : static PyObject *py_svcctl_ArgumentString_get_string(PyObject *obj, void *closure)
1956 : {
1957 0 : struct svcctl_ArgumentString *object = (struct svcctl_ArgumentString *)pytalloc_get_ptr(obj);
1958 : PyObject *py_string;
1959 0 : if (object->string == NULL) {
1960 0 : Py_RETURN_NONE;
1961 : }
1962 0 : if (object->string == NULL) {
1963 0 : py_string = Py_None;
1964 0 : Py_INCREF(py_string);
1965 : } else {
1966 0 : if (object->string == NULL) {
1967 0 : py_string = Py_None;
1968 0 : Py_INCREF(py_string);
1969 : } else {
1970 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1971 : }
1972 : }
1973 0 : return py_string;
1974 : }
1975 :
1976 0 : static int py_svcctl_ArgumentString_set_string(PyObject *py_obj, PyObject *value, void *closure)
1977 : {
1978 0 : struct svcctl_ArgumentString *object = (struct svcctl_ArgumentString *)pytalloc_get_ptr(py_obj);
1979 0 : if (value == NULL) {
1980 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
1981 0 : return -1;
1982 : }
1983 0 : if (value == Py_None) {
1984 0 : object->string = NULL;
1985 : } else {
1986 0 : object->string = NULL;
1987 : {
1988 : const char *test_str;
1989 : const char *talloc_str;
1990 0 : PyObject *unicode = NULL;
1991 0 : if (PyUnicode_Check(value)) {
1992 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1993 0 : if (unicode == NULL) {
1994 0 : PyErr_NoMemory();
1995 0 : return -1;
1996 : }
1997 0 : test_str = PyBytes_AS_STRING(unicode);
1998 0 : } else if (PyBytes_Check(value)) {
1999 0 : test_str = PyBytes_AS_STRING(value);
2000 : } else {
2001 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2002 0 : return -1;
2003 : }
2004 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2005 0 : if (unicode != NULL) {
2006 0 : Py_DECREF(unicode);
2007 : }
2008 0 : if (talloc_str == NULL) {
2009 0 : PyErr_NoMemory();
2010 0 : return -1;
2011 : }
2012 0 : object->string = talloc_str;
2013 : }
2014 : }
2015 0 : return 0;
2016 : }
2017 :
2018 : static PyGetSetDef py_svcctl_ArgumentString_getsetters[] = {
2019 : {
2020 : .name = discard_const_p(char, "string"),
2021 : .get = py_svcctl_ArgumentString_get_string,
2022 : .set = py_svcctl_ArgumentString_set_string,
2023 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2024 : },
2025 : { .name = NULL }
2026 : };
2027 :
2028 0 : static PyObject *py_svcctl_ArgumentString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2029 : {
2030 0 : return pytalloc_new(struct svcctl_ArgumentString, type);
2031 : }
2032 :
2033 :
2034 : static PyTypeObject svcctl_ArgumentString_Type = {
2035 : PyVarObject_HEAD_INIT(NULL, 0)
2036 : .tp_name = "svcctl.ArgumentString",
2037 : .tp_getset = py_svcctl_ArgumentString_getsetters,
2038 : .tp_methods = NULL,
2039 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2040 : .tp_new = py_svcctl_ArgumentString_new,
2041 : };
2042 :
2043 :
2044 0 : static PyObject *py_SERVICE_DESCRIPTION_get_description(PyObject *obj, void *closure)
2045 : {
2046 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(obj);
2047 : PyObject *py_description;
2048 0 : if (object->description == NULL) {
2049 0 : Py_RETURN_NONE;
2050 : }
2051 0 : if (object->description == NULL) {
2052 0 : py_description = Py_None;
2053 0 : Py_INCREF(py_description);
2054 : } else {
2055 0 : py_description = PyString_FromStringOrNULL(object->description);
2056 : }
2057 0 : return py_description;
2058 : }
2059 :
2060 0 : static int py_SERVICE_DESCRIPTION_set_description(PyObject *py_obj, PyObject *value, void *closure)
2061 : {
2062 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2063 0 : if (value == NULL) {
2064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
2065 0 : return -1;
2066 : }
2067 0 : if (value == Py_None) {
2068 0 : object->description = NULL;
2069 : } else {
2070 0 : object->description = NULL;
2071 : {
2072 : const char *test_str;
2073 : const char *talloc_str;
2074 0 : PyObject *unicode = NULL;
2075 0 : if (PyUnicode_Check(value)) {
2076 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2077 0 : if (unicode == NULL) {
2078 0 : PyErr_NoMemory();
2079 0 : return -1;
2080 : }
2081 0 : test_str = PyBytes_AS_STRING(unicode);
2082 0 : } else if (PyBytes_Check(value)) {
2083 0 : test_str = PyBytes_AS_STRING(value);
2084 : } else {
2085 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2086 0 : return -1;
2087 : }
2088 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2089 0 : if (unicode != NULL) {
2090 0 : Py_DECREF(unicode);
2091 : }
2092 0 : if (talloc_str == NULL) {
2093 0 : PyErr_NoMemory();
2094 0 : return -1;
2095 : }
2096 0 : object->description = talloc_str;
2097 : }
2098 : }
2099 0 : return 0;
2100 : }
2101 :
2102 : static PyGetSetDef py_SERVICE_DESCRIPTION_getsetters[] = {
2103 : {
2104 : .name = discard_const_p(char, "description"),
2105 : .get = py_SERVICE_DESCRIPTION_get_description,
2106 : .set = py_SERVICE_DESCRIPTION_set_description,
2107 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2108 : },
2109 : { .name = NULL }
2110 : };
2111 :
2112 0 : static PyObject *py_SERVICE_DESCRIPTION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2113 : {
2114 0 : return pytalloc_new(struct SERVICE_DESCRIPTION, type);
2115 : }
2116 :
2117 0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2118 : {
2119 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2120 0 : PyObject *ret = NULL;
2121 : DATA_BLOB blob;
2122 : enum ndr_err_code err;
2123 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2124 0 : if (tmp_ctx == NULL) {
2125 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2126 0 : return NULL;
2127 : }
2128 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_DESCRIPTION);
2129 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2130 0 : TALLOC_FREE(tmp_ctx);
2131 0 : PyErr_SetNdrError(err);
2132 0 : return NULL;
2133 : }
2134 :
2135 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2136 0 : TALLOC_FREE(tmp_ctx);
2137 0 : return ret;
2138 : }
2139 :
2140 0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2141 : {
2142 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2143 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2144 0 : Py_ssize_t blob_length = 0;
2145 : enum ndr_err_code err;
2146 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2147 0 : PyObject *allow_remaining_obj = NULL;
2148 0 : bool allow_remaining = false;
2149 :
2150 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2151 : discard_const_p(char *, kwnames),
2152 : &blob.data, &blob_length,
2153 : &allow_remaining_obj)) {
2154 0 : return NULL;
2155 : }
2156 0 : blob.length = blob_length;
2157 :
2158 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2159 0 : allow_remaining = true;
2160 : }
2161 :
2162 0 : if (allow_remaining) {
2163 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_DESCRIPTION);
2164 : } else {
2165 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_DESCRIPTION);
2166 : }
2167 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2168 0 : PyErr_SetNdrError(err);
2169 0 : return NULL;
2170 : }
2171 :
2172 0 : Py_RETURN_NONE;
2173 : }
2174 :
2175 0 : static PyObject *py_SERVICE_DESCRIPTION_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2176 : {
2177 0 : struct SERVICE_DESCRIPTION *object = (struct SERVICE_DESCRIPTION *)pytalloc_get_ptr(py_obj);
2178 : PyObject *ret;
2179 : char *retstr;
2180 :
2181 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_DESCRIPTION, "SERVICE_DESCRIPTION", object);
2182 0 : ret = PyUnicode_FromString(retstr);
2183 0 : talloc_free(retstr);
2184 :
2185 0 : return ret;
2186 : }
2187 :
2188 : static PyMethodDef py_SERVICE_DESCRIPTION_methods[] = {
2189 : { "__ndr_pack__", (PyCFunction)py_SERVICE_DESCRIPTION_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2190 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SERVICE_DESCRIPTION_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2191 : { "__ndr_print__", (PyCFunction)py_SERVICE_DESCRIPTION_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2192 : { NULL, NULL, 0, NULL }
2193 : };
2194 :
2195 :
2196 : static PyTypeObject SERVICE_DESCRIPTION_Type = {
2197 : PyVarObject_HEAD_INIT(NULL, 0)
2198 : .tp_name = "svcctl.SERVICE_DESCRIPTION",
2199 : .tp_getset = py_SERVICE_DESCRIPTION_getsetters,
2200 : .tp_methods = py_SERVICE_DESCRIPTION_methods,
2201 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2202 : .tp_new = py_SERVICE_DESCRIPTION_new,
2203 : };
2204 :
2205 :
2206 0 : static PyObject *py_SC_ACTION_get_type(PyObject *obj, void *closure)
2207 : {
2208 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(obj);
2209 : PyObject *py_type;
2210 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
2211 0 : return py_type;
2212 : }
2213 :
2214 0 : static int py_SC_ACTION_set_type(PyObject *py_obj, PyObject *value, void *closure)
2215 : {
2216 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(py_obj);
2217 0 : if (value == NULL) {
2218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
2219 0 : return -1;
2220 : }
2221 : {
2222 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
2223 0 : if (PyLong_Check(value)) {
2224 : unsigned long long test_var;
2225 0 : test_var = PyLong_AsUnsignedLongLong(value);
2226 0 : if (PyErr_Occurred() != NULL) {
2227 0 : return -1;
2228 : }
2229 0 : if (test_var > uint_max) {
2230 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2231 : PyLong_Type.tp_name, uint_max, test_var);
2232 0 : return -1;
2233 : }
2234 0 : object->type = test_var;
2235 : } else {
2236 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2237 : PyLong_Type.tp_name);
2238 0 : return -1;
2239 : }
2240 : }
2241 0 : return 0;
2242 : }
2243 :
2244 0 : static PyObject *py_SC_ACTION_get_delay(PyObject *obj, void *closure)
2245 : {
2246 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(obj);
2247 : PyObject *py_delay;
2248 0 : py_delay = PyLong_FromUnsignedLongLong((uint32_t)object->delay);
2249 0 : return py_delay;
2250 : }
2251 :
2252 0 : static int py_SC_ACTION_set_delay(PyObject *py_obj, PyObject *value, void *closure)
2253 : {
2254 0 : struct SC_ACTION *object = (struct SC_ACTION *)pytalloc_get_ptr(py_obj);
2255 0 : if (value == NULL) {
2256 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delay");
2257 0 : return -1;
2258 : }
2259 : {
2260 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->delay));
2261 0 : if (PyLong_Check(value)) {
2262 : unsigned long long test_var;
2263 0 : test_var = PyLong_AsUnsignedLongLong(value);
2264 0 : if (PyErr_Occurred() != NULL) {
2265 0 : return -1;
2266 : }
2267 0 : if (test_var > uint_max) {
2268 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2269 : PyLong_Type.tp_name, uint_max, test_var);
2270 0 : return -1;
2271 : }
2272 0 : object->delay = test_var;
2273 : } else {
2274 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2275 : PyLong_Type.tp_name);
2276 0 : return -1;
2277 : }
2278 : }
2279 0 : return 0;
2280 : }
2281 :
2282 : static PyGetSetDef py_SC_ACTION_getsetters[] = {
2283 : {
2284 : .name = discard_const_p(char, "type"),
2285 : .get = py_SC_ACTION_get_type,
2286 : .set = py_SC_ACTION_set_type,
2287 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_ACTION_TYPE")
2288 : },
2289 : {
2290 : .name = discard_const_p(char, "delay"),
2291 : .get = py_SC_ACTION_get_delay,
2292 : .set = py_SC_ACTION_set_delay,
2293 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2294 : },
2295 : { .name = NULL }
2296 : };
2297 :
2298 0 : static PyObject *py_SC_ACTION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2299 : {
2300 0 : return pytalloc_new(struct SC_ACTION, type);
2301 : }
2302 :
2303 :
2304 : static PyTypeObject SC_ACTION_Type = {
2305 : PyVarObject_HEAD_INIT(NULL, 0)
2306 : .tp_name = "svcctl.SC_ACTION",
2307 : .tp_getset = py_SC_ACTION_getsetters,
2308 : .tp_methods = NULL,
2309 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2310 : .tp_new = py_SC_ACTION_new,
2311 : };
2312 :
2313 :
2314 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_reset_period(PyObject *obj, void *closure)
2315 : {
2316 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
2317 : PyObject *py_reset_period;
2318 0 : py_reset_period = PyLong_FromUnsignedLongLong((uint32_t)object->reset_period);
2319 0 : return py_reset_period;
2320 : }
2321 :
2322 0 : static int py_SERVICE_FAILURE_ACTIONS_set_reset_period(PyObject *py_obj, PyObject *value, void *closure)
2323 : {
2324 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2325 0 : if (value == NULL) {
2326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reset_period");
2327 0 : return -1;
2328 : }
2329 : {
2330 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reset_period));
2331 0 : if (PyLong_Check(value)) {
2332 : unsigned long long test_var;
2333 0 : test_var = PyLong_AsUnsignedLongLong(value);
2334 0 : if (PyErr_Occurred() != NULL) {
2335 0 : return -1;
2336 : }
2337 0 : if (test_var > uint_max) {
2338 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2339 : PyLong_Type.tp_name, uint_max, test_var);
2340 0 : return -1;
2341 : }
2342 0 : object->reset_period = test_var;
2343 : } else {
2344 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2345 : PyLong_Type.tp_name);
2346 0 : return -1;
2347 : }
2348 : }
2349 0 : return 0;
2350 : }
2351 :
2352 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_rebootmsg(PyObject *obj, void *closure)
2353 : {
2354 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
2355 : PyObject *py_rebootmsg;
2356 0 : if (object->rebootmsg == NULL) {
2357 0 : Py_RETURN_NONE;
2358 : }
2359 0 : if (object->rebootmsg == NULL) {
2360 0 : py_rebootmsg = Py_None;
2361 0 : Py_INCREF(py_rebootmsg);
2362 : } else {
2363 0 : py_rebootmsg = PyString_FromStringOrNULL(object->rebootmsg);
2364 : }
2365 0 : return py_rebootmsg;
2366 : }
2367 :
2368 0 : static int py_SERVICE_FAILURE_ACTIONS_set_rebootmsg(PyObject *py_obj, PyObject *value, void *closure)
2369 : {
2370 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2371 0 : if (value == NULL) {
2372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rebootmsg");
2373 0 : return -1;
2374 : }
2375 0 : if (value == Py_None) {
2376 0 : object->rebootmsg = NULL;
2377 : } else {
2378 0 : object->rebootmsg = NULL;
2379 : {
2380 : const char *test_str;
2381 : const char *talloc_str;
2382 0 : PyObject *unicode = NULL;
2383 0 : if (PyUnicode_Check(value)) {
2384 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2385 0 : if (unicode == NULL) {
2386 0 : PyErr_NoMemory();
2387 0 : return -1;
2388 : }
2389 0 : test_str = PyBytes_AS_STRING(unicode);
2390 0 : } else if (PyBytes_Check(value)) {
2391 0 : test_str = PyBytes_AS_STRING(value);
2392 : } else {
2393 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2394 0 : return -1;
2395 : }
2396 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2397 0 : if (unicode != NULL) {
2398 0 : Py_DECREF(unicode);
2399 : }
2400 0 : if (talloc_str == NULL) {
2401 0 : PyErr_NoMemory();
2402 0 : return -1;
2403 : }
2404 0 : object->rebootmsg = talloc_str;
2405 : }
2406 : }
2407 0 : return 0;
2408 : }
2409 :
2410 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_command(PyObject *obj, void *closure)
2411 : {
2412 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
2413 : PyObject *py_command;
2414 0 : if (object->command == NULL) {
2415 0 : Py_RETURN_NONE;
2416 : }
2417 0 : if (object->command == NULL) {
2418 0 : py_command = Py_None;
2419 0 : Py_INCREF(py_command);
2420 : } else {
2421 0 : py_command = PyString_FromStringOrNULL(object->command);
2422 : }
2423 0 : return py_command;
2424 : }
2425 :
2426 0 : static int py_SERVICE_FAILURE_ACTIONS_set_command(PyObject *py_obj, PyObject *value, void *closure)
2427 : {
2428 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2429 0 : if (value == NULL) {
2430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->command");
2431 0 : return -1;
2432 : }
2433 0 : if (value == Py_None) {
2434 0 : object->command = NULL;
2435 : } else {
2436 0 : object->command = NULL;
2437 : {
2438 : const char *test_str;
2439 : const char *talloc_str;
2440 0 : PyObject *unicode = NULL;
2441 0 : if (PyUnicode_Check(value)) {
2442 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2443 0 : if (unicode == NULL) {
2444 0 : PyErr_NoMemory();
2445 0 : return -1;
2446 : }
2447 0 : test_str = PyBytes_AS_STRING(unicode);
2448 0 : } else if (PyBytes_Check(value)) {
2449 0 : test_str = PyBytes_AS_STRING(value);
2450 : } else {
2451 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2452 0 : return -1;
2453 : }
2454 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2455 0 : if (unicode != NULL) {
2456 0 : Py_DECREF(unicode);
2457 : }
2458 0 : if (talloc_str == NULL) {
2459 0 : PyErr_NoMemory();
2460 0 : return -1;
2461 : }
2462 0 : object->command = talloc_str;
2463 : }
2464 : }
2465 0 : return 0;
2466 : }
2467 :
2468 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_num_actions(PyObject *obj, void *closure)
2469 : {
2470 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
2471 : PyObject *py_num_actions;
2472 0 : py_num_actions = PyLong_FromUnsignedLongLong((uint32_t)object->num_actions);
2473 0 : return py_num_actions;
2474 : }
2475 :
2476 0 : static int py_SERVICE_FAILURE_ACTIONS_set_num_actions(PyObject *py_obj, PyObject *value, void *closure)
2477 : {
2478 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2479 0 : if (value == NULL) {
2480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_actions");
2481 0 : return -1;
2482 : }
2483 : {
2484 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_actions));
2485 0 : if (PyLong_Check(value)) {
2486 : unsigned long long test_var;
2487 0 : test_var = PyLong_AsUnsignedLongLong(value);
2488 0 : if (PyErr_Occurred() != NULL) {
2489 0 : return -1;
2490 : }
2491 0 : if (test_var > uint_max) {
2492 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2493 : PyLong_Type.tp_name, uint_max, test_var);
2494 0 : return -1;
2495 : }
2496 0 : object->num_actions = test_var;
2497 : } else {
2498 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2499 : PyLong_Type.tp_name);
2500 0 : return -1;
2501 : }
2502 : }
2503 0 : return 0;
2504 : }
2505 :
2506 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_get_actions(PyObject *obj, void *closure)
2507 : {
2508 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(obj);
2509 : PyObject *py_actions;
2510 0 : if (object->actions == NULL) {
2511 0 : Py_RETURN_NONE;
2512 : }
2513 0 : if (object->actions == NULL) {
2514 0 : py_actions = Py_None;
2515 0 : Py_INCREF(py_actions);
2516 : } else {
2517 0 : py_actions = PyList_New(object->num_actions);
2518 0 : if (py_actions == NULL) {
2519 0 : return NULL;
2520 : }
2521 : {
2522 : int actions_cntr_1;
2523 0 : for (actions_cntr_1 = 0; actions_cntr_1 < (object->num_actions); actions_cntr_1++) {
2524 : PyObject *py_actions_1;
2525 0 : py_actions_1 = pytalloc_reference_ex(&SC_ACTION_Type, object->actions, &object->actions[actions_cntr_1]);
2526 0 : PyList_SetItem(py_actions, actions_cntr_1, py_actions_1);
2527 : }
2528 : }
2529 : }
2530 0 : return py_actions;
2531 : }
2532 :
2533 0 : static int py_SERVICE_FAILURE_ACTIONS_set_actions(PyObject *py_obj, PyObject *value, void *closure)
2534 : {
2535 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2536 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->actions));
2537 0 : if (value == NULL) {
2538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->actions");
2539 0 : return -1;
2540 : }
2541 0 : if (value == Py_None) {
2542 0 : object->actions = NULL;
2543 : } else {
2544 0 : object->actions = NULL;
2545 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2546 : {
2547 : int actions_cntr_1;
2548 0 : object->actions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->actions, PyList_GET_SIZE(value));
2549 0 : if (!object->actions) { return -1;; }
2550 0 : talloc_set_name_const(object->actions, "ARRAY: object->actions");
2551 0 : for (actions_cntr_1 = 0; actions_cntr_1 < PyList_GET_SIZE(value); actions_cntr_1++) {
2552 0 : if (PyList_GET_ITEM(value, actions_cntr_1) == NULL) {
2553 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->actions[actions_cntr_1]");
2554 0 : return -1;
2555 : }
2556 0 : PY_CHECK_TYPE(&SC_ACTION_Type, PyList_GET_ITEM(value, actions_cntr_1), return -1;);
2557 0 : if (talloc_reference(object->actions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, actions_cntr_1))) == NULL) {
2558 0 : PyErr_NoMemory();
2559 0 : return -1;
2560 : }
2561 0 : object->actions[actions_cntr_1] = *(struct SC_ACTION *)pytalloc_get_ptr(PyList_GET_ITEM(value, actions_cntr_1));
2562 : }
2563 : }
2564 : }
2565 0 : return 0;
2566 : }
2567 :
2568 : static PyGetSetDef py_SERVICE_FAILURE_ACTIONS_getsetters[] = {
2569 : {
2570 : .name = discard_const_p(char, "reset_period"),
2571 : .get = py_SERVICE_FAILURE_ACTIONS_get_reset_period,
2572 : .set = py_SERVICE_FAILURE_ACTIONS_set_reset_period,
2573 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2574 : },
2575 : {
2576 : .name = discard_const_p(char, "rebootmsg"),
2577 : .get = py_SERVICE_FAILURE_ACTIONS_get_rebootmsg,
2578 : .set = py_SERVICE_FAILURE_ACTIONS_set_rebootmsg,
2579 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2580 : },
2581 : {
2582 : .name = discard_const_p(char, "command"),
2583 : .get = py_SERVICE_FAILURE_ACTIONS_get_command,
2584 : .set = py_SERVICE_FAILURE_ACTIONS_set_command,
2585 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2586 : },
2587 : {
2588 : .name = discard_const_p(char, "num_actions"),
2589 : .get = py_SERVICE_FAILURE_ACTIONS_get_num_actions,
2590 : .set = py_SERVICE_FAILURE_ACTIONS_set_num_actions,
2591 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2592 : },
2593 : {
2594 : .name = discard_const_p(char, "actions"),
2595 : .get = py_SERVICE_FAILURE_ACTIONS_get_actions,
2596 : .set = py_SERVICE_FAILURE_ACTIONS_set_actions,
2597 : .doc = discard_const_p(char, "PIDL-generated element of base type SC_ACTION")
2598 : },
2599 : { .name = NULL }
2600 : };
2601 :
2602 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2603 : {
2604 0 : return pytalloc_new(struct SERVICE_FAILURE_ACTIONS, type);
2605 : }
2606 :
2607 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2608 : {
2609 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2610 0 : PyObject *ret = NULL;
2611 : DATA_BLOB blob;
2612 : enum ndr_err_code err;
2613 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2614 0 : if (tmp_ctx == NULL) {
2615 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2616 0 : return NULL;
2617 : }
2618 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_SERVICE_FAILURE_ACTIONS);
2619 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2620 0 : TALLOC_FREE(tmp_ctx);
2621 0 : PyErr_SetNdrError(err);
2622 0 : return NULL;
2623 : }
2624 :
2625 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2626 0 : TALLOC_FREE(tmp_ctx);
2627 0 : return ret;
2628 : }
2629 :
2630 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2631 : {
2632 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2633 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2634 0 : Py_ssize_t blob_length = 0;
2635 : enum ndr_err_code err;
2636 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2637 0 : PyObject *allow_remaining_obj = NULL;
2638 0 : bool allow_remaining = false;
2639 :
2640 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2641 : discard_const_p(char *, kwnames),
2642 : &blob.data, &blob_length,
2643 : &allow_remaining_obj)) {
2644 0 : return NULL;
2645 : }
2646 0 : blob.length = blob_length;
2647 :
2648 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2649 0 : allow_remaining = true;
2650 : }
2651 :
2652 0 : if (allow_remaining) {
2653 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_FAILURE_ACTIONS);
2654 : } else {
2655 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_SERVICE_FAILURE_ACTIONS);
2656 : }
2657 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2658 0 : PyErr_SetNdrError(err);
2659 0 : return NULL;
2660 : }
2661 :
2662 0 : Py_RETURN_NONE;
2663 : }
2664 :
2665 0 : static PyObject *py_SERVICE_FAILURE_ACTIONS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2666 : {
2667 0 : struct SERVICE_FAILURE_ACTIONS *object = (struct SERVICE_FAILURE_ACTIONS *)pytalloc_get_ptr(py_obj);
2668 : PyObject *ret;
2669 : char *retstr;
2670 :
2671 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_SERVICE_FAILURE_ACTIONS, "SERVICE_FAILURE_ACTIONS", object);
2672 0 : ret = PyUnicode_FromString(retstr);
2673 0 : talloc_free(retstr);
2674 :
2675 0 : return ret;
2676 : }
2677 :
2678 : static PyMethodDef py_SERVICE_FAILURE_ACTIONS_methods[] = {
2679 : { "__ndr_pack__", (PyCFunction)py_SERVICE_FAILURE_ACTIONS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2680 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_SERVICE_FAILURE_ACTIONS_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2681 : { "__ndr_print__", (PyCFunction)py_SERVICE_FAILURE_ACTIONS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2682 : { NULL, NULL, 0, NULL }
2683 : };
2684 :
2685 :
2686 : static PyTypeObject SERVICE_FAILURE_ACTIONS_Type = {
2687 : PyVarObject_HEAD_INIT(NULL, 0)
2688 : .tp_name = "svcctl.SERVICE_FAILURE_ACTIONS",
2689 : .tp_getset = py_SERVICE_FAILURE_ACTIONS_getsetters,
2690 : .tp_methods = py_SERVICE_FAILURE_ACTIONS_methods,
2691 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2692 : .tp_new = py_SERVICE_FAILURE_ACTIONS_new,
2693 : };
2694 :
2695 :
2696 :
2697 0 : static PyObject *py_svcctl_CloseServiceHandle_in_get_handle(PyObject *obj, void *closure)
2698 : {
2699 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
2700 : PyObject *py_handle;
2701 0 : if (object->in.handle == NULL) {
2702 0 : Py_RETURN_NONE;
2703 : }
2704 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
2705 0 : return py_handle;
2706 : }
2707 :
2708 0 : static int py_svcctl_CloseServiceHandle_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
2709 : {
2710 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
2711 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
2712 0 : if (value == NULL) {
2713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
2714 0 : return -1;
2715 : }
2716 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
2717 0 : if (object->in.handle == NULL) {
2718 0 : PyErr_NoMemory();
2719 0 : return -1;
2720 : }
2721 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
2722 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2723 0 : PyErr_NoMemory();
2724 0 : return -1;
2725 : }
2726 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
2727 0 : return 0;
2728 : }
2729 :
2730 0 : static PyObject *py_svcctl_CloseServiceHandle_out_get_handle(PyObject *obj, void *closure)
2731 : {
2732 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
2733 : PyObject *py_handle;
2734 0 : if (object->out.handle == NULL) {
2735 0 : Py_RETURN_NONE;
2736 : }
2737 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
2738 0 : return py_handle;
2739 : }
2740 :
2741 0 : static int py_svcctl_CloseServiceHandle_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
2742 : {
2743 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
2744 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
2745 0 : if (value == NULL) {
2746 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
2747 0 : return -1;
2748 : }
2749 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
2750 0 : if (object->out.handle == NULL) {
2751 0 : PyErr_NoMemory();
2752 0 : return -1;
2753 : }
2754 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
2755 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2756 0 : PyErr_NoMemory();
2757 0 : return -1;
2758 : }
2759 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
2760 0 : return 0;
2761 : }
2762 :
2763 0 : static PyObject *py_svcctl_CloseServiceHandle_get_result(PyObject *obj, void *closure)
2764 : {
2765 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(obj);
2766 : PyObject *py_result;
2767 0 : py_result = PyErr_FromWERROR(object->out.result);
2768 0 : return py_result;
2769 : }
2770 :
2771 0 : static int py_svcctl_CloseServiceHandle_set_result(PyObject *py_obj, PyObject *value, void *closure)
2772 : {
2773 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
2774 0 : if (value == NULL) {
2775 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
2776 0 : return -1;
2777 : }
2778 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
2779 0 : return 0;
2780 : }
2781 :
2782 : static PyGetSetDef py_svcctl_CloseServiceHandle_getsetters[] = {
2783 : {
2784 : .name = discard_const_p(char, "in_handle"),
2785 : .get = py_svcctl_CloseServiceHandle_in_get_handle,
2786 : .set = py_svcctl_CloseServiceHandle_in_set_handle,
2787 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
2788 : },
2789 : {
2790 : .name = discard_const_p(char, "out_handle"),
2791 : .get = py_svcctl_CloseServiceHandle_out_get_handle,
2792 : .set = py_svcctl_CloseServiceHandle_out_set_handle,
2793 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
2794 : },
2795 : {
2796 : .name = discard_const_p(char, "result"),
2797 : .get = py_svcctl_CloseServiceHandle_get_result,
2798 : .set = py_svcctl_CloseServiceHandle_set_result,
2799 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
2800 : },
2801 : { .name = NULL }
2802 : };
2803 :
2804 0 : static PyObject *py_svcctl_CloseServiceHandle_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2805 : {
2806 0 : PyObject *self = pytalloc_new(struct svcctl_CloseServiceHandle, type);
2807 0 : struct svcctl_CloseServiceHandle *_self = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(self);
2808 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
2809 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
2810 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2811 0 : return self;
2812 : }
2813 :
2814 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
2815 : {
2816 :
2817 :
2818 0 : return PyLong_FromLong(0);
2819 : }
2820 :
2821 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
2822 : {
2823 0 : const struct ndr_interface_call *call = NULL;
2824 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
2825 0 : PyObject *ret = NULL;
2826 0 : struct ndr_push *push = NULL;
2827 : DATA_BLOB blob;
2828 : enum ndr_err_code err;
2829 :
2830 0 : if (ndr_table_svcctl.num_calls < 1) {
2831 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_pack");
2832 0 : return NULL;
2833 : }
2834 0 : call = &ndr_table_svcctl.calls[0];
2835 :
2836 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
2837 0 : if (push == NULL) {
2838 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2839 0 : return NULL;
2840 : }
2841 :
2842 0 : push->flags |= ndr_push_flags;
2843 :
2844 0 : err = call->ndr_push(push, ndr_inout_flags, object);
2845 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2846 0 : TALLOC_FREE(push);
2847 0 : PyErr_SetNdrError(err);
2848 0 : return NULL;
2849 : }
2850 0 : blob = ndr_push_blob(push);
2851 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2852 0 : TALLOC_FREE(push);
2853 0 : return ret;
2854 : }
2855 :
2856 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2857 : {
2858 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2859 0 : PyObject *bigendian_obj = NULL;
2860 0 : PyObject *ndr64_obj = NULL;
2861 0 : uint32_t ndr_push_flags = 0;
2862 :
2863 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
2864 : discard_const_p(char *, kwnames),
2865 : &bigendian_obj,
2866 : &ndr64_obj)) {
2867 0 : return NULL;
2868 : }
2869 :
2870 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2871 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2872 : }
2873 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2874 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2875 : }
2876 :
2877 0 : return py_svcctl_CloseServiceHandle_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
2878 : }
2879 :
2880 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2881 : {
2882 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2883 0 : PyObject *bigendian_obj = NULL;
2884 0 : PyObject *ndr64_obj = NULL;
2885 0 : uint32_t ndr_push_flags = 0;
2886 :
2887 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
2888 : discard_const_p(char *, kwnames),
2889 : &bigendian_obj,
2890 : &ndr64_obj)) {
2891 0 : return NULL;
2892 : }
2893 :
2894 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2895 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2896 : }
2897 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2898 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2899 : }
2900 :
2901 0 : return py_svcctl_CloseServiceHandle_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
2902 : }
2903 :
2904 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
2905 : {
2906 0 : const struct ndr_interface_call *call = NULL;
2907 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
2908 0 : struct ndr_pull *pull = NULL;
2909 : enum ndr_err_code err;
2910 :
2911 0 : if (ndr_table_svcctl.num_calls < 1) {
2912 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_unpack");
2913 0 : return NULL;
2914 : }
2915 0 : call = &ndr_table_svcctl.calls[0];
2916 :
2917 0 : pull = ndr_pull_init_blob(blob, object);
2918 0 : if (pull == NULL) {
2919 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2920 0 : return NULL;
2921 : }
2922 :
2923 0 : pull->flags |= ndr_pull_flags;
2924 :
2925 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
2926 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2927 0 : TALLOC_FREE(pull);
2928 0 : PyErr_SetNdrError(err);
2929 0 : return NULL;
2930 : }
2931 0 : if (!allow_remaining) {
2932 : uint32_t highest_ofs;
2933 :
2934 0 : if (pull->offset > pull->relative_highest_offset) {
2935 0 : highest_ofs = pull->offset;
2936 : } else {
2937 0 : highest_ofs = pull->relative_highest_offset;
2938 : }
2939 0 : if (highest_ofs < pull->data_size) {
2940 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
2941 : "not all bytes consumed ofs[%u] size[%u]",
2942 : highest_ofs, pull->data_size);
2943 0 : TALLOC_FREE(pull);
2944 0 : PyErr_SetNdrError(err);
2945 0 : return NULL;
2946 : }
2947 : }
2948 :
2949 0 : TALLOC_FREE(pull);
2950 0 : Py_RETURN_NONE;
2951 : }
2952 :
2953 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2954 : {
2955 : DATA_BLOB blob;
2956 0 : Py_ssize_t blob_length = 0;
2957 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
2958 0 : PyObject *bigendian_obj = NULL;
2959 0 : PyObject *ndr64_obj = NULL;
2960 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
2961 0 : PyObject *allow_remaining_obj = NULL;
2962 0 : bool allow_remaining = false;
2963 :
2964 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
2965 : discard_const_p(char *, kwnames),
2966 : &blob.data, &blob_length,
2967 : &bigendian_obj,
2968 : &ndr64_obj,
2969 : &allow_remaining_obj)) {
2970 0 : return NULL;
2971 : }
2972 0 : blob.length = blob_length;
2973 :
2974 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2975 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
2976 : }
2977 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2978 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
2979 : }
2980 :
2981 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2982 0 : allow_remaining = true;
2983 : }
2984 :
2985 0 : return py_svcctl_CloseServiceHandle_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
2986 : }
2987 :
2988 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2989 : {
2990 : DATA_BLOB blob;
2991 0 : Py_ssize_t blob_length = 0;
2992 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
2993 0 : PyObject *bigendian_obj = NULL;
2994 0 : PyObject *ndr64_obj = NULL;
2995 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
2996 0 : PyObject *allow_remaining_obj = NULL;
2997 0 : bool allow_remaining = false;
2998 :
2999 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3000 : discard_const_p(char *, kwnames),
3001 : &blob.data, &blob_length,
3002 : &bigendian_obj,
3003 : &ndr64_obj,
3004 : &allow_remaining_obj)) {
3005 0 : return NULL;
3006 : }
3007 0 : blob.length = blob_length;
3008 :
3009 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3010 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3011 : }
3012 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3013 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3014 : }
3015 :
3016 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3017 0 : allow_remaining = true;
3018 : }
3019 :
3020 0 : return py_svcctl_CloseServiceHandle_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3021 : }
3022 :
3023 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
3024 : {
3025 0 : const struct ndr_interface_call *call = NULL;
3026 0 : struct svcctl_CloseServiceHandle *object = (struct svcctl_CloseServiceHandle *)pytalloc_get_ptr(py_obj);
3027 : PyObject *ret;
3028 : char *retstr;
3029 :
3030 0 : if (ndr_table_svcctl.num_calls < 1) {
3031 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CloseServiceHandle_ndr_print");
3032 0 : return NULL;
3033 : }
3034 0 : call = &ndr_table_svcctl.calls[0];
3035 :
3036 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3037 0 : ret = PyUnicode_FromString(retstr);
3038 0 : TALLOC_FREE(retstr);
3039 :
3040 0 : return ret;
3041 : }
3042 :
3043 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3044 : {
3045 0 : return py_svcctl_CloseServiceHandle_ndr_print(py_obj, "svcctl_CloseServiceHandle_in", NDR_IN);
3046 : }
3047 :
3048 0 : static PyObject *py_svcctl_CloseServiceHandle_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3049 : {
3050 0 : return py_svcctl_CloseServiceHandle_ndr_print(py_obj, "svcctl_CloseServiceHandle_out", NDR_OUT);
3051 : }
3052 :
3053 : static PyMethodDef py_svcctl_CloseServiceHandle_methods[] = {
3054 : { "opnum", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_opnum, METH_NOARGS|METH_CLASS,
3055 : "svcctl.CloseServiceHandle.opnum() -> 0 (0x00) " },
3056 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3057 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3058 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3059 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3060 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3061 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3062 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CloseServiceHandle_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3063 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3064 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3065 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CloseServiceHandle_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3066 : { NULL, NULL, 0, NULL }
3067 : };
3068 :
3069 :
3070 : static PyTypeObject svcctl_CloseServiceHandle_Type = {
3071 : PyVarObject_HEAD_INIT(NULL, 0)
3072 : .tp_name = "svcctl.CloseServiceHandle",
3073 : .tp_getset = py_svcctl_CloseServiceHandle_getsetters,
3074 : .tp_methods = py_svcctl_CloseServiceHandle_methods,
3075 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3076 : .tp_new = py_svcctl_CloseServiceHandle_new,
3077 : };
3078 :
3079 0 : static bool pack_py_svcctl_CloseServiceHandle_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CloseServiceHandle *r)
3080 : {
3081 : PyObject *py_handle;
3082 0 : const char *kwnames[] = {
3083 : "handle", NULL
3084 : };
3085 :
3086 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_CloseServiceHandle", discard_const_p(char *, kwnames), &py_handle)) {
3087 0 : return false;
3088 : }
3089 :
3090 0 : if (py_handle == NULL) {
3091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
3092 0 : return false;
3093 : }
3094 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
3095 0 : if (r->in.handle == NULL) {
3096 0 : PyErr_NoMemory();
3097 0 : return false;
3098 : }
3099 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
3100 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
3101 0 : PyErr_NoMemory();
3102 0 : return false;
3103 : }
3104 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
3105 0 : return true;
3106 : }
3107 :
3108 0 : static PyObject *unpack_py_svcctl_CloseServiceHandle_args_out(struct svcctl_CloseServiceHandle *r)
3109 : {
3110 : PyObject *result;
3111 : PyObject *py_handle;
3112 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
3113 0 : result = py_handle;
3114 0 : if (!W_ERROR_IS_OK(r->out.result)) {
3115 0 : PyErr_SetWERROR(r->out.result);
3116 0 : return NULL;
3117 : }
3118 :
3119 0 : return result;
3120 : }
3121 :
3122 :
3123 0 : static PyObject *py_svcctl_ControlService_in_get_handle(PyObject *obj, void *closure)
3124 : {
3125 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
3126 : PyObject *py_handle;
3127 0 : if (object->in.handle == NULL) {
3128 0 : Py_RETURN_NONE;
3129 : }
3130 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
3131 0 : return py_handle;
3132 : }
3133 :
3134 0 : static int py_svcctl_ControlService_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
3135 : {
3136 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
3137 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
3138 0 : if (value == NULL) {
3139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
3140 0 : return -1;
3141 : }
3142 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
3143 0 : if (object->in.handle == NULL) {
3144 0 : PyErr_NoMemory();
3145 0 : return -1;
3146 : }
3147 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
3148 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3149 0 : PyErr_NoMemory();
3150 0 : return -1;
3151 : }
3152 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
3153 0 : return 0;
3154 : }
3155 :
3156 0 : static PyObject *py_svcctl_ControlService_in_get_control(PyObject *obj, void *closure)
3157 : {
3158 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
3159 : PyObject *py_control;
3160 0 : py_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.control);
3161 0 : return py_control;
3162 : }
3163 :
3164 0 : static int py_svcctl_ControlService_in_set_control(PyObject *py_obj, PyObject *value, void *closure)
3165 : {
3166 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
3167 0 : if (value == NULL) {
3168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.control");
3169 0 : return -1;
3170 : }
3171 : {
3172 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.control));
3173 0 : if (PyLong_Check(value)) {
3174 : unsigned long long test_var;
3175 0 : test_var = PyLong_AsUnsignedLongLong(value);
3176 0 : if (PyErr_Occurred() != NULL) {
3177 0 : return -1;
3178 : }
3179 0 : if (test_var > uint_max) {
3180 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3181 : PyLong_Type.tp_name, uint_max, test_var);
3182 0 : return -1;
3183 : }
3184 0 : object->in.control = test_var;
3185 : } else {
3186 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3187 : PyLong_Type.tp_name);
3188 0 : return -1;
3189 : }
3190 : }
3191 0 : return 0;
3192 : }
3193 :
3194 0 : static PyObject *py_svcctl_ControlService_out_get_service_status(PyObject *obj, void *closure)
3195 : {
3196 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
3197 : PyObject *py_service_status;
3198 0 : if (object->out.service_status == NULL) {
3199 0 : Py_RETURN_NONE;
3200 : }
3201 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, object->out.service_status, object->out.service_status);
3202 0 : return py_service_status;
3203 : }
3204 :
3205 0 : static int py_svcctl_ControlService_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
3206 : {
3207 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
3208 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
3209 0 : if (value == NULL) {
3210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
3211 0 : return -1;
3212 : }
3213 0 : object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
3214 0 : if (object->out.service_status == NULL) {
3215 0 : PyErr_NoMemory();
3216 0 : return -1;
3217 : }
3218 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
3219 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3220 0 : PyErr_NoMemory();
3221 0 : return -1;
3222 : }
3223 0 : object->out.service_status = (struct SERVICE_STATUS *)pytalloc_get_ptr(value);
3224 0 : return 0;
3225 : }
3226 :
3227 0 : static PyObject *py_svcctl_ControlService_get_result(PyObject *obj, void *closure)
3228 : {
3229 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(obj);
3230 : PyObject *py_result;
3231 0 : py_result = PyErr_FromWERROR(object->out.result);
3232 0 : return py_result;
3233 : }
3234 :
3235 0 : static int py_svcctl_ControlService_set_result(PyObject *py_obj, PyObject *value, void *closure)
3236 : {
3237 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
3238 0 : if (value == NULL) {
3239 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
3240 0 : return -1;
3241 : }
3242 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
3243 0 : return 0;
3244 : }
3245 :
3246 : static PyGetSetDef py_svcctl_ControlService_getsetters[] = {
3247 : {
3248 : .name = discard_const_p(char, "in_handle"),
3249 : .get = py_svcctl_ControlService_in_get_handle,
3250 : .set = py_svcctl_ControlService_in_set_handle,
3251 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
3252 : },
3253 : {
3254 : .name = discard_const_p(char, "in_control"),
3255 : .get = py_svcctl_ControlService_in_get_control,
3256 : .set = py_svcctl_ControlService_in_set_control,
3257 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_CONTROL")
3258 : },
3259 : {
3260 : .name = discard_const_p(char, "out_service_status"),
3261 : .get = py_svcctl_ControlService_out_get_service_status,
3262 : .set = py_svcctl_ControlService_out_set_service_status,
3263 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
3264 : },
3265 : {
3266 : .name = discard_const_p(char, "result"),
3267 : .get = py_svcctl_ControlService_get_result,
3268 : .set = py_svcctl_ControlService_set_result,
3269 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
3270 : },
3271 : { .name = NULL }
3272 : };
3273 :
3274 0 : static PyObject *py_svcctl_ControlService_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3275 : {
3276 0 : PyObject *self = pytalloc_new(struct svcctl_ControlService, type);
3277 0 : struct svcctl_ControlService *_self = (struct svcctl_ControlService *)pytalloc_get_ptr(self);
3278 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
3279 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
3280 0 : _self->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
3281 0 : return self;
3282 : }
3283 :
3284 0 : static PyObject *py_svcctl_ControlService_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
3285 : {
3286 :
3287 :
3288 0 : return PyLong_FromLong(1);
3289 : }
3290 :
3291 0 : static PyObject *py_svcctl_ControlService_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
3292 : {
3293 0 : const struct ndr_interface_call *call = NULL;
3294 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
3295 0 : PyObject *ret = NULL;
3296 0 : struct ndr_push *push = NULL;
3297 : DATA_BLOB blob;
3298 : enum ndr_err_code err;
3299 :
3300 0 : if (ndr_table_svcctl.num_calls < 2) {
3301 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_pack");
3302 0 : return NULL;
3303 : }
3304 0 : call = &ndr_table_svcctl.calls[1];
3305 :
3306 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
3307 0 : if (push == NULL) {
3308 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3309 0 : return NULL;
3310 : }
3311 :
3312 0 : push->flags |= ndr_push_flags;
3313 :
3314 0 : err = call->ndr_push(push, ndr_inout_flags, object);
3315 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3316 0 : TALLOC_FREE(push);
3317 0 : PyErr_SetNdrError(err);
3318 0 : return NULL;
3319 : }
3320 0 : blob = ndr_push_blob(push);
3321 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3322 0 : TALLOC_FREE(push);
3323 0 : return ret;
3324 : }
3325 :
3326 0 : static PyObject *py_svcctl_ControlService_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3327 : {
3328 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3329 0 : PyObject *bigendian_obj = NULL;
3330 0 : PyObject *ndr64_obj = NULL;
3331 0 : uint32_t ndr_push_flags = 0;
3332 :
3333 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
3334 : discard_const_p(char *, kwnames),
3335 : &bigendian_obj,
3336 : &ndr64_obj)) {
3337 0 : return NULL;
3338 : }
3339 :
3340 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3341 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3342 : }
3343 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3344 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3345 : }
3346 :
3347 0 : return py_svcctl_ControlService_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
3348 : }
3349 :
3350 0 : static PyObject *py_svcctl_ControlService_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3351 : {
3352 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3353 0 : PyObject *bigendian_obj = NULL;
3354 0 : PyObject *ndr64_obj = NULL;
3355 0 : uint32_t ndr_push_flags = 0;
3356 :
3357 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
3358 : discard_const_p(char *, kwnames),
3359 : &bigendian_obj,
3360 : &ndr64_obj)) {
3361 0 : return NULL;
3362 : }
3363 :
3364 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3365 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3366 : }
3367 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3368 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3369 : }
3370 :
3371 0 : return py_svcctl_ControlService_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
3372 : }
3373 :
3374 0 : static PyObject *py_svcctl_ControlService_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
3375 : {
3376 0 : const struct ndr_interface_call *call = NULL;
3377 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
3378 0 : struct ndr_pull *pull = NULL;
3379 : enum ndr_err_code err;
3380 :
3381 0 : if (ndr_table_svcctl.num_calls < 2) {
3382 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_unpack");
3383 0 : return NULL;
3384 : }
3385 0 : call = &ndr_table_svcctl.calls[1];
3386 :
3387 0 : pull = ndr_pull_init_blob(blob, object);
3388 0 : if (pull == NULL) {
3389 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3390 0 : return NULL;
3391 : }
3392 :
3393 0 : pull->flags |= ndr_pull_flags;
3394 :
3395 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3396 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3397 0 : TALLOC_FREE(pull);
3398 0 : PyErr_SetNdrError(err);
3399 0 : return NULL;
3400 : }
3401 0 : if (!allow_remaining) {
3402 : uint32_t highest_ofs;
3403 :
3404 0 : if (pull->offset > pull->relative_highest_offset) {
3405 0 : highest_ofs = pull->offset;
3406 : } else {
3407 0 : highest_ofs = pull->relative_highest_offset;
3408 : }
3409 0 : if (highest_ofs < pull->data_size) {
3410 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3411 : "not all bytes consumed ofs[%u] size[%u]",
3412 : highest_ofs, pull->data_size);
3413 0 : TALLOC_FREE(pull);
3414 0 : PyErr_SetNdrError(err);
3415 0 : return NULL;
3416 : }
3417 : }
3418 :
3419 0 : TALLOC_FREE(pull);
3420 0 : Py_RETURN_NONE;
3421 : }
3422 :
3423 0 : static PyObject *py_svcctl_ControlService_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3424 : {
3425 : DATA_BLOB blob;
3426 0 : Py_ssize_t blob_length = 0;
3427 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3428 0 : PyObject *bigendian_obj = NULL;
3429 0 : PyObject *ndr64_obj = NULL;
3430 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3431 0 : PyObject *allow_remaining_obj = NULL;
3432 0 : bool allow_remaining = false;
3433 :
3434 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3435 : discard_const_p(char *, kwnames),
3436 : &blob.data, &blob_length,
3437 : &bigendian_obj,
3438 : &ndr64_obj,
3439 : &allow_remaining_obj)) {
3440 0 : return NULL;
3441 : }
3442 0 : blob.length = blob_length;
3443 :
3444 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3445 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3446 : }
3447 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3448 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3449 : }
3450 :
3451 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3452 0 : allow_remaining = true;
3453 : }
3454 :
3455 0 : return py_svcctl_ControlService_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3456 : }
3457 :
3458 0 : static PyObject *py_svcctl_ControlService_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3459 : {
3460 : DATA_BLOB blob;
3461 0 : Py_ssize_t blob_length = 0;
3462 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3463 0 : PyObject *bigendian_obj = NULL;
3464 0 : PyObject *ndr64_obj = NULL;
3465 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3466 0 : PyObject *allow_remaining_obj = NULL;
3467 0 : bool allow_remaining = false;
3468 :
3469 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3470 : discard_const_p(char *, kwnames),
3471 : &blob.data, &blob_length,
3472 : &bigendian_obj,
3473 : &ndr64_obj,
3474 : &allow_remaining_obj)) {
3475 0 : return NULL;
3476 : }
3477 0 : blob.length = blob_length;
3478 :
3479 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3480 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3481 : }
3482 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3483 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3484 : }
3485 :
3486 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3487 0 : allow_remaining = true;
3488 : }
3489 :
3490 0 : return py_svcctl_ControlService_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3491 : }
3492 :
3493 0 : static PyObject *py_svcctl_ControlService_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
3494 : {
3495 0 : const struct ndr_interface_call *call = NULL;
3496 0 : struct svcctl_ControlService *object = (struct svcctl_ControlService *)pytalloc_get_ptr(py_obj);
3497 : PyObject *ret;
3498 : char *retstr;
3499 :
3500 0 : if (ndr_table_svcctl.num_calls < 2) {
3501 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ControlService_ndr_print");
3502 0 : return NULL;
3503 : }
3504 0 : call = &ndr_table_svcctl.calls[1];
3505 :
3506 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3507 0 : ret = PyUnicode_FromString(retstr);
3508 0 : TALLOC_FREE(retstr);
3509 :
3510 0 : return ret;
3511 : }
3512 :
3513 0 : static PyObject *py_svcctl_ControlService_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3514 : {
3515 0 : return py_svcctl_ControlService_ndr_print(py_obj, "svcctl_ControlService_in", NDR_IN);
3516 : }
3517 :
3518 0 : static PyObject *py_svcctl_ControlService_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3519 : {
3520 0 : return py_svcctl_ControlService_ndr_print(py_obj, "svcctl_ControlService_out", NDR_OUT);
3521 : }
3522 :
3523 : static PyMethodDef py_svcctl_ControlService_methods[] = {
3524 : { "opnum", (PyCFunction)py_svcctl_ControlService_ndr_opnum, METH_NOARGS|METH_CLASS,
3525 : "svcctl.ControlService.opnum() -> 1 (0x01) " },
3526 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3527 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3528 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3529 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3530 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3531 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3532 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ControlService_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3533 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3534 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ControlService_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3535 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ControlService_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3536 : { NULL, NULL, 0, NULL }
3537 : };
3538 :
3539 :
3540 : static PyTypeObject svcctl_ControlService_Type = {
3541 : PyVarObject_HEAD_INIT(NULL, 0)
3542 : .tp_name = "svcctl.ControlService",
3543 : .tp_getset = py_svcctl_ControlService_getsetters,
3544 : .tp_methods = py_svcctl_ControlService_methods,
3545 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3546 : .tp_new = py_svcctl_ControlService_new,
3547 : };
3548 :
3549 0 : static bool pack_py_svcctl_ControlService_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ControlService *r)
3550 : {
3551 : PyObject *py_handle;
3552 : PyObject *py_control;
3553 0 : const char *kwnames[] = {
3554 : "handle", "control", NULL
3555 : };
3556 :
3557 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_ControlService", discard_const_p(char *, kwnames), &py_handle, &py_control)) {
3558 0 : return false;
3559 : }
3560 :
3561 0 : if (py_handle == NULL) {
3562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
3563 0 : return false;
3564 : }
3565 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
3566 0 : if (r->in.handle == NULL) {
3567 0 : PyErr_NoMemory();
3568 0 : return false;
3569 : }
3570 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
3571 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
3572 0 : PyErr_NoMemory();
3573 0 : return false;
3574 : }
3575 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
3576 0 : if (py_control == NULL) {
3577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.control");
3578 0 : return false;
3579 : }
3580 : {
3581 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.control));
3582 0 : if (PyLong_Check(py_control)) {
3583 : unsigned long long test_var;
3584 0 : test_var = PyLong_AsUnsignedLongLong(py_control);
3585 0 : if (PyErr_Occurred() != NULL) {
3586 0 : return false;
3587 : }
3588 0 : if (test_var > uint_max) {
3589 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3590 : PyLong_Type.tp_name, uint_max, test_var);
3591 0 : return false;
3592 : }
3593 0 : r->in.control = test_var;
3594 : } else {
3595 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3596 : PyLong_Type.tp_name);
3597 0 : return false;
3598 : }
3599 : }
3600 0 : return true;
3601 : }
3602 :
3603 0 : static PyObject *unpack_py_svcctl_ControlService_args_out(struct svcctl_ControlService *r)
3604 : {
3605 : PyObject *result;
3606 : PyObject *py_service_status;
3607 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, r->out.service_status, r->out.service_status);
3608 0 : result = py_service_status;
3609 0 : if (!W_ERROR_IS_OK(r->out.result)) {
3610 0 : PyErr_SetWERROR(r->out.result);
3611 0 : return NULL;
3612 : }
3613 :
3614 0 : return result;
3615 : }
3616 :
3617 :
3618 0 : static PyObject *py_svcctl_DeleteService_in_get_handle(PyObject *obj, void *closure)
3619 : {
3620 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(obj);
3621 : PyObject *py_handle;
3622 0 : if (object->in.handle == NULL) {
3623 0 : Py_RETURN_NONE;
3624 : }
3625 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
3626 0 : return py_handle;
3627 : }
3628 :
3629 0 : static int py_svcctl_DeleteService_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
3630 : {
3631 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
3632 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
3633 0 : if (value == NULL) {
3634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
3635 0 : return -1;
3636 : }
3637 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
3638 0 : if (object->in.handle == NULL) {
3639 0 : PyErr_NoMemory();
3640 0 : return -1;
3641 : }
3642 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
3643 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3644 0 : PyErr_NoMemory();
3645 0 : return -1;
3646 : }
3647 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
3648 0 : return 0;
3649 : }
3650 :
3651 0 : static PyObject *py_svcctl_DeleteService_get_result(PyObject *obj, void *closure)
3652 : {
3653 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(obj);
3654 : PyObject *py_result;
3655 0 : py_result = PyErr_FromWERROR(object->out.result);
3656 0 : return py_result;
3657 : }
3658 :
3659 0 : static int py_svcctl_DeleteService_set_result(PyObject *py_obj, PyObject *value, void *closure)
3660 : {
3661 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
3662 0 : if (value == NULL) {
3663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
3664 0 : return -1;
3665 : }
3666 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
3667 0 : return 0;
3668 : }
3669 :
3670 : static PyGetSetDef py_svcctl_DeleteService_getsetters[] = {
3671 : {
3672 : .name = discard_const_p(char, "in_handle"),
3673 : .get = py_svcctl_DeleteService_in_get_handle,
3674 : .set = py_svcctl_DeleteService_in_set_handle,
3675 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
3676 : },
3677 : {
3678 : .name = discard_const_p(char, "result"),
3679 : .get = py_svcctl_DeleteService_get_result,
3680 : .set = py_svcctl_DeleteService_set_result,
3681 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
3682 : },
3683 : { .name = NULL }
3684 : };
3685 :
3686 0 : static PyObject *py_svcctl_DeleteService_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3687 : {
3688 0 : PyObject *self = pytalloc_new(struct svcctl_DeleteService, type);
3689 0 : struct svcctl_DeleteService *_self = (struct svcctl_DeleteService *)pytalloc_get_ptr(self);
3690 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
3691 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
3692 0 : return self;
3693 : }
3694 :
3695 0 : static PyObject *py_svcctl_DeleteService_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
3696 : {
3697 :
3698 :
3699 0 : return PyLong_FromLong(2);
3700 : }
3701 :
3702 0 : static PyObject *py_svcctl_DeleteService_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
3703 : {
3704 0 : const struct ndr_interface_call *call = NULL;
3705 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
3706 0 : PyObject *ret = NULL;
3707 0 : struct ndr_push *push = NULL;
3708 : DATA_BLOB blob;
3709 : enum ndr_err_code err;
3710 :
3711 0 : if (ndr_table_svcctl.num_calls < 3) {
3712 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_pack");
3713 0 : return NULL;
3714 : }
3715 0 : call = &ndr_table_svcctl.calls[2];
3716 :
3717 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
3718 0 : if (push == NULL) {
3719 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3720 0 : return NULL;
3721 : }
3722 :
3723 0 : push->flags |= ndr_push_flags;
3724 :
3725 0 : err = call->ndr_push(push, ndr_inout_flags, object);
3726 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3727 0 : TALLOC_FREE(push);
3728 0 : PyErr_SetNdrError(err);
3729 0 : return NULL;
3730 : }
3731 0 : blob = ndr_push_blob(push);
3732 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3733 0 : TALLOC_FREE(push);
3734 0 : return ret;
3735 : }
3736 :
3737 0 : static PyObject *py_svcctl_DeleteService_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3738 : {
3739 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3740 0 : PyObject *bigendian_obj = NULL;
3741 0 : PyObject *ndr64_obj = NULL;
3742 0 : uint32_t ndr_push_flags = 0;
3743 :
3744 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
3745 : discard_const_p(char *, kwnames),
3746 : &bigendian_obj,
3747 : &ndr64_obj)) {
3748 0 : return NULL;
3749 : }
3750 :
3751 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3752 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3753 : }
3754 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3755 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3756 : }
3757 :
3758 0 : return py_svcctl_DeleteService_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
3759 : }
3760 :
3761 0 : static PyObject *py_svcctl_DeleteService_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3762 : {
3763 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3764 0 : PyObject *bigendian_obj = NULL;
3765 0 : PyObject *ndr64_obj = NULL;
3766 0 : uint32_t ndr_push_flags = 0;
3767 :
3768 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
3769 : discard_const_p(char *, kwnames),
3770 : &bigendian_obj,
3771 : &ndr64_obj)) {
3772 0 : return NULL;
3773 : }
3774 :
3775 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3776 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3777 : }
3778 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3779 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3780 : }
3781 :
3782 0 : return py_svcctl_DeleteService_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
3783 : }
3784 :
3785 0 : static PyObject *py_svcctl_DeleteService_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
3786 : {
3787 0 : const struct ndr_interface_call *call = NULL;
3788 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
3789 0 : struct ndr_pull *pull = NULL;
3790 : enum ndr_err_code err;
3791 :
3792 0 : if (ndr_table_svcctl.num_calls < 3) {
3793 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_unpack");
3794 0 : return NULL;
3795 : }
3796 0 : call = &ndr_table_svcctl.calls[2];
3797 :
3798 0 : pull = ndr_pull_init_blob(blob, object);
3799 0 : if (pull == NULL) {
3800 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3801 0 : return NULL;
3802 : }
3803 :
3804 0 : pull->flags |= ndr_pull_flags;
3805 :
3806 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3807 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3808 0 : TALLOC_FREE(pull);
3809 0 : PyErr_SetNdrError(err);
3810 0 : return NULL;
3811 : }
3812 0 : if (!allow_remaining) {
3813 : uint32_t highest_ofs;
3814 :
3815 0 : if (pull->offset > pull->relative_highest_offset) {
3816 0 : highest_ofs = pull->offset;
3817 : } else {
3818 0 : highest_ofs = pull->relative_highest_offset;
3819 : }
3820 0 : if (highest_ofs < pull->data_size) {
3821 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3822 : "not all bytes consumed ofs[%u] size[%u]",
3823 : highest_ofs, pull->data_size);
3824 0 : TALLOC_FREE(pull);
3825 0 : PyErr_SetNdrError(err);
3826 0 : return NULL;
3827 : }
3828 : }
3829 :
3830 0 : TALLOC_FREE(pull);
3831 0 : Py_RETURN_NONE;
3832 : }
3833 :
3834 0 : static PyObject *py_svcctl_DeleteService_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3835 : {
3836 : DATA_BLOB blob;
3837 0 : Py_ssize_t blob_length = 0;
3838 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3839 0 : PyObject *bigendian_obj = NULL;
3840 0 : PyObject *ndr64_obj = NULL;
3841 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3842 0 : PyObject *allow_remaining_obj = NULL;
3843 0 : bool allow_remaining = false;
3844 :
3845 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3846 : discard_const_p(char *, kwnames),
3847 : &blob.data, &blob_length,
3848 : &bigendian_obj,
3849 : &ndr64_obj,
3850 : &allow_remaining_obj)) {
3851 0 : return NULL;
3852 : }
3853 0 : blob.length = blob_length;
3854 :
3855 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3856 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3857 : }
3858 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3859 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3860 : }
3861 :
3862 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3863 0 : allow_remaining = true;
3864 : }
3865 :
3866 0 : return py_svcctl_DeleteService_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3867 : }
3868 :
3869 0 : static PyObject *py_svcctl_DeleteService_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3870 : {
3871 : DATA_BLOB blob;
3872 0 : Py_ssize_t blob_length = 0;
3873 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3874 0 : PyObject *bigendian_obj = NULL;
3875 0 : PyObject *ndr64_obj = NULL;
3876 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3877 0 : PyObject *allow_remaining_obj = NULL;
3878 0 : bool allow_remaining = false;
3879 :
3880 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3881 : discard_const_p(char *, kwnames),
3882 : &blob.data, &blob_length,
3883 : &bigendian_obj,
3884 : &ndr64_obj,
3885 : &allow_remaining_obj)) {
3886 0 : return NULL;
3887 : }
3888 0 : blob.length = blob_length;
3889 :
3890 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3891 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3892 : }
3893 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3894 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3895 : }
3896 :
3897 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3898 0 : allow_remaining = true;
3899 : }
3900 :
3901 0 : return py_svcctl_DeleteService_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3902 : }
3903 :
3904 0 : static PyObject *py_svcctl_DeleteService_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
3905 : {
3906 0 : const struct ndr_interface_call *call = NULL;
3907 0 : struct svcctl_DeleteService *object = (struct svcctl_DeleteService *)pytalloc_get_ptr(py_obj);
3908 : PyObject *ret;
3909 : char *retstr;
3910 :
3911 0 : if (ndr_table_svcctl.num_calls < 3) {
3912 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_DeleteService_ndr_print");
3913 0 : return NULL;
3914 : }
3915 0 : call = &ndr_table_svcctl.calls[2];
3916 :
3917 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3918 0 : ret = PyUnicode_FromString(retstr);
3919 0 : TALLOC_FREE(retstr);
3920 :
3921 0 : return ret;
3922 : }
3923 :
3924 0 : static PyObject *py_svcctl_DeleteService_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3925 : {
3926 0 : return py_svcctl_DeleteService_ndr_print(py_obj, "svcctl_DeleteService_in", NDR_IN);
3927 : }
3928 :
3929 0 : static PyObject *py_svcctl_DeleteService_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3930 : {
3931 0 : return py_svcctl_DeleteService_ndr_print(py_obj, "svcctl_DeleteService_out", NDR_OUT);
3932 : }
3933 :
3934 : static PyMethodDef py_svcctl_DeleteService_methods[] = {
3935 : { "opnum", (PyCFunction)py_svcctl_DeleteService_ndr_opnum, METH_NOARGS|METH_CLASS,
3936 : "svcctl.DeleteService.opnum() -> 2 (0x02) " },
3937 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3938 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3939 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3940 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3941 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3942 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3943 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_DeleteService_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3944 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3945 : { "__ndr_print_in__", (PyCFunction)py_svcctl_DeleteService_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3946 : { "__ndr_print_out__", (PyCFunction)py_svcctl_DeleteService_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3947 : { NULL, NULL, 0, NULL }
3948 : };
3949 :
3950 :
3951 : static PyTypeObject svcctl_DeleteService_Type = {
3952 : PyVarObject_HEAD_INIT(NULL, 0)
3953 : .tp_name = "svcctl.DeleteService",
3954 : .tp_getset = py_svcctl_DeleteService_getsetters,
3955 : .tp_methods = py_svcctl_DeleteService_methods,
3956 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3957 : .tp_new = py_svcctl_DeleteService_new,
3958 : };
3959 :
3960 0 : static bool pack_py_svcctl_DeleteService_args_in(PyObject *args, PyObject *kwargs, struct svcctl_DeleteService *r)
3961 : {
3962 : PyObject *py_handle;
3963 0 : const char *kwnames[] = {
3964 : "handle", NULL
3965 : };
3966 :
3967 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_DeleteService", discard_const_p(char *, kwnames), &py_handle)) {
3968 0 : return false;
3969 : }
3970 :
3971 0 : if (py_handle == NULL) {
3972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
3973 0 : return false;
3974 : }
3975 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
3976 0 : if (r->in.handle == NULL) {
3977 0 : PyErr_NoMemory();
3978 0 : return false;
3979 : }
3980 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
3981 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
3982 0 : PyErr_NoMemory();
3983 0 : return false;
3984 : }
3985 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
3986 0 : return true;
3987 : }
3988 :
3989 0 : static PyObject *unpack_py_svcctl_DeleteService_args_out(struct svcctl_DeleteService *r)
3990 : {
3991 : PyObject *result;
3992 0 : result = Py_None;
3993 0 : Py_INCREF(result);
3994 0 : if (!W_ERROR_IS_OK(r->out.result)) {
3995 0 : PyErr_SetWERROR(r->out.result);
3996 0 : return NULL;
3997 : }
3998 :
3999 0 : return result;
4000 : }
4001 :
4002 :
4003 0 : static PyObject *py_svcctl_LockServiceDatabase_in_get_handle(PyObject *obj, void *closure)
4004 : {
4005 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
4006 : PyObject *py_handle;
4007 0 : if (object->in.handle == NULL) {
4008 0 : Py_RETURN_NONE;
4009 : }
4010 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
4011 0 : return py_handle;
4012 : }
4013 :
4014 0 : static int py_svcctl_LockServiceDatabase_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
4015 : {
4016 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
4017 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
4018 0 : if (value == NULL) {
4019 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
4020 0 : return -1;
4021 : }
4022 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
4023 0 : if (object->in.handle == NULL) {
4024 0 : PyErr_NoMemory();
4025 0 : return -1;
4026 : }
4027 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
4028 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4029 0 : PyErr_NoMemory();
4030 0 : return -1;
4031 : }
4032 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
4033 0 : return 0;
4034 : }
4035 :
4036 0 : static PyObject *py_svcctl_LockServiceDatabase_out_get_lock(PyObject *obj, void *closure)
4037 : {
4038 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
4039 : PyObject *py_lock;
4040 0 : if (object->out.lock == NULL) {
4041 0 : Py_RETURN_NONE;
4042 : }
4043 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, object->out.lock, object->out.lock);
4044 0 : return py_lock;
4045 : }
4046 :
4047 0 : static int py_svcctl_LockServiceDatabase_out_set_lock(PyObject *py_obj, PyObject *value, void *closure)
4048 : {
4049 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
4050 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock));
4051 0 : if (value == NULL) {
4052 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock");
4053 0 : return -1;
4054 : }
4055 0 : object->out.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock);
4056 0 : if (object->out.lock == NULL) {
4057 0 : PyErr_NoMemory();
4058 0 : return -1;
4059 : }
4060 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
4061 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4062 0 : PyErr_NoMemory();
4063 0 : return -1;
4064 : }
4065 0 : object->out.lock = (struct policy_handle *)pytalloc_get_ptr(value);
4066 0 : return 0;
4067 : }
4068 :
4069 0 : static PyObject *py_svcctl_LockServiceDatabase_get_result(PyObject *obj, void *closure)
4070 : {
4071 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(obj);
4072 : PyObject *py_result;
4073 0 : py_result = PyErr_FromWERROR(object->out.result);
4074 0 : return py_result;
4075 : }
4076 :
4077 0 : static int py_svcctl_LockServiceDatabase_set_result(PyObject *py_obj, PyObject *value, void *closure)
4078 : {
4079 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
4080 0 : if (value == NULL) {
4081 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
4082 0 : return -1;
4083 : }
4084 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
4085 0 : return 0;
4086 : }
4087 :
4088 : static PyGetSetDef py_svcctl_LockServiceDatabase_getsetters[] = {
4089 : {
4090 : .name = discard_const_p(char, "in_handle"),
4091 : .get = py_svcctl_LockServiceDatabase_in_get_handle,
4092 : .set = py_svcctl_LockServiceDatabase_in_set_handle,
4093 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
4094 : },
4095 : {
4096 : .name = discard_const_p(char, "out_lock"),
4097 : .get = py_svcctl_LockServiceDatabase_out_get_lock,
4098 : .set = py_svcctl_LockServiceDatabase_out_set_lock,
4099 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
4100 : },
4101 : {
4102 : .name = discard_const_p(char, "result"),
4103 : .get = py_svcctl_LockServiceDatabase_get_result,
4104 : .set = py_svcctl_LockServiceDatabase_set_result,
4105 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
4106 : },
4107 : { .name = NULL }
4108 : };
4109 :
4110 0 : static PyObject *py_svcctl_LockServiceDatabase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4111 : {
4112 0 : PyObject *self = pytalloc_new(struct svcctl_LockServiceDatabase, type);
4113 0 : struct svcctl_LockServiceDatabase *_self = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(self);
4114 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
4115 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
4116 0 : _self->out.lock = talloc_zero(mem_ctx, struct policy_handle);
4117 0 : return self;
4118 : }
4119 :
4120 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
4121 : {
4122 :
4123 :
4124 0 : return PyLong_FromLong(3);
4125 : }
4126 :
4127 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
4128 : {
4129 0 : const struct ndr_interface_call *call = NULL;
4130 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
4131 0 : PyObject *ret = NULL;
4132 0 : struct ndr_push *push = NULL;
4133 : DATA_BLOB blob;
4134 : enum ndr_err_code err;
4135 :
4136 0 : if (ndr_table_svcctl.num_calls < 4) {
4137 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_pack");
4138 0 : return NULL;
4139 : }
4140 0 : call = &ndr_table_svcctl.calls[3];
4141 :
4142 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
4143 0 : if (push == NULL) {
4144 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4145 0 : return NULL;
4146 : }
4147 :
4148 0 : push->flags |= ndr_push_flags;
4149 :
4150 0 : err = call->ndr_push(push, ndr_inout_flags, object);
4151 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4152 0 : TALLOC_FREE(push);
4153 0 : PyErr_SetNdrError(err);
4154 0 : return NULL;
4155 : }
4156 0 : blob = ndr_push_blob(push);
4157 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4158 0 : TALLOC_FREE(push);
4159 0 : return ret;
4160 : }
4161 :
4162 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4163 : {
4164 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4165 0 : PyObject *bigendian_obj = NULL;
4166 0 : PyObject *ndr64_obj = NULL;
4167 0 : uint32_t ndr_push_flags = 0;
4168 :
4169 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
4170 : discard_const_p(char *, kwnames),
4171 : &bigendian_obj,
4172 : &ndr64_obj)) {
4173 0 : return NULL;
4174 : }
4175 :
4176 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4177 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4178 : }
4179 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4180 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4181 : }
4182 :
4183 0 : return py_svcctl_LockServiceDatabase_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
4184 : }
4185 :
4186 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4187 : {
4188 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4189 0 : PyObject *bigendian_obj = NULL;
4190 0 : PyObject *ndr64_obj = NULL;
4191 0 : uint32_t ndr_push_flags = 0;
4192 :
4193 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
4194 : discard_const_p(char *, kwnames),
4195 : &bigendian_obj,
4196 : &ndr64_obj)) {
4197 0 : return NULL;
4198 : }
4199 :
4200 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4201 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4202 : }
4203 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4204 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4205 : }
4206 :
4207 0 : return py_svcctl_LockServiceDatabase_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
4208 : }
4209 :
4210 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
4211 : {
4212 0 : const struct ndr_interface_call *call = NULL;
4213 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
4214 0 : struct ndr_pull *pull = NULL;
4215 : enum ndr_err_code err;
4216 :
4217 0 : if (ndr_table_svcctl.num_calls < 4) {
4218 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_unpack");
4219 0 : return NULL;
4220 : }
4221 0 : call = &ndr_table_svcctl.calls[3];
4222 :
4223 0 : pull = ndr_pull_init_blob(blob, object);
4224 0 : if (pull == NULL) {
4225 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4226 0 : return NULL;
4227 : }
4228 :
4229 0 : pull->flags |= ndr_pull_flags;
4230 :
4231 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
4232 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4233 0 : TALLOC_FREE(pull);
4234 0 : PyErr_SetNdrError(err);
4235 0 : return NULL;
4236 : }
4237 0 : if (!allow_remaining) {
4238 : uint32_t highest_ofs;
4239 :
4240 0 : if (pull->offset > pull->relative_highest_offset) {
4241 0 : highest_ofs = pull->offset;
4242 : } else {
4243 0 : highest_ofs = pull->relative_highest_offset;
4244 : }
4245 0 : if (highest_ofs < pull->data_size) {
4246 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
4247 : "not all bytes consumed ofs[%u] size[%u]",
4248 : highest_ofs, pull->data_size);
4249 0 : TALLOC_FREE(pull);
4250 0 : PyErr_SetNdrError(err);
4251 0 : return NULL;
4252 : }
4253 : }
4254 :
4255 0 : TALLOC_FREE(pull);
4256 0 : Py_RETURN_NONE;
4257 : }
4258 :
4259 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4260 : {
4261 : DATA_BLOB blob;
4262 0 : Py_ssize_t blob_length = 0;
4263 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4264 0 : PyObject *bigendian_obj = NULL;
4265 0 : PyObject *ndr64_obj = NULL;
4266 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4267 0 : PyObject *allow_remaining_obj = NULL;
4268 0 : bool allow_remaining = false;
4269 :
4270 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
4271 : discard_const_p(char *, kwnames),
4272 : &blob.data, &blob_length,
4273 : &bigendian_obj,
4274 : &ndr64_obj,
4275 : &allow_remaining_obj)) {
4276 0 : return NULL;
4277 : }
4278 0 : blob.length = blob_length;
4279 :
4280 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4281 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4282 : }
4283 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4284 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4285 : }
4286 :
4287 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4288 0 : allow_remaining = true;
4289 : }
4290 :
4291 0 : return py_svcctl_LockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
4292 : }
4293 :
4294 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4295 : {
4296 : DATA_BLOB blob;
4297 0 : Py_ssize_t blob_length = 0;
4298 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4299 0 : PyObject *bigendian_obj = NULL;
4300 0 : PyObject *ndr64_obj = NULL;
4301 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4302 0 : PyObject *allow_remaining_obj = NULL;
4303 0 : bool allow_remaining = false;
4304 :
4305 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
4306 : discard_const_p(char *, kwnames),
4307 : &blob.data, &blob_length,
4308 : &bigendian_obj,
4309 : &ndr64_obj,
4310 : &allow_remaining_obj)) {
4311 0 : return NULL;
4312 : }
4313 0 : blob.length = blob_length;
4314 :
4315 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4316 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4317 : }
4318 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4319 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4320 : }
4321 :
4322 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4323 0 : allow_remaining = true;
4324 : }
4325 :
4326 0 : return py_svcctl_LockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
4327 : }
4328 :
4329 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
4330 : {
4331 0 : const struct ndr_interface_call *call = NULL;
4332 0 : struct svcctl_LockServiceDatabase *object = (struct svcctl_LockServiceDatabase *)pytalloc_get_ptr(py_obj);
4333 : PyObject *ret;
4334 : char *retstr;
4335 :
4336 0 : if (ndr_table_svcctl.num_calls < 4) {
4337 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_LockServiceDatabase_ndr_print");
4338 0 : return NULL;
4339 : }
4340 0 : call = &ndr_table_svcctl.calls[3];
4341 :
4342 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
4343 0 : ret = PyUnicode_FromString(retstr);
4344 0 : TALLOC_FREE(retstr);
4345 :
4346 0 : return ret;
4347 : }
4348 :
4349 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4350 : {
4351 0 : return py_svcctl_LockServiceDatabase_ndr_print(py_obj, "svcctl_LockServiceDatabase_in", NDR_IN);
4352 : }
4353 :
4354 0 : static PyObject *py_svcctl_LockServiceDatabase_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4355 : {
4356 0 : return py_svcctl_LockServiceDatabase_ndr_print(py_obj, "svcctl_LockServiceDatabase_out", NDR_OUT);
4357 : }
4358 :
4359 : static PyMethodDef py_svcctl_LockServiceDatabase_methods[] = {
4360 : { "opnum", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_opnum, METH_NOARGS|METH_CLASS,
4361 : "svcctl.LockServiceDatabase.opnum() -> 3 (0x03) " },
4362 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
4363 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
4364 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
4365 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
4366 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
4367 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
4368 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_LockServiceDatabase_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
4369 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
4370 : { "__ndr_print_in__", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
4371 : { "__ndr_print_out__", (PyCFunction)py_svcctl_LockServiceDatabase_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
4372 : { NULL, NULL, 0, NULL }
4373 : };
4374 :
4375 :
4376 : static PyTypeObject svcctl_LockServiceDatabase_Type = {
4377 : PyVarObject_HEAD_INIT(NULL, 0)
4378 : .tp_name = "svcctl.LockServiceDatabase",
4379 : .tp_getset = py_svcctl_LockServiceDatabase_getsetters,
4380 : .tp_methods = py_svcctl_LockServiceDatabase_methods,
4381 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4382 : .tp_new = py_svcctl_LockServiceDatabase_new,
4383 : };
4384 :
4385 0 : static bool pack_py_svcctl_LockServiceDatabase_args_in(PyObject *args, PyObject *kwargs, struct svcctl_LockServiceDatabase *r)
4386 : {
4387 : PyObject *py_handle;
4388 0 : const char *kwnames[] = {
4389 : "handle", NULL
4390 : };
4391 :
4392 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_LockServiceDatabase", discard_const_p(char *, kwnames), &py_handle)) {
4393 0 : return false;
4394 : }
4395 :
4396 0 : if (py_handle == NULL) {
4397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
4398 0 : return false;
4399 : }
4400 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
4401 0 : if (r->in.handle == NULL) {
4402 0 : PyErr_NoMemory();
4403 0 : return false;
4404 : }
4405 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
4406 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
4407 0 : PyErr_NoMemory();
4408 0 : return false;
4409 : }
4410 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
4411 0 : return true;
4412 : }
4413 :
4414 0 : static PyObject *unpack_py_svcctl_LockServiceDatabase_args_out(struct svcctl_LockServiceDatabase *r)
4415 : {
4416 : PyObject *result;
4417 : PyObject *py_lock;
4418 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, r->out.lock, r->out.lock);
4419 0 : result = py_lock;
4420 0 : if (!W_ERROR_IS_OK(r->out.result)) {
4421 0 : PyErr_SetWERROR(r->out.result);
4422 0 : return NULL;
4423 : }
4424 :
4425 0 : return result;
4426 : }
4427 :
4428 :
4429 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_handle(PyObject *obj, void *closure)
4430 : {
4431 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
4432 : PyObject *py_handle;
4433 0 : if (object->in.handle == NULL) {
4434 0 : Py_RETURN_NONE;
4435 : }
4436 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
4437 0 : return py_handle;
4438 : }
4439 :
4440 0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
4441 : {
4442 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4443 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
4444 0 : if (value == NULL) {
4445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
4446 0 : return -1;
4447 : }
4448 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
4449 0 : if (object->in.handle == NULL) {
4450 0 : PyErr_NoMemory();
4451 0 : return -1;
4452 : }
4453 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
4454 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4455 0 : PyErr_NoMemory();
4456 0 : return -1;
4457 : }
4458 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
4459 0 : return 0;
4460 : }
4461 :
4462 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_security_flags(PyObject *obj, void *closure)
4463 : {
4464 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
4465 : PyObject *py_security_flags;
4466 0 : py_security_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.security_flags);
4467 0 : return py_security_flags;
4468 : }
4469 :
4470 0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_security_flags(PyObject *py_obj, PyObject *value, void *closure)
4471 : {
4472 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4473 0 : if (value == NULL) {
4474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.security_flags");
4475 0 : return -1;
4476 : }
4477 : {
4478 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.security_flags));
4479 0 : if (PyLong_Check(value)) {
4480 : unsigned long long test_var;
4481 0 : test_var = PyLong_AsUnsignedLongLong(value);
4482 0 : if (PyErr_Occurred() != NULL) {
4483 0 : return -1;
4484 : }
4485 0 : if (test_var > uint_max) {
4486 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4487 : PyLong_Type.tp_name, uint_max, test_var);
4488 0 : return -1;
4489 : }
4490 0 : object->in.security_flags = test_var;
4491 : } else {
4492 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4493 : PyLong_Type.tp_name);
4494 0 : return -1;
4495 : }
4496 : }
4497 0 : return 0;
4498 : }
4499 :
4500 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_out_get_buffer(PyObject *obj, void *closure)
4501 : {
4502 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
4503 : PyObject *py_buffer;
4504 0 : if (object->out.buffer == NULL) {
4505 0 : Py_RETURN_NONE;
4506 : }
4507 0 : py_buffer = PyList_New(object->in.offered);
4508 0 : if (py_buffer == NULL) {
4509 0 : return NULL;
4510 : }
4511 : {
4512 : int buffer_cntr_1;
4513 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
4514 : PyObject *py_buffer_1;
4515 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_1]);
4516 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
4517 : }
4518 : }
4519 0 : return py_buffer;
4520 : }
4521 :
4522 0 : static int py_svcctl_QueryServiceObjectSecurity_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
4523 : {
4524 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4525 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
4526 0 : if (value == NULL) {
4527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
4528 0 : return -1;
4529 : }
4530 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
4531 0 : if (object->out.buffer == NULL) {
4532 0 : PyErr_NoMemory();
4533 0 : return -1;
4534 : }
4535 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4536 : {
4537 : int buffer_cntr_1;
4538 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
4539 0 : if (!object->out.buffer) { return -1;; }
4540 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
4541 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
4542 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
4543 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_1]");
4544 0 : return -1;
4545 : }
4546 : {
4547 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_1]));
4548 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
4549 : unsigned long long test_var;
4550 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
4551 0 : if (PyErr_Occurred() != NULL) {
4552 0 : return -1;
4553 : }
4554 0 : if (test_var > uint_max) {
4555 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4556 : PyLong_Type.tp_name, uint_max, test_var);
4557 0 : return -1;
4558 : }
4559 0 : object->out.buffer[buffer_cntr_1] = test_var;
4560 : } else {
4561 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4562 : PyLong_Type.tp_name);
4563 0 : return -1;
4564 : }
4565 : }
4566 : }
4567 : }
4568 0 : return 0;
4569 : }
4570 :
4571 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_in_get_offered(PyObject *obj, void *closure)
4572 : {
4573 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
4574 : PyObject *py_offered;
4575 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
4576 0 : return py_offered;
4577 : }
4578 :
4579 0 : static int py_svcctl_QueryServiceObjectSecurity_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
4580 : {
4581 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4582 0 : if (value == NULL) {
4583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
4584 0 : return -1;
4585 : }
4586 : {
4587 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
4588 0 : if (PyLong_Check(value)) {
4589 : unsigned long long test_var;
4590 0 : test_var = PyLong_AsUnsignedLongLong(value);
4591 0 : if (PyErr_Occurred() != NULL) {
4592 0 : return -1;
4593 : }
4594 0 : if (test_var > uint_max) {
4595 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4596 : PyLong_Type.tp_name, uint_max, test_var);
4597 0 : return -1;
4598 : }
4599 0 : object->in.offered = test_var;
4600 : } else {
4601 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4602 : PyLong_Type.tp_name);
4603 0 : return -1;
4604 : }
4605 : }
4606 0 : return 0;
4607 : }
4608 :
4609 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_out_get_needed(PyObject *obj, void *closure)
4610 : {
4611 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
4612 : PyObject *py_needed;
4613 0 : if (object->out.needed == NULL) {
4614 0 : Py_RETURN_NONE;
4615 : }
4616 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
4617 0 : return py_needed;
4618 : }
4619 :
4620 0 : static int py_svcctl_QueryServiceObjectSecurity_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
4621 : {
4622 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4623 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
4624 0 : if (value == NULL) {
4625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
4626 0 : return -1;
4627 : }
4628 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
4629 0 : if (object->out.needed == NULL) {
4630 0 : PyErr_NoMemory();
4631 0 : return -1;
4632 : }
4633 : {
4634 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
4635 0 : if (PyLong_Check(value)) {
4636 : unsigned long long test_var;
4637 0 : test_var = PyLong_AsUnsignedLongLong(value);
4638 0 : if (PyErr_Occurred() != NULL) {
4639 0 : return -1;
4640 : }
4641 0 : if (test_var > uint_max) {
4642 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4643 : PyLong_Type.tp_name, uint_max, test_var);
4644 0 : return -1;
4645 : }
4646 0 : *object->out.needed = test_var;
4647 : } else {
4648 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4649 : PyLong_Type.tp_name);
4650 0 : return -1;
4651 : }
4652 : }
4653 0 : return 0;
4654 : }
4655 :
4656 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_get_result(PyObject *obj, void *closure)
4657 : {
4658 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(obj);
4659 : PyObject *py_result;
4660 0 : py_result = PyErr_FromWERROR(object->out.result);
4661 0 : return py_result;
4662 : }
4663 :
4664 0 : static int py_svcctl_QueryServiceObjectSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
4665 : {
4666 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4667 0 : if (value == NULL) {
4668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
4669 0 : return -1;
4670 : }
4671 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
4672 0 : return 0;
4673 : }
4674 :
4675 : static PyGetSetDef py_svcctl_QueryServiceObjectSecurity_getsetters[] = {
4676 : {
4677 : .name = discard_const_p(char, "in_handle"),
4678 : .get = py_svcctl_QueryServiceObjectSecurity_in_get_handle,
4679 : .set = py_svcctl_QueryServiceObjectSecurity_in_set_handle,
4680 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
4681 : },
4682 : {
4683 : .name = discard_const_p(char, "in_security_flags"),
4684 : .get = py_svcctl_QueryServiceObjectSecurity_in_get_security_flags,
4685 : .set = py_svcctl_QueryServiceObjectSecurity_in_set_security_flags,
4686 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
4687 : },
4688 : {
4689 : .name = discard_const_p(char, "out_buffer"),
4690 : .get = py_svcctl_QueryServiceObjectSecurity_out_get_buffer,
4691 : .set = py_svcctl_QueryServiceObjectSecurity_out_set_buffer,
4692 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4693 : },
4694 : {
4695 : .name = discard_const_p(char, "in_offered"),
4696 : .get = py_svcctl_QueryServiceObjectSecurity_in_get_offered,
4697 : .set = py_svcctl_QueryServiceObjectSecurity_in_set_offered,
4698 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4699 : },
4700 : {
4701 : .name = discard_const_p(char, "out_needed"),
4702 : .get = py_svcctl_QueryServiceObjectSecurity_out_get_needed,
4703 : .set = py_svcctl_QueryServiceObjectSecurity_out_set_needed,
4704 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4705 : },
4706 : {
4707 : .name = discard_const_p(char, "result"),
4708 : .get = py_svcctl_QueryServiceObjectSecurity_get_result,
4709 : .set = py_svcctl_QueryServiceObjectSecurity_set_result,
4710 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
4711 : },
4712 : { .name = NULL }
4713 : };
4714 :
4715 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4716 : {
4717 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceObjectSecurity, type);
4718 0 : struct svcctl_QueryServiceObjectSecurity *_self = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(self);
4719 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
4720 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
4721 0 : _self->out.buffer = talloc_zero(mem_ctx, uint8_t);
4722 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
4723 0 : return self;
4724 : }
4725 :
4726 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
4727 : {
4728 :
4729 :
4730 0 : return PyLong_FromLong(4);
4731 : }
4732 :
4733 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
4734 : {
4735 0 : const struct ndr_interface_call *call = NULL;
4736 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4737 0 : PyObject *ret = NULL;
4738 0 : struct ndr_push *push = NULL;
4739 : DATA_BLOB blob;
4740 : enum ndr_err_code err;
4741 :
4742 0 : if (ndr_table_svcctl.num_calls < 5) {
4743 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_pack");
4744 0 : return NULL;
4745 : }
4746 0 : call = &ndr_table_svcctl.calls[4];
4747 :
4748 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
4749 0 : if (push == NULL) {
4750 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4751 0 : return NULL;
4752 : }
4753 :
4754 0 : push->flags |= ndr_push_flags;
4755 :
4756 0 : err = call->ndr_push(push, ndr_inout_flags, object);
4757 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4758 0 : TALLOC_FREE(push);
4759 0 : PyErr_SetNdrError(err);
4760 0 : return NULL;
4761 : }
4762 0 : blob = ndr_push_blob(push);
4763 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4764 0 : TALLOC_FREE(push);
4765 0 : return ret;
4766 : }
4767 :
4768 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4769 : {
4770 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4771 0 : PyObject *bigendian_obj = NULL;
4772 0 : PyObject *ndr64_obj = NULL;
4773 0 : uint32_t ndr_push_flags = 0;
4774 :
4775 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
4776 : discard_const_p(char *, kwnames),
4777 : &bigendian_obj,
4778 : &ndr64_obj)) {
4779 0 : return NULL;
4780 : }
4781 :
4782 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4783 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4784 : }
4785 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4786 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4787 : }
4788 :
4789 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
4790 : }
4791 :
4792 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4793 : {
4794 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4795 0 : PyObject *bigendian_obj = NULL;
4796 0 : PyObject *ndr64_obj = NULL;
4797 0 : uint32_t ndr_push_flags = 0;
4798 :
4799 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
4800 : discard_const_p(char *, kwnames),
4801 : &bigendian_obj,
4802 : &ndr64_obj)) {
4803 0 : return NULL;
4804 : }
4805 :
4806 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4807 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4808 : }
4809 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4810 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4811 : }
4812 :
4813 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
4814 : }
4815 :
4816 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
4817 : {
4818 0 : const struct ndr_interface_call *call = NULL;
4819 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4820 0 : struct ndr_pull *pull = NULL;
4821 : enum ndr_err_code err;
4822 :
4823 0 : if (ndr_table_svcctl.num_calls < 5) {
4824 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_unpack");
4825 0 : return NULL;
4826 : }
4827 0 : call = &ndr_table_svcctl.calls[4];
4828 :
4829 0 : pull = ndr_pull_init_blob(blob, object);
4830 0 : if (pull == NULL) {
4831 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4832 0 : return NULL;
4833 : }
4834 :
4835 0 : pull->flags |= ndr_pull_flags;
4836 :
4837 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
4838 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4839 0 : TALLOC_FREE(pull);
4840 0 : PyErr_SetNdrError(err);
4841 0 : return NULL;
4842 : }
4843 0 : if (!allow_remaining) {
4844 : uint32_t highest_ofs;
4845 :
4846 0 : if (pull->offset > pull->relative_highest_offset) {
4847 0 : highest_ofs = pull->offset;
4848 : } else {
4849 0 : highest_ofs = pull->relative_highest_offset;
4850 : }
4851 0 : if (highest_ofs < pull->data_size) {
4852 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
4853 : "not all bytes consumed ofs[%u] size[%u]",
4854 : highest_ofs, pull->data_size);
4855 0 : TALLOC_FREE(pull);
4856 0 : PyErr_SetNdrError(err);
4857 0 : return NULL;
4858 : }
4859 : }
4860 :
4861 0 : TALLOC_FREE(pull);
4862 0 : Py_RETURN_NONE;
4863 : }
4864 :
4865 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4866 : {
4867 : DATA_BLOB blob;
4868 0 : Py_ssize_t blob_length = 0;
4869 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4870 0 : PyObject *bigendian_obj = NULL;
4871 0 : PyObject *ndr64_obj = NULL;
4872 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4873 0 : PyObject *allow_remaining_obj = NULL;
4874 0 : bool allow_remaining = false;
4875 :
4876 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
4877 : discard_const_p(char *, kwnames),
4878 : &blob.data, &blob_length,
4879 : &bigendian_obj,
4880 : &ndr64_obj,
4881 : &allow_remaining_obj)) {
4882 0 : return NULL;
4883 : }
4884 0 : blob.length = blob_length;
4885 :
4886 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4887 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4888 : }
4889 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4890 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4891 : }
4892 :
4893 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4894 0 : allow_remaining = true;
4895 : }
4896 :
4897 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
4898 : }
4899 :
4900 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4901 : {
4902 : DATA_BLOB blob;
4903 0 : Py_ssize_t blob_length = 0;
4904 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4905 0 : PyObject *bigendian_obj = NULL;
4906 0 : PyObject *ndr64_obj = NULL;
4907 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4908 0 : PyObject *allow_remaining_obj = NULL;
4909 0 : bool allow_remaining = false;
4910 :
4911 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
4912 : discard_const_p(char *, kwnames),
4913 : &blob.data, &blob_length,
4914 : &bigendian_obj,
4915 : &ndr64_obj,
4916 : &allow_remaining_obj)) {
4917 0 : return NULL;
4918 : }
4919 0 : blob.length = blob_length;
4920 :
4921 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4922 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4923 : }
4924 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4925 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4926 : }
4927 :
4928 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4929 0 : allow_remaining = true;
4930 : }
4931 :
4932 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
4933 : }
4934 :
4935 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
4936 : {
4937 0 : const struct ndr_interface_call *call = NULL;
4938 0 : struct svcctl_QueryServiceObjectSecurity *object = (struct svcctl_QueryServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
4939 : PyObject *ret;
4940 : char *retstr;
4941 :
4942 0 : if (ndr_table_svcctl.num_calls < 5) {
4943 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceObjectSecurity_ndr_print");
4944 0 : return NULL;
4945 : }
4946 0 : call = &ndr_table_svcctl.calls[4];
4947 :
4948 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
4949 0 : ret = PyUnicode_FromString(retstr);
4950 0 : TALLOC_FREE(retstr);
4951 :
4952 0 : return ret;
4953 : }
4954 :
4955 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4956 : {
4957 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_print(py_obj, "svcctl_QueryServiceObjectSecurity_in", NDR_IN);
4958 : }
4959 :
4960 0 : static PyObject *py_svcctl_QueryServiceObjectSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4961 : {
4962 0 : return py_svcctl_QueryServiceObjectSecurity_ndr_print(py_obj, "svcctl_QueryServiceObjectSecurity_out", NDR_OUT);
4963 : }
4964 :
4965 : static PyMethodDef py_svcctl_QueryServiceObjectSecurity_methods[] = {
4966 : { "opnum", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
4967 : "svcctl.QueryServiceObjectSecurity.opnum() -> 4 (0x04) " },
4968 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
4969 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
4970 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
4971 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
4972 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
4973 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
4974 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceObjectSecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
4975 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
4976 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
4977 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceObjectSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
4978 : { NULL, NULL, 0, NULL }
4979 : };
4980 :
4981 :
4982 : static PyTypeObject svcctl_QueryServiceObjectSecurity_Type = {
4983 : PyVarObject_HEAD_INIT(NULL, 0)
4984 : .tp_name = "svcctl.QueryServiceObjectSecurity",
4985 : .tp_getset = py_svcctl_QueryServiceObjectSecurity_getsetters,
4986 : .tp_methods = py_svcctl_QueryServiceObjectSecurity_methods,
4987 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4988 : .tp_new = py_svcctl_QueryServiceObjectSecurity_new,
4989 : };
4990 :
4991 0 : static bool pack_py_svcctl_QueryServiceObjectSecurity_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceObjectSecurity *r)
4992 : {
4993 : PyObject *py_handle;
4994 : PyObject *py_security_flags;
4995 : PyObject *py_offered;
4996 0 : const char *kwnames[] = {
4997 : "handle", "security_flags", "offered", NULL
4998 : };
4999 :
5000 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceObjectSecurity", discard_const_p(char *, kwnames), &py_handle, &py_security_flags, &py_offered)) {
5001 0 : return false;
5002 : }
5003 :
5004 0 : if (py_handle == NULL) {
5005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
5006 0 : return false;
5007 : }
5008 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
5009 0 : if (r->in.handle == NULL) {
5010 0 : PyErr_NoMemory();
5011 0 : return false;
5012 : }
5013 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
5014 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
5015 0 : PyErr_NoMemory();
5016 0 : return false;
5017 : }
5018 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
5019 0 : if (py_security_flags == NULL) {
5020 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.security_flags");
5021 0 : return false;
5022 : }
5023 : {
5024 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.security_flags));
5025 0 : if (PyLong_Check(py_security_flags)) {
5026 : unsigned long long test_var;
5027 0 : test_var = PyLong_AsUnsignedLongLong(py_security_flags);
5028 0 : if (PyErr_Occurred() != NULL) {
5029 0 : return false;
5030 : }
5031 0 : if (test_var > uint_max) {
5032 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5033 : PyLong_Type.tp_name, uint_max, test_var);
5034 0 : return false;
5035 : }
5036 0 : r->in.security_flags = test_var;
5037 : } else {
5038 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5039 : PyLong_Type.tp_name);
5040 0 : return false;
5041 : }
5042 : }
5043 0 : if (py_offered == NULL) {
5044 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
5045 0 : return false;
5046 : }
5047 : {
5048 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
5049 0 : if (PyLong_Check(py_offered)) {
5050 : unsigned long long test_var;
5051 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
5052 0 : if (PyErr_Occurred() != NULL) {
5053 0 : return false;
5054 : }
5055 0 : if (test_var > uint_max) {
5056 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5057 : PyLong_Type.tp_name, uint_max, test_var);
5058 0 : return false;
5059 : }
5060 0 : r->in.offered = test_var;
5061 : } else {
5062 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5063 : PyLong_Type.tp_name);
5064 0 : return false;
5065 : }
5066 : }
5067 0 : return true;
5068 : }
5069 :
5070 0 : static PyObject *unpack_py_svcctl_QueryServiceObjectSecurity_args_out(struct svcctl_QueryServiceObjectSecurity *r)
5071 : {
5072 : PyObject *result;
5073 : PyObject *py_buffer;
5074 : PyObject *py_needed;
5075 0 : result = PyTuple_New(2);
5076 0 : py_buffer = PyList_New(r->in.offered);
5077 0 : if (py_buffer == NULL) {
5078 0 : return NULL;
5079 : }
5080 : {
5081 : int buffer_cntr_1;
5082 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
5083 : PyObject *py_buffer_1;
5084 0 : py_buffer_1 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_1]);
5085 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
5086 : }
5087 : }
5088 0 : PyTuple_SetItem(result, 0, py_buffer);
5089 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
5090 0 : PyTuple_SetItem(result, 1, py_needed);
5091 0 : if (!W_ERROR_IS_OK(r->out.result)) {
5092 0 : PyErr_SetWERROR(r->out.result);
5093 0 : return NULL;
5094 : }
5095 :
5096 0 : return result;
5097 : }
5098 :
5099 :
5100 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_handle(PyObject *obj, void *closure)
5101 : {
5102 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
5103 : PyObject *py_handle;
5104 0 : if (object->in.handle == NULL) {
5105 0 : Py_RETURN_NONE;
5106 : }
5107 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
5108 0 : return py_handle;
5109 : }
5110 :
5111 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
5112 : {
5113 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5114 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
5115 0 : if (value == NULL) {
5116 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
5117 0 : return -1;
5118 : }
5119 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
5120 0 : if (object->in.handle == NULL) {
5121 0 : PyErr_NoMemory();
5122 0 : return -1;
5123 : }
5124 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
5125 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5126 0 : PyErr_NoMemory();
5127 0 : return -1;
5128 : }
5129 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
5130 0 : return 0;
5131 : }
5132 :
5133 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_security_flags(PyObject *obj, void *closure)
5134 : {
5135 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
5136 : PyObject *py_security_flags;
5137 0 : py_security_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.security_flags);
5138 0 : return py_security_flags;
5139 : }
5140 :
5141 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_security_flags(PyObject *py_obj, PyObject *value, void *closure)
5142 : {
5143 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5144 0 : if (value == NULL) {
5145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.security_flags");
5146 0 : return -1;
5147 : }
5148 : {
5149 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.security_flags));
5150 0 : if (PyLong_Check(value)) {
5151 : unsigned long long test_var;
5152 0 : test_var = PyLong_AsUnsignedLongLong(value);
5153 0 : if (PyErr_Occurred() != NULL) {
5154 0 : return -1;
5155 : }
5156 0 : if (test_var > uint_max) {
5157 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5158 : PyLong_Type.tp_name, uint_max, test_var);
5159 0 : return -1;
5160 : }
5161 0 : object->in.security_flags = test_var;
5162 : } else {
5163 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5164 : PyLong_Type.tp_name);
5165 0 : return -1;
5166 : }
5167 : }
5168 0 : return 0;
5169 : }
5170 :
5171 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_buffer(PyObject *obj, void *closure)
5172 : {
5173 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
5174 : PyObject *py_buffer;
5175 0 : if (object->in.buffer == NULL) {
5176 0 : Py_RETURN_NONE;
5177 : }
5178 0 : py_buffer = PyList_New(object->in.offered);
5179 0 : if (py_buffer == NULL) {
5180 0 : return NULL;
5181 : }
5182 : {
5183 : int buffer_cntr_1;
5184 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
5185 : PyObject *py_buffer_1;
5186 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->in.buffer[buffer_cntr_1]);
5187 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
5188 : }
5189 : }
5190 0 : return py_buffer;
5191 : }
5192 :
5193 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
5194 : {
5195 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5196 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
5197 0 : if (value == NULL) {
5198 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer");
5199 0 : return -1;
5200 : }
5201 0 : object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
5202 0 : if (object->in.buffer == NULL) {
5203 0 : PyErr_NoMemory();
5204 0 : return -1;
5205 : }
5206 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5207 : {
5208 : int buffer_cntr_1;
5209 0 : object->in.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer, PyList_GET_SIZE(value));
5210 0 : if (!object->in.buffer) { return -1;; }
5211 0 : talloc_set_name_const(object->in.buffer, "ARRAY: object->in.buffer");
5212 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
5213 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
5214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer[buffer_cntr_1]");
5215 0 : return -1;
5216 : }
5217 : {
5218 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffer[buffer_cntr_1]));
5219 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
5220 : unsigned long long test_var;
5221 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
5222 0 : if (PyErr_Occurred() != NULL) {
5223 0 : return -1;
5224 : }
5225 0 : if (test_var > uint_max) {
5226 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5227 : PyLong_Type.tp_name, uint_max, test_var);
5228 0 : return -1;
5229 : }
5230 0 : object->in.buffer[buffer_cntr_1] = test_var;
5231 : } else {
5232 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5233 : PyLong_Type.tp_name);
5234 0 : return -1;
5235 : }
5236 : }
5237 : }
5238 : }
5239 0 : return 0;
5240 : }
5241 :
5242 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_in_get_offered(PyObject *obj, void *closure)
5243 : {
5244 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
5245 : PyObject *py_offered;
5246 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
5247 0 : return py_offered;
5248 : }
5249 :
5250 0 : static int py_svcctl_SetServiceObjectSecurity_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
5251 : {
5252 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5253 0 : if (value == NULL) {
5254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
5255 0 : return -1;
5256 : }
5257 : {
5258 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
5259 0 : if (PyLong_Check(value)) {
5260 : unsigned long long test_var;
5261 0 : test_var = PyLong_AsUnsignedLongLong(value);
5262 0 : if (PyErr_Occurred() != NULL) {
5263 0 : return -1;
5264 : }
5265 0 : if (test_var > uint_max) {
5266 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5267 : PyLong_Type.tp_name, uint_max, test_var);
5268 0 : return -1;
5269 : }
5270 0 : object->in.offered = test_var;
5271 : } else {
5272 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5273 : PyLong_Type.tp_name);
5274 0 : return -1;
5275 : }
5276 : }
5277 0 : return 0;
5278 : }
5279 :
5280 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_get_result(PyObject *obj, void *closure)
5281 : {
5282 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(obj);
5283 : PyObject *py_result;
5284 0 : py_result = PyErr_FromWERROR(object->out.result);
5285 0 : return py_result;
5286 : }
5287 :
5288 0 : static int py_svcctl_SetServiceObjectSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
5289 : {
5290 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5291 0 : if (value == NULL) {
5292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
5293 0 : return -1;
5294 : }
5295 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
5296 0 : return 0;
5297 : }
5298 :
5299 : static PyGetSetDef py_svcctl_SetServiceObjectSecurity_getsetters[] = {
5300 : {
5301 : .name = discard_const_p(char, "in_handle"),
5302 : .get = py_svcctl_SetServiceObjectSecurity_in_get_handle,
5303 : .set = py_svcctl_SetServiceObjectSecurity_in_set_handle,
5304 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
5305 : },
5306 : {
5307 : .name = discard_const_p(char, "in_security_flags"),
5308 : .get = py_svcctl_SetServiceObjectSecurity_in_get_security_flags,
5309 : .set = py_svcctl_SetServiceObjectSecurity_in_set_security_flags,
5310 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
5311 : },
5312 : {
5313 : .name = discard_const_p(char, "in_buffer"),
5314 : .get = py_svcctl_SetServiceObjectSecurity_in_get_buffer,
5315 : .set = py_svcctl_SetServiceObjectSecurity_in_set_buffer,
5316 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5317 : },
5318 : {
5319 : .name = discard_const_p(char, "in_offered"),
5320 : .get = py_svcctl_SetServiceObjectSecurity_in_get_offered,
5321 : .set = py_svcctl_SetServiceObjectSecurity_in_set_offered,
5322 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5323 : },
5324 : {
5325 : .name = discard_const_p(char, "result"),
5326 : .get = py_svcctl_SetServiceObjectSecurity_get_result,
5327 : .set = py_svcctl_SetServiceObjectSecurity_set_result,
5328 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
5329 : },
5330 : { .name = NULL }
5331 : };
5332 :
5333 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5334 : {
5335 0 : PyObject *self = pytalloc_new(struct svcctl_SetServiceObjectSecurity, type);
5336 0 : struct svcctl_SetServiceObjectSecurity *_self = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(self);
5337 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
5338 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
5339 0 : _self->in.buffer = talloc_zero(mem_ctx, uint8_t);
5340 0 : return self;
5341 : }
5342 :
5343 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5344 : {
5345 :
5346 :
5347 0 : return PyLong_FromLong(5);
5348 : }
5349 :
5350 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
5351 : {
5352 0 : const struct ndr_interface_call *call = NULL;
5353 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5354 0 : PyObject *ret = NULL;
5355 0 : struct ndr_push *push = NULL;
5356 : DATA_BLOB blob;
5357 : enum ndr_err_code err;
5358 :
5359 0 : if (ndr_table_svcctl.num_calls < 6) {
5360 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_pack");
5361 0 : return NULL;
5362 : }
5363 0 : call = &ndr_table_svcctl.calls[5];
5364 :
5365 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5366 0 : if (push == NULL) {
5367 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5368 0 : return NULL;
5369 : }
5370 :
5371 0 : push->flags |= ndr_push_flags;
5372 :
5373 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5374 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5375 0 : TALLOC_FREE(push);
5376 0 : PyErr_SetNdrError(err);
5377 0 : return NULL;
5378 : }
5379 0 : blob = ndr_push_blob(push);
5380 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5381 0 : TALLOC_FREE(push);
5382 0 : return ret;
5383 : }
5384 :
5385 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5386 : {
5387 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5388 0 : PyObject *bigendian_obj = NULL;
5389 0 : PyObject *ndr64_obj = NULL;
5390 0 : uint32_t ndr_push_flags = 0;
5391 :
5392 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5393 : discard_const_p(char *, kwnames),
5394 : &bigendian_obj,
5395 : &ndr64_obj)) {
5396 0 : return NULL;
5397 : }
5398 :
5399 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5400 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5401 : }
5402 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5403 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5404 : }
5405 :
5406 0 : return py_svcctl_SetServiceObjectSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5407 : }
5408 :
5409 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5410 : {
5411 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5412 0 : PyObject *bigendian_obj = NULL;
5413 0 : PyObject *ndr64_obj = NULL;
5414 0 : uint32_t ndr_push_flags = 0;
5415 :
5416 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5417 : discard_const_p(char *, kwnames),
5418 : &bigendian_obj,
5419 : &ndr64_obj)) {
5420 0 : return NULL;
5421 : }
5422 :
5423 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5424 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5425 : }
5426 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5427 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5428 : }
5429 :
5430 0 : return py_svcctl_SetServiceObjectSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
5431 : }
5432 :
5433 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
5434 : {
5435 0 : const struct ndr_interface_call *call = NULL;
5436 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5437 0 : struct ndr_pull *pull = NULL;
5438 : enum ndr_err_code err;
5439 :
5440 0 : if (ndr_table_svcctl.num_calls < 6) {
5441 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_unpack");
5442 0 : return NULL;
5443 : }
5444 0 : call = &ndr_table_svcctl.calls[5];
5445 :
5446 0 : pull = ndr_pull_init_blob(blob, object);
5447 0 : if (pull == NULL) {
5448 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5449 0 : return NULL;
5450 : }
5451 :
5452 0 : pull->flags |= ndr_pull_flags;
5453 :
5454 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
5455 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5456 0 : TALLOC_FREE(pull);
5457 0 : PyErr_SetNdrError(err);
5458 0 : return NULL;
5459 : }
5460 0 : if (!allow_remaining) {
5461 : uint32_t highest_ofs;
5462 :
5463 0 : if (pull->offset > pull->relative_highest_offset) {
5464 0 : highest_ofs = pull->offset;
5465 : } else {
5466 0 : highest_ofs = pull->relative_highest_offset;
5467 : }
5468 0 : if (highest_ofs < pull->data_size) {
5469 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
5470 : "not all bytes consumed ofs[%u] size[%u]",
5471 : highest_ofs, pull->data_size);
5472 0 : TALLOC_FREE(pull);
5473 0 : PyErr_SetNdrError(err);
5474 0 : return NULL;
5475 : }
5476 : }
5477 :
5478 0 : TALLOC_FREE(pull);
5479 0 : Py_RETURN_NONE;
5480 : }
5481 :
5482 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5483 : {
5484 : DATA_BLOB blob;
5485 0 : Py_ssize_t blob_length = 0;
5486 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5487 0 : PyObject *bigendian_obj = NULL;
5488 0 : PyObject *ndr64_obj = NULL;
5489 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5490 0 : PyObject *allow_remaining_obj = NULL;
5491 0 : bool allow_remaining = false;
5492 :
5493 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
5494 : discard_const_p(char *, kwnames),
5495 : &blob.data, &blob_length,
5496 : &bigendian_obj,
5497 : &ndr64_obj,
5498 : &allow_remaining_obj)) {
5499 0 : return NULL;
5500 : }
5501 0 : blob.length = blob_length;
5502 :
5503 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5504 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5505 : }
5506 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5507 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5508 : }
5509 :
5510 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5511 0 : allow_remaining = true;
5512 : }
5513 :
5514 0 : return py_svcctl_SetServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
5515 : }
5516 :
5517 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5518 : {
5519 : DATA_BLOB blob;
5520 0 : Py_ssize_t blob_length = 0;
5521 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5522 0 : PyObject *bigendian_obj = NULL;
5523 0 : PyObject *ndr64_obj = NULL;
5524 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5525 0 : PyObject *allow_remaining_obj = NULL;
5526 0 : bool allow_remaining = false;
5527 :
5528 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
5529 : discard_const_p(char *, kwnames),
5530 : &blob.data, &blob_length,
5531 : &bigendian_obj,
5532 : &ndr64_obj,
5533 : &allow_remaining_obj)) {
5534 0 : return NULL;
5535 : }
5536 0 : blob.length = blob_length;
5537 :
5538 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5539 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5540 : }
5541 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5542 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5543 : }
5544 :
5545 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5546 0 : allow_remaining = true;
5547 : }
5548 :
5549 0 : return py_svcctl_SetServiceObjectSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
5550 : }
5551 :
5552 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
5553 : {
5554 0 : const struct ndr_interface_call *call = NULL;
5555 0 : struct svcctl_SetServiceObjectSecurity *object = (struct svcctl_SetServiceObjectSecurity *)pytalloc_get_ptr(py_obj);
5556 : PyObject *ret;
5557 : char *retstr;
5558 :
5559 0 : if (ndr_table_svcctl.num_calls < 6) {
5560 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SetServiceObjectSecurity_ndr_print");
5561 0 : return NULL;
5562 : }
5563 0 : call = &ndr_table_svcctl.calls[5];
5564 :
5565 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
5566 0 : ret = PyUnicode_FromString(retstr);
5567 0 : TALLOC_FREE(retstr);
5568 :
5569 0 : return ret;
5570 : }
5571 :
5572 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5573 : {
5574 0 : return py_svcctl_SetServiceObjectSecurity_ndr_print(py_obj, "svcctl_SetServiceObjectSecurity_in", NDR_IN);
5575 : }
5576 :
5577 0 : static PyObject *py_svcctl_SetServiceObjectSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5578 : {
5579 0 : return py_svcctl_SetServiceObjectSecurity_ndr_print(py_obj, "svcctl_SetServiceObjectSecurity_out", NDR_OUT);
5580 : }
5581 :
5582 : static PyMethodDef py_svcctl_SetServiceObjectSecurity_methods[] = {
5583 : { "opnum", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
5584 : "svcctl.SetServiceObjectSecurity.opnum() -> 5 (0x05) " },
5585 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5586 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5587 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5588 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5589 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5590 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5591 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SetServiceObjectSecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5592 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5593 : { "__ndr_print_in__", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5594 : { "__ndr_print_out__", (PyCFunction)py_svcctl_SetServiceObjectSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5595 : { NULL, NULL, 0, NULL }
5596 : };
5597 :
5598 :
5599 : static PyTypeObject svcctl_SetServiceObjectSecurity_Type = {
5600 : PyVarObject_HEAD_INIT(NULL, 0)
5601 : .tp_name = "svcctl.SetServiceObjectSecurity",
5602 : .tp_getset = py_svcctl_SetServiceObjectSecurity_getsetters,
5603 : .tp_methods = py_svcctl_SetServiceObjectSecurity_methods,
5604 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5605 : .tp_new = py_svcctl_SetServiceObjectSecurity_new,
5606 : };
5607 :
5608 0 : static bool pack_py_svcctl_SetServiceObjectSecurity_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SetServiceObjectSecurity *r)
5609 : {
5610 : PyObject *py_handle;
5611 : PyObject *py_security_flags;
5612 : PyObject *py_buffer;
5613 0 : const char *kwnames[] = {
5614 : "handle", "security_flags", "buffer", NULL
5615 : };
5616 :
5617 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_SetServiceObjectSecurity", discard_const_p(char *, kwnames), &py_handle, &py_security_flags, &py_buffer)) {
5618 0 : return false;
5619 : }
5620 :
5621 0 : if (py_handle == NULL) {
5622 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
5623 0 : return false;
5624 : }
5625 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
5626 0 : if (r->in.handle == NULL) {
5627 0 : PyErr_NoMemory();
5628 0 : return false;
5629 : }
5630 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
5631 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
5632 0 : PyErr_NoMemory();
5633 0 : return false;
5634 : }
5635 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
5636 0 : if (py_security_flags == NULL) {
5637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.security_flags");
5638 0 : return false;
5639 : }
5640 : {
5641 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.security_flags));
5642 0 : if (PyLong_Check(py_security_flags)) {
5643 : unsigned long long test_var;
5644 0 : test_var = PyLong_AsUnsignedLongLong(py_security_flags);
5645 0 : if (PyErr_Occurred() != NULL) {
5646 0 : return false;
5647 : }
5648 0 : if (test_var > uint_max) {
5649 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5650 : PyLong_Type.tp_name, uint_max, test_var);
5651 0 : return false;
5652 : }
5653 0 : r->in.security_flags = test_var;
5654 : } else {
5655 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5656 : PyLong_Type.tp_name);
5657 0 : return false;
5658 : }
5659 : }
5660 0 : if (py_buffer == NULL) {
5661 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffer");
5662 0 : return false;
5663 : }
5664 0 : r->in.buffer = talloc_ptrtype(r, r->in.buffer);
5665 0 : if (r->in.buffer == NULL) {
5666 0 : PyErr_NoMemory();
5667 0 : return false;
5668 : }
5669 0 : PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
5670 : {
5671 : int buffer_cntr_1;
5672 0 : r->in.buffer = talloc_array_ptrtype(r, r->in.buffer, PyList_GET_SIZE(py_buffer));
5673 0 : if (!r->in.buffer) { return false;; }
5674 0 : talloc_set_name_const(r->in.buffer, "ARRAY: r->in.buffer");
5675 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(py_buffer); buffer_cntr_1++) {
5676 0 : if (PyList_GET_ITEM(py_buffer, buffer_cntr_1) == NULL) {
5677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffer[buffer_cntr_1]");
5678 0 : return false;
5679 : }
5680 : {
5681 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buffer[buffer_cntr_1]));
5682 0 : if (PyLong_Check(PyList_GET_ITEM(py_buffer, buffer_cntr_1))) {
5683 : unsigned long long test_var;
5684 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_buffer, buffer_cntr_1));
5685 0 : if (PyErr_Occurred() != NULL) {
5686 0 : return false;
5687 : }
5688 0 : if (test_var > uint_max) {
5689 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5690 : PyLong_Type.tp_name, uint_max, test_var);
5691 0 : return false;
5692 : }
5693 0 : r->in.buffer[buffer_cntr_1] = test_var;
5694 : } else {
5695 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5696 : PyLong_Type.tp_name);
5697 0 : return false;
5698 : }
5699 : }
5700 : }
5701 : }
5702 0 : PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
5703 0 : r->in.offered = PyList_GET_SIZE(py_buffer);
5704 0 : return true;
5705 : }
5706 :
5707 0 : static PyObject *unpack_py_svcctl_SetServiceObjectSecurity_args_out(struct svcctl_SetServiceObjectSecurity *r)
5708 : {
5709 : PyObject *result;
5710 0 : result = Py_None;
5711 0 : Py_INCREF(result);
5712 0 : if (!W_ERROR_IS_OK(r->out.result)) {
5713 0 : PyErr_SetWERROR(r->out.result);
5714 0 : return NULL;
5715 : }
5716 :
5717 0 : return result;
5718 : }
5719 :
5720 :
5721 0 : static PyObject *py_svcctl_QueryServiceStatus_in_get_handle(PyObject *obj, void *closure)
5722 : {
5723 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
5724 : PyObject *py_handle;
5725 0 : if (object->in.handle == NULL) {
5726 0 : Py_RETURN_NONE;
5727 : }
5728 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
5729 0 : return py_handle;
5730 : }
5731 :
5732 0 : static int py_svcctl_QueryServiceStatus_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
5733 : {
5734 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
5735 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
5736 0 : if (value == NULL) {
5737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
5738 0 : return -1;
5739 : }
5740 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
5741 0 : if (object->in.handle == NULL) {
5742 0 : PyErr_NoMemory();
5743 0 : return -1;
5744 : }
5745 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
5746 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5747 0 : PyErr_NoMemory();
5748 0 : return -1;
5749 : }
5750 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
5751 0 : return 0;
5752 : }
5753 :
5754 0 : static PyObject *py_svcctl_QueryServiceStatus_out_get_service_status(PyObject *obj, void *closure)
5755 : {
5756 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
5757 : PyObject *py_service_status;
5758 0 : if (object->out.service_status == NULL) {
5759 0 : Py_RETURN_NONE;
5760 : }
5761 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, object->out.service_status, object->out.service_status);
5762 0 : return py_service_status;
5763 : }
5764 :
5765 0 : static int py_svcctl_QueryServiceStatus_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
5766 : {
5767 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
5768 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
5769 0 : if (value == NULL) {
5770 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
5771 0 : return -1;
5772 : }
5773 0 : object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
5774 0 : if (object->out.service_status == NULL) {
5775 0 : PyErr_NoMemory();
5776 0 : return -1;
5777 : }
5778 0 : PY_CHECK_TYPE(&SERVICE_STATUS_Type, value, return -1;);
5779 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5780 0 : PyErr_NoMemory();
5781 0 : return -1;
5782 : }
5783 0 : object->out.service_status = (struct SERVICE_STATUS *)pytalloc_get_ptr(value);
5784 0 : return 0;
5785 : }
5786 :
5787 0 : static PyObject *py_svcctl_QueryServiceStatus_get_result(PyObject *obj, void *closure)
5788 : {
5789 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(obj);
5790 : PyObject *py_result;
5791 0 : py_result = PyErr_FromWERROR(object->out.result);
5792 0 : return py_result;
5793 : }
5794 :
5795 0 : static int py_svcctl_QueryServiceStatus_set_result(PyObject *py_obj, PyObject *value, void *closure)
5796 : {
5797 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
5798 0 : if (value == NULL) {
5799 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
5800 0 : return -1;
5801 : }
5802 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
5803 0 : return 0;
5804 : }
5805 :
5806 : static PyGetSetDef py_svcctl_QueryServiceStatus_getsetters[] = {
5807 : {
5808 : .name = discard_const_p(char, "in_handle"),
5809 : .get = py_svcctl_QueryServiceStatus_in_get_handle,
5810 : .set = py_svcctl_QueryServiceStatus_in_set_handle,
5811 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
5812 : },
5813 : {
5814 : .name = discard_const_p(char, "out_service_status"),
5815 : .get = py_svcctl_QueryServiceStatus_out_get_service_status,
5816 : .set = py_svcctl_QueryServiceStatus_out_set_service_status,
5817 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_STATUS")
5818 : },
5819 : {
5820 : .name = discard_const_p(char, "result"),
5821 : .get = py_svcctl_QueryServiceStatus_get_result,
5822 : .set = py_svcctl_QueryServiceStatus_set_result,
5823 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
5824 : },
5825 : { .name = NULL }
5826 : };
5827 :
5828 0 : static PyObject *py_svcctl_QueryServiceStatus_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5829 : {
5830 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceStatus, type);
5831 0 : struct svcctl_QueryServiceStatus *_self = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(self);
5832 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
5833 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
5834 0 : _self->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
5835 0 : return self;
5836 : }
5837 :
5838 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5839 : {
5840 :
5841 :
5842 0 : return PyLong_FromLong(6);
5843 : }
5844 :
5845 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
5846 : {
5847 0 : const struct ndr_interface_call *call = NULL;
5848 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
5849 0 : PyObject *ret = NULL;
5850 0 : struct ndr_push *push = NULL;
5851 : DATA_BLOB blob;
5852 : enum ndr_err_code err;
5853 :
5854 0 : if (ndr_table_svcctl.num_calls < 7) {
5855 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_pack");
5856 0 : return NULL;
5857 : }
5858 0 : call = &ndr_table_svcctl.calls[6];
5859 :
5860 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5861 0 : if (push == NULL) {
5862 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5863 0 : return NULL;
5864 : }
5865 :
5866 0 : push->flags |= ndr_push_flags;
5867 :
5868 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5869 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5870 0 : TALLOC_FREE(push);
5871 0 : PyErr_SetNdrError(err);
5872 0 : return NULL;
5873 : }
5874 0 : blob = ndr_push_blob(push);
5875 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5876 0 : TALLOC_FREE(push);
5877 0 : return ret;
5878 : }
5879 :
5880 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5881 : {
5882 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5883 0 : PyObject *bigendian_obj = NULL;
5884 0 : PyObject *ndr64_obj = NULL;
5885 0 : uint32_t ndr_push_flags = 0;
5886 :
5887 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5888 : discard_const_p(char *, kwnames),
5889 : &bigendian_obj,
5890 : &ndr64_obj)) {
5891 0 : return NULL;
5892 : }
5893 :
5894 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5895 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5896 : }
5897 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5898 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5899 : }
5900 :
5901 0 : return py_svcctl_QueryServiceStatus_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5902 : }
5903 :
5904 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5905 : {
5906 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5907 0 : PyObject *bigendian_obj = NULL;
5908 0 : PyObject *ndr64_obj = NULL;
5909 0 : uint32_t ndr_push_flags = 0;
5910 :
5911 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5912 : discard_const_p(char *, kwnames),
5913 : &bigendian_obj,
5914 : &ndr64_obj)) {
5915 0 : return NULL;
5916 : }
5917 :
5918 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5919 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5920 : }
5921 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5922 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5923 : }
5924 :
5925 0 : return py_svcctl_QueryServiceStatus_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
5926 : }
5927 :
5928 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
5929 : {
5930 0 : const struct ndr_interface_call *call = NULL;
5931 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
5932 0 : struct ndr_pull *pull = NULL;
5933 : enum ndr_err_code err;
5934 :
5935 0 : if (ndr_table_svcctl.num_calls < 7) {
5936 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_unpack");
5937 0 : return NULL;
5938 : }
5939 0 : call = &ndr_table_svcctl.calls[6];
5940 :
5941 0 : pull = ndr_pull_init_blob(blob, object);
5942 0 : if (pull == NULL) {
5943 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5944 0 : return NULL;
5945 : }
5946 :
5947 0 : pull->flags |= ndr_pull_flags;
5948 :
5949 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
5950 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5951 0 : TALLOC_FREE(pull);
5952 0 : PyErr_SetNdrError(err);
5953 0 : return NULL;
5954 : }
5955 0 : if (!allow_remaining) {
5956 : uint32_t highest_ofs;
5957 :
5958 0 : if (pull->offset > pull->relative_highest_offset) {
5959 0 : highest_ofs = pull->offset;
5960 : } else {
5961 0 : highest_ofs = pull->relative_highest_offset;
5962 : }
5963 0 : if (highest_ofs < pull->data_size) {
5964 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
5965 : "not all bytes consumed ofs[%u] size[%u]",
5966 : highest_ofs, pull->data_size);
5967 0 : TALLOC_FREE(pull);
5968 0 : PyErr_SetNdrError(err);
5969 0 : return NULL;
5970 : }
5971 : }
5972 :
5973 0 : TALLOC_FREE(pull);
5974 0 : Py_RETURN_NONE;
5975 : }
5976 :
5977 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5978 : {
5979 : DATA_BLOB blob;
5980 0 : Py_ssize_t blob_length = 0;
5981 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5982 0 : PyObject *bigendian_obj = NULL;
5983 0 : PyObject *ndr64_obj = NULL;
5984 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5985 0 : PyObject *allow_remaining_obj = NULL;
5986 0 : bool allow_remaining = false;
5987 :
5988 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
5989 : discard_const_p(char *, kwnames),
5990 : &blob.data, &blob_length,
5991 : &bigendian_obj,
5992 : &ndr64_obj,
5993 : &allow_remaining_obj)) {
5994 0 : return NULL;
5995 : }
5996 0 : blob.length = blob_length;
5997 :
5998 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5999 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6000 : }
6001 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6002 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6003 : }
6004 :
6005 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6006 0 : allow_remaining = true;
6007 : }
6008 :
6009 0 : return py_svcctl_QueryServiceStatus_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6010 : }
6011 :
6012 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6013 : {
6014 : DATA_BLOB blob;
6015 0 : Py_ssize_t blob_length = 0;
6016 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6017 0 : PyObject *bigendian_obj = NULL;
6018 0 : PyObject *ndr64_obj = NULL;
6019 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6020 0 : PyObject *allow_remaining_obj = NULL;
6021 0 : bool allow_remaining = false;
6022 :
6023 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6024 : discard_const_p(char *, kwnames),
6025 : &blob.data, &blob_length,
6026 : &bigendian_obj,
6027 : &ndr64_obj,
6028 : &allow_remaining_obj)) {
6029 0 : return NULL;
6030 : }
6031 0 : blob.length = blob_length;
6032 :
6033 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6034 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6035 : }
6036 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6037 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6038 : }
6039 :
6040 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6041 0 : allow_remaining = true;
6042 : }
6043 :
6044 0 : return py_svcctl_QueryServiceStatus_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6045 : }
6046 :
6047 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
6048 : {
6049 0 : const struct ndr_interface_call *call = NULL;
6050 0 : struct svcctl_QueryServiceStatus *object = (struct svcctl_QueryServiceStatus *)pytalloc_get_ptr(py_obj);
6051 : PyObject *ret;
6052 : char *retstr;
6053 :
6054 0 : if (ndr_table_svcctl.num_calls < 7) {
6055 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatus_ndr_print");
6056 0 : return NULL;
6057 : }
6058 0 : call = &ndr_table_svcctl.calls[6];
6059 :
6060 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6061 0 : ret = PyUnicode_FromString(retstr);
6062 0 : TALLOC_FREE(retstr);
6063 :
6064 0 : return ret;
6065 : }
6066 :
6067 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6068 : {
6069 0 : return py_svcctl_QueryServiceStatus_ndr_print(py_obj, "svcctl_QueryServiceStatus_in", NDR_IN);
6070 : }
6071 :
6072 0 : static PyObject *py_svcctl_QueryServiceStatus_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6073 : {
6074 0 : return py_svcctl_QueryServiceStatus_ndr_print(py_obj, "svcctl_QueryServiceStatus_out", NDR_OUT);
6075 : }
6076 :
6077 : static PyMethodDef py_svcctl_QueryServiceStatus_methods[] = {
6078 : { "opnum", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_opnum, METH_NOARGS|METH_CLASS,
6079 : "svcctl.QueryServiceStatus.opnum() -> 6 (0x06) " },
6080 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6081 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6082 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6083 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6084 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6085 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6086 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatus_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6087 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6088 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6089 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceStatus_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6090 : { NULL, NULL, 0, NULL }
6091 : };
6092 :
6093 :
6094 : static PyTypeObject svcctl_QueryServiceStatus_Type = {
6095 : PyVarObject_HEAD_INIT(NULL, 0)
6096 : .tp_name = "svcctl.QueryServiceStatus",
6097 : .tp_getset = py_svcctl_QueryServiceStatus_getsetters,
6098 : .tp_methods = py_svcctl_QueryServiceStatus_methods,
6099 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6100 : .tp_new = py_svcctl_QueryServiceStatus_new,
6101 : };
6102 :
6103 0 : static bool pack_py_svcctl_QueryServiceStatus_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceStatus *r)
6104 : {
6105 : PyObject *py_handle;
6106 0 : const char *kwnames[] = {
6107 : "handle", NULL
6108 : };
6109 :
6110 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_QueryServiceStatus", discard_const_p(char *, kwnames), &py_handle)) {
6111 0 : return false;
6112 : }
6113 :
6114 0 : if (py_handle == NULL) {
6115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
6116 0 : return false;
6117 : }
6118 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
6119 0 : if (r->in.handle == NULL) {
6120 0 : PyErr_NoMemory();
6121 0 : return false;
6122 : }
6123 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
6124 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
6125 0 : PyErr_NoMemory();
6126 0 : return false;
6127 : }
6128 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
6129 0 : return true;
6130 : }
6131 :
6132 0 : static PyObject *unpack_py_svcctl_QueryServiceStatus_args_out(struct svcctl_QueryServiceStatus *r)
6133 : {
6134 : PyObject *result;
6135 : PyObject *py_service_status;
6136 0 : py_service_status = pytalloc_reference_ex(&SERVICE_STATUS_Type, r->out.service_status, r->out.service_status);
6137 0 : result = py_service_status;
6138 0 : if (!W_ERROR_IS_OK(r->out.result)) {
6139 0 : PyErr_SetWERROR(r->out.result);
6140 0 : return NULL;
6141 : }
6142 :
6143 0 : return result;
6144 : }
6145 :
6146 :
6147 0 : static PyObject *py_svcctl_UnlockServiceDatabase_in_get_lock(PyObject *obj, void *closure)
6148 : {
6149 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
6150 : PyObject *py_lock;
6151 0 : if (object->in.lock == NULL) {
6152 0 : Py_RETURN_NONE;
6153 : }
6154 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, object->in.lock, object->in.lock);
6155 0 : return py_lock;
6156 : }
6157 :
6158 0 : static int py_svcctl_UnlockServiceDatabase_in_set_lock(PyObject *py_obj, PyObject *value, void *closure)
6159 : {
6160 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
6161 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lock));
6162 0 : if (value == NULL) {
6163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lock");
6164 0 : return -1;
6165 : }
6166 0 : object->in.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.lock);
6167 0 : if (object->in.lock == NULL) {
6168 0 : PyErr_NoMemory();
6169 0 : return -1;
6170 : }
6171 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
6172 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6173 0 : PyErr_NoMemory();
6174 0 : return -1;
6175 : }
6176 0 : object->in.lock = (struct policy_handle *)pytalloc_get_ptr(value);
6177 0 : return 0;
6178 : }
6179 :
6180 0 : static PyObject *py_svcctl_UnlockServiceDatabase_out_get_lock(PyObject *obj, void *closure)
6181 : {
6182 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
6183 : PyObject *py_lock;
6184 0 : if (object->out.lock == NULL) {
6185 0 : Py_RETURN_NONE;
6186 : }
6187 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, object->out.lock, object->out.lock);
6188 0 : return py_lock;
6189 : }
6190 :
6191 0 : static int py_svcctl_UnlockServiceDatabase_out_set_lock(PyObject *py_obj, PyObject *value, void *closure)
6192 : {
6193 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
6194 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock));
6195 0 : if (value == NULL) {
6196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock");
6197 0 : return -1;
6198 : }
6199 0 : object->out.lock = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock);
6200 0 : if (object->out.lock == NULL) {
6201 0 : PyErr_NoMemory();
6202 0 : return -1;
6203 : }
6204 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
6205 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6206 0 : PyErr_NoMemory();
6207 0 : return -1;
6208 : }
6209 0 : object->out.lock = (struct policy_handle *)pytalloc_get_ptr(value);
6210 0 : return 0;
6211 : }
6212 :
6213 0 : static PyObject *py_svcctl_UnlockServiceDatabase_get_result(PyObject *obj, void *closure)
6214 : {
6215 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(obj);
6216 : PyObject *py_result;
6217 0 : py_result = PyErr_FromWERROR(object->out.result);
6218 0 : return py_result;
6219 : }
6220 :
6221 0 : static int py_svcctl_UnlockServiceDatabase_set_result(PyObject *py_obj, PyObject *value, void *closure)
6222 : {
6223 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
6224 0 : if (value == NULL) {
6225 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
6226 0 : return -1;
6227 : }
6228 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
6229 0 : return 0;
6230 : }
6231 :
6232 : static PyGetSetDef py_svcctl_UnlockServiceDatabase_getsetters[] = {
6233 : {
6234 : .name = discard_const_p(char, "in_lock"),
6235 : .get = py_svcctl_UnlockServiceDatabase_in_get_lock,
6236 : .set = py_svcctl_UnlockServiceDatabase_in_set_lock,
6237 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
6238 : },
6239 : {
6240 : .name = discard_const_p(char, "out_lock"),
6241 : .get = py_svcctl_UnlockServiceDatabase_out_get_lock,
6242 : .set = py_svcctl_UnlockServiceDatabase_out_set_lock,
6243 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
6244 : },
6245 : {
6246 : .name = discard_const_p(char, "result"),
6247 : .get = py_svcctl_UnlockServiceDatabase_get_result,
6248 : .set = py_svcctl_UnlockServiceDatabase_set_result,
6249 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
6250 : },
6251 : { .name = NULL }
6252 : };
6253 :
6254 0 : static PyObject *py_svcctl_UnlockServiceDatabase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6255 : {
6256 0 : PyObject *self = pytalloc_new(struct svcctl_UnlockServiceDatabase, type);
6257 0 : struct svcctl_UnlockServiceDatabase *_self = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(self);
6258 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
6259 0 : _self->in.lock = talloc_zero(mem_ctx, struct policy_handle);
6260 0 : _self->out.lock = talloc_zero(mem_ctx, struct policy_handle);
6261 0 : return self;
6262 : }
6263 :
6264 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6265 : {
6266 :
6267 :
6268 0 : return PyLong_FromLong(8);
6269 : }
6270 :
6271 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
6272 : {
6273 0 : const struct ndr_interface_call *call = NULL;
6274 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
6275 0 : PyObject *ret = NULL;
6276 0 : struct ndr_push *push = NULL;
6277 : DATA_BLOB blob;
6278 : enum ndr_err_code err;
6279 :
6280 0 : if (ndr_table_svcctl.num_calls < 9) {
6281 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_pack");
6282 0 : return NULL;
6283 : }
6284 0 : call = &ndr_table_svcctl.calls[8];
6285 :
6286 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6287 0 : if (push == NULL) {
6288 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6289 0 : return NULL;
6290 : }
6291 :
6292 0 : push->flags |= ndr_push_flags;
6293 :
6294 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6295 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6296 0 : TALLOC_FREE(push);
6297 0 : PyErr_SetNdrError(err);
6298 0 : return NULL;
6299 : }
6300 0 : blob = ndr_push_blob(push);
6301 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6302 0 : TALLOC_FREE(push);
6303 0 : return ret;
6304 : }
6305 :
6306 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6307 : {
6308 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6309 0 : PyObject *bigendian_obj = NULL;
6310 0 : PyObject *ndr64_obj = NULL;
6311 0 : uint32_t ndr_push_flags = 0;
6312 :
6313 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6314 : discard_const_p(char *, kwnames),
6315 : &bigendian_obj,
6316 : &ndr64_obj)) {
6317 0 : return NULL;
6318 : }
6319 :
6320 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6321 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6322 : }
6323 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6324 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6325 : }
6326 :
6327 0 : return py_svcctl_UnlockServiceDatabase_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6328 : }
6329 :
6330 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6331 : {
6332 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6333 0 : PyObject *bigendian_obj = NULL;
6334 0 : PyObject *ndr64_obj = NULL;
6335 0 : uint32_t ndr_push_flags = 0;
6336 :
6337 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6338 : discard_const_p(char *, kwnames),
6339 : &bigendian_obj,
6340 : &ndr64_obj)) {
6341 0 : return NULL;
6342 : }
6343 :
6344 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6345 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6346 : }
6347 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6348 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6349 : }
6350 :
6351 0 : return py_svcctl_UnlockServiceDatabase_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6352 : }
6353 :
6354 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
6355 : {
6356 0 : const struct ndr_interface_call *call = NULL;
6357 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
6358 0 : struct ndr_pull *pull = NULL;
6359 : enum ndr_err_code err;
6360 :
6361 0 : if (ndr_table_svcctl.num_calls < 9) {
6362 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_unpack");
6363 0 : return NULL;
6364 : }
6365 0 : call = &ndr_table_svcctl.calls[8];
6366 :
6367 0 : pull = ndr_pull_init_blob(blob, object);
6368 0 : if (pull == NULL) {
6369 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6370 0 : return NULL;
6371 : }
6372 :
6373 0 : pull->flags |= ndr_pull_flags;
6374 :
6375 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6376 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6377 0 : TALLOC_FREE(pull);
6378 0 : PyErr_SetNdrError(err);
6379 0 : return NULL;
6380 : }
6381 0 : if (!allow_remaining) {
6382 : uint32_t highest_ofs;
6383 :
6384 0 : if (pull->offset > pull->relative_highest_offset) {
6385 0 : highest_ofs = pull->offset;
6386 : } else {
6387 0 : highest_ofs = pull->relative_highest_offset;
6388 : }
6389 0 : if (highest_ofs < pull->data_size) {
6390 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6391 : "not all bytes consumed ofs[%u] size[%u]",
6392 : highest_ofs, pull->data_size);
6393 0 : TALLOC_FREE(pull);
6394 0 : PyErr_SetNdrError(err);
6395 0 : return NULL;
6396 : }
6397 : }
6398 :
6399 0 : TALLOC_FREE(pull);
6400 0 : Py_RETURN_NONE;
6401 : }
6402 :
6403 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6404 : {
6405 : DATA_BLOB blob;
6406 0 : Py_ssize_t blob_length = 0;
6407 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6408 0 : PyObject *bigendian_obj = NULL;
6409 0 : PyObject *ndr64_obj = NULL;
6410 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6411 0 : PyObject *allow_remaining_obj = NULL;
6412 0 : bool allow_remaining = false;
6413 :
6414 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6415 : discard_const_p(char *, kwnames),
6416 : &blob.data, &blob_length,
6417 : &bigendian_obj,
6418 : &ndr64_obj,
6419 : &allow_remaining_obj)) {
6420 0 : return NULL;
6421 : }
6422 0 : blob.length = blob_length;
6423 :
6424 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6425 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6426 : }
6427 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6428 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6429 : }
6430 :
6431 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6432 0 : allow_remaining = true;
6433 : }
6434 :
6435 0 : return py_svcctl_UnlockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6436 : }
6437 :
6438 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6439 : {
6440 : DATA_BLOB blob;
6441 0 : Py_ssize_t blob_length = 0;
6442 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6443 0 : PyObject *bigendian_obj = NULL;
6444 0 : PyObject *ndr64_obj = NULL;
6445 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6446 0 : PyObject *allow_remaining_obj = NULL;
6447 0 : bool allow_remaining = false;
6448 :
6449 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6450 : discard_const_p(char *, kwnames),
6451 : &blob.data, &blob_length,
6452 : &bigendian_obj,
6453 : &ndr64_obj,
6454 : &allow_remaining_obj)) {
6455 0 : return NULL;
6456 : }
6457 0 : blob.length = blob_length;
6458 :
6459 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6460 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6461 : }
6462 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6463 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6464 : }
6465 :
6466 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6467 0 : allow_remaining = true;
6468 : }
6469 :
6470 0 : return py_svcctl_UnlockServiceDatabase_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6471 : }
6472 :
6473 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
6474 : {
6475 0 : const struct ndr_interface_call *call = NULL;
6476 0 : struct svcctl_UnlockServiceDatabase *object = (struct svcctl_UnlockServiceDatabase *)pytalloc_get_ptr(py_obj);
6477 : PyObject *ret;
6478 : char *retstr;
6479 :
6480 0 : if (ndr_table_svcctl.num_calls < 9) {
6481 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_UnlockServiceDatabase_ndr_print");
6482 0 : return NULL;
6483 : }
6484 0 : call = &ndr_table_svcctl.calls[8];
6485 :
6486 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6487 0 : ret = PyUnicode_FromString(retstr);
6488 0 : TALLOC_FREE(retstr);
6489 :
6490 0 : return ret;
6491 : }
6492 :
6493 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6494 : {
6495 0 : return py_svcctl_UnlockServiceDatabase_ndr_print(py_obj, "svcctl_UnlockServiceDatabase_in", NDR_IN);
6496 : }
6497 :
6498 0 : static PyObject *py_svcctl_UnlockServiceDatabase_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6499 : {
6500 0 : return py_svcctl_UnlockServiceDatabase_ndr_print(py_obj, "svcctl_UnlockServiceDatabase_out", NDR_OUT);
6501 : }
6502 :
6503 : static PyMethodDef py_svcctl_UnlockServiceDatabase_methods[] = {
6504 : { "opnum", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_opnum, METH_NOARGS|METH_CLASS,
6505 : "svcctl.UnlockServiceDatabase.opnum() -> 8 (0x08) " },
6506 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6507 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6508 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6509 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6510 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6511 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6512 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_UnlockServiceDatabase_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6513 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6514 : { "__ndr_print_in__", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6515 : { "__ndr_print_out__", (PyCFunction)py_svcctl_UnlockServiceDatabase_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6516 : { NULL, NULL, 0, NULL }
6517 : };
6518 :
6519 :
6520 : static PyTypeObject svcctl_UnlockServiceDatabase_Type = {
6521 : PyVarObject_HEAD_INIT(NULL, 0)
6522 : .tp_name = "svcctl.UnlockServiceDatabase",
6523 : .tp_getset = py_svcctl_UnlockServiceDatabase_getsetters,
6524 : .tp_methods = py_svcctl_UnlockServiceDatabase_methods,
6525 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6526 : .tp_new = py_svcctl_UnlockServiceDatabase_new,
6527 : };
6528 :
6529 0 : static bool pack_py_svcctl_UnlockServiceDatabase_args_in(PyObject *args, PyObject *kwargs, struct svcctl_UnlockServiceDatabase *r)
6530 : {
6531 : PyObject *py_lock;
6532 0 : const char *kwnames[] = {
6533 : "lock", NULL
6534 : };
6535 :
6536 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:svcctl_UnlockServiceDatabase", discard_const_p(char *, kwnames), &py_lock)) {
6537 0 : return false;
6538 : }
6539 :
6540 0 : if (py_lock == NULL) {
6541 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lock");
6542 0 : return false;
6543 : }
6544 0 : r->in.lock = talloc_ptrtype(r, r->in.lock);
6545 0 : if (r->in.lock == NULL) {
6546 0 : PyErr_NoMemory();
6547 0 : return false;
6548 : }
6549 0 : PY_CHECK_TYPE(policy_handle_Type, py_lock, return false;);
6550 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_lock)) == NULL) {
6551 0 : PyErr_NoMemory();
6552 0 : return false;
6553 : }
6554 0 : r->in.lock = (struct policy_handle *)pytalloc_get_ptr(py_lock);
6555 0 : return true;
6556 : }
6557 :
6558 0 : static PyObject *unpack_py_svcctl_UnlockServiceDatabase_args_out(struct svcctl_UnlockServiceDatabase *r)
6559 : {
6560 : PyObject *result;
6561 : PyObject *py_lock;
6562 0 : py_lock = pytalloc_reference_ex(policy_handle_Type, r->out.lock, r->out.lock);
6563 0 : result = py_lock;
6564 0 : if (!W_ERROR_IS_OK(r->out.result)) {
6565 0 : PyErr_SetWERROR(r->out.result);
6566 0 : return NULL;
6567 : }
6568 :
6569 0 : return result;
6570 : }
6571 :
6572 :
6573 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_handle(PyObject *obj, void *closure)
6574 : {
6575 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
6576 : PyObject *py_handle;
6577 0 : if (object->in.handle == NULL) {
6578 0 : Py_RETURN_NONE;
6579 : }
6580 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
6581 0 : return py_handle;
6582 : }
6583 :
6584 0 : static int py_svcctl_SCSetServiceBitsW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
6585 : {
6586 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6587 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
6588 0 : if (value == NULL) {
6589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
6590 0 : return -1;
6591 : }
6592 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
6593 0 : if (object->in.handle == NULL) {
6594 0 : PyErr_NoMemory();
6595 0 : return -1;
6596 : }
6597 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
6598 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6599 0 : PyErr_NoMemory();
6600 0 : return -1;
6601 : }
6602 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
6603 0 : return 0;
6604 : }
6605 :
6606 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_bits(PyObject *obj, void *closure)
6607 : {
6608 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
6609 : PyObject *py_bits;
6610 0 : py_bits = PyLong_FromUnsignedLongLong((uint32_t)object->in.bits);
6611 0 : return py_bits;
6612 : }
6613 :
6614 0 : static int py_svcctl_SCSetServiceBitsW_in_set_bits(PyObject *py_obj, PyObject *value, void *closure)
6615 : {
6616 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6617 0 : if (value == NULL) {
6618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bits");
6619 0 : return -1;
6620 : }
6621 : {
6622 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bits));
6623 0 : if (PyLong_Check(value)) {
6624 : unsigned long long test_var;
6625 0 : test_var = PyLong_AsUnsignedLongLong(value);
6626 0 : if (PyErr_Occurred() != NULL) {
6627 0 : return -1;
6628 : }
6629 0 : if (test_var > uint_max) {
6630 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6631 : PyLong_Type.tp_name, uint_max, test_var);
6632 0 : return -1;
6633 : }
6634 0 : object->in.bits = test_var;
6635 : } else {
6636 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6637 : PyLong_Type.tp_name);
6638 0 : return -1;
6639 : }
6640 : }
6641 0 : return 0;
6642 : }
6643 :
6644 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_bitson(PyObject *obj, void *closure)
6645 : {
6646 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
6647 : PyObject *py_bitson;
6648 0 : py_bitson = PyLong_FromUnsignedLongLong((uint32_t)object->in.bitson);
6649 0 : return py_bitson;
6650 : }
6651 :
6652 0 : static int py_svcctl_SCSetServiceBitsW_in_set_bitson(PyObject *py_obj, PyObject *value, void *closure)
6653 : {
6654 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6655 0 : if (value == NULL) {
6656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bitson");
6657 0 : return -1;
6658 : }
6659 : {
6660 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bitson));
6661 0 : if (PyLong_Check(value)) {
6662 : unsigned long long test_var;
6663 0 : test_var = PyLong_AsUnsignedLongLong(value);
6664 0 : if (PyErr_Occurred() != NULL) {
6665 0 : return -1;
6666 : }
6667 0 : if (test_var > uint_max) {
6668 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6669 : PyLong_Type.tp_name, uint_max, test_var);
6670 0 : return -1;
6671 : }
6672 0 : object->in.bitson = test_var;
6673 : } else {
6674 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6675 : PyLong_Type.tp_name);
6676 0 : return -1;
6677 : }
6678 : }
6679 0 : return 0;
6680 : }
6681 :
6682 0 : static PyObject *py_svcctl_SCSetServiceBitsW_in_get_immediate(PyObject *obj, void *closure)
6683 : {
6684 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
6685 : PyObject *py_immediate;
6686 0 : py_immediate = PyLong_FromUnsignedLongLong((uint32_t)object->in.immediate);
6687 0 : return py_immediate;
6688 : }
6689 :
6690 0 : static int py_svcctl_SCSetServiceBitsW_in_set_immediate(PyObject *py_obj, PyObject *value, void *closure)
6691 : {
6692 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6693 0 : if (value == NULL) {
6694 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.immediate");
6695 0 : return -1;
6696 : }
6697 : {
6698 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.immediate));
6699 0 : if (PyLong_Check(value)) {
6700 : unsigned long long test_var;
6701 0 : test_var = PyLong_AsUnsignedLongLong(value);
6702 0 : if (PyErr_Occurred() != NULL) {
6703 0 : return -1;
6704 : }
6705 0 : if (test_var > uint_max) {
6706 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6707 : PyLong_Type.tp_name, uint_max, test_var);
6708 0 : return -1;
6709 : }
6710 0 : object->in.immediate = test_var;
6711 : } else {
6712 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6713 : PyLong_Type.tp_name);
6714 0 : return -1;
6715 : }
6716 : }
6717 0 : return 0;
6718 : }
6719 :
6720 0 : static PyObject *py_svcctl_SCSetServiceBitsW_get_result(PyObject *obj, void *closure)
6721 : {
6722 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(obj);
6723 : PyObject *py_result;
6724 0 : py_result = PyErr_FromWERROR(object->out.result);
6725 0 : return py_result;
6726 : }
6727 :
6728 0 : static int py_svcctl_SCSetServiceBitsW_set_result(PyObject *py_obj, PyObject *value, void *closure)
6729 : {
6730 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6731 0 : if (value == NULL) {
6732 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
6733 0 : return -1;
6734 : }
6735 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
6736 0 : return 0;
6737 : }
6738 :
6739 : static PyGetSetDef py_svcctl_SCSetServiceBitsW_getsetters[] = {
6740 : {
6741 : .name = discard_const_p(char, "in_handle"),
6742 : .get = py_svcctl_SCSetServiceBitsW_in_get_handle,
6743 : .set = py_svcctl_SCSetServiceBitsW_in_set_handle,
6744 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
6745 : },
6746 : {
6747 : .name = discard_const_p(char, "in_bits"),
6748 : .get = py_svcctl_SCSetServiceBitsW_in_get_bits,
6749 : .set = py_svcctl_SCSetServiceBitsW_in_set_bits,
6750 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6751 : },
6752 : {
6753 : .name = discard_const_p(char, "in_bitson"),
6754 : .get = py_svcctl_SCSetServiceBitsW_in_get_bitson,
6755 : .set = py_svcctl_SCSetServiceBitsW_in_set_bitson,
6756 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6757 : },
6758 : {
6759 : .name = discard_const_p(char, "in_immediate"),
6760 : .get = py_svcctl_SCSetServiceBitsW_in_get_immediate,
6761 : .set = py_svcctl_SCSetServiceBitsW_in_set_immediate,
6762 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6763 : },
6764 : {
6765 : .name = discard_const_p(char, "result"),
6766 : .get = py_svcctl_SCSetServiceBitsW_get_result,
6767 : .set = py_svcctl_SCSetServiceBitsW_set_result,
6768 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
6769 : },
6770 : { .name = NULL }
6771 : };
6772 :
6773 0 : static PyObject *py_svcctl_SCSetServiceBitsW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6774 : {
6775 0 : PyObject *self = pytalloc_new(struct svcctl_SCSetServiceBitsW, type);
6776 0 : struct svcctl_SCSetServiceBitsW *_self = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(self);
6777 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
6778 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
6779 0 : return self;
6780 : }
6781 :
6782 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6783 : {
6784 :
6785 :
6786 0 : return PyLong_FromLong(10);
6787 : }
6788 :
6789 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
6790 : {
6791 0 : const struct ndr_interface_call *call = NULL;
6792 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6793 0 : PyObject *ret = NULL;
6794 0 : struct ndr_push *push = NULL;
6795 : DATA_BLOB blob;
6796 : enum ndr_err_code err;
6797 :
6798 0 : if (ndr_table_svcctl.num_calls < 11) {
6799 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_pack");
6800 0 : return NULL;
6801 : }
6802 0 : call = &ndr_table_svcctl.calls[10];
6803 :
6804 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6805 0 : if (push == NULL) {
6806 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6807 0 : return NULL;
6808 : }
6809 :
6810 0 : push->flags |= ndr_push_flags;
6811 :
6812 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6813 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6814 0 : TALLOC_FREE(push);
6815 0 : PyErr_SetNdrError(err);
6816 0 : return NULL;
6817 : }
6818 0 : blob = ndr_push_blob(push);
6819 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6820 0 : TALLOC_FREE(push);
6821 0 : return ret;
6822 : }
6823 :
6824 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6825 : {
6826 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6827 0 : PyObject *bigendian_obj = NULL;
6828 0 : PyObject *ndr64_obj = NULL;
6829 0 : uint32_t ndr_push_flags = 0;
6830 :
6831 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6832 : discard_const_p(char *, kwnames),
6833 : &bigendian_obj,
6834 : &ndr64_obj)) {
6835 0 : return NULL;
6836 : }
6837 :
6838 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6839 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6840 : }
6841 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6842 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6843 : }
6844 :
6845 0 : return py_svcctl_SCSetServiceBitsW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6846 : }
6847 :
6848 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6849 : {
6850 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6851 0 : PyObject *bigendian_obj = NULL;
6852 0 : PyObject *ndr64_obj = NULL;
6853 0 : uint32_t ndr_push_flags = 0;
6854 :
6855 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6856 : discard_const_p(char *, kwnames),
6857 : &bigendian_obj,
6858 : &ndr64_obj)) {
6859 0 : return NULL;
6860 : }
6861 :
6862 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6863 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6864 : }
6865 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6866 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6867 : }
6868 :
6869 0 : return py_svcctl_SCSetServiceBitsW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6870 : }
6871 :
6872 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
6873 : {
6874 0 : const struct ndr_interface_call *call = NULL;
6875 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6876 0 : struct ndr_pull *pull = NULL;
6877 : enum ndr_err_code err;
6878 :
6879 0 : if (ndr_table_svcctl.num_calls < 11) {
6880 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_unpack");
6881 0 : return NULL;
6882 : }
6883 0 : call = &ndr_table_svcctl.calls[10];
6884 :
6885 0 : pull = ndr_pull_init_blob(blob, object);
6886 0 : if (pull == NULL) {
6887 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6888 0 : return NULL;
6889 : }
6890 :
6891 0 : pull->flags |= ndr_pull_flags;
6892 :
6893 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6894 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6895 0 : TALLOC_FREE(pull);
6896 0 : PyErr_SetNdrError(err);
6897 0 : return NULL;
6898 : }
6899 0 : if (!allow_remaining) {
6900 : uint32_t highest_ofs;
6901 :
6902 0 : if (pull->offset > pull->relative_highest_offset) {
6903 0 : highest_ofs = pull->offset;
6904 : } else {
6905 0 : highest_ofs = pull->relative_highest_offset;
6906 : }
6907 0 : if (highest_ofs < pull->data_size) {
6908 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6909 : "not all bytes consumed ofs[%u] size[%u]",
6910 : highest_ofs, pull->data_size);
6911 0 : TALLOC_FREE(pull);
6912 0 : PyErr_SetNdrError(err);
6913 0 : return NULL;
6914 : }
6915 : }
6916 :
6917 0 : TALLOC_FREE(pull);
6918 0 : Py_RETURN_NONE;
6919 : }
6920 :
6921 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6922 : {
6923 : DATA_BLOB blob;
6924 0 : Py_ssize_t blob_length = 0;
6925 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6926 0 : PyObject *bigendian_obj = NULL;
6927 0 : PyObject *ndr64_obj = NULL;
6928 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6929 0 : PyObject *allow_remaining_obj = NULL;
6930 0 : bool allow_remaining = false;
6931 :
6932 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6933 : discard_const_p(char *, kwnames),
6934 : &blob.data, &blob_length,
6935 : &bigendian_obj,
6936 : &ndr64_obj,
6937 : &allow_remaining_obj)) {
6938 0 : return NULL;
6939 : }
6940 0 : blob.length = blob_length;
6941 :
6942 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6943 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6944 : }
6945 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6946 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6947 : }
6948 :
6949 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6950 0 : allow_remaining = true;
6951 : }
6952 :
6953 0 : return py_svcctl_SCSetServiceBitsW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6954 : }
6955 :
6956 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6957 : {
6958 : DATA_BLOB blob;
6959 0 : Py_ssize_t blob_length = 0;
6960 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6961 0 : PyObject *bigendian_obj = NULL;
6962 0 : PyObject *ndr64_obj = NULL;
6963 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6964 0 : PyObject *allow_remaining_obj = NULL;
6965 0 : bool allow_remaining = false;
6966 :
6967 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6968 : discard_const_p(char *, kwnames),
6969 : &blob.data, &blob_length,
6970 : &bigendian_obj,
6971 : &ndr64_obj,
6972 : &allow_remaining_obj)) {
6973 0 : return NULL;
6974 : }
6975 0 : blob.length = blob_length;
6976 :
6977 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6978 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6979 : }
6980 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6981 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6982 : }
6983 :
6984 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6985 0 : allow_remaining = true;
6986 : }
6987 :
6988 0 : return py_svcctl_SCSetServiceBitsW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6989 : }
6990 :
6991 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
6992 : {
6993 0 : const struct ndr_interface_call *call = NULL;
6994 0 : struct svcctl_SCSetServiceBitsW *object = (struct svcctl_SCSetServiceBitsW *)pytalloc_get_ptr(py_obj);
6995 : PyObject *ret;
6996 : char *retstr;
6997 :
6998 0 : if (ndr_table_svcctl.num_calls < 11) {
6999 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsW_ndr_print");
7000 0 : return NULL;
7001 : }
7002 0 : call = &ndr_table_svcctl.calls[10];
7003 :
7004 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7005 0 : ret = PyUnicode_FromString(retstr);
7006 0 : TALLOC_FREE(retstr);
7007 :
7008 0 : return ret;
7009 : }
7010 :
7011 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7012 : {
7013 0 : return py_svcctl_SCSetServiceBitsW_ndr_print(py_obj, "svcctl_SCSetServiceBitsW_in", NDR_IN);
7014 : }
7015 :
7016 0 : static PyObject *py_svcctl_SCSetServiceBitsW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7017 : {
7018 0 : return py_svcctl_SCSetServiceBitsW_ndr_print(py_obj, "svcctl_SCSetServiceBitsW_out", NDR_OUT);
7019 : }
7020 :
7021 : static PyMethodDef py_svcctl_SCSetServiceBitsW_methods[] = {
7022 : { "opnum", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_opnum, METH_NOARGS|METH_CLASS,
7023 : "svcctl.SCSetServiceBitsW.opnum() -> 10 (0x0a) " },
7024 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7025 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7026 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7027 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7028 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7029 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7030 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7031 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7032 : { "__ndr_print_in__", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7033 : { "__ndr_print_out__", (PyCFunction)py_svcctl_SCSetServiceBitsW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7034 : { NULL, NULL, 0, NULL }
7035 : };
7036 :
7037 :
7038 : static PyTypeObject svcctl_SCSetServiceBitsW_Type = {
7039 : PyVarObject_HEAD_INIT(NULL, 0)
7040 : .tp_name = "svcctl.SCSetServiceBitsW",
7041 : .tp_getset = py_svcctl_SCSetServiceBitsW_getsetters,
7042 : .tp_methods = py_svcctl_SCSetServiceBitsW_methods,
7043 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7044 : .tp_new = py_svcctl_SCSetServiceBitsW_new,
7045 : };
7046 :
7047 0 : static bool pack_py_svcctl_SCSetServiceBitsW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SCSetServiceBitsW *r)
7048 : {
7049 : PyObject *py_handle;
7050 : PyObject *py_bits;
7051 : PyObject *py_bitson;
7052 : PyObject *py_immediate;
7053 0 : const char *kwnames[] = {
7054 : "handle", "bits", "bitson", "immediate", NULL
7055 : };
7056 :
7057 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:svcctl_SCSetServiceBitsW", discard_const_p(char *, kwnames), &py_handle, &py_bits, &py_bitson, &py_immediate)) {
7058 0 : return false;
7059 : }
7060 :
7061 0 : if (py_handle == NULL) {
7062 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
7063 0 : return false;
7064 : }
7065 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
7066 0 : if (r->in.handle == NULL) {
7067 0 : PyErr_NoMemory();
7068 0 : return false;
7069 : }
7070 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
7071 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
7072 0 : PyErr_NoMemory();
7073 0 : return false;
7074 : }
7075 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
7076 0 : if (py_bits == NULL) {
7077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bits");
7078 0 : return false;
7079 : }
7080 : {
7081 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bits));
7082 0 : if (PyLong_Check(py_bits)) {
7083 : unsigned long long test_var;
7084 0 : test_var = PyLong_AsUnsignedLongLong(py_bits);
7085 0 : if (PyErr_Occurred() != NULL) {
7086 0 : return false;
7087 : }
7088 0 : if (test_var > uint_max) {
7089 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7090 : PyLong_Type.tp_name, uint_max, test_var);
7091 0 : return false;
7092 : }
7093 0 : r->in.bits = test_var;
7094 : } else {
7095 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7096 : PyLong_Type.tp_name);
7097 0 : return false;
7098 : }
7099 : }
7100 0 : if (py_bitson == NULL) {
7101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bitson");
7102 0 : return false;
7103 : }
7104 : {
7105 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bitson));
7106 0 : if (PyLong_Check(py_bitson)) {
7107 : unsigned long long test_var;
7108 0 : test_var = PyLong_AsUnsignedLongLong(py_bitson);
7109 0 : if (PyErr_Occurred() != NULL) {
7110 0 : return false;
7111 : }
7112 0 : if (test_var > uint_max) {
7113 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7114 : PyLong_Type.tp_name, uint_max, test_var);
7115 0 : return false;
7116 : }
7117 0 : r->in.bitson = test_var;
7118 : } else {
7119 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7120 : PyLong_Type.tp_name);
7121 0 : return false;
7122 : }
7123 : }
7124 0 : if (py_immediate == NULL) {
7125 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.immediate");
7126 0 : return false;
7127 : }
7128 : {
7129 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.immediate));
7130 0 : if (PyLong_Check(py_immediate)) {
7131 : unsigned long long test_var;
7132 0 : test_var = PyLong_AsUnsignedLongLong(py_immediate);
7133 0 : if (PyErr_Occurred() != NULL) {
7134 0 : return false;
7135 : }
7136 0 : if (test_var > uint_max) {
7137 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7138 : PyLong_Type.tp_name, uint_max, test_var);
7139 0 : return false;
7140 : }
7141 0 : r->in.immediate = test_var;
7142 : } else {
7143 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7144 : PyLong_Type.tp_name);
7145 0 : return false;
7146 : }
7147 : }
7148 0 : return true;
7149 : }
7150 :
7151 0 : static PyObject *unpack_py_svcctl_SCSetServiceBitsW_args_out(struct svcctl_SCSetServiceBitsW *r)
7152 : {
7153 : PyObject *result;
7154 0 : result = Py_None;
7155 0 : Py_INCREF(result);
7156 0 : if (!W_ERROR_IS_OK(r->out.result)) {
7157 0 : PyErr_SetWERROR(r->out.result);
7158 0 : return NULL;
7159 : }
7160 :
7161 0 : return result;
7162 : }
7163 :
7164 :
7165 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_handle(PyObject *obj, void *closure)
7166 : {
7167 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7168 : PyObject *py_handle;
7169 0 : if (object->in.handle == NULL) {
7170 0 : Py_RETURN_NONE;
7171 : }
7172 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
7173 0 : return py_handle;
7174 : }
7175 :
7176 0 : static int py_svcctl_ChangeServiceConfigW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
7177 : {
7178 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7179 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
7180 0 : if (value == NULL) {
7181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
7182 0 : return -1;
7183 : }
7184 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
7185 0 : if (object->in.handle == NULL) {
7186 0 : PyErr_NoMemory();
7187 0 : return -1;
7188 : }
7189 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
7190 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7191 0 : PyErr_NoMemory();
7192 0 : return -1;
7193 : }
7194 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
7195 0 : return 0;
7196 : }
7197 :
7198 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_type(PyObject *obj, void *closure)
7199 : {
7200 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7201 : PyObject *py_type;
7202 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
7203 0 : return py_type;
7204 : }
7205 :
7206 0 : static int py_svcctl_ChangeServiceConfigW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
7207 : {
7208 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7209 0 : if (value == NULL) {
7210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
7211 0 : return -1;
7212 : }
7213 : {
7214 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
7215 0 : if (PyLong_Check(value)) {
7216 : unsigned long long test_var;
7217 0 : test_var = PyLong_AsUnsignedLongLong(value);
7218 0 : if (PyErr_Occurred() != NULL) {
7219 0 : return -1;
7220 : }
7221 0 : if (test_var > uint_max) {
7222 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7223 : PyLong_Type.tp_name, uint_max, test_var);
7224 0 : return -1;
7225 : }
7226 0 : object->in.type = test_var;
7227 : } else {
7228 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7229 : PyLong_Type.tp_name);
7230 0 : return -1;
7231 : }
7232 : }
7233 0 : return 0;
7234 : }
7235 :
7236 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_start_type(PyObject *obj, void *closure)
7237 : {
7238 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7239 : PyObject *py_start_type;
7240 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
7241 0 : return py_start_type;
7242 : }
7243 :
7244 0 : static int py_svcctl_ChangeServiceConfigW_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
7245 : {
7246 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7247 0 : if (value == NULL) {
7248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
7249 0 : return -1;
7250 : }
7251 : {
7252 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
7253 0 : if (PyLong_Check(value)) {
7254 : unsigned long long test_var;
7255 0 : test_var = PyLong_AsUnsignedLongLong(value);
7256 0 : if (PyErr_Occurred() != NULL) {
7257 0 : return -1;
7258 : }
7259 0 : if (test_var > uint_max) {
7260 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7261 : PyLong_Type.tp_name, uint_max, test_var);
7262 0 : return -1;
7263 : }
7264 0 : object->in.start_type = test_var;
7265 : } else {
7266 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7267 : PyLong_Type.tp_name);
7268 0 : return -1;
7269 : }
7270 : }
7271 0 : return 0;
7272 : }
7273 :
7274 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_error_control(PyObject *obj, void *closure)
7275 : {
7276 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7277 : PyObject *py_error_control;
7278 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
7279 0 : return py_error_control;
7280 : }
7281 :
7282 0 : static int py_svcctl_ChangeServiceConfigW_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
7283 : {
7284 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7285 0 : if (value == NULL) {
7286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
7287 0 : return -1;
7288 : }
7289 : {
7290 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
7291 0 : if (PyLong_Check(value)) {
7292 : unsigned long long test_var;
7293 0 : test_var = PyLong_AsUnsignedLongLong(value);
7294 0 : if (PyErr_Occurred() != NULL) {
7295 0 : return -1;
7296 : }
7297 0 : if (test_var > uint_max) {
7298 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7299 : PyLong_Type.tp_name, uint_max, test_var);
7300 0 : return -1;
7301 : }
7302 0 : object->in.error_control = test_var;
7303 : } else {
7304 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7305 : PyLong_Type.tp_name);
7306 0 : return -1;
7307 : }
7308 : }
7309 0 : return 0;
7310 : }
7311 :
7312 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_binary_path(PyObject *obj, void *closure)
7313 : {
7314 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7315 : PyObject *py_binary_path;
7316 0 : if (object->in.binary_path == NULL) {
7317 0 : Py_RETURN_NONE;
7318 : }
7319 0 : if (object->in.binary_path == NULL) {
7320 0 : py_binary_path = Py_None;
7321 0 : Py_INCREF(py_binary_path);
7322 : } else {
7323 0 : if (object->in.binary_path == NULL) {
7324 0 : py_binary_path = Py_None;
7325 0 : Py_INCREF(py_binary_path);
7326 : } else {
7327 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
7328 : }
7329 : }
7330 0 : return py_binary_path;
7331 : }
7332 :
7333 0 : static int py_svcctl_ChangeServiceConfigW_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
7334 : {
7335 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7336 0 : if (value == NULL) {
7337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
7338 0 : return -1;
7339 : }
7340 0 : if (value == Py_None) {
7341 0 : object->in.binary_path = NULL;
7342 : } else {
7343 0 : object->in.binary_path = NULL;
7344 : {
7345 : const char *test_str;
7346 : const char *talloc_str;
7347 0 : PyObject *unicode = NULL;
7348 0 : if (PyUnicode_Check(value)) {
7349 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7350 0 : if (unicode == NULL) {
7351 0 : PyErr_NoMemory();
7352 0 : return -1;
7353 : }
7354 0 : test_str = PyBytes_AS_STRING(unicode);
7355 0 : } else if (PyBytes_Check(value)) {
7356 0 : test_str = PyBytes_AS_STRING(value);
7357 : } else {
7358 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7359 0 : return -1;
7360 : }
7361 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7362 0 : if (unicode != NULL) {
7363 0 : Py_DECREF(unicode);
7364 : }
7365 0 : if (talloc_str == NULL) {
7366 0 : PyErr_NoMemory();
7367 0 : return -1;
7368 : }
7369 0 : object->in.binary_path = talloc_str;
7370 : }
7371 : }
7372 0 : return 0;
7373 : }
7374 :
7375 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_load_order_group(PyObject *obj, void *closure)
7376 : {
7377 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7378 : PyObject *py_load_order_group;
7379 0 : if (object->in.load_order_group == NULL) {
7380 0 : Py_RETURN_NONE;
7381 : }
7382 0 : if (object->in.load_order_group == NULL) {
7383 0 : py_load_order_group = Py_None;
7384 0 : Py_INCREF(py_load_order_group);
7385 : } else {
7386 0 : if (object->in.load_order_group == NULL) {
7387 0 : py_load_order_group = Py_None;
7388 0 : Py_INCREF(py_load_order_group);
7389 : } else {
7390 0 : py_load_order_group = PyUnicode_Decode(object->in.load_order_group, strlen(object->in.load_order_group), "utf-8", "ignore");
7391 : }
7392 : }
7393 0 : return py_load_order_group;
7394 : }
7395 :
7396 0 : static int py_svcctl_ChangeServiceConfigW_in_set_load_order_group(PyObject *py_obj, PyObject *value, void *closure)
7397 : {
7398 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7399 0 : if (value == NULL) {
7400 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.load_order_group");
7401 0 : return -1;
7402 : }
7403 0 : if (value == Py_None) {
7404 0 : object->in.load_order_group = NULL;
7405 : } else {
7406 0 : object->in.load_order_group = NULL;
7407 : {
7408 : const char *test_str;
7409 : const char *talloc_str;
7410 0 : PyObject *unicode = NULL;
7411 0 : if (PyUnicode_Check(value)) {
7412 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7413 0 : if (unicode == NULL) {
7414 0 : PyErr_NoMemory();
7415 0 : return -1;
7416 : }
7417 0 : test_str = PyBytes_AS_STRING(unicode);
7418 0 : } else if (PyBytes_Check(value)) {
7419 0 : test_str = PyBytes_AS_STRING(value);
7420 : } else {
7421 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7422 0 : return -1;
7423 : }
7424 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7425 0 : if (unicode != NULL) {
7426 0 : Py_DECREF(unicode);
7427 : }
7428 0 : if (talloc_str == NULL) {
7429 0 : PyErr_NoMemory();
7430 0 : return -1;
7431 : }
7432 0 : object->in.load_order_group = talloc_str;
7433 : }
7434 : }
7435 0 : return 0;
7436 : }
7437 :
7438 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_tag_id(PyObject *obj, void *closure)
7439 : {
7440 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7441 : PyObject *py_tag_id;
7442 0 : if (object->in.tag_id == NULL) {
7443 0 : Py_RETURN_NONE;
7444 : }
7445 0 : if (object->in.tag_id == NULL) {
7446 0 : py_tag_id = Py_None;
7447 0 : Py_INCREF(py_tag_id);
7448 : } else {
7449 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->in.tag_id);
7450 : }
7451 0 : return py_tag_id;
7452 : }
7453 :
7454 0 : static int py_svcctl_ChangeServiceConfigW_in_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
7455 : {
7456 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7457 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.tag_id));
7458 0 : if (value == NULL) {
7459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.tag_id");
7460 0 : return -1;
7461 : }
7462 0 : if (value == Py_None) {
7463 0 : object->in.tag_id = NULL;
7464 : } else {
7465 0 : object->in.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.tag_id);
7466 0 : if (object->in.tag_id == NULL) {
7467 0 : PyErr_NoMemory();
7468 0 : return -1;
7469 : }
7470 : {
7471 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.tag_id));
7472 0 : if (PyLong_Check(value)) {
7473 : unsigned long long test_var;
7474 0 : test_var = PyLong_AsUnsignedLongLong(value);
7475 0 : if (PyErr_Occurred() != NULL) {
7476 0 : return -1;
7477 : }
7478 0 : if (test_var > uint_max) {
7479 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7480 : PyLong_Type.tp_name, uint_max, test_var);
7481 0 : return -1;
7482 : }
7483 0 : *object->in.tag_id = test_var;
7484 : } else {
7485 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7486 : PyLong_Type.tp_name);
7487 0 : return -1;
7488 : }
7489 : }
7490 : }
7491 0 : return 0;
7492 : }
7493 :
7494 0 : static PyObject *py_svcctl_ChangeServiceConfigW_out_get_tag_id(PyObject *obj, void *closure)
7495 : {
7496 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7497 : PyObject *py_tag_id;
7498 0 : if (object->out.tag_id == NULL) {
7499 0 : Py_RETURN_NONE;
7500 : }
7501 0 : if (object->out.tag_id == NULL) {
7502 0 : py_tag_id = Py_None;
7503 0 : Py_INCREF(py_tag_id);
7504 : } else {
7505 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->out.tag_id);
7506 : }
7507 0 : return py_tag_id;
7508 : }
7509 :
7510 0 : static int py_svcctl_ChangeServiceConfigW_out_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
7511 : {
7512 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7513 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.tag_id));
7514 0 : if (value == NULL) {
7515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.tag_id");
7516 0 : return -1;
7517 : }
7518 0 : if (value == Py_None) {
7519 0 : object->out.tag_id = NULL;
7520 : } else {
7521 0 : object->out.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.tag_id);
7522 0 : if (object->out.tag_id == NULL) {
7523 0 : PyErr_NoMemory();
7524 0 : return -1;
7525 : }
7526 : {
7527 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.tag_id));
7528 0 : if (PyLong_Check(value)) {
7529 : unsigned long long test_var;
7530 0 : test_var = PyLong_AsUnsignedLongLong(value);
7531 0 : if (PyErr_Occurred() != NULL) {
7532 0 : return -1;
7533 : }
7534 0 : if (test_var > uint_max) {
7535 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7536 : PyLong_Type.tp_name, uint_max, test_var);
7537 0 : return -1;
7538 : }
7539 0 : *object->out.tag_id = test_var;
7540 : } else {
7541 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7542 : PyLong_Type.tp_name);
7543 0 : return -1;
7544 : }
7545 : }
7546 : }
7547 0 : return 0;
7548 : }
7549 :
7550 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dependencies(PyObject *obj, void *closure)
7551 : {
7552 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7553 : PyObject *py_dependencies;
7554 0 : if (object->in.dependencies == NULL) {
7555 0 : Py_RETURN_NONE;
7556 : }
7557 0 : if (object->in.dependencies == NULL) {
7558 0 : py_dependencies = Py_None;
7559 0 : Py_INCREF(py_dependencies);
7560 : } else {
7561 0 : if (object->in.dependencies == NULL) {
7562 0 : py_dependencies = Py_None;
7563 0 : Py_INCREF(py_dependencies);
7564 : } else {
7565 0 : py_dependencies = PyUnicode_Decode(object->in.dependencies, strlen(object->in.dependencies), "utf-8", "ignore");
7566 : }
7567 : }
7568 0 : return py_dependencies;
7569 : }
7570 :
7571 0 : static int py_svcctl_ChangeServiceConfigW_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
7572 : {
7573 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7574 0 : if (value == NULL) {
7575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
7576 0 : return -1;
7577 : }
7578 0 : if (value == Py_None) {
7579 0 : object->in.dependencies = NULL;
7580 : } else {
7581 0 : object->in.dependencies = NULL;
7582 : {
7583 : const char *test_str;
7584 : const char *talloc_str;
7585 0 : PyObject *unicode = NULL;
7586 0 : if (PyUnicode_Check(value)) {
7587 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7588 0 : if (unicode == NULL) {
7589 0 : PyErr_NoMemory();
7590 0 : return -1;
7591 : }
7592 0 : test_str = PyBytes_AS_STRING(unicode);
7593 0 : } else if (PyBytes_Check(value)) {
7594 0 : test_str = PyBytes_AS_STRING(value);
7595 : } else {
7596 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7597 0 : return -1;
7598 : }
7599 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7600 0 : if (unicode != NULL) {
7601 0 : Py_DECREF(unicode);
7602 : }
7603 0 : if (talloc_str == NULL) {
7604 0 : PyErr_NoMemory();
7605 0 : return -1;
7606 : }
7607 0 : object->in.dependencies = talloc_str;
7608 : }
7609 : }
7610 0 : return 0;
7611 : }
7612 :
7613 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dwDependSize(PyObject *obj, void *closure)
7614 : {
7615 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7616 : PyObject *py_dwDependSize;
7617 0 : py_dwDependSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwDependSize);
7618 0 : return py_dwDependSize;
7619 : }
7620 :
7621 0 : static int py_svcctl_ChangeServiceConfigW_in_set_dwDependSize(PyObject *py_obj, PyObject *value, void *closure)
7622 : {
7623 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7624 0 : if (value == NULL) {
7625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwDependSize");
7626 0 : return -1;
7627 : }
7628 : {
7629 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwDependSize));
7630 0 : if (PyLong_Check(value)) {
7631 : unsigned long long test_var;
7632 0 : test_var = PyLong_AsUnsignedLongLong(value);
7633 0 : if (PyErr_Occurred() != NULL) {
7634 0 : return -1;
7635 : }
7636 0 : if (test_var > uint_max) {
7637 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7638 : PyLong_Type.tp_name, uint_max, test_var);
7639 0 : return -1;
7640 : }
7641 0 : object->in.dwDependSize = test_var;
7642 : } else {
7643 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7644 : PyLong_Type.tp_name);
7645 0 : return -1;
7646 : }
7647 : }
7648 0 : return 0;
7649 : }
7650 :
7651 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_service_start_name(PyObject *obj, void *closure)
7652 : {
7653 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7654 : PyObject *py_service_start_name;
7655 0 : if (object->in.service_start_name == NULL) {
7656 0 : Py_RETURN_NONE;
7657 : }
7658 0 : if (object->in.service_start_name == NULL) {
7659 0 : py_service_start_name = Py_None;
7660 0 : Py_INCREF(py_service_start_name);
7661 : } else {
7662 0 : if (object->in.service_start_name == NULL) {
7663 0 : py_service_start_name = Py_None;
7664 0 : Py_INCREF(py_service_start_name);
7665 : } else {
7666 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
7667 : }
7668 : }
7669 0 : return py_service_start_name;
7670 : }
7671 :
7672 0 : static int py_svcctl_ChangeServiceConfigW_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
7673 : {
7674 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7675 0 : if (value == NULL) {
7676 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
7677 0 : return -1;
7678 : }
7679 0 : if (value == Py_None) {
7680 0 : object->in.service_start_name = NULL;
7681 : } else {
7682 0 : object->in.service_start_name = NULL;
7683 : {
7684 : const char *test_str;
7685 : const char *talloc_str;
7686 0 : PyObject *unicode = NULL;
7687 0 : if (PyUnicode_Check(value)) {
7688 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7689 0 : if (unicode == NULL) {
7690 0 : PyErr_NoMemory();
7691 0 : return -1;
7692 : }
7693 0 : test_str = PyBytes_AS_STRING(unicode);
7694 0 : } else if (PyBytes_Check(value)) {
7695 0 : test_str = PyBytes_AS_STRING(value);
7696 : } else {
7697 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7698 0 : return -1;
7699 : }
7700 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7701 0 : if (unicode != NULL) {
7702 0 : Py_DECREF(unicode);
7703 : }
7704 0 : if (talloc_str == NULL) {
7705 0 : PyErr_NoMemory();
7706 0 : return -1;
7707 : }
7708 0 : object->in.service_start_name = talloc_str;
7709 : }
7710 : }
7711 0 : return 0;
7712 : }
7713 :
7714 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_password(PyObject *obj, void *closure)
7715 : {
7716 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7717 : PyObject *py_password;
7718 0 : if (object->in.password == NULL) {
7719 0 : Py_RETURN_NONE;
7720 : }
7721 0 : if (object->in.password == NULL) {
7722 0 : py_password = Py_None;
7723 0 : Py_INCREF(py_password);
7724 : } else {
7725 0 : if (object->in.password == NULL) {
7726 0 : py_password = Py_None;
7727 0 : Py_INCREF(py_password);
7728 : } else {
7729 0 : py_password = PyUnicode_Decode(object->in.password, strlen(object->in.password), "utf-8", "ignore");
7730 : }
7731 : }
7732 0 : return py_password;
7733 : }
7734 :
7735 0 : static int py_svcctl_ChangeServiceConfigW_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
7736 : {
7737 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7738 0 : if (value == NULL) {
7739 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
7740 0 : return -1;
7741 : }
7742 0 : if (value == Py_None) {
7743 0 : object->in.password = NULL;
7744 : } else {
7745 0 : object->in.password = NULL;
7746 : {
7747 : const char *test_str;
7748 : const char *talloc_str;
7749 0 : PyObject *unicode = NULL;
7750 0 : if (PyUnicode_Check(value)) {
7751 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7752 0 : if (unicode == NULL) {
7753 0 : PyErr_NoMemory();
7754 0 : return -1;
7755 : }
7756 0 : test_str = PyBytes_AS_STRING(unicode);
7757 0 : } else if (PyBytes_Check(value)) {
7758 0 : test_str = PyBytes_AS_STRING(value);
7759 : } else {
7760 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7761 0 : return -1;
7762 : }
7763 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7764 0 : if (unicode != NULL) {
7765 0 : Py_DECREF(unicode);
7766 : }
7767 0 : if (talloc_str == NULL) {
7768 0 : PyErr_NoMemory();
7769 0 : return -1;
7770 : }
7771 0 : object->in.password = talloc_str;
7772 : }
7773 : }
7774 0 : return 0;
7775 : }
7776 :
7777 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_dwPwSize(PyObject *obj, void *closure)
7778 : {
7779 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7780 : PyObject *py_dwPwSize;
7781 0 : py_dwPwSize = PyLong_FromUnsignedLongLong((uint32_t)object->in.dwPwSize);
7782 0 : return py_dwPwSize;
7783 : }
7784 :
7785 0 : static int py_svcctl_ChangeServiceConfigW_in_set_dwPwSize(PyObject *py_obj, PyObject *value, void *closure)
7786 : {
7787 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7788 0 : if (value == NULL) {
7789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dwPwSize");
7790 0 : return -1;
7791 : }
7792 : {
7793 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dwPwSize));
7794 0 : if (PyLong_Check(value)) {
7795 : unsigned long long test_var;
7796 0 : test_var = PyLong_AsUnsignedLongLong(value);
7797 0 : if (PyErr_Occurred() != NULL) {
7798 0 : return -1;
7799 : }
7800 0 : if (test_var > uint_max) {
7801 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7802 : PyLong_Type.tp_name, uint_max, test_var);
7803 0 : return -1;
7804 : }
7805 0 : object->in.dwPwSize = test_var;
7806 : } else {
7807 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7808 : PyLong_Type.tp_name);
7809 0 : return -1;
7810 : }
7811 : }
7812 0 : return 0;
7813 : }
7814 :
7815 0 : static PyObject *py_svcctl_ChangeServiceConfigW_in_get_display_name(PyObject *obj, void *closure)
7816 : {
7817 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7818 : PyObject *py_display_name;
7819 0 : if (object->in.display_name == NULL) {
7820 0 : Py_RETURN_NONE;
7821 : }
7822 0 : if (object->in.display_name == NULL) {
7823 0 : py_display_name = Py_None;
7824 0 : Py_INCREF(py_display_name);
7825 : } else {
7826 0 : if (object->in.display_name == NULL) {
7827 0 : py_display_name = Py_None;
7828 0 : Py_INCREF(py_display_name);
7829 : } else {
7830 0 : py_display_name = PyUnicode_Decode(object->in.display_name, strlen(object->in.display_name), "utf-8", "ignore");
7831 : }
7832 : }
7833 0 : return py_display_name;
7834 : }
7835 :
7836 0 : static int py_svcctl_ChangeServiceConfigW_in_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
7837 : {
7838 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7839 0 : if (value == NULL) {
7840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name");
7841 0 : return -1;
7842 : }
7843 0 : if (value == Py_None) {
7844 0 : object->in.display_name = NULL;
7845 : } else {
7846 0 : object->in.display_name = NULL;
7847 : {
7848 : const char *test_str;
7849 : const char *talloc_str;
7850 0 : PyObject *unicode = NULL;
7851 0 : if (PyUnicode_Check(value)) {
7852 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7853 0 : if (unicode == NULL) {
7854 0 : PyErr_NoMemory();
7855 0 : return -1;
7856 : }
7857 0 : test_str = PyBytes_AS_STRING(unicode);
7858 0 : } else if (PyBytes_Check(value)) {
7859 0 : test_str = PyBytes_AS_STRING(value);
7860 : } else {
7861 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7862 0 : return -1;
7863 : }
7864 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7865 0 : if (unicode != NULL) {
7866 0 : Py_DECREF(unicode);
7867 : }
7868 0 : if (talloc_str == NULL) {
7869 0 : PyErr_NoMemory();
7870 0 : return -1;
7871 : }
7872 0 : object->in.display_name = talloc_str;
7873 : }
7874 : }
7875 0 : return 0;
7876 : }
7877 :
7878 0 : static PyObject *py_svcctl_ChangeServiceConfigW_get_result(PyObject *obj, void *closure)
7879 : {
7880 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(obj);
7881 : PyObject *py_result;
7882 0 : py_result = PyErr_FromWERROR(object->out.result);
7883 0 : return py_result;
7884 : }
7885 :
7886 0 : static int py_svcctl_ChangeServiceConfigW_set_result(PyObject *py_obj, PyObject *value, void *closure)
7887 : {
7888 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
7889 0 : if (value == NULL) {
7890 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
7891 0 : return -1;
7892 : }
7893 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
7894 0 : return 0;
7895 : }
7896 :
7897 : static PyGetSetDef py_svcctl_ChangeServiceConfigW_getsetters[] = {
7898 : {
7899 : .name = discard_const_p(char, "in_handle"),
7900 : .get = py_svcctl_ChangeServiceConfigW_in_get_handle,
7901 : .set = py_svcctl_ChangeServiceConfigW_in_set_handle,
7902 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
7903 : },
7904 : {
7905 : .name = discard_const_p(char, "in_type"),
7906 : .get = py_svcctl_ChangeServiceConfigW_in_get_type,
7907 : .set = py_svcctl_ChangeServiceConfigW_in_set_type,
7908 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7909 : },
7910 : {
7911 : .name = discard_const_p(char, "in_start_type"),
7912 : .get = py_svcctl_ChangeServiceConfigW_in_get_start_type,
7913 : .set = py_svcctl_ChangeServiceConfigW_in_set_start_type,
7914 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
7915 : },
7916 : {
7917 : .name = discard_const_p(char, "in_error_control"),
7918 : .get = py_svcctl_ChangeServiceConfigW_in_get_error_control,
7919 : .set = py_svcctl_ChangeServiceConfigW_in_set_error_control,
7920 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
7921 : },
7922 : {
7923 : .name = discard_const_p(char, "in_binary_path"),
7924 : .get = py_svcctl_ChangeServiceConfigW_in_get_binary_path,
7925 : .set = py_svcctl_ChangeServiceConfigW_in_set_binary_path,
7926 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7927 : },
7928 : {
7929 : .name = discard_const_p(char, "in_load_order_group"),
7930 : .get = py_svcctl_ChangeServiceConfigW_in_get_load_order_group,
7931 : .set = py_svcctl_ChangeServiceConfigW_in_set_load_order_group,
7932 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7933 : },
7934 : {
7935 : .name = discard_const_p(char, "in_tag_id"),
7936 : .get = py_svcctl_ChangeServiceConfigW_in_get_tag_id,
7937 : .set = py_svcctl_ChangeServiceConfigW_in_set_tag_id,
7938 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7939 : },
7940 : {
7941 : .name = discard_const_p(char, "out_tag_id"),
7942 : .get = py_svcctl_ChangeServiceConfigW_out_get_tag_id,
7943 : .set = py_svcctl_ChangeServiceConfigW_out_set_tag_id,
7944 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7945 : },
7946 : {
7947 : .name = discard_const_p(char, "in_dependencies"),
7948 : .get = py_svcctl_ChangeServiceConfigW_in_get_dependencies,
7949 : .set = py_svcctl_ChangeServiceConfigW_in_set_dependencies,
7950 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7951 : },
7952 : {
7953 : .name = discard_const_p(char, "in_dwDependSize"),
7954 : .get = py_svcctl_ChangeServiceConfigW_in_get_dwDependSize,
7955 : .set = py_svcctl_ChangeServiceConfigW_in_set_dwDependSize,
7956 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7957 : },
7958 : {
7959 : .name = discard_const_p(char, "in_service_start_name"),
7960 : .get = py_svcctl_ChangeServiceConfigW_in_get_service_start_name,
7961 : .set = py_svcctl_ChangeServiceConfigW_in_set_service_start_name,
7962 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7963 : },
7964 : {
7965 : .name = discard_const_p(char, "in_password"),
7966 : .get = py_svcctl_ChangeServiceConfigW_in_get_password,
7967 : .set = py_svcctl_ChangeServiceConfigW_in_set_password,
7968 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7969 : },
7970 : {
7971 : .name = discard_const_p(char, "in_dwPwSize"),
7972 : .get = py_svcctl_ChangeServiceConfigW_in_get_dwPwSize,
7973 : .set = py_svcctl_ChangeServiceConfigW_in_set_dwPwSize,
7974 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7975 : },
7976 : {
7977 : .name = discard_const_p(char, "in_display_name"),
7978 : .get = py_svcctl_ChangeServiceConfigW_in_get_display_name,
7979 : .set = py_svcctl_ChangeServiceConfigW_in_set_display_name,
7980 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7981 : },
7982 : {
7983 : .name = discard_const_p(char, "result"),
7984 : .get = py_svcctl_ChangeServiceConfigW_get_result,
7985 : .set = py_svcctl_ChangeServiceConfigW_set_result,
7986 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
7987 : },
7988 : { .name = NULL }
7989 : };
7990 :
7991 0 : static PyObject *py_svcctl_ChangeServiceConfigW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7992 : {
7993 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfigW, type);
7994 0 : struct svcctl_ChangeServiceConfigW *_self = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(self);
7995 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
7996 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
7997 0 : return self;
7998 : }
7999 :
8000 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
8001 : {
8002 :
8003 :
8004 0 : return PyLong_FromLong(11);
8005 : }
8006 :
8007 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
8008 : {
8009 0 : const struct ndr_interface_call *call = NULL;
8010 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
8011 0 : PyObject *ret = NULL;
8012 0 : struct ndr_push *push = NULL;
8013 : DATA_BLOB blob;
8014 : enum ndr_err_code err;
8015 :
8016 0 : if (ndr_table_svcctl.num_calls < 12) {
8017 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_pack");
8018 0 : return NULL;
8019 : }
8020 0 : call = &ndr_table_svcctl.calls[11];
8021 :
8022 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
8023 0 : if (push == NULL) {
8024 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8025 0 : return NULL;
8026 : }
8027 :
8028 0 : push->flags |= ndr_push_flags;
8029 :
8030 0 : err = call->ndr_push(push, ndr_inout_flags, object);
8031 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8032 0 : TALLOC_FREE(push);
8033 0 : PyErr_SetNdrError(err);
8034 0 : return NULL;
8035 : }
8036 0 : blob = ndr_push_blob(push);
8037 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8038 0 : TALLOC_FREE(push);
8039 0 : return ret;
8040 : }
8041 :
8042 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8043 : {
8044 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8045 0 : PyObject *bigendian_obj = NULL;
8046 0 : PyObject *ndr64_obj = NULL;
8047 0 : uint32_t ndr_push_flags = 0;
8048 :
8049 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
8050 : discard_const_p(char *, kwnames),
8051 : &bigendian_obj,
8052 : &ndr64_obj)) {
8053 0 : return NULL;
8054 : }
8055 :
8056 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8057 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8058 : }
8059 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8060 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8061 : }
8062 :
8063 0 : return py_svcctl_ChangeServiceConfigW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
8064 : }
8065 :
8066 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8067 : {
8068 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8069 0 : PyObject *bigendian_obj = NULL;
8070 0 : PyObject *ndr64_obj = NULL;
8071 0 : uint32_t ndr_push_flags = 0;
8072 :
8073 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
8074 : discard_const_p(char *, kwnames),
8075 : &bigendian_obj,
8076 : &ndr64_obj)) {
8077 0 : return NULL;
8078 : }
8079 :
8080 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8081 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8082 : }
8083 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8084 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8085 : }
8086 :
8087 0 : return py_svcctl_ChangeServiceConfigW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
8088 : }
8089 :
8090 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
8091 : {
8092 0 : const struct ndr_interface_call *call = NULL;
8093 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
8094 0 : struct ndr_pull *pull = NULL;
8095 : enum ndr_err_code err;
8096 :
8097 0 : if (ndr_table_svcctl.num_calls < 12) {
8098 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_unpack");
8099 0 : return NULL;
8100 : }
8101 0 : call = &ndr_table_svcctl.calls[11];
8102 :
8103 0 : pull = ndr_pull_init_blob(blob, object);
8104 0 : if (pull == NULL) {
8105 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8106 0 : return NULL;
8107 : }
8108 :
8109 0 : pull->flags |= ndr_pull_flags;
8110 :
8111 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
8112 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8113 0 : TALLOC_FREE(pull);
8114 0 : PyErr_SetNdrError(err);
8115 0 : return NULL;
8116 : }
8117 0 : if (!allow_remaining) {
8118 : uint32_t highest_ofs;
8119 :
8120 0 : if (pull->offset > pull->relative_highest_offset) {
8121 0 : highest_ofs = pull->offset;
8122 : } else {
8123 0 : highest_ofs = pull->relative_highest_offset;
8124 : }
8125 0 : if (highest_ofs < pull->data_size) {
8126 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
8127 : "not all bytes consumed ofs[%u] size[%u]",
8128 : highest_ofs, pull->data_size);
8129 0 : TALLOC_FREE(pull);
8130 0 : PyErr_SetNdrError(err);
8131 0 : return NULL;
8132 : }
8133 : }
8134 :
8135 0 : TALLOC_FREE(pull);
8136 0 : Py_RETURN_NONE;
8137 : }
8138 :
8139 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8140 : {
8141 : DATA_BLOB blob;
8142 0 : Py_ssize_t blob_length = 0;
8143 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8144 0 : PyObject *bigendian_obj = NULL;
8145 0 : PyObject *ndr64_obj = NULL;
8146 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8147 0 : PyObject *allow_remaining_obj = NULL;
8148 0 : bool allow_remaining = false;
8149 :
8150 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
8151 : discard_const_p(char *, kwnames),
8152 : &blob.data, &blob_length,
8153 : &bigendian_obj,
8154 : &ndr64_obj,
8155 : &allow_remaining_obj)) {
8156 0 : return NULL;
8157 : }
8158 0 : blob.length = blob_length;
8159 :
8160 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8161 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8162 : }
8163 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8164 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8165 : }
8166 :
8167 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8168 0 : allow_remaining = true;
8169 : }
8170 :
8171 0 : return py_svcctl_ChangeServiceConfigW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
8172 : }
8173 :
8174 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8175 : {
8176 : DATA_BLOB blob;
8177 0 : Py_ssize_t blob_length = 0;
8178 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8179 0 : PyObject *bigendian_obj = NULL;
8180 0 : PyObject *ndr64_obj = NULL;
8181 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8182 0 : PyObject *allow_remaining_obj = NULL;
8183 0 : bool allow_remaining = false;
8184 :
8185 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
8186 : discard_const_p(char *, kwnames),
8187 : &blob.data, &blob_length,
8188 : &bigendian_obj,
8189 : &ndr64_obj,
8190 : &allow_remaining_obj)) {
8191 0 : return NULL;
8192 : }
8193 0 : blob.length = blob_length;
8194 :
8195 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8196 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8197 : }
8198 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8199 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8200 : }
8201 :
8202 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8203 0 : allow_remaining = true;
8204 : }
8205 :
8206 0 : return py_svcctl_ChangeServiceConfigW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
8207 : }
8208 :
8209 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
8210 : {
8211 0 : const struct ndr_interface_call *call = NULL;
8212 0 : struct svcctl_ChangeServiceConfigW *object = (struct svcctl_ChangeServiceConfigW *)pytalloc_get_ptr(py_obj);
8213 : PyObject *ret;
8214 : char *retstr;
8215 :
8216 0 : if (ndr_table_svcctl.num_calls < 12) {
8217 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigW_ndr_print");
8218 0 : return NULL;
8219 : }
8220 0 : call = &ndr_table_svcctl.calls[11];
8221 :
8222 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
8223 0 : ret = PyUnicode_FromString(retstr);
8224 0 : TALLOC_FREE(retstr);
8225 :
8226 0 : return ret;
8227 : }
8228 :
8229 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8230 : {
8231 0 : return py_svcctl_ChangeServiceConfigW_ndr_print(py_obj, "svcctl_ChangeServiceConfigW_in", NDR_IN);
8232 : }
8233 :
8234 0 : static PyObject *py_svcctl_ChangeServiceConfigW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8235 : {
8236 0 : return py_svcctl_ChangeServiceConfigW_ndr_print(py_obj, "svcctl_ChangeServiceConfigW_out", NDR_OUT);
8237 : }
8238 :
8239 : static PyMethodDef py_svcctl_ChangeServiceConfigW_methods[] = {
8240 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_opnum, METH_NOARGS|METH_CLASS,
8241 : "svcctl.ChangeServiceConfigW.opnum() -> 11 (0x0b) " },
8242 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
8243 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
8244 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
8245 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
8246 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
8247 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
8248 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
8249 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
8250 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
8251 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfigW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
8252 : { NULL, NULL, 0, NULL }
8253 : };
8254 :
8255 :
8256 : static PyTypeObject svcctl_ChangeServiceConfigW_Type = {
8257 : PyVarObject_HEAD_INIT(NULL, 0)
8258 : .tp_name = "svcctl.ChangeServiceConfigW",
8259 : .tp_getset = py_svcctl_ChangeServiceConfigW_getsetters,
8260 : .tp_methods = py_svcctl_ChangeServiceConfigW_methods,
8261 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8262 : .tp_new = py_svcctl_ChangeServiceConfigW_new,
8263 : };
8264 :
8265 0 : static bool pack_py_svcctl_ChangeServiceConfigW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfigW *r)
8266 : {
8267 : PyObject *py_handle;
8268 : PyObject *py_type;
8269 : PyObject *py_start_type;
8270 : PyObject *py_error_control;
8271 : PyObject *py_binary_path;
8272 : PyObject *py_load_order_group;
8273 : PyObject *py_tag_id;
8274 : PyObject *py_dependencies;
8275 : PyObject *py_service_start_name;
8276 : PyObject *py_password;
8277 : PyObject *py_display_name;
8278 0 : const char *kwnames[] = {
8279 : "handle", "type", "start_type", "error_control", "binary_path", "load_order_group", "tag_id", "dependencies", "service_start_name", "password", "display_name", NULL
8280 : };
8281 :
8282 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOO:svcctl_ChangeServiceConfigW", discard_const_p(char *, kwnames), &py_handle, &py_type, &py_start_type, &py_error_control, &py_binary_path, &py_load_order_group, &py_tag_id, &py_dependencies, &py_service_start_name, &py_password, &py_display_name)) {
8283 0 : return false;
8284 : }
8285 :
8286 0 : if (py_handle == NULL) {
8287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
8288 0 : return false;
8289 : }
8290 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
8291 0 : if (r->in.handle == NULL) {
8292 0 : PyErr_NoMemory();
8293 0 : return false;
8294 : }
8295 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
8296 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
8297 0 : PyErr_NoMemory();
8298 0 : return false;
8299 : }
8300 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
8301 0 : if (py_type == NULL) {
8302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
8303 0 : return false;
8304 : }
8305 : {
8306 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
8307 0 : if (PyLong_Check(py_type)) {
8308 : unsigned long long test_var;
8309 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
8310 0 : if (PyErr_Occurred() != NULL) {
8311 0 : return false;
8312 : }
8313 0 : if (test_var > uint_max) {
8314 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8315 : PyLong_Type.tp_name, uint_max, test_var);
8316 0 : return false;
8317 : }
8318 0 : r->in.type = test_var;
8319 : } else {
8320 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8321 : PyLong_Type.tp_name);
8322 0 : return false;
8323 : }
8324 : }
8325 0 : if (py_start_type == NULL) {
8326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
8327 0 : return false;
8328 : }
8329 : {
8330 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
8331 0 : if (PyLong_Check(py_start_type)) {
8332 : unsigned long long test_var;
8333 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
8334 0 : if (PyErr_Occurred() != NULL) {
8335 0 : return false;
8336 : }
8337 0 : if (test_var > uint_max) {
8338 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8339 : PyLong_Type.tp_name, uint_max, test_var);
8340 0 : return false;
8341 : }
8342 0 : r->in.start_type = test_var;
8343 : } else {
8344 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8345 : PyLong_Type.tp_name);
8346 0 : return false;
8347 : }
8348 : }
8349 0 : if (py_error_control == NULL) {
8350 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
8351 0 : return false;
8352 : }
8353 : {
8354 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
8355 0 : if (PyLong_Check(py_error_control)) {
8356 : unsigned long long test_var;
8357 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
8358 0 : if (PyErr_Occurred() != NULL) {
8359 0 : return false;
8360 : }
8361 0 : if (test_var > uint_max) {
8362 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8363 : PyLong_Type.tp_name, uint_max, test_var);
8364 0 : return false;
8365 : }
8366 0 : r->in.error_control = test_var;
8367 : } else {
8368 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8369 : PyLong_Type.tp_name);
8370 0 : return false;
8371 : }
8372 : }
8373 0 : if (py_binary_path == NULL) {
8374 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
8375 0 : return false;
8376 : }
8377 0 : if (py_binary_path == Py_None) {
8378 0 : r->in.binary_path = NULL;
8379 : } else {
8380 0 : r->in.binary_path = NULL;
8381 : {
8382 : const char *test_str;
8383 : const char *talloc_str;
8384 0 : PyObject *unicode = NULL;
8385 0 : if (PyUnicode_Check(py_binary_path)) {
8386 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
8387 0 : if (unicode == NULL) {
8388 0 : PyErr_NoMemory();
8389 0 : return false;
8390 : }
8391 0 : test_str = PyBytes_AS_STRING(unicode);
8392 0 : } else if (PyBytes_Check(py_binary_path)) {
8393 0 : test_str = PyBytes_AS_STRING(py_binary_path);
8394 : } else {
8395 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
8396 0 : return false;
8397 : }
8398 0 : talloc_str = talloc_strdup(r, test_str);
8399 0 : if (unicode != NULL) {
8400 0 : Py_DECREF(unicode);
8401 : }
8402 0 : if (talloc_str == NULL) {
8403 0 : PyErr_NoMemory();
8404 0 : return false;
8405 : }
8406 0 : r->in.binary_path = talloc_str;
8407 : }
8408 : }
8409 0 : if (py_load_order_group == NULL) {
8410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.load_order_group");
8411 0 : return false;
8412 : }
8413 0 : if (py_load_order_group == Py_None) {
8414 0 : r->in.load_order_group = NULL;
8415 : } else {
8416 0 : r->in.load_order_group = NULL;
8417 : {
8418 : const char *test_str;
8419 : const char *talloc_str;
8420 0 : PyObject *unicode = NULL;
8421 0 : if (PyUnicode_Check(py_load_order_group)) {
8422 0 : unicode = PyUnicode_AsEncodedString(py_load_order_group, "utf-8", "ignore");
8423 0 : if (unicode == NULL) {
8424 0 : PyErr_NoMemory();
8425 0 : return false;
8426 : }
8427 0 : test_str = PyBytes_AS_STRING(unicode);
8428 0 : } else if (PyBytes_Check(py_load_order_group)) {
8429 0 : test_str = PyBytes_AS_STRING(py_load_order_group);
8430 : } else {
8431 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_load_order_group)->tp_name);
8432 0 : return false;
8433 : }
8434 0 : talloc_str = talloc_strdup(r, test_str);
8435 0 : if (unicode != NULL) {
8436 0 : Py_DECREF(unicode);
8437 : }
8438 0 : if (talloc_str == NULL) {
8439 0 : PyErr_NoMemory();
8440 0 : return false;
8441 : }
8442 0 : r->in.load_order_group = talloc_str;
8443 : }
8444 : }
8445 0 : if (py_tag_id == NULL) {
8446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.tag_id");
8447 0 : return false;
8448 : }
8449 0 : if (py_tag_id == Py_None) {
8450 0 : r->in.tag_id = NULL;
8451 : } else {
8452 0 : r->in.tag_id = talloc_ptrtype(r, r->in.tag_id);
8453 0 : if (r->in.tag_id == NULL) {
8454 0 : PyErr_NoMemory();
8455 0 : return false;
8456 : }
8457 : {
8458 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.tag_id));
8459 0 : if (PyLong_Check(py_tag_id)) {
8460 : unsigned long long test_var;
8461 0 : test_var = PyLong_AsUnsignedLongLong(py_tag_id);
8462 0 : if (PyErr_Occurred() != NULL) {
8463 0 : return false;
8464 : }
8465 0 : if (test_var > uint_max) {
8466 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8467 : PyLong_Type.tp_name, uint_max, test_var);
8468 0 : return false;
8469 : }
8470 0 : *r->in.tag_id = test_var;
8471 : } else {
8472 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8473 : PyLong_Type.tp_name);
8474 0 : return false;
8475 : }
8476 : }
8477 : }
8478 0 : if (py_dependencies == NULL) {
8479 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
8480 0 : return false;
8481 : }
8482 0 : if (py_dependencies == Py_None) {
8483 0 : r->in.dependencies = NULL;
8484 : } else {
8485 0 : r->in.dependencies = NULL;
8486 : {
8487 : const char *test_str;
8488 : const char *talloc_str;
8489 0 : PyObject *unicode = NULL;
8490 0 : if (PyUnicode_Check(py_dependencies)) {
8491 0 : unicode = PyUnicode_AsEncodedString(py_dependencies, "utf-8", "ignore");
8492 0 : if (unicode == NULL) {
8493 0 : PyErr_NoMemory();
8494 0 : return false;
8495 : }
8496 0 : test_str = PyBytes_AS_STRING(unicode);
8497 0 : } else if (PyBytes_Check(py_dependencies)) {
8498 0 : test_str = PyBytes_AS_STRING(py_dependencies);
8499 : } else {
8500 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dependencies)->tp_name);
8501 0 : return false;
8502 : }
8503 0 : talloc_str = talloc_strdup(r, test_str);
8504 0 : if (unicode != NULL) {
8505 0 : Py_DECREF(unicode);
8506 : }
8507 0 : if (talloc_str == NULL) {
8508 0 : PyErr_NoMemory();
8509 0 : return false;
8510 : }
8511 0 : r->in.dependencies = talloc_str;
8512 : }
8513 : }
8514 0 : PY_CHECK_TYPE(&PyList_Type, py_dependencies, return false;);
8515 0 : r->in.dwDependSize = PyList_GET_SIZE(py_dependencies);
8516 0 : if (py_service_start_name == NULL) {
8517 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
8518 0 : return false;
8519 : }
8520 0 : if (py_service_start_name == Py_None) {
8521 0 : r->in.service_start_name = NULL;
8522 : } else {
8523 0 : r->in.service_start_name = NULL;
8524 : {
8525 : const char *test_str;
8526 : const char *talloc_str;
8527 0 : PyObject *unicode = NULL;
8528 0 : if (PyUnicode_Check(py_service_start_name)) {
8529 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
8530 0 : if (unicode == NULL) {
8531 0 : PyErr_NoMemory();
8532 0 : return false;
8533 : }
8534 0 : test_str = PyBytes_AS_STRING(unicode);
8535 0 : } else if (PyBytes_Check(py_service_start_name)) {
8536 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
8537 : } else {
8538 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
8539 0 : return false;
8540 : }
8541 0 : talloc_str = talloc_strdup(r, test_str);
8542 0 : if (unicode != NULL) {
8543 0 : Py_DECREF(unicode);
8544 : }
8545 0 : if (talloc_str == NULL) {
8546 0 : PyErr_NoMemory();
8547 0 : return false;
8548 : }
8549 0 : r->in.service_start_name = talloc_str;
8550 : }
8551 : }
8552 0 : if (py_password == NULL) {
8553 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
8554 0 : return false;
8555 : }
8556 0 : if (py_password == Py_None) {
8557 0 : r->in.password = NULL;
8558 : } else {
8559 0 : r->in.password = NULL;
8560 : {
8561 : const char *test_str;
8562 : const char *talloc_str;
8563 0 : PyObject *unicode = NULL;
8564 0 : if (PyUnicode_Check(py_password)) {
8565 0 : unicode = PyUnicode_AsEncodedString(py_password, "utf-8", "ignore");
8566 0 : if (unicode == NULL) {
8567 0 : PyErr_NoMemory();
8568 0 : return false;
8569 : }
8570 0 : test_str = PyBytes_AS_STRING(unicode);
8571 0 : } else if (PyBytes_Check(py_password)) {
8572 0 : test_str = PyBytes_AS_STRING(py_password);
8573 : } else {
8574 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_password)->tp_name);
8575 0 : return false;
8576 : }
8577 0 : talloc_str = talloc_strdup(r, test_str);
8578 0 : if (unicode != NULL) {
8579 0 : Py_DECREF(unicode);
8580 : }
8581 0 : if (talloc_str == NULL) {
8582 0 : PyErr_NoMemory();
8583 0 : return false;
8584 : }
8585 0 : r->in.password = talloc_str;
8586 : }
8587 : }
8588 0 : PY_CHECK_TYPE(&PyList_Type, py_password, return false;);
8589 0 : r->in.dwPwSize = PyList_GET_SIZE(py_password);
8590 0 : if (py_display_name == NULL) {
8591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name");
8592 0 : return false;
8593 : }
8594 0 : if (py_display_name == Py_None) {
8595 0 : r->in.display_name = NULL;
8596 : } else {
8597 0 : r->in.display_name = NULL;
8598 : {
8599 : const char *test_str;
8600 : const char *talloc_str;
8601 0 : PyObject *unicode = NULL;
8602 0 : if (PyUnicode_Check(py_display_name)) {
8603 0 : unicode = PyUnicode_AsEncodedString(py_display_name, "utf-8", "ignore");
8604 0 : if (unicode == NULL) {
8605 0 : PyErr_NoMemory();
8606 0 : return false;
8607 : }
8608 0 : test_str = PyBytes_AS_STRING(unicode);
8609 0 : } else if (PyBytes_Check(py_display_name)) {
8610 0 : test_str = PyBytes_AS_STRING(py_display_name);
8611 : } else {
8612 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_display_name)->tp_name);
8613 0 : return false;
8614 : }
8615 0 : talloc_str = talloc_strdup(r, test_str);
8616 0 : if (unicode != NULL) {
8617 0 : Py_DECREF(unicode);
8618 : }
8619 0 : if (talloc_str == NULL) {
8620 0 : PyErr_NoMemory();
8621 0 : return false;
8622 : }
8623 0 : r->in.display_name = talloc_str;
8624 : }
8625 : }
8626 0 : return true;
8627 : }
8628 :
8629 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfigW_args_out(struct svcctl_ChangeServiceConfigW *r)
8630 : {
8631 : PyObject *result;
8632 : PyObject *py_tag_id;
8633 0 : if (r->out.tag_id == NULL) {
8634 0 : py_tag_id = Py_None;
8635 0 : Py_INCREF(py_tag_id);
8636 : } else {
8637 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*r->out.tag_id);
8638 : }
8639 0 : result = py_tag_id;
8640 0 : if (!W_ERROR_IS_OK(r->out.result)) {
8641 0 : PyErr_SetWERROR(r->out.result);
8642 0 : return NULL;
8643 : }
8644 :
8645 0 : return result;
8646 : }
8647 :
8648 :
8649 0 : static PyObject *py_svcctl_CreateServiceW_in_get_scmanager_handle(PyObject *obj, void *closure)
8650 : {
8651 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8652 : PyObject *py_scmanager_handle;
8653 0 : if (object->in.scmanager_handle == NULL) {
8654 0 : Py_RETURN_NONE;
8655 : }
8656 0 : py_scmanager_handle = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager_handle, object->in.scmanager_handle);
8657 0 : return py_scmanager_handle;
8658 : }
8659 :
8660 0 : static int py_svcctl_CreateServiceW_in_set_scmanager_handle(PyObject *py_obj, PyObject *value, void *closure)
8661 : {
8662 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8663 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager_handle));
8664 0 : if (value == NULL) {
8665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager_handle");
8666 0 : return -1;
8667 : }
8668 0 : object->in.scmanager_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager_handle);
8669 0 : if (object->in.scmanager_handle == NULL) {
8670 0 : PyErr_NoMemory();
8671 0 : return -1;
8672 : }
8673 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
8674 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8675 0 : PyErr_NoMemory();
8676 0 : return -1;
8677 : }
8678 0 : object->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(value);
8679 0 : return 0;
8680 : }
8681 :
8682 0 : static PyObject *py_svcctl_CreateServiceW_in_get_ServiceName(PyObject *obj, void *closure)
8683 : {
8684 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8685 : PyObject *py_ServiceName;
8686 0 : if (object->in.ServiceName == NULL) {
8687 0 : py_ServiceName = Py_None;
8688 0 : Py_INCREF(py_ServiceName);
8689 : } else {
8690 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
8691 : }
8692 0 : return py_ServiceName;
8693 : }
8694 :
8695 0 : static int py_svcctl_CreateServiceW_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
8696 : {
8697 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8698 0 : if (value == NULL) {
8699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
8700 0 : return -1;
8701 : }
8702 : {
8703 : const char *test_str;
8704 : const char *talloc_str;
8705 0 : PyObject *unicode = NULL;
8706 0 : if (PyUnicode_Check(value)) {
8707 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8708 0 : if (unicode == NULL) {
8709 0 : PyErr_NoMemory();
8710 0 : return -1;
8711 : }
8712 0 : test_str = PyBytes_AS_STRING(unicode);
8713 0 : } else if (PyBytes_Check(value)) {
8714 0 : test_str = PyBytes_AS_STRING(value);
8715 : } else {
8716 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8717 0 : return -1;
8718 : }
8719 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8720 0 : if (unicode != NULL) {
8721 0 : Py_DECREF(unicode);
8722 : }
8723 0 : if (talloc_str == NULL) {
8724 0 : PyErr_NoMemory();
8725 0 : return -1;
8726 : }
8727 0 : object->in.ServiceName = talloc_str;
8728 : }
8729 0 : return 0;
8730 : }
8731 :
8732 0 : static PyObject *py_svcctl_CreateServiceW_in_get_DisplayName(PyObject *obj, void *closure)
8733 : {
8734 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8735 : PyObject *py_DisplayName;
8736 0 : if (object->in.DisplayName == NULL) {
8737 0 : Py_RETURN_NONE;
8738 : }
8739 0 : if (object->in.DisplayName == NULL) {
8740 0 : py_DisplayName = Py_None;
8741 0 : Py_INCREF(py_DisplayName);
8742 : } else {
8743 0 : if (object->in.DisplayName == NULL) {
8744 0 : py_DisplayName = Py_None;
8745 0 : Py_INCREF(py_DisplayName);
8746 : } else {
8747 0 : py_DisplayName = PyUnicode_Decode(object->in.DisplayName, strlen(object->in.DisplayName), "utf-8", "ignore");
8748 : }
8749 : }
8750 0 : return py_DisplayName;
8751 : }
8752 :
8753 0 : static int py_svcctl_CreateServiceW_in_set_DisplayName(PyObject *py_obj, PyObject *value, void *closure)
8754 : {
8755 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8756 0 : if (value == NULL) {
8757 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DisplayName");
8758 0 : return -1;
8759 : }
8760 0 : if (value == Py_None) {
8761 0 : object->in.DisplayName = NULL;
8762 : } else {
8763 0 : object->in.DisplayName = NULL;
8764 : {
8765 : const char *test_str;
8766 : const char *talloc_str;
8767 0 : PyObject *unicode = NULL;
8768 0 : if (PyUnicode_Check(value)) {
8769 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8770 0 : if (unicode == NULL) {
8771 0 : PyErr_NoMemory();
8772 0 : return -1;
8773 : }
8774 0 : test_str = PyBytes_AS_STRING(unicode);
8775 0 : } else if (PyBytes_Check(value)) {
8776 0 : test_str = PyBytes_AS_STRING(value);
8777 : } else {
8778 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8779 0 : return -1;
8780 : }
8781 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8782 0 : if (unicode != NULL) {
8783 0 : Py_DECREF(unicode);
8784 : }
8785 0 : if (talloc_str == NULL) {
8786 0 : PyErr_NoMemory();
8787 0 : return -1;
8788 : }
8789 0 : object->in.DisplayName = talloc_str;
8790 : }
8791 : }
8792 0 : return 0;
8793 : }
8794 :
8795 0 : static PyObject *py_svcctl_CreateServiceW_in_get_desired_access(PyObject *obj, void *closure)
8796 : {
8797 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8798 : PyObject *py_desired_access;
8799 0 : py_desired_access = PyLong_FromUnsignedLongLong((uint32_t)object->in.desired_access);
8800 0 : return py_desired_access;
8801 : }
8802 :
8803 0 : static int py_svcctl_CreateServiceW_in_set_desired_access(PyObject *py_obj, PyObject *value, void *closure)
8804 : {
8805 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8806 0 : if (value == NULL) {
8807 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.desired_access");
8808 0 : return -1;
8809 : }
8810 : {
8811 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.desired_access));
8812 0 : if (PyLong_Check(value)) {
8813 : unsigned long long test_var;
8814 0 : test_var = PyLong_AsUnsignedLongLong(value);
8815 0 : if (PyErr_Occurred() != NULL) {
8816 0 : return -1;
8817 : }
8818 0 : if (test_var > uint_max) {
8819 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8820 : PyLong_Type.tp_name, uint_max, test_var);
8821 0 : return -1;
8822 : }
8823 0 : object->in.desired_access = test_var;
8824 : } else {
8825 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8826 : PyLong_Type.tp_name);
8827 0 : return -1;
8828 : }
8829 : }
8830 0 : return 0;
8831 : }
8832 :
8833 0 : static PyObject *py_svcctl_CreateServiceW_in_get_type(PyObject *obj, void *closure)
8834 : {
8835 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8836 : PyObject *py_type;
8837 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
8838 0 : return py_type;
8839 : }
8840 :
8841 0 : static int py_svcctl_CreateServiceW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
8842 : {
8843 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8844 0 : if (value == NULL) {
8845 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
8846 0 : return -1;
8847 : }
8848 : {
8849 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
8850 0 : if (PyLong_Check(value)) {
8851 : unsigned long long test_var;
8852 0 : test_var = PyLong_AsUnsignedLongLong(value);
8853 0 : if (PyErr_Occurred() != NULL) {
8854 0 : return -1;
8855 : }
8856 0 : if (test_var > uint_max) {
8857 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8858 : PyLong_Type.tp_name, uint_max, test_var);
8859 0 : return -1;
8860 : }
8861 0 : object->in.type = test_var;
8862 : } else {
8863 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8864 : PyLong_Type.tp_name);
8865 0 : return -1;
8866 : }
8867 : }
8868 0 : return 0;
8869 : }
8870 :
8871 0 : static PyObject *py_svcctl_CreateServiceW_in_get_start_type(PyObject *obj, void *closure)
8872 : {
8873 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8874 : PyObject *py_start_type;
8875 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
8876 0 : return py_start_type;
8877 : }
8878 :
8879 0 : static int py_svcctl_CreateServiceW_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
8880 : {
8881 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8882 0 : if (value == NULL) {
8883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
8884 0 : return -1;
8885 : }
8886 : {
8887 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
8888 0 : if (PyLong_Check(value)) {
8889 : unsigned long long test_var;
8890 0 : test_var = PyLong_AsUnsignedLongLong(value);
8891 0 : if (PyErr_Occurred() != NULL) {
8892 0 : return -1;
8893 : }
8894 0 : if (test_var > uint_max) {
8895 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8896 : PyLong_Type.tp_name, uint_max, test_var);
8897 0 : return -1;
8898 : }
8899 0 : object->in.start_type = test_var;
8900 : } else {
8901 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8902 : PyLong_Type.tp_name);
8903 0 : return -1;
8904 : }
8905 : }
8906 0 : return 0;
8907 : }
8908 :
8909 0 : static PyObject *py_svcctl_CreateServiceW_in_get_error_control(PyObject *obj, void *closure)
8910 : {
8911 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8912 : PyObject *py_error_control;
8913 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
8914 0 : return py_error_control;
8915 : }
8916 :
8917 0 : static int py_svcctl_CreateServiceW_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
8918 : {
8919 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8920 0 : if (value == NULL) {
8921 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
8922 0 : return -1;
8923 : }
8924 : {
8925 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
8926 0 : if (PyLong_Check(value)) {
8927 : unsigned long long test_var;
8928 0 : test_var = PyLong_AsUnsignedLongLong(value);
8929 0 : if (PyErr_Occurred() != NULL) {
8930 0 : return -1;
8931 : }
8932 0 : if (test_var > uint_max) {
8933 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8934 : PyLong_Type.tp_name, uint_max, test_var);
8935 0 : return -1;
8936 : }
8937 0 : object->in.error_control = test_var;
8938 : } else {
8939 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8940 : PyLong_Type.tp_name);
8941 0 : return -1;
8942 : }
8943 : }
8944 0 : return 0;
8945 : }
8946 :
8947 0 : static PyObject *py_svcctl_CreateServiceW_in_get_binary_path(PyObject *obj, void *closure)
8948 : {
8949 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
8950 : PyObject *py_binary_path;
8951 0 : if (object->in.binary_path == NULL) {
8952 0 : py_binary_path = Py_None;
8953 0 : Py_INCREF(py_binary_path);
8954 : } else {
8955 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
8956 : }
8957 0 : return py_binary_path;
8958 : }
8959 :
8960 0 : static int py_svcctl_CreateServiceW_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
8961 : {
8962 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
8963 0 : if (value == NULL) {
8964 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
8965 0 : return -1;
8966 : }
8967 : {
8968 : const char *test_str;
8969 : const char *talloc_str;
8970 0 : PyObject *unicode = NULL;
8971 0 : if (PyUnicode_Check(value)) {
8972 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8973 0 : if (unicode == NULL) {
8974 0 : PyErr_NoMemory();
8975 0 : return -1;
8976 : }
8977 0 : test_str = PyBytes_AS_STRING(unicode);
8978 0 : } else if (PyBytes_Check(value)) {
8979 0 : test_str = PyBytes_AS_STRING(value);
8980 : } else {
8981 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8982 0 : return -1;
8983 : }
8984 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8985 0 : if (unicode != NULL) {
8986 0 : Py_DECREF(unicode);
8987 : }
8988 0 : if (talloc_str == NULL) {
8989 0 : PyErr_NoMemory();
8990 0 : return -1;
8991 : }
8992 0 : object->in.binary_path = talloc_str;
8993 : }
8994 0 : return 0;
8995 : }
8996 :
8997 0 : static PyObject *py_svcctl_CreateServiceW_in_get_LoadOrderGroupKey(PyObject *obj, void *closure)
8998 : {
8999 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9000 : PyObject *py_LoadOrderGroupKey;
9001 0 : if (object->in.LoadOrderGroupKey == NULL) {
9002 0 : Py_RETURN_NONE;
9003 : }
9004 0 : if (object->in.LoadOrderGroupKey == NULL) {
9005 0 : py_LoadOrderGroupKey = Py_None;
9006 0 : Py_INCREF(py_LoadOrderGroupKey);
9007 : } else {
9008 0 : if (object->in.LoadOrderGroupKey == NULL) {
9009 0 : py_LoadOrderGroupKey = Py_None;
9010 0 : Py_INCREF(py_LoadOrderGroupKey);
9011 : } else {
9012 0 : py_LoadOrderGroupKey = PyUnicode_Decode(object->in.LoadOrderGroupKey, strlen(object->in.LoadOrderGroupKey), "utf-8", "ignore");
9013 : }
9014 : }
9015 0 : return py_LoadOrderGroupKey;
9016 : }
9017 :
9018 0 : static int py_svcctl_CreateServiceW_in_set_LoadOrderGroupKey(PyObject *py_obj, PyObject *value, void *closure)
9019 : {
9020 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9021 0 : if (value == NULL) {
9022 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.LoadOrderGroupKey");
9023 0 : return -1;
9024 : }
9025 0 : if (value == Py_None) {
9026 0 : object->in.LoadOrderGroupKey = NULL;
9027 : } else {
9028 0 : object->in.LoadOrderGroupKey = NULL;
9029 : {
9030 : const char *test_str;
9031 : const char *talloc_str;
9032 0 : PyObject *unicode = NULL;
9033 0 : if (PyUnicode_Check(value)) {
9034 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9035 0 : if (unicode == NULL) {
9036 0 : PyErr_NoMemory();
9037 0 : return -1;
9038 : }
9039 0 : test_str = PyBytes_AS_STRING(unicode);
9040 0 : } else if (PyBytes_Check(value)) {
9041 0 : test_str = PyBytes_AS_STRING(value);
9042 : } else {
9043 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9044 0 : return -1;
9045 : }
9046 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9047 0 : if (unicode != NULL) {
9048 0 : Py_DECREF(unicode);
9049 : }
9050 0 : if (talloc_str == NULL) {
9051 0 : PyErr_NoMemory();
9052 0 : return -1;
9053 : }
9054 0 : object->in.LoadOrderGroupKey = talloc_str;
9055 : }
9056 : }
9057 0 : return 0;
9058 : }
9059 :
9060 0 : static PyObject *py_svcctl_CreateServiceW_in_get_TagId(PyObject *obj, void *closure)
9061 : {
9062 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9063 : PyObject *py_TagId;
9064 0 : if (object->in.TagId == NULL) {
9065 0 : Py_RETURN_NONE;
9066 : }
9067 0 : if (object->in.TagId == NULL) {
9068 0 : py_TagId = Py_None;
9069 0 : Py_INCREF(py_TagId);
9070 : } else {
9071 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->in.TagId);
9072 : }
9073 0 : return py_TagId;
9074 : }
9075 :
9076 0 : static int py_svcctl_CreateServiceW_in_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
9077 : {
9078 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9079 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.TagId));
9080 0 : if (value == NULL) {
9081 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.TagId");
9082 0 : return -1;
9083 : }
9084 0 : if (value == Py_None) {
9085 0 : object->in.TagId = NULL;
9086 : } else {
9087 0 : object->in.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.TagId);
9088 0 : if (object->in.TagId == NULL) {
9089 0 : PyErr_NoMemory();
9090 0 : return -1;
9091 : }
9092 : {
9093 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.TagId));
9094 0 : if (PyLong_Check(value)) {
9095 : unsigned long long test_var;
9096 0 : test_var = PyLong_AsUnsignedLongLong(value);
9097 0 : if (PyErr_Occurred() != NULL) {
9098 0 : return -1;
9099 : }
9100 0 : if (test_var > uint_max) {
9101 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9102 : PyLong_Type.tp_name, uint_max, test_var);
9103 0 : return -1;
9104 : }
9105 0 : *object->in.TagId = test_var;
9106 : } else {
9107 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9108 : PyLong_Type.tp_name);
9109 0 : return -1;
9110 : }
9111 : }
9112 : }
9113 0 : return 0;
9114 : }
9115 :
9116 0 : static PyObject *py_svcctl_CreateServiceW_out_get_TagId(PyObject *obj, void *closure)
9117 : {
9118 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9119 : PyObject *py_TagId;
9120 0 : if (object->out.TagId == NULL) {
9121 0 : Py_RETURN_NONE;
9122 : }
9123 0 : if (object->out.TagId == NULL) {
9124 0 : py_TagId = Py_None;
9125 0 : Py_INCREF(py_TagId);
9126 : } else {
9127 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.TagId);
9128 : }
9129 0 : return py_TagId;
9130 : }
9131 :
9132 0 : static int py_svcctl_CreateServiceW_out_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
9133 : {
9134 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9135 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.TagId));
9136 0 : if (value == NULL) {
9137 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.TagId");
9138 0 : return -1;
9139 : }
9140 0 : if (value == Py_None) {
9141 0 : object->out.TagId = NULL;
9142 : } else {
9143 0 : object->out.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.TagId);
9144 0 : if (object->out.TagId == NULL) {
9145 0 : PyErr_NoMemory();
9146 0 : return -1;
9147 : }
9148 : {
9149 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.TagId));
9150 0 : if (PyLong_Check(value)) {
9151 : unsigned long long test_var;
9152 0 : test_var = PyLong_AsUnsignedLongLong(value);
9153 0 : if (PyErr_Occurred() != NULL) {
9154 0 : return -1;
9155 : }
9156 0 : if (test_var > uint_max) {
9157 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9158 : PyLong_Type.tp_name, uint_max, test_var);
9159 0 : return -1;
9160 : }
9161 0 : *object->out.TagId = test_var;
9162 : } else {
9163 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9164 : PyLong_Type.tp_name);
9165 0 : return -1;
9166 : }
9167 : }
9168 : }
9169 0 : return 0;
9170 : }
9171 :
9172 0 : static PyObject *py_svcctl_CreateServiceW_in_get_dependencies(PyObject *obj, void *closure)
9173 : {
9174 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9175 : PyObject *py_dependencies;
9176 0 : if (object->in.dependencies == NULL) {
9177 0 : Py_RETURN_NONE;
9178 : }
9179 0 : if (object->in.dependencies == NULL) {
9180 0 : py_dependencies = Py_None;
9181 0 : Py_INCREF(py_dependencies);
9182 : } else {
9183 0 : py_dependencies = PyList_New(object->in.dependencies_size);
9184 0 : if (py_dependencies == NULL) {
9185 0 : return NULL;
9186 : }
9187 : {
9188 : int dependencies_cntr_1;
9189 0 : for (dependencies_cntr_1 = 0; dependencies_cntr_1 < (object->in.dependencies_size); dependencies_cntr_1++) {
9190 : PyObject *py_dependencies_1;
9191 0 : py_dependencies_1 = PyLong_FromLong((uint16_t)object->in.dependencies[dependencies_cntr_1]);
9192 0 : PyList_SetItem(py_dependencies, dependencies_cntr_1, py_dependencies_1);
9193 : }
9194 : }
9195 : }
9196 0 : return py_dependencies;
9197 : }
9198 :
9199 0 : static int py_svcctl_CreateServiceW_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
9200 : {
9201 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9202 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dependencies));
9203 0 : if (value == NULL) {
9204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
9205 0 : return -1;
9206 : }
9207 0 : if (value == Py_None) {
9208 0 : object->in.dependencies = NULL;
9209 : } else {
9210 0 : object->in.dependencies = NULL;
9211 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9212 : {
9213 : int dependencies_cntr_1;
9214 0 : object->in.dependencies = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dependencies, PyList_GET_SIZE(value));
9215 0 : if (!object->in.dependencies) { return -1;; }
9216 0 : talloc_set_name_const(object->in.dependencies, "ARRAY: object->in.dependencies");
9217 0 : for (dependencies_cntr_1 = 0; dependencies_cntr_1 < PyList_GET_SIZE(value); dependencies_cntr_1++) {
9218 0 : if (PyList_GET_ITEM(value, dependencies_cntr_1) == NULL) {
9219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies[dependencies_cntr_1]");
9220 0 : return -1;
9221 : }
9222 : {
9223 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dependencies[dependencies_cntr_1]));
9224 0 : if (PyLong_Check(PyList_GET_ITEM(value, dependencies_cntr_1))) {
9225 : unsigned long long test_var;
9226 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, dependencies_cntr_1));
9227 0 : if (PyErr_Occurred() != NULL) {
9228 0 : return -1;
9229 : }
9230 0 : if (test_var > uint_max) {
9231 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9232 : PyLong_Type.tp_name, uint_max, test_var);
9233 0 : return -1;
9234 : }
9235 0 : object->in.dependencies[dependencies_cntr_1] = test_var;
9236 : } else {
9237 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9238 : PyLong_Type.tp_name);
9239 0 : return -1;
9240 : }
9241 : }
9242 : }
9243 : }
9244 : }
9245 0 : return 0;
9246 : }
9247 :
9248 0 : static PyObject *py_svcctl_CreateServiceW_in_get_dependencies_size(PyObject *obj, void *closure)
9249 : {
9250 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9251 : PyObject *py_dependencies_size;
9252 0 : py_dependencies_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.dependencies_size);
9253 0 : return py_dependencies_size;
9254 : }
9255 :
9256 0 : static int py_svcctl_CreateServiceW_in_set_dependencies_size(PyObject *py_obj, PyObject *value, void *closure)
9257 : {
9258 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9259 0 : if (value == NULL) {
9260 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies_size");
9261 0 : return -1;
9262 : }
9263 : {
9264 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dependencies_size));
9265 0 : if (PyLong_Check(value)) {
9266 : unsigned long long test_var;
9267 0 : test_var = PyLong_AsUnsignedLongLong(value);
9268 0 : if (PyErr_Occurred() != NULL) {
9269 0 : return -1;
9270 : }
9271 0 : if (test_var > uint_max) {
9272 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9273 : PyLong_Type.tp_name, uint_max, test_var);
9274 0 : return -1;
9275 : }
9276 0 : object->in.dependencies_size = test_var;
9277 : } else {
9278 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9279 : PyLong_Type.tp_name);
9280 0 : return -1;
9281 : }
9282 : }
9283 0 : return 0;
9284 : }
9285 :
9286 0 : static PyObject *py_svcctl_CreateServiceW_in_get_service_start_name(PyObject *obj, void *closure)
9287 : {
9288 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9289 : PyObject *py_service_start_name;
9290 0 : if (object->in.service_start_name == NULL) {
9291 0 : Py_RETURN_NONE;
9292 : }
9293 0 : if (object->in.service_start_name == NULL) {
9294 0 : py_service_start_name = Py_None;
9295 0 : Py_INCREF(py_service_start_name);
9296 : } else {
9297 0 : if (object->in.service_start_name == NULL) {
9298 0 : py_service_start_name = Py_None;
9299 0 : Py_INCREF(py_service_start_name);
9300 : } else {
9301 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
9302 : }
9303 : }
9304 0 : return py_service_start_name;
9305 : }
9306 :
9307 0 : static int py_svcctl_CreateServiceW_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
9308 : {
9309 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9310 0 : if (value == NULL) {
9311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
9312 0 : return -1;
9313 : }
9314 0 : if (value == Py_None) {
9315 0 : object->in.service_start_name = NULL;
9316 : } else {
9317 0 : object->in.service_start_name = NULL;
9318 : {
9319 : const char *test_str;
9320 : const char *talloc_str;
9321 0 : PyObject *unicode = NULL;
9322 0 : if (PyUnicode_Check(value)) {
9323 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9324 0 : if (unicode == NULL) {
9325 0 : PyErr_NoMemory();
9326 0 : return -1;
9327 : }
9328 0 : test_str = PyBytes_AS_STRING(unicode);
9329 0 : } else if (PyBytes_Check(value)) {
9330 0 : test_str = PyBytes_AS_STRING(value);
9331 : } else {
9332 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9333 0 : return -1;
9334 : }
9335 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9336 0 : if (unicode != NULL) {
9337 0 : Py_DECREF(unicode);
9338 : }
9339 0 : if (talloc_str == NULL) {
9340 0 : PyErr_NoMemory();
9341 0 : return -1;
9342 : }
9343 0 : object->in.service_start_name = talloc_str;
9344 : }
9345 : }
9346 0 : return 0;
9347 : }
9348 :
9349 0 : static PyObject *py_svcctl_CreateServiceW_in_get_password(PyObject *obj, void *closure)
9350 : {
9351 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9352 : PyObject *py_password;
9353 0 : if (object->in.password == NULL) {
9354 0 : Py_RETURN_NONE;
9355 : }
9356 0 : if (object->in.password == NULL) {
9357 0 : py_password = Py_None;
9358 0 : Py_INCREF(py_password);
9359 : } else {
9360 0 : py_password = PyList_New(object->in.password_size);
9361 0 : if (py_password == NULL) {
9362 0 : return NULL;
9363 : }
9364 : {
9365 : int password_cntr_1;
9366 0 : for (password_cntr_1 = 0; password_cntr_1 < (object->in.password_size); password_cntr_1++) {
9367 : PyObject *py_password_1;
9368 0 : py_password_1 = PyLong_FromLong((uint16_t)object->in.password[password_cntr_1]);
9369 0 : PyList_SetItem(py_password, password_cntr_1, py_password_1);
9370 : }
9371 : }
9372 : }
9373 0 : return py_password;
9374 : }
9375 :
9376 0 : static int py_svcctl_CreateServiceW_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
9377 : {
9378 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9379 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.password));
9380 0 : if (value == NULL) {
9381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
9382 0 : return -1;
9383 : }
9384 0 : if (value == Py_None) {
9385 0 : object->in.password = NULL;
9386 : } else {
9387 0 : object->in.password = NULL;
9388 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9389 : {
9390 : int password_cntr_1;
9391 0 : object->in.password = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.password, PyList_GET_SIZE(value));
9392 0 : if (!object->in.password) { return -1;; }
9393 0 : talloc_set_name_const(object->in.password, "ARRAY: object->in.password");
9394 0 : for (password_cntr_1 = 0; password_cntr_1 < PyList_GET_SIZE(value); password_cntr_1++) {
9395 0 : if (PyList_GET_ITEM(value, password_cntr_1) == NULL) {
9396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password[password_cntr_1]");
9397 0 : return -1;
9398 : }
9399 : {
9400 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.password[password_cntr_1]));
9401 0 : if (PyLong_Check(PyList_GET_ITEM(value, password_cntr_1))) {
9402 : unsigned long long test_var;
9403 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, password_cntr_1));
9404 0 : if (PyErr_Occurred() != NULL) {
9405 0 : return -1;
9406 : }
9407 0 : if (test_var > uint_max) {
9408 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9409 : PyLong_Type.tp_name, uint_max, test_var);
9410 0 : return -1;
9411 : }
9412 0 : object->in.password[password_cntr_1] = test_var;
9413 : } else {
9414 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9415 : PyLong_Type.tp_name);
9416 0 : return -1;
9417 : }
9418 : }
9419 : }
9420 : }
9421 : }
9422 0 : return 0;
9423 : }
9424 :
9425 0 : static PyObject *py_svcctl_CreateServiceW_in_get_password_size(PyObject *obj, void *closure)
9426 : {
9427 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9428 : PyObject *py_password_size;
9429 0 : py_password_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.password_size);
9430 0 : return py_password_size;
9431 : }
9432 :
9433 0 : static int py_svcctl_CreateServiceW_in_set_password_size(PyObject *py_obj, PyObject *value, void *closure)
9434 : {
9435 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9436 0 : if (value == NULL) {
9437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password_size");
9438 0 : return -1;
9439 : }
9440 : {
9441 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.password_size));
9442 0 : if (PyLong_Check(value)) {
9443 : unsigned long long test_var;
9444 0 : test_var = PyLong_AsUnsignedLongLong(value);
9445 0 : if (PyErr_Occurred() != NULL) {
9446 0 : return -1;
9447 : }
9448 0 : if (test_var > uint_max) {
9449 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9450 : PyLong_Type.tp_name, uint_max, test_var);
9451 0 : return -1;
9452 : }
9453 0 : object->in.password_size = test_var;
9454 : } else {
9455 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9456 : PyLong_Type.tp_name);
9457 0 : return -1;
9458 : }
9459 : }
9460 0 : return 0;
9461 : }
9462 :
9463 0 : static PyObject *py_svcctl_CreateServiceW_out_get_handle(PyObject *obj, void *closure)
9464 : {
9465 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9466 : PyObject *py_handle;
9467 0 : if (object->out.handle == NULL) {
9468 0 : Py_RETURN_NONE;
9469 : }
9470 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
9471 0 : return py_handle;
9472 : }
9473 :
9474 0 : static int py_svcctl_CreateServiceW_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
9475 : {
9476 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9477 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
9478 0 : if (value == NULL) {
9479 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
9480 0 : return -1;
9481 : }
9482 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
9483 0 : if (object->out.handle == NULL) {
9484 0 : PyErr_NoMemory();
9485 0 : return -1;
9486 : }
9487 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
9488 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9489 0 : PyErr_NoMemory();
9490 0 : return -1;
9491 : }
9492 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
9493 0 : return 0;
9494 : }
9495 :
9496 0 : static PyObject *py_svcctl_CreateServiceW_get_result(PyObject *obj, void *closure)
9497 : {
9498 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(obj);
9499 : PyObject *py_result;
9500 0 : py_result = PyErr_FromWERROR(object->out.result);
9501 0 : return py_result;
9502 : }
9503 :
9504 0 : static int py_svcctl_CreateServiceW_set_result(PyObject *py_obj, PyObject *value, void *closure)
9505 : {
9506 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9507 0 : if (value == NULL) {
9508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
9509 0 : return -1;
9510 : }
9511 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
9512 0 : return 0;
9513 : }
9514 :
9515 : static PyGetSetDef py_svcctl_CreateServiceW_getsetters[] = {
9516 : {
9517 : .name = discard_const_p(char, "in_scmanager_handle"),
9518 : .get = py_svcctl_CreateServiceW_in_get_scmanager_handle,
9519 : .set = py_svcctl_CreateServiceW_in_set_scmanager_handle,
9520 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
9521 : },
9522 : {
9523 : .name = discard_const_p(char, "in_ServiceName"),
9524 : .get = py_svcctl_CreateServiceW_in_get_ServiceName,
9525 : .set = py_svcctl_CreateServiceW_in_set_ServiceName,
9526 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9527 : },
9528 : {
9529 : .name = discard_const_p(char, "in_DisplayName"),
9530 : .get = py_svcctl_CreateServiceW_in_get_DisplayName,
9531 : .set = py_svcctl_CreateServiceW_in_set_DisplayName,
9532 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9533 : },
9534 : {
9535 : .name = discard_const_p(char, "in_desired_access"),
9536 : .get = py_svcctl_CreateServiceW_in_get_desired_access,
9537 : .set = py_svcctl_CreateServiceW_in_set_desired_access,
9538 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9539 : },
9540 : {
9541 : .name = discard_const_p(char, "in_type"),
9542 : .get = py_svcctl_CreateServiceW_in_get_type,
9543 : .set = py_svcctl_CreateServiceW_in_set_type,
9544 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9545 : },
9546 : {
9547 : .name = discard_const_p(char, "in_start_type"),
9548 : .get = py_svcctl_CreateServiceW_in_get_start_type,
9549 : .set = py_svcctl_CreateServiceW_in_set_start_type,
9550 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
9551 : },
9552 : {
9553 : .name = discard_const_p(char, "in_error_control"),
9554 : .get = py_svcctl_CreateServiceW_in_get_error_control,
9555 : .set = py_svcctl_CreateServiceW_in_set_error_control,
9556 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
9557 : },
9558 : {
9559 : .name = discard_const_p(char, "in_binary_path"),
9560 : .get = py_svcctl_CreateServiceW_in_get_binary_path,
9561 : .set = py_svcctl_CreateServiceW_in_set_binary_path,
9562 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9563 : },
9564 : {
9565 : .name = discard_const_p(char, "in_LoadOrderGroupKey"),
9566 : .get = py_svcctl_CreateServiceW_in_get_LoadOrderGroupKey,
9567 : .set = py_svcctl_CreateServiceW_in_set_LoadOrderGroupKey,
9568 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9569 : },
9570 : {
9571 : .name = discard_const_p(char, "in_TagId"),
9572 : .get = py_svcctl_CreateServiceW_in_get_TagId,
9573 : .set = py_svcctl_CreateServiceW_in_set_TagId,
9574 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9575 : },
9576 : {
9577 : .name = discard_const_p(char, "out_TagId"),
9578 : .get = py_svcctl_CreateServiceW_out_get_TagId,
9579 : .set = py_svcctl_CreateServiceW_out_set_TagId,
9580 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9581 : },
9582 : {
9583 : .name = discard_const_p(char, "in_dependencies"),
9584 : .get = py_svcctl_CreateServiceW_in_get_dependencies,
9585 : .set = py_svcctl_CreateServiceW_in_set_dependencies,
9586 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9587 : },
9588 : {
9589 : .name = discard_const_p(char, "in_dependencies_size"),
9590 : .get = py_svcctl_CreateServiceW_in_get_dependencies_size,
9591 : .set = py_svcctl_CreateServiceW_in_set_dependencies_size,
9592 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9593 : },
9594 : {
9595 : .name = discard_const_p(char, "in_service_start_name"),
9596 : .get = py_svcctl_CreateServiceW_in_get_service_start_name,
9597 : .set = py_svcctl_CreateServiceW_in_set_service_start_name,
9598 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9599 : },
9600 : {
9601 : .name = discard_const_p(char, "in_password"),
9602 : .get = py_svcctl_CreateServiceW_in_get_password,
9603 : .set = py_svcctl_CreateServiceW_in_set_password,
9604 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9605 : },
9606 : {
9607 : .name = discard_const_p(char, "in_password_size"),
9608 : .get = py_svcctl_CreateServiceW_in_get_password_size,
9609 : .set = py_svcctl_CreateServiceW_in_set_password_size,
9610 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9611 : },
9612 : {
9613 : .name = discard_const_p(char, "out_handle"),
9614 : .get = py_svcctl_CreateServiceW_out_get_handle,
9615 : .set = py_svcctl_CreateServiceW_out_set_handle,
9616 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
9617 : },
9618 : {
9619 : .name = discard_const_p(char, "result"),
9620 : .get = py_svcctl_CreateServiceW_get_result,
9621 : .set = py_svcctl_CreateServiceW_set_result,
9622 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
9623 : },
9624 : { .name = NULL }
9625 : };
9626 :
9627 0 : static PyObject *py_svcctl_CreateServiceW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9628 : {
9629 0 : PyObject *self = pytalloc_new(struct svcctl_CreateServiceW, type);
9630 0 : struct svcctl_CreateServiceW *_self = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(self);
9631 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
9632 0 : _self->in.scmanager_handle = talloc_zero(mem_ctx, struct policy_handle);
9633 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
9634 0 : return self;
9635 : }
9636 :
9637 0 : static PyObject *py_svcctl_CreateServiceW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
9638 : {
9639 :
9640 :
9641 0 : return PyLong_FromLong(12);
9642 : }
9643 :
9644 0 : static PyObject *py_svcctl_CreateServiceW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
9645 : {
9646 0 : const struct ndr_interface_call *call = NULL;
9647 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9648 0 : PyObject *ret = NULL;
9649 0 : struct ndr_push *push = NULL;
9650 : DATA_BLOB blob;
9651 : enum ndr_err_code err;
9652 :
9653 0 : if (ndr_table_svcctl.num_calls < 13) {
9654 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceW_ndr_pack");
9655 0 : return NULL;
9656 : }
9657 0 : call = &ndr_table_svcctl.calls[12];
9658 :
9659 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
9660 0 : if (push == NULL) {
9661 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9662 0 : return NULL;
9663 : }
9664 :
9665 0 : push->flags |= ndr_push_flags;
9666 :
9667 0 : err = call->ndr_push(push, ndr_inout_flags, object);
9668 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9669 0 : TALLOC_FREE(push);
9670 0 : PyErr_SetNdrError(err);
9671 0 : return NULL;
9672 : }
9673 0 : blob = ndr_push_blob(push);
9674 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9675 0 : TALLOC_FREE(push);
9676 0 : return ret;
9677 : }
9678 :
9679 0 : static PyObject *py_svcctl_CreateServiceW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9680 : {
9681 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9682 0 : PyObject *bigendian_obj = NULL;
9683 0 : PyObject *ndr64_obj = NULL;
9684 0 : uint32_t ndr_push_flags = 0;
9685 :
9686 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
9687 : discard_const_p(char *, kwnames),
9688 : &bigendian_obj,
9689 : &ndr64_obj)) {
9690 0 : return NULL;
9691 : }
9692 :
9693 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9694 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9695 : }
9696 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9697 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9698 : }
9699 :
9700 0 : return py_svcctl_CreateServiceW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
9701 : }
9702 :
9703 0 : static PyObject *py_svcctl_CreateServiceW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9704 : {
9705 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9706 0 : PyObject *bigendian_obj = NULL;
9707 0 : PyObject *ndr64_obj = NULL;
9708 0 : uint32_t ndr_push_flags = 0;
9709 :
9710 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
9711 : discard_const_p(char *, kwnames),
9712 : &bigendian_obj,
9713 : &ndr64_obj)) {
9714 0 : return NULL;
9715 : }
9716 :
9717 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9718 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9719 : }
9720 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9721 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9722 : }
9723 :
9724 0 : return py_svcctl_CreateServiceW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
9725 : }
9726 :
9727 0 : static PyObject *py_svcctl_CreateServiceW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
9728 : {
9729 0 : const struct ndr_interface_call *call = NULL;
9730 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9731 0 : struct ndr_pull *pull = NULL;
9732 : enum ndr_err_code err;
9733 :
9734 0 : if (ndr_table_svcctl.num_calls < 13) {
9735 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceW_ndr_unpack");
9736 0 : return NULL;
9737 : }
9738 0 : call = &ndr_table_svcctl.calls[12];
9739 :
9740 0 : pull = ndr_pull_init_blob(blob, object);
9741 0 : if (pull == NULL) {
9742 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9743 0 : return NULL;
9744 : }
9745 :
9746 0 : pull->flags |= ndr_pull_flags;
9747 :
9748 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
9749 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9750 0 : TALLOC_FREE(pull);
9751 0 : PyErr_SetNdrError(err);
9752 0 : return NULL;
9753 : }
9754 0 : if (!allow_remaining) {
9755 : uint32_t highest_ofs;
9756 :
9757 0 : if (pull->offset > pull->relative_highest_offset) {
9758 0 : highest_ofs = pull->offset;
9759 : } else {
9760 0 : highest_ofs = pull->relative_highest_offset;
9761 : }
9762 0 : if (highest_ofs < pull->data_size) {
9763 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
9764 : "not all bytes consumed ofs[%u] size[%u]",
9765 : highest_ofs, pull->data_size);
9766 0 : TALLOC_FREE(pull);
9767 0 : PyErr_SetNdrError(err);
9768 0 : return NULL;
9769 : }
9770 : }
9771 :
9772 0 : TALLOC_FREE(pull);
9773 0 : Py_RETURN_NONE;
9774 : }
9775 :
9776 0 : static PyObject *py_svcctl_CreateServiceW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9777 : {
9778 : DATA_BLOB blob;
9779 0 : Py_ssize_t blob_length = 0;
9780 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9781 0 : PyObject *bigendian_obj = NULL;
9782 0 : PyObject *ndr64_obj = NULL;
9783 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9784 0 : PyObject *allow_remaining_obj = NULL;
9785 0 : bool allow_remaining = false;
9786 :
9787 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
9788 : discard_const_p(char *, kwnames),
9789 : &blob.data, &blob_length,
9790 : &bigendian_obj,
9791 : &ndr64_obj,
9792 : &allow_remaining_obj)) {
9793 0 : return NULL;
9794 : }
9795 0 : blob.length = blob_length;
9796 :
9797 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9798 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9799 : }
9800 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9801 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9802 : }
9803 :
9804 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9805 0 : allow_remaining = true;
9806 : }
9807 :
9808 0 : return py_svcctl_CreateServiceW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
9809 : }
9810 :
9811 0 : static PyObject *py_svcctl_CreateServiceW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9812 : {
9813 : DATA_BLOB blob;
9814 0 : Py_ssize_t blob_length = 0;
9815 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9816 0 : PyObject *bigendian_obj = NULL;
9817 0 : PyObject *ndr64_obj = NULL;
9818 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9819 0 : PyObject *allow_remaining_obj = NULL;
9820 0 : bool allow_remaining = false;
9821 :
9822 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
9823 : discard_const_p(char *, kwnames),
9824 : &blob.data, &blob_length,
9825 : &bigendian_obj,
9826 : &ndr64_obj,
9827 : &allow_remaining_obj)) {
9828 0 : return NULL;
9829 : }
9830 0 : blob.length = blob_length;
9831 :
9832 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9833 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9834 : }
9835 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9836 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9837 : }
9838 :
9839 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9840 0 : allow_remaining = true;
9841 : }
9842 :
9843 0 : return py_svcctl_CreateServiceW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
9844 : }
9845 :
9846 0 : static PyObject *py_svcctl_CreateServiceW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
9847 : {
9848 0 : const struct ndr_interface_call *call = NULL;
9849 0 : struct svcctl_CreateServiceW *object = (struct svcctl_CreateServiceW *)pytalloc_get_ptr(py_obj);
9850 : PyObject *ret;
9851 : char *retstr;
9852 :
9853 0 : if (ndr_table_svcctl.num_calls < 13) {
9854 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceW_ndr_print");
9855 0 : return NULL;
9856 : }
9857 0 : call = &ndr_table_svcctl.calls[12];
9858 :
9859 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
9860 0 : ret = PyUnicode_FromString(retstr);
9861 0 : TALLOC_FREE(retstr);
9862 :
9863 0 : return ret;
9864 : }
9865 :
9866 0 : static PyObject *py_svcctl_CreateServiceW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9867 : {
9868 0 : return py_svcctl_CreateServiceW_ndr_print(py_obj, "svcctl_CreateServiceW_in", NDR_IN);
9869 : }
9870 :
9871 0 : static PyObject *py_svcctl_CreateServiceW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9872 : {
9873 0 : return py_svcctl_CreateServiceW_ndr_print(py_obj, "svcctl_CreateServiceW_out", NDR_OUT);
9874 : }
9875 :
9876 : static PyMethodDef py_svcctl_CreateServiceW_methods[] = {
9877 : { "opnum", (PyCFunction)py_svcctl_CreateServiceW_ndr_opnum, METH_NOARGS|METH_CLASS,
9878 : "svcctl.CreateServiceW.opnum() -> 12 (0x0c) " },
9879 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
9880 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
9881 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
9882 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
9883 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
9884 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
9885 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
9886 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
9887 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CreateServiceW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
9888 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CreateServiceW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
9889 : { NULL, NULL, 0, NULL }
9890 : };
9891 :
9892 :
9893 : static PyTypeObject svcctl_CreateServiceW_Type = {
9894 : PyVarObject_HEAD_INIT(NULL, 0)
9895 : .tp_name = "svcctl.CreateServiceW",
9896 : .tp_getset = py_svcctl_CreateServiceW_getsetters,
9897 : .tp_methods = py_svcctl_CreateServiceW_methods,
9898 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9899 : .tp_new = py_svcctl_CreateServiceW_new,
9900 : };
9901 :
9902 0 : static bool pack_py_svcctl_CreateServiceW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CreateServiceW *r)
9903 : {
9904 : PyObject *py_scmanager_handle;
9905 : PyObject *py_ServiceName;
9906 : PyObject *py_DisplayName;
9907 : PyObject *py_desired_access;
9908 : PyObject *py_type;
9909 : PyObject *py_start_type;
9910 : PyObject *py_error_control;
9911 : PyObject *py_binary_path;
9912 : PyObject *py_LoadOrderGroupKey;
9913 : PyObject *py_TagId;
9914 : PyObject *py_dependencies;
9915 : PyObject *py_service_start_name;
9916 : PyObject *py_password;
9917 0 : const char *kwnames[] = {
9918 : "scmanager_handle", "ServiceName", "DisplayName", "desired_access", "type", "start_type", "error_control", "binary_path", "LoadOrderGroupKey", "TagId", "dependencies", "service_start_name", "password", NULL
9919 : };
9920 :
9921 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)) {
9922 0 : return false;
9923 : }
9924 :
9925 0 : if (py_scmanager_handle == NULL) {
9926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager_handle");
9927 0 : return false;
9928 : }
9929 0 : r->in.scmanager_handle = talloc_ptrtype(r, r->in.scmanager_handle);
9930 0 : if (r->in.scmanager_handle == NULL) {
9931 0 : PyErr_NoMemory();
9932 0 : return false;
9933 : }
9934 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager_handle, return false;);
9935 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager_handle)) == NULL) {
9936 0 : PyErr_NoMemory();
9937 0 : return false;
9938 : }
9939 0 : r->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(py_scmanager_handle);
9940 0 : if (py_ServiceName == NULL) {
9941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
9942 0 : return false;
9943 : }
9944 : {
9945 : const char *test_str;
9946 : const char *talloc_str;
9947 0 : PyObject *unicode = NULL;
9948 0 : if (PyUnicode_Check(py_ServiceName)) {
9949 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
9950 0 : if (unicode == NULL) {
9951 0 : PyErr_NoMemory();
9952 0 : return false;
9953 : }
9954 0 : test_str = PyBytes_AS_STRING(unicode);
9955 0 : } else if (PyBytes_Check(py_ServiceName)) {
9956 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
9957 : } else {
9958 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
9959 0 : return false;
9960 : }
9961 0 : talloc_str = talloc_strdup(r, test_str);
9962 0 : if (unicode != NULL) {
9963 0 : Py_DECREF(unicode);
9964 : }
9965 0 : if (talloc_str == NULL) {
9966 0 : PyErr_NoMemory();
9967 0 : return false;
9968 : }
9969 0 : r->in.ServiceName = talloc_str;
9970 : }
9971 0 : if (py_DisplayName == NULL) {
9972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DisplayName");
9973 0 : return false;
9974 : }
9975 0 : if (py_DisplayName == Py_None) {
9976 0 : r->in.DisplayName = NULL;
9977 : } else {
9978 0 : r->in.DisplayName = NULL;
9979 : {
9980 : const char *test_str;
9981 : const char *talloc_str;
9982 0 : PyObject *unicode = NULL;
9983 0 : if (PyUnicode_Check(py_DisplayName)) {
9984 0 : unicode = PyUnicode_AsEncodedString(py_DisplayName, "utf-8", "ignore");
9985 0 : if (unicode == NULL) {
9986 0 : PyErr_NoMemory();
9987 0 : return false;
9988 : }
9989 0 : test_str = PyBytes_AS_STRING(unicode);
9990 0 : } else if (PyBytes_Check(py_DisplayName)) {
9991 0 : test_str = PyBytes_AS_STRING(py_DisplayName);
9992 : } else {
9993 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DisplayName)->tp_name);
9994 0 : return false;
9995 : }
9996 0 : talloc_str = talloc_strdup(r, test_str);
9997 0 : if (unicode != NULL) {
9998 0 : Py_DECREF(unicode);
9999 : }
10000 0 : if (talloc_str == NULL) {
10001 0 : PyErr_NoMemory();
10002 0 : return false;
10003 : }
10004 0 : r->in.DisplayName = talloc_str;
10005 : }
10006 : }
10007 0 : if (py_desired_access == NULL) {
10008 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.desired_access");
10009 0 : return false;
10010 : }
10011 : {
10012 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.desired_access));
10013 0 : if (PyLong_Check(py_desired_access)) {
10014 : unsigned long long test_var;
10015 0 : test_var = PyLong_AsUnsignedLongLong(py_desired_access);
10016 0 : if (PyErr_Occurred() != NULL) {
10017 0 : return false;
10018 : }
10019 0 : if (test_var > uint_max) {
10020 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10021 : PyLong_Type.tp_name, uint_max, test_var);
10022 0 : return false;
10023 : }
10024 0 : r->in.desired_access = test_var;
10025 : } else {
10026 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10027 : PyLong_Type.tp_name);
10028 0 : return false;
10029 : }
10030 : }
10031 0 : if (py_type == NULL) {
10032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
10033 0 : return false;
10034 : }
10035 : {
10036 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
10037 0 : if (PyLong_Check(py_type)) {
10038 : unsigned long long test_var;
10039 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
10040 0 : if (PyErr_Occurred() != NULL) {
10041 0 : return false;
10042 : }
10043 0 : if (test_var > uint_max) {
10044 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10045 : PyLong_Type.tp_name, uint_max, test_var);
10046 0 : return false;
10047 : }
10048 0 : r->in.type = test_var;
10049 : } else {
10050 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10051 : PyLong_Type.tp_name);
10052 0 : return false;
10053 : }
10054 : }
10055 0 : if (py_start_type == NULL) {
10056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
10057 0 : return false;
10058 : }
10059 : {
10060 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
10061 0 : if (PyLong_Check(py_start_type)) {
10062 : unsigned long long test_var;
10063 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
10064 0 : if (PyErr_Occurred() != NULL) {
10065 0 : return false;
10066 : }
10067 0 : if (test_var > uint_max) {
10068 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10069 : PyLong_Type.tp_name, uint_max, test_var);
10070 0 : return false;
10071 : }
10072 0 : r->in.start_type = test_var;
10073 : } else {
10074 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10075 : PyLong_Type.tp_name);
10076 0 : return false;
10077 : }
10078 : }
10079 0 : if (py_error_control == NULL) {
10080 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
10081 0 : return false;
10082 : }
10083 : {
10084 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
10085 0 : if (PyLong_Check(py_error_control)) {
10086 : unsigned long long test_var;
10087 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
10088 0 : if (PyErr_Occurred() != NULL) {
10089 0 : return false;
10090 : }
10091 0 : if (test_var > uint_max) {
10092 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10093 : PyLong_Type.tp_name, uint_max, test_var);
10094 0 : return false;
10095 : }
10096 0 : r->in.error_control = test_var;
10097 : } else {
10098 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10099 : PyLong_Type.tp_name);
10100 0 : return false;
10101 : }
10102 : }
10103 0 : if (py_binary_path == NULL) {
10104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
10105 0 : return false;
10106 : }
10107 : {
10108 : const char *test_str;
10109 : const char *talloc_str;
10110 0 : PyObject *unicode = NULL;
10111 0 : if (PyUnicode_Check(py_binary_path)) {
10112 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
10113 0 : if (unicode == NULL) {
10114 0 : PyErr_NoMemory();
10115 0 : return false;
10116 : }
10117 0 : test_str = PyBytes_AS_STRING(unicode);
10118 0 : } else if (PyBytes_Check(py_binary_path)) {
10119 0 : test_str = PyBytes_AS_STRING(py_binary_path);
10120 : } else {
10121 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
10122 0 : return false;
10123 : }
10124 0 : talloc_str = talloc_strdup(r, test_str);
10125 0 : if (unicode != NULL) {
10126 0 : Py_DECREF(unicode);
10127 : }
10128 0 : if (talloc_str == NULL) {
10129 0 : PyErr_NoMemory();
10130 0 : return false;
10131 : }
10132 0 : r->in.binary_path = talloc_str;
10133 : }
10134 0 : if (py_LoadOrderGroupKey == NULL) {
10135 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.LoadOrderGroupKey");
10136 0 : return false;
10137 : }
10138 0 : if (py_LoadOrderGroupKey == Py_None) {
10139 0 : r->in.LoadOrderGroupKey = NULL;
10140 : } else {
10141 0 : r->in.LoadOrderGroupKey = NULL;
10142 : {
10143 : const char *test_str;
10144 : const char *talloc_str;
10145 0 : PyObject *unicode = NULL;
10146 0 : if (PyUnicode_Check(py_LoadOrderGroupKey)) {
10147 0 : unicode = PyUnicode_AsEncodedString(py_LoadOrderGroupKey, "utf-8", "ignore");
10148 0 : if (unicode == NULL) {
10149 0 : PyErr_NoMemory();
10150 0 : return false;
10151 : }
10152 0 : test_str = PyBytes_AS_STRING(unicode);
10153 0 : } else if (PyBytes_Check(py_LoadOrderGroupKey)) {
10154 0 : test_str = PyBytes_AS_STRING(py_LoadOrderGroupKey);
10155 : } else {
10156 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_LoadOrderGroupKey)->tp_name);
10157 0 : return false;
10158 : }
10159 0 : talloc_str = talloc_strdup(r, test_str);
10160 0 : if (unicode != NULL) {
10161 0 : Py_DECREF(unicode);
10162 : }
10163 0 : if (talloc_str == NULL) {
10164 0 : PyErr_NoMemory();
10165 0 : return false;
10166 : }
10167 0 : r->in.LoadOrderGroupKey = talloc_str;
10168 : }
10169 : }
10170 0 : if (py_TagId == NULL) {
10171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.TagId");
10172 0 : return false;
10173 : }
10174 0 : if (py_TagId == Py_None) {
10175 0 : r->in.TagId = NULL;
10176 : } else {
10177 0 : r->in.TagId = talloc_ptrtype(r, r->in.TagId);
10178 0 : if (r->in.TagId == NULL) {
10179 0 : PyErr_NoMemory();
10180 0 : return false;
10181 : }
10182 : {
10183 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.TagId));
10184 0 : if (PyLong_Check(py_TagId)) {
10185 : unsigned long long test_var;
10186 0 : test_var = PyLong_AsUnsignedLongLong(py_TagId);
10187 0 : if (PyErr_Occurred() != NULL) {
10188 0 : return false;
10189 : }
10190 0 : if (test_var > uint_max) {
10191 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10192 : PyLong_Type.tp_name, uint_max, test_var);
10193 0 : return false;
10194 : }
10195 0 : *r->in.TagId = test_var;
10196 : } else {
10197 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10198 : PyLong_Type.tp_name);
10199 0 : return false;
10200 : }
10201 : }
10202 : }
10203 0 : if (py_dependencies == NULL) {
10204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
10205 0 : return false;
10206 : }
10207 0 : if (py_dependencies == Py_None) {
10208 0 : r->in.dependencies = NULL;
10209 : } else {
10210 0 : r->in.dependencies = NULL;
10211 0 : PY_CHECK_TYPE(&PyList_Type, py_dependencies, return false;);
10212 : {
10213 : int dependencies_cntr_1;
10214 0 : r->in.dependencies = talloc_array_ptrtype(r, r->in.dependencies, PyList_GET_SIZE(py_dependencies));
10215 0 : if (!r->in.dependencies) { return false;; }
10216 0 : talloc_set_name_const(r->in.dependencies, "ARRAY: r->in.dependencies");
10217 0 : for (dependencies_cntr_1 = 0; dependencies_cntr_1 < PyList_GET_SIZE(py_dependencies); dependencies_cntr_1++) {
10218 0 : if (PyList_GET_ITEM(py_dependencies, dependencies_cntr_1) == NULL) {
10219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies[dependencies_cntr_1]");
10220 0 : return false;
10221 : }
10222 : {
10223 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dependencies[dependencies_cntr_1]));
10224 0 : if (PyLong_Check(PyList_GET_ITEM(py_dependencies, dependencies_cntr_1))) {
10225 : unsigned long long test_var;
10226 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_dependencies, dependencies_cntr_1));
10227 0 : if (PyErr_Occurred() != NULL) {
10228 0 : return false;
10229 : }
10230 0 : if (test_var > uint_max) {
10231 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10232 : PyLong_Type.tp_name, uint_max, test_var);
10233 0 : return false;
10234 : }
10235 0 : r->in.dependencies[dependencies_cntr_1] = test_var;
10236 : } else {
10237 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10238 : PyLong_Type.tp_name);
10239 0 : return false;
10240 : }
10241 : }
10242 : }
10243 : }
10244 : }
10245 0 : PY_CHECK_TYPE(&PyList_Type, py_dependencies, return false;);
10246 0 : r->in.dependencies_size = PyList_GET_SIZE(py_dependencies);
10247 0 : if (py_service_start_name == NULL) {
10248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
10249 0 : return false;
10250 : }
10251 0 : if (py_service_start_name == Py_None) {
10252 0 : r->in.service_start_name = NULL;
10253 : } else {
10254 0 : r->in.service_start_name = NULL;
10255 : {
10256 : const char *test_str;
10257 : const char *talloc_str;
10258 0 : PyObject *unicode = NULL;
10259 0 : if (PyUnicode_Check(py_service_start_name)) {
10260 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
10261 0 : if (unicode == NULL) {
10262 0 : PyErr_NoMemory();
10263 0 : return false;
10264 : }
10265 0 : test_str = PyBytes_AS_STRING(unicode);
10266 0 : } else if (PyBytes_Check(py_service_start_name)) {
10267 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
10268 : } else {
10269 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
10270 0 : return false;
10271 : }
10272 0 : talloc_str = talloc_strdup(r, test_str);
10273 0 : if (unicode != NULL) {
10274 0 : Py_DECREF(unicode);
10275 : }
10276 0 : if (talloc_str == NULL) {
10277 0 : PyErr_NoMemory();
10278 0 : return false;
10279 : }
10280 0 : r->in.service_start_name = talloc_str;
10281 : }
10282 : }
10283 0 : if (py_password == NULL) {
10284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
10285 0 : return false;
10286 : }
10287 0 : if (py_password == Py_None) {
10288 0 : r->in.password = NULL;
10289 : } else {
10290 0 : r->in.password = NULL;
10291 0 : PY_CHECK_TYPE(&PyList_Type, py_password, return false;);
10292 : {
10293 : int password_cntr_1;
10294 0 : r->in.password = talloc_array_ptrtype(r, r->in.password, PyList_GET_SIZE(py_password));
10295 0 : if (!r->in.password) { return false;; }
10296 0 : talloc_set_name_const(r->in.password, "ARRAY: r->in.password");
10297 0 : for (password_cntr_1 = 0; password_cntr_1 < PyList_GET_SIZE(py_password); password_cntr_1++) {
10298 0 : if (PyList_GET_ITEM(py_password, password_cntr_1) == NULL) {
10299 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password[password_cntr_1]");
10300 0 : return false;
10301 : }
10302 : {
10303 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.password[password_cntr_1]));
10304 0 : if (PyLong_Check(PyList_GET_ITEM(py_password, password_cntr_1))) {
10305 : unsigned long long test_var;
10306 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_password, password_cntr_1));
10307 0 : if (PyErr_Occurred() != NULL) {
10308 0 : return false;
10309 : }
10310 0 : if (test_var > uint_max) {
10311 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10312 : PyLong_Type.tp_name, uint_max, test_var);
10313 0 : return false;
10314 : }
10315 0 : r->in.password[password_cntr_1] = test_var;
10316 : } else {
10317 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10318 : PyLong_Type.tp_name);
10319 0 : return false;
10320 : }
10321 : }
10322 : }
10323 : }
10324 : }
10325 0 : PY_CHECK_TYPE(&PyList_Type, py_password, return false;);
10326 0 : r->in.password_size = PyList_GET_SIZE(py_password);
10327 0 : return true;
10328 : }
10329 :
10330 0 : static PyObject *unpack_py_svcctl_CreateServiceW_args_out(struct svcctl_CreateServiceW *r)
10331 : {
10332 : PyObject *result;
10333 : PyObject *py_TagId;
10334 : PyObject *py_handle;
10335 0 : result = PyTuple_New(2);
10336 0 : if (r->out.TagId == NULL) {
10337 0 : py_TagId = Py_None;
10338 0 : Py_INCREF(py_TagId);
10339 : } else {
10340 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*r->out.TagId);
10341 : }
10342 0 : PyTuple_SetItem(result, 0, py_TagId);
10343 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
10344 0 : PyTuple_SetItem(result, 1, py_handle);
10345 0 : if (!W_ERROR_IS_OK(r->out.result)) {
10346 0 : PyErr_SetWERROR(r->out.result);
10347 0 : return NULL;
10348 : }
10349 :
10350 0 : return result;
10351 : }
10352 :
10353 :
10354 0 : static PyObject *py_svcctl_EnumDependentServicesW_in_get_service(PyObject *obj, void *closure)
10355 : {
10356 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
10357 : PyObject *py_service;
10358 0 : if (object->in.service == NULL) {
10359 0 : Py_RETURN_NONE;
10360 : }
10361 0 : py_service = pytalloc_reference_ex(policy_handle_Type, object->in.service, object->in.service);
10362 0 : return py_service;
10363 : }
10364 :
10365 0 : static int py_svcctl_EnumDependentServicesW_in_set_service(PyObject *py_obj, PyObject *value, void *closure)
10366 : {
10367 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10368 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.service));
10369 0 : if (value == NULL) {
10370 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service");
10371 0 : return -1;
10372 : }
10373 0 : object->in.service = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.service);
10374 0 : if (object->in.service == NULL) {
10375 0 : PyErr_NoMemory();
10376 0 : return -1;
10377 : }
10378 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
10379 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10380 0 : PyErr_NoMemory();
10381 0 : return -1;
10382 : }
10383 0 : object->in.service = (struct policy_handle *)pytalloc_get_ptr(value);
10384 0 : return 0;
10385 : }
10386 :
10387 0 : static PyObject *py_svcctl_EnumDependentServicesW_in_get_state(PyObject *obj, void *closure)
10388 : {
10389 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
10390 : PyObject *py_state;
10391 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
10392 0 : return py_state;
10393 : }
10394 :
10395 0 : static int py_svcctl_EnumDependentServicesW_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
10396 : {
10397 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10398 0 : if (value == NULL) {
10399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
10400 0 : return -1;
10401 : }
10402 : {
10403 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
10404 0 : if (PyLong_Check(value)) {
10405 : unsigned long long test_var;
10406 0 : test_var = PyLong_AsUnsignedLongLong(value);
10407 0 : if (PyErr_Occurred() != NULL) {
10408 0 : return -1;
10409 : }
10410 0 : if (test_var > uint_max) {
10411 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10412 : PyLong_Type.tp_name, uint_max, test_var);
10413 0 : return -1;
10414 : }
10415 0 : object->in.state = test_var;
10416 : } else {
10417 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10418 : PyLong_Type.tp_name);
10419 0 : return -1;
10420 : }
10421 : }
10422 0 : return 0;
10423 : }
10424 :
10425 0 : static PyObject *py_svcctl_EnumDependentServicesW_out_get_service_status(PyObject *obj, void *closure)
10426 : {
10427 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
10428 : PyObject *py_service_status;
10429 0 : if (object->out.service_status == NULL) {
10430 0 : Py_RETURN_NONE;
10431 : }
10432 0 : py_service_status = PyList_New(object->in.offered);
10433 0 : if (py_service_status == NULL) {
10434 0 : return NULL;
10435 : }
10436 : {
10437 : int service_status_cntr_1;
10438 0 : for (service_status_cntr_1 = 0; service_status_cntr_1 < (object->in.offered); service_status_cntr_1++) {
10439 : PyObject *py_service_status_1;
10440 0 : py_service_status_1 = PyLong_FromLong((uint16_t)object->out.service_status[service_status_cntr_1]);
10441 0 : PyList_SetItem(py_service_status, service_status_cntr_1, py_service_status_1);
10442 : }
10443 : }
10444 0 : return py_service_status;
10445 : }
10446 :
10447 0 : static int py_svcctl_EnumDependentServicesW_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
10448 : {
10449 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10450 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
10451 0 : if (value == NULL) {
10452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
10453 0 : return -1;
10454 : }
10455 0 : object->out.service_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status);
10456 0 : if (object->out.service_status == NULL) {
10457 0 : PyErr_NoMemory();
10458 0 : return -1;
10459 : }
10460 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10461 : {
10462 : int service_status_cntr_1;
10463 0 : object->out.service_status = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_status, PyList_GET_SIZE(value));
10464 0 : if (!object->out.service_status) { return -1;; }
10465 0 : talloc_set_name_const(object->out.service_status, "ARRAY: object->out.service_status");
10466 0 : for (service_status_cntr_1 = 0; service_status_cntr_1 < PyList_GET_SIZE(value); service_status_cntr_1++) {
10467 0 : if (PyList_GET_ITEM(value, service_status_cntr_1) == NULL) {
10468 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status[service_status_cntr_1]");
10469 0 : return -1;
10470 : }
10471 : {
10472 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.service_status[service_status_cntr_1]));
10473 0 : if (PyLong_Check(PyList_GET_ITEM(value, service_status_cntr_1))) {
10474 : unsigned long long test_var;
10475 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, service_status_cntr_1));
10476 0 : if (PyErr_Occurred() != NULL) {
10477 0 : return -1;
10478 : }
10479 0 : if (test_var > uint_max) {
10480 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10481 : PyLong_Type.tp_name, uint_max, test_var);
10482 0 : return -1;
10483 : }
10484 0 : object->out.service_status[service_status_cntr_1] = test_var;
10485 : } else {
10486 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10487 : PyLong_Type.tp_name);
10488 0 : return -1;
10489 : }
10490 : }
10491 : }
10492 : }
10493 0 : return 0;
10494 : }
10495 :
10496 0 : static PyObject *py_svcctl_EnumDependentServicesW_in_get_offered(PyObject *obj, void *closure)
10497 : {
10498 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
10499 : PyObject *py_offered;
10500 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
10501 0 : return py_offered;
10502 : }
10503 :
10504 0 : static int py_svcctl_EnumDependentServicesW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
10505 : {
10506 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10507 0 : if (value == NULL) {
10508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
10509 0 : return -1;
10510 : }
10511 : {
10512 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
10513 0 : if (PyLong_Check(value)) {
10514 : unsigned long long test_var;
10515 0 : test_var = PyLong_AsUnsignedLongLong(value);
10516 0 : if (PyErr_Occurred() != NULL) {
10517 0 : return -1;
10518 : }
10519 0 : if (test_var > uint_max) {
10520 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10521 : PyLong_Type.tp_name, uint_max, test_var);
10522 0 : return -1;
10523 : }
10524 0 : object->in.offered = test_var;
10525 : } else {
10526 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10527 : PyLong_Type.tp_name);
10528 0 : return -1;
10529 : }
10530 : }
10531 0 : return 0;
10532 : }
10533 :
10534 0 : static PyObject *py_svcctl_EnumDependentServicesW_out_get_needed(PyObject *obj, void *closure)
10535 : {
10536 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
10537 : PyObject *py_needed;
10538 0 : if (object->out.needed == NULL) {
10539 0 : Py_RETURN_NONE;
10540 : }
10541 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
10542 0 : return py_needed;
10543 : }
10544 :
10545 0 : static int py_svcctl_EnumDependentServicesW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
10546 : {
10547 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10548 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
10549 0 : if (value == NULL) {
10550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
10551 0 : return -1;
10552 : }
10553 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
10554 0 : if (object->out.needed == NULL) {
10555 0 : PyErr_NoMemory();
10556 0 : return -1;
10557 : }
10558 : {
10559 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
10560 0 : if (PyLong_Check(value)) {
10561 : unsigned long long test_var;
10562 0 : test_var = PyLong_AsUnsignedLongLong(value);
10563 0 : if (PyErr_Occurred() != NULL) {
10564 0 : return -1;
10565 : }
10566 0 : if (test_var > uint_max) {
10567 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10568 : PyLong_Type.tp_name, uint_max, test_var);
10569 0 : return -1;
10570 : }
10571 0 : *object->out.needed = test_var;
10572 : } else {
10573 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10574 : PyLong_Type.tp_name);
10575 0 : return -1;
10576 : }
10577 : }
10578 0 : return 0;
10579 : }
10580 :
10581 0 : static PyObject *py_svcctl_EnumDependentServicesW_out_get_services_returned(PyObject *obj, void *closure)
10582 : {
10583 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
10584 : PyObject *py_services_returned;
10585 0 : if (object->out.services_returned == NULL) {
10586 0 : Py_RETURN_NONE;
10587 : }
10588 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
10589 0 : return py_services_returned;
10590 : }
10591 :
10592 0 : static int py_svcctl_EnumDependentServicesW_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
10593 : {
10594 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10595 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
10596 0 : if (value == NULL) {
10597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
10598 0 : return -1;
10599 : }
10600 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
10601 0 : if (object->out.services_returned == NULL) {
10602 0 : PyErr_NoMemory();
10603 0 : return -1;
10604 : }
10605 : {
10606 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
10607 0 : if (PyLong_Check(value)) {
10608 : unsigned long long test_var;
10609 0 : test_var = PyLong_AsUnsignedLongLong(value);
10610 0 : if (PyErr_Occurred() != NULL) {
10611 0 : return -1;
10612 : }
10613 0 : if (test_var > uint_max) {
10614 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10615 : PyLong_Type.tp_name, uint_max, test_var);
10616 0 : return -1;
10617 : }
10618 0 : *object->out.services_returned = test_var;
10619 : } else {
10620 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10621 : PyLong_Type.tp_name);
10622 0 : return -1;
10623 : }
10624 : }
10625 0 : return 0;
10626 : }
10627 :
10628 0 : static PyObject *py_svcctl_EnumDependentServicesW_get_result(PyObject *obj, void *closure)
10629 : {
10630 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(obj);
10631 : PyObject *py_result;
10632 0 : py_result = PyErr_FromWERROR(object->out.result);
10633 0 : return py_result;
10634 : }
10635 :
10636 0 : static int py_svcctl_EnumDependentServicesW_set_result(PyObject *py_obj, PyObject *value, void *closure)
10637 : {
10638 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10639 0 : if (value == NULL) {
10640 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
10641 0 : return -1;
10642 : }
10643 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
10644 0 : return 0;
10645 : }
10646 :
10647 : static PyGetSetDef py_svcctl_EnumDependentServicesW_getsetters[] = {
10648 : {
10649 : .name = discard_const_p(char, "in_service"),
10650 : .get = py_svcctl_EnumDependentServicesW_in_get_service,
10651 : .set = py_svcctl_EnumDependentServicesW_in_set_service,
10652 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
10653 : },
10654 : {
10655 : .name = discard_const_p(char, "in_state"),
10656 : .get = py_svcctl_EnumDependentServicesW_in_get_state,
10657 : .set = py_svcctl_EnumDependentServicesW_in_set_state,
10658 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
10659 : },
10660 : {
10661 : .name = discard_const_p(char, "out_service_status"),
10662 : .get = py_svcctl_EnumDependentServicesW_out_get_service_status,
10663 : .set = py_svcctl_EnumDependentServicesW_out_set_service_status,
10664 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10665 : },
10666 : {
10667 : .name = discard_const_p(char, "in_offered"),
10668 : .get = py_svcctl_EnumDependentServicesW_in_get_offered,
10669 : .set = py_svcctl_EnumDependentServicesW_in_set_offered,
10670 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10671 : },
10672 : {
10673 : .name = discard_const_p(char, "out_needed"),
10674 : .get = py_svcctl_EnumDependentServicesW_out_get_needed,
10675 : .set = py_svcctl_EnumDependentServicesW_out_set_needed,
10676 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10677 : },
10678 : {
10679 : .name = discard_const_p(char, "out_services_returned"),
10680 : .get = py_svcctl_EnumDependentServicesW_out_get_services_returned,
10681 : .set = py_svcctl_EnumDependentServicesW_out_set_services_returned,
10682 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10683 : },
10684 : {
10685 : .name = discard_const_p(char, "result"),
10686 : .get = py_svcctl_EnumDependentServicesW_get_result,
10687 : .set = py_svcctl_EnumDependentServicesW_set_result,
10688 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
10689 : },
10690 : { .name = NULL }
10691 : };
10692 :
10693 0 : static PyObject *py_svcctl_EnumDependentServicesW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10694 : {
10695 0 : PyObject *self = pytalloc_new(struct svcctl_EnumDependentServicesW, type);
10696 0 : struct svcctl_EnumDependentServicesW *_self = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(self);
10697 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
10698 0 : _self->in.service = talloc_zero(mem_ctx, struct policy_handle);
10699 0 : _self->out.service_status = talloc_zero(mem_ctx, uint8_t);
10700 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
10701 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
10702 0 : return self;
10703 : }
10704 :
10705 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
10706 : {
10707 :
10708 :
10709 0 : return PyLong_FromLong(13);
10710 : }
10711 :
10712 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
10713 : {
10714 0 : const struct ndr_interface_call *call = NULL;
10715 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10716 0 : PyObject *ret = NULL;
10717 0 : struct ndr_push *push = NULL;
10718 : DATA_BLOB blob;
10719 : enum ndr_err_code err;
10720 :
10721 0 : if (ndr_table_svcctl.num_calls < 14) {
10722 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesW_ndr_pack");
10723 0 : return NULL;
10724 : }
10725 0 : call = &ndr_table_svcctl.calls[13];
10726 :
10727 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
10728 0 : if (push == NULL) {
10729 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10730 0 : return NULL;
10731 : }
10732 :
10733 0 : push->flags |= ndr_push_flags;
10734 :
10735 0 : err = call->ndr_push(push, ndr_inout_flags, object);
10736 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10737 0 : TALLOC_FREE(push);
10738 0 : PyErr_SetNdrError(err);
10739 0 : return NULL;
10740 : }
10741 0 : blob = ndr_push_blob(push);
10742 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10743 0 : TALLOC_FREE(push);
10744 0 : return ret;
10745 : }
10746 :
10747 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10748 : {
10749 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10750 0 : PyObject *bigendian_obj = NULL;
10751 0 : PyObject *ndr64_obj = NULL;
10752 0 : uint32_t ndr_push_flags = 0;
10753 :
10754 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
10755 : discard_const_p(char *, kwnames),
10756 : &bigendian_obj,
10757 : &ndr64_obj)) {
10758 0 : return NULL;
10759 : }
10760 :
10761 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10762 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10763 : }
10764 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10765 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10766 : }
10767 :
10768 0 : return py_svcctl_EnumDependentServicesW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
10769 : }
10770 :
10771 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10772 : {
10773 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10774 0 : PyObject *bigendian_obj = NULL;
10775 0 : PyObject *ndr64_obj = NULL;
10776 0 : uint32_t ndr_push_flags = 0;
10777 :
10778 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
10779 : discard_const_p(char *, kwnames),
10780 : &bigendian_obj,
10781 : &ndr64_obj)) {
10782 0 : return NULL;
10783 : }
10784 :
10785 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10786 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10787 : }
10788 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10789 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10790 : }
10791 :
10792 0 : return py_svcctl_EnumDependentServicesW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
10793 : }
10794 :
10795 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
10796 : {
10797 0 : const struct ndr_interface_call *call = NULL;
10798 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10799 0 : struct ndr_pull *pull = NULL;
10800 : enum ndr_err_code err;
10801 :
10802 0 : if (ndr_table_svcctl.num_calls < 14) {
10803 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesW_ndr_unpack");
10804 0 : return NULL;
10805 : }
10806 0 : call = &ndr_table_svcctl.calls[13];
10807 :
10808 0 : pull = ndr_pull_init_blob(blob, object);
10809 0 : if (pull == NULL) {
10810 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10811 0 : return NULL;
10812 : }
10813 :
10814 0 : pull->flags |= ndr_pull_flags;
10815 :
10816 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
10817 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10818 0 : TALLOC_FREE(pull);
10819 0 : PyErr_SetNdrError(err);
10820 0 : return NULL;
10821 : }
10822 0 : if (!allow_remaining) {
10823 : uint32_t highest_ofs;
10824 :
10825 0 : if (pull->offset > pull->relative_highest_offset) {
10826 0 : highest_ofs = pull->offset;
10827 : } else {
10828 0 : highest_ofs = pull->relative_highest_offset;
10829 : }
10830 0 : if (highest_ofs < pull->data_size) {
10831 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
10832 : "not all bytes consumed ofs[%u] size[%u]",
10833 : highest_ofs, pull->data_size);
10834 0 : TALLOC_FREE(pull);
10835 0 : PyErr_SetNdrError(err);
10836 0 : return NULL;
10837 : }
10838 : }
10839 :
10840 0 : TALLOC_FREE(pull);
10841 0 : Py_RETURN_NONE;
10842 : }
10843 :
10844 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10845 : {
10846 : DATA_BLOB blob;
10847 0 : Py_ssize_t blob_length = 0;
10848 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10849 0 : PyObject *bigendian_obj = NULL;
10850 0 : PyObject *ndr64_obj = NULL;
10851 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10852 0 : PyObject *allow_remaining_obj = NULL;
10853 0 : bool allow_remaining = false;
10854 :
10855 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
10856 : discard_const_p(char *, kwnames),
10857 : &blob.data, &blob_length,
10858 : &bigendian_obj,
10859 : &ndr64_obj,
10860 : &allow_remaining_obj)) {
10861 0 : return NULL;
10862 : }
10863 0 : blob.length = blob_length;
10864 :
10865 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10866 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10867 : }
10868 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10869 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10870 : }
10871 :
10872 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10873 0 : allow_remaining = true;
10874 : }
10875 :
10876 0 : return py_svcctl_EnumDependentServicesW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
10877 : }
10878 :
10879 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10880 : {
10881 : DATA_BLOB blob;
10882 0 : Py_ssize_t blob_length = 0;
10883 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10884 0 : PyObject *bigendian_obj = NULL;
10885 0 : PyObject *ndr64_obj = NULL;
10886 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10887 0 : PyObject *allow_remaining_obj = NULL;
10888 0 : bool allow_remaining = false;
10889 :
10890 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
10891 : discard_const_p(char *, kwnames),
10892 : &blob.data, &blob_length,
10893 : &bigendian_obj,
10894 : &ndr64_obj,
10895 : &allow_remaining_obj)) {
10896 0 : return NULL;
10897 : }
10898 0 : blob.length = blob_length;
10899 :
10900 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10901 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10902 : }
10903 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10904 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10905 : }
10906 :
10907 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10908 0 : allow_remaining = true;
10909 : }
10910 :
10911 0 : return py_svcctl_EnumDependentServicesW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
10912 : }
10913 :
10914 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
10915 : {
10916 0 : const struct ndr_interface_call *call = NULL;
10917 0 : struct svcctl_EnumDependentServicesW *object = (struct svcctl_EnumDependentServicesW *)pytalloc_get_ptr(py_obj);
10918 : PyObject *ret;
10919 : char *retstr;
10920 :
10921 0 : if (ndr_table_svcctl.num_calls < 14) {
10922 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesW_ndr_print");
10923 0 : return NULL;
10924 : }
10925 0 : call = &ndr_table_svcctl.calls[13];
10926 :
10927 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
10928 0 : ret = PyUnicode_FromString(retstr);
10929 0 : TALLOC_FREE(retstr);
10930 :
10931 0 : return ret;
10932 : }
10933 :
10934 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10935 : {
10936 0 : return py_svcctl_EnumDependentServicesW_ndr_print(py_obj, "svcctl_EnumDependentServicesW_in", NDR_IN);
10937 : }
10938 :
10939 0 : static PyObject *py_svcctl_EnumDependentServicesW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10940 : {
10941 0 : return py_svcctl_EnumDependentServicesW_ndr_print(py_obj, "svcctl_EnumDependentServicesW_out", NDR_OUT);
10942 : }
10943 :
10944 : static PyMethodDef py_svcctl_EnumDependentServicesW_methods[] = {
10945 : { "opnum", (PyCFunction)py_svcctl_EnumDependentServicesW_ndr_opnum, METH_NOARGS|METH_CLASS,
10946 : "svcctl.EnumDependentServicesW.opnum() -> 13 (0x0d) " },
10947 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
10948 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
10949 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
10950 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
10951 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
10952 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
10953 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
10954 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
10955 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumDependentServicesW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
10956 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumDependentServicesW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
10957 : { NULL, NULL, 0, NULL }
10958 : };
10959 :
10960 :
10961 : static PyTypeObject svcctl_EnumDependentServicesW_Type = {
10962 : PyVarObject_HEAD_INIT(NULL, 0)
10963 : .tp_name = "svcctl.EnumDependentServicesW",
10964 : .tp_getset = py_svcctl_EnumDependentServicesW_getsetters,
10965 : .tp_methods = py_svcctl_EnumDependentServicesW_methods,
10966 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10967 : .tp_new = py_svcctl_EnumDependentServicesW_new,
10968 : };
10969 :
10970 0 : static bool pack_py_svcctl_EnumDependentServicesW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumDependentServicesW *r)
10971 : {
10972 : PyObject *py_service;
10973 : PyObject *py_state;
10974 : PyObject *py_offered;
10975 0 : const char *kwnames[] = {
10976 : "service", "state", "offered", NULL
10977 : };
10978 :
10979 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_EnumDependentServicesW", discard_const_p(char *, kwnames), &py_service, &py_state, &py_offered)) {
10980 0 : return false;
10981 : }
10982 :
10983 0 : if (py_service == NULL) {
10984 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service");
10985 0 : return false;
10986 : }
10987 0 : r->in.service = talloc_ptrtype(r, r->in.service);
10988 0 : if (r->in.service == NULL) {
10989 0 : PyErr_NoMemory();
10990 0 : return false;
10991 : }
10992 0 : PY_CHECK_TYPE(policy_handle_Type, py_service, return false;);
10993 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_service)) == NULL) {
10994 0 : PyErr_NoMemory();
10995 0 : return false;
10996 : }
10997 0 : r->in.service = (struct policy_handle *)pytalloc_get_ptr(py_service);
10998 0 : if (py_state == NULL) {
10999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
11000 0 : return false;
11001 : }
11002 : {
11003 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
11004 0 : if (PyLong_Check(py_state)) {
11005 : unsigned long long test_var;
11006 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
11007 0 : if (PyErr_Occurred() != NULL) {
11008 0 : return false;
11009 : }
11010 0 : if (test_var > uint_max) {
11011 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11012 : PyLong_Type.tp_name, uint_max, test_var);
11013 0 : return false;
11014 : }
11015 0 : r->in.state = test_var;
11016 : } else {
11017 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11018 : PyLong_Type.tp_name);
11019 0 : return false;
11020 : }
11021 : }
11022 0 : if (py_offered == NULL) {
11023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
11024 0 : return false;
11025 : }
11026 : {
11027 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
11028 0 : if (PyLong_Check(py_offered)) {
11029 : unsigned long long test_var;
11030 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
11031 0 : if (PyErr_Occurred() != NULL) {
11032 0 : return false;
11033 : }
11034 0 : if (test_var > uint_max) {
11035 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11036 : PyLong_Type.tp_name, uint_max, test_var);
11037 0 : return false;
11038 : }
11039 0 : r->in.offered = test_var;
11040 : } else {
11041 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11042 : PyLong_Type.tp_name);
11043 0 : return false;
11044 : }
11045 : }
11046 0 : return true;
11047 : }
11048 :
11049 0 : static PyObject *unpack_py_svcctl_EnumDependentServicesW_args_out(struct svcctl_EnumDependentServicesW *r)
11050 : {
11051 : PyObject *result;
11052 : PyObject *py_service_status;
11053 : PyObject *py_needed;
11054 : PyObject *py_services_returned;
11055 0 : result = PyTuple_New(3);
11056 0 : py_service_status = PyList_New(r->in.offered);
11057 0 : if (py_service_status == NULL) {
11058 0 : return NULL;
11059 : }
11060 : {
11061 : int service_status_cntr_1;
11062 0 : for (service_status_cntr_1 = 0; service_status_cntr_1 < (r->in.offered); service_status_cntr_1++) {
11063 : PyObject *py_service_status_1;
11064 0 : py_service_status_1 = PyLong_FromLong((uint16_t)r->out.service_status[service_status_cntr_1]);
11065 0 : PyList_SetItem(py_service_status, service_status_cntr_1, py_service_status_1);
11066 : }
11067 : }
11068 0 : PyTuple_SetItem(result, 0, py_service_status);
11069 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
11070 0 : PyTuple_SetItem(result, 1, py_needed);
11071 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
11072 0 : PyTuple_SetItem(result, 2, py_services_returned);
11073 0 : if (!W_ERROR_IS_OK(r->out.result)) {
11074 0 : PyErr_SetWERROR(r->out.result);
11075 0 : return NULL;
11076 : }
11077 :
11078 0 : return result;
11079 : }
11080 :
11081 :
11082 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_handle(PyObject *obj, void *closure)
11083 : {
11084 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11085 : PyObject *py_handle;
11086 0 : if (object->in.handle == NULL) {
11087 0 : Py_RETURN_NONE;
11088 : }
11089 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
11090 0 : return py_handle;
11091 : }
11092 :
11093 0 : static int py_svcctl_EnumServicesStatusW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
11094 : {
11095 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11096 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
11097 0 : if (value == NULL) {
11098 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
11099 0 : return -1;
11100 : }
11101 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
11102 0 : if (object->in.handle == NULL) {
11103 0 : PyErr_NoMemory();
11104 0 : return -1;
11105 : }
11106 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
11107 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11108 0 : PyErr_NoMemory();
11109 0 : return -1;
11110 : }
11111 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
11112 0 : return 0;
11113 : }
11114 :
11115 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_type(PyObject *obj, void *closure)
11116 : {
11117 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11118 : PyObject *py_type;
11119 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
11120 0 : return py_type;
11121 : }
11122 :
11123 0 : static int py_svcctl_EnumServicesStatusW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
11124 : {
11125 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11126 0 : if (value == NULL) {
11127 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
11128 0 : return -1;
11129 : }
11130 : {
11131 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
11132 0 : if (PyLong_Check(value)) {
11133 : unsigned long long test_var;
11134 0 : test_var = PyLong_AsUnsignedLongLong(value);
11135 0 : if (PyErr_Occurred() != NULL) {
11136 0 : return -1;
11137 : }
11138 0 : if (test_var > uint_max) {
11139 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11140 : PyLong_Type.tp_name, uint_max, test_var);
11141 0 : return -1;
11142 : }
11143 0 : object->in.type = test_var;
11144 : } else {
11145 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11146 : PyLong_Type.tp_name);
11147 0 : return -1;
11148 : }
11149 : }
11150 0 : return 0;
11151 : }
11152 :
11153 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_state(PyObject *obj, void *closure)
11154 : {
11155 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11156 : PyObject *py_state;
11157 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
11158 0 : return py_state;
11159 : }
11160 :
11161 0 : static int py_svcctl_EnumServicesStatusW_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
11162 : {
11163 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11164 0 : if (value == NULL) {
11165 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
11166 0 : return -1;
11167 : }
11168 : {
11169 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
11170 0 : if (PyLong_Check(value)) {
11171 : unsigned long long test_var;
11172 0 : test_var = PyLong_AsUnsignedLongLong(value);
11173 0 : if (PyErr_Occurred() != NULL) {
11174 0 : return -1;
11175 : }
11176 0 : if (test_var > uint_max) {
11177 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11178 : PyLong_Type.tp_name, uint_max, test_var);
11179 0 : return -1;
11180 : }
11181 0 : object->in.state = test_var;
11182 : } else {
11183 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11184 : PyLong_Type.tp_name);
11185 0 : return -1;
11186 : }
11187 : }
11188 0 : return 0;
11189 : }
11190 :
11191 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_service(PyObject *obj, void *closure)
11192 : {
11193 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11194 : PyObject *py_service;
11195 0 : if (object->out.service == NULL) {
11196 0 : Py_RETURN_NONE;
11197 : }
11198 0 : py_service = PyList_New(object->in.offered);
11199 0 : if (py_service == NULL) {
11200 0 : return NULL;
11201 : }
11202 : {
11203 : int service_cntr_1;
11204 0 : for (service_cntr_1 = 0; service_cntr_1 < (object->in.offered); service_cntr_1++) {
11205 : PyObject *py_service_1;
11206 0 : py_service_1 = PyLong_FromLong((uint16_t)object->out.service[service_cntr_1]);
11207 0 : PyList_SetItem(py_service, service_cntr_1, py_service_1);
11208 : }
11209 : }
11210 0 : return py_service;
11211 : }
11212 :
11213 0 : static int py_svcctl_EnumServicesStatusW_out_set_service(PyObject *py_obj, PyObject *value, void *closure)
11214 : {
11215 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11216 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service));
11217 0 : if (value == NULL) {
11218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service");
11219 0 : return -1;
11220 : }
11221 0 : object->out.service = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service);
11222 0 : if (object->out.service == NULL) {
11223 0 : PyErr_NoMemory();
11224 0 : return -1;
11225 : }
11226 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11227 : {
11228 : int service_cntr_1;
11229 0 : object->out.service = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service, PyList_GET_SIZE(value));
11230 0 : if (!object->out.service) { return -1;; }
11231 0 : talloc_set_name_const(object->out.service, "ARRAY: object->out.service");
11232 0 : for (service_cntr_1 = 0; service_cntr_1 < PyList_GET_SIZE(value); service_cntr_1++) {
11233 0 : if (PyList_GET_ITEM(value, service_cntr_1) == NULL) {
11234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service[service_cntr_1]");
11235 0 : return -1;
11236 : }
11237 : {
11238 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.service[service_cntr_1]));
11239 0 : if (PyLong_Check(PyList_GET_ITEM(value, service_cntr_1))) {
11240 : unsigned long long test_var;
11241 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, service_cntr_1));
11242 0 : if (PyErr_Occurred() != NULL) {
11243 0 : return -1;
11244 : }
11245 0 : if (test_var > uint_max) {
11246 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11247 : PyLong_Type.tp_name, uint_max, test_var);
11248 0 : return -1;
11249 : }
11250 0 : object->out.service[service_cntr_1] = test_var;
11251 : } else {
11252 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11253 : PyLong_Type.tp_name);
11254 0 : return -1;
11255 : }
11256 : }
11257 : }
11258 : }
11259 0 : return 0;
11260 : }
11261 :
11262 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_offered(PyObject *obj, void *closure)
11263 : {
11264 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11265 : PyObject *py_offered;
11266 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
11267 0 : return py_offered;
11268 : }
11269 :
11270 0 : static int py_svcctl_EnumServicesStatusW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
11271 : {
11272 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11273 0 : if (value == NULL) {
11274 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
11275 0 : return -1;
11276 : }
11277 : {
11278 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
11279 0 : if (PyLong_Check(value)) {
11280 : unsigned long long test_var;
11281 0 : test_var = PyLong_AsUnsignedLongLong(value);
11282 0 : if (PyErr_Occurred() != NULL) {
11283 0 : return -1;
11284 : }
11285 0 : if (test_var > uint_max) {
11286 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11287 : PyLong_Type.tp_name, uint_max, test_var);
11288 0 : return -1;
11289 : }
11290 0 : object->in.offered = test_var;
11291 : } else {
11292 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11293 : PyLong_Type.tp_name);
11294 0 : return -1;
11295 : }
11296 : }
11297 0 : return 0;
11298 : }
11299 :
11300 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_needed(PyObject *obj, void *closure)
11301 : {
11302 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11303 : PyObject *py_needed;
11304 0 : if (object->out.needed == NULL) {
11305 0 : Py_RETURN_NONE;
11306 : }
11307 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
11308 0 : return py_needed;
11309 : }
11310 :
11311 0 : static int py_svcctl_EnumServicesStatusW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
11312 : {
11313 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11314 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
11315 0 : if (value == NULL) {
11316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
11317 0 : return -1;
11318 : }
11319 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
11320 0 : if (object->out.needed == NULL) {
11321 0 : PyErr_NoMemory();
11322 0 : return -1;
11323 : }
11324 : {
11325 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
11326 0 : if (PyLong_Check(value)) {
11327 : unsigned long long test_var;
11328 0 : test_var = PyLong_AsUnsignedLongLong(value);
11329 0 : if (PyErr_Occurred() != NULL) {
11330 0 : return -1;
11331 : }
11332 0 : if (test_var > uint_max) {
11333 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11334 : PyLong_Type.tp_name, uint_max, test_var);
11335 0 : return -1;
11336 : }
11337 0 : *object->out.needed = test_var;
11338 : } else {
11339 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11340 : PyLong_Type.tp_name);
11341 0 : return -1;
11342 : }
11343 : }
11344 0 : return 0;
11345 : }
11346 :
11347 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_services_returned(PyObject *obj, void *closure)
11348 : {
11349 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11350 : PyObject *py_services_returned;
11351 0 : if (object->out.services_returned == NULL) {
11352 0 : Py_RETURN_NONE;
11353 : }
11354 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
11355 0 : return py_services_returned;
11356 : }
11357 :
11358 0 : static int py_svcctl_EnumServicesStatusW_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
11359 : {
11360 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11361 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
11362 0 : if (value == NULL) {
11363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
11364 0 : return -1;
11365 : }
11366 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
11367 0 : if (object->out.services_returned == NULL) {
11368 0 : PyErr_NoMemory();
11369 0 : return -1;
11370 : }
11371 : {
11372 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
11373 0 : if (PyLong_Check(value)) {
11374 : unsigned long long test_var;
11375 0 : test_var = PyLong_AsUnsignedLongLong(value);
11376 0 : if (PyErr_Occurred() != NULL) {
11377 0 : return -1;
11378 : }
11379 0 : if (test_var > uint_max) {
11380 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11381 : PyLong_Type.tp_name, uint_max, test_var);
11382 0 : return -1;
11383 : }
11384 0 : *object->out.services_returned = test_var;
11385 : } else {
11386 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11387 : PyLong_Type.tp_name);
11388 0 : return -1;
11389 : }
11390 : }
11391 0 : return 0;
11392 : }
11393 :
11394 0 : static PyObject *py_svcctl_EnumServicesStatusW_in_get_resume_handle(PyObject *obj, void *closure)
11395 : {
11396 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11397 : PyObject *py_resume_handle;
11398 0 : if (object->in.resume_handle == NULL) {
11399 0 : Py_RETURN_NONE;
11400 : }
11401 0 : if (object->in.resume_handle == NULL) {
11402 0 : py_resume_handle = Py_None;
11403 0 : Py_INCREF(py_resume_handle);
11404 : } else {
11405 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
11406 : }
11407 0 : return py_resume_handle;
11408 : }
11409 :
11410 0 : static int py_svcctl_EnumServicesStatusW_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
11411 : {
11412 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11413 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
11414 0 : if (value == NULL) {
11415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
11416 0 : return -1;
11417 : }
11418 0 : if (value == Py_None) {
11419 0 : object->in.resume_handle = NULL;
11420 : } else {
11421 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
11422 0 : if (object->in.resume_handle == NULL) {
11423 0 : PyErr_NoMemory();
11424 0 : return -1;
11425 : }
11426 : {
11427 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
11428 0 : if (PyLong_Check(value)) {
11429 : unsigned long long test_var;
11430 0 : test_var = PyLong_AsUnsignedLongLong(value);
11431 0 : if (PyErr_Occurred() != NULL) {
11432 0 : return -1;
11433 : }
11434 0 : if (test_var > uint_max) {
11435 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11436 : PyLong_Type.tp_name, uint_max, test_var);
11437 0 : return -1;
11438 : }
11439 0 : *object->in.resume_handle = test_var;
11440 : } else {
11441 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11442 : PyLong_Type.tp_name);
11443 0 : return -1;
11444 : }
11445 : }
11446 : }
11447 0 : return 0;
11448 : }
11449 :
11450 0 : static PyObject *py_svcctl_EnumServicesStatusW_out_get_resume_handle(PyObject *obj, void *closure)
11451 : {
11452 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11453 : PyObject *py_resume_handle;
11454 0 : if (object->out.resume_handle == NULL) {
11455 0 : Py_RETURN_NONE;
11456 : }
11457 0 : if (object->out.resume_handle == NULL) {
11458 0 : py_resume_handle = Py_None;
11459 0 : Py_INCREF(py_resume_handle);
11460 : } else {
11461 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
11462 : }
11463 0 : return py_resume_handle;
11464 : }
11465 :
11466 0 : static int py_svcctl_EnumServicesStatusW_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
11467 : {
11468 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11469 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
11470 0 : if (value == NULL) {
11471 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
11472 0 : return -1;
11473 : }
11474 0 : if (value == Py_None) {
11475 0 : object->out.resume_handle = NULL;
11476 : } else {
11477 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
11478 0 : if (object->out.resume_handle == NULL) {
11479 0 : PyErr_NoMemory();
11480 0 : return -1;
11481 : }
11482 : {
11483 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
11484 0 : if (PyLong_Check(value)) {
11485 : unsigned long long test_var;
11486 0 : test_var = PyLong_AsUnsignedLongLong(value);
11487 0 : if (PyErr_Occurred() != NULL) {
11488 0 : return -1;
11489 : }
11490 0 : if (test_var > uint_max) {
11491 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11492 : PyLong_Type.tp_name, uint_max, test_var);
11493 0 : return -1;
11494 : }
11495 0 : *object->out.resume_handle = test_var;
11496 : } else {
11497 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11498 : PyLong_Type.tp_name);
11499 0 : return -1;
11500 : }
11501 : }
11502 : }
11503 0 : return 0;
11504 : }
11505 :
11506 0 : static PyObject *py_svcctl_EnumServicesStatusW_get_result(PyObject *obj, void *closure)
11507 : {
11508 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(obj);
11509 : PyObject *py_result;
11510 0 : py_result = PyErr_FromWERROR(object->out.result);
11511 0 : return py_result;
11512 : }
11513 :
11514 0 : static int py_svcctl_EnumServicesStatusW_set_result(PyObject *py_obj, PyObject *value, void *closure)
11515 : {
11516 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11517 0 : if (value == NULL) {
11518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
11519 0 : return -1;
11520 : }
11521 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
11522 0 : return 0;
11523 : }
11524 :
11525 : static PyGetSetDef py_svcctl_EnumServicesStatusW_getsetters[] = {
11526 : {
11527 : .name = discard_const_p(char, "in_handle"),
11528 : .get = py_svcctl_EnumServicesStatusW_in_get_handle,
11529 : .set = py_svcctl_EnumServicesStatusW_in_set_handle,
11530 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
11531 : },
11532 : {
11533 : .name = discard_const_p(char, "in_type"),
11534 : .get = py_svcctl_EnumServicesStatusW_in_get_type,
11535 : .set = py_svcctl_EnumServicesStatusW_in_set_type,
11536 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11537 : },
11538 : {
11539 : .name = discard_const_p(char, "in_state"),
11540 : .get = py_svcctl_EnumServicesStatusW_in_get_state,
11541 : .set = py_svcctl_EnumServicesStatusW_in_set_state,
11542 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
11543 : },
11544 : {
11545 : .name = discard_const_p(char, "out_service"),
11546 : .get = py_svcctl_EnumServicesStatusW_out_get_service,
11547 : .set = py_svcctl_EnumServicesStatusW_out_set_service,
11548 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11549 : },
11550 : {
11551 : .name = discard_const_p(char, "in_offered"),
11552 : .get = py_svcctl_EnumServicesStatusW_in_get_offered,
11553 : .set = py_svcctl_EnumServicesStatusW_in_set_offered,
11554 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11555 : },
11556 : {
11557 : .name = discard_const_p(char, "out_needed"),
11558 : .get = py_svcctl_EnumServicesStatusW_out_get_needed,
11559 : .set = py_svcctl_EnumServicesStatusW_out_set_needed,
11560 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11561 : },
11562 : {
11563 : .name = discard_const_p(char, "out_services_returned"),
11564 : .get = py_svcctl_EnumServicesStatusW_out_get_services_returned,
11565 : .set = py_svcctl_EnumServicesStatusW_out_set_services_returned,
11566 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11567 : },
11568 : {
11569 : .name = discard_const_p(char, "in_resume_handle"),
11570 : .get = py_svcctl_EnumServicesStatusW_in_get_resume_handle,
11571 : .set = py_svcctl_EnumServicesStatusW_in_set_resume_handle,
11572 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11573 : },
11574 : {
11575 : .name = discard_const_p(char, "out_resume_handle"),
11576 : .get = py_svcctl_EnumServicesStatusW_out_get_resume_handle,
11577 : .set = py_svcctl_EnumServicesStatusW_out_set_resume_handle,
11578 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11579 : },
11580 : {
11581 : .name = discard_const_p(char, "result"),
11582 : .get = py_svcctl_EnumServicesStatusW_get_result,
11583 : .set = py_svcctl_EnumServicesStatusW_set_result,
11584 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
11585 : },
11586 : { .name = NULL }
11587 : };
11588 :
11589 0 : static PyObject *py_svcctl_EnumServicesStatusW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11590 : {
11591 0 : PyObject *self = pytalloc_new(struct svcctl_EnumServicesStatusW, type);
11592 0 : struct svcctl_EnumServicesStatusW *_self = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(self);
11593 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
11594 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
11595 0 : _self->out.service = talloc_zero(mem_ctx, uint8_t);
11596 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
11597 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
11598 0 : return self;
11599 : }
11600 :
11601 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
11602 : {
11603 :
11604 :
11605 0 : return PyLong_FromLong(14);
11606 : }
11607 :
11608 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
11609 : {
11610 0 : const struct ndr_interface_call *call = NULL;
11611 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11612 0 : PyObject *ret = NULL;
11613 0 : struct ndr_push *push = NULL;
11614 : DATA_BLOB blob;
11615 : enum ndr_err_code err;
11616 :
11617 0 : if (ndr_table_svcctl.num_calls < 15) {
11618 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusW_ndr_pack");
11619 0 : return NULL;
11620 : }
11621 0 : call = &ndr_table_svcctl.calls[14];
11622 :
11623 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
11624 0 : if (push == NULL) {
11625 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11626 0 : return NULL;
11627 : }
11628 :
11629 0 : push->flags |= ndr_push_flags;
11630 :
11631 0 : err = call->ndr_push(push, ndr_inout_flags, object);
11632 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11633 0 : TALLOC_FREE(push);
11634 0 : PyErr_SetNdrError(err);
11635 0 : return NULL;
11636 : }
11637 0 : blob = ndr_push_blob(push);
11638 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11639 0 : TALLOC_FREE(push);
11640 0 : return ret;
11641 : }
11642 :
11643 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11644 : {
11645 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11646 0 : PyObject *bigendian_obj = NULL;
11647 0 : PyObject *ndr64_obj = NULL;
11648 0 : uint32_t ndr_push_flags = 0;
11649 :
11650 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
11651 : discard_const_p(char *, kwnames),
11652 : &bigendian_obj,
11653 : &ndr64_obj)) {
11654 0 : return NULL;
11655 : }
11656 :
11657 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11658 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11659 : }
11660 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11661 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11662 : }
11663 :
11664 0 : return py_svcctl_EnumServicesStatusW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
11665 : }
11666 :
11667 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11668 : {
11669 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11670 0 : PyObject *bigendian_obj = NULL;
11671 0 : PyObject *ndr64_obj = NULL;
11672 0 : uint32_t ndr_push_flags = 0;
11673 :
11674 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
11675 : discard_const_p(char *, kwnames),
11676 : &bigendian_obj,
11677 : &ndr64_obj)) {
11678 0 : return NULL;
11679 : }
11680 :
11681 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11682 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11683 : }
11684 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11685 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11686 : }
11687 :
11688 0 : return py_svcctl_EnumServicesStatusW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
11689 : }
11690 :
11691 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
11692 : {
11693 0 : const struct ndr_interface_call *call = NULL;
11694 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11695 0 : struct ndr_pull *pull = NULL;
11696 : enum ndr_err_code err;
11697 :
11698 0 : if (ndr_table_svcctl.num_calls < 15) {
11699 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusW_ndr_unpack");
11700 0 : return NULL;
11701 : }
11702 0 : call = &ndr_table_svcctl.calls[14];
11703 :
11704 0 : pull = ndr_pull_init_blob(blob, object);
11705 0 : if (pull == NULL) {
11706 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11707 0 : return NULL;
11708 : }
11709 :
11710 0 : pull->flags |= ndr_pull_flags;
11711 :
11712 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
11713 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11714 0 : TALLOC_FREE(pull);
11715 0 : PyErr_SetNdrError(err);
11716 0 : return NULL;
11717 : }
11718 0 : if (!allow_remaining) {
11719 : uint32_t highest_ofs;
11720 :
11721 0 : if (pull->offset > pull->relative_highest_offset) {
11722 0 : highest_ofs = pull->offset;
11723 : } else {
11724 0 : highest_ofs = pull->relative_highest_offset;
11725 : }
11726 0 : if (highest_ofs < pull->data_size) {
11727 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
11728 : "not all bytes consumed ofs[%u] size[%u]",
11729 : highest_ofs, pull->data_size);
11730 0 : TALLOC_FREE(pull);
11731 0 : PyErr_SetNdrError(err);
11732 0 : return NULL;
11733 : }
11734 : }
11735 :
11736 0 : TALLOC_FREE(pull);
11737 0 : Py_RETURN_NONE;
11738 : }
11739 :
11740 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11741 : {
11742 : DATA_BLOB blob;
11743 0 : Py_ssize_t blob_length = 0;
11744 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11745 0 : PyObject *bigendian_obj = NULL;
11746 0 : PyObject *ndr64_obj = NULL;
11747 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11748 0 : PyObject *allow_remaining_obj = NULL;
11749 0 : bool allow_remaining = false;
11750 :
11751 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
11752 : discard_const_p(char *, kwnames),
11753 : &blob.data, &blob_length,
11754 : &bigendian_obj,
11755 : &ndr64_obj,
11756 : &allow_remaining_obj)) {
11757 0 : return NULL;
11758 : }
11759 0 : blob.length = blob_length;
11760 :
11761 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11762 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11763 : }
11764 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11765 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11766 : }
11767 :
11768 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11769 0 : allow_remaining = true;
11770 : }
11771 :
11772 0 : return py_svcctl_EnumServicesStatusW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
11773 : }
11774 :
11775 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11776 : {
11777 : DATA_BLOB blob;
11778 0 : Py_ssize_t blob_length = 0;
11779 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11780 0 : PyObject *bigendian_obj = NULL;
11781 0 : PyObject *ndr64_obj = NULL;
11782 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11783 0 : PyObject *allow_remaining_obj = NULL;
11784 0 : bool allow_remaining = false;
11785 :
11786 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
11787 : discard_const_p(char *, kwnames),
11788 : &blob.data, &blob_length,
11789 : &bigendian_obj,
11790 : &ndr64_obj,
11791 : &allow_remaining_obj)) {
11792 0 : return NULL;
11793 : }
11794 0 : blob.length = blob_length;
11795 :
11796 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11797 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11798 : }
11799 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11800 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11801 : }
11802 :
11803 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11804 0 : allow_remaining = true;
11805 : }
11806 :
11807 0 : return py_svcctl_EnumServicesStatusW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
11808 : }
11809 :
11810 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
11811 : {
11812 0 : const struct ndr_interface_call *call = NULL;
11813 0 : struct svcctl_EnumServicesStatusW *object = (struct svcctl_EnumServicesStatusW *)pytalloc_get_ptr(py_obj);
11814 : PyObject *ret;
11815 : char *retstr;
11816 :
11817 0 : if (ndr_table_svcctl.num_calls < 15) {
11818 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusW_ndr_print");
11819 0 : return NULL;
11820 : }
11821 0 : call = &ndr_table_svcctl.calls[14];
11822 :
11823 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
11824 0 : ret = PyUnicode_FromString(retstr);
11825 0 : TALLOC_FREE(retstr);
11826 :
11827 0 : return ret;
11828 : }
11829 :
11830 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11831 : {
11832 0 : return py_svcctl_EnumServicesStatusW_ndr_print(py_obj, "svcctl_EnumServicesStatusW_in", NDR_IN);
11833 : }
11834 :
11835 0 : static PyObject *py_svcctl_EnumServicesStatusW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11836 : {
11837 0 : return py_svcctl_EnumServicesStatusW_ndr_print(py_obj, "svcctl_EnumServicesStatusW_out", NDR_OUT);
11838 : }
11839 :
11840 : static PyMethodDef py_svcctl_EnumServicesStatusW_methods[] = {
11841 : { "opnum", (PyCFunction)py_svcctl_EnumServicesStatusW_ndr_opnum, METH_NOARGS|METH_CLASS,
11842 : "svcctl.EnumServicesStatusW.opnum() -> 14 (0x0e) " },
11843 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
11844 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
11845 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
11846 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
11847 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
11848 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
11849 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
11850 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
11851 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumServicesStatusW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
11852 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumServicesStatusW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
11853 : { NULL, NULL, 0, NULL }
11854 : };
11855 :
11856 :
11857 : static PyTypeObject svcctl_EnumServicesStatusW_Type = {
11858 : PyVarObject_HEAD_INIT(NULL, 0)
11859 : .tp_name = "svcctl.EnumServicesStatusW",
11860 : .tp_getset = py_svcctl_EnumServicesStatusW_getsetters,
11861 : .tp_methods = py_svcctl_EnumServicesStatusW_methods,
11862 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11863 : .tp_new = py_svcctl_EnumServicesStatusW_new,
11864 : };
11865 :
11866 0 : static bool pack_py_svcctl_EnumServicesStatusW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumServicesStatusW *r)
11867 : {
11868 : PyObject *py_handle;
11869 : PyObject *py_type;
11870 : PyObject *py_state;
11871 : PyObject *py_offered;
11872 : PyObject *py_resume_handle;
11873 0 : const char *kwnames[] = {
11874 : "handle", "type", "state", "offered", "resume_handle", NULL
11875 : };
11876 :
11877 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)) {
11878 0 : return false;
11879 : }
11880 :
11881 0 : if (py_handle == NULL) {
11882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
11883 0 : return false;
11884 : }
11885 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
11886 0 : if (r->in.handle == NULL) {
11887 0 : PyErr_NoMemory();
11888 0 : return false;
11889 : }
11890 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11891 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11892 0 : PyErr_NoMemory();
11893 0 : return false;
11894 : }
11895 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11896 0 : if (py_type == NULL) {
11897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
11898 0 : return false;
11899 : }
11900 : {
11901 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
11902 0 : if (PyLong_Check(py_type)) {
11903 : unsigned long long test_var;
11904 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
11905 0 : if (PyErr_Occurred() != NULL) {
11906 0 : return false;
11907 : }
11908 0 : if (test_var > uint_max) {
11909 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11910 : PyLong_Type.tp_name, uint_max, test_var);
11911 0 : return false;
11912 : }
11913 0 : r->in.type = test_var;
11914 : } else {
11915 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11916 : PyLong_Type.tp_name);
11917 0 : return false;
11918 : }
11919 : }
11920 0 : if (py_state == NULL) {
11921 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
11922 0 : return false;
11923 : }
11924 : {
11925 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
11926 0 : if (PyLong_Check(py_state)) {
11927 : unsigned long long test_var;
11928 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
11929 0 : if (PyErr_Occurred() != NULL) {
11930 0 : return false;
11931 : }
11932 0 : if (test_var > uint_max) {
11933 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11934 : PyLong_Type.tp_name, uint_max, test_var);
11935 0 : return false;
11936 : }
11937 0 : r->in.state = test_var;
11938 : } else {
11939 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11940 : PyLong_Type.tp_name);
11941 0 : return false;
11942 : }
11943 : }
11944 0 : if (py_offered == NULL) {
11945 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
11946 0 : return false;
11947 : }
11948 : {
11949 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
11950 0 : if (PyLong_Check(py_offered)) {
11951 : unsigned long long test_var;
11952 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
11953 0 : if (PyErr_Occurred() != NULL) {
11954 0 : return false;
11955 : }
11956 0 : if (test_var > uint_max) {
11957 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11958 : PyLong_Type.tp_name, uint_max, test_var);
11959 0 : return false;
11960 : }
11961 0 : r->in.offered = test_var;
11962 : } else {
11963 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11964 : PyLong_Type.tp_name);
11965 0 : return false;
11966 : }
11967 : }
11968 0 : if (py_resume_handle == NULL) {
11969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
11970 0 : return false;
11971 : }
11972 0 : if (py_resume_handle == Py_None) {
11973 0 : r->in.resume_handle = NULL;
11974 : } else {
11975 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
11976 0 : if (r->in.resume_handle == NULL) {
11977 0 : PyErr_NoMemory();
11978 0 : return false;
11979 : }
11980 : {
11981 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
11982 0 : if (PyLong_Check(py_resume_handle)) {
11983 : unsigned long long test_var;
11984 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
11985 0 : if (PyErr_Occurred() != NULL) {
11986 0 : return false;
11987 : }
11988 0 : if (test_var > uint_max) {
11989 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11990 : PyLong_Type.tp_name, uint_max, test_var);
11991 0 : return false;
11992 : }
11993 0 : *r->in.resume_handle = test_var;
11994 : } else {
11995 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11996 : PyLong_Type.tp_name);
11997 0 : return false;
11998 : }
11999 : }
12000 : }
12001 0 : return true;
12002 : }
12003 :
12004 0 : static PyObject *unpack_py_svcctl_EnumServicesStatusW_args_out(struct svcctl_EnumServicesStatusW *r)
12005 : {
12006 : PyObject *result;
12007 : PyObject *py_service;
12008 : PyObject *py_needed;
12009 : PyObject *py_services_returned;
12010 : PyObject *py_resume_handle;
12011 0 : result = PyTuple_New(4);
12012 0 : py_service = PyList_New(r->in.offered);
12013 0 : if (py_service == NULL) {
12014 0 : return NULL;
12015 : }
12016 : {
12017 : int service_cntr_1;
12018 0 : for (service_cntr_1 = 0; service_cntr_1 < (r->in.offered); service_cntr_1++) {
12019 : PyObject *py_service_1;
12020 0 : py_service_1 = PyLong_FromLong((uint16_t)r->out.service[service_cntr_1]);
12021 0 : PyList_SetItem(py_service, service_cntr_1, py_service_1);
12022 : }
12023 : }
12024 0 : PyTuple_SetItem(result, 0, py_service);
12025 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
12026 0 : PyTuple_SetItem(result, 1, py_needed);
12027 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
12028 0 : PyTuple_SetItem(result, 2, py_services_returned);
12029 0 : if (r->out.resume_handle == NULL) {
12030 0 : py_resume_handle = Py_None;
12031 0 : Py_INCREF(py_resume_handle);
12032 : } else {
12033 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
12034 : }
12035 0 : PyTuple_SetItem(result, 3, py_resume_handle);
12036 0 : if (!W_ERROR_IS_OK(r->out.result)) {
12037 0 : PyErr_SetWERROR(r->out.result);
12038 0 : return NULL;
12039 : }
12040 :
12041 0 : return result;
12042 : }
12043 :
12044 :
12045 0 : static PyObject *py_svcctl_OpenSCManagerW_in_get_MachineName(PyObject *obj, void *closure)
12046 : {
12047 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
12048 : PyObject *py_MachineName;
12049 0 : if (object->in.MachineName == NULL) {
12050 0 : Py_RETURN_NONE;
12051 : }
12052 0 : if (object->in.MachineName == NULL) {
12053 0 : py_MachineName = Py_None;
12054 0 : Py_INCREF(py_MachineName);
12055 : } else {
12056 0 : if (object->in.MachineName == NULL) {
12057 0 : py_MachineName = Py_None;
12058 0 : Py_INCREF(py_MachineName);
12059 : } else {
12060 0 : py_MachineName = PyUnicode_Decode(object->in.MachineName, strlen(object->in.MachineName), "utf-8", "ignore");
12061 : }
12062 : }
12063 0 : return py_MachineName;
12064 : }
12065 :
12066 0 : static int py_svcctl_OpenSCManagerW_in_set_MachineName(PyObject *py_obj, PyObject *value, void *closure)
12067 : {
12068 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12069 0 : if (value == NULL) {
12070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.MachineName");
12071 0 : return -1;
12072 : }
12073 0 : if (value == Py_None) {
12074 0 : object->in.MachineName = NULL;
12075 : } else {
12076 0 : object->in.MachineName = NULL;
12077 : {
12078 : const char *test_str;
12079 : const char *talloc_str;
12080 0 : PyObject *unicode = NULL;
12081 0 : if (PyUnicode_Check(value)) {
12082 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12083 0 : if (unicode == NULL) {
12084 0 : PyErr_NoMemory();
12085 0 : return -1;
12086 : }
12087 0 : test_str = PyBytes_AS_STRING(unicode);
12088 0 : } else if (PyBytes_Check(value)) {
12089 0 : test_str = PyBytes_AS_STRING(value);
12090 : } else {
12091 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12092 0 : return -1;
12093 : }
12094 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12095 0 : if (unicode != NULL) {
12096 0 : Py_DECREF(unicode);
12097 : }
12098 0 : if (talloc_str == NULL) {
12099 0 : PyErr_NoMemory();
12100 0 : return -1;
12101 : }
12102 0 : object->in.MachineName = talloc_str;
12103 : }
12104 : }
12105 0 : return 0;
12106 : }
12107 :
12108 0 : static PyObject *py_svcctl_OpenSCManagerW_in_get_DatabaseName(PyObject *obj, void *closure)
12109 : {
12110 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
12111 : PyObject *py_DatabaseName;
12112 0 : if (object->in.DatabaseName == NULL) {
12113 0 : Py_RETURN_NONE;
12114 : }
12115 0 : if (object->in.DatabaseName == NULL) {
12116 0 : py_DatabaseName = Py_None;
12117 0 : Py_INCREF(py_DatabaseName);
12118 : } else {
12119 0 : if (object->in.DatabaseName == NULL) {
12120 0 : py_DatabaseName = Py_None;
12121 0 : Py_INCREF(py_DatabaseName);
12122 : } else {
12123 0 : py_DatabaseName = PyUnicode_Decode(object->in.DatabaseName, strlen(object->in.DatabaseName), "utf-8", "ignore");
12124 : }
12125 : }
12126 0 : return py_DatabaseName;
12127 : }
12128 :
12129 0 : static int py_svcctl_OpenSCManagerW_in_set_DatabaseName(PyObject *py_obj, PyObject *value, void *closure)
12130 : {
12131 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12132 0 : if (value == NULL) {
12133 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DatabaseName");
12134 0 : return -1;
12135 : }
12136 0 : if (value == Py_None) {
12137 0 : object->in.DatabaseName = NULL;
12138 : } else {
12139 0 : object->in.DatabaseName = NULL;
12140 : {
12141 : const char *test_str;
12142 : const char *talloc_str;
12143 0 : PyObject *unicode = NULL;
12144 0 : if (PyUnicode_Check(value)) {
12145 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12146 0 : if (unicode == NULL) {
12147 0 : PyErr_NoMemory();
12148 0 : return -1;
12149 : }
12150 0 : test_str = PyBytes_AS_STRING(unicode);
12151 0 : } else if (PyBytes_Check(value)) {
12152 0 : test_str = PyBytes_AS_STRING(value);
12153 : } else {
12154 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12155 0 : return -1;
12156 : }
12157 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12158 0 : if (unicode != NULL) {
12159 0 : Py_DECREF(unicode);
12160 : }
12161 0 : if (talloc_str == NULL) {
12162 0 : PyErr_NoMemory();
12163 0 : return -1;
12164 : }
12165 0 : object->in.DatabaseName = talloc_str;
12166 : }
12167 : }
12168 0 : return 0;
12169 : }
12170 :
12171 0 : static PyObject *py_svcctl_OpenSCManagerW_in_get_access_mask(PyObject *obj, void *closure)
12172 : {
12173 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
12174 : PyObject *py_access_mask;
12175 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
12176 0 : return py_access_mask;
12177 : }
12178 :
12179 0 : static int py_svcctl_OpenSCManagerW_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
12180 : {
12181 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12182 0 : if (value == NULL) {
12183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
12184 0 : return -1;
12185 : }
12186 : {
12187 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
12188 0 : if (PyLong_Check(value)) {
12189 : unsigned long long test_var;
12190 0 : test_var = PyLong_AsUnsignedLongLong(value);
12191 0 : if (PyErr_Occurred() != NULL) {
12192 0 : return -1;
12193 : }
12194 0 : if (test_var > uint_max) {
12195 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12196 : PyLong_Type.tp_name, uint_max, test_var);
12197 0 : return -1;
12198 : }
12199 0 : object->in.access_mask = test_var;
12200 : } else {
12201 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12202 : PyLong_Type.tp_name);
12203 0 : return -1;
12204 : }
12205 : }
12206 0 : return 0;
12207 : }
12208 :
12209 0 : static PyObject *py_svcctl_OpenSCManagerW_out_get_handle(PyObject *obj, void *closure)
12210 : {
12211 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
12212 : PyObject *py_handle;
12213 0 : if (object->out.handle == NULL) {
12214 0 : Py_RETURN_NONE;
12215 : }
12216 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
12217 0 : return py_handle;
12218 : }
12219 :
12220 0 : static int py_svcctl_OpenSCManagerW_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
12221 : {
12222 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12223 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
12224 0 : if (value == NULL) {
12225 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
12226 0 : return -1;
12227 : }
12228 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
12229 0 : if (object->out.handle == NULL) {
12230 0 : PyErr_NoMemory();
12231 0 : return -1;
12232 : }
12233 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12234 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12235 0 : PyErr_NoMemory();
12236 0 : return -1;
12237 : }
12238 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
12239 0 : return 0;
12240 : }
12241 :
12242 0 : static PyObject *py_svcctl_OpenSCManagerW_get_result(PyObject *obj, void *closure)
12243 : {
12244 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(obj);
12245 : PyObject *py_result;
12246 0 : py_result = PyErr_FromWERROR(object->out.result);
12247 0 : return py_result;
12248 : }
12249 :
12250 0 : static int py_svcctl_OpenSCManagerW_set_result(PyObject *py_obj, PyObject *value, void *closure)
12251 : {
12252 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12253 0 : if (value == NULL) {
12254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
12255 0 : return -1;
12256 : }
12257 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
12258 0 : return 0;
12259 : }
12260 :
12261 : static PyGetSetDef py_svcctl_OpenSCManagerW_getsetters[] = {
12262 : {
12263 : .name = discard_const_p(char, "in_MachineName"),
12264 : .get = py_svcctl_OpenSCManagerW_in_get_MachineName,
12265 : .set = py_svcctl_OpenSCManagerW_in_set_MachineName,
12266 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
12267 : },
12268 : {
12269 : .name = discard_const_p(char, "in_DatabaseName"),
12270 : .get = py_svcctl_OpenSCManagerW_in_get_DatabaseName,
12271 : .set = py_svcctl_OpenSCManagerW_in_set_DatabaseName,
12272 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
12273 : },
12274 : {
12275 : .name = discard_const_p(char, "in_access_mask"),
12276 : .get = py_svcctl_OpenSCManagerW_in_get_access_mask,
12277 : .set = py_svcctl_OpenSCManagerW_in_set_access_mask,
12278 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_MgrAccessMask")
12279 : },
12280 : {
12281 : .name = discard_const_p(char, "out_handle"),
12282 : .get = py_svcctl_OpenSCManagerW_out_get_handle,
12283 : .set = py_svcctl_OpenSCManagerW_out_set_handle,
12284 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
12285 : },
12286 : {
12287 : .name = discard_const_p(char, "result"),
12288 : .get = py_svcctl_OpenSCManagerW_get_result,
12289 : .set = py_svcctl_OpenSCManagerW_set_result,
12290 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
12291 : },
12292 : { .name = NULL }
12293 : };
12294 :
12295 0 : static PyObject *py_svcctl_OpenSCManagerW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12296 : {
12297 0 : PyObject *self = pytalloc_new(struct svcctl_OpenSCManagerW, type);
12298 0 : struct svcctl_OpenSCManagerW *_self = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(self);
12299 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
12300 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
12301 0 : return self;
12302 : }
12303 :
12304 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12305 : {
12306 :
12307 :
12308 0 : return PyLong_FromLong(15);
12309 : }
12310 :
12311 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
12312 : {
12313 0 : const struct ndr_interface_call *call = NULL;
12314 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12315 0 : PyObject *ret = NULL;
12316 0 : struct ndr_push *push = NULL;
12317 : DATA_BLOB blob;
12318 : enum ndr_err_code err;
12319 :
12320 0 : if (ndr_table_svcctl.num_calls < 16) {
12321 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerW_ndr_pack");
12322 0 : return NULL;
12323 : }
12324 0 : call = &ndr_table_svcctl.calls[15];
12325 :
12326 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12327 0 : if (push == NULL) {
12328 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12329 0 : return NULL;
12330 : }
12331 :
12332 0 : push->flags |= ndr_push_flags;
12333 :
12334 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12335 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12336 0 : TALLOC_FREE(push);
12337 0 : PyErr_SetNdrError(err);
12338 0 : return NULL;
12339 : }
12340 0 : blob = ndr_push_blob(push);
12341 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12342 0 : TALLOC_FREE(push);
12343 0 : return ret;
12344 : }
12345 :
12346 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12347 : {
12348 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12349 0 : PyObject *bigendian_obj = NULL;
12350 0 : PyObject *ndr64_obj = NULL;
12351 0 : uint32_t ndr_push_flags = 0;
12352 :
12353 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12354 : discard_const_p(char *, kwnames),
12355 : &bigendian_obj,
12356 : &ndr64_obj)) {
12357 0 : return NULL;
12358 : }
12359 :
12360 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12361 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12362 : }
12363 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12364 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12365 : }
12366 :
12367 0 : return py_svcctl_OpenSCManagerW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12368 : }
12369 :
12370 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12371 : {
12372 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12373 0 : PyObject *bigendian_obj = NULL;
12374 0 : PyObject *ndr64_obj = NULL;
12375 0 : uint32_t ndr_push_flags = 0;
12376 :
12377 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12378 : discard_const_p(char *, kwnames),
12379 : &bigendian_obj,
12380 : &ndr64_obj)) {
12381 0 : return NULL;
12382 : }
12383 :
12384 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12385 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12386 : }
12387 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12388 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12389 : }
12390 :
12391 0 : return py_svcctl_OpenSCManagerW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
12392 : }
12393 :
12394 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
12395 : {
12396 0 : const struct ndr_interface_call *call = NULL;
12397 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12398 0 : struct ndr_pull *pull = NULL;
12399 : enum ndr_err_code err;
12400 :
12401 0 : if (ndr_table_svcctl.num_calls < 16) {
12402 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerW_ndr_unpack");
12403 0 : return NULL;
12404 : }
12405 0 : call = &ndr_table_svcctl.calls[15];
12406 :
12407 0 : pull = ndr_pull_init_blob(blob, object);
12408 0 : if (pull == NULL) {
12409 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12410 0 : return NULL;
12411 : }
12412 :
12413 0 : pull->flags |= ndr_pull_flags;
12414 :
12415 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
12416 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12417 0 : TALLOC_FREE(pull);
12418 0 : PyErr_SetNdrError(err);
12419 0 : return NULL;
12420 : }
12421 0 : if (!allow_remaining) {
12422 : uint32_t highest_ofs;
12423 :
12424 0 : if (pull->offset > pull->relative_highest_offset) {
12425 0 : highest_ofs = pull->offset;
12426 : } else {
12427 0 : highest_ofs = pull->relative_highest_offset;
12428 : }
12429 0 : if (highest_ofs < pull->data_size) {
12430 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
12431 : "not all bytes consumed ofs[%u] size[%u]",
12432 : highest_ofs, pull->data_size);
12433 0 : TALLOC_FREE(pull);
12434 0 : PyErr_SetNdrError(err);
12435 0 : return NULL;
12436 : }
12437 : }
12438 :
12439 0 : TALLOC_FREE(pull);
12440 0 : Py_RETURN_NONE;
12441 : }
12442 :
12443 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12444 : {
12445 : DATA_BLOB blob;
12446 0 : Py_ssize_t blob_length = 0;
12447 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12448 0 : PyObject *bigendian_obj = NULL;
12449 0 : PyObject *ndr64_obj = NULL;
12450 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12451 0 : PyObject *allow_remaining_obj = NULL;
12452 0 : bool allow_remaining = false;
12453 :
12454 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12455 : discard_const_p(char *, kwnames),
12456 : &blob.data, &blob_length,
12457 : &bigendian_obj,
12458 : &ndr64_obj,
12459 : &allow_remaining_obj)) {
12460 0 : return NULL;
12461 : }
12462 0 : blob.length = blob_length;
12463 :
12464 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12465 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12466 : }
12467 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12468 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12469 : }
12470 :
12471 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12472 0 : allow_remaining = true;
12473 : }
12474 :
12475 0 : return py_svcctl_OpenSCManagerW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12476 : }
12477 :
12478 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12479 : {
12480 : DATA_BLOB blob;
12481 0 : Py_ssize_t blob_length = 0;
12482 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12483 0 : PyObject *bigendian_obj = NULL;
12484 0 : PyObject *ndr64_obj = NULL;
12485 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12486 0 : PyObject *allow_remaining_obj = NULL;
12487 0 : bool allow_remaining = false;
12488 :
12489 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12490 : discard_const_p(char *, kwnames),
12491 : &blob.data, &blob_length,
12492 : &bigendian_obj,
12493 : &ndr64_obj,
12494 : &allow_remaining_obj)) {
12495 0 : return NULL;
12496 : }
12497 0 : blob.length = blob_length;
12498 :
12499 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12500 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12501 : }
12502 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12503 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12504 : }
12505 :
12506 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12507 0 : allow_remaining = true;
12508 : }
12509 :
12510 0 : return py_svcctl_OpenSCManagerW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12511 : }
12512 :
12513 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
12514 : {
12515 0 : const struct ndr_interface_call *call = NULL;
12516 0 : struct svcctl_OpenSCManagerW *object = (struct svcctl_OpenSCManagerW *)pytalloc_get_ptr(py_obj);
12517 : PyObject *ret;
12518 : char *retstr;
12519 :
12520 0 : if (ndr_table_svcctl.num_calls < 16) {
12521 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerW_ndr_print");
12522 0 : return NULL;
12523 : }
12524 0 : call = &ndr_table_svcctl.calls[15];
12525 :
12526 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12527 0 : ret = PyUnicode_FromString(retstr);
12528 0 : TALLOC_FREE(retstr);
12529 :
12530 0 : return ret;
12531 : }
12532 :
12533 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12534 : {
12535 0 : return py_svcctl_OpenSCManagerW_ndr_print(py_obj, "svcctl_OpenSCManagerW_in", NDR_IN);
12536 : }
12537 :
12538 0 : static PyObject *py_svcctl_OpenSCManagerW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12539 : {
12540 0 : return py_svcctl_OpenSCManagerW_ndr_print(py_obj, "svcctl_OpenSCManagerW_out", NDR_OUT);
12541 : }
12542 :
12543 : static PyMethodDef py_svcctl_OpenSCManagerW_methods[] = {
12544 : { "opnum", (PyCFunction)py_svcctl_OpenSCManagerW_ndr_opnum, METH_NOARGS|METH_CLASS,
12545 : "svcctl.OpenSCManagerW.opnum() -> 15 (0x0f) " },
12546 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12547 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12548 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12549 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12550 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12551 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12552 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12553 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12554 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenSCManagerW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12555 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenSCManagerW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12556 : { NULL, NULL, 0, NULL }
12557 : };
12558 :
12559 :
12560 : static PyTypeObject svcctl_OpenSCManagerW_Type = {
12561 : PyVarObject_HEAD_INIT(NULL, 0)
12562 : .tp_name = "svcctl.OpenSCManagerW",
12563 : .tp_getset = py_svcctl_OpenSCManagerW_getsetters,
12564 : .tp_methods = py_svcctl_OpenSCManagerW_methods,
12565 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12566 : .tp_new = py_svcctl_OpenSCManagerW_new,
12567 : };
12568 :
12569 0 : static bool pack_py_svcctl_OpenSCManagerW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenSCManagerW *r)
12570 : {
12571 : PyObject *py_MachineName;
12572 : PyObject *py_DatabaseName;
12573 : PyObject *py_access_mask;
12574 0 : const char *kwnames[] = {
12575 : "MachineName", "DatabaseName", "access_mask", NULL
12576 : };
12577 :
12578 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenSCManagerW", discard_const_p(char *, kwnames), &py_MachineName, &py_DatabaseName, &py_access_mask)) {
12579 0 : return false;
12580 : }
12581 :
12582 0 : if (py_MachineName == NULL) {
12583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.MachineName");
12584 0 : return false;
12585 : }
12586 0 : if (py_MachineName == Py_None) {
12587 0 : r->in.MachineName = NULL;
12588 : } else {
12589 0 : r->in.MachineName = NULL;
12590 : {
12591 : const char *test_str;
12592 : const char *talloc_str;
12593 0 : PyObject *unicode = NULL;
12594 0 : if (PyUnicode_Check(py_MachineName)) {
12595 0 : unicode = PyUnicode_AsEncodedString(py_MachineName, "utf-8", "ignore");
12596 0 : if (unicode == NULL) {
12597 0 : PyErr_NoMemory();
12598 0 : return false;
12599 : }
12600 0 : test_str = PyBytes_AS_STRING(unicode);
12601 0 : } else if (PyBytes_Check(py_MachineName)) {
12602 0 : test_str = PyBytes_AS_STRING(py_MachineName);
12603 : } else {
12604 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_MachineName)->tp_name);
12605 0 : return false;
12606 : }
12607 0 : talloc_str = talloc_strdup(r, test_str);
12608 0 : if (unicode != NULL) {
12609 0 : Py_DECREF(unicode);
12610 : }
12611 0 : if (talloc_str == NULL) {
12612 0 : PyErr_NoMemory();
12613 0 : return false;
12614 : }
12615 0 : r->in.MachineName = talloc_str;
12616 : }
12617 : }
12618 0 : if (py_DatabaseName == NULL) {
12619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DatabaseName");
12620 0 : return false;
12621 : }
12622 0 : if (py_DatabaseName == Py_None) {
12623 0 : r->in.DatabaseName = NULL;
12624 : } else {
12625 0 : r->in.DatabaseName = NULL;
12626 : {
12627 : const char *test_str;
12628 : const char *talloc_str;
12629 0 : PyObject *unicode = NULL;
12630 0 : if (PyUnicode_Check(py_DatabaseName)) {
12631 0 : unicode = PyUnicode_AsEncodedString(py_DatabaseName, "utf-8", "ignore");
12632 0 : if (unicode == NULL) {
12633 0 : PyErr_NoMemory();
12634 0 : return false;
12635 : }
12636 0 : test_str = PyBytes_AS_STRING(unicode);
12637 0 : } else if (PyBytes_Check(py_DatabaseName)) {
12638 0 : test_str = PyBytes_AS_STRING(py_DatabaseName);
12639 : } else {
12640 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DatabaseName)->tp_name);
12641 0 : return false;
12642 : }
12643 0 : talloc_str = talloc_strdup(r, test_str);
12644 0 : if (unicode != NULL) {
12645 0 : Py_DECREF(unicode);
12646 : }
12647 0 : if (talloc_str == NULL) {
12648 0 : PyErr_NoMemory();
12649 0 : return false;
12650 : }
12651 0 : r->in.DatabaseName = talloc_str;
12652 : }
12653 : }
12654 0 : if (py_access_mask == NULL) {
12655 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
12656 0 : return false;
12657 : }
12658 : {
12659 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
12660 0 : if (PyLong_Check(py_access_mask)) {
12661 : unsigned long long test_var;
12662 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
12663 0 : if (PyErr_Occurred() != NULL) {
12664 0 : return false;
12665 : }
12666 0 : if (test_var > uint_max) {
12667 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12668 : PyLong_Type.tp_name, uint_max, test_var);
12669 0 : return false;
12670 : }
12671 0 : r->in.access_mask = test_var;
12672 : } else {
12673 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12674 : PyLong_Type.tp_name);
12675 0 : return false;
12676 : }
12677 : }
12678 0 : return true;
12679 : }
12680 :
12681 0 : static PyObject *unpack_py_svcctl_OpenSCManagerW_args_out(struct svcctl_OpenSCManagerW *r)
12682 : {
12683 : PyObject *result;
12684 : PyObject *py_handle;
12685 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
12686 0 : result = py_handle;
12687 0 : if (!W_ERROR_IS_OK(r->out.result)) {
12688 0 : PyErr_SetWERROR(r->out.result);
12689 0 : return NULL;
12690 : }
12691 :
12692 0 : return result;
12693 : }
12694 :
12695 :
12696 0 : static PyObject *py_svcctl_OpenServiceW_in_get_scmanager_handle(PyObject *obj, void *closure)
12697 : {
12698 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
12699 : PyObject *py_scmanager_handle;
12700 0 : if (object->in.scmanager_handle == NULL) {
12701 0 : Py_RETURN_NONE;
12702 : }
12703 0 : py_scmanager_handle = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager_handle, object->in.scmanager_handle);
12704 0 : return py_scmanager_handle;
12705 : }
12706 :
12707 0 : static int py_svcctl_OpenServiceW_in_set_scmanager_handle(PyObject *py_obj, PyObject *value, void *closure)
12708 : {
12709 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
12710 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager_handle));
12711 0 : if (value == NULL) {
12712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager_handle");
12713 0 : return -1;
12714 : }
12715 0 : object->in.scmanager_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager_handle);
12716 0 : if (object->in.scmanager_handle == NULL) {
12717 0 : PyErr_NoMemory();
12718 0 : return -1;
12719 : }
12720 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12721 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12722 0 : PyErr_NoMemory();
12723 0 : return -1;
12724 : }
12725 0 : object->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(value);
12726 0 : return 0;
12727 : }
12728 :
12729 0 : static PyObject *py_svcctl_OpenServiceW_in_get_ServiceName(PyObject *obj, void *closure)
12730 : {
12731 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
12732 : PyObject *py_ServiceName;
12733 0 : if (object->in.ServiceName == NULL) {
12734 0 : py_ServiceName = Py_None;
12735 0 : Py_INCREF(py_ServiceName);
12736 : } else {
12737 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
12738 : }
12739 0 : return py_ServiceName;
12740 : }
12741 :
12742 0 : static int py_svcctl_OpenServiceW_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
12743 : {
12744 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
12745 0 : if (value == NULL) {
12746 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
12747 0 : return -1;
12748 : }
12749 : {
12750 : const char *test_str;
12751 : const char *talloc_str;
12752 0 : PyObject *unicode = NULL;
12753 0 : if (PyUnicode_Check(value)) {
12754 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12755 0 : if (unicode == NULL) {
12756 0 : PyErr_NoMemory();
12757 0 : return -1;
12758 : }
12759 0 : test_str = PyBytes_AS_STRING(unicode);
12760 0 : } else if (PyBytes_Check(value)) {
12761 0 : test_str = PyBytes_AS_STRING(value);
12762 : } else {
12763 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12764 0 : return -1;
12765 : }
12766 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12767 0 : if (unicode != NULL) {
12768 0 : Py_DECREF(unicode);
12769 : }
12770 0 : if (talloc_str == NULL) {
12771 0 : PyErr_NoMemory();
12772 0 : return -1;
12773 : }
12774 0 : object->in.ServiceName = talloc_str;
12775 : }
12776 0 : return 0;
12777 : }
12778 :
12779 0 : static PyObject *py_svcctl_OpenServiceW_in_get_access_mask(PyObject *obj, void *closure)
12780 : {
12781 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
12782 : PyObject *py_access_mask;
12783 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
12784 0 : return py_access_mask;
12785 : }
12786 :
12787 0 : static int py_svcctl_OpenServiceW_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
12788 : {
12789 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
12790 0 : if (value == NULL) {
12791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
12792 0 : return -1;
12793 : }
12794 : {
12795 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
12796 0 : if (PyLong_Check(value)) {
12797 : unsigned long long test_var;
12798 0 : test_var = PyLong_AsUnsignedLongLong(value);
12799 0 : if (PyErr_Occurred() != NULL) {
12800 0 : return -1;
12801 : }
12802 0 : if (test_var > uint_max) {
12803 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12804 : PyLong_Type.tp_name, uint_max, test_var);
12805 0 : return -1;
12806 : }
12807 0 : object->in.access_mask = test_var;
12808 : } else {
12809 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12810 : PyLong_Type.tp_name);
12811 0 : return -1;
12812 : }
12813 : }
12814 0 : return 0;
12815 : }
12816 :
12817 0 : static PyObject *py_svcctl_OpenServiceW_out_get_handle(PyObject *obj, void *closure)
12818 : {
12819 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
12820 : PyObject *py_handle;
12821 0 : if (object->out.handle == NULL) {
12822 0 : Py_RETURN_NONE;
12823 : }
12824 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
12825 0 : return py_handle;
12826 : }
12827 :
12828 0 : static int py_svcctl_OpenServiceW_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
12829 : {
12830 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
12831 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
12832 0 : if (value == NULL) {
12833 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
12834 0 : return -1;
12835 : }
12836 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
12837 0 : if (object->out.handle == NULL) {
12838 0 : PyErr_NoMemory();
12839 0 : return -1;
12840 : }
12841 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12842 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12843 0 : PyErr_NoMemory();
12844 0 : return -1;
12845 : }
12846 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
12847 0 : return 0;
12848 : }
12849 :
12850 0 : static PyObject *py_svcctl_OpenServiceW_get_result(PyObject *obj, void *closure)
12851 : {
12852 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(obj);
12853 : PyObject *py_result;
12854 0 : py_result = PyErr_FromWERROR(object->out.result);
12855 0 : return py_result;
12856 : }
12857 :
12858 0 : static int py_svcctl_OpenServiceW_set_result(PyObject *py_obj, PyObject *value, void *closure)
12859 : {
12860 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
12861 0 : if (value == NULL) {
12862 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
12863 0 : return -1;
12864 : }
12865 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
12866 0 : return 0;
12867 : }
12868 :
12869 : static PyGetSetDef py_svcctl_OpenServiceW_getsetters[] = {
12870 : {
12871 : .name = discard_const_p(char, "in_scmanager_handle"),
12872 : .get = py_svcctl_OpenServiceW_in_get_scmanager_handle,
12873 : .set = py_svcctl_OpenServiceW_in_set_scmanager_handle,
12874 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
12875 : },
12876 : {
12877 : .name = discard_const_p(char, "in_ServiceName"),
12878 : .get = py_svcctl_OpenServiceW_in_get_ServiceName,
12879 : .set = py_svcctl_OpenServiceW_in_set_ServiceName,
12880 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
12881 : },
12882 : {
12883 : .name = discard_const_p(char, "in_access_mask"),
12884 : .get = py_svcctl_OpenServiceW_in_get_access_mask,
12885 : .set = py_svcctl_OpenServiceW_in_set_access_mask,
12886 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceAccessMask")
12887 : },
12888 : {
12889 : .name = discard_const_p(char, "out_handle"),
12890 : .get = py_svcctl_OpenServiceW_out_get_handle,
12891 : .set = py_svcctl_OpenServiceW_out_set_handle,
12892 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
12893 : },
12894 : {
12895 : .name = discard_const_p(char, "result"),
12896 : .get = py_svcctl_OpenServiceW_get_result,
12897 : .set = py_svcctl_OpenServiceW_set_result,
12898 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
12899 : },
12900 : { .name = NULL }
12901 : };
12902 :
12903 0 : static PyObject *py_svcctl_OpenServiceW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12904 : {
12905 0 : PyObject *self = pytalloc_new(struct svcctl_OpenServiceW, type);
12906 0 : struct svcctl_OpenServiceW *_self = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(self);
12907 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
12908 0 : _self->in.scmanager_handle = talloc_zero(mem_ctx, struct policy_handle);
12909 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
12910 0 : return self;
12911 : }
12912 :
12913 0 : static PyObject *py_svcctl_OpenServiceW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12914 : {
12915 :
12916 :
12917 0 : return PyLong_FromLong(16);
12918 : }
12919 :
12920 0 : static PyObject *py_svcctl_OpenServiceW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
12921 : {
12922 0 : const struct ndr_interface_call *call = NULL;
12923 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
12924 0 : PyObject *ret = NULL;
12925 0 : struct ndr_push *push = NULL;
12926 : DATA_BLOB blob;
12927 : enum ndr_err_code err;
12928 :
12929 0 : if (ndr_table_svcctl.num_calls < 17) {
12930 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceW_ndr_pack");
12931 0 : return NULL;
12932 : }
12933 0 : call = &ndr_table_svcctl.calls[16];
12934 :
12935 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12936 0 : if (push == NULL) {
12937 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12938 0 : return NULL;
12939 : }
12940 :
12941 0 : push->flags |= ndr_push_flags;
12942 :
12943 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12944 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12945 0 : TALLOC_FREE(push);
12946 0 : PyErr_SetNdrError(err);
12947 0 : return NULL;
12948 : }
12949 0 : blob = ndr_push_blob(push);
12950 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12951 0 : TALLOC_FREE(push);
12952 0 : return ret;
12953 : }
12954 :
12955 0 : static PyObject *py_svcctl_OpenServiceW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12956 : {
12957 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12958 0 : PyObject *bigendian_obj = NULL;
12959 0 : PyObject *ndr64_obj = NULL;
12960 0 : uint32_t ndr_push_flags = 0;
12961 :
12962 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12963 : discard_const_p(char *, kwnames),
12964 : &bigendian_obj,
12965 : &ndr64_obj)) {
12966 0 : return NULL;
12967 : }
12968 :
12969 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12970 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12971 : }
12972 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12973 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12974 : }
12975 :
12976 0 : return py_svcctl_OpenServiceW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12977 : }
12978 :
12979 0 : static PyObject *py_svcctl_OpenServiceW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12980 : {
12981 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12982 0 : PyObject *bigendian_obj = NULL;
12983 0 : PyObject *ndr64_obj = NULL;
12984 0 : uint32_t ndr_push_flags = 0;
12985 :
12986 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12987 : discard_const_p(char *, kwnames),
12988 : &bigendian_obj,
12989 : &ndr64_obj)) {
12990 0 : return NULL;
12991 : }
12992 :
12993 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12994 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12995 : }
12996 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12997 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12998 : }
12999 :
13000 0 : return py_svcctl_OpenServiceW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13001 : }
13002 :
13003 0 : static PyObject *py_svcctl_OpenServiceW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
13004 : {
13005 0 : const struct ndr_interface_call *call = NULL;
13006 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
13007 0 : struct ndr_pull *pull = NULL;
13008 : enum ndr_err_code err;
13009 :
13010 0 : if (ndr_table_svcctl.num_calls < 17) {
13011 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceW_ndr_unpack");
13012 0 : return NULL;
13013 : }
13014 0 : call = &ndr_table_svcctl.calls[16];
13015 :
13016 0 : pull = ndr_pull_init_blob(blob, object);
13017 0 : if (pull == NULL) {
13018 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13019 0 : return NULL;
13020 : }
13021 :
13022 0 : pull->flags |= ndr_pull_flags;
13023 :
13024 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13025 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13026 0 : TALLOC_FREE(pull);
13027 0 : PyErr_SetNdrError(err);
13028 0 : return NULL;
13029 : }
13030 0 : if (!allow_remaining) {
13031 : uint32_t highest_ofs;
13032 :
13033 0 : if (pull->offset > pull->relative_highest_offset) {
13034 0 : highest_ofs = pull->offset;
13035 : } else {
13036 0 : highest_ofs = pull->relative_highest_offset;
13037 : }
13038 0 : if (highest_ofs < pull->data_size) {
13039 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13040 : "not all bytes consumed ofs[%u] size[%u]",
13041 : highest_ofs, pull->data_size);
13042 0 : TALLOC_FREE(pull);
13043 0 : PyErr_SetNdrError(err);
13044 0 : return NULL;
13045 : }
13046 : }
13047 :
13048 0 : TALLOC_FREE(pull);
13049 0 : Py_RETURN_NONE;
13050 : }
13051 :
13052 0 : static PyObject *py_svcctl_OpenServiceW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13053 : {
13054 : DATA_BLOB blob;
13055 0 : Py_ssize_t blob_length = 0;
13056 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13057 0 : PyObject *bigendian_obj = NULL;
13058 0 : PyObject *ndr64_obj = NULL;
13059 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13060 0 : PyObject *allow_remaining_obj = NULL;
13061 0 : bool allow_remaining = false;
13062 :
13063 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13064 : discard_const_p(char *, kwnames),
13065 : &blob.data, &blob_length,
13066 : &bigendian_obj,
13067 : &ndr64_obj,
13068 : &allow_remaining_obj)) {
13069 0 : return NULL;
13070 : }
13071 0 : blob.length = blob_length;
13072 :
13073 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13074 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13075 : }
13076 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13077 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13078 : }
13079 :
13080 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13081 0 : allow_remaining = true;
13082 : }
13083 :
13084 0 : return py_svcctl_OpenServiceW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13085 : }
13086 :
13087 0 : static PyObject *py_svcctl_OpenServiceW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13088 : {
13089 : DATA_BLOB blob;
13090 0 : Py_ssize_t blob_length = 0;
13091 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13092 0 : PyObject *bigendian_obj = NULL;
13093 0 : PyObject *ndr64_obj = NULL;
13094 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13095 0 : PyObject *allow_remaining_obj = NULL;
13096 0 : bool allow_remaining = false;
13097 :
13098 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13099 : discard_const_p(char *, kwnames),
13100 : &blob.data, &blob_length,
13101 : &bigendian_obj,
13102 : &ndr64_obj,
13103 : &allow_remaining_obj)) {
13104 0 : return NULL;
13105 : }
13106 0 : blob.length = blob_length;
13107 :
13108 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13109 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13110 : }
13111 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13112 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13113 : }
13114 :
13115 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13116 0 : allow_remaining = true;
13117 : }
13118 :
13119 0 : return py_svcctl_OpenServiceW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13120 : }
13121 :
13122 0 : static PyObject *py_svcctl_OpenServiceW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
13123 : {
13124 0 : const struct ndr_interface_call *call = NULL;
13125 0 : struct svcctl_OpenServiceW *object = (struct svcctl_OpenServiceW *)pytalloc_get_ptr(py_obj);
13126 : PyObject *ret;
13127 : char *retstr;
13128 :
13129 0 : if (ndr_table_svcctl.num_calls < 17) {
13130 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceW_ndr_print");
13131 0 : return NULL;
13132 : }
13133 0 : call = &ndr_table_svcctl.calls[16];
13134 :
13135 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13136 0 : ret = PyUnicode_FromString(retstr);
13137 0 : TALLOC_FREE(retstr);
13138 :
13139 0 : return ret;
13140 : }
13141 :
13142 0 : static PyObject *py_svcctl_OpenServiceW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13143 : {
13144 0 : return py_svcctl_OpenServiceW_ndr_print(py_obj, "svcctl_OpenServiceW_in", NDR_IN);
13145 : }
13146 :
13147 0 : static PyObject *py_svcctl_OpenServiceW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13148 : {
13149 0 : return py_svcctl_OpenServiceW_ndr_print(py_obj, "svcctl_OpenServiceW_out", NDR_OUT);
13150 : }
13151 :
13152 : static PyMethodDef py_svcctl_OpenServiceW_methods[] = {
13153 : { "opnum", (PyCFunction)py_svcctl_OpenServiceW_ndr_opnum, METH_NOARGS|METH_CLASS,
13154 : "svcctl.OpenServiceW.opnum() -> 16 (0x10) " },
13155 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13156 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13157 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13158 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13159 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13160 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13161 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13162 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13163 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenServiceW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13164 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenServiceW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13165 : { NULL, NULL, 0, NULL }
13166 : };
13167 :
13168 :
13169 : static PyTypeObject svcctl_OpenServiceW_Type = {
13170 : PyVarObject_HEAD_INIT(NULL, 0)
13171 : .tp_name = "svcctl.OpenServiceW",
13172 : .tp_getset = py_svcctl_OpenServiceW_getsetters,
13173 : .tp_methods = py_svcctl_OpenServiceW_methods,
13174 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13175 : .tp_new = py_svcctl_OpenServiceW_new,
13176 : };
13177 :
13178 0 : static bool pack_py_svcctl_OpenServiceW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenServiceW *r)
13179 : {
13180 : PyObject *py_scmanager_handle;
13181 : PyObject *py_ServiceName;
13182 : PyObject *py_access_mask;
13183 0 : const char *kwnames[] = {
13184 : "scmanager_handle", "ServiceName", "access_mask", NULL
13185 : };
13186 :
13187 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenServiceW", discard_const_p(char *, kwnames), &py_scmanager_handle, &py_ServiceName, &py_access_mask)) {
13188 0 : return false;
13189 : }
13190 :
13191 0 : if (py_scmanager_handle == NULL) {
13192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager_handle");
13193 0 : return false;
13194 : }
13195 0 : r->in.scmanager_handle = talloc_ptrtype(r, r->in.scmanager_handle);
13196 0 : if (r->in.scmanager_handle == NULL) {
13197 0 : PyErr_NoMemory();
13198 0 : return false;
13199 : }
13200 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager_handle, return false;);
13201 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager_handle)) == NULL) {
13202 0 : PyErr_NoMemory();
13203 0 : return false;
13204 : }
13205 0 : r->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(py_scmanager_handle);
13206 0 : if (py_ServiceName == NULL) {
13207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
13208 0 : return false;
13209 : }
13210 : {
13211 : const char *test_str;
13212 : const char *talloc_str;
13213 0 : PyObject *unicode = NULL;
13214 0 : if (PyUnicode_Check(py_ServiceName)) {
13215 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
13216 0 : if (unicode == NULL) {
13217 0 : PyErr_NoMemory();
13218 0 : return false;
13219 : }
13220 0 : test_str = PyBytes_AS_STRING(unicode);
13221 0 : } else if (PyBytes_Check(py_ServiceName)) {
13222 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
13223 : } else {
13224 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
13225 0 : return false;
13226 : }
13227 0 : talloc_str = talloc_strdup(r, test_str);
13228 0 : if (unicode != NULL) {
13229 0 : Py_DECREF(unicode);
13230 : }
13231 0 : if (talloc_str == NULL) {
13232 0 : PyErr_NoMemory();
13233 0 : return false;
13234 : }
13235 0 : r->in.ServiceName = talloc_str;
13236 : }
13237 0 : if (py_access_mask == NULL) {
13238 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
13239 0 : return false;
13240 : }
13241 : {
13242 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
13243 0 : if (PyLong_Check(py_access_mask)) {
13244 : unsigned long long test_var;
13245 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
13246 0 : if (PyErr_Occurred() != NULL) {
13247 0 : return false;
13248 : }
13249 0 : if (test_var > uint_max) {
13250 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13251 : PyLong_Type.tp_name, uint_max, test_var);
13252 0 : return false;
13253 : }
13254 0 : r->in.access_mask = test_var;
13255 : } else {
13256 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13257 : PyLong_Type.tp_name);
13258 0 : return false;
13259 : }
13260 : }
13261 0 : return true;
13262 : }
13263 :
13264 0 : static PyObject *unpack_py_svcctl_OpenServiceW_args_out(struct svcctl_OpenServiceW *r)
13265 : {
13266 : PyObject *result;
13267 : PyObject *py_handle;
13268 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
13269 0 : result = py_handle;
13270 0 : if (!W_ERROR_IS_OK(r->out.result)) {
13271 0 : PyErr_SetWERROR(r->out.result);
13272 0 : return NULL;
13273 : }
13274 :
13275 0 : return result;
13276 : }
13277 :
13278 :
13279 0 : static PyObject *py_svcctl_QueryServiceConfigW_in_get_handle(PyObject *obj, void *closure)
13280 : {
13281 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
13282 : PyObject *py_handle;
13283 0 : if (object->in.handle == NULL) {
13284 0 : Py_RETURN_NONE;
13285 : }
13286 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13287 0 : return py_handle;
13288 : }
13289 :
13290 0 : static int py_svcctl_QueryServiceConfigW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13291 : {
13292 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13293 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13294 0 : if (value == NULL) {
13295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
13296 0 : return -1;
13297 : }
13298 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13299 0 : if (object->in.handle == NULL) {
13300 0 : PyErr_NoMemory();
13301 0 : return -1;
13302 : }
13303 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13304 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13305 0 : PyErr_NoMemory();
13306 0 : return -1;
13307 : }
13308 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13309 0 : return 0;
13310 : }
13311 :
13312 0 : static PyObject *py_svcctl_QueryServiceConfigW_out_get_query(PyObject *obj, void *closure)
13313 : {
13314 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
13315 : PyObject *py_query;
13316 0 : if (object->out.query == NULL) {
13317 0 : Py_RETURN_NONE;
13318 : }
13319 0 : py_query = pytalloc_reference_ex(&QUERY_SERVICE_CONFIG_Type, object->out.query, object->out.query);
13320 0 : return py_query;
13321 : }
13322 :
13323 0 : static int py_svcctl_QueryServiceConfigW_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
13324 : {
13325 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13326 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query));
13327 0 : if (value == NULL) {
13328 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
13329 0 : return -1;
13330 : }
13331 0 : object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query);
13332 0 : if (object->out.query == NULL) {
13333 0 : PyErr_NoMemory();
13334 0 : return -1;
13335 : }
13336 0 : PY_CHECK_TYPE(&QUERY_SERVICE_CONFIG_Type, value, return -1;);
13337 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13338 0 : PyErr_NoMemory();
13339 0 : return -1;
13340 : }
13341 0 : object->out.query = (struct QUERY_SERVICE_CONFIG *)pytalloc_get_ptr(value);
13342 0 : return 0;
13343 : }
13344 :
13345 0 : static PyObject *py_svcctl_QueryServiceConfigW_in_get_offered(PyObject *obj, void *closure)
13346 : {
13347 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
13348 : PyObject *py_offered;
13349 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
13350 0 : return py_offered;
13351 : }
13352 :
13353 0 : static int py_svcctl_QueryServiceConfigW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
13354 : {
13355 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13356 0 : if (value == NULL) {
13357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
13358 0 : return -1;
13359 : }
13360 : {
13361 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
13362 0 : if (PyLong_Check(value)) {
13363 : unsigned long long test_var;
13364 0 : test_var = PyLong_AsUnsignedLongLong(value);
13365 0 : if (PyErr_Occurred() != NULL) {
13366 0 : return -1;
13367 : }
13368 0 : if (test_var > uint_max) {
13369 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13370 : PyLong_Type.tp_name, uint_max, test_var);
13371 0 : return -1;
13372 : }
13373 0 : object->in.offered = test_var;
13374 : } else {
13375 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13376 : PyLong_Type.tp_name);
13377 0 : return -1;
13378 : }
13379 : }
13380 0 : return 0;
13381 : }
13382 :
13383 0 : static PyObject *py_svcctl_QueryServiceConfigW_out_get_needed(PyObject *obj, void *closure)
13384 : {
13385 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
13386 : PyObject *py_needed;
13387 0 : if (object->out.needed == NULL) {
13388 0 : Py_RETURN_NONE;
13389 : }
13390 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
13391 0 : return py_needed;
13392 : }
13393 :
13394 0 : static int py_svcctl_QueryServiceConfigW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
13395 : {
13396 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13397 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
13398 0 : if (value == NULL) {
13399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
13400 0 : return -1;
13401 : }
13402 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
13403 0 : if (object->out.needed == NULL) {
13404 0 : PyErr_NoMemory();
13405 0 : return -1;
13406 : }
13407 : {
13408 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
13409 0 : if (PyLong_Check(value)) {
13410 : unsigned long long test_var;
13411 0 : test_var = PyLong_AsUnsignedLongLong(value);
13412 0 : if (PyErr_Occurred() != NULL) {
13413 0 : return -1;
13414 : }
13415 0 : if (test_var > uint_max) {
13416 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13417 : PyLong_Type.tp_name, uint_max, test_var);
13418 0 : return -1;
13419 : }
13420 0 : *object->out.needed = test_var;
13421 : } else {
13422 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13423 : PyLong_Type.tp_name);
13424 0 : return -1;
13425 : }
13426 : }
13427 0 : return 0;
13428 : }
13429 :
13430 0 : static PyObject *py_svcctl_QueryServiceConfigW_get_result(PyObject *obj, void *closure)
13431 : {
13432 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(obj);
13433 : PyObject *py_result;
13434 0 : py_result = PyErr_FromWERROR(object->out.result);
13435 0 : return py_result;
13436 : }
13437 :
13438 0 : static int py_svcctl_QueryServiceConfigW_set_result(PyObject *py_obj, PyObject *value, void *closure)
13439 : {
13440 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13441 0 : if (value == NULL) {
13442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13443 0 : return -1;
13444 : }
13445 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
13446 0 : return 0;
13447 : }
13448 :
13449 : static PyGetSetDef py_svcctl_QueryServiceConfigW_getsetters[] = {
13450 : {
13451 : .name = discard_const_p(char, "in_handle"),
13452 : .get = py_svcctl_QueryServiceConfigW_in_get_handle,
13453 : .set = py_svcctl_QueryServiceConfigW_in_set_handle,
13454 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13455 : },
13456 : {
13457 : .name = discard_const_p(char, "out_query"),
13458 : .get = py_svcctl_QueryServiceConfigW_out_get_query,
13459 : .set = py_svcctl_QueryServiceConfigW_out_set_query,
13460 : .doc = discard_const_p(char, "PIDL-generated element of base type QUERY_SERVICE_CONFIG")
13461 : },
13462 : {
13463 : .name = discard_const_p(char, "in_offered"),
13464 : .get = py_svcctl_QueryServiceConfigW_in_get_offered,
13465 : .set = py_svcctl_QueryServiceConfigW_in_set_offered,
13466 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13467 : },
13468 : {
13469 : .name = discard_const_p(char, "out_needed"),
13470 : .get = py_svcctl_QueryServiceConfigW_out_get_needed,
13471 : .set = py_svcctl_QueryServiceConfigW_out_set_needed,
13472 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13473 : },
13474 : {
13475 : .name = discard_const_p(char, "result"),
13476 : .get = py_svcctl_QueryServiceConfigW_get_result,
13477 : .set = py_svcctl_QueryServiceConfigW_set_result,
13478 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
13479 : },
13480 : { .name = NULL }
13481 : };
13482 :
13483 0 : static PyObject *py_svcctl_QueryServiceConfigW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13484 : {
13485 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfigW, type);
13486 0 : struct svcctl_QueryServiceConfigW *_self = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(self);
13487 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13488 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
13489 0 : _self->out.query = talloc_zero(mem_ctx, struct QUERY_SERVICE_CONFIG);
13490 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
13491 0 : return self;
13492 : }
13493 :
13494 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13495 : {
13496 :
13497 :
13498 0 : return PyLong_FromLong(17);
13499 : }
13500 :
13501 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
13502 : {
13503 0 : const struct ndr_interface_call *call = NULL;
13504 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13505 0 : PyObject *ret = NULL;
13506 0 : struct ndr_push *push = NULL;
13507 : DATA_BLOB blob;
13508 : enum ndr_err_code err;
13509 :
13510 0 : if (ndr_table_svcctl.num_calls < 18) {
13511 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigW_ndr_pack");
13512 0 : return NULL;
13513 : }
13514 0 : call = &ndr_table_svcctl.calls[17];
13515 :
13516 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13517 0 : if (push == NULL) {
13518 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13519 0 : return NULL;
13520 : }
13521 :
13522 0 : push->flags |= ndr_push_flags;
13523 :
13524 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13525 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13526 0 : TALLOC_FREE(push);
13527 0 : PyErr_SetNdrError(err);
13528 0 : return NULL;
13529 : }
13530 0 : blob = ndr_push_blob(push);
13531 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13532 0 : TALLOC_FREE(push);
13533 0 : return ret;
13534 : }
13535 :
13536 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13537 : {
13538 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13539 0 : PyObject *bigendian_obj = NULL;
13540 0 : PyObject *ndr64_obj = NULL;
13541 0 : uint32_t ndr_push_flags = 0;
13542 :
13543 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13544 : discard_const_p(char *, kwnames),
13545 : &bigendian_obj,
13546 : &ndr64_obj)) {
13547 0 : return NULL;
13548 : }
13549 :
13550 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13551 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13552 : }
13553 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13554 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13555 : }
13556 :
13557 0 : return py_svcctl_QueryServiceConfigW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13558 : }
13559 :
13560 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13561 : {
13562 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13563 0 : PyObject *bigendian_obj = NULL;
13564 0 : PyObject *ndr64_obj = NULL;
13565 0 : uint32_t ndr_push_flags = 0;
13566 :
13567 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13568 : discard_const_p(char *, kwnames),
13569 : &bigendian_obj,
13570 : &ndr64_obj)) {
13571 0 : return NULL;
13572 : }
13573 :
13574 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13575 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13576 : }
13577 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13578 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13579 : }
13580 :
13581 0 : return py_svcctl_QueryServiceConfigW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13582 : }
13583 :
13584 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
13585 : {
13586 0 : const struct ndr_interface_call *call = NULL;
13587 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13588 0 : struct ndr_pull *pull = NULL;
13589 : enum ndr_err_code err;
13590 :
13591 0 : if (ndr_table_svcctl.num_calls < 18) {
13592 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigW_ndr_unpack");
13593 0 : return NULL;
13594 : }
13595 0 : call = &ndr_table_svcctl.calls[17];
13596 :
13597 0 : pull = ndr_pull_init_blob(blob, object);
13598 0 : if (pull == NULL) {
13599 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13600 0 : return NULL;
13601 : }
13602 :
13603 0 : pull->flags |= ndr_pull_flags;
13604 :
13605 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13606 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13607 0 : TALLOC_FREE(pull);
13608 0 : PyErr_SetNdrError(err);
13609 0 : return NULL;
13610 : }
13611 0 : if (!allow_remaining) {
13612 : uint32_t highest_ofs;
13613 :
13614 0 : if (pull->offset > pull->relative_highest_offset) {
13615 0 : highest_ofs = pull->offset;
13616 : } else {
13617 0 : highest_ofs = pull->relative_highest_offset;
13618 : }
13619 0 : if (highest_ofs < pull->data_size) {
13620 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13621 : "not all bytes consumed ofs[%u] size[%u]",
13622 : highest_ofs, pull->data_size);
13623 0 : TALLOC_FREE(pull);
13624 0 : PyErr_SetNdrError(err);
13625 0 : return NULL;
13626 : }
13627 : }
13628 :
13629 0 : TALLOC_FREE(pull);
13630 0 : Py_RETURN_NONE;
13631 : }
13632 :
13633 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13634 : {
13635 : DATA_BLOB blob;
13636 0 : Py_ssize_t blob_length = 0;
13637 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13638 0 : PyObject *bigendian_obj = NULL;
13639 0 : PyObject *ndr64_obj = NULL;
13640 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13641 0 : PyObject *allow_remaining_obj = NULL;
13642 0 : bool allow_remaining = false;
13643 :
13644 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13645 : discard_const_p(char *, kwnames),
13646 : &blob.data, &blob_length,
13647 : &bigendian_obj,
13648 : &ndr64_obj,
13649 : &allow_remaining_obj)) {
13650 0 : return NULL;
13651 : }
13652 0 : blob.length = blob_length;
13653 :
13654 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13655 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13656 : }
13657 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13658 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13659 : }
13660 :
13661 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13662 0 : allow_remaining = true;
13663 : }
13664 :
13665 0 : return py_svcctl_QueryServiceConfigW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13666 : }
13667 :
13668 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13669 : {
13670 : DATA_BLOB blob;
13671 0 : Py_ssize_t blob_length = 0;
13672 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13673 0 : PyObject *bigendian_obj = NULL;
13674 0 : PyObject *ndr64_obj = NULL;
13675 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13676 0 : PyObject *allow_remaining_obj = NULL;
13677 0 : bool allow_remaining = false;
13678 :
13679 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13680 : discard_const_p(char *, kwnames),
13681 : &blob.data, &blob_length,
13682 : &bigendian_obj,
13683 : &ndr64_obj,
13684 : &allow_remaining_obj)) {
13685 0 : return NULL;
13686 : }
13687 0 : blob.length = blob_length;
13688 :
13689 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13690 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13691 : }
13692 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13693 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13694 : }
13695 :
13696 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13697 0 : allow_remaining = true;
13698 : }
13699 :
13700 0 : return py_svcctl_QueryServiceConfigW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13701 : }
13702 :
13703 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
13704 : {
13705 0 : const struct ndr_interface_call *call = NULL;
13706 0 : struct svcctl_QueryServiceConfigW *object = (struct svcctl_QueryServiceConfigW *)pytalloc_get_ptr(py_obj);
13707 : PyObject *ret;
13708 : char *retstr;
13709 :
13710 0 : if (ndr_table_svcctl.num_calls < 18) {
13711 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigW_ndr_print");
13712 0 : return NULL;
13713 : }
13714 0 : call = &ndr_table_svcctl.calls[17];
13715 :
13716 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13717 0 : ret = PyUnicode_FromString(retstr);
13718 0 : TALLOC_FREE(retstr);
13719 :
13720 0 : return ret;
13721 : }
13722 :
13723 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13724 : {
13725 0 : return py_svcctl_QueryServiceConfigW_ndr_print(py_obj, "svcctl_QueryServiceConfigW_in", NDR_IN);
13726 : }
13727 :
13728 0 : static PyObject *py_svcctl_QueryServiceConfigW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13729 : {
13730 0 : return py_svcctl_QueryServiceConfigW_ndr_print(py_obj, "svcctl_QueryServiceConfigW_out", NDR_OUT);
13731 : }
13732 :
13733 : static PyMethodDef py_svcctl_QueryServiceConfigW_methods[] = {
13734 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfigW_ndr_opnum, METH_NOARGS|METH_CLASS,
13735 : "svcctl.QueryServiceConfigW.opnum() -> 17 (0x11) " },
13736 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13737 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13738 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13739 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13740 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13741 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13742 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13743 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13744 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfigW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13745 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfigW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13746 : { NULL, NULL, 0, NULL }
13747 : };
13748 :
13749 :
13750 : static PyTypeObject svcctl_QueryServiceConfigW_Type = {
13751 : PyVarObject_HEAD_INIT(NULL, 0)
13752 : .tp_name = "svcctl.QueryServiceConfigW",
13753 : .tp_getset = py_svcctl_QueryServiceConfigW_getsetters,
13754 : .tp_methods = py_svcctl_QueryServiceConfigW_methods,
13755 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13756 : .tp_new = py_svcctl_QueryServiceConfigW_new,
13757 : };
13758 :
13759 0 : static bool pack_py_svcctl_QueryServiceConfigW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfigW *r)
13760 : {
13761 : PyObject *py_handle;
13762 : PyObject *py_offered;
13763 0 : const char *kwnames[] = {
13764 : "handle", "offered", NULL
13765 : };
13766 :
13767 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceConfigW", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
13768 0 : return false;
13769 : }
13770 :
13771 0 : if (py_handle == NULL) {
13772 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
13773 0 : return false;
13774 : }
13775 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
13776 0 : if (r->in.handle == NULL) {
13777 0 : PyErr_NoMemory();
13778 0 : return false;
13779 : }
13780 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13781 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13782 0 : PyErr_NoMemory();
13783 0 : return false;
13784 : }
13785 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13786 0 : if (py_offered == NULL) {
13787 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
13788 0 : return false;
13789 : }
13790 : {
13791 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
13792 0 : if (PyLong_Check(py_offered)) {
13793 : unsigned long long test_var;
13794 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
13795 0 : if (PyErr_Occurred() != NULL) {
13796 0 : return false;
13797 : }
13798 0 : if (test_var > uint_max) {
13799 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13800 : PyLong_Type.tp_name, uint_max, test_var);
13801 0 : return false;
13802 : }
13803 0 : r->in.offered = test_var;
13804 : } else {
13805 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13806 : PyLong_Type.tp_name);
13807 0 : return false;
13808 : }
13809 : }
13810 0 : return true;
13811 : }
13812 :
13813 0 : static PyObject *unpack_py_svcctl_QueryServiceConfigW_args_out(struct svcctl_QueryServiceConfigW *r)
13814 : {
13815 : PyObject *result;
13816 : PyObject *py_query;
13817 : PyObject *py_needed;
13818 0 : result = PyTuple_New(2);
13819 0 : py_query = pytalloc_reference_ex(&QUERY_SERVICE_CONFIG_Type, r->out.query, r->out.query);
13820 0 : PyTuple_SetItem(result, 0, py_query);
13821 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
13822 0 : PyTuple_SetItem(result, 1, py_needed);
13823 0 : if (!W_ERROR_IS_OK(r->out.result)) {
13824 0 : PyErr_SetWERROR(r->out.result);
13825 0 : return NULL;
13826 : }
13827 :
13828 0 : return result;
13829 : }
13830 :
13831 :
13832 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_in_get_handle(PyObject *obj, void *closure)
13833 : {
13834 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
13835 : PyObject *py_handle;
13836 0 : if (object->in.handle == NULL) {
13837 0 : Py_RETURN_NONE;
13838 : }
13839 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13840 0 : return py_handle;
13841 : }
13842 :
13843 0 : static int py_svcctl_QueryServiceLockStatusW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13844 : {
13845 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
13846 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13847 0 : if (value == NULL) {
13848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
13849 0 : return -1;
13850 : }
13851 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13852 0 : if (object->in.handle == NULL) {
13853 0 : PyErr_NoMemory();
13854 0 : return -1;
13855 : }
13856 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13857 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13858 0 : PyErr_NoMemory();
13859 0 : return -1;
13860 : }
13861 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13862 0 : return 0;
13863 : }
13864 :
13865 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_in_get_offered(PyObject *obj, void *closure)
13866 : {
13867 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
13868 : PyObject *py_offered;
13869 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
13870 0 : return py_offered;
13871 : }
13872 :
13873 0 : static int py_svcctl_QueryServiceLockStatusW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
13874 : {
13875 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
13876 0 : if (value == NULL) {
13877 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
13878 0 : return -1;
13879 : }
13880 : {
13881 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
13882 0 : if (PyLong_Check(value)) {
13883 : unsigned long long test_var;
13884 0 : test_var = PyLong_AsUnsignedLongLong(value);
13885 0 : if (PyErr_Occurred() != NULL) {
13886 0 : return -1;
13887 : }
13888 0 : if (test_var > uint_max) {
13889 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13890 : PyLong_Type.tp_name, uint_max, test_var);
13891 0 : return -1;
13892 : }
13893 0 : object->in.offered = test_var;
13894 : } else {
13895 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13896 : PyLong_Type.tp_name);
13897 0 : return -1;
13898 : }
13899 : }
13900 0 : return 0;
13901 : }
13902 :
13903 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_out_get_lock_status(PyObject *obj, void *closure)
13904 : {
13905 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
13906 : PyObject *py_lock_status;
13907 0 : if (object->out.lock_status == NULL) {
13908 0 : Py_RETURN_NONE;
13909 : }
13910 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, object->out.lock_status, object->out.lock_status);
13911 0 : return py_lock_status;
13912 : }
13913 :
13914 0 : static int py_svcctl_QueryServiceLockStatusW_out_set_lock_status(PyObject *py_obj, PyObject *value, void *closure)
13915 : {
13916 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
13917 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock_status));
13918 0 : if (value == NULL) {
13919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock_status");
13920 0 : return -1;
13921 : }
13922 0 : object->out.lock_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock_status);
13923 0 : if (object->out.lock_status == NULL) {
13924 0 : PyErr_NoMemory();
13925 0 : return -1;
13926 : }
13927 0 : PY_CHECK_TYPE(&SERVICE_LOCK_STATUS_Type, value, return -1;);
13928 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13929 0 : PyErr_NoMemory();
13930 0 : return -1;
13931 : }
13932 0 : object->out.lock_status = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(value);
13933 0 : return 0;
13934 : }
13935 :
13936 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_out_get_needed(PyObject *obj, void *closure)
13937 : {
13938 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
13939 : PyObject *py_needed;
13940 0 : if (object->out.needed == NULL) {
13941 0 : Py_RETURN_NONE;
13942 : }
13943 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
13944 0 : return py_needed;
13945 : }
13946 :
13947 0 : static int py_svcctl_QueryServiceLockStatusW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
13948 : {
13949 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
13950 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
13951 0 : if (value == NULL) {
13952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
13953 0 : return -1;
13954 : }
13955 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
13956 0 : if (object->out.needed == NULL) {
13957 0 : PyErr_NoMemory();
13958 0 : return -1;
13959 : }
13960 : {
13961 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
13962 0 : if (PyLong_Check(value)) {
13963 : unsigned long long test_var;
13964 0 : test_var = PyLong_AsUnsignedLongLong(value);
13965 0 : if (PyErr_Occurred() != NULL) {
13966 0 : return -1;
13967 : }
13968 0 : if (test_var > uint_max) {
13969 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13970 : PyLong_Type.tp_name, uint_max, test_var);
13971 0 : return -1;
13972 : }
13973 0 : *object->out.needed = test_var;
13974 : } else {
13975 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13976 : PyLong_Type.tp_name);
13977 0 : return -1;
13978 : }
13979 : }
13980 0 : return 0;
13981 : }
13982 :
13983 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_get_result(PyObject *obj, void *closure)
13984 : {
13985 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(obj);
13986 : PyObject *py_result;
13987 0 : py_result = PyErr_FromWERROR(object->out.result);
13988 0 : return py_result;
13989 : }
13990 :
13991 0 : static int py_svcctl_QueryServiceLockStatusW_set_result(PyObject *py_obj, PyObject *value, void *closure)
13992 : {
13993 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
13994 0 : if (value == NULL) {
13995 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13996 0 : return -1;
13997 : }
13998 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
13999 0 : return 0;
14000 : }
14001 :
14002 : static PyGetSetDef py_svcctl_QueryServiceLockStatusW_getsetters[] = {
14003 : {
14004 : .name = discard_const_p(char, "in_handle"),
14005 : .get = py_svcctl_QueryServiceLockStatusW_in_get_handle,
14006 : .set = py_svcctl_QueryServiceLockStatusW_in_set_handle,
14007 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14008 : },
14009 : {
14010 : .name = discard_const_p(char, "in_offered"),
14011 : .get = py_svcctl_QueryServiceLockStatusW_in_get_offered,
14012 : .set = py_svcctl_QueryServiceLockStatusW_in_set_offered,
14013 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14014 : },
14015 : {
14016 : .name = discard_const_p(char, "out_lock_status"),
14017 : .get = py_svcctl_QueryServiceLockStatusW_out_get_lock_status,
14018 : .set = py_svcctl_QueryServiceLockStatusW_out_set_lock_status,
14019 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_LOCK_STATUS")
14020 : },
14021 : {
14022 : .name = discard_const_p(char, "out_needed"),
14023 : .get = py_svcctl_QueryServiceLockStatusW_out_get_needed,
14024 : .set = py_svcctl_QueryServiceLockStatusW_out_set_needed,
14025 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14026 : },
14027 : {
14028 : .name = discard_const_p(char, "result"),
14029 : .get = py_svcctl_QueryServiceLockStatusW_get_result,
14030 : .set = py_svcctl_QueryServiceLockStatusW_set_result,
14031 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
14032 : },
14033 : { .name = NULL }
14034 : };
14035 :
14036 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14037 : {
14038 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceLockStatusW, type);
14039 0 : struct svcctl_QueryServiceLockStatusW *_self = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(self);
14040 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14041 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14042 0 : _self->out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
14043 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
14044 0 : return self;
14045 : }
14046 :
14047 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14048 : {
14049 :
14050 :
14051 0 : return PyLong_FromLong(18);
14052 : }
14053 :
14054 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
14055 : {
14056 0 : const struct ndr_interface_call *call = NULL;
14057 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
14058 0 : PyObject *ret = NULL;
14059 0 : struct ndr_push *push = NULL;
14060 : DATA_BLOB blob;
14061 : enum ndr_err_code err;
14062 :
14063 0 : if (ndr_table_svcctl.num_calls < 19) {
14064 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusW_ndr_pack");
14065 0 : return NULL;
14066 : }
14067 0 : call = &ndr_table_svcctl.calls[18];
14068 :
14069 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14070 0 : if (push == NULL) {
14071 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14072 0 : return NULL;
14073 : }
14074 :
14075 0 : push->flags |= ndr_push_flags;
14076 :
14077 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14078 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14079 0 : TALLOC_FREE(push);
14080 0 : PyErr_SetNdrError(err);
14081 0 : return NULL;
14082 : }
14083 0 : blob = ndr_push_blob(push);
14084 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14085 0 : TALLOC_FREE(push);
14086 0 : return ret;
14087 : }
14088 :
14089 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14090 : {
14091 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14092 0 : PyObject *bigendian_obj = NULL;
14093 0 : PyObject *ndr64_obj = NULL;
14094 0 : uint32_t ndr_push_flags = 0;
14095 :
14096 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14097 : discard_const_p(char *, kwnames),
14098 : &bigendian_obj,
14099 : &ndr64_obj)) {
14100 0 : return NULL;
14101 : }
14102 :
14103 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14104 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14105 : }
14106 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14107 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14108 : }
14109 :
14110 0 : return py_svcctl_QueryServiceLockStatusW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14111 : }
14112 :
14113 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14114 : {
14115 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14116 0 : PyObject *bigendian_obj = NULL;
14117 0 : PyObject *ndr64_obj = NULL;
14118 0 : uint32_t ndr_push_flags = 0;
14119 :
14120 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14121 : discard_const_p(char *, kwnames),
14122 : &bigendian_obj,
14123 : &ndr64_obj)) {
14124 0 : return NULL;
14125 : }
14126 :
14127 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14128 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14129 : }
14130 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14131 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14132 : }
14133 :
14134 0 : return py_svcctl_QueryServiceLockStatusW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14135 : }
14136 :
14137 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
14138 : {
14139 0 : const struct ndr_interface_call *call = NULL;
14140 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
14141 0 : struct ndr_pull *pull = NULL;
14142 : enum ndr_err_code err;
14143 :
14144 0 : if (ndr_table_svcctl.num_calls < 19) {
14145 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusW_ndr_unpack");
14146 0 : return NULL;
14147 : }
14148 0 : call = &ndr_table_svcctl.calls[18];
14149 :
14150 0 : pull = ndr_pull_init_blob(blob, object);
14151 0 : if (pull == NULL) {
14152 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14153 0 : return NULL;
14154 : }
14155 :
14156 0 : pull->flags |= ndr_pull_flags;
14157 :
14158 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14159 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14160 0 : TALLOC_FREE(pull);
14161 0 : PyErr_SetNdrError(err);
14162 0 : return NULL;
14163 : }
14164 0 : if (!allow_remaining) {
14165 : uint32_t highest_ofs;
14166 :
14167 0 : if (pull->offset > pull->relative_highest_offset) {
14168 0 : highest_ofs = pull->offset;
14169 : } else {
14170 0 : highest_ofs = pull->relative_highest_offset;
14171 : }
14172 0 : if (highest_ofs < pull->data_size) {
14173 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14174 : "not all bytes consumed ofs[%u] size[%u]",
14175 : highest_ofs, pull->data_size);
14176 0 : TALLOC_FREE(pull);
14177 0 : PyErr_SetNdrError(err);
14178 0 : return NULL;
14179 : }
14180 : }
14181 :
14182 0 : TALLOC_FREE(pull);
14183 0 : Py_RETURN_NONE;
14184 : }
14185 :
14186 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14187 : {
14188 : DATA_BLOB blob;
14189 0 : Py_ssize_t blob_length = 0;
14190 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14191 0 : PyObject *bigendian_obj = NULL;
14192 0 : PyObject *ndr64_obj = NULL;
14193 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14194 0 : PyObject *allow_remaining_obj = NULL;
14195 0 : bool allow_remaining = false;
14196 :
14197 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14198 : discard_const_p(char *, kwnames),
14199 : &blob.data, &blob_length,
14200 : &bigendian_obj,
14201 : &ndr64_obj,
14202 : &allow_remaining_obj)) {
14203 0 : return NULL;
14204 : }
14205 0 : blob.length = blob_length;
14206 :
14207 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14208 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14209 : }
14210 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14211 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14212 : }
14213 :
14214 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14215 0 : allow_remaining = true;
14216 : }
14217 :
14218 0 : return py_svcctl_QueryServiceLockStatusW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14219 : }
14220 :
14221 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14222 : {
14223 : DATA_BLOB blob;
14224 0 : Py_ssize_t blob_length = 0;
14225 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14226 0 : PyObject *bigendian_obj = NULL;
14227 0 : PyObject *ndr64_obj = NULL;
14228 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14229 0 : PyObject *allow_remaining_obj = NULL;
14230 0 : bool allow_remaining = false;
14231 :
14232 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14233 : discard_const_p(char *, kwnames),
14234 : &blob.data, &blob_length,
14235 : &bigendian_obj,
14236 : &ndr64_obj,
14237 : &allow_remaining_obj)) {
14238 0 : return NULL;
14239 : }
14240 0 : blob.length = blob_length;
14241 :
14242 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14243 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14244 : }
14245 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14246 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14247 : }
14248 :
14249 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14250 0 : allow_remaining = true;
14251 : }
14252 :
14253 0 : return py_svcctl_QueryServiceLockStatusW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14254 : }
14255 :
14256 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
14257 : {
14258 0 : const struct ndr_interface_call *call = NULL;
14259 0 : struct svcctl_QueryServiceLockStatusW *object = (struct svcctl_QueryServiceLockStatusW *)pytalloc_get_ptr(py_obj);
14260 : PyObject *ret;
14261 : char *retstr;
14262 :
14263 0 : if (ndr_table_svcctl.num_calls < 19) {
14264 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusW_ndr_print");
14265 0 : return NULL;
14266 : }
14267 0 : call = &ndr_table_svcctl.calls[18];
14268 :
14269 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14270 0 : ret = PyUnicode_FromString(retstr);
14271 0 : TALLOC_FREE(retstr);
14272 :
14273 0 : return ret;
14274 : }
14275 :
14276 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14277 : {
14278 0 : return py_svcctl_QueryServiceLockStatusW_ndr_print(py_obj, "svcctl_QueryServiceLockStatusW_in", NDR_IN);
14279 : }
14280 :
14281 0 : static PyObject *py_svcctl_QueryServiceLockStatusW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14282 : {
14283 0 : return py_svcctl_QueryServiceLockStatusW_ndr_print(py_obj, "svcctl_QueryServiceLockStatusW_out", NDR_OUT);
14284 : }
14285 :
14286 : static PyMethodDef py_svcctl_QueryServiceLockStatusW_methods[] = {
14287 : { "opnum", (PyCFunction)py_svcctl_QueryServiceLockStatusW_ndr_opnum, METH_NOARGS|METH_CLASS,
14288 : "svcctl.QueryServiceLockStatusW.opnum() -> 18 (0x12) " },
14289 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14290 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14291 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14292 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14293 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14294 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14295 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14296 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14297 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceLockStatusW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14298 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceLockStatusW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14299 : { NULL, NULL, 0, NULL }
14300 : };
14301 :
14302 :
14303 : static PyTypeObject svcctl_QueryServiceLockStatusW_Type = {
14304 : PyVarObject_HEAD_INIT(NULL, 0)
14305 : .tp_name = "svcctl.QueryServiceLockStatusW",
14306 : .tp_getset = py_svcctl_QueryServiceLockStatusW_getsetters,
14307 : .tp_methods = py_svcctl_QueryServiceLockStatusW_methods,
14308 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14309 : .tp_new = py_svcctl_QueryServiceLockStatusW_new,
14310 : };
14311 :
14312 0 : static bool pack_py_svcctl_QueryServiceLockStatusW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceLockStatusW *r)
14313 : {
14314 : PyObject *py_handle;
14315 : PyObject *py_offered;
14316 0 : const char *kwnames[] = {
14317 : "handle", "offered", NULL
14318 : };
14319 :
14320 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceLockStatusW", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
14321 0 : return false;
14322 : }
14323 :
14324 0 : if (py_handle == NULL) {
14325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
14326 0 : return false;
14327 : }
14328 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
14329 0 : if (r->in.handle == NULL) {
14330 0 : PyErr_NoMemory();
14331 0 : return false;
14332 : }
14333 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14334 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14335 0 : PyErr_NoMemory();
14336 0 : return false;
14337 : }
14338 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14339 0 : if (py_offered == NULL) {
14340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
14341 0 : return false;
14342 : }
14343 : {
14344 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
14345 0 : if (PyLong_Check(py_offered)) {
14346 : unsigned long long test_var;
14347 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
14348 0 : if (PyErr_Occurred() != NULL) {
14349 0 : return false;
14350 : }
14351 0 : if (test_var > uint_max) {
14352 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14353 : PyLong_Type.tp_name, uint_max, test_var);
14354 0 : return false;
14355 : }
14356 0 : r->in.offered = test_var;
14357 : } else {
14358 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14359 : PyLong_Type.tp_name);
14360 0 : return false;
14361 : }
14362 : }
14363 0 : return true;
14364 : }
14365 :
14366 0 : static PyObject *unpack_py_svcctl_QueryServiceLockStatusW_args_out(struct svcctl_QueryServiceLockStatusW *r)
14367 : {
14368 : PyObject *result;
14369 : PyObject *py_lock_status;
14370 : PyObject *py_needed;
14371 0 : result = PyTuple_New(2);
14372 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, r->out.lock_status, r->out.lock_status);
14373 0 : PyTuple_SetItem(result, 0, py_lock_status);
14374 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
14375 0 : PyTuple_SetItem(result, 1, py_needed);
14376 0 : if (!W_ERROR_IS_OK(r->out.result)) {
14377 0 : PyErr_SetWERROR(r->out.result);
14378 0 : return NULL;
14379 : }
14380 :
14381 0 : return result;
14382 : }
14383 :
14384 :
14385 0 : static PyObject *py_svcctl_StartServiceW_in_get_handle(PyObject *obj, void *closure)
14386 : {
14387 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
14388 : PyObject *py_handle;
14389 0 : if (object->in.handle == NULL) {
14390 0 : Py_RETURN_NONE;
14391 : }
14392 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14393 0 : return py_handle;
14394 : }
14395 :
14396 0 : static int py_svcctl_StartServiceW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14397 : {
14398 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
14399 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14400 0 : if (value == NULL) {
14401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
14402 0 : return -1;
14403 : }
14404 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14405 0 : if (object->in.handle == NULL) {
14406 0 : PyErr_NoMemory();
14407 0 : return -1;
14408 : }
14409 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14410 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14411 0 : PyErr_NoMemory();
14412 0 : return -1;
14413 : }
14414 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14415 0 : return 0;
14416 : }
14417 :
14418 0 : static PyObject *py_svcctl_StartServiceW_in_get_NumArgs(PyObject *obj, void *closure)
14419 : {
14420 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
14421 : PyObject *py_NumArgs;
14422 0 : py_NumArgs = PyLong_FromUnsignedLongLong((uint32_t)object->in.NumArgs);
14423 0 : return py_NumArgs;
14424 : }
14425 :
14426 0 : static int py_svcctl_StartServiceW_in_set_NumArgs(PyObject *py_obj, PyObject *value, void *closure)
14427 : {
14428 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
14429 0 : if (value == NULL) {
14430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.NumArgs");
14431 0 : return -1;
14432 : }
14433 : {
14434 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.NumArgs));
14435 0 : if (PyLong_Check(value)) {
14436 : unsigned long long test_var;
14437 0 : test_var = PyLong_AsUnsignedLongLong(value);
14438 0 : if (PyErr_Occurred() != NULL) {
14439 0 : return -1;
14440 : }
14441 0 : if (test_var > uint_max) {
14442 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14443 : PyLong_Type.tp_name, uint_max, test_var);
14444 0 : return -1;
14445 : }
14446 0 : object->in.NumArgs = test_var;
14447 : } else {
14448 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14449 : PyLong_Type.tp_name);
14450 0 : return -1;
14451 : }
14452 : }
14453 0 : return 0;
14454 : }
14455 :
14456 0 : static PyObject *py_svcctl_StartServiceW_in_get_Arguments(PyObject *obj, void *closure)
14457 : {
14458 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
14459 : PyObject *py_Arguments;
14460 0 : if (object->in.Arguments == NULL) {
14461 0 : Py_RETURN_NONE;
14462 : }
14463 0 : if (object->in.Arguments == NULL) {
14464 0 : py_Arguments = Py_None;
14465 0 : Py_INCREF(py_Arguments);
14466 : } else {
14467 0 : py_Arguments = PyList_New(object->in.NumArgs);
14468 0 : if (py_Arguments == NULL) {
14469 0 : return NULL;
14470 : }
14471 : {
14472 : int Arguments_cntr_1;
14473 0 : for (Arguments_cntr_1 = 0; Arguments_cntr_1 < (object->in.NumArgs); Arguments_cntr_1++) {
14474 : PyObject *py_Arguments_1;
14475 0 : py_Arguments_1 = pytalloc_reference_ex(&svcctl_ArgumentString_Type, object->in.Arguments, &object->in.Arguments[Arguments_cntr_1]);
14476 0 : PyList_SetItem(py_Arguments, Arguments_cntr_1, py_Arguments_1);
14477 : }
14478 : }
14479 : }
14480 0 : return py_Arguments;
14481 : }
14482 :
14483 0 : static int py_svcctl_StartServiceW_in_set_Arguments(PyObject *py_obj, PyObject *value, void *closure)
14484 : {
14485 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
14486 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.Arguments));
14487 0 : if (value == NULL) {
14488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Arguments");
14489 0 : return -1;
14490 : }
14491 0 : if (value == Py_None) {
14492 0 : object->in.Arguments = NULL;
14493 : } else {
14494 0 : object->in.Arguments = NULL;
14495 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
14496 : {
14497 : int Arguments_cntr_1;
14498 0 : object->in.Arguments = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.Arguments, PyList_GET_SIZE(value));
14499 0 : if (!object->in.Arguments) { return -1;; }
14500 0 : talloc_set_name_const(object->in.Arguments, "ARRAY: object->in.Arguments");
14501 0 : for (Arguments_cntr_1 = 0; Arguments_cntr_1 < PyList_GET_SIZE(value); Arguments_cntr_1++) {
14502 0 : if (PyList_GET_ITEM(value, Arguments_cntr_1) == NULL) {
14503 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Arguments[Arguments_cntr_1]");
14504 0 : return -1;
14505 : }
14506 0 : PY_CHECK_TYPE(&svcctl_ArgumentString_Type, PyList_GET_ITEM(value, Arguments_cntr_1), return -1;);
14507 0 : if (talloc_reference(object->in.Arguments, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, Arguments_cntr_1))) == NULL) {
14508 0 : PyErr_NoMemory();
14509 0 : return -1;
14510 : }
14511 0 : object->in.Arguments[Arguments_cntr_1] = *(struct svcctl_ArgumentString *)pytalloc_get_ptr(PyList_GET_ITEM(value, Arguments_cntr_1));
14512 : }
14513 : }
14514 : }
14515 0 : return 0;
14516 : }
14517 :
14518 0 : static PyObject *py_svcctl_StartServiceW_get_result(PyObject *obj, void *closure)
14519 : {
14520 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(obj);
14521 : PyObject *py_result;
14522 0 : py_result = PyErr_FromWERROR(object->out.result);
14523 0 : return py_result;
14524 : }
14525 :
14526 0 : static int py_svcctl_StartServiceW_set_result(PyObject *py_obj, PyObject *value, void *closure)
14527 : {
14528 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
14529 0 : if (value == NULL) {
14530 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
14531 0 : return -1;
14532 : }
14533 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
14534 0 : return 0;
14535 : }
14536 :
14537 : static PyGetSetDef py_svcctl_StartServiceW_getsetters[] = {
14538 : {
14539 : .name = discard_const_p(char, "in_handle"),
14540 : .get = py_svcctl_StartServiceW_in_get_handle,
14541 : .set = py_svcctl_StartServiceW_in_set_handle,
14542 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14543 : },
14544 : {
14545 : .name = discard_const_p(char, "in_NumArgs"),
14546 : .get = py_svcctl_StartServiceW_in_get_NumArgs,
14547 : .set = py_svcctl_StartServiceW_in_set_NumArgs,
14548 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14549 : },
14550 : {
14551 : .name = discard_const_p(char, "in_Arguments"),
14552 : .get = py_svcctl_StartServiceW_in_get_Arguments,
14553 : .set = py_svcctl_StartServiceW_in_set_Arguments,
14554 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ArgumentString")
14555 : },
14556 : {
14557 : .name = discard_const_p(char, "result"),
14558 : .get = py_svcctl_StartServiceW_get_result,
14559 : .set = py_svcctl_StartServiceW_set_result,
14560 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
14561 : },
14562 : { .name = NULL }
14563 : };
14564 :
14565 0 : static PyObject *py_svcctl_StartServiceW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14566 : {
14567 0 : PyObject *self = pytalloc_new(struct svcctl_StartServiceW, type);
14568 0 : struct svcctl_StartServiceW *_self = (struct svcctl_StartServiceW *)pytalloc_get_ptr(self);
14569 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14570 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14571 0 : return self;
14572 : }
14573 :
14574 0 : static PyObject *py_svcctl_StartServiceW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14575 : {
14576 :
14577 :
14578 0 : return PyLong_FromLong(19);
14579 : }
14580 :
14581 0 : static PyObject *py_svcctl_StartServiceW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
14582 : {
14583 0 : const struct ndr_interface_call *call = NULL;
14584 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
14585 0 : PyObject *ret = NULL;
14586 0 : struct ndr_push *push = NULL;
14587 : DATA_BLOB blob;
14588 : enum ndr_err_code err;
14589 :
14590 0 : if (ndr_table_svcctl.num_calls < 20) {
14591 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceW_ndr_pack");
14592 0 : return NULL;
14593 : }
14594 0 : call = &ndr_table_svcctl.calls[19];
14595 :
14596 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14597 0 : if (push == NULL) {
14598 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14599 0 : return NULL;
14600 : }
14601 :
14602 0 : push->flags |= ndr_push_flags;
14603 :
14604 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14605 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14606 0 : TALLOC_FREE(push);
14607 0 : PyErr_SetNdrError(err);
14608 0 : return NULL;
14609 : }
14610 0 : blob = ndr_push_blob(push);
14611 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14612 0 : TALLOC_FREE(push);
14613 0 : return ret;
14614 : }
14615 :
14616 0 : static PyObject *py_svcctl_StartServiceW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14617 : {
14618 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14619 0 : PyObject *bigendian_obj = NULL;
14620 0 : PyObject *ndr64_obj = NULL;
14621 0 : uint32_t ndr_push_flags = 0;
14622 :
14623 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14624 : discard_const_p(char *, kwnames),
14625 : &bigendian_obj,
14626 : &ndr64_obj)) {
14627 0 : return NULL;
14628 : }
14629 :
14630 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14631 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14632 : }
14633 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14634 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14635 : }
14636 :
14637 0 : return py_svcctl_StartServiceW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14638 : }
14639 :
14640 0 : static PyObject *py_svcctl_StartServiceW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14641 : {
14642 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14643 0 : PyObject *bigendian_obj = NULL;
14644 0 : PyObject *ndr64_obj = NULL;
14645 0 : uint32_t ndr_push_flags = 0;
14646 :
14647 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14648 : discard_const_p(char *, kwnames),
14649 : &bigendian_obj,
14650 : &ndr64_obj)) {
14651 0 : return NULL;
14652 : }
14653 :
14654 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14655 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14656 : }
14657 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14658 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14659 : }
14660 :
14661 0 : return py_svcctl_StartServiceW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14662 : }
14663 :
14664 0 : static PyObject *py_svcctl_StartServiceW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
14665 : {
14666 0 : const struct ndr_interface_call *call = NULL;
14667 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
14668 0 : struct ndr_pull *pull = NULL;
14669 : enum ndr_err_code err;
14670 :
14671 0 : if (ndr_table_svcctl.num_calls < 20) {
14672 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceW_ndr_unpack");
14673 0 : return NULL;
14674 : }
14675 0 : call = &ndr_table_svcctl.calls[19];
14676 :
14677 0 : pull = ndr_pull_init_blob(blob, object);
14678 0 : if (pull == NULL) {
14679 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14680 0 : return NULL;
14681 : }
14682 :
14683 0 : pull->flags |= ndr_pull_flags;
14684 :
14685 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14686 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14687 0 : TALLOC_FREE(pull);
14688 0 : PyErr_SetNdrError(err);
14689 0 : return NULL;
14690 : }
14691 0 : if (!allow_remaining) {
14692 : uint32_t highest_ofs;
14693 :
14694 0 : if (pull->offset > pull->relative_highest_offset) {
14695 0 : highest_ofs = pull->offset;
14696 : } else {
14697 0 : highest_ofs = pull->relative_highest_offset;
14698 : }
14699 0 : if (highest_ofs < pull->data_size) {
14700 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14701 : "not all bytes consumed ofs[%u] size[%u]",
14702 : highest_ofs, pull->data_size);
14703 0 : TALLOC_FREE(pull);
14704 0 : PyErr_SetNdrError(err);
14705 0 : return NULL;
14706 : }
14707 : }
14708 :
14709 0 : TALLOC_FREE(pull);
14710 0 : Py_RETURN_NONE;
14711 : }
14712 :
14713 0 : static PyObject *py_svcctl_StartServiceW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14714 : {
14715 : DATA_BLOB blob;
14716 0 : Py_ssize_t blob_length = 0;
14717 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14718 0 : PyObject *bigendian_obj = NULL;
14719 0 : PyObject *ndr64_obj = NULL;
14720 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14721 0 : PyObject *allow_remaining_obj = NULL;
14722 0 : bool allow_remaining = false;
14723 :
14724 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14725 : discard_const_p(char *, kwnames),
14726 : &blob.data, &blob_length,
14727 : &bigendian_obj,
14728 : &ndr64_obj,
14729 : &allow_remaining_obj)) {
14730 0 : return NULL;
14731 : }
14732 0 : blob.length = blob_length;
14733 :
14734 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14735 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14736 : }
14737 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14738 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14739 : }
14740 :
14741 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14742 0 : allow_remaining = true;
14743 : }
14744 :
14745 0 : return py_svcctl_StartServiceW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14746 : }
14747 :
14748 0 : static PyObject *py_svcctl_StartServiceW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14749 : {
14750 : DATA_BLOB blob;
14751 0 : Py_ssize_t blob_length = 0;
14752 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14753 0 : PyObject *bigendian_obj = NULL;
14754 0 : PyObject *ndr64_obj = NULL;
14755 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14756 0 : PyObject *allow_remaining_obj = NULL;
14757 0 : bool allow_remaining = false;
14758 :
14759 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14760 : discard_const_p(char *, kwnames),
14761 : &blob.data, &blob_length,
14762 : &bigendian_obj,
14763 : &ndr64_obj,
14764 : &allow_remaining_obj)) {
14765 0 : return NULL;
14766 : }
14767 0 : blob.length = blob_length;
14768 :
14769 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14770 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14771 : }
14772 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14773 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14774 : }
14775 :
14776 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14777 0 : allow_remaining = true;
14778 : }
14779 :
14780 0 : return py_svcctl_StartServiceW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14781 : }
14782 :
14783 0 : static PyObject *py_svcctl_StartServiceW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
14784 : {
14785 0 : const struct ndr_interface_call *call = NULL;
14786 0 : struct svcctl_StartServiceW *object = (struct svcctl_StartServiceW *)pytalloc_get_ptr(py_obj);
14787 : PyObject *ret;
14788 : char *retstr;
14789 :
14790 0 : if (ndr_table_svcctl.num_calls < 20) {
14791 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceW_ndr_print");
14792 0 : return NULL;
14793 : }
14794 0 : call = &ndr_table_svcctl.calls[19];
14795 :
14796 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14797 0 : ret = PyUnicode_FromString(retstr);
14798 0 : TALLOC_FREE(retstr);
14799 :
14800 0 : return ret;
14801 : }
14802 :
14803 0 : static PyObject *py_svcctl_StartServiceW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14804 : {
14805 0 : return py_svcctl_StartServiceW_ndr_print(py_obj, "svcctl_StartServiceW_in", NDR_IN);
14806 : }
14807 :
14808 0 : static PyObject *py_svcctl_StartServiceW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14809 : {
14810 0 : return py_svcctl_StartServiceW_ndr_print(py_obj, "svcctl_StartServiceW_out", NDR_OUT);
14811 : }
14812 :
14813 : static PyMethodDef py_svcctl_StartServiceW_methods[] = {
14814 : { "opnum", (PyCFunction)py_svcctl_StartServiceW_ndr_opnum, METH_NOARGS|METH_CLASS,
14815 : "svcctl.StartServiceW.opnum() -> 19 (0x13) " },
14816 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14817 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14818 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14819 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14820 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14821 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14822 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14823 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14824 : { "__ndr_print_in__", (PyCFunction)py_svcctl_StartServiceW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14825 : { "__ndr_print_out__", (PyCFunction)py_svcctl_StartServiceW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14826 : { NULL, NULL, 0, NULL }
14827 : };
14828 :
14829 :
14830 : static PyTypeObject svcctl_StartServiceW_Type = {
14831 : PyVarObject_HEAD_INIT(NULL, 0)
14832 : .tp_name = "svcctl.StartServiceW",
14833 : .tp_getset = py_svcctl_StartServiceW_getsetters,
14834 : .tp_methods = py_svcctl_StartServiceW_methods,
14835 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14836 : .tp_new = py_svcctl_StartServiceW_new,
14837 : };
14838 :
14839 0 : static bool pack_py_svcctl_StartServiceW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_StartServiceW *r)
14840 : {
14841 : PyObject *py_handle;
14842 : PyObject *py_Arguments;
14843 0 : const char *kwnames[] = {
14844 : "handle", "Arguments", NULL
14845 : };
14846 :
14847 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_StartServiceW", discard_const_p(char *, kwnames), &py_handle, &py_Arguments)) {
14848 0 : return false;
14849 : }
14850 :
14851 0 : if (py_handle == NULL) {
14852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
14853 0 : return false;
14854 : }
14855 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
14856 0 : if (r->in.handle == NULL) {
14857 0 : PyErr_NoMemory();
14858 0 : return false;
14859 : }
14860 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14861 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14862 0 : PyErr_NoMemory();
14863 0 : return false;
14864 : }
14865 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14866 0 : PY_CHECK_TYPE(&PyList_Type, py_Arguments, return false;);
14867 0 : r->in.NumArgs = PyList_GET_SIZE(py_Arguments);
14868 0 : if (py_Arguments == NULL) {
14869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Arguments");
14870 0 : return false;
14871 : }
14872 0 : if (py_Arguments == Py_None) {
14873 0 : r->in.Arguments = NULL;
14874 : } else {
14875 0 : r->in.Arguments = NULL;
14876 0 : PY_CHECK_TYPE(&PyList_Type, py_Arguments, return false;);
14877 : {
14878 : int Arguments_cntr_1;
14879 0 : r->in.Arguments = talloc_array_ptrtype(r, r->in.Arguments, PyList_GET_SIZE(py_Arguments));
14880 0 : if (!r->in.Arguments) { return false;; }
14881 0 : talloc_set_name_const(r->in.Arguments, "ARRAY: r->in.Arguments");
14882 0 : for (Arguments_cntr_1 = 0; Arguments_cntr_1 < PyList_GET_SIZE(py_Arguments); Arguments_cntr_1++) {
14883 0 : if (PyList_GET_ITEM(py_Arguments, Arguments_cntr_1) == NULL) {
14884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Arguments[Arguments_cntr_1]");
14885 0 : return false;
14886 : }
14887 0 : PY_CHECK_TYPE(&svcctl_ArgumentString_Type, PyList_GET_ITEM(py_Arguments, Arguments_cntr_1), return false;);
14888 0 : if (talloc_reference(r->in.Arguments, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_Arguments, Arguments_cntr_1))) == NULL) {
14889 0 : PyErr_NoMemory();
14890 0 : return false;
14891 : }
14892 0 : r->in.Arguments[Arguments_cntr_1] = *(struct svcctl_ArgumentString *)pytalloc_get_ptr(PyList_GET_ITEM(py_Arguments, Arguments_cntr_1));
14893 : }
14894 : }
14895 : }
14896 0 : return true;
14897 : }
14898 :
14899 0 : static PyObject *unpack_py_svcctl_StartServiceW_args_out(struct svcctl_StartServiceW *r)
14900 : {
14901 : PyObject *result;
14902 0 : result = Py_None;
14903 0 : Py_INCREF(result);
14904 0 : if (!W_ERROR_IS_OK(r->out.result)) {
14905 0 : PyErr_SetWERROR(r->out.result);
14906 0 : return NULL;
14907 : }
14908 :
14909 0 : return result;
14910 : }
14911 :
14912 :
14913 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_in_get_handle(PyObject *obj, void *closure)
14914 : {
14915 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
14916 : PyObject *py_handle;
14917 0 : if (object->in.handle == NULL) {
14918 0 : Py_RETURN_NONE;
14919 : }
14920 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14921 0 : return py_handle;
14922 : }
14923 :
14924 0 : static int py_svcctl_GetServiceDisplayNameW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14925 : {
14926 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
14927 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14928 0 : if (value == NULL) {
14929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
14930 0 : return -1;
14931 : }
14932 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14933 0 : if (object->in.handle == NULL) {
14934 0 : PyErr_NoMemory();
14935 0 : return -1;
14936 : }
14937 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14938 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14939 0 : PyErr_NoMemory();
14940 0 : return -1;
14941 : }
14942 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14943 0 : return 0;
14944 : }
14945 :
14946 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_in_get_service_name(PyObject *obj, void *closure)
14947 : {
14948 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
14949 : PyObject *py_service_name;
14950 0 : if (object->in.service_name == NULL) {
14951 0 : Py_RETURN_NONE;
14952 : }
14953 0 : if (object->in.service_name == NULL) {
14954 0 : py_service_name = Py_None;
14955 0 : Py_INCREF(py_service_name);
14956 : } else {
14957 0 : if (object->in.service_name == NULL) {
14958 0 : py_service_name = Py_None;
14959 0 : Py_INCREF(py_service_name);
14960 : } else {
14961 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
14962 : }
14963 : }
14964 0 : return py_service_name;
14965 : }
14966 :
14967 0 : static int py_svcctl_GetServiceDisplayNameW_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
14968 : {
14969 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
14970 0 : if (value == NULL) {
14971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
14972 0 : return -1;
14973 : }
14974 0 : if (value == Py_None) {
14975 0 : object->in.service_name = NULL;
14976 : } else {
14977 0 : object->in.service_name = NULL;
14978 : {
14979 : const char *test_str;
14980 : const char *talloc_str;
14981 0 : PyObject *unicode = NULL;
14982 0 : if (PyUnicode_Check(value)) {
14983 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
14984 0 : if (unicode == NULL) {
14985 0 : PyErr_NoMemory();
14986 0 : return -1;
14987 : }
14988 0 : test_str = PyBytes_AS_STRING(unicode);
14989 0 : } else if (PyBytes_Check(value)) {
14990 0 : test_str = PyBytes_AS_STRING(value);
14991 : } else {
14992 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
14993 0 : return -1;
14994 : }
14995 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
14996 0 : if (unicode != NULL) {
14997 0 : Py_DECREF(unicode);
14998 : }
14999 0 : if (talloc_str == NULL) {
15000 0 : PyErr_NoMemory();
15001 0 : return -1;
15002 : }
15003 0 : object->in.service_name = talloc_str;
15004 : }
15005 : }
15006 0 : return 0;
15007 : }
15008 :
15009 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_out_get_display_name(PyObject *obj, void *closure)
15010 : {
15011 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
15012 : PyObject *py_display_name;
15013 0 : if (object->out.display_name == NULL) {
15014 0 : Py_RETURN_NONE;
15015 : }
15016 0 : if (*object->out.display_name == NULL) {
15017 0 : py_display_name = Py_None;
15018 0 : Py_INCREF(py_display_name);
15019 : } else {
15020 0 : if (*object->out.display_name == NULL) {
15021 0 : py_display_name = Py_None;
15022 0 : Py_INCREF(py_display_name);
15023 : } else {
15024 0 : py_display_name = PyUnicode_Decode(*object->out.display_name, strlen(*object->out.display_name), "utf-8", "ignore");
15025 : }
15026 : }
15027 0 : return py_display_name;
15028 : }
15029 :
15030 0 : static int py_svcctl_GetServiceDisplayNameW_out_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
15031 : {
15032 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
15033 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name));
15034 0 : if (value == NULL) {
15035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name");
15036 0 : return -1;
15037 : }
15038 0 : object->out.display_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name);
15039 0 : if (object->out.display_name == NULL) {
15040 0 : PyErr_NoMemory();
15041 0 : return -1;
15042 : }
15043 0 : if (value == Py_None) {
15044 0 : *object->out.display_name = NULL;
15045 : } else {
15046 0 : *object->out.display_name = NULL;
15047 : {
15048 : const char *test_str;
15049 : const char *talloc_str;
15050 0 : PyObject *unicode = NULL;
15051 0 : if (PyUnicode_Check(value)) {
15052 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15053 0 : if (unicode == NULL) {
15054 0 : PyErr_NoMemory();
15055 0 : return -1;
15056 : }
15057 0 : test_str = PyBytes_AS_STRING(unicode);
15058 0 : } else if (PyBytes_Check(value)) {
15059 0 : test_str = PyBytes_AS_STRING(value);
15060 : } else {
15061 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15062 0 : return -1;
15063 : }
15064 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15065 0 : if (unicode != NULL) {
15066 0 : Py_DECREF(unicode);
15067 : }
15068 0 : if (talloc_str == NULL) {
15069 0 : PyErr_NoMemory();
15070 0 : return -1;
15071 : }
15072 0 : *object->out.display_name = talloc_str;
15073 : }
15074 : }
15075 0 : return 0;
15076 : }
15077 :
15078 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_in_get_display_name_length(PyObject *obj, void *closure)
15079 : {
15080 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
15081 : PyObject *py_display_name_length;
15082 0 : if (object->in.display_name_length == NULL) {
15083 0 : Py_RETURN_NONE;
15084 : }
15085 0 : if (object->in.display_name_length == NULL) {
15086 0 : py_display_name_length = Py_None;
15087 0 : Py_INCREF(py_display_name_length);
15088 : } else {
15089 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
15090 : }
15091 0 : return py_display_name_length;
15092 : }
15093 :
15094 0 : static int py_svcctl_GetServiceDisplayNameW_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
15095 : {
15096 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
15097 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
15098 0 : if (value == NULL) {
15099 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
15100 0 : return -1;
15101 : }
15102 0 : if (value == Py_None) {
15103 0 : object->in.display_name_length = NULL;
15104 : } else {
15105 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
15106 0 : if (object->in.display_name_length == NULL) {
15107 0 : PyErr_NoMemory();
15108 0 : return -1;
15109 : }
15110 : {
15111 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
15112 0 : if (PyLong_Check(value)) {
15113 : unsigned long long test_var;
15114 0 : test_var = PyLong_AsUnsignedLongLong(value);
15115 0 : if (PyErr_Occurred() != NULL) {
15116 0 : return -1;
15117 : }
15118 0 : if (test_var > uint_max) {
15119 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15120 : PyLong_Type.tp_name, uint_max, test_var);
15121 0 : return -1;
15122 : }
15123 0 : *object->in.display_name_length = test_var;
15124 : } else {
15125 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15126 : PyLong_Type.tp_name);
15127 0 : return -1;
15128 : }
15129 : }
15130 : }
15131 0 : return 0;
15132 : }
15133 :
15134 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_out_get_display_name_length(PyObject *obj, void *closure)
15135 : {
15136 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
15137 : PyObject *py_display_name_length;
15138 0 : if (object->out.display_name_length == NULL) {
15139 0 : Py_RETURN_NONE;
15140 : }
15141 0 : if (object->out.display_name_length == NULL) {
15142 0 : py_display_name_length = Py_None;
15143 0 : Py_INCREF(py_display_name_length);
15144 : } else {
15145 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
15146 : }
15147 0 : return py_display_name_length;
15148 : }
15149 :
15150 0 : static int py_svcctl_GetServiceDisplayNameW_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
15151 : {
15152 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
15153 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
15154 0 : if (value == NULL) {
15155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
15156 0 : return -1;
15157 : }
15158 0 : if (value == Py_None) {
15159 0 : object->out.display_name_length = NULL;
15160 : } else {
15161 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
15162 0 : if (object->out.display_name_length == NULL) {
15163 0 : PyErr_NoMemory();
15164 0 : return -1;
15165 : }
15166 : {
15167 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
15168 0 : if (PyLong_Check(value)) {
15169 : unsigned long long test_var;
15170 0 : test_var = PyLong_AsUnsignedLongLong(value);
15171 0 : if (PyErr_Occurred() != NULL) {
15172 0 : return -1;
15173 : }
15174 0 : if (test_var > uint_max) {
15175 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15176 : PyLong_Type.tp_name, uint_max, test_var);
15177 0 : return -1;
15178 : }
15179 0 : *object->out.display_name_length = test_var;
15180 : } else {
15181 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15182 : PyLong_Type.tp_name);
15183 0 : return -1;
15184 : }
15185 : }
15186 : }
15187 0 : return 0;
15188 : }
15189 :
15190 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_get_result(PyObject *obj, void *closure)
15191 : {
15192 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(obj);
15193 : PyObject *py_result;
15194 0 : py_result = PyErr_FromWERROR(object->out.result);
15195 0 : return py_result;
15196 : }
15197 :
15198 0 : static int py_svcctl_GetServiceDisplayNameW_set_result(PyObject *py_obj, PyObject *value, void *closure)
15199 : {
15200 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
15201 0 : if (value == NULL) {
15202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15203 0 : return -1;
15204 : }
15205 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
15206 0 : return 0;
15207 : }
15208 :
15209 : static PyGetSetDef py_svcctl_GetServiceDisplayNameW_getsetters[] = {
15210 : {
15211 : .name = discard_const_p(char, "in_handle"),
15212 : .get = py_svcctl_GetServiceDisplayNameW_in_get_handle,
15213 : .set = py_svcctl_GetServiceDisplayNameW_in_set_handle,
15214 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15215 : },
15216 : {
15217 : .name = discard_const_p(char, "in_service_name"),
15218 : .get = py_svcctl_GetServiceDisplayNameW_in_get_service_name,
15219 : .set = py_svcctl_GetServiceDisplayNameW_in_set_service_name,
15220 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
15221 : },
15222 : {
15223 : .name = discard_const_p(char, "out_display_name"),
15224 : .get = py_svcctl_GetServiceDisplayNameW_out_get_display_name,
15225 : .set = py_svcctl_GetServiceDisplayNameW_out_set_display_name,
15226 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
15227 : },
15228 : {
15229 : .name = discard_const_p(char, "in_display_name_length"),
15230 : .get = py_svcctl_GetServiceDisplayNameW_in_get_display_name_length,
15231 : .set = py_svcctl_GetServiceDisplayNameW_in_set_display_name_length,
15232 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15233 : },
15234 : {
15235 : .name = discard_const_p(char, "out_display_name_length"),
15236 : .get = py_svcctl_GetServiceDisplayNameW_out_get_display_name_length,
15237 : .set = py_svcctl_GetServiceDisplayNameW_out_set_display_name_length,
15238 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15239 : },
15240 : {
15241 : .name = discard_const_p(char, "result"),
15242 : .get = py_svcctl_GetServiceDisplayNameW_get_result,
15243 : .set = py_svcctl_GetServiceDisplayNameW_set_result,
15244 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
15245 : },
15246 : { .name = NULL }
15247 : };
15248 :
15249 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15250 : {
15251 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceDisplayNameW, type);
15252 0 : struct svcctl_GetServiceDisplayNameW *_self = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(self);
15253 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15254 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15255 0 : return self;
15256 : }
15257 :
15258 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15259 : {
15260 :
15261 :
15262 0 : return PyLong_FromLong(20);
15263 : }
15264 :
15265 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
15266 : {
15267 0 : const struct ndr_interface_call *call = NULL;
15268 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
15269 0 : PyObject *ret = NULL;
15270 0 : struct ndr_push *push = NULL;
15271 : DATA_BLOB blob;
15272 : enum ndr_err_code err;
15273 :
15274 0 : if (ndr_table_svcctl.num_calls < 21) {
15275 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameW_ndr_pack");
15276 0 : return NULL;
15277 : }
15278 0 : call = &ndr_table_svcctl.calls[20];
15279 :
15280 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15281 0 : if (push == NULL) {
15282 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15283 0 : return NULL;
15284 : }
15285 :
15286 0 : push->flags |= ndr_push_flags;
15287 :
15288 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15289 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15290 0 : TALLOC_FREE(push);
15291 0 : PyErr_SetNdrError(err);
15292 0 : return NULL;
15293 : }
15294 0 : blob = ndr_push_blob(push);
15295 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15296 0 : TALLOC_FREE(push);
15297 0 : return ret;
15298 : }
15299 :
15300 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15301 : {
15302 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15303 0 : PyObject *bigendian_obj = NULL;
15304 0 : PyObject *ndr64_obj = NULL;
15305 0 : uint32_t ndr_push_flags = 0;
15306 :
15307 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15308 : discard_const_p(char *, kwnames),
15309 : &bigendian_obj,
15310 : &ndr64_obj)) {
15311 0 : return NULL;
15312 : }
15313 :
15314 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15315 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15316 : }
15317 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15318 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15319 : }
15320 :
15321 0 : return py_svcctl_GetServiceDisplayNameW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15322 : }
15323 :
15324 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15325 : {
15326 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15327 0 : PyObject *bigendian_obj = NULL;
15328 0 : PyObject *ndr64_obj = NULL;
15329 0 : uint32_t ndr_push_flags = 0;
15330 :
15331 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15332 : discard_const_p(char *, kwnames),
15333 : &bigendian_obj,
15334 : &ndr64_obj)) {
15335 0 : return NULL;
15336 : }
15337 :
15338 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15339 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15340 : }
15341 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15342 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15343 : }
15344 :
15345 0 : return py_svcctl_GetServiceDisplayNameW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15346 : }
15347 :
15348 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
15349 : {
15350 0 : const struct ndr_interface_call *call = NULL;
15351 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
15352 0 : struct ndr_pull *pull = NULL;
15353 : enum ndr_err_code err;
15354 :
15355 0 : if (ndr_table_svcctl.num_calls < 21) {
15356 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameW_ndr_unpack");
15357 0 : return NULL;
15358 : }
15359 0 : call = &ndr_table_svcctl.calls[20];
15360 :
15361 0 : pull = ndr_pull_init_blob(blob, object);
15362 0 : if (pull == NULL) {
15363 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15364 0 : return NULL;
15365 : }
15366 :
15367 0 : pull->flags |= ndr_pull_flags;
15368 :
15369 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15370 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15371 0 : TALLOC_FREE(pull);
15372 0 : PyErr_SetNdrError(err);
15373 0 : return NULL;
15374 : }
15375 0 : if (!allow_remaining) {
15376 : uint32_t highest_ofs;
15377 :
15378 0 : if (pull->offset > pull->relative_highest_offset) {
15379 0 : highest_ofs = pull->offset;
15380 : } else {
15381 0 : highest_ofs = pull->relative_highest_offset;
15382 : }
15383 0 : if (highest_ofs < pull->data_size) {
15384 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15385 : "not all bytes consumed ofs[%u] size[%u]",
15386 : highest_ofs, pull->data_size);
15387 0 : TALLOC_FREE(pull);
15388 0 : PyErr_SetNdrError(err);
15389 0 : return NULL;
15390 : }
15391 : }
15392 :
15393 0 : TALLOC_FREE(pull);
15394 0 : Py_RETURN_NONE;
15395 : }
15396 :
15397 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15398 : {
15399 : DATA_BLOB blob;
15400 0 : Py_ssize_t blob_length = 0;
15401 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15402 0 : PyObject *bigendian_obj = NULL;
15403 0 : PyObject *ndr64_obj = NULL;
15404 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15405 0 : PyObject *allow_remaining_obj = NULL;
15406 0 : bool allow_remaining = false;
15407 :
15408 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15409 : discard_const_p(char *, kwnames),
15410 : &blob.data, &blob_length,
15411 : &bigendian_obj,
15412 : &ndr64_obj,
15413 : &allow_remaining_obj)) {
15414 0 : return NULL;
15415 : }
15416 0 : blob.length = blob_length;
15417 :
15418 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15419 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15420 : }
15421 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15422 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15423 : }
15424 :
15425 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15426 0 : allow_remaining = true;
15427 : }
15428 :
15429 0 : return py_svcctl_GetServiceDisplayNameW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15430 : }
15431 :
15432 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15433 : {
15434 : DATA_BLOB blob;
15435 0 : Py_ssize_t blob_length = 0;
15436 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15437 0 : PyObject *bigendian_obj = NULL;
15438 0 : PyObject *ndr64_obj = NULL;
15439 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15440 0 : PyObject *allow_remaining_obj = NULL;
15441 0 : bool allow_remaining = false;
15442 :
15443 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15444 : discard_const_p(char *, kwnames),
15445 : &blob.data, &blob_length,
15446 : &bigendian_obj,
15447 : &ndr64_obj,
15448 : &allow_remaining_obj)) {
15449 0 : return NULL;
15450 : }
15451 0 : blob.length = blob_length;
15452 :
15453 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15454 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15455 : }
15456 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15457 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15458 : }
15459 :
15460 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15461 0 : allow_remaining = true;
15462 : }
15463 :
15464 0 : return py_svcctl_GetServiceDisplayNameW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15465 : }
15466 :
15467 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
15468 : {
15469 0 : const struct ndr_interface_call *call = NULL;
15470 0 : struct svcctl_GetServiceDisplayNameW *object = (struct svcctl_GetServiceDisplayNameW *)pytalloc_get_ptr(py_obj);
15471 : PyObject *ret;
15472 : char *retstr;
15473 :
15474 0 : if (ndr_table_svcctl.num_calls < 21) {
15475 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameW_ndr_print");
15476 0 : return NULL;
15477 : }
15478 0 : call = &ndr_table_svcctl.calls[20];
15479 :
15480 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15481 0 : ret = PyUnicode_FromString(retstr);
15482 0 : TALLOC_FREE(retstr);
15483 :
15484 0 : return ret;
15485 : }
15486 :
15487 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15488 : {
15489 0 : return py_svcctl_GetServiceDisplayNameW_ndr_print(py_obj, "svcctl_GetServiceDisplayNameW_in", NDR_IN);
15490 : }
15491 :
15492 0 : static PyObject *py_svcctl_GetServiceDisplayNameW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15493 : {
15494 0 : return py_svcctl_GetServiceDisplayNameW_ndr_print(py_obj, "svcctl_GetServiceDisplayNameW_out", NDR_OUT);
15495 : }
15496 :
15497 : static PyMethodDef py_svcctl_GetServiceDisplayNameW_methods[] = {
15498 : { "opnum", (PyCFunction)py_svcctl_GetServiceDisplayNameW_ndr_opnum, METH_NOARGS|METH_CLASS,
15499 : "svcctl.GetServiceDisplayNameW.opnum() -> 20 (0x14) " },
15500 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15501 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15502 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15503 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15504 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15505 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15506 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15507 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15508 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceDisplayNameW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15509 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceDisplayNameW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15510 : { NULL, NULL, 0, NULL }
15511 : };
15512 :
15513 :
15514 : static PyTypeObject svcctl_GetServiceDisplayNameW_Type = {
15515 : PyVarObject_HEAD_INIT(NULL, 0)
15516 : .tp_name = "svcctl.GetServiceDisplayNameW",
15517 : .tp_getset = py_svcctl_GetServiceDisplayNameW_getsetters,
15518 : .tp_methods = py_svcctl_GetServiceDisplayNameW_methods,
15519 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15520 : .tp_new = py_svcctl_GetServiceDisplayNameW_new,
15521 : };
15522 :
15523 0 : static bool pack_py_svcctl_GetServiceDisplayNameW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceDisplayNameW *r)
15524 : {
15525 : PyObject *py_handle;
15526 : PyObject *py_service_name;
15527 : PyObject *py_display_name_length;
15528 0 : const char *kwnames[] = {
15529 : "handle", "service_name", "display_name_length", NULL
15530 : };
15531 :
15532 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceDisplayNameW", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
15533 0 : return false;
15534 : }
15535 :
15536 0 : if (py_handle == NULL) {
15537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
15538 0 : return false;
15539 : }
15540 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15541 0 : if (r->in.handle == NULL) {
15542 0 : PyErr_NoMemory();
15543 0 : return false;
15544 : }
15545 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15546 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15547 0 : PyErr_NoMemory();
15548 0 : return false;
15549 : }
15550 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15551 0 : if (py_service_name == NULL) {
15552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
15553 0 : return false;
15554 : }
15555 0 : if (py_service_name == Py_None) {
15556 0 : r->in.service_name = NULL;
15557 : } else {
15558 0 : r->in.service_name = NULL;
15559 : {
15560 : const char *test_str;
15561 : const char *talloc_str;
15562 0 : PyObject *unicode = NULL;
15563 0 : if (PyUnicode_Check(py_service_name)) {
15564 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
15565 0 : if (unicode == NULL) {
15566 0 : PyErr_NoMemory();
15567 0 : return false;
15568 : }
15569 0 : test_str = PyBytes_AS_STRING(unicode);
15570 0 : } else if (PyBytes_Check(py_service_name)) {
15571 0 : test_str = PyBytes_AS_STRING(py_service_name);
15572 : } else {
15573 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
15574 0 : return false;
15575 : }
15576 0 : talloc_str = talloc_strdup(r, test_str);
15577 0 : if (unicode != NULL) {
15578 0 : Py_DECREF(unicode);
15579 : }
15580 0 : if (talloc_str == NULL) {
15581 0 : PyErr_NoMemory();
15582 0 : return false;
15583 : }
15584 0 : r->in.service_name = talloc_str;
15585 : }
15586 : }
15587 0 : if (py_display_name_length == NULL) {
15588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
15589 0 : return false;
15590 : }
15591 0 : if (py_display_name_length == Py_None) {
15592 0 : r->in.display_name_length = NULL;
15593 : } else {
15594 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
15595 0 : if (r->in.display_name_length == NULL) {
15596 0 : PyErr_NoMemory();
15597 0 : return false;
15598 : }
15599 : {
15600 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
15601 0 : if (PyLong_Check(py_display_name_length)) {
15602 : unsigned long long test_var;
15603 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
15604 0 : if (PyErr_Occurred() != NULL) {
15605 0 : return false;
15606 : }
15607 0 : if (test_var > uint_max) {
15608 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15609 : PyLong_Type.tp_name, uint_max, test_var);
15610 0 : return false;
15611 : }
15612 0 : *r->in.display_name_length = test_var;
15613 : } else {
15614 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15615 : PyLong_Type.tp_name);
15616 0 : return false;
15617 : }
15618 : }
15619 : }
15620 0 : return true;
15621 : }
15622 :
15623 0 : static PyObject *unpack_py_svcctl_GetServiceDisplayNameW_args_out(struct svcctl_GetServiceDisplayNameW *r)
15624 : {
15625 : PyObject *result;
15626 : PyObject *py_display_name;
15627 : PyObject *py_display_name_length;
15628 0 : result = PyTuple_New(2);
15629 0 : if (*r->out.display_name == NULL) {
15630 0 : py_display_name = Py_None;
15631 0 : Py_INCREF(py_display_name);
15632 : } else {
15633 0 : if (*r->out.display_name == NULL) {
15634 0 : py_display_name = Py_None;
15635 0 : Py_INCREF(py_display_name);
15636 : } else {
15637 0 : py_display_name = PyUnicode_Decode(*r->out.display_name, strlen(*r->out.display_name), "utf-8", "ignore");
15638 : }
15639 : }
15640 0 : PyTuple_SetItem(result, 0, py_display_name);
15641 0 : if (r->out.display_name_length == NULL) {
15642 0 : py_display_name_length = Py_None;
15643 0 : Py_INCREF(py_display_name_length);
15644 : } else {
15645 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
15646 : }
15647 0 : PyTuple_SetItem(result, 1, py_display_name_length);
15648 0 : if (!W_ERROR_IS_OK(r->out.result)) {
15649 0 : PyErr_SetWERROR(r->out.result);
15650 0 : return NULL;
15651 : }
15652 :
15653 0 : return result;
15654 : }
15655 :
15656 :
15657 0 : static PyObject *py_svcctl_GetServiceKeyNameW_in_get_handle(PyObject *obj, void *closure)
15658 : {
15659 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
15660 : PyObject *py_handle;
15661 0 : if (object->in.handle == NULL) {
15662 0 : Py_RETURN_NONE;
15663 : }
15664 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
15665 0 : return py_handle;
15666 : }
15667 :
15668 0 : static int py_svcctl_GetServiceKeyNameW_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
15669 : {
15670 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
15671 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
15672 0 : if (value == NULL) {
15673 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
15674 0 : return -1;
15675 : }
15676 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
15677 0 : if (object->in.handle == NULL) {
15678 0 : PyErr_NoMemory();
15679 0 : return -1;
15680 : }
15681 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
15682 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15683 0 : PyErr_NoMemory();
15684 0 : return -1;
15685 : }
15686 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
15687 0 : return 0;
15688 : }
15689 :
15690 0 : static PyObject *py_svcctl_GetServiceKeyNameW_in_get_service_name(PyObject *obj, void *closure)
15691 : {
15692 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
15693 : PyObject *py_service_name;
15694 0 : if (object->in.service_name == NULL) {
15695 0 : Py_RETURN_NONE;
15696 : }
15697 0 : if (object->in.service_name == NULL) {
15698 0 : py_service_name = Py_None;
15699 0 : Py_INCREF(py_service_name);
15700 : } else {
15701 0 : if (object->in.service_name == NULL) {
15702 0 : py_service_name = Py_None;
15703 0 : Py_INCREF(py_service_name);
15704 : } else {
15705 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
15706 : }
15707 : }
15708 0 : return py_service_name;
15709 : }
15710 :
15711 0 : static int py_svcctl_GetServiceKeyNameW_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
15712 : {
15713 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
15714 0 : if (value == NULL) {
15715 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
15716 0 : return -1;
15717 : }
15718 0 : if (value == Py_None) {
15719 0 : object->in.service_name = NULL;
15720 : } else {
15721 0 : object->in.service_name = NULL;
15722 : {
15723 : const char *test_str;
15724 : const char *talloc_str;
15725 0 : PyObject *unicode = NULL;
15726 0 : if (PyUnicode_Check(value)) {
15727 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15728 0 : if (unicode == NULL) {
15729 0 : PyErr_NoMemory();
15730 0 : return -1;
15731 : }
15732 0 : test_str = PyBytes_AS_STRING(unicode);
15733 0 : } else if (PyBytes_Check(value)) {
15734 0 : test_str = PyBytes_AS_STRING(value);
15735 : } else {
15736 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15737 0 : return -1;
15738 : }
15739 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15740 0 : if (unicode != NULL) {
15741 0 : Py_DECREF(unicode);
15742 : }
15743 0 : if (talloc_str == NULL) {
15744 0 : PyErr_NoMemory();
15745 0 : return -1;
15746 : }
15747 0 : object->in.service_name = talloc_str;
15748 : }
15749 : }
15750 0 : return 0;
15751 : }
15752 :
15753 0 : static PyObject *py_svcctl_GetServiceKeyNameW_out_get_key_name(PyObject *obj, void *closure)
15754 : {
15755 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
15756 : PyObject *py_key_name;
15757 0 : if (object->out.key_name == NULL) {
15758 0 : Py_RETURN_NONE;
15759 : }
15760 0 : if (*object->out.key_name == NULL) {
15761 0 : py_key_name = Py_None;
15762 0 : Py_INCREF(py_key_name);
15763 : } else {
15764 0 : if (*object->out.key_name == NULL) {
15765 0 : py_key_name = Py_None;
15766 0 : Py_INCREF(py_key_name);
15767 : } else {
15768 0 : py_key_name = PyUnicode_Decode(*object->out.key_name, strlen(*object->out.key_name), "utf-8", "ignore");
15769 : }
15770 : }
15771 0 : return py_key_name;
15772 : }
15773 :
15774 0 : static int py_svcctl_GetServiceKeyNameW_out_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
15775 : {
15776 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
15777 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.key_name));
15778 0 : if (value == NULL) {
15779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.key_name");
15780 0 : return -1;
15781 : }
15782 0 : object->out.key_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.key_name);
15783 0 : if (object->out.key_name == NULL) {
15784 0 : PyErr_NoMemory();
15785 0 : return -1;
15786 : }
15787 0 : if (value == Py_None) {
15788 0 : *object->out.key_name = NULL;
15789 : } else {
15790 0 : *object->out.key_name = NULL;
15791 : {
15792 : const char *test_str;
15793 : const char *talloc_str;
15794 0 : PyObject *unicode = NULL;
15795 0 : if (PyUnicode_Check(value)) {
15796 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15797 0 : if (unicode == NULL) {
15798 0 : PyErr_NoMemory();
15799 0 : return -1;
15800 : }
15801 0 : test_str = PyBytes_AS_STRING(unicode);
15802 0 : } else if (PyBytes_Check(value)) {
15803 0 : test_str = PyBytes_AS_STRING(value);
15804 : } else {
15805 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15806 0 : return -1;
15807 : }
15808 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15809 0 : if (unicode != NULL) {
15810 0 : Py_DECREF(unicode);
15811 : }
15812 0 : if (talloc_str == NULL) {
15813 0 : PyErr_NoMemory();
15814 0 : return -1;
15815 : }
15816 0 : *object->out.key_name = talloc_str;
15817 : }
15818 : }
15819 0 : return 0;
15820 : }
15821 :
15822 0 : static PyObject *py_svcctl_GetServiceKeyNameW_in_get_display_name_length(PyObject *obj, void *closure)
15823 : {
15824 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
15825 : PyObject *py_display_name_length;
15826 0 : if (object->in.display_name_length == NULL) {
15827 0 : Py_RETURN_NONE;
15828 : }
15829 0 : if (object->in.display_name_length == NULL) {
15830 0 : py_display_name_length = Py_None;
15831 0 : Py_INCREF(py_display_name_length);
15832 : } else {
15833 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
15834 : }
15835 0 : return py_display_name_length;
15836 : }
15837 :
15838 0 : static int py_svcctl_GetServiceKeyNameW_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
15839 : {
15840 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
15841 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
15842 0 : if (value == NULL) {
15843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
15844 0 : return -1;
15845 : }
15846 0 : if (value == Py_None) {
15847 0 : object->in.display_name_length = NULL;
15848 : } else {
15849 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
15850 0 : if (object->in.display_name_length == NULL) {
15851 0 : PyErr_NoMemory();
15852 0 : return -1;
15853 : }
15854 : {
15855 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
15856 0 : if (PyLong_Check(value)) {
15857 : unsigned long long test_var;
15858 0 : test_var = PyLong_AsUnsignedLongLong(value);
15859 0 : if (PyErr_Occurred() != NULL) {
15860 0 : return -1;
15861 : }
15862 0 : if (test_var > uint_max) {
15863 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15864 : PyLong_Type.tp_name, uint_max, test_var);
15865 0 : return -1;
15866 : }
15867 0 : *object->in.display_name_length = test_var;
15868 : } else {
15869 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15870 : PyLong_Type.tp_name);
15871 0 : return -1;
15872 : }
15873 : }
15874 : }
15875 0 : return 0;
15876 : }
15877 :
15878 0 : static PyObject *py_svcctl_GetServiceKeyNameW_out_get_display_name_length(PyObject *obj, void *closure)
15879 : {
15880 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
15881 : PyObject *py_display_name_length;
15882 0 : if (object->out.display_name_length == NULL) {
15883 0 : Py_RETURN_NONE;
15884 : }
15885 0 : if (object->out.display_name_length == NULL) {
15886 0 : py_display_name_length = Py_None;
15887 0 : Py_INCREF(py_display_name_length);
15888 : } else {
15889 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
15890 : }
15891 0 : return py_display_name_length;
15892 : }
15893 :
15894 0 : static int py_svcctl_GetServiceKeyNameW_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
15895 : {
15896 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
15897 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
15898 0 : if (value == NULL) {
15899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
15900 0 : return -1;
15901 : }
15902 0 : if (value == Py_None) {
15903 0 : object->out.display_name_length = NULL;
15904 : } else {
15905 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
15906 0 : if (object->out.display_name_length == NULL) {
15907 0 : PyErr_NoMemory();
15908 0 : return -1;
15909 : }
15910 : {
15911 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
15912 0 : if (PyLong_Check(value)) {
15913 : unsigned long long test_var;
15914 0 : test_var = PyLong_AsUnsignedLongLong(value);
15915 0 : if (PyErr_Occurred() != NULL) {
15916 0 : return -1;
15917 : }
15918 0 : if (test_var > uint_max) {
15919 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15920 : PyLong_Type.tp_name, uint_max, test_var);
15921 0 : return -1;
15922 : }
15923 0 : *object->out.display_name_length = test_var;
15924 : } else {
15925 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15926 : PyLong_Type.tp_name);
15927 0 : return -1;
15928 : }
15929 : }
15930 : }
15931 0 : return 0;
15932 : }
15933 :
15934 0 : static PyObject *py_svcctl_GetServiceKeyNameW_get_result(PyObject *obj, void *closure)
15935 : {
15936 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(obj);
15937 : PyObject *py_result;
15938 0 : py_result = PyErr_FromWERROR(object->out.result);
15939 0 : return py_result;
15940 : }
15941 :
15942 0 : static int py_svcctl_GetServiceKeyNameW_set_result(PyObject *py_obj, PyObject *value, void *closure)
15943 : {
15944 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
15945 0 : if (value == NULL) {
15946 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15947 0 : return -1;
15948 : }
15949 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
15950 0 : return 0;
15951 : }
15952 :
15953 : static PyGetSetDef py_svcctl_GetServiceKeyNameW_getsetters[] = {
15954 : {
15955 : .name = discard_const_p(char, "in_handle"),
15956 : .get = py_svcctl_GetServiceKeyNameW_in_get_handle,
15957 : .set = py_svcctl_GetServiceKeyNameW_in_set_handle,
15958 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15959 : },
15960 : {
15961 : .name = discard_const_p(char, "in_service_name"),
15962 : .get = py_svcctl_GetServiceKeyNameW_in_get_service_name,
15963 : .set = py_svcctl_GetServiceKeyNameW_in_set_service_name,
15964 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
15965 : },
15966 : {
15967 : .name = discard_const_p(char, "out_key_name"),
15968 : .get = py_svcctl_GetServiceKeyNameW_out_get_key_name,
15969 : .set = py_svcctl_GetServiceKeyNameW_out_set_key_name,
15970 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
15971 : },
15972 : {
15973 : .name = discard_const_p(char, "in_display_name_length"),
15974 : .get = py_svcctl_GetServiceKeyNameW_in_get_display_name_length,
15975 : .set = py_svcctl_GetServiceKeyNameW_in_set_display_name_length,
15976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15977 : },
15978 : {
15979 : .name = discard_const_p(char, "out_display_name_length"),
15980 : .get = py_svcctl_GetServiceKeyNameW_out_get_display_name_length,
15981 : .set = py_svcctl_GetServiceKeyNameW_out_set_display_name_length,
15982 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15983 : },
15984 : {
15985 : .name = discard_const_p(char, "result"),
15986 : .get = py_svcctl_GetServiceKeyNameW_get_result,
15987 : .set = py_svcctl_GetServiceKeyNameW_set_result,
15988 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
15989 : },
15990 : { .name = NULL }
15991 : };
15992 :
15993 0 : static PyObject *py_svcctl_GetServiceKeyNameW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15994 : {
15995 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceKeyNameW, type);
15996 0 : struct svcctl_GetServiceKeyNameW *_self = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(self);
15997 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15998 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15999 0 : return self;
16000 : }
16001 :
16002 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16003 : {
16004 :
16005 :
16006 0 : return PyLong_FromLong(21);
16007 : }
16008 :
16009 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
16010 : {
16011 0 : const struct ndr_interface_call *call = NULL;
16012 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
16013 0 : PyObject *ret = NULL;
16014 0 : struct ndr_push *push = NULL;
16015 : DATA_BLOB blob;
16016 : enum ndr_err_code err;
16017 :
16018 0 : if (ndr_table_svcctl.num_calls < 22) {
16019 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameW_ndr_pack");
16020 0 : return NULL;
16021 : }
16022 0 : call = &ndr_table_svcctl.calls[21];
16023 :
16024 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16025 0 : if (push == NULL) {
16026 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16027 0 : return NULL;
16028 : }
16029 :
16030 0 : push->flags |= ndr_push_flags;
16031 :
16032 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16033 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16034 0 : TALLOC_FREE(push);
16035 0 : PyErr_SetNdrError(err);
16036 0 : return NULL;
16037 : }
16038 0 : blob = ndr_push_blob(push);
16039 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16040 0 : TALLOC_FREE(push);
16041 0 : return ret;
16042 : }
16043 :
16044 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16045 : {
16046 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16047 0 : PyObject *bigendian_obj = NULL;
16048 0 : PyObject *ndr64_obj = NULL;
16049 0 : uint32_t ndr_push_flags = 0;
16050 :
16051 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16052 : discard_const_p(char *, kwnames),
16053 : &bigendian_obj,
16054 : &ndr64_obj)) {
16055 0 : return NULL;
16056 : }
16057 :
16058 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16059 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16060 : }
16061 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16062 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16063 : }
16064 :
16065 0 : return py_svcctl_GetServiceKeyNameW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16066 : }
16067 :
16068 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16069 : {
16070 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16071 0 : PyObject *bigendian_obj = NULL;
16072 0 : PyObject *ndr64_obj = NULL;
16073 0 : uint32_t ndr_push_flags = 0;
16074 :
16075 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16076 : discard_const_p(char *, kwnames),
16077 : &bigendian_obj,
16078 : &ndr64_obj)) {
16079 0 : return NULL;
16080 : }
16081 :
16082 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16083 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16084 : }
16085 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16086 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16087 : }
16088 :
16089 0 : return py_svcctl_GetServiceKeyNameW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16090 : }
16091 :
16092 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
16093 : {
16094 0 : const struct ndr_interface_call *call = NULL;
16095 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
16096 0 : struct ndr_pull *pull = NULL;
16097 : enum ndr_err_code err;
16098 :
16099 0 : if (ndr_table_svcctl.num_calls < 22) {
16100 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameW_ndr_unpack");
16101 0 : return NULL;
16102 : }
16103 0 : call = &ndr_table_svcctl.calls[21];
16104 :
16105 0 : pull = ndr_pull_init_blob(blob, object);
16106 0 : if (pull == NULL) {
16107 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16108 0 : return NULL;
16109 : }
16110 :
16111 0 : pull->flags |= ndr_pull_flags;
16112 :
16113 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16114 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16115 0 : TALLOC_FREE(pull);
16116 0 : PyErr_SetNdrError(err);
16117 0 : return NULL;
16118 : }
16119 0 : if (!allow_remaining) {
16120 : uint32_t highest_ofs;
16121 :
16122 0 : if (pull->offset > pull->relative_highest_offset) {
16123 0 : highest_ofs = pull->offset;
16124 : } else {
16125 0 : highest_ofs = pull->relative_highest_offset;
16126 : }
16127 0 : if (highest_ofs < pull->data_size) {
16128 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16129 : "not all bytes consumed ofs[%u] size[%u]",
16130 : highest_ofs, pull->data_size);
16131 0 : TALLOC_FREE(pull);
16132 0 : PyErr_SetNdrError(err);
16133 0 : return NULL;
16134 : }
16135 : }
16136 :
16137 0 : TALLOC_FREE(pull);
16138 0 : Py_RETURN_NONE;
16139 : }
16140 :
16141 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16142 : {
16143 : DATA_BLOB blob;
16144 0 : Py_ssize_t blob_length = 0;
16145 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16146 0 : PyObject *bigendian_obj = NULL;
16147 0 : PyObject *ndr64_obj = NULL;
16148 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16149 0 : PyObject *allow_remaining_obj = NULL;
16150 0 : bool allow_remaining = false;
16151 :
16152 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16153 : discard_const_p(char *, kwnames),
16154 : &blob.data, &blob_length,
16155 : &bigendian_obj,
16156 : &ndr64_obj,
16157 : &allow_remaining_obj)) {
16158 0 : return NULL;
16159 : }
16160 0 : blob.length = blob_length;
16161 :
16162 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16163 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16164 : }
16165 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16166 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16167 : }
16168 :
16169 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16170 0 : allow_remaining = true;
16171 : }
16172 :
16173 0 : return py_svcctl_GetServiceKeyNameW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16174 : }
16175 :
16176 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16177 : {
16178 : DATA_BLOB blob;
16179 0 : Py_ssize_t blob_length = 0;
16180 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16181 0 : PyObject *bigendian_obj = NULL;
16182 0 : PyObject *ndr64_obj = NULL;
16183 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16184 0 : PyObject *allow_remaining_obj = NULL;
16185 0 : bool allow_remaining = false;
16186 :
16187 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16188 : discard_const_p(char *, kwnames),
16189 : &blob.data, &blob_length,
16190 : &bigendian_obj,
16191 : &ndr64_obj,
16192 : &allow_remaining_obj)) {
16193 0 : return NULL;
16194 : }
16195 0 : blob.length = blob_length;
16196 :
16197 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16198 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16199 : }
16200 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16201 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16202 : }
16203 :
16204 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16205 0 : allow_remaining = true;
16206 : }
16207 :
16208 0 : return py_svcctl_GetServiceKeyNameW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16209 : }
16210 :
16211 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
16212 : {
16213 0 : const struct ndr_interface_call *call = NULL;
16214 0 : struct svcctl_GetServiceKeyNameW *object = (struct svcctl_GetServiceKeyNameW *)pytalloc_get_ptr(py_obj);
16215 : PyObject *ret;
16216 : char *retstr;
16217 :
16218 0 : if (ndr_table_svcctl.num_calls < 22) {
16219 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameW_ndr_print");
16220 0 : return NULL;
16221 : }
16222 0 : call = &ndr_table_svcctl.calls[21];
16223 :
16224 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16225 0 : ret = PyUnicode_FromString(retstr);
16226 0 : TALLOC_FREE(retstr);
16227 :
16228 0 : return ret;
16229 : }
16230 :
16231 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16232 : {
16233 0 : return py_svcctl_GetServiceKeyNameW_ndr_print(py_obj, "svcctl_GetServiceKeyNameW_in", NDR_IN);
16234 : }
16235 :
16236 0 : static PyObject *py_svcctl_GetServiceKeyNameW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16237 : {
16238 0 : return py_svcctl_GetServiceKeyNameW_ndr_print(py_obj, "svcctl_GetServiceKeyNameW_out", NDR_OUT);
16239 : }
16240 :
16241 : static PyMethodDef py_svcctl_GetServiceKeyNameW_methods[] = {
16242 : { "opnum", (PyCFunction)py_svcctl_GetServiceKeyNameW_ndr_opnum, METH_NOARGS|METH_CLASS,
16243 : "svcctl.GetServiceKeyNameW.opnum() -> 21 (0x15) " },
16244 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16245 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16246 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16247 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16248 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16249 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16250 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16251 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16252 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceKeyNameW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16253 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceKeyNameW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16254 : { NULL, NULL, 0, NULL }
16255 : };
16256 :
16257 :
16258 : static PyTypeObject svcctl_GetServiceKeyNameW_Type = {
16259 : PyVarObject_HEAD_INIT(NULL, 0)
16260 : .tp_name = "svcctl.GetServiceKeyNameW",
16261 : .tp_getset = py_svcctl_GetServiceKeyNameW_getsetters,
16262 : .tp_methods = py_svcctl_GetServiceKeyNameW_methods,
16263 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16264 : .tp_new = py_svcctl_GetServiceKeyNameW_new,
16265 : };
16266 :
16267 0 : static bool pack_py_svcctl_GetServiceKeyNameW_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceKeyNameW *r)
16268 : {
16269 : PyObject *py_handle;
16270 : PyObject *py_service_name;
16271 : PyObject *py_display_name_length;
16272 0 : const char *kwnames[] = {
16273 : "handle", "service_name", "display_name_length", NULL
16274 : };
16275 :
16276 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceKeyNameW", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
16277 0 : return false;
16278 : }
16279 :
16280 0 : if (py_handle == NULL) {
16281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
16282 0 : return false;
16283 : }
16284 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
16285 0 : if (r->in.handle == NULL) {
16286 0 : PyErr_NoMemory();
16287 0 : return false;
16288 : }
16289 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
16290 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
16291 0 : PyErr_NoMemory();
16292 0 : return false;
16293 : }
16294 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
16295 0 : if (py_service_name == NULL) {
16296 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
16297 0 : return false;
16298 : }
16299 0 : if (py_service_name == Py_None) {
16300 0 : r->in.service_name = NULL;
16301 : } else {
16302 0 : r->in.service_name = NULL;
16303 : {
16304 : const char *test_str;
16305 : const char *talloc_str;
16306 0 : PyObject *unicode = NULL;
16307 0 : if (PyUnicode_Check(py_service_name)) {
16308 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
16309 0 : if (unicode == NULL) {
16310 0 : PyErr_NoMemory();
16311 0 : return false;
16312 : }
16313 0 : test_str = PyBytes_AS_STRING(unicode);
16314 0 : } else if (PyBytes_Check(py_service_name)) {
16315 0 : test_str = PyBytes_AS_STRING(py_service_name);
16316 : } else {
16317 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
16318 0 : return false;
16319 : }
16320 0 : talloc_str = talloc_strdup(r, test_str);
16321 0 : if (unicode != NULL) {
16322 0 : Py_DECREF(unicode);
16323 : }
16324 0 : if (talloc_str == NULL) {
16325 0 : PyErr_NoMemory();
16326 0 : return false;
16327 : }
16328 0 : r->in.service_name = talloc_str;
16329 : }
16330 : }
16331 0 : if (py_display_name_length == NULL) {
16332 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
16333 0 : return false;
16334 : }
16335 0 : if (py_display_name_length == Py_None) {
16336 0 : r->in.display_name_length = NULL;
16337 : } else {
16338 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
16339 0 : if (r->in.display_name_length == NULL) {
16340 0 : PyErr_NoMemory();
16341 0 : return false;
16342 : }
16343 : {
16344 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
16345 0 : if (PyLong_Check(py_display_name_length)) {
16346 : unsigned long long test_var;
16347 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
16348 0 : if (PyErr_Occurred() != NULL) {
16349 0 : return false;
16350 : }
16351 0 : if (test_var > uint_max) {
16352 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16353 : PyLong_Type.tp_name, uint_max, test_var);
16354 0 : return false;
16355 : }
16356 0 : *r->in.display_name_length = test_var;
16357 : } else {
16358 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16359 : PyLong_Type.tp_name);
16360 0 : return false;
16361 : }
16362 : }
16363 : }
16364 0 : return true;
16365 : }
16366 :
16367 0 : static PyObject *unpack_py_svcctl_GetServiceKeyNameW_args_out(struct svcctl_GetServiceKeyNameW *r)
16368 : {
16369 : PyObject *result;
16370 : PyObject *py_key_name;
16371 : PyObject *py_display_name_length;
16372 0 : result = PyTuple_New(2);
16373 0 : if (*r->out.key_name == NULL) {
16374 0 : py_key_name = Py_None;
16375 0 : Py_INCREF(py_key_name);
16376 : } else {
16377 0 : if (*r->out.key_name == NULL) {
16378 0 : py_key_name = Py_None;
16379 0 : Py_INCREF(py_key_name);
16380 : } else {
16381 0 : py_key_name = PyUnicode_Decode(*r->out.key_name, strlen(*r->out.key_name), "utf-8", "ignore");
16382 : }
16383 : }
16384 0 : PyTuple_SetItem(result, 0, py_key_name);
16385 0 : if (r->out.display_name_length == NULL) {
16386 0 : py_display_name_length = Py_None;
16387 0 : Py_INCREF(py_display_name_length);
16388 : } else {
16389 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
16390 : }
16391 0 : PyTuple_SetItem(result, 1, py_display_name_length);
16392 0 : if (!W_ERROR_IS_OK(r->out.result)) {
16393 0 : PyErr_SetWERROR(r->out.result);
16394 0 : return NULL;
16395 : }
16396 :
16397 0 : return result;
16398 : }
16399 :
16400 :
16401 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_handle(PyObject *obj, void *closure)
16402 : {
16403 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
16404 : PyObject *py_handle;
16405 0 : if (object->in.handle == NULL) {
16406 0 : Py_RETURN_NONE;
16407 : }
16408 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
16409 0 : return py_handle;
16410 : }
16411 :
16412 0 : static int py_svcctl_SCSetServiceBitsA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16413 : {
16414 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16415 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
16416 0 : if (value == NULL) {
16417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
16418 0 : return -1;
16419 : }
16420 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
16421 0 : if (object->in.handle == NULL) {
16422 0 : PyErr_NoMemory();
16423 0 : return -1;
16424 : }
16425 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16426 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16427 0 : PyErr_NoMemory();
16428 0 : return -1;
16429 : }
16430 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16431 0 : return 0;
16432 : }
16433 :
16434 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_bits(PyObject *obj, void *closure)
16435 : {
16436 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
16437 : PyObject *py_bits;
16438 0 : py_bits = PyLong_FromUnsignedLongLong((uint32_t)object->in.bits);
16439 0 : return py_bits;
16440 : }
16441 :
16442 0 : static int py_svcctl_SCSetServiceBitsA_in_set_bits(PyObject *py_obj, PyObject *value, void *closure)
16443 : {
16444 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16445 0 : if (value == NULL) {
16446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bits");
16447 0 : return -1;
16448 : }
16449 : {
16450 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bits));
16451 0 : if (PyLong_Check(value)) {
16452 : unsigned long long test_var;
16453 0 : test_var = PyLong_AsUnsignedLongLong(value);
16454 0 : if (PyErr_Occurred() != NULL) {
16455 0 : return -1;
16456 : }
16457 0 : if (test_var > uint_max) {
16458 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16459 : PyLong_Type.tp_name, uint_max, test_var);
16460 0 : return -1;
16461 : }
16462 0 : object->in.bits = test_var;
16463 : } else {
16464 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16465 : PyLong_Type.tp_name);
16466 0 : return -1;
16467 : }
16468 : }
16469 0 : return 0;
16470 : }
16471 :
16472 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_bitson(PyObject *obj, void *closure)
16473 : {
16474 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
16475 : PyObject *py_bitson;
16476 0 : py_bitson = PyLong_FromUnsignedLongLong((uint32_t)object->in.bitson);
16477 0 : return py_bitson;
16478 : }
16479 :
16480 0 : static int py_svcctl_SCSetServiceBitsA_in_set_bitson(PyObject *py_obj, PyObject *value, void *closure)
16481 : {
16482 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16483 0 : if (value == NULL) {
16484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.bitson");
16485 0 : return -1;
16486 : }
16487 : {
16488 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bitson));
16489 0 : if (PyLong_Check(value)) {
16490 : unsigned long long test_var;
16491 0 : test_var = PyLong_AsUnsignedLongLong(value);
16492 0 : if (PyErr_Occurred() != NULL) {
16493 0 : return -1;
16494 : }
16495 0 : if (test_var > uint_max) {
16496 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16497 : PyLong_Type.tp_name, uint_max, test_var);
16498 0 : return -1;
16499 : }
16500 0 : object->in.bitson = test_var;
16501 : } else {
16502 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16503 : PyLong_Type.tp_name);
16504 0 : return -1;
16505 : }
16506 : }
16507 0 : return 0;
16508 : }
16509 :
16510 0 : static PyObject *py_svcctl_SCSetServiceBitsA_in_get_immediate(PyObject *obj, void *closure)
16511 : {
16512 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
16513 : PyObject *py_immediate;
16514 0 : py_immediate = PyLong_FromUnsignedLongLong((uint32_t)object->in.immediate);
16515 0 : return py_immediate;
16516 : }
16517 :
16518 0 : static int py_svcctl_SCSetServiceBitsA_in_set_immediate(PyObject *py_obj, PyObject *value, void *closure)
16519 : {
16520 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16521 0 : if (value == NULL) {
16522 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.immediate");
16523 0 : return -1;
16524 : }
16525 : {
16526 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.immediate));
16527 0 : if (PyLong_Check(value)) {
16528 : unsigned long long test_var;
16529 0 : test_var = PyLong_AsUnsignedLongLong(value);
16530 0 : if (PyErr_Occurred() != NULL) {
16531 0 : return -1;
16532 : }
16533 0 : if (test_var > uint_max) {
16534 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16535 : PyLong_Type.tp_name, uint_max, test_var);
16536 0 : return -1;
16537 : }
16538 0 : object->in.immediate = test_var;
16539 : } else {
16540 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16541 : PyLong_Type.tp_name);
16542 0 : return -1;
16543 : }
16544 : }
16545 0 : return 0;
16546 : }
16547 :
16548 0 : static PyObject *py_svcctl_SCSetServiceBitsA_get_result(PyObject *obj, void *closure)
16549 : {
16550 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(obj);
16551 : PyObject *py_result;
16552 0 : py_result = PyErr_FromWERROR(object->out.result);
16553 0 : return py_result;
16554 : }
16555 :
16556 0 : static int py_svcctl_SCSetServiceBitsA_set_result(PyObject *py_obj, PyObject *value, void *closure)
16557 : {
16558 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16559 0 : if (value == NULL) {
16560 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16561 0 : return -1;
16562 : }
16563 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
16564 0 : return 0;
16565 : }
16566 :
16567 : static PyGetSetDef py_svcctl_SCSetServiceBitsA_getsetters[] = {
16568 : {
16569 : .name = discard_const_p(char, "in_handle"),
16570 : .get = py_svcctl_SCSetServiceBitsA_in_get_handle,
16571 : .set = py_svcctl_SCSetServiceBitsA_in_set_handle,
16572 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16573 : },
16574 : {
16575 : .name = discard_const_p(char, "in_bits"),
16576 : .get = py_svcctl_SCSetServiceBitsA_in_get_bits,
16577 : .set = py_svcctl_SCSetServiceBitsA_in_set_bits,
16578 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16579 : },
16580 : {
16581 : .name = discard_const_p(char, "in_bitson"),
16582 : .get = py_svcctl_SCSetServiceBitsA_in_get_bitson,
16583 : .set = py_svcctl_SCSetServiceBitsA_in_set_bitson,
16584 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16585 : },
16586 : {
16587 : .name = discard_const_p(char, "in_immediate"),
16588 : .get = py_svcctl_SCSetServiceBitsA_in_get_immediate,
16589 : .set = py_svcctl_SCSetServiceBitsA_in_set_immediate,
16590 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16591 : },
16592 : {
16593 : .name = discard_const_p(char, "result"),
16594 : .get = py_svcctl_SCSetServiceBitsA_get_result,
16595 : .set = py_svcctl_SCSetServiceBitsA_set_result,
16596 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
16597 : },
16598 : { .name = NULL }
16599 : };
16600 :
16601 0 : static PyObject *py_svcctl_SCSetServiceBitsA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16602 : {
16603 0 : PyObject *self = pytalloc_new(struct svcctl_SCSetServiceBitsA, type);
16604 0 : struct svcctl_SCSetServiceBitsA *_self = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(self);
16605 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16606 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
16607 0 : return self;
16608 : }
16609 :
16610 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16611 : {
16612 :
16613 :
16614 0 : return PyLong_FromLong(22);
16615 : }
16616 :
16617 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
16618 : {
16619 0 : const struct ndr_interface_call *call = NULL;
16620 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16621 0 : PyObject *ret = NULL;
16622 0 : struct ndr_push *push = NULL;
16623 : DATA_BLOB blob;
16624 : enum ndr_err_code err;
16625 :
16626 0 : if (ndr_table_svcctl.num_calls < 23) {
16627 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsA_ndr_pack");
16628 0 : return NULL;
16629 : }
16630 0 : call = &ndr_table_svcctl.calls[22];
16631 :
16632 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16633 0 : if (push == NULL) {
16634 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16635 0 : return NULL;
16636 : }
16637 :
16638 0 : push->flags |= ndr_push_flags;
16639 :
16640 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16641 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16642 0 : TALLOC_FREE(push);
16643 0 : PyErr_SetNdrError(err);
16644 0 : return NULL;
16645 : }
16646 0 : blob = ndr_push_blob(push);
16647 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16648 0 : TALLOC_FREE(push);
16649 0 : return ret;
16650 : }
16651 :
16652 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16653 : {
16654 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16655 0 : PyObject *bigendian_obj = NULL;
16656 0 : PyObject *ndr64_obj = NULL;
16657 0 : uint32_t ndr_push_flags = 0;
16658 :
16659 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16660 : discard_const_p(char *, kwnames),
16661 : &bigendian_obj,
16662 : &ndr64_obj)) {
16663 0 : return NULL;
16664 : }
16665 :
16666 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16667 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16668 : }
16669 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16670 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16671 : }
16672 :
16673 0 : return py_svcctl_SCSetServiceBitsA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16674 : }
16675 :
16676 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16677 : {
16678 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16679 0 : PyObject *bigendian_obj = NULL;
16680 0 : PyObject *ndr64_obj = NULL;
16681 0 : uint32_t ndr_push_flags = 0;
16682 :
16683 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16684 : discard_const_p(char *, kwnames),
16685 : &bigendian_obj,
16686 : &ndr64_obj)) {
16687 0 : return NULL;
16688 : }
16689 :
16690 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16691 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16692 : }
16693 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16694 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16695 : }
16696 :
16697 0 : return py_svcctl_SCSetServiceBitsA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16698 : }
16699 :
16700 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
16701 : {
16702 0 : const struct ndr_interface_call *call = NULL;
16703 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16704 0 : struct ndr_pull *pull = NULL;
16705 : enum ndr_err_code err;
16706 :
16707 0 : if (ndr_table_svcctl.num_calls < 23) {
16708 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsA_ndr_unpack");
16709 0 : return NULL;
16710 : }
16711 0 : call = &ndr_table_svcctl.calls[22];
16712 :
16713 0 : pull = ndr_pull_init_blob(blob, object);
16714 0 : if (pull == NULL) {
16715 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16716 0 : return NULL;
16717 : }
16718 :
16719 0 : pull->flags |= ndr_pull_flags;
16720 :
16721 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16722 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16723 0 : TALLOC_FREE(pull);
16724 0 : PyErr_SetNdrError(err);
16725 0 : return NULL;
16726 : }
16727 0 : if (!allow_remaining) {
16728 : uint32_t highest_ofs;
16729 :
16730 0 : if (pull->offset > pull->relative_highest_offset) {
16731 0 : highest_ofs = pull->offset;
16732 : } else {
16733 0 : highest_ofs = pull->relative_highest_offset;
16734 : }
16735 0 : if (highest_ofs < pull->data_size) {
16736 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16737 : "not all bytes consumed ofs[%u] size[%u]",
16738 : highest_ofs, pull->data_size);
16739 0 : TALLOC_FREE(pull);
16740 0 : PyErr_SetNdrError(err);
16741 0 : return NULL;
16742 : }
16743 : }
16744 :
16745 0 : TALLOC_FREE(pull);
16746 0 : Py_RETURN_NONE;
16747 : }
16748 :
16749 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16750 : {
16751 : DATA_BLOB blob;
16752 0 : Py_ssize_t blob_length = 0;
16753 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16754 0 : PyObject *bigendian_obj = NULL;
16755 0 : PyObject *ndr64_obj = NULL;
16756 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16757 0 : PyObject *allow_remaining_obj = NULL;
16758 0 : bool allow_remaining = false;
16759 :
16760 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16761 : discard_const_p(char *, kwnames),
16762 : &blob.data, &blob_length,
16763 : &bigendian_obj,
16764 : &ndr64_obj,
16765 : &allow_remaining_obj)) {
16766 0 : return NULL;
16767 : }
16768 0 : blob.length = blob_length;
16769 :
16770 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16771 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16772 : }
16773 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16774 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16775 : }
16776 :
16777 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16778 0 : allow_remaining = true;
16779 : }
16780 :
16781 0 : return py_svcctl_SCSetServiceBitsA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16782 : }
16783 :
16784 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16785 : {
16786 : DATA_BLOB blob;
16787 0 : Py_ssize_t blob_length = 0;
16788 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16789 0 : PyObject *bigendian_obj = NULL;
16790 0 : PyObject *ndr64_obj = NULL;
16791 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16792 0 : PyObject *allow_remaining_obj = NULL;
16793 0 : bool allow_remaining = false;
16794 :
16795 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16796 : discard_const_p(char *, kwnames),
16797 : &blob.data, &blob_length,
16798 : &bigendian_obj,
16799 : &ndr64_obj,
16800 : &allow_remaining_obj)) {
16801 0 : return NULL;
16802 : }
16803 0 : blob.length = blob_length;
16804 :
16805 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16806 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16807 : }
16808 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16809 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16810 : }
16811 :
16812 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16813 0 : allow_remaining = true;
16814 : }
16815 :
16816 0 : return py_svcctl_SCSetServiceBitsA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16817 : }
16818 :
16819 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
16820 : {
16821 0 : const struct ndr_interface_call *call = NULL;
16822 0 : struct svcctl_SCSetServiceBitsA *object = (struct svcctl_SCSetServiceBitsA *)pytalloc_get_ptr(py_obj);
16823 : PyObject *ret;
16824 : char *retstr;
16825 :
16826 0 : if (ndr_table_svcctl.num_calls < 23) {
16827 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_SCSetServiceBitsA_ndr_print");
16828 0 : return NULL;
16829 : }
16830 0 : call = &ndr_table_svcctl.calls[22];
16831 :
16832 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16833 0 : ret = PyUnicode_FromString(retstr);
16834 0 : TALLOC_FREE(retstr);
16835 :
16836 0 : return ret;
16837 : }
16838 :
16839 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16840 : {
16841 0 : return py_svcctl_SCSetServiceBitsA_ndr_print(py_obj, "svcctl_SCSetServiceBitsA_in", NDR_IN);
16842 : }
16843 :
16844 0 : static PyObject *py_svcctl_SCSetServiceBitsA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16845 : {
16846 0 : return py_svcctl_SCSetServiceBitsA_ndr_print(py_obj, "svcctl_SCSetServiceBitsA_out", NDR_OUT);
16847 : }
16848 :
16849 : static PyMethodDef py_svcctl_SCSetServiceBitsA_methods[] = {
16850 : { "opnum", (PyCFunction)py_svcctl_SCSetServiceBitsA_ndr_opnum, METH_NOARGS|METH_CLASS,
16851 : "svcctl.SCSetServiceBitsA.opnum() -> 22 (0x16) " },
16852 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16853 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16854 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16855 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16856 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16857 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16858 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_SCSetServiceBitsA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16859 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16860 : { "__ndr_print_in__", (PyCFunction)py_svcctl_SCSetServiceBitsA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16861 : { "__ndr_print_out__", (PyCFunction)py_svcctl_SCSetServiceBitsA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16862 : { NULL, NULL, 0, NULL }
16863 : };
16864 :
16865 :
16866 : static PyTypeObject svcctl_SCSetServiceBitsA_Type = {
16867 : PyVarObject_HEAD_INIT(NULL, 0)
16868 : .tp_name = "svcctl.SCSetServiceBitsA",
16869 : .tp_getset = py_svcctl_SCSetServiceBitsA_getsetters,
16870 : .tp_methods = py_svcctl_SCSetServiceBitsA_methods,
16871 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16872 : .tp_new = py_svcctl_SCSetServiceBitsA_new,
16873 : };
16874 :
16875 0 : static bool pack_py_svcctl_SCSetServiceBitsA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_SCSetServiceBitsA *r)
16876 : {
16877 : PyObject *py_handle;
16878 : PyObject *py_bits;
16879 : PyObject *py_bitson;
16880 : PyObject *py_immediate;
16881 0 : const char *kwnames[] = {
16882 : "handle", "bits", "bitson", "immediate", NULL
16883 : };
16884 :
16885 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:svcctl_SCSetServiceBitsA", discard_const_p(char *, kwnames), &py_handle, &py_bits, &py_bitson, &py_immediate)) {
16886 0 : return false;
16887 : }
16888 :
16889 0 : if (py_handle == NULL) {
16890 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
16891 0 : return false;
16892 : }
16893 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
16894 0 : if (r->in.handle == NULL) {
16895 0 : PyErr_NoMemory();
16896 0 : return false;
16897 : }
16898 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
16899 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
16900 0 : PyErr_NoMemory();
16901 0 : return false;
16902 : }
16903 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
16904 0 : if (py_bits == NULL) {
16905 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bits");
16906 0 : return false;
16907 : }
16908 : {
16909 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bits));
16910 0 : if (PyLong_Check(py_bits)) {
16911 : unsigned long long test_var;
16912 0 : test_var = PyLong_AsUnsignedLongLong(py_bits);
16913 0 : if (PyErr_Occurred() != NULL) {
16914 0 : return false;
16915 : }
16916 0 : if (test_var > uint_max) {
16917 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16918 : PyLong_Type.tp_name, uint_max, test_var);
16919 0 : return false;
16920 : }
16921 0 : r->in.bits = test_var;
16922 : } else {
16923 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16924 : PyLong_Type.tp_name);
16925 0 : return false;
16926 : }
16927 : }
16928 0 : if (py_bitson == NULL) {
16929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.bitson");
16930 0 : return false;
16931 : }
16932 : {
16933 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.bitson));
16934 0 : if (PyLong_Check(py_bitson)) {
16935 : unsigned long long test_var;
16936 0 : test_var = PyLong_AsUnsignedLongLong(py_bitson);
16937 0 : if (PyErr_Occurred() != NULL) {
16938 0 : return false;
16939 : }
16940 0 : if (test_var > uint_max) {
16941 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16942 : PyLong_Type.tp_name, uint_max, test_var);
16943 0 : return false;
16944 : }
16945 0 : r->in.bitson = test_var;
16946 : } else {
16947 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16948 : PyLong_Type.tp_name);
16949 0 : return false;
16950 : }
16951 : }
16952 0 : if (py_immediate == NULL) {
16953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.immediate");
16954 0 : return false;
16955 : }
16956 : {
16957 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.immediate));
16958 0 : if (PyLong_Check(py_immediate)) {
16959 : unsigned long long test_var;
16960 0 : test_var = PyLong_AsUnsignedLongLong(py_immediate);
16961 0 : if (PyErr_Occurred() != NULL) {
16962 0 : return false;
16963 : }
16964 0 : if (test_var > uint_max) {
16965 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16966 : PyLong_Type.tp_name, uint_max, test_var);
16967 0 : return false;
16968 : }
16969 0 : r->in.immediate = test_var;
16970 : } else {
16971 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16972 : PyLong_Type.tp_name);
16973 0 : return false;
16974 : }
16975 : }
16976 0 : return true;
16977 : }
16978 :
16979 0 : static PyObject *unpack_py_svcctl_SCSetServiceBitsA_args_out(struct svcctl_SCSetServiceBitsA *r)
16980 : {
16981 : PyObject *result;
16982 0 : result = Py_None;
16983 0 : Py_INCREF(result);
16984 0 : if (!W_ERROR_IS_OK(r->out.result)) {
16985 0 : PyErr_SetWERROR(r->out.result);
16986 0 : return NULL;
16987 : }
16988 :
16989 0 : return result;
16990 : }
16991 :
16992 :
16993 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_handle(PyObject *obj, void *closure)
16994 : {
16995 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
16996 : PyObject *py_handle;
16997 0 : if (object->in.handle == NULL) {
16998 0 : Py_RETURN_NONE;
16999 : }
17000 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
17001 0 : return py_handle;
17002 : }
17003 :
17004 0 : static int py_svcctl_ChangeServiceConfigA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
17005 : {
17006 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17007 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
17008 0 : if (value == NULL) {
17009 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
17010 0 : return -1;
17011 : }
17012 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
17013 0 : if (object->in.handle == NULL) {
17014 0 : PyErr_NoMemory();
17015 0 : return -1;
17016 : }
17017 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17018 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17019 0 : PyErr_NoMemory();
17020 0 : return -1;
17021 : }
17022 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
17023 0 : return 0;
17024 : }
17025 :
17026 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_type(PyObject *obj, void *closure)
17027 : {
17028 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17029 : PyObject *py_type;
17030 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
17031 0 : return py_type;
17032 : }
17033 :
17034 0 : static int py_svcctl_ChangeServiceConfigA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
17035 : {
17036 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17037 0 : if (value == NULL) {
17038 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
17039 0 : return -1;
17040 : }
17041 : {
17042 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
17043 0 : if (PyLong_Check(value)) {
17044 : unsigned long long test_var;
17045 0 : test_var = PyLong_AsUnsignedLongLong(value);
17046 0 : if (PyErr_Occurred() != NULL) {
17047 0 : return -1;
17048 : }
17049 0 : if (test_var > uint_max) {
17050 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17051 : PyLong_Type.tp_name, uint_max, test_var);
17052 0 : return -1;
17053 : }
17054 0 : object->in.type = test_var;
17055 : } else {
17056 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17057 : PyLong_Type.tp_name);
17058 0 : return -1;
17059 : }
17060 : }
17061 0 : return 0;
17062 : }
17063 :
17064 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_start_type(PyObject *obj, void *closure)
17065 : {
17066 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17067 : PyObject *py_start_type;
17068 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
17069 0 : return py_start_type;
17070 : }
17071 :
17072 0 : static int py_svcctl_ChangeServiceConfigA_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
17073 : {
17074 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17075 0 : if (value == NULL) {
17076 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
17077 0 : return -1;
17078 : }
17079 : {
17080 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
17081 0 : if (PyLong_Check(value)) {
17082 : unsigned long long test_var;
17083 0 : test_var = PyLong_AsUnsignedLongLong(value);
17084 0 : if (PyErr_Occurred() != NULL) {
17085 0 : return -1;
17086 : }
17087 0 : if (test_var > uint_max) {
17088 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17089 : PyLong_Type.tp_name, uint_max, test_var);
17090 0 : return -1;
17091 : }
17092 0 : object->in.start_type = test_var;
17093 : } else {
17094 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17095 : PyLong_Type.tp_name);
17096 0 : return -1;
17097 : }
17098 : }
17099 0 : return 0;
17100 : }
17101 :
17102 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_error_control(PyObject *obj, void *closure)
17103 : {
17104 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17105 : PyObject *py_error_control;
17106 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
17107 0 : return py_error_control;
17108 : }
17109 :
17110 0 : static int py_svcctl_ChangeServiceConfigA_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
17111 : {
17112 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17113 0 : if (value == NULL) {
17114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
17115 0 : return -1;
17116 : }
17117 : {
17118 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
17119 0 : if (PyLong_Check(value)) {
17120 : unsigned long long test_var;
17121 0 : test_var = PyLong_AsUnsignedLongLong(value);
17122 0 : if (PyErr_Occurred() != NULL) {
17123 0 : return -1;
17124 : }
17125 0 : if (test_var > uint_max) {
17126 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17127 : PyLong_Type.tp_name, uint_max, test_var);
17128 0 : return -1;
17129 : }
17130 0 : object->in.error_control = test_var;
17131 : } else {
17132 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17133 : PyLong_Type.tp_name);
17134 0 : return -1;
17135 : }
17136 : }
17137 0 : return 0;
17138 : }
17139 :
17140 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_binary_path(PyObject *obj, void *closure)
17141 : {
17142 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17143 : PyObject *py_binary_path;
17144 0 : if (object->in.binary_path == NULL) {
17145 0 : Py_RETURN_NONE;
17146 : }
17147 0 : if (object->in.binary_path == NULL) {
17148 0 : py_binary_path = Py_None;
17149 0 : Py_INCREF(py_binary_path);
17150 : } else {
17151 0 : if (object->in.binary_path == NULL) {
17152 0 : py_binary_path = Py_None;
17153 0 : Py_INCREF(py_binary_path);
17154 : } else {
17155 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
17156 : }
17157 : }
17158 0 : return py_binary_path;
17159 : }
17160 :
17161 0 : static int py_svcctl_ChangeServiceConfigA_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
17162 : {
17163 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17164 0 : if (value == NULL) {
17165 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
17166 0 : return -1;
17167 : }
17168 0 : if (value == Py_None) {
17169 0 : object->in.binary_path = NULL;
17170 : } else {
17171 0 : object->in.binary_path = NULL;
17172 : {
17173 : const char *test_str;
17174 : const char *talloc_str;
17175 0 : PyObject *unicode = NULL;
17176 0 : if (PyUnicode_Check(value)) {
17177 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17178 0 : if (unicode == NULL) {
17179 0 : PyErr_NoMemory();
17180 0 : return -1;
17181 : }
17182 0 : test_str = PyBytes_AS_STRING(unicode);
17183 0 : } else if (PyBytes_Check(value)) {
17184 0 : test_str = PyBytes_AS_STRING(value);
17185 : } else {
17186 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17187 0 : return -1;
17188 : }
17189 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17190 0 : if (unicode != NULL) {
17191 0 : Py_DECREF(unicode);
17192 : }
17193 0 : if (talloc_str == NULL) {
17194 0 : PyErr_NoMemory();
17195 0 : return -1;
17196 : }
17197 0 : object->in.binary_path = talloc_str;
17198 : }
17199 : }
17200 0 : return 0;
17201 : }
17202 :
17203 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_load_order_group(PyObject *obj, void *closure)
17204 : {
17205 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17206 : PyObject *py_load_order_group;
17207 0 : if (object->in.load_order_group == NULL) {
17208 0 : Py_RETURN_NONE;
17209 : }
17210 0 : if (object->in.load_order_group == NULL) {
17211 0 : py_load_order_group = Py_None;
17212 0 : Py_INCREF(py_load_order_group);
17213 : } else {
17214 0 : if (object->in.load_order_group == NULL) {
17215 0 : py_load_order_group = Py_None;
17216 0 : Py_INCREF(py_load_order_group);
17217 : } else {
17218 0 : py_load_order_group = PyUnicode_Decode(object->in.load_order_group, strlen(object->in.load_order_group), "utf-8", "ignore");
17219 : }
17220 : }
17221 0 : return py_load_order_group;
17222 : }
17223 :
17224 0 : static int py_svcctl_ChangeServiceConfigA_in_set_load_order_group(PyObject *py_obj, PyObject *value, void *closure)
17225 : {
17226 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17227 0 : if (value == NULL) {
17228 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.load_order_group");
17229 0 : return -1;
17230 : }
17231 0 : if (value == Py_None) {
17232 0 : object->in.load_order_group = NULL;
17233 : } else {
17234 0 : object->in.load_order_group = NULL;
17235 : {
17236 : const char *test_str;
17237 : const char *talloc_str;
17238 0 : PyObject *unicode = NULL;
17239 0 : if (PyUnicode_Check(value)) {
17240 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17241 0 : if (unicode == NULL) {
17242 0 : PyErr_NoMemory();
17243 0 : return -1;
17244 : }
17245 0 : test_str = PyBytes_AS_STRING(unicode);
17246 0 : } else if (PyBytes_Check(value)) {
17247 0 : test_str = PyBytes_AS_STRING(value);
17248 : } else {
17249 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17250 0 : return -1;
17251 : }
17252 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17253 0 : if (unicode != NULL) {
17254 0 : Py_DECREF(unicode);
17255 : }
17256 0 : if (talloc_str == NULL) {
17257 0 : PyErr_NoMemory();
17258 0 : return -1;
17259 : }
17260 0 : object->in.load_order_group = talloc_str;
17261 : }
17262 : }
17263 0 : return 0;
17264 : }
17265 :
17266 0 : static PyObject *py_svcctl_ChangeServiceConfigA_out_get_tag_id(PyObject *obj, void *closure)
17267 : {
17268 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17269 : PyObject *py_tag_id;
17270 0 : if (object->out.tag_id == NULL) {
17271 0 : Py_RETURN_NONE;
17272 : }
17273 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*object->out.tag_id);
17274 0 : return py_tag_id;
17275 : }
17276 :
17277 0 : static int py_svcctl_ChangeServiceConfigA_out_set_tag_id(PyObject *py_obj, PyObject *value, void *closure)
17278 : {
17279 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17280 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.tag_id));
17281 0 : if (value == NULL) {
17282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.tag_id");
17283 0 : return -1;
17284 : }
17285 0 : object->out.tag_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.tag_id);
17286 0 : if (object->out.tag_id == NULL) {
17287 0 : PyErr_NoMemory();
17288 0 : return -1;
17289 : }
17290 : {
17291 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.tag_id));
17292 0 : if (PyLong_Check(value)) {
17293 : unsigned long long test_var;
17294 0 : test_var = PyLong_AsUnsignedLongLong(value);
17295 0 : if (PyErr_Occurred() != NULL) {
17296 0 : return -1;
17297 : }
17298 0 : if (test_var > uint_max) {
17299 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17300 : PyLong_Type.tp_name, uint_max, test_var);
17301 0 : return -1;
17302 : }
17303 0 : *object->out.tag_id = test_var;
17304 : } else {
17305 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17306 : PyLong_Type.tp_name);
17307 0 : return -1;
17308 : }
17309 : }
17310 0 : return 0;
17311 : }
17312 :
17313 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_dependencies(PyObject *obj, void *closure)
17314 : {
17315 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17316 : PyObject *py_dependencies;
17317 0 : if (object->in.dependencies == NULL) {
17318 0 : Py_RETURN_NONE;
17319 : }
17320 0 : if (object->in.dependencies == NULL) {
17321 0 : py_dependencies = Py_None;
17322 0 : Py_INCREF(py_dependencies);
17323 : } else {
17324 0 : if (object->in.dependencies == NULL) {
17325 0 : py_dependencies = Py_None;
17326 0 : Py_INCREF(py_dependencies);
17327 : } else {
17328 0 : py_dependencies = PyUnicode_Decode(object->in.dependencies, strlen(object->in.dependencies), "utf-8", "ignore");
17329 : }
17330 : }
17331 0 : return py_dependencies;
17332 : }
17333 :
17334 0 : static int py_svcctl_ChangeServiceConfigA_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
17335 : {
17336 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17337 0 : if (value == NULL) {
17338 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
17339 0 : return -1;
17340 : }
17341 0 : if (value == Py_None) {
17342 0 : object->in.dependencies = NULL;
17343 : } else {
17344 0 : object->in.dependencies = NULL;
17345 : {
17346 : const char *test_str;
17347 : const char *talloc_str;
17348 0 : PyObject *unicode = NULL;
17349 0 : if (PyUnicode_Check(value)) {
17350 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17351 0 : if (unicode == NULL) {
17352 0 : PyErr_NoMemory();
17353 0 : return -1;
17354 : }
17355 0 : test_str = PyBytes_AS_STRING(unicode);
17356 0 : } else if (PyBytes_Check(value)) {
17357 0 : test_str = PyBytes_AS_STRING(value);
17358 : } else {
17359 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17360 0 : return -1;
17361 : }
17362 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17363 0 : if (unicode != NULL) {
17364 0 : Py_DECREF(unicode);
17365 : }
17366 0 : if (talloc_str == NULL) {
17367 0 : PyErr_NoMemory();
17368 0 : return -1;
17369 : }
17370 0 : object->in.dependencies = talloc_str;
17371 : }
17372 : }
17373 0 : return 0;
17374 : }
17375 :
17376 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_service_start_name(PyObject *obj, void *closure)
17377 : {
17378 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17379 : PyObject *py_service_start_name;
17380 0 : if (object->in.service_start_name == NULL) {
17381 0 : Py_RETURN_NONE;
17382 : }
17383 0 : if (object->in.service_start_name == NULL) {
17384 0 : py_service_start_name = Py_None;
17385 0 : Py_INCREF(py_service_start_name);
17386 : } else {
17387 0 : if (object->in.service_start_name == NULL) {
17388 0 : py_service_start_name = Py_None;
17389 0 : Py_INCREF(py_service_start_name);
17390 : } else {
17391 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
17392 : }
17393 : }
17394 0 : return py_service_start_name;
17395 : }
17396 :
17397 0 : static int py_svcctl_ChangeServiceConfigA_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
17398 : {
17399 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17400 0 : if (value == NULL) {
17401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
17402 0 : return -1;
17403 : }
17404 0 : if (value == Py_None) {
17405 0 : object->in.service_start_name = NULL;
17406 : } else {
17407 0 : object->in.service_start_name = NULL;
17408 : {
17409 : const char *test_str;
17410 : const char *talloc_str;
17411 0 : PyObject *unicode = NULL;
17412 0 : if (PyUnicode_Check(value)) {
17413 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17414 0 : if (unicode == NULL) {
17415 0 : PyErr_NoMemory();
17416 0 : return -1;
17417 : }
17418 0 : test_str = PyBytes_AS_STRING(unicode);
17419 0 : } else if (PyBytes_Check(value)) {
17420 0 : test_str = PyBytes_AS_STRING(value);
17421 : } else {
17422 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17423 0 : return -1;
17424 : }
17425 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17426 0 : if (unicode != NULL) {
17427 0 : Py_DECREF(unicode);
17428 : }
17429 0 : if (talloc_str == NULL) {
17430 0 : PyErr_NoMemory();
17431 0 : return -1;
17432 : }
17433 0 : object->in.service_start_name = talloc_str;
17434 : }
17435 : }
17436 0 : return 0;
17437 : }
17438 :
17439 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_password(PyObject *obj, void *closure)
17440 : {
17441 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17442 : PyObject *py_password;
17443 0 : if (object->in.password == NULL) {
17444 0 : Py_RETURN_NONE;
17445 : }
17446 0 : if (object->in.password == NULL) {
17447 0 : py_password = Py_None;
17448 0 : Py_INCREF(py_password);
17449 : } else {
17450 0 : if (object->in.password == NULL) {
17451 0 : py_password = Py_None;
17452 0 : Py_INCREF(py_password);
17453 : } else {
17454 0 : py_password = PyUnicode_Decode(object->in.password, strlen(object->in.password), "utf-8", "ignore");
17455 : }
17456 : }
17457 0 : return py_password;
17458 : }
17459 :
17460 0 : static int py_svcctl_ChangeServiceConfigA_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
17461 : {
17462 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17463 0 : if (value == NULL) {
17464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
17465 0 : return -1;
17466 : }
17467 0 : if (value == Py_None) {
17468 0 : object->in.password = NULL;
17469 : } else {
17470 0 : object->in.password = NULL;
17471 : {
17472 : const char *test_str;
17473 : const char *talloc_str;
17474 0 : PyObject *unicode = NULL;
17475 0 : if (PyUnicode_Check(value)) {
17476 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17477 0 : if (unicode == NULL) {
17478 0 : PyErr_NoMemory();
17479 0 : return -1;
17480 : }
17481 0 : test_str = PyBytes_AS_STRING(unicode);
17482 0 : } else if (PyBytes_Check(value)) {
17483 0 : test_str = PyBytes_AS_STRING(value);
17484 : } else {
17485 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17486 0 : return -1;
17487 : }
17488 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17489 0 : if (unicode != NULL) {
17490 0 : Py_DECREF(unicode);
17491 : }
17492 0 : if (talloc_str == NULL) {
17493 0 : PyErr_NoMemory();
17494 0 : return -1;
17495 : }
17496 0 : object->in.password = talloc_str;
17497 : }
17498 : }
17499 0 : return 0;
17500 : }
17501 :
17502 0 : static PyObject *py_svcctl_ChangeServiceConfigA_in_get_display_name(PyObject *obj, void *closure)
17503 : {
17504 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17505 : PyObject *py_display_name;
17506 0 : if (object->in.display_name == NULL) {
17507 0 : Py_RETURN_NONE;
17508 : }
17509 0 : if (object->in.display_name == NULL) {
17510 0 : py_display_name = Py_None;
17511 0 : Py_INCREF(py_display_name);
17512 : } else {
17513 0 : if (object->in.display_name == NULL) {
17514 0 : py_display_name = Py_None;
17515 0 : Py_INCREF(py_display_name);
17516 : } else {
17517 0 : py_display_name = PyUnicode_Decode(object->in.display_name, strlen(object->in.display_name), "utf-8", "ignore");
17518 : }
17519 : }
17520 0 : return py_display_name;
17521 : }
17522 :
17523 0 : static int py_svcctl_ChangeServiceConfigA_in_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
17524 : {
17525 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17526 0 : if (value == NULL) {
17527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name");
17528 0 : return -1;
17529 : }
17530 0 : if (value == Py_None) {
17531 0 : object->in.display_name = NULL;
17532 : } else {
17533 0 : object->in.display_name = NULL;
17534 : {
17535 : const char *test_str;
17536 : const char *talloc_str;
17537 0 : PyObject *unicode = NULL;
17538 0 : if (PyUnicode_Check(value)) {
17539 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17540 0 : if (unicode == NULL) {
17541 0 : PyErr_NoMemory();
17542 0 : return -1;
17543 : }
17544 0 : test_str = PyBytes_AS_STRING(unicode);
17545 0 : } else if (PyBytes_Check(value)) {
17546 0 : test_str = PyBytes_AS_STRING(value);
17547 : } else {
17548 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17549 0 : return -1;
17550 : }
17551 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17552 0 : if (unicode != NULL) {
17553 0 : Py_DECREF(unicode);
17554 : }
17555 0 : if (talloc_str == NULL) {
17556 0 : PyErr_NoMemory();
17557 0 : return -1;
17558 : }
17559 0 : object->in.display_name = talloc_str;
17560 : }
17561 : }
17562 0 : return 0;
17563 : }
17564 :
17565 0 : static PyObject *py_svcctl_ChangeServiceConfigA_get_result(PyObject *obj, void *closure)
17566 : {
17567 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(obj);
17568 : PyObject *py_result;
17569 0 : py_result = PyErr_FromWERROR(object->out.result);
17570 0 : return py_result;
17571 : }
17572 :
17573 0 : static int py_svcctl_ChangeServiceConfigA_set_result(PyObject *py_obj, PyObject *value, void *closure)
17574 : {
17575 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17576 0 : if (value == NULL) {
17577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17578 0 : return -1;
17579 : }
17580 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
17581 0 : return 0;
17582 : }
17583 :
17584 : static PyGetSetDef py_svcctl_ChangeServiceConfigA_getsetters[] = {
17585 : {
17586 : .name = discard_const_p(char, "in_handle"),
17587 : .get = py_svcctl_ChangeServiceConfigA_in_get_handle,
17588 : .set = py_svcctl_ChangeServiceConfigA_in_set_handle,
17589 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17590 : },
17591 : {
17592 : .name = discard_const_p(char, "in_type"),
17593 : .get = py_svcctl_ChangeServiceConfigA_in_get_type,
17594 : .set = py_svcctl_ChangeServiceConfigA_in_set_type,
17595 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17596 : },
17597 : {
17598 : .name = discard_const_p(char, "in_start_type"),
17599 : .get = py_svcctl_ChangeServiceConfigA_in_get_start_type,
17600 : .set = py_svcctl_ChangeServiceConfigA_in_set_start_type,
17601 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
17602 : },
17603 : {
17604 : .name = discard_const_p(char, "in_error_control"),
17605 : .get = py_svcctl_ChangeServiceConfigA_in_get_error_control,
17606 : .set = py_svcctl_ChangeServiceConfigA_in_set_error_control,
17607 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
17608 : },
17609 : {
17610 : .name = discard_const_p(char, "in_binary_path"),
17611 : .get = py_svcctl_ChangeServiceConfigA_in_get_binary_path,
17612 : .set = py_svcctl_ChangeServiceConfigA_in_set_binary_path,
17613 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17614 : },
17615 : {
17616 : .name = discard_const_p(char, "in_load_order_group"),
17617 : .get = py_svcctl_ChangeServiceConfigA_in_get_load_order_group,
17618 : .set = py_svcctl_ChangeServiceConfigA_in_set_load_order_group,
17619 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17620 : },
17621 : {
17622 : .name = discard_const_p(char, "out_tag_id"),
17623 : .get = py_svcctl_ChangeServiceConfigA_out_get_tag_id,
17624 : .set = py_svcctl_ChangeServiceConfigA_out_set_tag_id,
17625 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17626 : },
17627 : {
17628 : .name = discard_const_p(char, "in_dependencies"),
17629 : .get = py_svcctl_ChangeServiceConfigA_in_get_dependencies,
17630 : .set = py_svcctl_ChangeServiceConfigA_in_set_dependencies,
17631 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17632 : },
17633 : {
17634 : .name = discard_const_p(char, "in_service_start_name"),
17635 : .get = py_svcctl_ChangeServiceConfigA_in_get_service_start_name,
17636 : .set = py_svcctl_ChangeServiceConfigA_in_set_service_start_name,
17637 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17638 : },
17639 : {
17640 : .name = discard_const_p(char, "in_password"),
17641 : .get = py_svcctl_ChangeServiceConfigA_in_get_password,
17642 : .set = py_svcctl_ChangeServiceConfigA_in_set_password,
17643 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17644 : },
17645 : {
17646 : .name = discard_const_p(char, "in_display_name"),
17647 : .get = py_svcctl_ChangeServiceConfigA_in_get_display_name,
17648 : .set = py_svcctl_ChangeServiceConfigA_in_set_display_name,
17649 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17650 : },
17651 : {
17652 : .name = discard_const_p(char, "result"),
17653 : .get = py_svcctl_ChangeServiceConfigA_get_result,
17654 : .set = py_svcctl_ChangeServiceConfigA_set_result,
17655 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
17656 : },
17657 : { .name = NULL }
17658 : };
17659 :
17660 0 : static PyObject *py_svcctl_ChangeServiceConfigA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17661 : {
17662 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfigA, type);
17663 0 : struct svcctl_ChangeServiceConfigA *_self = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(self);
17664 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17665 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
17666 0 : _self->out.tag_id = talloc_zero(mem_ctx, uint32_t);
17667 0 : return self;
17668 : }
17669 :
17670 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17671 : {
17672 :
17673 :
17674 0 : return PyLong_FromLong(23);
17675 : }
17676 :
17677 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
17678 : {
17679 0 : const struct ndr_interface_call *call = NULL;
17680 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17681 0 : PyObject *ret = NULL;
17682 0 : struct ndr_push *push = NULL;
17683 : DATA_BLOB blob;
17684 : enum ndr_err_code err;
17685 :
17686 0 : if (ndr_table_svcctl.num_calls < 24) {
17687 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigA_ndr_pack");
17688 0 : return NULL;
17689 : }
17690 0 : call = &ndr_table_svcctl.calls[23];
17691 :
17692 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17693 0 : if (push == NULL) {
17694 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17695 0 : return NULL;
17696 : }
17697 :
17698 0 : push->flags |= ndr_push_flags;
17699 :
17700 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17701 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17702 0 : TALLOC_FREE(push);
17703 0 : PyErr_SetNdrError(err);
17704 0 : return NULL;
17705 : }
17706 0 : blob = ndr_push_blob(push);
17707 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17708 0 : TALLOC_FREE(push);
17709 0 : return ret;
17710 : }
17711 :
17712 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17713 : {
17714 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17715 0 : PyObject *bigendian_obj = NULL;
17716 0 : PyObject *ndr64_obj = NULL;
17717 0 : uint32_t ndr_push_flags = 0;
17718 :
17719 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17720 : discard_const_p(char *, kwnames),
17721 : &bigendian_obj,
17722 : &ndr64_obj)) {
17723 0 : return NULL;
17724 : }
17725 :
17726 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17727 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17728 : }
17729 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17730 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17731 : }
17732 :
17733 0 : return py_svcctl_ChangeServiceConfigA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17734 : }
17735 :
17736 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17737 : {
17738 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17739 0 : PyObject *bigendian_obj = NULL;
17740 0 : PyObject *ndr64_obj = NULL;
17741 0 : uint32_t ndr_push_flags = 0;
17742 :
17743 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17744 : discard_const_p(char *, kwnames),
17745 : &bigendian_obj,
17746 : &ndr64_obj)) {
17747 0 : return NULL;
17748 : }
17749 :
17750 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17751 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17752 : }
17753 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17754 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17755 : }
17756 :
17757 0 : return py_svcctl_ChangeServiceConfigA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17758 : }
17759 :
17760 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
17761 : {
17762 0 : const struct ndr_interface_call *call = NULL;
17763 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17764 0 : struct ndr_pull *pull = NULL;
17765 : enum ndr_err_code err;
17766 :
17767 0 : if (ndr_table_svcctl.num_calls < 24) {
17768 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigA_ndr_unpack");
17769 0 : return NULL;
17770 : }
17771 0 : call = &ndr_table_svcctl.calls[23];
17772 :
17773 0 : pull = ndr_pull_init_blob(blob, object);
17774 0 : if (pull == NULL) {
17775 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17776 0 : return NULL;
17777 : }
17778 :
17779 0 : pull->flags |= ndr_pull_flags;
17780 :
17781 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17782 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17783 0 : TALLOC_FREE(pull);
17784 0 : PyErr_SetNdrError(err);
17785 0 : return NULL;
17786 : }
17787 0 : if (!allow_remaining) {
17788 : uint32_t highest_ofs;
17789 :
17790 0 : if (pull->offset > pull->relative_highest_offset) {
17791 0 : highest_ofs = pull->offset;
17792 : } else {
17793 0 : highest_ofs = pull->relative_highest_offset;
17794 : }
17795 0 : if (highest_ofs < pull->data_size) {
17796 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17797 : "not all bytes consumed ofs[%u] size[%u]",
17798 : highest_ofs, pull->data_size);
17799 0 : TALLOC_FREE(pull);
17800 0 : PyErr_SetNdrError(err);
17801 0 : return NULL;
17802 : }
17803 : }
17804 :
17805 0 : TALLOC_FREE(pull);
17806 0 : Py_RETURN_NONE;
17807 : }
17808 :
17809 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17810 : {
17811 : DATA_BLOB blob;
17812 0 : Py_ssize_t blob_length = 0;
17813 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17814 0 : PyObject *bigendian_obj = NULL;
17815 0 : PyObject *ndr64_obj = NULL;
17816 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17817 0 : PyObject *allow_remaining_obj = NULL;
17818 0 : bool allow_remaining = false;
17819 :
17820 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17821 : discard_const_p(char *, kwnames),
17822 : &blob.data, &blob_length,
17823 : &bigendian_obj,
17824 : &ndr64_obj,
17825 : &allow_remaining_obj)) {
17826 0 : return NULL;
17827 : }
17828 0 : blob.length = blob_length;
17829 :
17830 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17831 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17832 : }
17833 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17834 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17835 : }
17836 :
17837 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17838 0 : allow_remaining = true;
17839 : }
17840 :
17841 0 : return py_svcctl_ChangeServiceConfigA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17842 : }
17843 :
17844 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17845 : {
17846 : DATA_BLOB blob;
17847 0 : Py_ssize_t blob_length = 0;
17848 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17849 0 : PyObject *bigendian_obj = NULL;
17850 0 : PyObject *ndr64_obj = NULL;
17851 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17852 0 : PyObject *allow_remaining_obj = NULL;
17853 0 : bool allow_remaining = false;
17854 :
17855 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17856 : discard_const_p(char *, kwnames),
17857 : &blob.data, &blob_length,
17858 : &bigendian_obj,
17859 : &ndr64_obj,
17860 : &allow_remaining_obj)) {
17861 0 : return NULL;
17862 : }
17863 0 : blob.length = blob_length;
17864 :
17865 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17866 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17867 : }
17868 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17869 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17870 : }
17871 :
17872 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17873 0 : allow_remaining = true;
17874 : }
17875 :
17876 0 : return py_svcctl_ChangeServiceConfigA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17877 : }
17878 :
17879 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
17880 : {
17881 0 : const struct ndr_interface_call *call = NULL;
17882 0 : struct svcctl_ChangeServiceConfigA *object = (struct svcctl_ChangeServiceConfigA *)pytalloc_get_ptr(py_obj);
17883 : PyObject *ret;
17884 : char *retstr;
17885 :
17886 0 : if (ndr_table_svcctl.num_calls < 24) {
17887 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfigA_ndr_print");
17888 0 : return NULL;
17889 : }
17890 0 : call = &ndr_table_svcctl.calls[23];
17891 :
17892 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17893 0 : ret = PyUnicode_FromString(retstr);
17894 0 : TALLOC_FREE(retstr);
17895 :
17896 0 : return ret;
17897 : }
17898 :
17899 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17900 : {
17901 0 : return py_svcctl_ChangeServiceConfigA_ndr_print(py_obj, "svcctl_ChangeServiceConfigA_in", NDR_IN);
17902 : }
17903 :
17904 0 : static PyObject *py_svcctl_ChangeServiceConfigA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17905 : {
17906 0 : return py_svcctl_ChangeServiceConfigA_ndr_print(py_obj, "svcctl_ChangeServiceConfigA_out", NDR_OUT);
17907 : }
17908 :
17909 : static PyMethodDef py_svcctl_ChangeServiceConfigA_methods[] = {
17910 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfigA_ndr_opnum, METH_NOARGS|METH_CLASS,
17911 : "svcctl.ChangeServiceConfigA.opnum() -> 23 (0x17) " },
17912 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17913 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17914 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17915 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17916 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17917 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17918 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfigA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17919 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17920 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfigA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17921 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfigA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17922 : { NULL, NULL, 0, NULL }
17923 : };
17924 :
17925 :
17926 : static PyTypeObject svcctl_ChangeServiceConfigA_Type = {
17927 : PyVarObject_HEAD_INIT(NULL, 0)
17928 : .tp_name = "svcctl.ChangeServiceConfigA",
17929 : .tp_getset = py_svcctl_ChangeServiceConfigA_getsetters,
17930 : .tp_methods = py_svcctl_ChangeServiceConfigA_methods,
17931 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17932 : .tp_new = py_svcctl_ChangeServiceConfigA_new,
17933 : };
17934 :
17935 0 : static bool pack_py_svcctl_ChangeServiceConfigA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfigA *r)
17936 : {
17937 : PyObject *py_handle;
17938 : PyObject *py_type;
17939 : PyObject *py_start_type;
17940 : PyObject *py_error_control;
17941 : PyObject *py_binary_path;
17942 : PyObject *py_load_order_group;
17943 : PyObject *py_dependencies;
17944 : PyObject *py_service_start_name;
17945 : PyObject *py_password;
17946 : PyObject *py_display_name;
17947 0 : const char *kwnames[] = {
17948 : "handle", "type", "start_type", "error_control", "binary_path", "load_order_group", "dependencies", "service_start_name", "password", "display_name", NULL
17949 : };
17950 :
17951 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)) {
17952 0 : return false;
17953 : }
17954 :
17955 0 : if (py_handle == NULL) {
17956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
17957 0 : return false;
17958 : }
17959 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
17960 0 : if (r->in.handle == NULL) {
17961 0 : PyErr_NoMemory();
17962 0 : return false;
17963 : }
17964 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
17965 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
17966 0 : PyErr_NoMemory();
17967 0 : return false;
17968 : }
17969 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
17970 0 : if (py_type == NULL) {
17971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
17972 0 : return false;
17973 : }
17974 : {
17975 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
17976 0 : if (PyLong_Check(py_type)) {
17977 : unsigned long long test_var;
17978 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
17979 0 : if (PyErr_Occurred() != NULL) {
17980 0 : return false;
17981 : }
17982 0 : if (test_var > uint_max) {
17983 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17984 : PyLong_Type.tp_name, uint_max, test_var);
17985 0 : return false;
17986 : }
17987 0 : r->in.type = test_var;
17988 : } else {
17989 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17990 : PyLong_Type.tp_name);
17991 0 : return false;
17992 : }
17993 : }
17994 0 : if (py_start_type == NULL) {
17995 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
17996 0 : return false;
17997 : }
17998 : {
17999 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
18000 0 : if (PyLong_Check(py_start_type)) {
18001 : unsigned long long test_var;
18002 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
18003 0 : if (PyErr_Occurred() != NULL) {
18004 0 : return false;
18005 : }
18006 0 : if (test_var > uint_max) {
18007 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18008 : PyLong_Type.tp_name, uint_max, test_var);
18009 0 : return false;
18010 : }
18011 0 : r->in.start_type = test_var;
18012 : } else {
18013 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18014 : PyLong_Type.tp_name);
18015 0 : return false;
18016 : }
18017 : }
18018 0 : if (py_error_control == NULL) {
18019 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
18020 0 : return false;
18021 : }
18022 : {
18023 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
18024 0 : if (PyLong_Check(py_error_control)) {
18025 : unsigned long long test_var;
18026 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
18027 0 : if (PyErr_Occurred() != NULL) {
18028 0 : return false;
18029 : }
18030 0 : if (test_var > uint_max) {
18031 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18032 : PyLong_Type.tp_name, uint_max, test_var);
18033 0 : return false;
18034 : }
18035 0 : r->in.error_control = test_var;
18036 : } else {
18037 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18038 : PyLong_Type.tp_name);
18039 0 : return false;
18040 : }
18041 : }
18042 0 : if (py_binary_path == NULL) {
18043 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
18044 0 : return false;
18045 : }
18046 0 : if (py_binary_path == Py_None) {
18047 0 : r->in.binary_path = NULL;
18048 : } else {
18049 0 : r->in.binary_path = NULL;
18050 : {
18051 : const char *test_str;
18052 : const char *talloc_str;
18053 0 : PyObject *unicode = NULL;
18054 0 : if (PyUnicode_Check(py_binary_path)) {
18055 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
18056 0 : if (unicode == NULL) {
18057 0 : PyErr_NoMemory();
18058 0 : return false;
18059 : }
18060 0 : test_str = PyBytes_AS_STRING(unicode);
18061 0 : } else if (PyBytes_Check(py_binary_path)) {
18062 0 : test_str = PyBytes_AS_STRING(py_binary_path);
18063 : } else {
18064 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
18065 0 : return false;
18066 : }
18067 0 : talloc_str = talloc_strdup(r, test_str);
18068 0 : if (unicode != NULL) {
18069 0 : Py_DECREF(unicode);
18070 : }
18071 0 : if (talloc_str == NULL) {
18072 0 : PyErr_NoMemory();
18073 0 : return false;
18074 : }
18075 0 : r->in.binary_path = talloc_str;
18076 : }
18077 : }
18078 0 : if (py_load_order_group == NULL) {
18079 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.load_order_group");
18080 0 : return false;
18081 : }
18082 0 : if (py_load_order_group == Py_None) {
18083 0 : r->in.load_order_group = NULL;
18084 : } else {
18085 0 : r->in.load_order_group = NULL;
18086 : {
18087 : const char *test_str;
18088 : const char *talloc_str;
18089 0 : PyObject *unicode = NULL;
18090 0 : if (PyUnicode_Check(py_load_order_group)) {
18091 0 : unicode = PyUnicode_AsEncodedString(py_load_order_group, "utf-8", "ignore");
18092 0 : if (unicode == NULL) {
18093 0 : PyErr_NoMemory();
18094 0 : return false;
18095 : }
18096 0 : test_str = PyBytes_AS_STRING(unicode);
18097 0 : } else if (PyBytes_Check(py_load_order_group)) {
18098 0 : test_str = PyBytes_AS_STRING(py_load_order_group);
18099 : } else {
18100 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_load_order_group)->tp_name);
18101 0 : return false;
18102 : }
18103 0 : talloc_str = talloc_strdup(r, test_str);
18104 0 : if (unicode != NULL) {
18105 0 : Py_DECREF(unicode);
18106 : }
18107 0 : if (talloc_str == NULL) {
18108 0 : PyErr_NoMemory();
18109 0 : return false;
18110 : }
18111 0 : r->in.load_order_group = talloc_str;
18112 : }
18113 : }
18114 0 : if (py_dependencies == NULL) {
18115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
18116 0 : return false;
18117 : }
18118 0 : if (py_dependencies == Py_None) {
18119 0 : r->in.dependencies = NULL;
18120 : } else {
18121 0 : r->in.dependencies = NULL;
18122 : {
18123 : const char *test_str;
18124 : const char *talloc_str;
18125 0 : PyObject *unicode = NULL;
18126 0 : if (PyUnicode_Check(py_dependencies)) {
18127 0 : unicode = PyUnicode_AsEncodedString(py_dependencies, "utf-8", "ignore");
18128 0 : if (unicode == NULL) {
18129 0 : PyErr_NoMemory();
18130 0 : return false;
18131 : }
18132 0 : test_str = PyBytes_AS_STRING(unicode);
18133 0 : } else if (PyBytes_Check(py_dependencies)) {
18134 0 : test_str = PyBytes_AS_STRING(py_dependencies);
18135 : } else {
18136 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dependencies)->tp_name);
18137 0 : return false;
18138 : }
18139 0 : talloc_str = talloc_strdup(r, test_str);
18140 0 : if (unicode != NULL) {
18141 0 : Py_DECREF(unicode);
18142 : }
18143 0 : if (talloc_str == NULL) {
18144 0 : PyErr_NoMemory();
18145 0 : return false;
18146 : }
18147 0 : r->in.dependencies = talloc_str;
18148 : }
18149 : }
18150 0 : if (py_service_start_name == NULL) {
18151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
18152 0 : return false;
18153 : }
18154 0 : if (py_service_start_name == Py_None) {
18155 0 : r->in.service_start_name = NULL;
18156 : } else {
18157 0 : r->in.service_start_name = NULL;
18158 : {
18159 : const char *test_str;
18160 : const char *talloc_str;
18161 0 : PyObject *unicode = NULL;
18162 0 : if (PyUnicode_Check(py_service_start_name)) {
18163 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
18164 0 : if (unicode == NULL) {
18165 0 : PyErr_NoMemory();
18166 0 : return false;
18167 : }
18168 0 : test_str = PyBytes_AS_STRING(unicode);
18169 0 : } else if (PyBytes_Check(py_service_start_name)) {
18170 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
18171 : } else {
18172 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
18173 0 : return false;
18174 : }
18175 0 : talloc_str = talloc_strdup(r, test_str);
18176 0 : if (unicode != NULL) {
18177 0 : Py_DECREF(unicode);
18178 : }
18179 0 : if (talloc_str == NULL) {
18180 0 : PyErr_NoMemory();
18181 0 : return false;
18182 : }
18183 0 : r->in.service_start_name = talloc_str;
18184 : }
18185 : }
18186 0 : if (py_password == NULL) {
18187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
18188 0 : return false;
18189 : }
18190 0 : if (py_password == Py_None) {
18191 0 : r->in.password = NULL;
18192 : } else {
18193 0 : r->in.password = NULL;
18194 : {
18195 : const char *test_str;
18196 : const char *talloc_str;
18197 0 : PyObject *unicode = NULL;
18198 0 : if (PyUnicode_Check(py_password)) {
18199 0 : unicode = PyUnicode_AsEncodedString(py_password, "utf-8", "ignore");
18200 0 : if (unicode == NULL) {
18201 0 : PyErr_NoMemory();
18202 0 : return false;
18203 : }
18204 0 : test_str = PyBytes_AS_STRING(unicode);
18205 0 : } else if (PyBytes_Check(py_password)) {
18206 0 : test_str = PyBytes_AS_STRING(py_password);
18207 : } else {
18208 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_password)->tp_name);
18209 0 : return false;
18210 : }
18211 0 : talloc_str = talloc_strdup(r, test_str);
18212 0 : if (unicode != NULL) {
18213 0 : Py_DECREF(unicode);
18214 : }
18215 0 : if (talloc_str == NULL) {
18216 0 : PyErr_NoMemory();
18217 0 : return false;
18218 : }
18219 0 : r->in.password = talloc_str;
18220 : }
18221 : }
18222 0 : if (py_display_name == NULL) {
18223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name");
18224 0 : return false;
18225 : }
18226 0 : if (py_display_name == Py_None) {
18227 0 : r->in.display_name = NULL;
18228 : } else {
18229 0 : r->in.display_name = NULL;
18230 : {
18231 : const char *test_str;
18232 : const char *talloc_str;
18233 0 : PyObject *unicode = NULL;
18234 0 : if (PyUnicode_Check(py_display_name)) {
18235 0 : unicode = PyUnicode_AsEncodedString(py_display_name, "utf-8", "ignore");
18236 0 : if (unicode == NULL) {
18237 0 : PyErr_NoMemory();
18238 0 : return false;
18239 : }
18240 0 : test_str = PyBytes_AS_STRING(unicode);
18241 0 : } else if (PyBytes_Check(py_display_name)) {
18242 0 : test_str = PyBytes_AS_STRING(py_display_name);
18243 : } else {
18244 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_display_name)->tp_name);
18245 0 : return false;
18246 : }
18247 0 : talloc_str = talloc_strdup(r, test_str);
18248 0 : if (unicode != NULL) {
18249 0 : Py_DECREF(unicode);
18250 : }
18251 0 : if (talloc_str == NULL) {
18252 0 : PyErr_NoMemory();
18253 0 : return false;
18254 : }
18255 0 : r->in.display_name = talloc_str;
18256 : }
18257 : }
18258 0 : return true;
18259 : }
18260 :
18261 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfigA_args_out(struct svcctl_ChangeServiceConfigA *r)
18262 : {
18263 : PyObject *result;
18264 : PyObject *py_tag_id;
18265 0 : py_tag_id = PyLong_FromUnsignedLongLong((uint32_t)*r->out.tag_id);
18266 0 : result = py_tag_id;
18267 0 : if (!W_ERROR_IS_OK(r->out.result)) {
18268 0 : PyErr_SetWERROR(r->out.result);
18269 0 : return NULL;
18270 : }
18271 :
18272 0 : return result;
18273 : }
18274 :
18275 :
18276 0 : static PyObject *py_svcctl_CreateServiceA_in_get_handle(PyObject *obj, void *closure)
18277 : {
18278 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18279 : PyObject *py_handle;
18280 0 : if (object->in.handle == NULL) {
18281 0 : Py_RETURN_NONE;
18282 : }
18283 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
18284 0 : return py_handle;
18285 : }
18286 :
18287 0 : static int py_svcctl_CreateServiceA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
18288 : {
18289 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18290 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
18291 0 : if (value == NULL) {
18292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
18293 0 : return -1;
18294 : }
18295 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
18296 0 : if (object->in.handle == NULL) {
18297 0 : PyErr_NoMemory();
18298 0 : return -1;
18299 : }
18300 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18301 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18302 0 : PyErr_NoMemory();
18303 0 : return -1;
18304 : }
18305 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
18306 0 : return 0;
18307 : }
18308 :
18309 0 : static PyObject *py_svcctl_CreateServiceA_in_get_ServiceName(PyObject *obj, void *closure)
18310 : {
18311 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18312 : PyObject *py_ServiceName;
18313 0 : if (object->in.ServiceName == NULL) {
18314 0 : Py_RETURN_NONE;
18315 : }
18316 0 : if (object->in.ServiceName == NULL) {
18317 0 : py_ServiceName = Py_None;
18318 0 : Py_INCREF(py_ServiceName);
18319 : } else {
18320 0 : if (object->in.ServiceName == NULL) {
18321 0 : py_ServiceName = Py_None;
18322 0 : Py_INCREF(py_ServiceName);
18323 : } else {
18324 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
18325 : }
18326 : }
18327 0 : return py_ServiceName;
18328 : }
18329 :
18330 0 : static int py_svcctl_CreateServiceA_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
18331 : {
18332 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18333 0 : if (value == NULL) {
18334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
18335 0 : return -1;
18336 : }
18337 0 : if (value == Py_None) {
18338 0 : object->in.ServiceName = NULL;
18339 : } else {
18340 0 : object->in.ServiceName = NULL;
18341 : {
18342 : const char *test_str;
18343 : const char *talloc_str;
18344 0 : PyObject *unicode = NULL;
18345 0 : if (PyUnicode_Check(value)) {
18346 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18347 0 : if (unicode == NULL) {
18348 0 : PyErr_NoMemory();
18349 0 : return -1;
18350 : }
18351 0 : test_str = PyBytes_AS_STRING(unicode);
18352 0 : } else if (PyBytes_Check(value)) {
18353 0 : test_str = PyBytes_AS_STRING(value);
18354 : } else {
18355 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18356 0 : return -1;
18357 : }
18358 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18359 0 : if (unicode != NULL) {
18360 0 : Py_DECREF(unicode);
18361 : }
18362 0 : if (talloc_str == NULL) {
18363 0 : PyErr_NoMemory();
18364 0 : return -1;
18365 : }
18366 0 : object->in.ServiceName = talloc_str;
18367 : }
18368 : }
18369 0 : return 0;
18370 : }
18371 :
18372 0 : static PyObject *py_svcctl_CreateServiceA_in_get_DisplayName(PyObject *obj, void *closure)
18373 : {
18374 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18375 : PyObject *py_DisplayName;
18376 0 : if (object->in.DisplayName == NULL) {
18377 0 : Py_RETURN_NONE;
18378 : }
18379 0 : if (object->in.DisplayName == NULL) {
18380 0 : py_DisplayName = Py_None;
18381 0 : Py_INCREF(py_DisplayName);
18382 : } else {
18383 0 : if (object->in.DisplayName == NULL) {
18384 0 : py_DisplayName = Py_None;
18385 0 : Py_INCREF(py_DisplayName);
18386 : } else {
18387 0 : py_DisplayName = PyUnicode_Decode(object->in.DisplayName, strlen(object->in.DisplayName), "utf-8", "ignore");
18388 : }
18389 : }
18390 0 : return py_DisplayName;
18391 : }
18392 :
18393 0 : static int py_svcctl_CreateServiceA_in_set_DisplayName(PyObject *py_obj, PyObject *value, void *closure)
18394 : {
18395 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18396 0 : if (value == NULL) {
18397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DisplayName");
18398 0 : return -1;
18399 : }
18400 0 : if (value == Py_None) {
18401 0 : object->in.DisplayName = NULL;
18402 : } else {
18403 0 : object->in.DisplayName = NULL;
18404 : {
18405 : const char *test_str;
18406 : const char *talloc_str;
18407 0 : PyObject *unicode = NULL;
18408 0 : if (PyUnicode_Check(value)) {
18409 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18410 0 : if (unicode == NULL) {
18411 0 : PyErr_NoMemory();
18412 0 : return -1;
18413 : }
18414 0 : test_str = PyBytes_AS_STRING(unicode);
18415 0 : } else if (PyBytes_Check(value)) {
18416 0 : test_str = PyBytes_AS_STRING(value);
18417 : } else {
18418 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18419 0 : return -1;
18420 : }
18421 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18422 0 : if (unicode != NULL) {
18423 0 : Py_DECREF(unicode);
18424 : }
18425 0 : if (talloc_str == NULL) {
18426 0 : PyErr_NoMemory();
18427 0 : return -1;
18428 : }
18429 0 : object->in.DisplayName = talloc_str;
18430 : }
18431 : }
18432 0 : return 0;
18433 : }
18434 :
18435 0 : static PyObject *py_svcctl_CreateServiceA_in_get_desired_access(PyObject *obj, void *closure)
18436 : {
18437 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18438 : PyObject *py_desired_access;
18439 0 : py_desired_access = PyLong_FromUnsignedLongLong((uint32_t)object->in.desired_access);
18440 0 : return py_desired_access;
18441 : }
18442 :
18443 0 : static int py_svcctl_CreateServiceA_in_set_desired_access(PyObject *py_obj, PyObject *value, void *closure)
18444 : {
18445 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18446 0 : if (value == NULL) {
18447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.desired_access");
18448 0 : return -1;
18449 : }
18450 : {
18451 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.desired_access));
18452 0 : if (PyLong_Check(value)) {
18453 : unsigned long long test_var;
18454 0 : test_var = PyLong_AsUnsignedLongLong(value);
18455 0 : if (PyErr_Occurred() != NULL) {
18456 0 : return -1;
18457 : }
18458 0 : if (test_var > uint_max) {
18459 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18460 : PyLong_Type.tp_name, uint_max, test_var);
18461 0 : return -1;
18462 : }
18463 0 : object->in.desired_access = test_var;
18464 : } else {
18465 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18466 : PyLong_Type.tp_name);
18467 0 : return -1;
18468 : }
18469 : }
18470 0 : return 0;
18471 : }
18472 :
18473 0 : static PyObject *py_svcctl_CreateServiceA_in_get_type(PyObject *obj, void *closure)
18474 : {
18475 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18476 : PyObject *py_type;
18477 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
18478 0 : return py_type;
18479 : }
18480 :
18481 0 : static int py_svcctl_CreateServiceA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
18482 : {
18483 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18484 0 : if (value == NULL) {
18485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
18486 0 : return -1;
18487 : }
18488 : {
18489 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
18490 0 : if (PyLong_Check(value)) {
18491 : unsigned long long test_var;
18492 0 : test_var = PyLong_AsUnsignedLongLong(value);
18493 0 : if (PyErr_Occurred() != NULL) {
18494 0 : return -1;
18495 : }
18496 0 : if (test_var > uint_max) {
18497 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18498 : PyLong_Type.tp_name, uint_max, test_var);
18499 0 : return -1;
18500 : }
18501 0 : object->in.type = test_var;
18502 : } else {
18503 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18504 : PyLong_Type.tp_name);
18505 0 : return -1;
18506 : }
18507 : }
18508 0 : return 0;
18509 : }
18510 :
18511 0 : static PyObject *py_svcctl_CreateServiceA_in_get_start_type(PyObject *obj, void *closure)
18512 : {
18513 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18514 : PyObject *py_start_type;
18515 0 : py_start_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_type);
18516 0 : return py_start_type;
18517 : }
18518 :
18519 0 : static int py_svcctl_CreateServiceA_in_set_start_type(PyObject *py_obj, PyObject *value, void *closure)
18520 : {
18521 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18522 0 : if (value == NULL) {
18523 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_type");
18524 0 : return -1;
18525 : }
18526 : {
18527 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_type));
18528 0 : if (PyLong_Check(value)) {
18529 : unsigned long long test_var;
18530 0 : test_var = PyLong_AsUnsignedLongLong(value);
18531 0 : if (PyErr_Occurred() != NULL) {
18532 0 : return -1;
18533 : }
18534 0 : if (test_var > uint_max) {
18535 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18536 : PyLong_Type.tp_name, uint_max, test_var);
18537 0 : return -1;
18538 : }
18539 0 : object->in.start_type = test_var;
18540 : } else {
18541 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18542 : PyLong_Type.tp_name);
18543 0 : return -1;
18544 : }
18545 : }
18546 0 : return 0;
18547 : }
18548 :
18549 0 : static PyObject *py_svcctl_CreateServiceA_in_get_error_control(PyObject *obj, void *closure)
18550 : {
18551 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18552 : PyObject *py_error_control;
18553 0 : py_error_control = PyLong_FromUnsignedLongLong((uint32_t)object->in.error_control);
18554 0 : return py_error_control;
18555 : }
18556 :
18557 0 : static int py_svcctl_CreateServiceA_in_set_error_control(PyObject *py_obj, PyObject *value, void *closure)
18558 : {
18559 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18560 0 : if (value == NULL) {
18561 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.error_control");
18562 0 : return -1;
18563 : }
18564 : {
18565 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.error_control));
18566 0 : if (PyLong_Check(value)) {
18567 : unsigned long long test_var;
18568 0 : test_var = PyLong_AsUnsignedLongLong(value);
18569 0 : if (PyErr_Occurred() != NULL) {
18570 0 : return -1;
18571 : }
18572 0 : if (test_var > uint_max) {
18573 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18574 : PyLong_Type.tp_name, uint_max, test_var);
18575 0 : return -1;
18576 : }
18577 0 : object->in.error_control = test_var;
18578 : } else {
18579 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18580 : PyLong_Type.tp_name);
18581 0 : return -1;
18582 : }
18583 : }
18584 0 : return 0;
18585 : }
18586 :
18587 0 : static PyObject *py_svcctl_CreateServiceA_in_get_binary_path(PyObject *obj, void *closure)
18588 : {
18589 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18590 : PyObject *py_binary_path;
18591 0 : if (object->in.binary_path == NULL) {
18592 0 : Py_RETURN_NONE;
18593 : }
18594 0 : if (object->in.binary_path == NULL) {
18595 0 : py_binary_path = Py_None;
18596 0 : Py_INCREF(py_binary_path);
18597 : } else {
18598 0 : if (object->in.binary_path == NULL) {
18599 0 : py_binary_path = Py_None;
18600 0 : Py_INCREF(py_binary_path);
18601 : } else {
18602 0 : py_binary_path = PyUnicode_Decode(object->in.binary_path, strlen(object->in.binary_path), "utf-8", "ignore");
18603 : }
18604 : }
18605 0 : return py_binary_path;
18606 : }
18607 :
18608 0 : static int py_svcctl_CreateServiceA_in_set_binary_path(PyObject *py_obj, PyObject *value, void *closure)
18609 : {
18610 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18611 0 : if (value == NULL) {
18612 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.binary_path");
18613 0 : return -1;
18614 : }
18615 0 : if (value == Py_None) {
18616 0 : object->in.binary_path = NULL;
18617 : } else {
18618 0 : object->in.binary_path = NULL;
18619 : {
18620 : const char *test_str;
18621 : const char *talloc_str;
18622 0 : PyObject *unicode = NULL;
18623 0 : if (PyUnicode_Check(value)) {
18624 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18625 0 : if (unicode == NULL) {
18626 0 : PyErr_NoMemory();
18627 0 : return -1;
18628 : }
18629 0 : test_str = PyBytes_AS_STRING(unicode);
18630 0 : } else if (PyBytes_Check(value)) {
18631 0 : test_str = PyBytes_AS_STRING(value);
18632 : } else {
18633 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18634 0 : return -1;
18635 : }
18636 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18637 0 : if (unicode != NULL) {
18638 0 : Py_DECREF(unicode);
18639 : }
18640 0 : if (talloc_str == NULL) {
18641 0 : PyErr_NoMemory();
18642 0 : return -1;
18643 : }
18644 0 : object->in.binary_path = talloc_str;
18645 : }
18646 : }
18647 0 : return 0;
18648 : }
18649 :
18650 0 : static PyObject *py_svcctl_CreateServiceA_in_get_LoadOrderGroupKey(PyObject *obj, void *closure)
18651 : {
18652 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18653 : PyObject *py_LoadOrderGroupKey;
18654 0 : if (object->in.LoadOrderGroupKey == NULL) {
18655 0 : Py_RETURN_NONE;
18656 : }
18657 0 : if (object->in.LoadOrderGroupKey == NULL) {
18658 0 : py_LoadOrderGroupKey = Py_None;
18659 0 : Py_INCREF(py_LoadOrderGroupKey);
18660 : } else {
18661 0 : if (object->in.LoadOrderGroupKey == NULL) {
18662 0 : py_LoadOrderGroupKey = Py_None;
18663 0 : Py_INCREF(py_LoadOrderGroupKey);
18664 : } else {
18665 0 : py_LoadOrderGroupKey = PyUnicode_Decode(object->in.LoadOrderGroupKey, strlen(object->in.LoadOrderGroupKey), "utf-8", "ignore");
18666 : }
18667 : }
18668 0 : return py_LoadOrderGroupKey;
18669 : }
18670 :
18671 0 : static int py_svcctl_CreateServiceA_in_set_LoadOrderGroupKey(PyObject *py_obj, PyObject *value, void *closure)
18672 : {
18673 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18674 0 : if (value == NULL) {
18675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.LoadOrderGroupKey");
18676 0 : return -1;
18677 : }
18678 0 : if (value == Py_None) {
18679 0 : object->in.LoadOrderGroupKey = NULL;
18680 : } else {
18681 0 : object->in.LoadOrderGroupKey = NULL;
18682 : {
18683 : const char *test_str;
18684 : const char *talloc_str;
18685 0 : PyObject *unicode = NULL;
18686 0 : if (PyUnicode_Check(value)) {
18687 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18688 0 : if (unicode == NULL) {
18689 0 : PyErr_NoMemory();
18690 0 : return -1;
18691 : }
18692 0 : test_str = PyBytes_AS_STRING(unicode);
18693 0 : } else if (PyBytes_Check(value)) {
18694 0 : test_str = PyBytes_AS_STRING(value);
18695 : } else {
18696 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18697 0 : return -1;
18698 : }
18699 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18700 0 : if (unicode != NULL) {
18701 0 : Py_DECREF(unicode);
18702 : }
18703 0 : if (talloc_str == NULL) {
18704 0 : PyErr_NoMemory();
18705 0 : return -1;
18706 : }
18707 0 : object->in.LoadOrderGroupKey = talloc_str;
18708 : }
18709 : }
18710 0 : return 0;
18711 : }
18712 :
18713 0 : static PyObject *py_svcctl_CreateServiceA_out_get_TagId(PyObject *obj, void *closure)
18714 : {
18715 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18716 : PyObject *py_TagId;
18717 0 : if (object->out.TagId == NULL) {
18718 0 : Py_RETURN_NONE;
18719 : }
18720 0 : if (object->out.TagId == NULL) {
18721 0 : py_TagId = Py_None;
18722 0 : Py_INCREF(py_TagId);
18723 : } else {
18724 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*object->out.TagId);
18725 : }
18726 0 : return py_TagId;
18727 : }
18728 :
18729 0 : static int py_svcctl_CreateServiceA_out_set_TagId(PyObject *py_obj, PyObject *value, void *closure)
18730 : {
18731 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18732 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.TagId));
18733 0 : if (value == NULL) {
18734 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.TagId");
18735 0 : return -1;
18736 : }
18737 0 : if (value == Py_None) {
18738 0 : object->out.TagId = NULL;
18739 : } else {
18740 0 : object->out.TagId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.TagId);
18741 0 : if (object->out.TagId == NULL) {
18742 0 : PyErr_NoMemory();
18743 0 : return -1;
18744 : }
18745 : {
18746 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.TagId));
18747 0 : if (PyLong_Check(value)) {
18748 : unsigned long long test_var;
18749 0 : test_var = PyLong_AsUnsignedLongLong(value);
18750 0 : if (PyErr_Occurred() != NULL) {
18751 0 : return -1;
18752 : }
18753 0 : if (test_var > uint_max) {
18754 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18755 : PyLong_Type.tp_name, uint_max, test_var);
18756 0 : return -1;
18757 : }
18758 0 : *object->out.TagId = test_var;
18759 : } else {
18760 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18761 : PyLong_Type.tp_name);
18762 0 : return -1;
18763 : }
18764 : }
18765 : }
18766 0 : return 0;
18767 : }
18768 :
18769 0 : static PyObject *py_svcctl_CreateServiceA_in_get_dependencies(PyObject *obj, void *closure)
18770 : {
18771 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18772 : PyObject *py_dependencies;
18773 0 : if (object->in.dependencies == NULL) {
18774 0 : Py_RETURN_NONE;
18775 : }
18776 0 : if (object->in.dependencies == NULL) {
18777 0 : py_dependencies = Py_None;
18778 0 : Py_INCREF(py_dependencies);
18779 : } else {
18780 0 : if (object->in.dependencies == NULL) {
18781 0 : py_dependencies = Py_None;
18782 0 : Py_INCREF(py_dependencies);
18783 : } else {
18784 0 : py_dependencies = PyUnicode_Decode(object->in.dependencies, strlen(object->in.dependencies), "utf-8", "ignore");
18785 : }
18786 : }
18787 0 : return py_dependencies;
18788 : }
18789 :
18790 0 : static int py_svcctl_CreateServiceA_in_set_dependencies(PyObject *py_obj, PyObject *value, void *closure)
18791 : {
18792 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18793 0 : if (value == NULL) {
18794 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dependencies");
18795 0 : return -1;
18796 : }
18797 0 : if (value == Py_None) {
18798 0 : object->in.dependencies = NULL;
18799 : } else {
18800 0 : object->in.dependencies = NULL;
18801 : {
18802 : const char *test_str;
18803 : const char *talloc_str;
18804 0 : PyObject *unicode = NULL;
18805 0 : if (PyUnicode_Check(value)) {
18806 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18807 0 : if (unicode == NULL) {
18808 0 : PyErr_NoMemory();
18809 0 : return -1;
18810 : }
18811 0 : test_str = PyBytes_AS_STRING(unicode);
18812 0 : } else if (PyBytes_Check(value)) {
18813 0 : test_str = PyBytes_AS_STRING(value);
18814 : } else {
18815 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18816 0 : return -1;
18817 : }
18818 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18819 0 : if (unicode != NULL) {
18820 0 : Py_DECREF(unicode);
18821 : }
18822 0 : if (talloc_str == NULL) {
18823 0 : PyErr_NoMemory();
18824 0 : return -1;
18825 : }
18826 0 : object->in.dependencies = talloc_str;
18827 : }
18828 : }
18829 0 : return 0;
18830 : }
18831 :
18832 0 : static PyObject *py_svcctl_CreateServiceA_in_get_service_start_name(PyObject *obj, void *closure)
18833 : {
18834 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18835 : PyObject *py_service_start_name;
18836 0 : if (object->in.service_start_name == NULL) {
18837 0 : Py_RETURN_NONE;
18838 : }
18839 0 : if (object->in.service_start_name == NULL) {
18840 0 : py_service_start_name = Py_None;
18841 0 : Py_INCREF(py_service_start_name);
18842 : } else {
18843 0 : if (object->in.service_start_name == NULL) {
18844 0 : py_service_start_name = Py_None;
18845 0 : Py_INCREF(py_service_start_name);
18846 : } else {
18847 0 : py_service_start_name = PyUnicode_Decode(object->in.service_start_name, strlen(object->in.service_start_name), "utf-8", "ignore");
18848 : }
18849 : }
18850 0 : return py_service_start_name;
18851 : }
18852 :
18853 0 : static int py_svcctl_CreateServiceA_in_set_service_start_name(PyObject *py_obj, PyObject *value, void *closure)
18854 : {
18855 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18856 0 : if (value == NULL) {
18857 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_start_name");
18858 0 : return -1;
18859 : }
18860 0 : if (value == Py_None) {
18861 0 : object->in.service_start_name = NULL;
18862 : } else {
18863 0 : object->in.service_start_name = NULL;
18864 : {
18865 : const char *test_str;
18866 : const char *talloc_str;
18867 0 : PyObject *unicode = NULL;
18868 0 : if (PyUnicode_Check(value)) {
18869 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18870 0 : if (unicode == NULL) {
18871 0 : PyErr_NoMemory();
18872 0 : return -1;
18873 : }
18874 0 : test_str = PyBytes_AS_STRING(unicode);
18875 0 : } else if (PyBytes_Check(value)) {
18876 0 : test_str = PyBytes_AS_STRING(value);
18877 : } else {
18878 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18879 0 : return -1;
18880 : }
18881 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18882 0 : if (unicode != NULL) {
18883 0 : Py_DECREF(unicode);
18884 : }
18885 0 : if (talloc_str == NULL) {
18886 0 : PyErr_NoMemory();
18887 0 : return -1;
18888 : }
18889 0 : object->in.service_start_name = talloc_str;
18890 : }
18891 : }
18892 0 : return 0;
18893 : }
18894 :
18895 0 : static PyObject *py_svcctl_CreateServiceA_in_get_password(PyObject *obj, void *closure)
18896 : {
18897 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18898 : PyObject *py_password;
18899 0 : if (object->in.password == NULL) {
18900 0 : Py_RETURN_NONE;
18901 : }
18902 0 : if (object->in.password == NULL) {
18903 0 : py_password = Py_None;
18904 0 : Py_INCREF(py_password);
18905 : } else {
18906 0 : if (object->in.password == NULL) {
18907 0 : py_password = Py_None;
18908 0 : Py_INCREF(py_password);
18909 : } else {
18910 0 : py_password = PyUnicode_Decode(object->in.password, strlen(object->in.password), "utf-8", "ignore");
18911 : }
18912 : }
18913 0 : return py_password;
18914 : }
18915 :
18916 0 : static int py_svcctl_CreateServiceA_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
18917 : {
18918 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18919 0 : if (value == NULL) {
18920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
18921 0 : return -1;
18922 : }
18923 0 : if (value == Py_None) {
18924 0 : object->in.password = NULL;
18925 : } else {
18926 0 : object->in.password = NULL;
18927 : {
18928 : const char *test_str;
18929 : const char *talloc_str;
18930 0 : PyObject *unicode = NULL;
18931 0 : if (PyUnicode_Check(value)) {
18932 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18933 0 : if (unicode == NULL) {
18934 0 : PyErr_NoMemory();
18935 0 : return -1;
18936 : }
18937 0 : test_str = PyBytes_AS_STRING(unicode);
18938 0 : } else if (PyBytes_Check(value)) {
18939 0 : test_str = PyBytes_AS_STRING(value);
18940 : } else {
18941 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18942 0 : return -1;
18943 : }
18944 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18945 0 : if (unicode != NULL) {
18946 0 : Py_DECREF(unicode);
18947 : }
18948 0 : if (talloc_str == NULL) {
18949 0 : PyErr_NoMemory();
18950 0 : return -1;
18951 : }
18952 0 : object->in.password = talloc_str;
18953 : }
18954 : }
18955 0 : return 0;
18956 : }
18957 :
18958 0 : static PyObject *py_svcctl_CreateServiceA_get_result(PyObject *obj, void *closure)
18959 : {
18960 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(obj);
18961 : PyObject *py_result;
18962 0 : py_result = PyErr_FromWERROR(object->out.result);
18963 0 : return py_result;
18964 : }
18965 :
18966 0 : static int py_svcctl_CreateServiceA_set_result(PyObject *py_obj, PyObject *value, void *closure)
18967 : {
18968 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
18969 0 : if (value == NULL) {
18970 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
18971 0 : return -1;
18972 : }
18973 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
18974 0 : return 0;
18975 : }
18976 :
18977 : static PyGetSetDef py_svcctl_CreateServiceA_getsetters[] = {
18978 : {
18979 : .name = discard_const_p(char, "in_handle"),
18980 : .get = py_svcctl_CreateServiceA_in_get_handle,
18981 : .set = py_svcctl_CreateServiceA_in_set_handle,
18982 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18983 : },
18984 : {
18985 : .name = discard_const_p(char, "in_ServiceName"),
18986 : .get = py_svcctl_CreateServiceA_in_get_ServiceName,
18987 : .set = py_svcctl_CreateServiceA_in_set_ServiceName,
18988 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
18989 : },
18990 : {
18991 : .name = discard_const_p(char, "in_DisplayName"),
18992 : .get = py_svcctl_CreateServiceA_in_get_DisplayName,
18993 : .set = py_svcctl_CreateServiceA_in_set_DisplayName,
18994 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
18995 : },
18996 : {
18997 : .name = discard_const_p(char, "in_desired_access"),
18998 : .get = py_svcctl_CreateServiceA_in_get_desired_access,
18999 : .set = py_svcctl_CreateServiceA_in_set_desired_access,
19000 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19001 : },
19002 : {
19003 : .name = discard_const_p(char, "in_type"),
19004 : .get = py_svcctl_CreateServiceA_in_get_type,
19005 : .set = py_svcctl_CreateServiceA_in_set_type,
19006 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19007 : },
19008 : {
19009 : .name = discard_const_p(char, "in_start_type"),
19010 : .get = py_svcctl_CreateServiceA_in_get_start_type,
19011 : .set = py_svcctl_CreateServiceA_in_set_start_type,
19012 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StartType")
19013 : },
19014 : {
19015 : .name = discard_const_p(char, "in_error_control"),
19016 : .get = py_svcctl_CreateServiceA_in_get_error_control,
19017 : .set = py_svcctl_CreateServiceA_in_set_error_control,
19018 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ErrorControl")
19019 : },
19020 : {
19021 : .name = discard_const_p(char, "in_binary_path"),
19022 : .get = py_svcctl_CreateServiceA_in_get_binary_path,
19023 : .set = py_svcctl_CreateServiceA_in_set_binary_path,
19024 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19025 : },
19026 : {
19027 : .name = discard_const_p(char, "in_LoadOrderGroupKey"),
19028 : .get = py_svcctl_CreateServiceA_in_get_LoadOrderGroupKey,
19029 : .set = py_svcctl_CreateServiceA_in_set_LoadOrderGroupKey,
19030 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19031 : },
19032 : {
19033 : .name = discard_const_p(char, "out_TagId"),
19034 : .get = py_svcctl_CreateServiceA_out_get_TagId,
19035 : .set = py_svcctl_CreateServiceA_out_set_TagId,
19036 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19037 : },
19038 : {
19039 : .name = discard_const_p(char, "in_dependencies"),
19040 : .get = py_svcctl_CreateServiceA_in_get_dependencies,
19041 : .set = py_svcctl_CreateServiceA_in_set_dependencies,
19042 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19043 : },
19044 : {
19045 : .name = discard_const_p(char, "in_service_start_name"),
19046 : .get = py_svcctl_CreateServiceA_in_get_service_start_name,
19047 : .set = py_svcctl_CreateServiceA_in_set_service_start_name,
19048 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19049 : },
19050 : {
19051 : .name = discard_const_p(char, "in_password"),
19052 : .get = py_svcctl_CreateServiceA_in_get_password,
19053 : .set = py_svcctl_CreateServiceA_in_set_password,
19054 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19055 : },
19056 : {
19057 : .name = discard_const_p(char, "result"),
19058 : .get = py_svcctl_CreateServiceA_get_result,
19059 : .set = py_svcctl_CreateServiceA_set_result,
19060 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
19061 : },
19062 : { .name = NULL }
19063 : };
19064 :
19065 0 : static PyObject *py_svcctl_CreateServiceA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19066 : {
19067 0 : PyObject *self = pytalloc_new(struct svcctl_CreateServiceA, type);
19068 0 : struct svcctl_CreateServiceA *_self = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(self);
19069 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19070 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
19071 0 : return self;
19072 : }
19073 :
19074 0 : static PyObject *py_svcctl_CreateServiceA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19075 : {
19076 :
19077 :
19078 0 : return PyLong_FromLong(24);
19079 : }
19080 :
19081 0 : static PyObject *py_svcctl_CreateServiceA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
19082 : {
19083 0 : const struct ndr_interface_call *call = NULL;
19084 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
19085 0 : PyObject *ret = NULL;
19086 0 : struct ndr_push *push = NULL;
19087 : DATA_BLOB blob;
19088 : enum ndr_err_code err;
19089 :
19090 0 : if (ndr_table_svcctl.num_calls < 25) {
19091 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceA_ndr_pack");
19092 0 : return NULL;
19093 : }
19094 0 : call = &ndr_table_svcctl.calls[24];
19095 :
19096 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19097 0 : if (push == NULL) {
19098 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19099 0 : return NULL;
19100 : }
19101 :
19102 0 : push->flags |= ndr_push_flags;
19103 :
19104 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19105 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19106 0 : TALLOC_FREE(push);
19107 0 : PyErr_SetNdrError(err);
19108 0 : return NULL;
19109 : }
19110 0 : blob = ndr_push_blob(push);
19111 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19112 0 : TALLOC_FREE(push);
19113 0 : return ret;
19114 : }
19115 :
19116 0 : static PyObject *py_svcctl_CreateServiceA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19117 : {
19118 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19119 0 : PyObject *bigendian_obj = NULL;
19120 0 : PyObject *ndr64_obj = NULL;
19121 0 : uint32_t ndr_push_flags = 0;
19122 :
19123 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19124 : discard_const_p(char *, kwnames),
19125 : &bigendian_obj,
19126 : &ndr64_obj)) {
19127 0 : return NULL;
19128 : }
19129 :
19130 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19131 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19132 : }
19133 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19134 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19135 : }
19136 :
19137 0 : return py_svcctl_CreateServiceA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19138 : }
19139 :
19140 0 : static PyObject *py_svcctl_CreateServiceA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19141 : {
19142 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19143 0 : PyObject *bigendian_obj = NULL;
19144 0 : PyObject *ndr64_obj = NULL;
19145 0 : uint32_t ndr_push_flags = 0;
19146 :
19147 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19148 : discard_const_p(char *, kwnames),
19149 : &bigendian_obj,
19150 : &ndr64_obj)) {
19151 0 : return NULL;
19152 : }
19153 :
19154 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19155 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19156 : }
19157 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19158 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19159 : }
19160 :
19161 0 : return py_svcctl_CreateServiceA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19162 : }
19163 :
19164 0 : static PyObject *py_svcctl_CreateServiceA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
19165 : {
19166 0 : const struct ndr_interface_call *call = NULL;
19167 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
19168 0 : struct ndr_pull *pull = NULL;
19169 : enum ndr_err_code err;
19170 :
19171 0 : if (ndr_table_svcctl.num_calls < 25) {
19172 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceA_ndr_unpack");
19173 0 : return NULL;
19174 : }
19175 0 : call = &ndr_table_svcctl.calls[24];
19176 :
19177 0 : pull = ndr_pull_init_blob(blob, object);
19178 0 : if (pull == NULL) {
19179 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19180 0 : return NULL;
19181 : }
19182 :
19183 0 : pull->flags |= ndr_pull_flags;
19184 :
19185 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19186 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19187 0 : TALLOC_FREE(pull);
19188 0 : PyErr_SetNdrError(err);
19189 0 : return NULL;
19190 : }
19191 0 : if (!allow_remaining) {
19192 : uint32_t highest_ofs;
19193 :
19194 0 : if (pull->offset > pull->relative_highest_offset) {
19195 0 : highest_ofs = pull->offset;
19196 : } else {
19197 0 : highest_ofs = pull->relative_highest_offset;
19198 : }
19199 0 : if (highest_ofs < pull->data_size) {
19200 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19201 : "not all bytes consumed ofs[%u] size[%u]",
19202 : highest_ofs, pull->data_size);
19203 0 : TALLOC_FREE(pull);
19204 0 : PyErr_SetNdrError(err);
19205 0 : return NULL;
19206 : }
19207 : }
19208 :
19209 0 : TALLOC_FREE(pull);
19210 0 : Py_RETURN_NONE;
19211 : }
19212 :
19213 0 : static PyObject *py_svcctl_CreateServiceA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19214 : {
19215 : DATA_BLOB blob;
19216 0 : Py_ssize_t blob_length = 0;
19217 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19218 0 : PyObject *bigendian_obj = NULL;
19219 0 : PyObject *ndr64_obj = NULL;
19220 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19221 0 : PyObject *allow_remaining_obj = NULL;
19222 0 : bool allow_remaining = false;
19223 :
19224 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19225 : discard_const_p(char *, kwnames),
19226 : &blob.data, &blob_length,
19227 : &bigendian_obj,
19228 : &ndr64_obj,
19229 : &allow_remaining_obj)) {
19230 0 : return NULL;
19231 : }
19232 0 : blob.length = blob_length;
19233 :
19234 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19235 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19236 : }
19237 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19238 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19239 : }
19240 :
19241 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19242 0 : allow_remaining = true;
19243 : }
19244 :
19245 0 : return py_svcctl_CreateServiceA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19246 : }
19247 :
19248 0 : static PyObject *py_svcctl_CreateServiceA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19249 : {
19250 : DATA_BLOB blob;
19251 0 : Py_ssize_t blob_length = 0;
19252 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19253 0 : PyObject *bigendian_obj = NULL;
19254 0 : PyObject *ndr64_obj = NULL;
19255 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19256 0 : PyObject *allow_remaining_obj = NULL;
19257 0 : bool allow_remaining = false;
19258 :
19259 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19260 : discard_const_p(char *, kwnames),
19261 : &blob.data, &blob_length,
19262 : &bigendian_obj,
19263 : &ndr64_obj,
19264 : &allow_remaining_obj)) {
19265 0 : return NULL;
19266 : }
19267 0 : blob.length = blob_length;
19268 :
19269 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19270 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19271 : }
19272 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19273 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19274 : }
19275 :
19276 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19277 0 : allow_remaining = true;
19278 : }
19279 :
19280 0 : return py_svcctl_CreateServiceA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19281 : }
19282 :
19283 0 : static PyObject *py_svcctl_CreateServiceA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
19284 : {
19285 0 : const struct ndr_interface_call *call = NULL;
19286 0 : struct svcctl_CreateServiceA *object = (struct svcctl_CreateServiceA *)pytalloc_get_ptr(py_obj);
19287 : PyObject *ret;
19288 : char *retstr;
19289 :
19290 0 : if (ndr_table_svcctl.num_calls < 25) {
19291 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_CreateServiceA_ndr_print");
19292 0 : return NULL;
19293 : }
19294 0 : call = &ndr_table_svcctl.calls[24];
19295 :
19296 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19297 0 : ret = PyUnicode_FromString(retstr);
19298 0 : TALLOC_FREE(retstr);
19299 :
19300 0 : return ret;
19301 : }
19302 :
19303 0 : static PyObject *py_svcctl_CreateServiceA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19304 : {
19305 0 : return py_svcctl_CreateServiceA_ndr_print(py_obj, "svcctl_CreateServiceA_in", NDR_IN);
19306 : }
19307 :
19308 0 : static PyObject *py_svcctl_CreateServiceA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19309 : {
19310 0 : return py_svcctl_CreateServiceA_ndr_print(py_obj, "svcctl_CreateServiceA_out", NDR_OUT);
19311 : }
19312 :
19313 : static PyMethodDef py_svcctl_CreateServiceA_methods[] = {
19314 : { "opnum", (PyCFunction)py_svcctl_CreateServiceA_ndr_opnum, METH_NOARGS|METH_CLASS,
19315 : "svcctl.CreateServiceA.opnum() -> 24 (0x18) " },
19316 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19317 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19318 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19319 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19320 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19321 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19322 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_CreateServiceA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19323 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19324 : { "__ndr_print_in__", (PyCFunction)py_svcctl_CreateServiceA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19325 : { "__ndr_print_out__", (PyCFunction)py_svcctl_CreateServiceA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19326 : { NULL, NULL, 0, NULL }
19327 : };
19328 :
19329 :
19330 : static PyTypeObject svcctl_CreateServiceA_Type = {
19331 : PyVarObject_HEAD_INIT(NULL, 0)
19332 : .tp_name = "svcctl.CreateServiceA",
19333 : .tp_getset = py_svcctl_CreateServiceA_getsetters,
19334 : .tp_methods = py_svcctl_CreateServiceA_methods,
19335 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19336 : .tp_new = py_svcctl_CreateServiceA_new,
19337 : };
19338 :
19339 0 : static bool pack_py_svcctl_CreateServiceA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_CreateServiceA *r)
19340 : {
19341 : PyObject *py_handle;
19342 : PyObject *py_ServiceName;
19343 : PyObject *py_DisplayName;
19344 : PyObject *py_desired_access;
19345 : PyObject *py_type;
19346 : PyObject *py_start_type;
19347 : PyObject *py_error_control;
19348 : PyObject *py_binary_path;
19349 : PyObject *py_LoadOrderGroupKey;
19350 : PyObject *py_dependencies;
19351 : PyObject *py_service_start_name;
19352 : PyObject *py_password;
19353 0 : const char *kwnames[] = {
19354 : "handle", "ServiceName", "DisplayName", "desired_access", "type", "start_type", "error_control", "binary_path", "LoadOrderGroupKey", "dependencies", "service_start_name", "password", NULL
19355 : };
19356 :
19357 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)) {
19358 0 : return false;
19359 : }
19360 :
19361 0 : if (py_handle == NULL) {
19362 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
19363 0 : return false;
19364 : }
19365 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
19366 0 : if (r->in.handle == NULL) {
19367 0 : PyErr_NoMemory();
19368 0 : return false;
19369 : }
19370 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
19371 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
19372 0 : PyErr_NoMemory();
19373 0 : return false;
19374 : }
19375 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
19376 0 : if (py_ServiceName == NULL) {
19377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
19378 0 : return false;
19379 : }
19380 0 : if (py_ServiceName == Py_None) {
19381 0 : r->in.ServiceName = NULL;
19382 : } else {
19383 0 : r->in.ServiceName = NULL;
19384 : {
19385 : const char *test_str;
19386 : const char *talloc_str;
19387 0 : PyObject *unicode = NULL;
19388 0 : if (PyUnicode_Check(py_ServiceName)) {
19389 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
19390 0 : if (unicode == NULL) {
19391 0 : PyErr_NoMemory();
19392 0 : return false;
19393 : }
19394 0 : test_str = PyBytes_AS_STRING(unicode);
19395 0 : } else if (PyBytes_Check(py_ServiceName)) {
19396 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
19397 : } else {
19398 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
19399 0 : return false;
19400 : }
19401 0 : talloc_str = talloc_strdup(r, test_str);
19402 0 : if (unicode != NULL) {
19403 0 : Py_DECREF(unicode);
19404 : }
19405 0 : if (talloc_str == NULL) {
19406 0 : PyErr_NoMemory();
19407 0 : return false;
19408 : }
19409 0 : r->in.ServiceName = talloc_str;
19410 : }
19411 : }
19412 0 : if (py_DisplayName == NULL) {
19413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DisplayName");
19414 0 : return false;
19415 : }
19416 0 : if (py_DisplayName == Py_None) {
19417 0 : r->in.DisplayName = NULL;
19418 : } else {
19419 0 : r->in.DisplayName = NULL;
19420 : {
19421 : const char *test_str;
19422 : const char *talloc_str;
19423 0 : PyObject *unicode = NULL;
19424 0 : if (PyUnicode_Check(py_DisplayName)) {
19425 0 : unicode = PyUnicode_AsEncodedString(py_DisplayName, "utf-8", "ignore");
19426 0 : if (unicode == NULL) {
19427 0 : PyErr_NoMemory();
19428 0 : return false;
19429 : }
19430 0 : test_str = PyBytes_AS_STRING(unicode);
19431 0 : } else if (PyBytes_Check(py_DisplayName)) {
19432 0 : test_str = PyBytes_AS_STRING(py_DisplayName);
19433 : } else {
19434 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DisplayName)->tp_name);
19435 0 : return false;
19436 : }
19437 0 : talloc_str = talloc_strdup(r, test_str);
19438 0 : if (unicode != NULL) {
19439 0 : Py_DECREF(unicode);
19440 : }
19441 0 : if (talloc_str == NULL) {
19442 0 : PyErr_NoMemory();
19443 0 : return false;
19444 : }
19445 0 : r->in.DisplayName = talloc_str;
19446 : }
19447 : }
19448 0 : if (py_desired_access == NULL) {
19449 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.desired_access");
19450 0 : return false;
19451 : }
19452 : {
19453 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.desired_access));
19454 0 : if (PyLong_Check(py_desired_access)) {
19455 : unsigned long long test_var;
19456 0 : test_var = PyLong_AsUnsignedLongLong(py_desired_access);
19457 0 : if (PyErr_Occurred() != NULL) {
19458 0 : return false;
19459 : }
19460 0 : if (test_var > uint_max) {
19461 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19462 : PyLong_Type.tp_name, uint_max, test_var);
19463 0 : return false;
19464 : }
19465 0 : r->in.desired_access = test_var;
19466 : } else {
19467 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19468 : PyLong_Type.tp_name);
19469 0 : return false;
19470 : }
19471 : }
19472 0 : if (py_type == NULL) {
19473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
19474 0 : return false;
19475 : }
19476 : {
19477 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
19478 0 : if (PyLong_Check(py_type)) {
19479 : unsigned long long test_var;
19480 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
19481 0 : if (PyErr_Occurred() != NULL) {
19482 0 : return false;
19483 : }
19484 0 : if (test_var > uint_max) {
19485 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19486 : PyLong_Type.tp_name, uint_max, test_var);
19487 0 : return false;
19488 : }
19489 0 : r->in.type = test_var;
19490 : } else {
19491 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19492 : PyLong_Type.tp_name);
19493 0 : return false;
19494 : }
19495 : }
19496 0 : if (py_start_type == NULL) {
19497 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_type");
19498 0 : return false;
19499 : }
19500 : {
19501 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_type));
19502 0 : if (PyLong_Check(py_start_type)) {
19503 : unsigned long long test_var;
19504 0 : test_var = PyLong_AsUnsignedLongLong(py_start_type);
19505 0 : if (PyErr_Occurred() != NULL) {
19506 0 : return false;
19507 : }
19508 0 : if (test_var > uint_max) {
19509 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19510 : PyLong_Type.tp_name, uint_max, test_var);
19511 0 : return false;
19512 : }
19513 0 : r->in.start_type = test_var;
19514 : } else {
19515 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19516 : PyLong_Type.tp_name);
19517 0 : return false;
19518 : }
19519 : }
19520 0 : if (py_error_control == NULL) {
19521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.error_control");
19522 0 : return false;
19523 : }
19524 : {
19525 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.error_control));
19526 0 : if (PyLong_Check(py_error_control)) {
19527 : unsigned long long test_var;
19528 0 : test_var = PyLong_AsUnsignedLongLong(py_error_control);
19529 0 : if (PyErr_Occurred() != NULL) {
19530 0 : return false;
19531 : }
19532 0 : if (test_var > uint_max) {
19533 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19534 : PyLong_Type.tp_name, uint_max, test_var);
19535 0 : return false;
19536 : }
19537 0 : r->in.error_control = test_var;
19538 : } else {
19539 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19540 : PyLong_Type.tp_name);
19541 0 : return false;
19542 : }
19543 : }
19544 0 : if (py_binary_path == NULL) {
19545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.binary_path");
19546 0 : return false;
19547 : }
19548 0 : if (py_binary_path == Py_None) {
19549 0 : r->in.binary_path = NULL;
19550 : } else {
19551 0 : r->in.binary_path = NULL;
19552 : {
19553 : const char *test_str;
19554 : const char *talloc_str;
19555 0 : PyObject *unicode = NULL;
19556 0 : if (PyUnicode_Check(py_binary_path)) {
19557 0 : unicode = PyUnicode_AsEncodedString(py_binary_path, "utf-8", "ignore");
19558 0 : if (unicode == NULL) {
19559 0 : PyErr_NoMemory();
19560 0 : return false;
19561 : }
19562 0 : test_str = PyBytes_AS_STRING(unicode);
19563 0 : } else if (PyBytes_Check(py_binary_path)) {
19564 0 : test_str = PyBytes_AS_STRING(py_binary_path);
19565 : } else {
19566 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_binary_path)->tp_name);
19567 0 : return false;
19568 : }
19569 0 : talloc_str = talloc_strdup(r, test_str);
19570 0 : if (unicode != NULL) {
19571 0 : Py_DECREF(unicode);
19572 : }
19573 0 : if (talloc_str == NULL) {
19574 0 : PyErr_NoMemory();
19575 0 : return false;
19576 : }
19577 0 : r->in.binary_path = talloc_str;
19578 : }
19579 : }
19580 0 : if (py_LoadOrderGroupKey == NULL) {
19581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.LoadOrderGroupKey");
19582 0 : return false;
19583 : }
19584 0 : if (py_LoadOrderGroupKey == Py_None) {
19585 0 : r->in.LoadOrderGroupKey = NULL;
19586 : } else {
19587 0 : r->in.LoadOrderGroupKey = NULL;
19588 : {
19589 : const char *test_str;
19590 : const char *talloc_str;
19591 0 : PyObject *unicode = NULL;
19592 0 : if (PyUnicode_Check(py_LoadOrderGroupKey)) {
19593 0 : unicode = PyUnicode_AsEncodedString(py_LoadOrderGroupKey, "utf-8", "ignore");
19594 0 : if (unicode == NULL) {
19595 0 : PyErr_NoMemory();
19596 0 : return false;
19597 : }
19598 0 : test_str = PyBytes_AS_STRING(unicode);
19599 0 : } else if (PyBytes_Check(py_LoadOrderGroupKey)) {
19600 0 : test_str = PyBytes_AS_STRING(py_LoadOrderGroupKey);
19601 : } else {
19602 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_LoadOrderGroupKey)->tp_name);
19603 0 : return false;
19604 : }
19605 0 : talloc_str = talloc_strdup(r, test_str);
19606 0 : if (unicode != NULL) {
19607 0 : Py_DECREF(unicode);
19608 : }
19609 0 : if (talloc_str == NULL) {
19610 0 : PyErr_NoMemory();
19611 0 : return false;
19612 : }
19613 0 : r->in.LoadOrderGroupKey = talloc_str;
19614 : }
19615 : }
19616 0 : if (py_dependencies == NULL) {
19617 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dependencies");
19618 0 : return false;
19619 : }
19620 0 : if (py_dependencies == Py_None) {
19621 0 : r->in.dependencies = NULL;
19622 : } else {
19623 0 : r->in.dependencies = NULL;
19624 : {
19625 : const char *test_str;
19626 : const char *talloc_str;
19627 0 : PyObject *unicode = NULL;
19628 0 : if (PyUnicode_Check(py_dependencies)) {
19629 0 : unicode = PyUnicode_AsEncodedString(py_dependencies, "utf-8", "ignore");
19630 0 : if (unicode == NULL) {
19631 0 : PyErr_NoMemory();
19632 0 : return false;
19633 : }
19634 0 : test_str = PyBytes_AS_STRING(unicode);
19635 0 : } else if (PyBytes_Check(py_dependencies)) {
19636 0 : test_str = PyBytes_AS_STRING(py_dependencies);
19637 : } else {
19638 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dependencies)->tp_name);
19639 0 : return false;
19640 : }
19641 0 : talloc_str = talloc_strdup(r, test_str);
19642 0 : if (unicode != NULL) {
19643 0 : Py_DECREF(unicode);
19644 : }
19645 0 : if (talloc_str == NULL) {
19646 0 : PyErr_NoMemory();
19647 0 : return false;
19648 : }
19649 0 : r->in.dependencies = talloc_str;
19650 : }
19651 : }
19652 0 : if (py_service_start_name == NULL) {
19653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_start_name");
19654 0 : return false;
19655 : }
19656 0 : if (py_service_start_name == Py_None) {
19657 0 : r->in.service_start_name = NULL;
19658 : } else {
19659 0 : r->in.service_start_name = NULL;
19660 : {
19661 : const char *test_str;
19662 : const char *talloc_str;
19663 0 : PyObject *unicode = NULL;
19664 0 : if (PyUnicode_Check(py_service_start_name)) {
19665 0 : unicode = PyUnicode_AsEncodedString(py_service_start_name, "utf-8", "ignore");
19666 0 : if (unicode == NULL) {
19667 0 : PyErr_NoMemory();
19668 0 : return false;
19669 : }
19670 0 : test_str = PyBytes_AS_STRING(unicode);
19671 0 : } else if (PyBytes_Check(py_service_start_name)) {
19672 0 : test_str = PyBytes_AS_STRING(py_service_start_name);
19673 : } else {
19674 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_start_name)->tp_name);
19675 0 : return false;
19676 : }
19677 0 : talloc_str = talloc_strdup(r, test_str);
19678 0 : if (unicode != NULL) {
19679 0 : Py_DECREF(unicode);
19680 : }
19681 0 : if (talloc_str == NULL) {
19682 0 : PyErr_NoMemory();
19683 0 : return false;
19684 : }
19685 0 : r->in.service_start_name = talloc_str;
19686 : }
19687 : }
19688 0 : if (py_password == NULL) {
19689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
19690 0 : return false;
19691 : }
19692 0 : if (py_password == Py_None) {
19693 0 : r->in.password = NULL;
19694 : } else {
19695 0 : r->in.password = NULL;
19696 : {
19697 : const char *test_str;
19698 : const char *talloc_str;
19699 0 : PyObject *unicode = NULL;
19700 0 : if (PyUnicode_Check(py_password)) {
19701 0 : unicode = PyUnicode_AsEncodedString(py_password, "utf-8", "ignore");
19702 0 : if (unicode == NULL) {
19703 0 : PyErr_NoMemory();
19704 0 : return false;
19705 : }
19706 0 : test_str = PyBytes_AS_STRING(unicode);
19707 0 : } else if (PyBytes_Check(py_password)) {
19708 0 : test_str = PyBytes_AS_STRING(py_password);
19709 : } else {
19710 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_password)->tp_name);
19711 0 : return false;
19712 : }
19713 0 : talloc_str = talloc_strdup(r, test_str);
19714 0 : if (unicode != NULL) {
19715 0 : Py_DECREF(unicode);
19716 : }
19717 0 : if (talloc_str == NULL) {
19718 0 : PyErr_NoMemory();
19719 0 : return false;
19720 : }
19721 0 : r->in.password = talloc_str;
19722 : }
19723 : }
19724 0 : return true;
19725 : }
19726 :
19727 0 : static PyObject *unpack_py_svcctl_CreateServiceA_args_out(struct svcctl_CreateServiceA *r)
19728 : {
19729 : PyObject *result;
19730 : PyObject *py_TagId;
19731 0 : if (r->out.TagId == NULL) {
19732 0 : py_TagId = Py_None;
19733 0 : Py_INCREF(py_TagId);
19734 : } else {
19735 0 : py_TagId = PyLong_FromUnsignedLongLong((uint32_t)*r->out.TagId);
19736 : }
19737 0 : result = py_TagId;
19738 0 : if (!W_ERROR_IS_OK(r->out.result)) {
19739 0 : PyErr_SetWERROR(r->out.result);
19740 0 : return NULL;
19741 : }
19742 :
19743 0 : return result;
19744 : }
19745 :
19746 :
19747 0 : static PyObject *py_svcctl_EnumDependentServicesA_in_get_service(PyObject *obj, void *closure)
19748 : {
19749 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
19750 : PyObject *py_service;
19751 0 : if (object->in.service == NULL) {
19752 0 : Py_RETURN_NONE;
19753 : }
19754 0 : py_service = pytalloc_reference_ex(policy_handle_Type, object->in.service, object->in.service);
19755 0 : return py_service;
19756 : }
19757 :
19758 0 : static int py_svcctl_EnumDependentServicesA_in_set_service(PyObject *py_obj, PyObject *value, void *closure)
19759 : {
19760 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
19761 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.service));
19762 0 : if (value == NULL) {
19763 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service");
19764 0 : return -1;
19765 : }
19766 0 : object->in.service = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.service);
19767 0 : if (object->in.service == NULL) {
19768 0 : PyErr_NoMemory();
19769 0 : return -1;
19770 : }
19771 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19772 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19773 0 : PyErr_NoMemory();
19774 0 : return -1;
19775 : }
19776 0 : object->in.service = (struct policy_handle *)pytalloc_get_ptr(value);
19777 0 : return 0;
19778 : }
19779 :
19780 0 : static PyObject *py_svcctl_EnumDependentServicesA_in_get_state(PyObject *obj, void *closure)
19781 : {
19782 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
19783 : PyObject *py_state;
19784 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
19785 0 : return py_state;
19786 : }
19787 :
19788 0 : static int py_svcctl_EnumDependentServicesA_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
19789 : {
19790 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
19791 0 : if (value == NULL) {
19792 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
19793 0 : return -1;
19794 : }
19795 : {
19796 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
19797 0 : if (PyLong_Check(value)) {
19798 : unsigned long long test_var;
19799 0 : test_var = PyLong_AsUnsignedLongLong(value);
19800 0 : if (PyErr_Occurred() != NULL) {
19801 0 : return -1;
19802 : }
19803 0 : if (test_var > uint_max) {
19804 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19805 : PyLong_Type.tp_name, uint_max, test_var);
19806 0 : return -1;
19807 : }
19808 0 : object->in.state = test_var;
19809 : } else {
19810 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19811 : PyLong_Type.tp_name);
19812 0 : return -1;
19813 : }
19814 : }
19815 0 : return 0;
19816 : }
19817 :
19818 0 : static PyObject *py_svcctl_EnumDependentServicesA_out_get_service_status(PyObject *obj, void *closure)
19819 : {
19820 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
19821 : PyObject *py_service_status;
19822 0 : if (object->out.service_status == NULL) {
19823 0 : Py_RETURN_NONE;
19824 : }
19825 0 : if (object->out.service_status == NULL) {
19826 0 : py_service_status = Py_None;
19827 0 : Py_INCREF(py_service_status);
19828 : } else {
19829 0 : py_service_status = pytalloc_reference_ex(&ENUM_SERVICE_STATUSA_Type, object->out.service_status, object->out.service_status);
19830 : }
19831 0 : return py_service_status;
19832 : }
19833 :
19834 0 : static int py_svcctl_EnumDependentServicesA_out_set_service_status(PyObject *py_obj, PyObject *value, void *closure)
19835 : {
19836 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
19837 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_status));
19838 0 : if (value == NULL) {
19839 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_status");
19840 0 : return -1;
19841 : }
19842 0 : if (value == Py_None) {
19843 0 : object->out.service_status = NULL;
19844 : } else {
19845 0 : object->out.service_status = NULL;
19846 0 : PY_CHECK_TYPE(&ENUM_SERVICE_STATUSA_Type, value, return -1;);
19847 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19848 0 : PyErr_NoMemory();
19849 0 : return -1;
19850 : }
19851 0 : object->out.service_status = (struct ENUM_SERVICE_STATUSA *)pytalloc_get_ptr(value);
19852 : }
19853 0 : return 0;
19854 : }
19855 :
19856 0 : static PyObject *py_svcctl_EnumDependentServicesA_in_get_offered(PyObject *obj, void *closure)
19857 : {
19858 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
19859 : PyObject *py_offered;
19860 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
19861 0 : return py_offered;
19862 : }
19863 :
19864 0 : static int py_svcctl_EnumDependentServicesA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
19865 : {
19866 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
19867 0 : if (value == NULL) {
19868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
19869 0 : return -1;
19870 : }
19871 : {
19872 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
19873 0 : if (PyLong_Check(value)) {
19874 : unsigned long long test_var;
19875 0 : test_var = PyLong_AsUnsignedLongLong(value);
19876 0 : if (PyErr_Occurred() != NULL) {
19877 0 : return -1;
19878 : }
19879 0 : if (test_var > uint_max) {
19880 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19881 : PyLong_Type.tp_name, uint_max, test_var);
19882 0 : return -1;
19883 : }
19884 0 : object->in.offered = test_var;
19885 : } else {
19886 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19887 : PyLong_Type.tp_name);
19888 0 : return -1;
19889 : }
19890 : }
19891 0 : return 0;
19892 : }
19893 :
19894 0 : static PyObject *py_svcctl_EnumDependentServicesA_out_get_needed(PyObject *obj, void *closure)
19895 : {
19896 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
19897 : PyObject *py_needed;
19898 0 : if (object->out.needed == NULL) {
19899 0 : Py_RETURN_NONE;
19900 : }
19901 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
19902 0 : return py_needed;
19903 : }
19904 :
19905 0 : static int py_svcctl_EnumDependentServicesA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
19906 : {
19907 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
19908 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
19909 0 : if (value == NULL) {
19910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
19911 0 : return -1;
19912 : }
19913 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
19914 0 : if (object->out.needed == NULL) {
19915 0 : PyErr_NoMemory();
19916 0 : return -1;
19917 : }
19918 : {
19919 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
19920 0 : if (PyLong_Check(value)) {
19921 : unsigned long long test_var;
19922 0 : test_var = PyLong_AsUnsignedLongLong(value);
19923 0 : if (PyErr_Occurred() != NULL) {
19924 0 : return -1;
19925 : }
19926 0 : if (test_var > uint_max) {
19927 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19928 : PyLong_Type.tp_name, uint_max, test_var);
19929 0 : return -1;
19930 : }
19931 0 : *object->out.needed = test_var;
19932 : } else {
19933 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19934 : PyLong_Type.tp_name);
19935 0 : return -1;
19936 : }
19937 : }
19938 0 : return 0;
19939 : }
19940 :
19941 0 : static PyObject *py_svcctl_EnumDependentServicesA_out_get_services_returned(PyObject *obj, void *closure)
19942 : {
19943 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
19944 : PyObject *py_services_returned;
19945 0 : if (object->out.services_returned == NULL) {
19946 0 : Py_RETURN_NONE;
19947 : }
19948 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
19949 0 : return py_services_returned;
19950 : }
19951 :
19952 0 : static int py_svcctl_EnumDependentServicesA_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
19953 : {
19954 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
19955 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
19956 0 : if (value == NULL) {
19957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
19958 0 : return -1;
19959 : }
19960 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
19961 0 : if (object->out.services_returned == NULL) {
19962 0 : PyErr_NoMemory();
19963 0 : return -1;
19964 : }
19965 : {
19966 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
19967 0 : if (PyLong_Check(value)) {
19968 : unsigned long long test_var;
19969 0 : test_var = PyLong_AsUnsignedLongLong(value);
19970 0 : if (PyErr_Occurred() != NULL) {
19971 0 : return -1;
19972 : }
19973 0 : if (test_var > uint_max) {
19974 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19975 : PyLong_Type.tp_name, uint_max, test_var);
19976 0 : return -1;
19977 : }
19978 0 : *object->out.services_returned = test_var;
19979 : } else {
19980 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19981 : PyLong_Type.tp_name);
19982 0 : return -1;
19983 : }
19984 : }
19985 0 : return 0;
19986 : }
19987 :
19988 0 : static PyObject *py_svcctl_EnumDependentServicesA_get_result(PyObject *obj, void *closure)
19989 : {
19990 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(obj);
19991 : PyObject *py_result;
19992 0 : py_result = PyErr_FromWERROR(object->out.result);
19993 0 : return py_result;
19994 : }
19995 :
19996 0 : static int py_svcctl_EnumDependentServicesA_set_result(PyObject *py_obj, PyObject *value, void *closure)
19997 : {
19998 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
19999 0 : if (value == NULL) {
20000 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20001 0 : return -1;
20002 : }
20003 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
20004 0 : return 0;
20005 : }
20006 :
20007 : static PyGetSetDef py_svcctl_EnumDependentServicesA_getsetters[] = {
20008 : {
20009 : .name = discard_const_p(char, "in_service"),
20010 : .get = py_svcctl_EnumDependentServicesA_in_get_service,
20011 : .set = py_svcctl_EnumDependentServicesA_in_set_service,
20012 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20013 : },
20014 : {
20015 : .name = discard_const_p(char, "in_state"),
20016 : .get = py_svcctl_EnumDependentServicesA_in_get_state,
20017 : .set = py_svcctl_EnumDependentServicesA_in_set_state,
20018 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
20019 : },
20020 : {
20021 : .name = discard_const_p(char, "out_service_status"),
20022 : .get = py_svcctl_EnumDependentServicesA_out_get_service_status,
20023 : .set = py_svcctl_EnumDependentServicesA_out_set_service_status,
20024 : .doc = discard_const_p(char, "PIDL-generated element of base type ENUM_SERVICE_STATUSA")
20025 : },
20026 : {
20027 : .name = discard_const_p(char, "in_offered"),
20028 : .get = py_svcctl_EnumDependentServicesA_in_get_offered,
20029 : .set = py_svcctl_EnumDependentServicesA_in_set_offered,
20030 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20031 : },
20032 : {
20033 : .name = discard_const_p(char, "out_needed"),
20034 : .get = py_svcctl_EnumDependentServicesA_out_get_needed,
20035 : .set = py_svcctl_EnumDependentServicesA_out_set_needed,
20036 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20037 : },
20038 : {
20039 : .name = discard_const_p(char, "out_services_returned"),
20040 : .get = py_svcctl_EnumDependentServicesA_out_get_services_returned,
20041 : .set = py_svcctl_EnumDependentServicesA_out_set_services_returned,
20042 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20043 : },
20044 : {
20045 : .name = discard_const_p(char, "result"),
20046 : .get = py_svcctl_EnumDependentServicesA_get_result,
20047 : .set = py_svcctl_EnumDependentServicesA_set_result,
20048 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
20049 : },
20050 : { .name = NULL }
20051 : };
20052 :
20053 0 : static PyObject *py_svcctl_EnumDependentServicesA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20054 : {
20055 0 : PyObject *self = pytalloc_new(struct svcctl_EnumDependentServicesA, type);
20056 0 : struct svcctl_EnumDependentServicesA *_self = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(self);
20057 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20058 0 : _self->in.service = talloc_zero(mem_ctx, struct policy_handle);
20059 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
20060 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
20061 0 : return self;
20062 : }
20063 :
20064 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20065 : {
20066 :
20067 :
20068 0 : return PyLong_FromLong(25);
20069 : }
20070 :
20071 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
20072 : {
20073 0 : const struct ndr_interface_call *call = NULL;
20074 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
20075 0 : PyObject *ret = NULL;
20076 0 : struct ndr_push *push = NULL;
20077 : DATA_BLOB blob;
20078 : enum ndr_err_code err;
20079 :
20080 0 : if (ndr_table_svcctl.num_calls < 26) {
20081 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesA_ndr_pack");
20082 0 : return NULL;
20083 : }
20084 0 : call = &ndr_table_svcctl.calls[25];
20085 :
20086 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20087 0 : if (push == NULL) {
20088 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20089 0 : return NULL;
20090 : }
20091 :
20092 0 : push->flags |= ndr_push_flags;
20093 :
20094 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20095 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20096 0 : TALLOC_FREE(push);
20097 0 : PyErr_SetNdrError(err);
20098 0 : return NULL;
20099 : }
20100 0 : blob = ndr_push_blob(push);
20101 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20102 0 : TALLOC_FREE(push);
20103 0 : return ret;
20104 : }
20105 :
20106 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20107 : {
20108 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20109 0 : PyObject *bigendian_obj = NULL;
20110 0 : PyObject *ndr64_obj = NULL;
20111 0 : uint32_t ndr_push_flags = 0;
20112 :
20113 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20114 : discard_const_p(char *, kwnames),
20115 : &bigendian_obj,
20116 : &ndr64_obj)) {
20117 0 : return NULL;
20118 : }
20119 :
20120 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20121 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20122 : }
20123 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20124 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20125 : }
20126 :
20127 0 : return py_svcctl_EnumDependentServicesA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20128 : }
20129 :
20130 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20131 : {
20132 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20133 0 : PyObject *bigendian_obj = NULL;
20134 0 : PyObject *ndr64_obj = NULL;
20135 0 : uint32_t ndr_push_flags = 0;
20136 :
20137 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20138 : discard_const_p(char *, kwnames),
20139 : &bigendian_obj,
20140 : &ndr64_obj)) {
20141 0 : return NULL;
20142 : }
20143 :
20144 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20145 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20146 : }
20147 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20148 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20149 : }
20150 :
20151 0 : return py_svcctl_EnumDependentServicesA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20152 : }
20153 :
20154 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
20155 : {
20156 0 : const struct ndr_interface_call *call = NULL;
20157 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
20158 0 : struct ndr_pull *pull = NULL;
20159 : enum ndr_err_code err;
20160 :
20161 0 : if (ndr_table_svcctl.num_calls < 26) {
20162 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesA_ndr_unpack");
20163 0 : return NULL;
20164 : }
20165 0 : call = &ndr_table_svcctl.calls[25];
20166 :
20167 0 : pull = ndr_pull_init_blob(blob, object);
20168 0 : if (pull == NULL) {
20169 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20170 0 : return NULL;
20171 : }
20172 :
20173 0 : pull->flags |= ndr_pull_flags;
20174 :
20175 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20176 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20177 0 : TALLOC_FREE(pull);
20178 0 : PyErr_SetNdrError(err);
20179 0 : return NULL;
20180 : }
20181 0 : if (!allow_remaining) {
20182 : uint32_t highest_ofs;
20183 :
20184 0 : if (pull->offset > pull->relative_highest_offset) {
20185 0 : highest_ofs = pull->offset;
20186 : } else {
20187 0 : highest_ofs = pull->relative_highest_offset;
20188 : }
20189 0 : if (highest_ofs < pull->data_size) {
20190 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20191 : "not all bytes consumed ofs[%u] size[%u]",
20192 : highest_ofs, pull->data_size);
20193 0 : TALLOC_FREE(pull);
20194 0 : PyErr_SetNdrError(err);
20195 0 : return NULL;
20196 : }
20197 : }
20198 :
20199 0 : TALLOC_FREE(pull);
20200 0 : Py_RETURN_NONE;
20201 : }
20202 :
20203 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20204 : {
20205 : DATA_BLOB blob;
20206 0 : Py_ssize_t blob_length = 0;
20207 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20208 0 : PyObject *bigendian_obj = NULL;
20209 0 : PyObject *ndr64_obj = NULL;
20210 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20211 0 : PyObject *allow_remaining_obj = NULL;
20212 0 : bool allow_remaining = false;
20213 :
20214 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20215 : discard_const_p(char *, kwnames),
20216 : &blob.data, &blob_length,
20217 : &bigendian_obj,
20218 : &ndr64_obj,
20219 : &allow_remaining_obj)) {
20220 0 : return NULL;
20221 : }
20222 0 : blob.length = blob_length;
20223 :
20224 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20225 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20226 : }
20227 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20228 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20229 : }
20230 :
20231 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20232 0 : allow_remaining = true;
20233 : }
20234 :
20235 0 : return py_svcctl_EnumDependentServicesA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20236 : }
20237 :
20238 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20239 : {
20240 : DATA_BLOB blob;
20241 0 : Py_ssize_t blob_length = 0;
20242 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20243 0 : PyObject *bigendian_obj = NULL;
20244 0 : PyObject *ndr64_obj = NULL;
20245 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20246 0 : PyObject *allow_remaining_obj = NULL;
20247 0 : bool allow_remaining = false;
20248 :
20249 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20250 : discard_const_p(char *, kwnames),
20251 : &blob.data, &blob_length,
20252 : &bigendian_obj,
20253 : &ndr64_obj,
20254 : &allow_remaining_obj)) {
20255 0 : return NULL;
20256 : }
20257 0 : blob.length = blob_length;
20258 :
20259 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20260 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20261 : }
20262 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20263 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20264 : }
20265 :
20266 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20267 0 : allow_remaining = true;
20268 : }
20269 :
20270 0 : return py_svcctl_EnumDependentServicesA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20271 : }
20272 :
20273 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
20274 : {
20275 0 : const struct ndr_interface_call *call = NULL;
20276 0 : struct svcctl_EnumDependentServicesA *object = (struct svcctl_EnumDependentServicesA *)pytalloc_get_ptr(py_obj);
20277 : PyObject *ret;
20278 : char *retstr;
20279 :
20280 0 : if (ndr_table_svcctl.num_calls < 26) {
20281 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumDependentServicesA_ndr_print");
20282 0 : return NULL;
20283 : }
20284 0 : call = &ndr_table_svcctl.calls[25];
20285 :
20286 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20287 0 : ret = PyUnicode_FromString(retstr);
20288 0 : TALLOC_FREE(retstr);
20289 :
20290 0 : return ret;
20291 : }
20292 :
20293 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20294 : {
20295 0 : return py_svcctl_EnumDependentServicesA_ndr_print(py_obj, "svcctl_EnumDependentServicesA_in", NDR_IN);
20296 : }
20297 :
20298 0 : static PyObject *py_svcctl_EnumDependentServicesA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20299 : {
20300 0 : return py_svcctl_EnumDependentServicesA_ndr_print(py_obj, "svcctl_EnumDependentServicesA_out", NDR_OUT);
20301 : }
20302 :
20303 : static PyMethodDef py_svcctl_EnumDependentServicesA_methods[] = {
20304 : { "opnum", (PyCFunction)py_svcctl_EnumDependentServicesA_ndr_opnum, METH_NOARGS|METH_CLASS,
20305 : "svcctl.EnumDependentServicesA.opnum() -> 25 (0x19) " },
20306 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20307 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20308 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20309 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20310 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20311 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20312 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumDependentServicesA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20313 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20314 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumDependentServicesA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20315 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumDependentServicesA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20316 : { NULL, NULL, 0, NULL }
20317 : };
20318 :
20319 :
20320 : static PyTypeObject svcctl_EnumDependentServicesA_Type = {
20321 : PyVarObject_HEAD_INIT(NULL, 0)
20322 : .tp_name = "svcctl.EnumDependentServicesA",
20323 : .tp_getset = py_svcctl_EnumDependentServicesA_getsetters,
20324 : .tp_methods = py_svcctl_EnumDependentServicesA_methods,
20325 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20326 : .tp_new = py_svcctl_EnumDependentServicesA_new,
20327 : };
20328 :
20329 0 : static bool pack_py_svcctl_EnumDependentServicesA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumDependentServicesA *r)
20330 : {
20331 : PyObject *py_service;
20332 : PyObject *py_state;
20333 : PyObject *py_offered;
20334 0 : const char *kwnames[] = {
20335 : "service", "state", "offered", NULL
20336 : };
20337 :
20338 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_EnumDependentServicesA", discard_const_p(char *, kwnames), &py_service, &py_state, &py_offered)) {
20339 0 : return false;
20340 : }
20341 :
20342 0 : if (py_service == NULL) {
20343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service");
20344 0 : return false;
20345 : }
20346 0 : r->in.service = talloc_ptrtype(r, r->in.service);
20347 0 : if (r->in.service == NULL) {
20348 0 : PyErr_NoMemory();
20349 0 : return false;
20350 : }
20351 0 : PY_CHECK_TYPE(policy_handle_Type, py_service, return false;);
20352 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_service)) == NULL) {
20353 0 : PyErr_NoMemory();
20354 0 : return false;
20355 : }
20356 0 : r->in.service = (struct policy_handle *)pytalloc_get_ptr(py_service);
20357 0 : if (py_state == NULL) {
20358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
20359 0 : return false;
20360 : }
20361 : {
20362 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
20363 0 : if (PyLong_Check(py_state)) {
20364 : unsigned long long test_var;
20365 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
20366 0 : if (PyErr_Occurred() != NULL) {
20367 0 : return false;
20368 : }
20369 0 : if (test_var > uint_max) {
20370 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20371 : PyLong_Type.tp_name, uint_max, test_var);
20372 0 : return false;
20373 : }
20374 0 : r->in.state = test_var;
20375 : } else {
20376 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20377 : PyLong_Type.tp_name);
20378 0 : return false;
20379 : }
20380 : }
20381 0 : if (py_offered == NULL) {
20382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
20383 0 : return false;
20384 : }
20385 : {
20386 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
20387 0 : if (PyLong_Check(py_offered)) {
20388 : unsigned long long test_var;
20389 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
20390 0 : if (PyErr_Occurred() != NULL) {
20391 0 : return false;
20392 : }
20393 0 : if (test_var > uint_max) {
20394 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20395 : PyLong_Type.tp_name, uint_max, test_var);
20396 0 : return false;
20397 : }
20398 0 : r->in.offered = test_var;
20399 : } else {
20400 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20401 : PyLong_Type.tp_name);
20402 0 : return false;
20403 : }
20404 : }
20405 0 : return true;
20406 : }
20407 :
20408 0 : static PyObject *unpack_py_svcctl_EnumDependentServicesA_args_out(struct svcctl_EnumDependentServicesA *r)
20409 : {
20410 : PyObject *result;
20411 : PyObject *py_service_status;
20412 : PyObject *py_needed;
20413 : PyObject *py_services_returned;
20414 0 : result = PyTuple_New(3);
20415 0 : if (r->out.service_status == NULL) {
20416 0 : py_service_status = Py_None;
20417 0 : Py_INCREF(py_service_status);
20418 : } else {
20419 0 : py_service_status = pytalloc_reference_ex(&ENUM_SERVICE_STATUSA_Type, r->out.service_status, r->out.service_status);
20420 : }
20421 0 : PyTuple_SetItem(result, 0, py_service_status);
20422 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
20423 0 : PyTuple_SetItem(result, 1, py_needed);
20424 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
20425 0 : PyTuple_SetItem(result, 2, py_services_returned);
20426 0 : if (!W_ERROR_IS_OK(r->out.result)) {
20427 0 : PyErr_SetWERROR(r->out.result);
20428 0 : return NULL;
20429 : }
20430 :
20431 0 : return result;
20432 : }
20433 :
20434 :
20435 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_handle(PyObject *obj, void *closure)
20436 : {
20437 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20438 : PyObject *py_handle;
20439 0 : if (object->in.handle == NULL) {
20440 0 : Py_RETURN_NONE;
20441 : }
20442 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20443 0 : return py_handle;
20444 : }
20445 :
20446 0 : static int py_svcctl_EnumServicesStatusA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20447 : {
20448 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20449 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20450 0 : if (value == NULL) {
20451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
20452 0 : return -1;
20453 : }
20454 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20455 0 : if (object->in.handle == NULL) {
20456 0 : PyErr_NoMemory();
20457 0 : return -1;
20458 : }
20459 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20460 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20461 0 : PyErr_NoMemory();
20462 0 : return -1;
20463 : }
20464 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20465 0 : return 0;
20466 : }
20467 :
20468 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_type(PyObject *obj, void *closure)
20469 : {
20470 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20471 : PyObject *py_type;
20472 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
20473 0 : return py_type;
20474 : }
20475 :
20476 0 : static int py_svcctl_EnumServicesStatusA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
20477 : {
20478 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20479 0 : if (value == NULL) {
20480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
20481 0 : return -1;
20482 : }
20483 : {
20484 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
20485 0 : if (PyLong_Check(value)) {
20486 : unsigned long long test_var;
20487 0 : test_var = PyLong_AsUnsignedLongLong(value);
20488 0 : if (PyErr_Occurred() != NULL) {
20489 0 : return -1;
20490 : }
20491 0 : if (test_var > uint_max) {
20492 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20493 : PyLong_Type.tp_name, uint_max, test_var);
20494 0 : return -1;
20495 : }
20496 0 : object->in.type = test_var;
20497 : } else {
20498 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20499 : PyLong_Type.tp_name);
20500 0 : return -1;
20501 : }
20502 : }
20503 0 : return 0;
20504 : }
20505 :
20506 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_state(PyObject *obj, void *closure)
20507 : {
20508 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20509 : PyObject *py_state;
20510 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
20511 0 : return py_state;
20512 : }
20513 :
20514 0 : static int py_svcctl_EnumServicesStatusA_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
20515 : {
20516 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20517 0 : if (value == NULL) {
20518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
20519 0 : return -1;
20520 : }
20521 : {
20522 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
20523 0 : if (PyLong_Check(value)) {
20524 : unsigned long long test_var;
20525 0 : test_var = PyLong_AsUnsignedLongLong(value);
20526 0 : if (PyErr_Occurred() != NULL) {
20527 0 : return -1;
20528 : }
20529 0 : if (test_var > uint_max) {
20530 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20531 : PyLong_Type.tp_name, uint_max, test_var);
20532 0 : return -1;
20533 : }
20534 0 : object->in.state = test_var;
20535 : } else {
20536 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20537 : PyLong_Type.tp_name);
20538 0 : return -1;
20539 : }
20540 : }
20541 0 : return 0;
20542 : }
20543 :
20544 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_offered(PyObject *obj, void *closure)
20545 : {
20546 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20547 : PyObject *py_offered;
20548 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
20549 0 : return py_offered;
20550 : }
20551 :
20552 0 : static int py_svcctl_EnumServicesStatusA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
20553 : {
20554 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20555 0 : if (value == NULL) {
20556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
20557 0 : return -1;
20558 : }
20559 : {
20560 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
20561 0 : if (PyLong_Check(value)) {
20562 : unsigned long long test_var;
20563 0 : test_var = PyLong_AsUnsignedLongLong(value);
20564 0 : if (PyErr_Occurred() != NULL) {
20565 0 : return -1;
20566 : }
20567 0 : if (test_var > uint_max) {
20568 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20569 : PyLong_Type.tp_name, uint_max, test_var);
20570 0 : return -1;
20571 : }
20572 0 : object->in.offered = test_var;
20573 : } else {
20574 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20575 : PyLong_Type.tp_name);
20576 0 : return -1;
20577 : }
20578 : }
20579 0 : return 0;
20580 : }
20581 :
20582 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_service(PyObject *obj, void *closure)
20583 : {
20584 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20585 : PyObject *py_service;
20586 0 : py_service = PyList_New(object->in.offered);
20587 0 : if (py_service == NULL) {
20588 0 : return NULL;
20589 : }
20590 : {
20591 : int service_cntr_0;
20592 0 : for (service_cntr_0 = 0; service_cntr_0 < (object->in.offered); service_cntr_0++) {
20593 : PyObject *py_service_0;
20594 0 : py_service_0 = PyLong_FromLong((uint16_t)object->out.service[service_cntr_0]);
20595 0 : PyList_SetItem(py_service, service_cntr_0, py_service_0);
20596 : }
20597 : }
20598 0 : return py_service;
20599 : }
20600 :
20601 0 : static int py_svcctl_EnumServicesStatusA_out_set_service(PyObject *py_obj, PyObject *value, void *closure)
20602 : {
20603 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20604 0 : if (value == NULL) {
20605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service");
20606 0 : return -1;
20607 : }
20608 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
20609 : {
20610 : int service_cntr_0;
20611 0 : object->out.service = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service, PyList_GET_SIZE(value));
20612 0 : if (!object->out.service) { return -1;; }
20613 0 : talloc_set_name_const(object->out.service, "ARRAY: object->out.service");
20614 0 : for (service_cntr_0 = 0; service_cntr_0 < PyList_GET_SIZE(value); service_cntr_0++) {
20615 0 : if (PyList_GET_ITEM(value, service_cntr_0) == NULL) {
20616 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service[service_cntr_0]");
20617 0 : return -1;
20618 : }
20619 : {
20620 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.service[service_cntr_0]));
20621 0 : if (PyLong_Check(PyList_GET_ITEM(value, service_cntr_0))) {
20622 : unsigned long long test_var;
20623 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, service_cntr_0));
20624 0 : if (PyErr_Occurred() != NULL) {
20625 0 : return -1;
20626 : }
20627 0 : if (test_var > uint_max) {
20628 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20629 : PyLong_Type.tp_name, uint_max, test_var);
20630 0 : return -1;
20631 : }
20632 0 : object->out.service[service_cntr_0] = test_var;
20633 : } else {
20634 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20635 : PyLong_Type.tp_name);
20636 0 : return -1;
20637 : }
20638 : }
20639 : }
20640 : }
20641 0 : return 0;
20642 : }
20643 :
20644 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_needed(PyObject *obj, void *closure)
20645 : {
20646 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20647 : PyObject *py_needed;
20648 0 : if (object->out.needed == NULL) {
20649 0 : Py_RETURN_NONE;
20650 : }
20651 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
20652 0 : return py_needed;
20653 : }
20654 :
20655 0 : static int py_svcctl_EnumServicesStatusA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
20656 : {
20657 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20658 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
20659 0 : if (value == NULL) {
20660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
20661 0 : return -1;
20662 : }
20663 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
20664 0 : if (object->out.needed == NULL) {
20665 0 : PyErr_NoMemory();
20666 0 : return -1;
20667 : }
20668 : {
20669 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
20670 0 : if (PyLong_Check(value)) {
20671 : unsigned long long test_var;
20672 0 : test_var = PyLong_AsUnsignedLongLong(value);
20673 0 : if (PyErr_Occurred() != NULL) {
20674 0 : return -1;
20675 : }
20676 0 : if (test_var > uint_max) {
20677 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20678 : PyLong_Type.tp_name, uint_max, test_var);
20679 0 : return -1;
20680 : }
20681 0 : *object->out.needed = test_var;
20682 : } else {
20683 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20684 : PyLong_Type.tp_name);
20685 0 : return -1;
20686 : }
20687 : }
20688 0 : return 0;
20689 : }
20690 :
20691 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_services_returned(PyObject *obj, void *closure)
20692 : {
20693 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20694 : PyObject *py_services_returned;
20695 0 : if (object->out.services_returned == NULL) {
20696 0 : Py_RETURN_NONE;
20697 : }
20698 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.services_returned);
20699 0 : return py_services_returned;
20700 : }
20701 :
20702 0 : static int py_svcctl_EnumServicesStatusA_out_set_services_returned(PyObject *py_obj, PyObject *value, void *closure)
20703 : {
20704 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20705 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services_returned));
20706 0 : if (value == NULL) {
20707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services_returned");
20708 0 : return -1;
20709 : }
20710 0 : object->out.services_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services_returned);
20711 0 : if (object->out.services_returned == NULL) {
20712 0 : PyErr_NoMemory();
20713 0 : return -1;
20714 : }
20715 : {
20716 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.services_returned));
20717 0 : if (PyLong_Check(value)) {
20718 : unsigned long long test_var;
20719 0 : test_var = PyLong_AsUnsignedLongLong(value);
20720 0 : if (PyErr_Occurred() != NULL) {
20721 0 : return -1;
20722 : }
20723 0 : if (test_var > uint_max) {
20724 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20725 : PyLong_Type.tp_name, uint_max, test_var);
20726 0 : return -1;
20727 : }
20728 0 : *object->out.services_returned = test_var;
20729 : } else {
20730 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20731 : PyLong_Type.tp_name);
20732 0 : return -1;
20733 : }
20734 : }
20735 0 : return 0;
20736 : }
20737 :
20738 0 : static PyObject *py_svcctl_EnumServicesStatusA_in_get_resume_handle(PyObject *obj, void *closure)
20739 : {
20740 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20741 : PyObject *py_resume_handle;
20742 0 : if (object->in.resume_handle == NULL) {
20743 0 : Py_RETURN_NONE;
20744 : }
20745 0 : if (object->in.resume_handle == NULL) {
20746 0 : py_resume_handle = Py_None;
20747 0 : Py_INCREF(py_resume_handle);
20748 : } else {
20749 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
20750 : }
20751 0 : return py_resume_handle;
20752 : }
20753 :
20754 0 : static int py_svcctl_EnumServicesStatusA_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
20755 : {
20756 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20757 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
20758 0 : if (value == NULL) {
20759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
20760 0 : return -1;
20761 : }
20762 0 : if (value == Py_None) {
20763 0 : object->in.resume_handle = NULL;
20764 : } else {
20765 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
20766 0 : if (object->in.resume_handle == NULL) {
20767 0 : PyErr_NoMemory();
20768 0 : return -1;
20769 : }
20770 : {
20771 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
20772 0 : if (PyLong_Check(value)) {
20773 : unsigned long long test_var;
20774 0 : test_var = PyLong_AsUnsignedLongLong(value);
20775 0 : if (PyErr_Occurred() != NULL) {
20776 0 : return -1;
20777 : }
20778 0 : if (test_var > uint_max) {
20779 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20780 : PyLong_Type.tp_name, uint_max, test_var);
20781 0 : return -1;
20782 : }
20783 0 : *object->in.resume_handle = test_var;
20784 : } else {
20785 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20786 : PyLong_Type.tp_name);
20787 0 : return -1;
20788 : }
20789 : }
20790 : }
20791 0 : return 0;
20792 : }
20793 :
20794 0 : static PyObject *py_svcctl_EnumServicesStatusA_out_get_resume_handle(PyObject *obj, void *closure)
20795 : {
20796 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20797 : PyObject *py_resume_handle;
20798 0 : if (object->out.resume_handle == NULL) {
20799 0 : Py_RETURN_NONE;
20800 : }
20801 0 : if (object->out.resume_handle == NULL) {
20802 0 : py_resume_handle = Py_None;
20803 0 : Py_INCREF(py_resume_handle);
20804 : } else {
20805 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
20806 : }
20807 0 : return py_resume_handle;
20808 : }
20809 :
20810 0 : static int py_svcctl_EnumServicesStatusA_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
20811 : {
20812 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20813 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
20814 0 : if (value == NULL) {
20815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
20816 0 : return -1;
20817 : }
20818 0 : if (value == Py_None) {
20819 0 : object->out.resume_handle = NULL;
20820 : } else {
20821 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
20822 0 : if (object->out.resume_handle == NULL) {
20823 0 : PyErr_NoMemory();
20824 0 : return -1;
20825 : }
20826 : {
20827 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
20828 0 : if (PyLong_Check(value)) {
20829 : unsigned long long test_var;
20830 0 : test_var = PyLong_AsUnsignedLongLong(value);
20831 0 : if (PyErr_Occurred() != NULL) {
20832 0 : return -1;
20833 : }
20834 0 : if (test_var > uint_max) {
20835 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20836 : PyLong_Type.tp_name, uint_max, test_var);
20837 0 : return -1;
20838 : }
20839 0 : *object->out.resume_handle = test_var;
20840 : } else {
20841 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20842 : PyLong_Type.tp_name);
20843 0 : return -1;
20844 : }
20845 : }
20846 : }
20847 0 : return 0;
20848 : }
20849 :
20850 0 : static PyObject *py_svcctl_EnumServicesStatusA_get_result(PyObject *obj, void *closure)
20851 : {
20852 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(obj);
20853 : PyObject *py_result;
20854 0 : py_result = PyErr_FromWERROR(object->out.result);
20855 0 : return py_result;
20856 : }
20857 :
20858 0 : static int py_svcctl_EnumServicesStatusA_set_result(PyObject *py_obj, PyObject *value, void *closure)
20859 : {
20860 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20861 0 : if (value == NULL) {
20862 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20863 0 : return -1;
20864 : }
20865 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
20866 0 : return 0;
20867 : }
20868 :
20869 : static PyGetSetDef py_svcctl_EnumServicesStatusA_getsetters[] = {
20870 : {
20871 : .name = discard_const_p(char, "in_handle"),
20872 : .get = py_svcctl_EnumServicesStatusA_in_get_handle,
20873 : .set = py_svcctl_EnumServicesStatusA_in_set_handle,
20874 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20875 : },
20876 : {
20877 : .name = discard_const_p(char, "in_type"),
20878 : .get = py_svcctl_EnumServicesStatusA_in_get_type,
20879 : .set = py_svcctl_EnumServicesStatusA_in_set_type,
20880 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20881 : },
20882 : {
20883 : .name = discard_const_p(char, "in_state"),
20884 : .get = py_svcctl_EnumServicesStatusA_in_get_state,
20885 : .set = py_svcctl_EnumServicesStatusA_in_set_state,
20886 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
20887 : },
20888 : {
20889 : .name = discard_const_p(char, "in_offered"),
20890 : .get = py_svcctl_EnumServicesStatusA_in_get_offered,
20891 : .set = py_svcctl_EnumServicesStatusA_in_set_offered,
20892 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20893 : },
20894 : {
20895 : .name = discard_const_p(char, "out_service"),
20896 : .get = py_svcctl_EnumServicesStatusA_out_get_service,
20897 : .set = py_svcctl_EnumServicesStatusA_out_set_service,
20898 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
20899 : },
20900 : {
20901 : .name = discard_const_p(char, "out_needed"),
20902 : .get = py_svcctl_EnumServicesStatusA_out_get_needed,
20903 : .set = py_svcctl_EnumServicesStatusA_out_set_needed,
20904 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20905 : },
20906 : {
20907 : .name = discard_const_p(char, "out_services_returned"),
20908 : .get = py_svcctl_EnumServicesStatusA_out_get_services_returned,
20909 : .set = py_svcctl_EnumServicesStatusA_out_set_services_returned,
20910 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20911 : },
20912 : {
20913 : .name = discard_const_p(char, "in_resume_handle"),
20914 : .get = py_svcctl_EnumServicesStatusA_in_get_resume_handle,
20915 : .set = py_svcctl_EnumServicesStatusA_in_set_resume_handle,
20916 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20917 : },
20918 : {
20919 : .name = discard_const_p(char, "out_resume_handle"),
20920 : .get = py_svcctl_EnumServicesStatusA_out_get_resume_handle,
20921 : .set = py_svcctl_EnumServicesStatusA_out_set_resume_handle,
20922 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20923 : },
20924 : {
20925 : .name = discard_const_p(char, "result"),
20926 : .get = py_svcctl_EnumServicesStatusA_get_result,
20927 : .set = py_svcctl_EnumServicesStatusA_set_result,
20928 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
20929 : },
20930 : { .name = NULL }
20931 : };
20932 :
20933 0 : static PyObject *py_svcctl_EnumServicesStatusA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20934 : {
20935 0 : PyObject *self = pytalloc_new(struct svcctl_EnumServicesStatusA, type);
20936 0 : struct svcctl_EnumServicesStatusA *_self = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(self);
20937 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20938 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20939 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
20940 0 : _self->out.services_returned = talloc_zero(mem_ctx, uint32_t);
20941 0 : return self;
20942 : }
20943 :
20944 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20945 : {
20946 :
20947 :
20948 0 : return PyLong_FromLong(26);
20949 : }
20950 :
20951 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
20952 : {
20953 0 : const struct ndr_interface_call *call = NULL;
20954 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
20955 0 : PyObject *ret = NULL;
20956 0 : struct ndr_push *push = NULL;
20957 : DATA_BLOB blob;
20958 : enum ndr_err_code err;
20959 :
20960 0 : if (ndr_table_svcctl.num_calls < 27) {
20961 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusA_ndr_pack");
20962 0 : return NULL;
20963 : }
20964 0 : call = &ndr_table_svcctl.calls[26];
20965 :
20966 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20967 0 : if (push == NULL) {
20968 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20969 0 : return NULL;
20970 : }
20971 :
20972 0 : push->flags |= ndr_push_flags;
20973 :
20974 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20975 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20976 0 : TALLOC_FREE(push);
20977 0 : PyErr_SetNdrError(err);
20978 0 : return NULL;
20979 : }
20980 0 : blob = ndr_push_blob(push);
20981 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20982 0 : TALLOC_FREE(push);
20983 0 : return ret;
20984 : }
20985 :
20986 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20987 : {
20988 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20989 0 : PyObject *bigendian_obj = NULL;
20990 0 : PyObject *ndr64_obj = NULL;
20991 0 : uint32_t ndr_push_flags = 0;
20992 :
20993 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20994 : discard_const_p(char *, kwnames),
20995 : &bigendian_obj,
20996 : &ndr64_obj)) {
20997 0 : return NULL;
20998 : }
20999 :
21000 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21001 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21002 : }
21003 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21004 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21005 : }
21006 :
21007 0 : return py_svcctl_EnumServicesStatusA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21008 : }
21009 :
21010 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21011 : {
21012 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21013 0 : PyObject *bigendian_obj = NULL;
21014 0 : PyObject *ndr64_obj = NULL;
21015 0 : uint32_t ndr_push_flags = 0;
21016 :
21017 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21018 : discard_const_p(char *, kwnames),
21019 : &bigendian_obj,
21020 : &ndr64_obj)) {
21021 0 : return NULL;
21022 : }
21023 :
21024 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21025 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21026 : }
21027 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21028 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21029 : }
21030 :
21031 0 : return py_svcctl_EnumServicesStatusA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21032 : }
21033 :
21034 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
21035 : {
21036 0 : const struct ndr_interface_call *call = NULL;
21037 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
21038 0 : struct ndr_pull *pull = NULL;
21039 : enum ndr_err_code err;
21040 :
21041 0 : if (ndr_table_svcctl.num_calls < 27) {
21042 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusA_ndr_unpack");
21043 0 : return NULL;
21044 : }
21045 0 : call = &ndr_table_svcctl.calls[26];
21046 :
21047 0 : pull = ndr_pull_init_blob(blob, object);
21048 0 : if (pull == NULL) {
21049 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21050 0 : return NULL;
21051 : }
21052 :
21053 0 : pull->flags |= ndr_pull_flags;
21054 :
21055 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21056 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21057 0 : TALLOC_FREE(pull);
21058 0 : PyErr_SetNdrError(err);
21059 0 : return NULL;
21060 : }
21061 0 : if (!allow_remaining) {
21062 : uint32_t highest_ofs;
21063 :
21064 0 : if (pull->offset > pull->relative_highest_offset) {
21065 0 : highest_ofs = pull->offset;
21066 : } else {
21067 0 : highest_ofs = pull->relative_highest_offset;
21068 : }
21069 0 : if (highest_ofs < pull->data_size) {
21070 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21071 : "not all bytes consumed ofs[%u] size[%u]",
21072 : highest_ofs, pull->data_size);
21073 0 : TALLOC_FREE(pull);
21074 0 : PyErr_SetNdrError(err);
21075 0 : return NULL;
21076 : }
21077 : }
21078 :
21079 0 : TALLOC_FREE(pull);
21080 0 : Py_RETURN_NONE;
21081 : }
21082 :
21083 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21084 : {
21085 : DATA_BLOB blob;
21086 0 : Py_ssize_t blob_length = 0;
21087 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21088 0 : PyObject *bigendian_obj = NULL;
21089 0 : PyObject *ndr64_obj = NULL;
21090 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21091 0 : PyObject *allow_remaining_obj = NULL;
21092 0 : bool allow_remaining = false;
21093 :
21094 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21095 : discard_const_p(char *, kwnames),
21096 : &blob.data, &blob_length,
21097 : &bigendian_obj,
21098 : &ndr64_obj,
21099 : &allow_remaining_obj)) {
21100 0 : return NULL;
21101 : }
21102 0 : blob.length = blob_length;
21103 :
21104 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21105 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21106 : }
21107 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21108 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21109 : }
21110 :
21111 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21112 0 : allow_remaining = true;
21113 : }
21114 :
21115 0 : return py_svcctl_EnumServicesStatusA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21116 : }
21117 :
21118 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21119 : {
21120 : DATA_BLOB blob;
21121 0 : Py_ssize_t blob_length = 0;
21122 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21123 0 : PyObject *bigendian_obj = NULL;
21124 0 : PyObject *ndr64_obj = NULL;
21125 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21126 0 : PyObject *allow_remaining_obj = NULL;
21127 0 : bool allow_remaining = false;
21128 :
21129 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21130 : discard_const_p(char *, kwnames),
21131 : &blob.data, &blob_length,
21132 : &bigendian_obj,
21133 : &ndr64_obj,
21134 : &allow_remaining_obj)) {
21135 0 : return NULL;
21136 : }
21137 0 : blob.length = blob_length;
21138 :
21139 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21140 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21141 : }
21142 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21143 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21144 : }
21145 :
21146 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21147 0 : allow_remaining = true;
21148 : }
21149 :
21150 0 : return py_svcctl_EnumServicesStatusA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21151 : }
21152 :
21153 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
21154 : {
21155 0 : const struct ndr_interface_call *call = NULL;
21156 0 : struct svcctl_EnumServicesStatusA *object = (struct svcctl_EnumServicesStatusA *)pytalloc_get_ptr(py_obj);
21157 : PyObject *ret;
21158 : char *retstr;
21159 :
21160 0 : if (ndr_table_svcctl.num_calls < 27) {
21161 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_EnumServicesStatusA_ndr_print");
21162 0 : return NULL;
21163 : }
21164 0 : call = &ndr_table_svcctl.calls[26];
21165 :
21166 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21167 0 : ret = PyUnicode_FromString(retstr);
21168 0 : TALLOC_FREE(retstr);
21169 :
21170 0 : return ret;
21171 : }
21172 :
21173 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21174 : {
21175 0 : return py_svcctl_EnumServicesStatusA_ndr_print(py_obj, "svcctl_EnumServicesStatusA_in", NDR_IN);
21176 : }
21177 :
21178 0 : static PyObject *py_svcctl_EnumServicesStatusA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21179 : {
21180 0 : return py_svcctl_EnumServicesStatusA_ndr_print(py_obj, "svcctl_EnumServicesStatusA_out", NDR_OUT);
21181 : }
21182 :
21183 : static PyMethodDef py_svcctl_EnumServicesStatusA_methods[] = {
21184 : { "opnum", (PyCFunction)py_svcctl_EnumServicesStatusA_ndr_opnum, METH_NOARGS|METH_CLASS,
21185 : "svcctl.EnumServicesStatusA.opnum() -> 26 (0x1a) " },
21186 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21187 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21188 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21189 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21190 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21191 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21192 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_EnumServicesStatusA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21193 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21194 : { "__ndr_print_in__", (PyCFunction)py_svcctl_EnumServicesStatusA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21195 : { "__ndr_print_out__", (PyCFunction)py_svcctl_EnumServicesStatusA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21196 : { NULL, NULL, 0, NULL }
21197 : };
21198 :
21199 :
21200 : static PyTypeObject svcctl_EnumServicesStatusA_Type = {
21201 : PyVarObject_HEAD_INIT(NULL, 0)
21202 : .tp_name = "svcctl.EnumServicesStatusA",
21203 : .tp_getset = py_svcctl_EnumServicesStatusA_getsetters,
21204 : .tp_methods = py_svcctl_EnumServicesStatusA_methods,
21205 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21206 : .tp_new = py_svcctl_EnumServicesStatusA_new,
21207 : };
21208 :
21209 0 : static bool pack_py_svcctl_EnumServicesStatusA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_EnumServicesStatusA *r)
21210 : {
21211 : PyObject *py_handle;
21212 : PyObject *py_type;
21213 : PyObject *py_state;
21214 : PyObject *py_offered;
21215 : PyObject *py_resume_handle;
21216 0 : const char *kwnames[] = {
21217 : "handle", "type", "state", "offered", "resume_handle", NULL
21218 : };
21219 :
21220 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)) {
21221 0 : return false;
21222 : }
21223 :
21224 0 : if (py_handle == NULL) {
21225 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21226 0 : return false;
21227 : }
21228 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21229 0 : if (r->in.handle == NULL) {
21230 0 : PyErr_NoMemory();
21231 0 : return false;
21232 : }
21233 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21234 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21235 0 : PyErr_NoMemory();
21236 0 : return false;
21237 : }
21238 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21239 0 : if (py_type == NULL) {
21240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
21241 0 : return false;
21242 : }
21243 : {
21244 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
21245 0 : if (PyLong_Check(py_type)) {
21246 : unsigned long long test_var;
21247 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
21248 0 : if (PyErr_Occurred() != NULL) {
21249 0 : return false;
21250 : }
21251 0 : if (test_var > uint_max) {
21252 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21253 : PyLong_Type.tp_name, uint_max, test_var);
21254 0 : return false;
21255 : }
21256 0 : r->in.type = test_var;
21257 : } else {
21258 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21259 : PyLong_Type.tp_name);
21260 0 : return false;
21261 : }
21262 : }
21263 0 : if (py_state == NULL) {
21264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
21265 0 : return false;
21266 : }
21267 : {
21268 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
21269 0 : if (PyLong_Check(py_state)) {
21270 : unsigned long long test_var;
21271 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
21272 0 : if (PyErr_Occurred() != NULL) {
21273 0 : return false;
21274 : }
21275 0 : if (test_var > uint_max) {
21276 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21277 : PyLong_Type.tp_name, uint_max, test_var);
21278 0 : return false;
21279 : }
21280 0 : r->in.state = test_var;
21281 : } else {
21282 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21283 : PyLong_Type.tp_name);
21284 0 : return false;
21285 : }
21286 : }
21287 0 : if (py_offered == NULL) {
21288 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
21289 0 : return false;
21290 : }
21291 : {
21292 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
21293 0 : if (PyLong_Check(py_offered)) {
21294 : unsigned long long test_var;
21295 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
21296 0 : if (PyErr_Occurred() != NULL) {
21297 0 : return false;
21298 : }
21299 0 : if (test_var > uint_max) {
21300 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21301 : PyLong_Type.tp_name, uint_max, test_var);
21302 0 : return false;
21303 : }
21304 0 : r->in.offered = test_var;
21305 : } else {
21306 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21307 : PyLong_Type.tp_name);
21308 0 : return false;
21309 : }
21310 : }
21311 0 : if (py_resume_handle == NULL) {
21312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
21313 0 : return false;
21314 : }
21315 0 : if (py_resume_handle == Py_None) {
21316 0 : r->in.resume_handle = NULL;
21317 : } else {
21318 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
21319 0 : if (r->in.resume_handle == NULL) {
21320 0 : PyErr_NoMemory();
21321 0 : return false;
21322 : }
21323 : {
21324 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
21325 0 : if (PyLong_Check(py_resume_handle)) {
21326 : unsigned long long test_var;
21327 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
21328 0 : if (PyErr_Occurred() != NULL) {
21329 0 : return false;
21330 : }
21331 0 : if (test_var > uint_max) {
21332 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21333 : PyLong_Type.tp_name, uint_max, test_var);
21334 0 : return false;
21335 : }
21336 0 : *r->in.resume_handle = test_var;
21337 : } else {
21338 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21339 : PyLong_Type.tp_name);
21340 0 : return false;
21341 : }
21342 : }
21343 : }
21344 0 : return true;
21345 : }
21346 :
21347 0 : static PyObject *unpack_py_svcctl_EnumServicesStatusA_args_out(struct svcctl_EnumServicesStatusA *r)
21348 : {
21349 : PyObject *result;
21350 : PyObject *py_service;
21351 : PyObject *py_needed;
21352 : PyObject *py_services_returned;
21353 : PyObject *py_resume_handle;
21354 0 : result = PyTuple_New(4);
21355 0 : py_service = PyList_New(r->in.offered);
21356 0 : if (py_service == NULL) {
21357 0 : return NULL;
21358 : }
21359 : {
21360 : int service_cntr_0;
21361 0 : for (service_cntr_0 = 0; service_cntr_0 < (r->in.offered); service_cntr_0++) {
21362 : PyObject *py_service_0;
21363 0 : py_service_0 = PyLong_FromLong((uint16_t)r->out.service[service_cntr_0]);
21364 0 : PyList_SetItem(py_service, service_cntr_0, py_service_0);
21365 : }
21366 : }
21367 0 : PyTuple_SetItem(result, 0, py_service);
21368 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
21369 0 : PyTuple_SetItem(result, 1, py_needed);
21370 0 : py_services_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.services_returned);
21371 0 : PyTuple_SetItem(result, 2, py_services_returned);
21372 0 : if (r->out.resume_handle == NULL) {
21373 0 : py_resume_handle = Py_None;
21374 0 : Py_INCREF(py_resume_handle);
21375 : } else {
21376 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
21377 : }
21378 0 : PyTuple_SetItem(result, 3, py_resume_handle);
21379 0 : if (!W_ERROR_IS_OK(r->out.result)) {
21380 0 : PyErr_SetWERROR(r->out.result);
21381 0 : return NULL;
21382 : }
21383 :
21384 0 : return result;
21385 : }
21386 :
21387 :
21388 0 : static PyObject *py_svcctl_OpenSCManagerA_in_get_MachineName(PyObject *obj, void *closure)
21389 : {
21390 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
21391 : PyObject *py_MachineName;
21392 0 : if (object->in.MachineName == NULL) {
21393 0 : Py_RETURN_NONE;
21394 : }
21395 0 : if (object->in.MachineName == NULL) {
21396 0 : py_MachineName = Py_None;
21397 0 : Py_INCREF(py_MachineName);
21398 : } else {
21399 0 : if (object->in.MachineName == NULL) {
21400 0 : py_MachineName = Py_None;
21401 0 : Py_INCREF(py_MachineName);
21402 : } else {
21403 0 : py_MachineName = PyUnicode_Decode(object->in.MachineName, strlen(object->in.MachineName), "utf-8", "ignore");
21404 : }
21405 : }
21406 0 : return py_MachineName;
21407 : }
21408 :
21409 0 : static int py_svcctl_OpenSCManagerA_in_set_MachineName(PyObject *py_obj, PyObject *value, void *closure)
21410 : {
21411 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21412 0 : if (value == NULL) {
21413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.MachineName");
21414 0 : return -1;
21415 : }
21416 0 : if (value == Py_None) {
21417 0 : object->in.MachineName = NULL;
21418 : } else {
21419 0 : object->in.MachineName = NULL;
21420 : {
21421 : const char *test_str;
21422 : const char *talloc_str;
21423 0 : PyObject *unicode = NULL;
21424 0 : if (PyUnicode_Check(value)) {
21425 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21426 0 : if (unicode == NULL) {
21427 0 : PyErr_NoMemory();
21428 0 : return -1;
21429 : }
21430 0 : test_str = PyBytes_AS_STRING(unicode);
21431 0 : } else if (PyBytes_Check(value)) {
21432 0 : test_str = PyBytes_AS_STRING(value);
21433 : } else {
21434 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21435 0 : return -1;
21436 : }
21437 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21438 0 : if (unicode != NULL) {
21439 0 : Py_DECREF(unicode);
21440 : }
21441 0 : if (talloc_str == NULL) {
21442 0 : PyErr_NoMemory();
21443 0 : return -1;
21444 : }
21445 0 : object->in.MachineName = talloc_str;
21446 : }
21447 : }
21448 0 : return 0;
21449 : }
21450 :
21451 0 : static PyObject *py_svcctl_OpenSCManagerA_in_get_DatabaseName(PyObject *obj, void *closure)
21452 : {
21453 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
21454 : PyObject *py_DatabaseName;
21455 0 : if (object->in.DatabaseName == NULL) {
21456 0 : Py_RETURN_NONE;
21457 : }
21458 0 : if (object->in.DatabaseName == NULL) {
21459 0 : py_DatabaseName = Py_None;
21460 0 : Py_INCREF(py_DatabaseName);
21461 : } else {
21462 0 : if (object->in.DatabaseName == NULL) {
21463 0 : py_DatabaseName = Py_None;
21464 0 : Py_INCREF(py_DatabaseName);
21465 : } else {
21466 0 : py_DatabaseName = PyUnicode_Decode(object->in.DatabaseName, strlen(object->in.DatabaseName), "utf-8", "ignore");
21467 : }
21468 : }
21469 0 : return py_DatabaseName;
21470 : }
21471 :
21472 0 : static int py_svcctl_OpenSCManagerA_in_set_DatabaseName(PyObject *py_obj, PyObject *value, void *closure)
21473 : {
21474 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21475 0 : if (value == NULL) {
21476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.DatabaseName");
21477 0 : return -1;
21478 : }
21479 0 : if (value == Py_None) {
21480 0 : object->in.DatabaseName = NULL;
21481 : } else {
21482 0 : object->in.DatabaseName = NULL;
21483 : {
21484 : const char *test_str;
21485 : const char *talloc_str;
21486 0 : PyObject *unicode = NULL;
21487 0 : if (PyUnicode_Check(value)) {
21488 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21489 0 : if (unicode == NULL) {
21490 0 : PyErr_NoMemory();
21491 0 : return -1;
21492 : }
21493 0 : test_str = PyBytes_AS_STRING(unicode);
21494 0 : } else if (PyBytes_Check(value)) {
21495 0 : test_str = PyBytes_AS_STRING(value);
21496 : } else {
21497 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21498 0 : return -1;
21499 : }
21500 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21501 0 : if (unicode != NULL) {
21502 0 : Py_DECREF(unicode);
21503 : }
21504 0 : if (talloc_str == NULL) {
21505 0 : PyErr_NoMemory();
21506 0 : return -1;
21507 : }
21508 0 : object->in.DatabaseName = talloc_str;
21509 : }
21510 : }
21511 0 : return 0;
21512 : }
21513 :
21514 0 : static PyObject *py_svcctl_OpenSCManagerA_in_get_access_mask(PyObject *obj, void *closure)
21515 : {
21516 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
21517 : PyObject *py_access_mask;
21518 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
21519 0 : return py_access_mask;
21520 : }
21521 :
21522 0 : static int py_svcctl_OpenSCManagerA_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
21523 : {
21524 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21525 0 : if (value == NULL) {
21526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
21527 0 : return -1;
21528 : }
21529 : {
21530 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
21531 0 : if (PyLong_Check(value)) {
21532 : unsigned long long test_var;
21533 0 : test_var = PyLong_AsUnsignedLongLong(value);
21534 0 : if (PyErr_Occurred() != NULL) {
21535 0 : return -1;
21536 : }
21537 0 : if (test_var > uint_max) {
21538 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21539 : PyLong_Type.tp_name, uint_max, test_var);
21540 0 : return -1;
21541 : }
21542 0 : object->in.access_mask = test_var;
21543 : } else {
21544 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21545 : PyLong_Type.tp_name);
21546 0 : return -1;
21547 : }
21548 : }
21549 0 : return 0;
21550 : }
21551 :
21552 0 : static PyObject *py_svcctl_OpenSCManagerA_out_get_handle(PyObject *obj, void *closure)
21553 : {
21554 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
21555 : PyObject *py_handle;
21556 0 : if (object->out.handle == NULL) {
21557 0 : Py_RETURN_NONE;
21558 : }
21559 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
21560 0 : return py_handle;
21561 : }
21562 :
21563 0 : static int py_svcctl_OpenSCManagerA_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
21564 : {
21565 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21566 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
21567 0 : if (value == NULL) {
21568 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
21569 0 : return -1;
21570 : }
21571 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
21572 0 : if (object->out.handle == NULL) {
21573 0 : PyErr_NoMemory();
21574 0 : return -1;
21575 : }
21576 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21577 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21578 0 : PyErr_NoMemory();
21579 0 : return -1;
21580 : }
21581 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
21582 0 : return 0;
21583 : }
21584 :
21585 0 : static PyObject *py_svcctl_OpenSCManagerA_get_result(PyObject *obj, void *closure)
21586 : {
21587 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(obj);
21588 : PyObject *py_result;
21589 0 : py_result = PyErr_FromWERROR(object->out.result);
21590 0 : return py_result;
21591 : }
21592 :
21593 0 : static int py_svcctl_OpenSCManagerA_set_result(PyObject *py_obj, PyObject *value, void *closure)
21594 : {
21595 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21596 0 : if (value == NULL) {
21597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
21598 0 : return -1;
21599 : }
21600 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
21601 0 : return 0;
21602 : }
21603 :
21604 : static PyGetSetDef py_svcctl_OpenSCManagerA_getsetters[] = {
21605 : {
21606 : .name = discard_const_p(char, "in_MachineName"),
21607 : .get = py_svcctl_OpenSCManagerA_in_get_MachineName,
21608 : .set = py_svcctl_OpenSCManagerA_in_set_MachineName,
21609 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21610 : },
21611 : {
21612 : .name = discard_const_p(char, "in_DatabaseName"),
21613 : .get = py_svcctl_OpenSCManagerA_in_get_DatabaseName,
21614 : .set = py_svcctl_OpenSCManagerA_in_set_DatabaseName,
21615 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21616 : },
21617 : {
21618 : .name = discard_const_p(char, "in_access_mask"),
21619 : .get = py_svcctl_OpenSCManagerA_in_get_access_mask,
21620 : .set = py_svcctl_OpenSCManagerA_in_set_access_mask,
21621 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
21622 : },
21623 : {
21624 : .name = discard_const_p(char, "out_handle"),
21625 : .get = py_svcctl_OpenSCManagerA_out_get_handle,
21626 : .set = py_svcctl_OpenSCManagerA_out_set_handle,
21627 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21628 : },
21629 : {
21630 : .name = discard_const_p(char, "result"),
21631 : .get = py_svcctl_OpenSCManagerA_get_result,
21632 : .set = py_svcctl_OpenSCManagerA_set_result,
21633 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
21634 : },
21635 : { .name = NULL }
21636 : };
21637 :
21638 0 : static PyObject *py_svcctl_OpenSCManagerA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21639 : {
21640 0 : PyObject *self = pytalloc_new(struct svcctl_OpenSCManagerA, type);
21641 0 : struct svcctl_OpenSCManagerA *_self = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(self);
21642 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21643 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
21644 0 : return self;
21645 : }
21646 :
21647 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21648 : {
21649 :
21650 :
21651 0 : return PyLong_FromLong(27);
21652 : }
21653 :
21654 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
21655 : {
21656 0 : const struct ndr_interface_call *call = NULL;
21657 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21658 0 : PyObject *ret = NULL;
21659 0 : struct ndr_push *push = NULL;
21660 : DATA_BLOB blob;
21661 : enum ndr_err_code err;
21662 :
21663 0 : if (ndr_table_svcctl.num_calls < 28) {
21664 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerA_ndr_pack");
21665 0 : return NULL;
21666 : }
21667 0 : call = &ndr_table_svcctl.calls[27];
21668 :
21669 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21670 0 : if (push == NULL) {
21671 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21672 0 : return NULL;
21673 : }
21674 :
21675 0 : push->flags |= ndr_push_flags;
21676 :
21677 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21678 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21679 0 : TALLOC_FREE(push);
21680 0 : PyErr_SetNdrError(err);
21681 0 : return NULL;
21682 : }
21683 0 : blob = ndr_push_blob(push);
21684 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21685 0 : TALLOC_FREE(push);
21686 0 : return ret;
21687 : }
21688 :
21689 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21690 : {
21691 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21692 0 : PyObject *bigendian_obj = NULL;
21693 0 : PyObject *ndr64_obj = NULL;
21694 0 : uint32_t ndr_push_flags = 0;
21695 :
21696 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21697 : discard_const_p(char *, kwnames),
21698 : &bigendian_obj,
21699 : &ndr64_obj)) {
21700 0 : return NULL;
21701 : }
21702 :
21703 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21704 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21705 : }
21706 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21707 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21708 : }
21709 :
21710 0 : return py_svcctl_OpenSCManagerA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21711 : }
21712 :
21713 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21714 : {
21715 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21716 0 : PyObject *bigendian_obj = NULL;
21717 0 : PyObject *ndr64_obj = NULL;
21718 0 : uint32_t ndr_push_flags = 0;
21719 :
21720 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21721 : discard_const_p(char *, kwnames),
21722 : &bigendian_obj,
21723 : &ndr64_obj)) {
21724 0 : return NULL;
21725 : }
21726 :
21727 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21728 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21729 : }
21730 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21731 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21732 : }
21733 :
21734 0 : return py_svcctl_OpenSCManagerA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21735 : }
21736 :
21737 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
21738 : {
21739 0 : const struct ndr_interface_call *call = NULL;
21740 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21741 0 : struct ndr_pull *pull = NULL;
21742 : enum ndr_err_code err;
21743 :
21744 0 : if (ndr_table_svcctl.num_calls < 28) {
21745 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerA_ndr_unpack");
21746 0 : return NULL;
21747 : }
21748 0 : call = &ndr_table_svcctl.calls[27];
21749 :
21750 0 : pull = ndr_pull_init_blob(blob, object);
21751 0 : if (pull == NULL) {
21752 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21753 0 : return NULL;
21754 : }
21755 :
21756 0 : pull->flags |= ndr_pull_flags;
21757 :
21758 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21759 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21760 0 : TALLOC_FREE(pull);
21761 0 : PyErr_SetNdrError(err);
21762 0 : return NULL;
21763 : }
21764 0 : if (!allow_remaining) {
21765 : uint32_t highest_ofs;
21766 :
21767 0 : if (pull->offset > pull->relative_highest_offset) {
21768 0 : highest_ofs = pull->offset;
21769 : } else {
21770 0 : highest_ofs = pull->relative_highest_offset;
21771 : }
21772 0 : if (highest_ofs < pull->data_size) {
21773 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21774 : "not all bytes consumed ofs[%u] size[%u]",
21775 : highest_ofs, pull->data_size);
21776 0 : TALLOC_FREE(pull);
21777 0 : PyErr_SetNdrError(err);
21778 0 : return NULL;
21779 : }
21780 : }
21781 :
21782 0 : TALLOC_FREE(pull);
21783 0 : Py_RETURN_NONE;
21784 : }
21785 :
21786 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21787 : {
21788 : DATA_BLOB blob;
21789 0 : Py_ssize_t blob_length = 0;
21790 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21791 0 : PyObject *bigendian_obj = NULL;
21792 0 : PyObject *ndr64_obj = NULL;
21793 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21794 0 : PyObject *allow_remaining_obj = NULL;
21795 0 : bool allow_remaining = false;
21796 :
21797 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21798 : discard_const_p(char *, kwnames),
21799 : &blob.data, &blob_length,
21800 : &bigendian_obj,
21801 : &ndr64_obj,
21802 : &allow_remaining_obj)) {
21803 0 : return NULL;
21804 : }
21805 0 : blob.length = blob_length;
21806 :
21807 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21808 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21809 : }
21810 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21811 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21812 : }
21813 :
21814 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21815 0 : allow_remaining = true;
21816 : }
21817 :
21818 0 : return py_svcctl_OpenSCManagerA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21819 : }
21820 :
21821 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21822 : {
21823 : DATA_BLOB blob;
21824 0 : Py_ssize_t blob_length = 0;
21825 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21826 0 : PyObject *bigendian_obj = NULL;
21827 0 : PyObject *ndr64_obj = NULL;
21828 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21829 0 : PyObject *allow_remaining_obj = NULL;
21830 0 : bool allow_remaining = false;
21831 :
21832 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21833 : discard_const_p(char *, kwnames),
21834 : &blob.data, &blob_length,
21835 : &bigendian_obj,
21836 : &ndr64_obj,
21837 : &allow_remaining_obj)) {
21838 0 : return NULL;
21839 : }
21840 0 : blob.length = blob_length;
21841 :
21842 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21843 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21844 : }
21845 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21846 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21847 : }
21848 :
21849 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21850 0 : allow_remaining = true;
21851 : }
21852 :
21853 0 : return py_svcctl_OpenSCManagerA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21854 : }
21855 :
21856 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
21857 : {
21858 0 : const struct ndr_interface_call *call = NULL;
21859 0 : struct svcctl_OpenSCManagerA *object = (struct svcctl_OpenSCManagerA *)pytalloc_get_ptr(py_obj);
21860 : PyObject *ret;
21861 : char *retstr;
21862 :
21863 0 : if (ndr_table_svcctl.num_calls < 28) {
21864 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenSCManagerA_ndr_print");
21865 0 : return NULL;
21866 : }
21867 0 : call = &ndr_table_svcctl.calls[27];
21868 :
21869 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21870 0 : ret = PyUnicode_FromString(retstr);
21871 0 : TALLOC_FREE(retstr);
21872 :
21873 0 : return ret;
21874 : }
21875 :
21876 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21877 : {
21878 0 : return py_svcctl_OpenSCManagerA_ndr_print(py_obj, "svcctl_OpenSCManagerA_in", NDR_IN);
21879 : }
21880 :
21881 0 : static PyObject *py_svcctl_OpenSCManagerA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21882 : {
21883 0 : return py_svcctl_OpenSCManagerA_ndr_print(py_obj, "svcctl_OpenSCManagerA_out", NDR_OUT);
21884 : }
21885 :
21886 : static PyMethodDef py_svcctl_OpenSCManagerA_methods[] = {
21887 : { "opnum", (PyCFunction)py_svcctl_OpenSCManagerA_ndr_opnum, METH_NOARGS|METH_CLASS,
21888 : "svcctl.OpenSCManagerA.opnum() -> 27 (0x1b) " },
21889 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21890 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21891 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21892 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21893 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21894 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21895 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenSCManagerA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21896 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21897 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenSCManagerA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21898 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenSCManagerA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21899 : { NULL, NULL, 0, NULL }
21900 : };
21901 :
21902 :
21903 : static PyTypeObject svcctl_OpenSCManagerA_Type = {
21904 : PyVarObject_HEAD_INIT(NULL, 0)
21905 : .tp_name = "svcctl.OpenSCManagerA",
21906 : .tp_getset = py_svcctl_OpenSCManagerA_getsetters,
21907 : .tp_methods = py_svcctl_OpenSCManagerA_methods,
21908 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21909 : .tp_new = py_svcctl_OpenSCManagerA_new,
21910 : };
21911 :
21912 0 : static bool pack_py_svcctl_OpenSCManagerA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenSCManagerA *r)
21913 : {
21914 : PyObject *py_MachineName;
21915 : PyObject *py_DatabaseName;
21916 : PyObject *py_access_mask;
21917 0 : const char *kwnames[] = {
21918 : "MachineName", "DatabaseName", "access_mask", NULL
21919 : };
21920 :
21921 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenSCManagerA", discard_const_p(char *, kwnames), &py_MachineName, &py_DatabaseName, &py_access_mask)) {
21922 0 : return false;
21923 : }
21924 :
21925 0 : if (py_MachineName == NULL) {
21926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.MachineName");
21927 0 : return false;
21928 : }
21929 0 : if (py_MachineName == Py_None) {
21930 0 : r->in.MachineName = NULL;
21931 : } else {
21932 0 : r->in.MachineName = NULL;
21933 : {
21934 : const char *test_str;
21935 : const char *talloc_str;
21936 0 : PyObject *unicode = NULL;
21937 0 : if (PyUnicode_Check(py_MachineName)) {
21938 0 : unicode = PyUnicode_AsEncodedString(py_MachineName, "utf-8", "ignore");
21939 0 : if (unicode == NULL) {
21940 0 : PyErr_NoMemory();
21941 0 : return false;
21942 : }
21943 0 : test_str = PyBytes_AS_STRING(unicode);
21944 0 : } else if (PyBytes_Check(py_MachineName)) {
21945 0 : test_str = PyBytes_AS_STRING(py_MachineName);
21946 : } else {
21947 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_MachineName)->tp_name);
21948 0 : return false;
21949 : }
21950 0 : talloc_str = talloc_strdup(r, test_str);
21951 0 : if (unicode != NULL) {
21952 0 : Py_DECREF(unicode);
21953 : }
21954 0 : if (talloc_str == NULL) {
21955 0 : PyErr_NoMemory();
21956 0 : return false;
21957 : }
21958 0 : r->in.MachineName = talloc_str;
21959 : }
21960 : }
21961 0 : if (py_DatabaseName == NULL) {
21962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.DatabaseName");
21963 0 : return false;
21964 : }
21965 0 : if (py_DatabaseName == Py_None) {
21966 0 : r->in.DatabaseName = NULL;
21967 : } else {
21968 0 : r->in.DatabaseName = NULL;
21969 : {
21970 : const char *test_str;
21971 : const char *talloc_str;
21972 0 : PyObject *unicode = NULL;
21973 0 : if (PyUnicode_Check(py_DatabaseName)) {
21974 0 : unicode = PyUnicode_AsEncodedString(py_DatabaseName, "utf-8", "ignore");
21975 0 : if (unicode == NULL) {
21976 0 : PyErr_NoMemory();
21977 0 : return false;
21978 : }
21979 0 : test_str = PyBytes_AS_STRING(unicode);
21980 0 : } else if (PyBytes_Check(py_DatabaseName)) {
21981 0 : test_str = PyBytes_AS_STRING(py_DatabaseName);
21982 : } else {
21983 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_DatabaseName)->tp_name);
21984 0 : return false;
21985 : }
21986 0 : talloc_str = talloc_strdup(r, test_str);
21987 0 : if (unicode != NULL) {
21988 0 : Py_DECREF(unicode);
21989 : }
21990 0 : if (talloc_str == NULL) {
21991 0 : PyErr_NoMemory();
21992 0 : return false;
21993 : }
21994 0 : r->in.DatabaseName = talloc_str;
21995 : }
21996 : }
21997 0 : if (py_access_mask == NULL) {
21998 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
21999 0 : return false;
22000 : }
22001 : {
22002 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
22003 0 : if (PyLong_Check(py_access_mask)) {
22004 : unsigned long long test_var;
22005 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
22006 0 : if (PyErr_Occurred() != NULL) {
22007 0 : return false;
22008 : }
22009 0 : if (test_var > uint_max) {
22010 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22011 : PyLong_Type.tp_name, uint_max, test_var);
22012 0 : return false;
22013 : }
22014 0 : r->in.access_mask = test_var;
22015 : } else {
22016 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22017 : PyLong_Type.tp_name);
22018 0 : return false;
22019 : }
22020 : }
22021 0 : return true;
22022 : }
22023 :
22024 0 : static PyObject *unpack_py_svcctl_OpenSCManagerA_args_out(struct svcctl_OpenSCManagerA *r)
22025 : {
22026 : PyObject *result;
22027 : PyObject *py_handle;
22028 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
22029 0 : result = py_handle;
22030 0 : if (!W_ERROR_IS_OK(r->out.result)) {
22031 0 : PyErr_SetWERROR(r->out.result);
22032 0 : return NULL;
22033 : }
22034 :
22035 0 : return result;
22036 : }
22037 :
22038 :
22039 0 : static PyObject *py_svcctl_OpenServiceA_in_get_scmanager_handle(PyObject *obj, void *closure)
22040 : {
22041 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
22042 : PyObject *py_scmanager_handle;
22043 0 : if (object->in.scmanager_handle == NULL) {
22044 0 : Py_RETURN_NONE;
22045 : }
22046 0 : py_scmanager_handle = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager_handle, object->in.scmanager_handle);
22047 0 : return py_scmanager_handle;
22048 : }
22049 :
22050 0 : static int py_svcctl_OpenServiceA_in_set_scmanager_handle(PyObject *py_obj, PyObject *value, void *closure)
22051 : {
22052 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22053 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager_handle));
22054 0 : if (value == NULL) {
22055 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager_handle");
22056 0 : return -1;
22057 : }
22058 0 : object->in.scmanager_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager_handle);
22059 0 : if (object->in.scmanager_handle == NULL) {
22060 0 : PyErr_NoMemory();
22061 0 : return -1;
22062 : }
22063 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22064 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22065 0 : PyErr_NoMemory();
22066 0 : return -1;
22067 : }
22068 0 : object->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(value);
22069 0 : return 0;
22070 : }
22071 :
22072 0 : static PyObject *py_svcctl_OpenServiceA_in_get_ServiceName(PyObject *obj, void *closure)
22073 : {
22074 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
22075 : PyObject *py_ServiceName;
22076 0 : if (object->in.ServiceName == NULL) {
22077 0 : Py_RETURN_NONE;
22078 : }
22079 0 : if (object->in.ServiceName == NULL) {
22080 0 : py_ServiceName = Py_None;
22081 0 : Py_INCREF(py_ServiceName);
22082 : } else {
22083 0 : if (object->in.ServiceName == NULL) {
22084 0 : py_ServiceName = Py_None;
22085 0 : Py_INCREF(py_ServiceName);
22086 : } else {
22087 0 : py_ServiceName = PyUnicode_Decode(object->in.ServiceName, strlen(object->in.ServiceName), "utf-8", "ignore");
22088 : }
22089 : }
22090 0 : return py_ServiceName;
22091 : }
22092 :
22093 0 : static int py_svcctl_OpenServiceA_in_set_ServiceName(PyObject *py_obj, PyObject *value, void *closure)
22094 : {
22095 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22096 0 : if (value == NULL) {
22097 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ServiceName");
22098 0 : return -1;
22099 : }
22100 0 : if (value == Py_None) {
22101 0 : object->in.ServiceName = NULL;
22102 : } else {
22103 0 : object->in.ServiceName = NULL;
22104 : {
22105 : const char *test_str;
22106 : const char *talloc_str;
22107 0 : PyObject *unicode = NULL;
22108 0 : if (PyUnicode_Check(value)) {
22109 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
22110 0 : if (unicode == NULL) {
22111 0 : PyErr_NoMemory();
22112 0 : return -1;
22113 : }
22114 0 : test_str = PyBytes_AS_STRING(unicode);
22115 0 : } else if (PyBytes_Check(value)) {
22116 0 : test_str = PyBytes_AS_STRING(value);
22117 : } else {
22118 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
22119 0 : return -1;
22120 : }
22121 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
22122 0 : if (unicode != NULL) {
22123 0 : Py_DECREF(unicode);
22124 : }
22125 0 : if (talloc_str == NULL) {
22126 0 : PyErr_NoMemory();
22127 0 : return -1;
22128 : }
22129 0 : object->in.ServiceName = talloc_str;
22130 : }
22131 : }
22132 0 : return 0;
22133 : }
22134 :
22135 0 : static PyObject *py_svcctl_OpenServiceA_in_get_access_mask(PyObject *obj, void *closure)
22136 : {
22137 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
22138 : PyObject *py_access_mask;
22139 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
22140 0 : return py_access_mask;
22141 : }
22142 :
22143 0 : static int py_svcctl_OpenServiceA_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
22144 : {
22145 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22146 0 : if (value == NULL) {
22147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
22148 0 : return -1;
22149 : }
22150 : {
22151 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
22152 0 : if (PyLong_Check(value)) {
22153 : unsigned long long test_var;
22154 0 : test_var = PyLong_AsUnsignedLongLong(value);
22155 0 : if (PyErr_Occurred() != NULL) {
22156 0 : return -1;
22157 : }
22158 0 : if (test_var > uint_max) {
22159 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22160 : PyLong_Type.tp_name, uint_max, test_var);
22161 0 : return -1;
22162 : }
22163 0 : object->in.access_mask = test_var;
22164 : } else {
22165 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22166 : PyLong_Type.tp_name);
22167 0 : return -1;
22168 : }
22169 : }
22170 0 : return 0;
22171 : }
22172 :
22173 0 : static PyObject *py_svcctl_OpenServiceA_out_get_handle(PyObject *obj, void *closure)
22174 : {
22175 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
22176 : PyObject *py_handle;
22177 0 : if (object->out.handle == NULL) {
22178 0 : Py_RETURN_NONE;
22179 : }
22180 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
22181 0 : return py_handle;
22182 : }
22183 :
22184 0 : static int py_svcctl_OpenServiceA_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22185 : {
22186 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22187 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
22188 0 : if (value == NULL) {
22189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
22190 0 : return -1;
22191 : }
22192 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
22193 0 : if (object->out.handle == NULL) {
22194 0 : PyErr_NoMemory();
22195 0 : return -1;
22196 : }
22197 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22198 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22199 0 : PyErr_NoMemory();
22200 0 : return -1;
22201 : }
22202 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22203 0 : return 0;
22204 : }
22205 :
22206 0 : static PyObject *py_svcctl_OpenServiceA_get_result(PyObject *obj, void *closure)
22207 : {
22208 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(obj);
22209 : PyObject *py_result;
22210 0 : py_result = PyErr_FromWERROR(object->out.result);
22211 0 : return py_result;
22212 : }
22213 :
22214 0 : static int py_svcctl_OpenServiceA_set_result(PyObject *py_obj, PyObject *value, void *closure)
22215 : {
22216 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22217 0 : if (value == NULL) {
22218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22219 0 : return -1;
22220 : }
22221 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
22222 0 : return 0;
22223 : }
22224 :
22225 : static PyGetSetDef py_svcctl_OpenServiceA_getsetters[] = {
22226 : {
22227 : .name = discard_const_p(char, "in_scmanager_handle"),
22228 : .get = py_svcctl_OpenServiceA_in_get_scmanager_handle,
22229 : .set = py_svcctl_OpenServiceA_in_set_scmanager_handle,
22230 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22231 : },
22232 : {
22233 : .name = discard_const_p(char, "in_ServiceName"),
22234 : .get = py_svcctl_OpenServiceA_in_get_ServiceName,
22235 : .set = py_svcctl_OpenServiceA_in_set_ServiceName,
22236 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22237 : },
22238 : {
22239 : .name = discard_const_p(char, "in_access_mask"),
22240 : .get = py_svcctl_OpenServiceA_in_get_access_mask,
22241 : .set = py_svcctl_OpenServiceA_in_set_access_mask,
22242 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22243 : },
22244 : {
22245 : .name = discard_const_p(char, "out_handle"),
22246 : .get = py_svcctl_OpenServiceA_out_get_handle,
22247 : .set = py_svcctl_OpenServiceA_out_set_handle,
22248 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22249 : },
22250 : {
22251 : .name = discard_const_p(char, "result"),
22252 : .get = py_svcctl_OpenServiceA_get_result,
22253 : .set = py_svcctl_OpenServiceA_set_result,
22254 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
22255 : },
22256 : { .name = NULL }
22257 : };
22258 :
22259 0 : static PyObject *py_svcctl_OpenServiceA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22260 : {
22261 0 : PyObject *self = pytalloc_new(struct svcctl_OpenServiceA, type);
22262 0 : struct svcctl_OpenServiceA *_self = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(self);
22263 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22264 0 : _self->in.scmanager_handle = talloc_zero(mem_ctx, struct policy_handle);
22265 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
22266 0 : return self;
22267 : }
22268 :
22269 0 : static PyObject *py_svcctl_OpenServiceA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22270 : {
22271 :
22272 :
22273 0 : return PyLong_FromLong(28);
22274 : }
22275 :
22276 0 : static PyObject *py_svcctl_OpenServiceA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
22277 : {
22278 0 : const struct ndr_interface_call *call = NULL;
22279 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22280 0 : PyObject *ret = NULL;
22281 0 : struct ndr_push *push = NULL;
22282 : DATA_BLOB blob;
22283 : enum ndr_err_code err;
22284 :
22285 0 : if (ndr_table_svcctl.num_calls < 29) {
22286 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceA_ndr_pack");
22287 0 : return NULL;
22288 : }
22289 0 : call = &ndr_table_svcctl.calls[28];
22290 :
22291 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22292 0 : if (push == NULL) {
22293 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22294 0 : return NULL;
22295 : }
22296 :
22297 0 : push->flags |= ndr_push_flags;
22298 :
22299 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22300 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22301 0 : TALLOC_FREE(push);
22302 0 : PyErr_SetNdrError(err);
22303 0 : return NULL;
22304 : }
22305 0 : blob = ndr_push_blob(push);
22306 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22307 0 : TALLOC_FREE(push);
22308 0 : return ret;
22309 : }
22310 :
22311 0 : static PyObject *py_svcctl_OpenServiceA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22312 : {
22313 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22314 0 : PyObject *bigendian_obj = NULL;
22315 0 : PyObject *ndr64_obj = NULL;
22316 0 : uint32_t ndr_push_flags = 0;
22317 :
22318 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22319 : discard_const_p(char *, kwnames),
22320 : &bigendian_obj,
22321 : &ndr64_obj)) {
22322 0 : return NULL;
22323 : }
22324 :
22325 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22326 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22327 : }
22328 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22329 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22330 : }
22331 :
22332 0 : return py_svcctl_OpenServiceA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22333 : }
22334 :
22335 0 : static PyObject *py_svcctl_OpenServiceA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22336 : {
22337 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22338 0 : PyObject *bigendian_obj = NULL;
22339 0 : PyObject *ndr64_obj = NULL;
22340 0 : uint32_t ndr_push_flags = 0;
22341 :
22342 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22343 : discard_const_p(char *, kwnames),
22344 : &bigendian_obj,
22345 : &ndr64_obj)) {
22346 0 : return NULL;
22347 : }
22348 :
22349 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22350 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22351 : }
22352 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22353 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22354 : }
22355 :
22356 0 : return py_svcctl_OpenServiceA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22357 : }
22358 :
22359 0 : static PyObject *py_svcctl_OpenServiceA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
22360 : {
22361 0 : const struct ndr_interface_call *call = NULL;
22362 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22363 0 : struct ndr_pull *pull = NULL;
22364 : enum ndr_err_code err;
22365 :
22366 0 : if (ndr_table_svcctl.num_calls < 29) {
22367 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceA_ndr_unpack");
22368 0 : return NULL;
22369 : }
22370 0 : call = &ndr_table_svcctl.calls[28];
22371 :
22372 0 : pull = ndr_pull_init_blob(blob, object);
22373 0 : if (pull == NULL) {
22374 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22375 0 : return NULL;
22376 : }
22377 :
22378 0 : pull->flags |= ndr_pull_flags;
22379 :
22380 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22381 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22382 0 : TALLOC_FREE(pull);
22383 0 : PyErr_SetNdrError(err);
22384 0 : return NULL;
22385 : }
22386 0 : if (!allow_remaining) {
22387 : uint32_t highest_ofs;
22388 :
22389 0 : if (pull->offset > pull->relative_highest_offset) {
22390 0 : highest_ofs = pull->offset;
22391 : } else {
22392 0 : highest_ofs = pull->relative_highest_offset;
22393 : }
22394 0 : if (highest_ofs < pull->data_size) {
22395 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22396 : "not all bytes consumed ofs[%u] size[%u]",
22397 : highest_ofs, pull->data_size);
22398 0 : TALLOC_FREE(pull);
22399 0 : PyErr_SetNdrError(err);
22400 0 : return NULL;
22401 : }
22402 : }
22403 :
22404 0 : TALLOC_FREE(pull);
22405 0 : Py_RETURN_NONE;
22406 : }
22407 :
22408 0 : static PyObject *py_svcctl_OpenServiceA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22409 : {
22410 : DATA_BLOB blob;
22411 0 : Py_ssize_t blob_length = 0;
22412 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22413 0 : PyObject *bigendian_obj = NULL;
22414 0 : PyObject *ndr64_obj = NULL;
22415 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22416 0 : PyObject *allow_remaining_obj = NULL;
22417 0 : bool allow_remaining = false;
22418 :
22419 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22420 : discard_const_p(char *, kwnames),
22421 : &blob.data, &blob_length,
22422 : &bigendian_obj,
22423 : &ndr64_obj,
22424 : &allow_remaining_obj)) {
22425 0 : return NULL;
22426 : }
22427 0 : blob.length = blob_length;
22428 :
22429 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22430 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22431 : }
22432 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22433 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22434 : }
22435 :
22436 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22437 0 : allow_remaining = true;
22438 : }
22439 :
22440 0 : return py_svcctl_OpenServiceA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22441 : }
22442 :
22443 0 : static PyObject *py_svcctl_OpenServiceA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22444 : {
22445 : DATA_BLOB blob;
22446 0 : Py_ssize_t blob_length = 0;
22447 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22448 0 : PyObject *bigendian_obj = NULL;
22449 0 : PyObject *ndr64_obj = NULL;
22450 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22451 0 : PyObject *allow_remaining_obj = NULL;
22452 0 : bool allow_remaining = false;
22453 :
22454 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22455 : discard_const_p(char *, kwnames),
22456 : &blob.data, &blob_length,
22457 : &bigendian_obj,
22458 : &ndr64_obj,
22459 : &allow_remaining_obj)) {
22460 0 : return NULL;
22461 : }
22462 0 : blob.length = blob_length;
22463 :
22464 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22465 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22466 : }
22467 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22468 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22469 : }
22470 :
22471 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22472 0 : allow_remaining = true;
22473 : }
22474 :
22475 0 : return py_svcctl_OpenServiceA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22476 : }
22477 :
22478 0 : static PyObject *py_svcctl_OpenServiceA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
22479 : {
22480 0 : const struct ndr_interface_call *call = NULL;
22481 0 : struct svcctl_OpenServiceA *object = (struct svcctl_OpenServiceA *)pytalloc_get_ptr(py_obj);
22482 : PyObject *ret;
22483 : char *retstr;
22484 :
22485 0 : if (ndr_table_svcctl.num_calls < 29) {
22486 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_OpenServiceA_ndr_print");
22487 0 : return NULL;
22488 : }
22489 0 : call = &ndr_table_svcctl.calls[28];
22490 :
22491 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22492 0 : ret = PyUnicode_FromString(retstr);
22493 0 : TALLOC_FREE(retstr);
22494 :
22495 0 : return ret;
22496 : }
22497 :
22498 0 : static PyObject *py_svcctl_OpenServiceA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22499 : {
22500 0 : return py_svcctl_OpenServiceA_ndr_print(py_obj, "svcctl_OpenServiceA_in", NDR_IN);
22501 : }
22502 :
22503 0 : static PyObject *py_svcctl_OpenServiceA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22504 : {
22505 0 : return py_svcctl_OpenServiceA_ndr_print(py_obj, "svcctl_OpenServiceA_out", NDR_OUT);
22506 : }
22507 :
22508 : static PyMethodDef py_svcctl_OpenServiceA_methods[] = {
22509 : { "opnum", (PyCFunction)py_svcctl_OpenServiceA_ndr_opnum, METH_NOARGS|METH_CLASS,
22510 : "svcctl.OpenServiceA.opnum() -> 28 (0x1c) " },
22511 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22512 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22513 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22514 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22515 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22516 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22517 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_OpenServiceA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22518 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22519 : { "__ndr_print_in__", (PyCFunction)py_svcctl_OpenServiceA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22520 : { "__ndr_print_out__", (PyCFunction)py_svcctl_OpenServiceA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22521 : { NULL, NULL, 0, NULL }
22522 : };
22523 :
22524 :
22525 : static PyTypeObject svcctl_OpenServiceA_Type = {
22526 : PyVarObject_HEAD_INIT(NULL, 0)
22527 : .tp_name = "svcctl.OpenServiceA",
22528 : .tp_getset = py_svcctl_OpenServiceA_getsetters,
22529 : .tp_methods = py_svcctl_OpenServiceA_methods,
22530 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22531 : .tp_new = py_svcctl_OpenServiceA_new,
22532 : };
22533 :
22534 0 : static bool pack_py_svcctl_OpenServiceA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_OpenServiceA *r)
22535 : {
22536 : PyObject *py_scmanager_handle;
22537 : PyObject *py_ServiceName;
22538 : PyObject *py_access_mask;
22539 0 : const char *kwnames[] = {
22540 : "scmanager_handle", "ServiceName", "access_mask", NULL
22541 : };
22542 :
22543 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_OpenServiceA", discard_const_p(char *, kwnames), &py_scmanager_handle, &py_ServiceName, &py_access_mask)) {
22544 0 : return false;
22545 : }
22546 :
22547 0 : if (py_scmanager_handle == NULL) {
22548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager_handle");
22549 0 : return false;
22550 : }
22551 0 : r->in.scmanager_handle = talloc_ptrtype(r, r->in.scmanager_handle);
22552 0 : if (r->in.scmanager_handle == NULL) {
22553 0 : PyErr_NoMemory();
22554 0 : return false;
22555 : }
22556 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager_handle, return false;);
22557 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager_handle)) == NULL) {
22558 0 : PyErr_NoMemory();
22559 0 : return false;
22560 : }
22561 0 : r->in.scmanager_handle = (struct policy_handle *)pytalloc_get_ptr(py_scmanager_handle);
22562 0 : if (py_ServiceName == NULL) {
22563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ServiceName");
22564 0 : return false;
22565 : }
22566 0 : if (py_ServiceName == Py_None) {
22567 0 : r->in.ServiceName = NULL;
22568 : } else {
22569 0 : r->in.ServiceName = NULL;
22570 : {
22571 : const char *test_str;
22572 : const char *talloc_str;
22573 0 : PyObject *unicode = NULL;
22574 0 : if (PyUnicode_Check(py_ServiceName)) {
22575 0 : unicode = PyUnicode_AsEncodedString(py_ServiceName, "utf-8", "ignore");
22576 0 : if (unicode == NULL) {
22577 0 : PyErr_NoMemory();
22578 0 : return false;
22579 : }
22580 0 : test_str = PyBytes_AS_STRING(unicode);
22581 0 : } else if (PyBytes_Check(py_ServiceName)) {
22582 0 : test_str = PyBytes_AS_STRING(py_ServiceName);
22583 : } else {
22584 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ServiceName)->tp_name);
22585 0 : return false;
22586 : }
22587 0 : talloc_str = talloc_strdup(r, test_str);
22588 0 : if (unicode != NULL) {
22589 0 : Py_DECREF(unicode);
22590 : }
22591 0 : if (talloc_str == NULL) {
22592 0 : PyErr_NoMemory();
22593 0 : return false;
22594 : }
22595 0 : r->in.ServiceName = talloc_str;
22596 : }
22597 : }
22598 0 : if (py_access_mask == NULL) {
22599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
22600 0 : return false;
22601 : }
22602 : {
22603 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
22604 0 : if (PyLong_Check(py_access_mask)) {
22605 : unsigned long long test_var;
22606 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
22607 0 : if (PyErr_Occurred() != NULL) {
22608 0 : return false;
22609 : }
22610 0 : if (test_var > uint_max) {
22611 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22612 : PyLong_Type.tp_name, uint_max, test_var);
22613 0 : return false;
22614 : }
22615 0 : r->in.access_mask = test_var;
22616 : } else {
22617 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22618 : PyLong_Type.tp_name);
22619 0 : return false;
22620 : }
22621 : }
22622 0 : return true;
22623 : }
22624 :
22625 0 : static PyObject *unpack_py_svcctl_OpenServiceA_args_out(struct svcctl_OpenServiceA *r)
22626 : {
22627 : PyObject *result;
22628 : PyObject *py_handle;
22629 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
22630 0 : result = py_handle;
22631 0 : if (!W_ERROR_IS_OK(r->out.result)) {
22632 0 : PyErr_SetWERROR(r->out.result);
22633 0 : return NULL;
22634 : }
22635 :
22636 0 : return result;
22637 : }
22638 :
22639 :
22640 0 : static PyObject *py_svcctl_QueryServiceConfigA_in_get_handle(PyObject *obj, void *closure)
22641 : {
22642 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
22643 : PyObject *py_handle;
22644 0 : if (object->in.handle == NULL) {
22645 0 : Py_RETURN_NONE;
22646 : }
22647 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22648 0 : return py_handle;
22649 : }
22650 :
22651 0 : static int py_svcctl_QueryServiceConfigA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22652 : {
22653 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
22654 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22655 0 : if (value == NULL) {
22656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22657 0 : return -1;
22658 : }
22659 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22660 0 : if (object->in.handle == NULL) {
22661 0 : PyErr_NoMemory();
22662 0 : return -1;
22663 : }
22664 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22665 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22666 0 : PyErr_NoMemory();
22667 0 : return -1;
22668 : }
22669 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22670 0 : return 0;
22671 : }
22672 :
22673 0 : static PyObject *py_svcctl_QueryServiceConfigA_out_get_query(PyObject *obj, void *closure)
22674 : {
22675 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
22676 : PyObject *py_query;
22677 0 : py_query = PyList_New(object->in.offered);
22678 0 : if (py_query == NULL) {
22679 0 : return NULL;
22680 : }
22681 : {
22682 : int query_cntr_0;
22683 0 : for (query_cntr_0 = 0; query_cntr_0 < (object->in.offered); query_cntr_0++) {
22684 : PyObject *py_query_0;
22685 0 : py_query_0 = PyLong_FromLong((uint16_t)object->out.query[query_cntr_0]);
22686 0 : PyList_SetItem(py_query, query_cntr_0, py_query_0);
22687 : }
22688 : }
22689 0 : return py_query;
22690 : }
22691 :
22692 0 : static int py_svcctl_QueryServiceConfigA_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
22693 : {
22694 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
22695 0 : if (value == NULL) {
22696 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
22697 0 : return -1;
22698 : }
22699 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
22700 : {
22701 : int query_cntr_0;
22702 0 : object->out.query = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query, PyList_GET_SIZE(value));
22703 0 : if (!object->out.query) { return -1;; }
22704 0 : talloc_set_name_const(object->out.query, "ARRAY: object->out.query");
22705 0 : for (query_cntr_0 = 0; query_cntr_0 < PyList_GET_SIZE(value); query_cntr_0++) {
22706 0 : if (PyList_GET_ITEM(value, query_cntr_0) == NULL) {
22707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query[query_cntr_0]");
22708 0 : return -1;
22709 : }
22710 : {
22711 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.query[query_cntr_0]));
22712 0 : if (PyLong_Check(PyList_GET_ITEM(value, query_cntr_0))) {
22713 : unsigned long long test_var;
22714 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, query_cntr_0));
22715 0 : if (PyErr_Occurred() != NULL) {
22716 0 : return -1;
22717 : }
22718 0 : if (test_var > uint_max) {
22719 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22720 : PyLong_Type.tp_name, uint_max, test_var);
22721 0 : return -1;
22722 : }
22723 0 : object->out.query[query_cntr_0] = test_var;
22724 : } else {
22725 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22726 : PyLong_Type.tp_name);
22727 0 : return -1;
22728 : }
22729 : }
22730 : }
22731 : }
22732 0 : return 0;
22733 : }
22734 :
22735 0 : static PyObject *py_svcctl_QueryServiceConfigA_in_get_offered(PyObject *obj, void *closure)
22736 : {
22737 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
22738 : PyObject *py_offered;
22739 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
22740 0 : return py_offered;
22741 : }
22742 :
22743 0 : static int py_svcctl_QueryServiceConfigA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
22744 : {
22745 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
22746 0 : if (value == NULL) {
22747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
22748 0 : return -1;
22749 : }
22750 : {
22751 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
22752 0 : if (PyLong_Check(value)) {
22753 : unsigned long long test_var;
22754 0 : test_var = PyLong_AsUnsignedLongLong(value);
22755 0 : if (PyErr_Occurred() != NULL) {
22756 0 : return -1;
22757 : }
22758 0 : if (test_var > uint_max) {
22759 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22760 : PyLong_Type.tp_name, uint_max, test_var);
22761 0 : return -1;
22762 : }
22763 0 : object->in.offered = test_var;
22764 : } else {
22765 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22766 : PyLong_Type.tp_name);
22767 0 : return -1;
22768 : }
22769 : }
22770 0 : return 0;
22771 : }
22772 :
22773 0 : static PyObject *py_svcctl_QueryServiceConfigA_out_get_needed(PyObject *obj, void *closure)
22774 : {
22775 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
22776 : PyObject *py_needed;
22777 0 : if (object->out.needed == NULL) {
22778 0 : Py_RETURN_NONE;
22779 : }
22780 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
22781 0 : return py_needed;
22782 : }
22783 :
22784 0 : static int py_svcctl_QueryServiceConfigA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
22785 : {
22786 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
22787 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
22788 0 : if (value == NULL) {
22789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
22790 0 : return -1;
22791 : }
22792 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
22793 0 : if (object->out.needed == NULL) {
22794 0 : PyErr_NoMemory();
22795 0 : return -1;
22796 : }
22797 : {
22798 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
22799 0 : if (PyLong_Check(value)) {
22800 : unsigned long long test_var;
22801 0 : test_var = PyLong_AsUnsignedLongLong(value);
22802 0 : if (PyErr_Occurred() != NULL) {
22803 0 : return -1;
22804 : }
22805 0 : if (test_var > uint_max) {
22806 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22807 : PyLong_Type.tp_name, uint_max, test_var);
22808 0 : return -1;
22809 : }
22810 0 : *object->out.needed = test_var;
22811 : } else {
22812 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22813 : PyLong_Type.tp_name);
22814 0 : return -1;
22815 : }
22816 : }
22817 0 : return 0;
22818 : }
22819 :
22820 0 : static PyObject *py_svcctl_QueryServiceConfigA_get_result(PyObject *obj, void *closure)
22821 : {
22822 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(obj);
22823 : PyObject *py_result;
22824 0 : py_result = PyErr_FromWERROR(object->out.result);
22825 0 : return py_result;
22826 : }
22827 :
22828 0 : static int py_svcctl_QueryServiceConfigA_set_result(PyObject *py_obj, PyObject *value, void *closure)
22829 : {
22830 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
22831 0 : if (value == NULL) {
22832 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22833 0 : return -1;
22834 : }
22835 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
22836 0 : return 0;
22837 : }
22838 :
22839 : static PyGetSetDef py_svcctl_QueryServiceConfigA_getsetters[] = {
22840 : {
22841 : .name = discard_const_p(char, "in_handle"),
22842 : .get = py_svcctl_QueryServiceConfigA_in_get_handle,
22843 : .set = py_svcctl_QueryServiceConfigA_in_set_handle,
22844 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22845 : },
22846 : {
22847 : .name = discard_const_p(char, "out_query"),
22848 : .get = py_svcctl_QueryServiceConfigA_out_get_query,
22849 : .set = py_svcctl_QueryServiceConfigA_out_set_query,
22850 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
22851 : },
22852 : {
22853 : .name = discard_const_p(char, "in_offered"),
22854 : .get = py_svcctl_QueryServiceConfigA_in_get_offered,
22855 : .set = py_svcctl_QueryServiceConfigA_in_set_offered,
22856 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22857 : },
22858 : {
22859 : .name = discard_const_p(char, "out_needed"),
22860 : .get = py_svcctl_QueryServiceConfigA_out_get_needed,
22861 : .set = py_svcctl_QueryServiceConfigA_out_set_needed,
22862 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22863 : },
22864 : {
22865 : .name = discard_const_p(char, "result"),
22866 : .get = py_svcctl_QueryServiceConfigA_get_result,
22867 : .set = py_svcctl_QueryServiceConfigA_set_result,
22868 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
22869 : },
22870 : { .name = NULL }
22871 : };
22872 :
22873 0 : static PyObject *py_svcctl_QueryServiceConfigA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22874 : {
22875 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfigA, type);
22876 0 : struct svcctl_QueryServiceConfigA *_self = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(self);
22877 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22878 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22879 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
22880 0 : return self;
22881 : }
22882 :
22883 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22884 : {
22885 :
22886 :
22887 0 : return PyLong_FromLong(29);
22888 : }
22889 :
22890 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
22891 : {
22892 0 : const struct ndr_interface_call *call = NULL;
22893 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
22894 0 : PyObject *ret = NULL;
22895 0 : struct ndr_push *push = NULL;
22896 : DATA_BLOB blob;
22897 : enum ndr_err_code err;
22898 :
22899 0 : if (ndr_table_svcctl.num_calls < 30) {
22900 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigA_ndr_pack");
22901 0 : return NULL;
22902 : }
22903 0 : call = &ndr_table_svcctl.calls[29];
22904 :
22905 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22906 0 : if (push == NULL) {
22907 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22908 0 : return NULL;
22909 : }
22910 :
22911 0 : push->flags |= ndr_push_flags;
22912 :
22913 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22914 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22915 0 : TALLOC_FREE(push);
22916 0 : PyErr_SetNdrError(err);
22917 0 : return NULL;
22918 : }
22919 0 : blob = ndr_push_blob(push);
22920 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22921 0 : TALLOC_FREE(push);
22922 0 : return ret;
22923 : }
22924 :
22925 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22926 : {
22927 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22928 0 : PyObject *bigendian_obj = NULL;
22929 0 : PyObject *ndr64_obj = NULL;
22930 0 : uint32_t ndr_push_flags = 0;
22931 :
22932 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22933 : discard_const_p(char *, kwnames),
22934 : &bigendian_obj,
22935 : &ndr64_obj)) {
22936 0 : return NULL;
22937 : }
22938 :
22939 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22940 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22941 : }
22942 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22943 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22944 : }
22945 :
22946 0 : return py_svcctl_QueryServiceConfigA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22947 : }
22948 :
22949 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22950 : {
22951 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22952 0 : PyObject *bigendian_obj = NULL;
22953 0 : PyObject *ndr64_obj = NULL;
22954 0 : uint32_t ndr_push_flags = 0;
22955 :
22956 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22957 : discard_const_p(char *, kwnames),
22958 : &bigendian_obj,
22959 : &ndr64_obj)) {
22960 0 : return NULL;
22961 : }
22962 :
22963 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22964 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22965 : }
22966 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22967 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22968 : }
22969 :
22970 0 : return py_svcctl_QueryServiceConfigA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22971 : }
22972 :
22973 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
22974 : {
22975 0 : const struct ndr_interface_call *call = NULL;
22976 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
22977 0 : struct ndr_pull *pull = NULL;
22978 : enum ndr_err_code err;
22979 :
22980 0 : if (ndr_table_svcctl.num_calls < 30) {
22981 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigA_ndr_unpack");
22982 0 : return NULL;
22983 : }
22984 0 : call = &ndr_table_svcctl.calls[29];
22985 :
22986 0 : pull = ndr_pull_init_blob(blob, object);
22987 0 : if (pull == NULL) {
22988 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22989 0 : return NULL;
22990 : }
22991 :
22992 0 : pull->flags |= ndr_pull_flags;
22993 :
22994 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22995 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22996 0 : TALLOC_FREE(pull);
22997 0 : PyErr_SetNdrError(err);
22998 0 : return NULL;
22999 : }
23000 0 : if (!allow_remaining) {
23001 : uint32_t highest_ofs;
23002 :
23003 0 : if (pull->offset > pull->relative_highest_offset) {
23004 0 : highest_ofs = pull->offset;
23005 : } else {
23006 0 : highest_ofs = pull->relative_highest_offset;
23007 : }
23008 0 : if (highest_ofs < pull->data_size) {
23009 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23010 : "not all bytes consumed ofs[%u] size[%u]",
23011 : highest_ofs, pull->data_size);
23012 0 : TALLOC_FREE(pull);
23013 0 : PyErr_SetNdrError(err);
23014 0 : return NULL;
23015 : }
23016 : }
23017 :
23018 0 : TALLOC_FREE(pull);
23019 0 : Py_RETURN_NONE;
23020 : }
23021 :
23022 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23023 : {
23024 : DATA_BLOB blob;
23025 0 : Py_ssize_t blob_length = 0;
23026 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23027 0 : PyObject *bigendian_obj = NULL;
23028 0 : PyObject *ndr64_obj = NULL;
23029 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23030 0 : PyObject *allow_remaining_obj = NULL;
23031 0 : bool allow_remaining = false;
23032 :
23033 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23034 : discard_const_p(char *, kwnames),
23035 : &blob.data, &blob_length,
23036 : &bigendian_obj,
23037 : &ndr64_obj,
23038 : &allow_remaining_obj)) {
23039 0 : return NULL;
23040 : }
23041 0 : blob.length = blob_length;
23042 :
23043 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23044 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23045 : }
23046 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23047 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23048 : }
23049 :
23050 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23051 0 : allow_remaining = true;
23052 : }
23053 :
23054 0 : return py_svcctl_QueryServiceConfigA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23055 : }
23056 :
23057 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23058 : {
23059 : DATA_BLOB blob;
23060 0 : Py_ssize_t blob_length = 0;
23061 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23062 0 : PyObject *bigendian_obj = NULL;
23063 0 : PyObject *ndr64_obj = NULL;
23064 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23065 0 : PyObject *allow_remaining_obj = NULL;
23066 0 : bool allow_remaining = false;
23067 :
23068 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23069 : discard_const_p(char *, kwnames),
23070 : &blob.data, &blob_length,
23071 : &bigendian_obj,
23072 : &ndr64_obj,
23073 : &allow_remaining_obj)) {
23074 0 : return NULL;
23075 : }
23076 0 : blob.length = blob_length;
23077 :
23078 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23079 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23080 : }
23081 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23082 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23083 : }
23084 :
23085 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23086 0 : allow_remaining = true;
23087 : }
23088 :
23089 0 : return py_svcctl_QueryServiceConfigA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23090 : }
23091 :
23092 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
23093 : {
23094 0 : const struct ndr_interface_call *call = NULL;
23095 0 : struct svcctl_QueryServiceConfigA *object = (struct svcctl_QueryServiceConfigA *)pytalloc_get_ptr(py_obj);
23096 : PyObject *ret;
23097 : char *retstr;
23098 :
23099 0 : if (ndr_table_svcctl.num_calls < 30) {
23100 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfigA_ndr_print");
23101 0 : return NULL;
23102 : }
23103 0 : call = &ndr_table_svcctl.calls[29];
23104 :
23105 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23106 0 : ret = PyUnicode_FromString(retstr);
23107 0 : TALLOC_FREE(retstr);
23108 :
23109 0 : return ret;
23110 : }
23111 :
23112 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23113 : {
23114 0 : return py_svcctl_QueryServiceConfigA_ndr_print(py_obj, "svcctl_QueryServiceConfigA_in", NDR_IN);
23115 : }
23116 :
23117 0 : static PyObject *py_svcctl_QueryServiceConfigA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23118 : {
23119 0 : return py_svcctl_QueryServiceConfigA_ndr_print(py_obj, "svcctl_QueryServiceConfigA_out", NDR_OUT);
23120 : }
23121 :
23122 : static PyMethodDef py_svcctl_QueryServiceConfigA_methods[] = {
23123 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfigA_ndr_opnum, METH_NOARGS|METH_CLASS,
23124 : "svcctl.QueryServiceConfigA.opnum() -> 29 (0x1d) " },
23125 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23126 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23127 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23128 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23129 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23130 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23131 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfigA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23132 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23133 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfigA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23134 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfigA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23135 : { NULL, NULL, 0, NULL }
23136 : };
23137 :
23138 :
23139 : static PyTypeObject svcctl_QueryServiceConfigA_Type = {
23140 : PyVarObject_HEAD_INIT(NULL, 0)
23141 : .tp_name = "svcctl.QueryServiceConfigA",
23142 : .tp_getset = py_svcctl_QueryServiceConfigA_getsetters,
23143 : .tp_methods = py_svcctl_QueryServiceConfigA_methods,
23144 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23145 : .tp_new = py_svcctl_QueryServiceConfigA_new,
23146 : };
23147 :
23148 0 : static bool pack_py_svcctl_QueryServiceConfigA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfigA *r)
23149 : {
23150 : PyObject *py_handle;
23151 : PyObject *py_offered;
23152 0 : const char *kwnames[] = {
23153 : "handle", "offered", NULL
23154 : };
23155 :
23156 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceConfigA", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
23157 0 : return false;
23158 : }
23159 :
23160 0 : if (py_handle == NULL) {
23161 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
23162 0 : return false;
23163 : }
23164 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23165 0 : if (r->in.handle == NULL) {
23166 0 : PyErr_NoMemory();
23167 0 : return false;
23168 : }
23169 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23170 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23171 0 : PyErr_NoMemory();
23172 0 : return false;
23173 : }
23174 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23175 0 : if (py_offered == NULL) {
23176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
23177 0 : return false;
23178 : }
23179 : {
23180 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
23181 0 : if (PyLong_Check(py_offered)) {
23182 : unsigned long long test_var;
23183 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
23184 0 : if (PyErr_Occurred() != NULL) {
23185 0 : return false;
23186 : }
23187 0 : if (test_var > uint_max) {
23188 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23189 : PyLong_Type.tp_name, uint_max, test_var);
23190 0 : return false;
23191 : }
23192 0 : r->in.offered = test_var;
23193 : } else {
23194 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23195 : PyLong_Type.tp_name);
23196 0 : return false;
23197 : }
23198 : }
23199 0 : return true;
23200 : }
23201 :
23202 0 : static PyObject *unpack_py_svcctl_QueryServiceConfigA_args_out(struct svcctl_QueryServiceConfigA *r)
23203 : {
23204 : PyObject *result;
23205 : PyObject *py_query;
23206 : PyObject *py_needed;
23207 0 : result = PyTuple_New(2);
23208 0 : py_query = PyList_New(r->in.offered);
23209 0 : if (py_query == NULL) {
23210 0 : return NULL;
23211 : }
23212 : {
23213 : int query_cntr_0;
23214 0 : for (query_cntr_0 = 0; query_cntr_0 < (r->in.offered); query_cntr_0++) {
23215 : PyObject *py_query_0;
23216 0 : py_query_0 = PyLong_FromLong((uint16_t)r->out.query[query_cntr_0]);
23217 0 : PyList_SetItem(py_query, query_cntr_0, py_query_0);
23218 : }
23219 : }
23220 0 : PyTuple_SetItem(result, 0, py_query);
23221 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
23222 0 : PyTuple_SetItem(result, 1, py_needed);
23223 0 : if (!W_ERROR_IS_OK(r->out.result)) {
23224 0 : PyErr_SetWERROR(r->out.result);
23225 0 : return NULL;
23226 : }
23227 :
23228 0 : return result;
23229 : }
23230 :
23231 :
23232 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_in_get_handle(PyObject *obj, void *closure)
23233 : {
23234 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
23235 : PyObject *py_handle;
23236 0 : if (object->in.handle == NULL) {
23237 0 : Py_RETURN_NONE;
23238 : }
23239 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
23240 0 : return py_handle;
23241 : }
23242 :
23243 0 : static int py_svcctl_QueryServiceLockStatusA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
23244 : {
23245 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23246 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
23247 0 : if (value == NULL) {
23248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
23249 0 : return -1;
23250 : }
23251 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
23252 0 : if (object->in.handle == NULL) {
23253 0 : PyErr_NoMemory();
23254 0 : return -1;
23255 : }
23256 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23257 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23258 0 : PyErr_NoMemory();
23259 0 : return -1;
23260 : }
23261 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
23262 0 : return 0;
23263 : }
23264 :
23265 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_in_get_offered(PyObject *obj, void *closure)
23266 : {
23267 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
23268 : PyObject *py_offered;
23269 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
23270 0 : return py_offered;
23271 : }
23272 :
23273 0 : static int py_svcctl_QueryServiceLockStatusA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
23274 : {
23275 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23276 0 : if (value == NULL) {
23277 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
23278 0 : return -1;
23279 : }
23280 : {
23281 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
23282 0 : if (PyLong_Check(value)) {
23283 : unsigned long long test_var;
23284 0 : test_var = PyLong_AsUnsignedLongLong(value);
23285 0 : if (PyErr_Occurred() != NULL) {
23286 0 : return -1;
23287 : }
23288 0 : if (test_var > uint_max) {
23289 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23290 : PyLong_Type.tp_name, uint_max, test_var);
23291 0 : return -1;
23292 : }
23293 0 : object->in.offered = test_var;
23294 : } else {
23295 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23296 : PyLong_Type.tp_name);
23297 0 : return -1;
23298 : }
23299 : }
23300 0 : return 0;
23301 : }
23302 :
23303 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_out_get_lock_status(PyObject *obj, void *closure)
23304 : {
23305 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
23306 : PyObject *py_lock_status;
23307 0 : if (object->out.lock_status == NULL) {
23308 0 : Py_RETURN_NONE;
23309 : }
23310 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, object->out.lock_status, object->out.lock_status);
23311 0 : return py_lock_status;
23312 : }
23313 :
23314 0 : static int py_svcctl_QueryServiceLockStatusA_out_set_lock_status(PyObject *py_obj, PyObject *value, void *closure)
23315 : {
23316 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23317 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.lock_status));
23318 0 : if (value == NULL) {
23319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.lock_status");
23320 0 : return -1;
23321 : }
23322 0 : object->out.lock_status = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.lock_status);
23323 0 : if (object->out.lock_status == NULL) {
23324 0 : PyErr_NoMemory();
23325 0 : return -1;
23326 : }
23327 0 : PY_CHECK_TYPE(&SERVICE_LOCK_STATUS_Type, value, return -1;);
23328 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23329 0 : PyErr_NoMemory();
23330 0 : return -1;
23331 : }
23332 0 : object->out.lock_status = (struct SERVICE_LOCK_STATUS *)pytalloc_get_ptr(value);
23333 0 : return 0;
23334 : }
23335 :
23336 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_out_get_needed(PyObject *obj, void *closure)
23337 : {
23338 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
23339 : PyObject *py_needed;
23340 0 : if (object->out.needed == NULL) {
23341 0 : Py_RETURN_NONE;
23342 : }
23343 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
23344 0 : return py_needed;
23345 : }
23346 :
23347 0 : static int py_svcctl_QueryServiceLockStatusA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
23348 : {
23349 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23350 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
23351 0 : if (value == NULL) {
23352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
23353 0 : return -1;
23354 : }
23355 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
23356 0 : if (object->out.needed == NULL) {
23357 0 : PyErr_NoMemory();
23358 0 : return -1;
23359 : }
23360 : {
23361 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
23362 0 : if (PyLong_Check(value)) {
23363 : unsigned long long test_var;
23364 0 : test_var = PyLong_AsUnsignedLongLong(value);
23365 0 : if (PyErr_Occurred() != NULL) {
23366 0 : return -1;
23367 : }
23368 0 : if (test_var > uint_max) {
23369 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23370 : PyLong_Type.tp_name, uint_max, test_var);
23371 0 : return -1;
23372 : }
23373 0 : *object->out.needed = test_var;
23374 : } else {
23375 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23376 : PyLong_Type.tp_name);
23377 0 : return -1;
23378 : }
23379 : }
23380 0 : return 0;
23381 : }
23382 :
23383 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_get_result(PyObject *obj, void *closure)
23384 : {
23385 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(obj);
23386 : PyObject *py_result;
23387 0 : py_result = PyErr_FromWERROR(object->out.result);
23388 0 : return py_result;
23389 : }
23390 :
23391 0 : static int py_svcctl_QueryServiceLockStatusA_set_result(PyObject *py_obj, PyObject *value, void *closure)
23392 : {
23393 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23394 0 : if (value == NULL) {
23395 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23396 0 : return -1;
23397 : }
23398 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
23399 0 : return 0;
23400 : }
23401 :
23402 : static PyGetSetDef py_svcctl_QueryServiceLockStatusA_getsetters[] = {
23403 : {
23404 : .name = discard_const_p(char, "in_handle"),
23405 : .get = py_svcctl_QueryServiceLockStatusA_in_get_handle,
23406 : .set = py_svcctl_QueryServiceLockStatusA_in_set_handle,
23407 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23408 : },
23409 : {
23410 : .name = discard_const_p(char, "in_offered"),
23411 : .get = py_svcctl_QueryServiceLockStatusA_in_get_offered,
23412 : .set = py_svcctl_QueryServiceLockStatusA_in_set_offered,
23413 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23414 : },
23415 : {
23416 : .name = discard_const_p(char, "out_lock_status"),
23417 : .get = py_svcctl_QueryServiceLockStatusA_out_get_lock_status,
23418 : .set = py_svcctl_QueryServiceLockStatusA_out_set_lock_status,
23419 : .doc = discard_const_p(char, "PIDL-generated element of base type SERVICE_LOCK_STATUS")
23420 : },
23421 : {
23422 : .name = discard_const_p(char, "out_needed"),
23423 : .get = py_svcctl_QueryServiceLockStatusA_out_get_needed,
23424 : .set = py_svcctl_QueryServiceLockStatusA_out_set_needed,
23425 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23426 : },
23427 : {
23428 : .name = discard_const_p(char, "result"),
23429 : .get = py_svcctl_QueryServiceLockStatusA_get_result,
23430 : .set = py_svcctl_QueryServiceLockStatusA_set_result,
23431 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
23432 : },
23433 : { .name = NULL }
23434 : };
23435 :
23436 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23437 : {
23438 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceLockStatusA, type);
23439 0 : struct svcctl_QueryServiceLockStatusA *_self = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(self);
23440 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23441 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23442 0 : _self->out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
23443 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
23444 0 : return self;
23445 : }
23446 :
23447 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23448 : {
23449 :
23450 :
23451 0 : return PyLong_FromLong(30);
23452 : }
23453 :
23454 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
23455 : {
23456 0 : const struct ndr_interface_call *call = NULL;
23457 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23458 0 : PyObject *ret = NULL;
23459 0 : struct ndr_push *push = NULL;
23460 : DATA_BLOB blob;
23461 : enum ndr_err_code err;
23462 :
23463 0 : if (ndr_table_svcctl.num_calls < 31) {
23464 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusA_ndr_pack");
23465 0 : return NULL;
23466 : }
23467 0 : call = &ndr_table_svcctl.calls[30];
23468 :
23469 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23470 0 : if (push == NULL) {
23471 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23472 0 : return NULL;
23473 : }
23474 :
23475 0 : push->flags |= ndr_push_flags;
23476 :
23477 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23478 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23479 0 : TALLOC_FREE(push);
23480 0 : PyErr_SetNdrError(err);
23481 0 : return NULL;
23482 : }
23483 0 : blob = ndr_push_blob(push);
23484 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23485 0 : TALLOC_FREE(push);
23486 0 : return ret;
23487 : }
23488 :
23489 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23490 : {
23491 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23492 0 : PyObject *bigendian_obj = NULL;
23493 0 : PyObject *ndr64_obj = NULL;
23494 0 : uint32_t ndr_push_flags = 0;
23495 :
23496 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23497 : discard_const_p(char *, kwnames),
23498 : &bigendian_obj,
23499 : &ndr64_obj)) {
23500 0 : return NULL;
23501 : }
23502 :
23503 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23504 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23505 : }
23506 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23507 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23508 : }
23509 :
23510 0 : return py_svcctl_QueryServiceLockStatusA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23511 : }
23512 :
23513 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23514 : {
23515 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23516 0 : PyObject *bigendian_obj = NULL;
23517 0 : PyObject *ndr64_obj = NULL;
23518 0 : uint32_t ndr_push_flags = 0;
23519 :
23520 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23521 : discard_const_p(char *, kwnames),
23522 : &bigendian_obj,
23523 : &ndr64_obj)) {
23524 0 : return NULL;
23525 : }
23526 :
23527 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23528 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23529 : }
23530 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23531 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23532 : }
23533 :
23534 0 : return py_svcctl_QueryServiceLockStatusA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23535 : }
23536 :
23537 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
23538 : {
23539 0 : const struct ndr_interface_call *call = NULL;
23540 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23541 0 : struct ndr_pull *pull = NULL;
23542 : enum ndr_err_code err;
23543 :
23544 0 : if (ndr_table_svcctl.num_calls < 31) {
23545 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusA_ndr_unpack");
23546 0 : return NULL;
23547 : }
23548 0 : call = &ndr_table_svcctl.calls[30];
23549 :
23550 0 : pull = ndr_pull_init_blob(blob, object);
23551 0 : if (pull == NULL) {
23552 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23553 0 : return NULL;
23554 : }
23555 :
23556 0 : pull->flags |= ndr_pull_flags;
23557 :
23558 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23559 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23560 0 : TALLOC_FREE(pull);
23561 0 : PyErr_SetNdrError(err);
23562 0 : return NULL;
23563 : }
23564 0 : if (!allow_remaining) {
23565 : uint32_t highest_ofs;
23566 :
23567 0 : if (pull->offset > pull->relative_highest_offset) {
23568 0 : highest_ofs = pull->offset;
23569 : } else {
23570 0 : highest_ofs = pull->relative_highest_offset;
23571 : }
23572 0 : if (highest_ofs < pull->data_size) {
23573 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23574 : "not all bytes consumed ofs[%u] size[%u]",
23575 : highest_ofs, pull->data_size);
23576 0 : TALLOC_FREE(pull);
23577 0 : PyErr_SetNdrError(err);
23578 0 : return NULL;
23579 : }
23580 : }
23581 :
23582 0 : TALLOC_FREE(pull);
23583 0 : Py_RETURN_NONE;
23584 : }
23585 :
23586 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23587 : {
23588 : DATA_BLOB blob;
23589 0 : Py_ssize_t blob_length = 0;
23590 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23591 0 : PyObject *bigendian_obj = NULL;
23592 0 : PyObject *ndr64_obj = NULL;
23593 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23594 0 : PyObject *allow_remaining_obj = NULL;
23595 0 : bool allow_remaining = false;
23596 :
23597 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23598 : discard_const_p(char *, kwnames),
23599 : &blob.data, &blob_length,
23600 : &bigendian_obj,
23601 : &ndr64_obj,
23602 : &allow_remaining_obj)) {
23603 0 : return NULL;
23604 : }
23605 0 : blob.length = blob_length;
23606 :
23607 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23608 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23609 : }
23610 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23611 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23612 : }
23613 :
23614 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23615 0 : allow_remaining = true;
23616 : }
23617 :
23618 0 : return py_svcctl_QueryServiceLockStatusA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23619 : }
23620 :
23621 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23622 : {
23623 : DATA_BLOB blob;
23624 0 : Py_ssize_t blob_length = 0;
23625 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23626 0 : PyObject *bigendian_obj = NULL;
23627 0 : PyObject *ndr64_obj = NULL;
23628 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23629 0 : PyObject *allow_remaining_obj = NULL;
23630 0 : bool allow_remaining = false;
23631 :
23632 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23633 : discard_const_p(char *, kwnames),
23634 : &blob.data, &blob_length,
23635 : &bigendian_obj,
23636 : &ndr64_obj,
23637 : &allow_remaining_obj)) {
23638 0 : return NULL;
23639 : }
23640 0 : blob.length = blob_length;
23641 :
23642 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23643 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23644 : }
23645 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23646 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23647 : }
23648 :
23649 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23650 0 : allow_remaining = true;
23651 : }
23652 :
23653 0 : return py_svcctl_QueryServiceLockStatusA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23654 : }
23655 :
23656 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
23657 : {
23658 0 : const struct ndr_interface_call *call = NULL;
23659 0 : struct svcctl_QueryServiceLockStatusA *object = (struct svcctl_QueryServiceLockStatusA *)pytalloc_get_ptr(py_obj);
23660 : PyObject *ret;
23661 : char *retstr;
23662 :
23663 0 : if (ndr_table_svcctl.num_calls < 31) {
23664 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceLockStatusA_ndr_print");
23665 0 : return NULL;
23666 : }
23667 0 : call = &ndr_table_svcctl.calls[30];
23668 :
23669 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23670 0 : ret = PyUnicode_FromString(retstr);
23671 0 : TALLOC_FREE(retstr);
23672 :
23673 0 : return ret;
23674 : }
23675 :
23676 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23677 : {
23678 0 : return py_svcctl_QueryServiceLockStatusA_ndr_print(py_obj, "svcctl_QueryServiceLockStatusA_in", NDR_IN);
23679 : }
23680 :
23681 0 : static PyObject *py_svcctl_QueryServiceLockStatusA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23682 : {
23683 0 : return py_svcctl_QueryServiceLockStatusA_ndr_print(py_obj, "svcctl_QueryServiceLockStatusA_out", NDR_OUT);
23684 : }
23685 :
23686 : static PyMethodDef py_svcctl_QueryServiceLockStatusA_methods[] = {
23687 : { "opnum", (PyCFunction)py_svcctl_QueryServiceLockStatusA_ndr_opnum, METH_NOARGS|METH_CLASS,
23688 : "svcctl.QueryServiceLockStatusA.opnum() -> 30 (0x1e) " },
23689 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23690 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23691 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23692 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23693 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23694 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23695 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceLockStatusA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23696 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23697 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceLockStatusA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23698 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceLockStatusA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23699 : { NULL, NULL, 0, NULL }
23700 : };
23701 :
23702 :
23703 : static PyTypeObject svcctl_QueryServiceLockStatusA_Type = {
23704 : PyVarObject_HEAD_INIT(NULL, 0)
23705 : .tp_name = "svcctl.QueryServiceLockStatusA",
23706 : .tp_getset = py_svcctl_QueryServiceLockStatusA_getsetters,
23707 : .tp_methods = py_svcctl_QueryServiceLockStatusA_methods,
23708 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23709 : .tp_new = py_svcctl_QueryServiceLockStatusA_new,
23710 : };
23711 :
23712 0 : static bool pack_py_svcctl_QueryServiceLockStatusA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceLockStatusA *r)
23713 : {
23714 : PyObject *py_handle;
23715 : PyObject *py_offered;
23716 0 : const char *kwnames[] = {
23717 : "handle", "offered", NULL
23718 : };
23719 :
23720 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:svcctl_QueryServiceLockStatusA", discard_const_p(char *, kwnames), &py_handle, &py_offered)) {
23721 0 : return false;
23722 : }
23723 :
23724 0 : if (py_handle == NULL) {
23725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
23726 0 : return false;
23727 : }
23728 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23729 0 : if (r->in.handle == NULL) {
23730 0 : PyErr_NoMemory();
23731 0 : return false;
23732 : }
23733 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23734 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23735 0 : PyErr_NoMemory();
23736 0 : return false;
23737 : }
23738 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23739 0 : if (py_offered == NULL) {
23740 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
23741 0 : return false;
23742 : }
23743 : {
23744 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
23745 0 : if (PyLong_Check(py_offered)) {
23746 : unsigned long long test_var;
23747 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
23748 0 : if (PyErr_Occurred() != NULL) {
23749 0 : return false;
23750 : }
23751 0 : if (test_var > uint_max) {
23752 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23753 : PyLong_Type.tp_name, uint_max, test_var);
23754 0 : return false;
23755 : }
23756 0 : r->in.offered = test_var;
23757 : } else {
23758 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23759 : PyLong_Type.tp_name);
23760 0 : return false;
23761 : }
23762 : }
23763 0 : return true;
23764 : }
23765 :
23766 0 : static PyObject *unpack_py_svcctl_QueryServiceLockStatusA_args_out(struct svcctl_QueryServiceLockStatusA *r)
23767 : {
23768 : PyObject *result;
23769 : PyObject *py_lock_status;
23770 : PyObject *py_needed;
23771 0 : result = PyTuple_New(2);
23772 0 : py_lock_status = pytalloc_reference_ex(&SERVICE_LOCK_STATUS_Type, r->out.lock_status, r->out.lock_status);
23773 0 : PyTuple_SetItem(result, 0, py_lock_status);
23774 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
23775 0 : PyTuple_SetItem(result, 1, py_needed);
23776 0 : if (!W_ERROR_IS_OK(r->out.result)) {
23777 0 : PyErr_SetWERROR(r->out.result);
23778 0 : return NULL;
23779 : }
23780 :
23781 0 : return result;
23782 : }
23783 :
23784 :
23785 0 : static PyObject *py_svcctl_StartServiceA_in_get_handle(PyObject *obj, void *closure)
23786 : {
23787 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
23788 : PyObject *py_handle;
23789 0 : if (object->in.handle == NULL) {
23790 0 : Py_RETURN_NONE;
23791 : }
23792 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
23793 0 : return py_handle;
23794 : }
23795 :
23796 0 : static int py_svcctl_StartServiceA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
23797 : {
23798 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
23799 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
23800 0 : if (value == NULL) {
23801 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
23802 0 : return -1;
23803 : }
23804 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
23805 0 : if (object->in.handle == NULL) {
23806 0 : PyErr_NoMemory();
23807 0 : return -1;
23808 : }
23809 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23810 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23811 0 : PyErr_NoMemory();
23812 0 : return -1;
23813 : }
23814 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
23815 0 : return 0;
23816 : }
23817 :
23818 0 : static PyObject *py_svcctl_StartServiceA_in_get_NumArgs(PyObject *obj, void *closure)
23819 : {
23820 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
23821 : PyObject *py_NumArgs;
23822 0 : py_NumArgs = PyLong_FromUnsignedLongLong((uint32_t)object->in.NumArgs);
23823 0 : return py_NumArgs;
23824 : }
23825 :
23826 0 : static int py_svcctl_StartServiceA_in_set_NumArgs(PyObject *py_obj, PyObject *value, void *closure)
23827 : {
23828 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
23829 0 : if (value == NULL) {
23830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.NumArgs");
23831 0 : return -1;
23832 : }
23833 : {
23834 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.NumArgs));
23835 0 : if (PyLong_Check(value)) {
23836 : unsigned long long test_var;
23837 0 : test_var = PyLong_AsUnsignedLongLong(value);
23838 0 : if (PyErr_Occurred() != NULL) {
23839 0 : return -1;
23840 : }
23841 0 : if (test_var > uint_max) {
23842 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23843 : PyLong_Type.tp_name, uint_max, test_var);
23844 0 : return -1;
23845 : }
23846 0 : object->in.NumArgs = test_var;
23847 : } else {
23848 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23849 : PyLong_Type.tp_name);
23850 0 : return -1;
23851 : }
23852 : }
23853 0 : return 0;
23854 : }
23855 :
23856 0 : static PyObject *py_svcctl_StartServiceA_in_get_Arguments(PyObject *obj, void *closure)
23857 : {
23858 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
23859 : PyObject *py_Arguments;
23860 0 : if (object->in.Arguments == NULL) {
23861 0 : Py_RETURN_NONE;
23862 : }
23863 0 : if (object->in.Arguments == NULL) {
23864 0 : py_Arguments = Py_None;
23865 0 : Py_INCREF(py_Arguments);
23866 : } else {
23867 0 : if (object->in.Arguments == NULL) {
23868 0 : py_Arguments = Py_None;
23869 0 : Py_INCREF(py_Arguments);
23870 : } else {
23871 0 : py_Arguments = PyUnicode_Decode(object->in.Arguments, strlen(object->in.Arguments), "utf-8", "ignore");
23872 : }
23873 : }
23874 0 : return py_Arguments;
23875 : }
23876 :
23877 0 : static int py_svcctl_StartServiceA_in_set_Arguments(PyObject *py_obj, PyObject *value, void *closure)
23878 : {
23879 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
23880 0 : if (value == NULL) {
23881 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Arguments");
23882 0 : return -1;
23883 : }
23884 0 : if (value == Py_None) {
23885 0 : object->in.Arguments = NULL;
23886 : } else {
23887 0 : object->in.Arguments = NULL;
23888 : {
23889 : const char *test_str;
23890 : const char *talloc_str;
23891 0 : PyObject *unicode = NULL;
23892 0 : if (PyUnicode_Check(value)) {
23893 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
23894 0 : if (unicode == NULL) {
23895 0 : PyErr_NoMemory();
23896 0 : return -1;
23897 : }
23898 0 : test_str = PyBytes_AS_STRING(unicode);
23899 0 : } else if (PyBytes_Check(value)) {
23900 0 : test_str = PyBytes_AS_STRING(value);
23901 : } else {
23902 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
23903 0 : return -1;
23904 : }
23905 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
23906 0 : if (unicode != NULL) {
23907 0 : Py_DECREF(unicode);
23908 : }
23909 0 : if (talloc_str == NULL) {
23910 0 : PyErr_NoMemory();
23911 0 : return -1;
23912 : }
23913 0 : object->in.Arguments = talloc_str;
23914 : }
23915 : }
23916 0 : return 0;
23917 : }
23918 :
23919 0 : static PyObject *py_svcctl_StartServiceA_get_result(PyObject *obj, void *closure)
23920 : {
23921 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(obj);
23922 : PyObject *py_result;
23923 0 : py_result = PyErr_FromWERROR(object->out.result);
23924 0 : return py_result;
23925 : }
23926 :
23927 0 : static int py_svcctl_StartServiceA_set_result(PyObject *py_obj, PyObject *value, void *closure)
23928 : {
23929 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
23930 0 : if (value == NULL) {
23931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23932 0 : return -1;
23933 : }
23934 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
23935 0 : return 0;
23936 : }
23937 :
23938 : static PyGetSetDef py_svcctl_StartServiceA_getsetters[] = {
23939 : {
23940 : .name = discard_const_p(char, "in_handle"),
23941 : .get = py_svcctl_StartServiceA_in_get_handle,
23942 : .set = py_svcctl_StartServiceA_in_set_handle,
23943 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23944 : },
23945 : {
23946 : .name = discard_const_p(char, "in_NumArgs"),
23947 : .get = py_svcctl_StartServiceA_in_get_NumArgs,
23948 : .set = py_svcctl_StartServiceA_in_set_NumArgs,
23949 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23950 : },
23951 : {
23952 : .name = discard_const_p(char, "in_Arguments"),
23953 : .get = py_svcctl_StartServiceA_in_get_Arguments,
23954 : .set = py_svcctl_StartServiceA_in_set_Arguments,
23955 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
23956 : },
23957 : {
23958 : .name = discard_const_p(char, "result"),
23959 : .get = py_svcctl_StartServiceA_get_result,
23960 : .set = py_svcctl_StartServiceA_set_result,
23961 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
23962 : },
23963 : { .name = NULL }
23964 : };
23965 :
23966 0 : static PyObject *py_svcctl_StartServiceA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23967 : {
23968 0 : PyObject *self = pytalloc_new(struct svcctl_StartServiceA, type);
23969 0 : struct svcctl_StartServiceA *_self = (struct svcctl_StartServiceA *)pytalloc_get_ptr(self);
23970 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23971 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23972 0 : return self;
23973 : }
23974 :
23975 0 : static PyObject *py_svcctl_StartServiceA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23976 : {
23977 :
23978 :
23979 0 : return PyLong_FromLong(31);
23980 : }
23981 :
23982 0 : static PyObject *py_svcctl_StartServiceA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
23983 : {
23984 0 : const struct ndr_interface_call *call = NULL;
23985 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
23986 0 : PyObject *ret = NULL;
23987 0 : struct ndr_push *push = NULL;
23988 : DATA_BLOB blob;
23989 : enum ndr_err_code err;
23990 :
23991 0 : if (ndr_table_svcctl.num_calls < 32) {
23992 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceA_ndr_pack");
23993 0 : return NULL;
23994 : }
23995 0 : call = &ndr_table_svcctl.calls[31];
23996 :
23997 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23998 0 : if (push == NULL) {
23999 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24000 0 : return NULL;
24001 : }
24002 :
24003 0 : push->flags |= ndr_push_flags;
24004 :
24005 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24006 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24007 0 : TALLOC_FREE(push);
24008 0 : PyErr_SetNdrError(err);
24009 0 : return NULL;
24010 : }
24011 0 : blob = ndr_push_blob(push);
24012 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24013 0 : TALLOC_FREE(push);
24014 0 : return ret;
24015 : }
24016 :
24017 0 : static PyObject *py_svcctl_StartServiceA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24018 : {
24019 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24020 0 : PyObject *bigendian_obj = NULL;
24021 0 : PyObject *ndr64_obj = NULL;
24022 0 : uint32_t ndr_push_flags = 0;
24023 :
24024 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24025 : discard_const_p(char *, kwnames),
24026 : &bigendian_obj,
24027 : &ndr64_obj)) {
24028 0 : return NULL;
24029 : }
24030 :
24031 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24032 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24033 : }
24034 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24035 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24036 : }
24037 :
24038 0 : return py_svcctl_StartServiceA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24039 : }
24040 :
24041 0 : static PyObject *py_svcctl_StartServiceA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24042 : {
24043 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24044 0 : PyObject *bigendian_obj = NULL;
24045 0 : PyObject *ndr64_obj = NULL;
24046 0 : uint32_t ndr_push_flags = 0;
24047 :
24048 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24049 : discard_const_p(char *, kwnames),
24050 : &bigendian_obj,
24051 : &ndr64_obj)) {
24052 0 : return NULL;
24053 : }
24054 :
24055 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24056 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24057 : }
24058 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24059 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24060 : }
24061 :
24062 0 : return py_svcctl_StartServiceA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24063 : }
24064 :
24065 0 : static PyObject *py_svcctl_StartServiceA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
24066 : {
24067 0 : const struct ndr_interface_call *call = NULL;
24068 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
24069 0 : struct ndr_pull *pull = NULL;
24070 : enum ndr_err_code err;
24071 :
24072 0 : if (ndr_table_svcctl.num_calls < 32) {
24073 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceA_ndr_unpack");
24074 0 : return NULL;
24075 : }
24076 0 : call = &ndr_table_svcctl.calls[31];
24077 :
24078 0 : pull = ndr_pull_init_blob(blob, object);
24079 0 : if (pull == NULL) {
24080 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24081 0 : return NULL;
24082 : }
24083 :
24084 0 : pull->flags |= ndr_pull_flags;
24085 :
24086 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24087 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24088 0 : TALLOC_FREE(pull);
24089 0 : PyErr_SetNdrError(err);
24090 0 : return NULL;
24091 : }
24092 0 : if (!allow_remaining) {
24093 : uint32_t highest_ofs;
24094 :
24095 0 : if (pull->offset > pull->relative_highest_offset) {
24096 0 : highest_ofs = pull->offset;
24097 : } else {
24098 0 : highest_ofs = pull->relative_highest_offset;
24099 : }
24100 0 : if (highest_ofs < pull->data_size) {
24101 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24102 : "not all bytes consumed ofs[%u] size[%u]",
24103 : highest_ofs, pull->data_size);
24104 0 : TALLOC_FREE(pull);
24105 0 : PyErr_SetNdrError(err);
24106 0 : return NULL;
24107 : }
24108 : }
24109 :
24110 0 : TALLOC_FREE(pull);
24111 0 : Py_RETURN_NONE;
24112 : }
24113 :
24114 0 : static PyObject *py_svcctl_StartServiceA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24115 : {
24116 : DATA_BLOB blob;
24117 0 : Py_ssize_t blob_length = 0;
24118 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24119 0 : PyObject *bigendian_obj = NULL;
24120 0 : PyObject *ndr64_obj = NULL;
24121 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24122 0 : PyObject *allow_remaining_obj = NULL;
24123 0 : bool allow_remaining = false;
24124 :
24125 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24126 : discard_const_p(char *, kwnames),
24127 : &blob.data, &blob_length,
24128 : &bigendian_obj,
24129 : &ndr64_obj,
24130 : &allow_remaining_obj)) {
24131 0 : return NULL;
24132 : }
24133 0 : blob.length = blob_length;
24134 :
24135 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24136 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24137 : }
24138 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24139 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24140 : }
24141 :
24142 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24143 0 : allow_remaining = true;
24144 : }
24145 :
24146 0 : return py_svcctl_StartServiceA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24147 : }
24148 :
24149 0 : static PyObject *py_svcctl_StartServiceA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24150 : {
24151 : DATA_BLOB blob;
24152 0 : Py_ssize_t blob_length = 0;
24153 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24154 0 : PyObject *bigendian_obj = NULL;
24155 0 : PyObject *ndr64_obj = NULL;
24156 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24157 0 : PyObject *allow_remaining_obj = NULL;
24158 0 : bool allow_remaining = false;
24159 :
24160 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24161 : discard_const_p(char *, kwnames),
24162 : &blob.data, &blob_length,
24163 : &bigendian_obj,
24164 : &ndr64_obj,
24165 : &allow_remaining_obj)) {
24166 0 : return NULL;
24167 : }
24168 0 : blob.length = blob_length;
24169 :
24170 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24171 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24172 : }
24173 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24174 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24175 : }
24176 :
24177 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24178 0 : allow_remaining = true;
24179 : }
24180 :
24181 0 : return py_svcctl_StartServiceA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24182 : }
24183 :
24184 0 : static PyObject *py_svcctl_StartServiceA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
24185 : {
24186 0 : const struct ndr_interface_call *call = NULL;
24187 0 : struct svcctl_StartServiceA *object = (struct svcctl_StartServiceA *)pytalloc_get_ptr(py_obj);
24188 : PyObject *ret;
24189 : char *retstr;
24190 :
24191 0 : if (ndr_table_svcctl.num_calls < 32) {
24192 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_StartServiceA_ndr_print");
24193 0 : return NULL;
24194 : }
24195 0 : call = &ndr_table_svcctl.calls[31];
24196 :
24197 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24198 0 : ret = PyUnicode_FromString(retstr);
24199 0 : TALLOC_FREE(retstr);
24200 :
24201 0 : return ret;
24202 : }
24203 :
24204 0 : static PyObject *py_svcctl_StartServiceA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24205 : {
24206 0 : return py_svcctl_StartServiceA_ndr_print(py_obj, "svcctl_StartServiceA_in", NDR_IN);
24207 : }
24208 :
24209 0 : static PyObject *py_svcctl_StartServiceA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24210 : {
24211 0 : return py_svcctl_StartServiceA_ndr_print(py_obj, "svcctl_StartServiceA_out", NDR_OUT);
24212 : }
24213 :
24214 : static PyMethodDef py_svcctl_StartServiceA_methods[] = {
24215 : { "opnum", (PyCFunction)py_svcctl_StartServiceA_ndr_opnum, METH_NOARGS|METH_CLASS,
24216 : "svcctl.StartServiceA.opnum() -> 31 (0x1f) " },
24217 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24218 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24219 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24220 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24221 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24222 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24223 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_StartServiceA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24224 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24225 : { "__ndr_print_in__", (PyCFunction)py_svcctl_StartServiceA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24226 : { "__ndr_print_out__", (PyCFunction)py_svcctl_StartServiceA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24227 : { NULL, NULL, 0, NULL }
24228 : };
24229 :
24230 :
24231 : static PyTypeObject svcctl_StartServiceA_Type = {
24232 : PyVarObject_HEAD_INIT(NULL, 0)
24233 : .tp_name = "svcctl.StartServiceA",
24234 : .tp_getset = py_svcctl_StartServiceA_getsetters,
24235 : .tp_methods = py_svcctl_StartServiceA_methods,
24236 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24237 : .tp_new = py_svcctl_StartServiceA_new,
24238 : };
24239 :
24240 0 : static bool pack_py_svcctl_StartServiceA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_StartServiceA *r)
24241 : {
24242 : PyObject *py_handle;
24243 : PyObject *py_NumArgs;
24244 : PyObject *py_Arguments;
24245 0 : const char *kwnames[] = {
24246 : "handle", "NumArgs", "Arguments", NULL
24247 : };
24248 :
24249 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_StartServiceA", discard_const_p(char *, kwnames), &py_handle, &py_NumArgs, &py_Arguments)) {
24250 0 : return false;
24251 : }
24252 :
24253 0 : if (py_handle == NULL) {
24254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
24255 0 : return false;
24256 : }
24257 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
24258 0 : if (r->in.handle == NULL) {
24259 0 : PyErr_NoMemory();
24260 0 : return false;
24261 : }
24262 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
24263 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
24264 0 : PyErr_NoMemory();
24265 0 : return false;
24266 : }
24267 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
24268 0 : if (py_NumArgs == NULL) {
24269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.NumArgs");
24270 0 : return false;
24271 : }
24272 : {
24273 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.NumArgs));
24274 0 : if (PyLong_Check(py_NumArgs)) {
24275 : unsigned long long test_var;
24276 0 : test_var = PyLong_AsUnsignedLongLong(py_NumArgs);
24277 0 : if (PyErr_Occurred() != NULL) {
24278 0 : return false;
24279 : }
24280 0 : if (test_var > uint_max) {
24281 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24282 : PyLong_Type.tp_name, uint_max, test_var);
24283 0 : return false;
24284 : }
24285 0 : r->in.NumArgs = test_var;
24286 : } else {
24287 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24288 : PyLong_Type.tp_name);
24289 0 : return false;
24290 : }
24291 : }
24292 0 : if (py_Arguments == NULL) {
24293 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Arguments");
24294 0 : return false;
24295 : }
24296 0 : if (py_Arguments == Py_None) {
24297 0 : r->in.Arguments = NULL;
24298 : } else {
24299 0 : r->in.Arguments = NULL;
24300 : {
24301 : const char *test_str;
24302 : const char *talloc_str;
24303 0 : PyObject *unicode = NULL;
24304 0 : if (PyUnicode_Check(py_Arguments)) {
24305 0 : unicode = PyUnicode_AsEncodedString(py_Arguments, "utf-8", "ignore");
24306 0 : if (unicode == NULL) {
24307 0 : PyErr_NoMemory();
24308 0 : return false;
24309 : }
24310 0 : test_str = PyBytes_AS_STRING(unicode);
24311 0 : } else if (PyBytes_Check(py_Arguments)) {
24312 0 : test_str = PyBytes_AS_STRING(py_Arguments);
24313 : } else {
24314 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_Arguments)->tp_name);
24315 0 : return false;
24316 : }
24317 0 : talloc_str = talloc_strdup(r, test_str);
24318 0 : if (unicode != NULL) {
24319 0 : Py_DECREF(unicode);
24320 : }
24321 0 : if (talloc_str == NULL) {
24322 0 : PyErr_NoMemory();
24323 0 : return false;
24324 : }
24325 0 : r->in.Arguments = talloc_str;
24326 : }
24327 : }
24328 0 : return true;
24329 : }
24330 :
24331 0 : static PyObject *unpack_py_svcctl_StartServiceA_args_out(struct svcctl_StartServiceA *r)
24332 : {
24333 : PyObject *result;
24334 0 : result = Py_None;
24335 0 : Py_INCREF(result);
24336 0 : if (!W_ERROR_IS_OK(r->out.result)) {
24337 0 : PyErr_SetWERROR(r->out.result);
24338 0 : return NULL;
24339 : }
24340 :
24341 0 : return result;
24342 : }
24343 :
24344 :
24345 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_in_get_handle(PyObject *obj, void *closure)
24346 : {
24347 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
24348 : PyObject *py_handle;
24349 0 : if (object->in.handle == NULL) {
24350 0 : Py_RETURN_NONE;
24351 : }
24352 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
24353 0 : return py_handle;
24354 : }
24355 :
24356 0 : static int py_svcctl_GetServiceDisplayNameA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
24357 : {
24358 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24359 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
24360 0 : if (value == NULL) {
24361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
24362 0 : return -1;
24363 : }
24364 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
24365 0 : if (object->in.handle == NULL) {
24366 0 : PyErr_NoMemory();
24367 0 : return -1;
24368 : }
24369 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24370 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24371 0 : PyErr_NoMemory();
24372 0 : return -1;
24373 : }
24374 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
24375 0 : return 0;
24376 : }
24377 :
24378 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_in_get_service_name(PyObject *obj, void *closure)
24379 : {
24380 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
24381 : PyObject *py_service_name;
24382 0 : if (object->in.service_name == NULL) {
24383 0 : Py_RETURN_NONE;
24384 : }
24385 0 : if (object->in.service_name == NULL) {
24386 0 : py_service_name = Py_None;
24387 0 : Py_INCREF(py_service_name);
24388 : } else {
24389 0 : if (object->in.service_name == NULL) {
24390 0 : py_service_name = Py_None;
24391 0 : Py_INCREF(py_service_name);
24392 : } else {
24393 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
24394 : }
24395 : }
24396 0 : return py_service_name;
24397 : }
24398 :
24399 0 : static int py_svcctl_GetServiceDisplayNameA_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
24400 : {
24401 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24402 0 : if (value == NULL) {
24403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
24404 0 : return -1;
24405 : }
24406 0 : if (value == Py_None) {
24407 0 : object->in.service_name = NULL;
24408 : } else {
24409 0 : object->in.service_name = NULL;
24410 : {
24411 : const char *test_str;
24412 : const char *talloc_str;
24413 0 : PyObject *unicode = NULL;
24414 0 : if (PyUnicode_Check(value)) {
24415 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
24416 0 : if (unicode == NULL) {
24417 0 : PyErr_NoMemory();
24418 0 : return -1;
24419 : }
24420 0 : test_str = PyBytes_AS_STRING(unicode);
24421 0 : } else if (PyBytes_Check(value)) {
24422 0 : test_str = PyBytes_AS_STRING(value);
24423 : } else {
24424 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
24425 0 : return -1;
24426 : }
24427 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
24428 0 : if (unicode != NULL) {
24429 0 : Py_DECREF(unicode);
24430 : }
24431 0 : if (talloc_str == NULL) {
24432 0 : PyErr_NoMemory();
24433 0 : return -1;
24434 : }
24435 0 : object->in.service_name = talloc_str;
24436 : }
24437 : }
24438 0 : return 0;
24439 : }
24440 :
24441 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_out_get_display_name(PyObject *obj, void *closure)
24442 : {
24443 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
24444 : PyObject *py_display_name;
24445 0 : if (object->out.display_name == NULL) {
24446 0 : Py_RETURN_NONE;
24447 : }
24448 0 : if (*object->out.display_name == NULL) {
24449 0 : py_display_name = Py_None;
24450 0 : Py_INCREF(py_display_name);
24451 : } else {
24452 0 : if (*object->out.display_name == NULL) {
24453 0 : py_display_name = Py_None;
24454 0 : Py_INCREF(py_display_name);
24455 : } else {
24456 0 : py_display_name = PyUnicode_Decode(*object->out.display_name, strlen(*object->out.display_name), "utf-8", "ignore");
24457 : }
24458 : }
24459 0 : return py_display_name;
24460 : }
24461 :
24462 0 : static int py_svcctl_GetServiceDisplayNameA_out_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
24463 : {
24464 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24465 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name));
24466 0 : if (value == NULL) {
24467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name");
24468 0 : return -1;
24469 : }
24470 0 : object->out.display_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name);
24471 0 : if (object->out.display_name == NULL) {
24472 0 : PyErr_NoMemory();
24473 0 : return -1;
24474 : }
24475 0 : if (value == Py_None) {
24476 0 : *object->out.display_name = NULL;
24477 : } else {
24478 0 : *object->out.display_name = NULL;
24479 : {
24480 : const char *test_str;
24481 : const char *talloc_str;
24482 0 : PyObject *unicode = NULL;
24483 0 : if (PyUnicode_Check(value)) {
24484 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
24485 0 : if (unicode == NULL) {
24486 0 : PyErr_NoMemory();
24487 0 : return -1;
24488 : }
24489 0 : test_str = PyBytes_AS_STRING(unicode);
24490 0 : } else if (PyBytes_Check(value)) {
24491 0 : test_str = PyBytes_AS_STRING(value);
24492 : } else {
24493 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
24494 0 : return -1;
24495 : }
24496 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
24497 0 : if (unicode != NULL) {
24498 0 : Py_DECREF(unicode);
24499 : }
24500 0 : if (talloc_str == NULL) {
24501 0 : PyErr_NoMemory();
24502 0 : return -1;
24503 : }
24504 0 : *object->out.display_name = talloc_str;
24505 : }
24506 : }
24507 0 : return 0;
24508 : }
24509 :
24510 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_in_get_display_name_length(PyObject *obj, void *closure)
24511 : {
24512 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
24513 : PyObject *py_display_name_length;
24514 0 : if (object->in.display_name_length == NULL) {
24515 0 : Py_RETURN_NONE;
24516 : }
24517 0 : if (object->in.display_name_length == NULL) {
24518 0 : py_display_name_length = Py_None;
24519 0 : Py_INCREF(py_display_name_length);
24520 : } else {
24521 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
24522 : }
24523 0 : return py_display_name_length;
24524 : }
24525 :
24526 0 : static int py_svcctl_GetServiceDisplayNameA_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
24527 : {
24528 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24529 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
24530 0 : if (value == NULL) {
24531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
24532 0 : return -1;
24533 : }
24534 0 : if (value == Py_None) {
24535 0 : object->in.display_name_length = NULL;
24536 : } else {
24537 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
24538 0 : if (object->in.display_name_length == NULL) {
24539 0 : PyErr_NoMemory();
24540 0 : return -1;
24541 : }
24542 : {
24543 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
24544 0 : if (PyLong_Check(value)) {
24545 : unsigned long long test_var;
24546 0 : test_var = PyLong_AsUnsignedLongLong(value);
24547 0 : if (PyErr_Occurred() != NULL) {
24548 0 : return -1;
24549 : }
24550 0 : if (test_var > uint_max) {
24551 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24552 : PyLong_Type.tp_name, uint_max, test_var);
24553 0 : return -1;
24554 : }
24555 0 : *object->in.display_name_length = test_var;
24556 : } else {
24557 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24558 : PyLong_Type.tp_name);
24559 0 : return -1;
24560 : }
24561 : }
24562 : }
24563 0 : return 0;
24564 : }
24565 :
24566 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_out_get_display_name_length(PyObject *obj, void *closure)
24567 : {
24568 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
24569 : PyObject *py_display_name_length;
24570 0 : if (object->out.display_name_length == NULL) {
24571 0 : Py_RETURN_NONE;
24572 : }
24573 0 : if (object->out.display_name_length == NULL) {
24574 0 : py_display_name_length = Py_None;
24575 0 : Py_INCREF(py_display_name_length);
24576 : } else {
24577 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
24578 : }
24579 0 : return py_display_name_length;
24580 : }
24581 :
24582 0 : static int py_svcctl_GetServiceDisplayNameA_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
24583 : {
24584 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24585 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
24586 0 : if (value == NULL) {
24587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
24588 0 : return -1;
24589 : }
24590 0 : if (value == Py_None) {
24591 0 : object->out.display_name_length = NULL;
24592 : } else {
24593 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
24594 0 : if (object->out.display_name_length == NULL) {
24595 0 : PyErr_NoMemory();
24596 0 : return -1;
24597 : }
24598 : {
24599 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
24600 0 : if (PyLong_Check(value)) {
24601 : unsigned long long test_var;
24602 0 : test_var = PyLong_AsUnsignedLongLong(value);
24603 0 : if (PyErr_Occurred() != NULL) {
24604 0 : return -1;
24605 : }
24606 0 : if (test_var > uint_max) {
24607 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24608 : PyLong_Type.tp_name, uint_max, test_var);
24609 0 : return -1;
24610 : }
24611 0 : *object->out.display_name_length = test_var;
24612 : } else {
24613 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24614 : PyLong_Type.tp_name);
24615 0 : return -1;
24616 : }
24617 : }
24618 : }
24619 0 : return 0;
24620 : }
24621 :
24622 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_get_result(PyObject *obj, void *closure)
24623 : {
24624 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(obj);
24625 : PyObject *py_result;
24626 0 : py_result = PyErr_FromWERROR(object->out.result);
24627 0 : return py_result;
24628 : }
24629 :
24630 0 : static int py_svcctl_GetServiceDisplayNameA_set_result(PyObject *py_obj, PyObject *value, void *closure)
24631 : {
24632 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24633 0 : if (value == NULL) {
24634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
24635 0 : return -1;
24636 : }
24637 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
24638 0 : return 0;
24639 : }
24640 :
24641 : static PyGetSetDef py_svcctl_GetServiceDisplayNameA_getsetters[] = {
24642 : {
24643 : .name = discard_const_p(char, "in_handle"),
24644 : .get = py_svcctl_GetServiceDisplayNameA_in_get_handle,
24645 : .set = py_svcctl_GetServiceDisplayNameA_in_set_handle,
24646 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24647 : },
24648 : {
24649 : .name = discard_const_p(char, "in_service_name"),
24650 : .get = py_svcctl_GetServiceDisplayNameA_in_get_service_name,
24651 : .set = py_svcctl_GetServiceDisplayNameA_in_set_service_name,
24652 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
24653 : },
24654 : {
24655 : .name = discard_const_p(char, "out_display_name"),
24656 : .get = py_svcctl_GetServiceDisplayNameA_out_get_display_name,
24657 : .set = py_svcctl_GetServiceDisplayNameA_out_set_display_name,
24658 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
24659 : },
24660 : {
24661 : .name = discard_const_p(char, "in_display_name_length"),
24662 : .get = py_svcctl_GetServiceDisplayNameA_in_get_display_name_length,
24663 : .set = py_svcctl_GetServiceDisplayNameA_in_set_display_name_length,
24664 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24665 : },
24666 : {
24667 : .name = discard_const_p(char, "out_display_name_length"),
24668 : .get = py_svcctl_GetServiceDisplayNameA_out_get_display_name_length,
24669 : .set = py_svcctl_GetServiceDisplayNameA_out_set_display_name_length,
24670 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24671 : },
24672 : {
24673 : .name = discard_const_p(char, "result"),
24674 : .get = py_svcctl_GetServiceDisplayNameA_get_result,
24675 : .set = py_svcctl_GetServiceDisplayNameA_set_result,
24676 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
24677 : },
24678 : { .name = NULL }
24679 : };
24680 :
24681 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24682 : {
24683 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceDisplayNameA, type);
24684 0 : struct svcctl_GetServiceDisplayNameA *_self = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(self);
24685 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24686 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
24687 0 : return self;
24688 : }
24689 :
24690 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24691 : {
24692 :
24693 :
24694 0 : return PyLong_FromLong(32);
24695 : }
24696 :
24697 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
24698 : {
24699 0 : const struct ndr_interface_call *call = NULL;
24700 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24701 0 : PyObject *ret = NULL;
24702 0 : struct ndr_push *push = NULL;
24703 : DATA_BLOB blob;
24704 : enum ndr_err_code err;
24705 :
24706 0 : if (ndr_table_svcctl.num_calls < 33) {
24707 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameA_ndr_pack");
24708 0 : return NULL;
24709 : }
24710 0 : call = &ndr_table_svcctl.calls[32];
24711 :
24712 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24713 0 : if (push == NULL) {
24714 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24715 0 : return NULL;
24716 : }
24717 :
24718 0 : push->flags |= ndr_push_flags;
24719 :
24720 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24721 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24722 0 : TALLOC_FREE(push);
24723 0 : PyErr_SetNdrError(err);
24724 0 : return NULL;
24725 : }
24726 0 : blob = ndr_push_blob(push);
24727 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24728 0 : TALLOC_FREE(push);
24729 0 : return ret;
24730 : }
24731 :
24732 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24733 : {
24734 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24735 0 : PyObject *bigendian_obj = NULL;
24736 0 : PyObject *ndr64_obj = NULL;
24737 0 : uint32_t ndr_push_flags = 0;
24738 :
24739 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24740 : discard_const_p(char *, kwnames),
24741 : &bigendian_obj,
24742 : &ndr64_obj)) {
24743 0 : return NULL;
24744 : }
24745 :
24746 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24747 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24748 : }
24749 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24750 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24751 : }
24752 :
24753 0 : return py_svcctl_GetServiceDisplayNameA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24754 : }
24755 :
24756 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24757 : {
24758 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24759 0 : PyObject *bigendian_obj = NULL;
24760 0 : PyObject *ndr64_obj = NULL;
24761 0 : uint32_t ndr_push_flags = 0;
24762 :
24763 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24764 : discard_const_p(char *, kwnames),
24765 : &bigendian_obj,
24766 : &ndr64_obj)) {
24767 0 : return NULL;
24768 : }
24769 :
24770 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24771 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24772 : }
24773 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24774 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24775 : }
24776 :
24777 0 : return py_svcctl_GetServiceDisplayNameA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24778 : }
24779 :
24780 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
24781 : {
24782 0 : const struct ndr_interface_call *call = NULL;
24783 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24784 0 : struct ndr_pull *pull = NULL;
24785 : enum ndr_err_code err;
24786 :
24787 0 : if (ndr_table_svcctl.num_calls < 33) {
24788 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameA_ndr_unpack");
24789 0 : return NULL;
24790 : }
24791 0 : call = &ndr_table_svcctl.calls[32];
24792 :
24793 0 : pull = ndr_pull_init_blob(blob, object);
24794 0 : if (pull == NULL) {
24795 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24796 0 : return NULL;
24797 : }
24798 :
24799 0 : pull->flags |= ndr_pull_flags;
24800 :
24801 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24802 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24803 0 : TALLOC_FREE(pull);
24804 0 : PyErr_SetNdrError(err);
24805 0 : return NULL;
24806 : }
24807 0 : if (!allow_remaining) {
24808 : uint32_t highest_ofs;
24809 :
24810 0 : if (pull->offset > pull->relative_highest_offset) {
24811 0 : highest_ofs = pull->offset;
24812 : } else {
24813 0 : highest_ofs = pull->relative_highest_offset;
24814 : }
24815 0 : if (highest_ofs < pull->data_size) {
24816 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24817 : "not all bytes consumed ofs[%u] size[%u]",
24818 : highest_ofs, pull->data_size);
24819 0 : TALLOC_FREE(pull);
24820 0 : PyErr_SetNdrError(err);
24821 0 : return NULL;
24822 : }
24823 : }
24824 :
24825 0 : TALLOC_FREE(pull);
24826 0 : Py_RETURN_NONE;
24827 : }
24828 :
24829 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24830 : {
24831 : DATA_BLOB blob;
24832 0 : Py_ssize_t blob_length = 0;
24833 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24834 0 : PyObject *bigendian_obj = NULL;
24835 0 : PyObject *ndr64_obj = NULL;
24836 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24837 0 : PyObject *allow_remaining_obj = NULL;
24838 0 : bool allow_remaining = false;
24839 :
24840 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24841 : discard_const_p(char *, kwnames),
24842 : &blob.data, &blob_length,
24843 : &bigendian_obj,
24844 : &ndr64_obj,
24845 : &allow_remaining_obj)) {
24846 0 : return NULL;
24847 : }
24848 0 : blob.length = blob_length;
24849 :
24850 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24851 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24852 : }
24853 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24854 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24855 : }
24856 :
24857 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24858 0 : allow_remaining = true;
24859 : }
24860 :
24861 0 : return py_svcctl_GetServiceDisplayNameA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24862 : }
24863 :
24864 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24865 : {
24866 : DATA_BLOB blob;
24867 0 : Py_ssize_t blob_length = 0;
24868 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24869 0 : PyObject *bigendian_obj = NULL;
24870 0 : PyObject *ndr64_obj = NULL;
24871 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24872 0 : PyObject *allow_remaining_obj = NULL;
24873 0 : bool allow_remaining = false;
24874 :
24875 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24876 : discard_const_p(char *, kwnames),
24877 : &blob.data, &blob_length,
24878 : &bigendian_obj,
24879 : &ndr64_obj,
24880 : &allow_remaining_obj)) {
24881 0 : return NULL;
24882 : }
24883 0 : blob.length = blob_length;
24884 :
24885 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24886 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24887 : }
24888 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24889 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24890 : }
24891 :
24892 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24893 0 : allow_remaining = true;
24894 : }
24895 :
24896 0 : return py_svcctl_GetServiceDisplayNameA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24897 : }
24898 :
24899 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
24900 : {
24901 0 : const struct ndr_interface_call *call = NULL;
24902 0 : struct svcctl_GetServiceDisplayNameA *object = (struct svcctl_GetServiceDisplayNameA *)pytalloc_get_ptr(py_obj);
24903 : PyObject *ret;
24904 : char *retstr;
24905 :
24906 0 : if (ndr_table_svcctl.num_calls < 33) {
24907 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceDisplayNameA_ndr_print");
24908 0 : return NULL;
24909 : }
24910 0 : call = &ndr_table_svcctl.calls[32];
24911 :
24912 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24913 0 : ret = PyUnicode_FromString(retstr);
24914 0 : TALLOC_FREE(retstr);
24915 :
24916 0 : return ret;
24917 : }
24918 :
24919 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24920 : {
24921 0 : return py_svcctl_GetServiceDisplayNameA_ndr_print(py_obj, "svcctl_GetServiceDisplayNameA_in", NDR_IN);
24922 : }
24923 :
24924 0 : static PyObject *py_svcctl_GetServiceDisplayNameA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24925 : {
24926 0 : return py_svcctl_GetServiceDisplayNameA_ndr_print(py_obj, "svcctl_GetServiceDisplayNameA_out", NDR_OUT);
24927 : }
24928 :
24929 : static PyMethodDef py_svcctl_GetServiceDisplayNameA_methods[] = {
24930 : { "opnum", (PyCFunction)py_svcctl_GetServiceDisplayNameA_ndr_opnum, METH_NOARGS|METH_CLASS,
24931 : "svcctl.GetServiceDisplayNameA.opnum() -> 32 (0x20) " },
24932 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24933 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24934 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24935 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24936 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24937 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24938 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceDisplayNameA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24939 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24940 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceDisplayNameA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24941 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceDisplayNameA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24942 : { NULL, NULL, 0, NULL }
24943 : };
24944 :
24945 :
24946 : static PyTypeObject svcctl_GetServiceDisplayNameA_Type = {
24947 : PyVarObject_HEAD_INIT(NULL, 0)
24948 : .tp_name = "svcctl.GetServiceDisplayNameA",
24949 : .tp_getset = py_svcctl_GetServiceDisplayNameA_getsetters,
24950 : .tp_methods = py_svcctl_GetServiceDisplayNameA_methods,
24951 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24952 : .tp_new = py_svcctl_GetServiceDisplayNameA_new,
24953 : };
24954 :
24955 0 : static bool pack_py_svcctl_GetServiceDisplayNameA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceDisplayNameA *r)
24956 : {
24957 : PyObject *py_handle;
24958 : PyObject *py_service_name;
24959 : PyObject *py_display_name_length;
24960 0 : const char *kwnames[] = {
24961 : "handle", "service_name", "display_name_length", NULL
24962 : };
24963 :
24964 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceDisplayNameA", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
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_service_name == NULL) {
24984 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
24985 0 : return false;
24986 : }
24987 0 : if (py_service_name == Py_None) {
24988 0 : r->in.service_name = NULL;
24989 : } else {
24990 0 : r->in.service_name = NULL;
24991 : {
24992 : const char *test_str;
24993 : const char *talloc_str;
24994 0 : PyObject *unicode = NULL;
24995 0 : if (PyUnicode_Check(py_service_name)) {
24996 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
24997 0 : if (unicode == NULL) {
24998 0 : PyErr_NoMemory();
24999 0 : return false;
25000 : }
25001 0 : test_str = PyBytes_AS_STRING(unicode);
25002 0 : } else if (PyBytes_Check(py_service_name)) {
25003 0 : test_str = PyBytes_AS_STRING(py_service_name);
25004 : } else {
25005 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
25006 0 : return false;
25007 : }
25008 0 : talloc_str = talloc_strdup(r, test_str);
25009 0 : if (unicode != NULL) {
25010 0 : Py_DECREF(unicode);
25011 : }
25012 0 : if (talloc_str == NULL) {
25013 0 : PyErr_NoMemory();
25014 0 : return false;
25015 : }
25016 0 : r->in.service_name = talloc_str;
25017 : }
25018 : }
25019 0 : if (py_display_name_length == NULL) {
25020 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
25021 0 : return false;
25022 : }
25023 0 : if (py_display_name_length == Py_None) {
25024 0 : r->in.display_name_length = NULL;
25025 : } else {
25026 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
25027 0 : if (r->in.display_name_length == NULL) {
25028 0 : PyErr_NoMemory();
25029 0 : return false;
25030 : }
25031 : {
25032 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
25033 0 : if (PyLong_Check(py_display_name_length)) {
25034 : unsigned long long test_var;
25035 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
25036 0 : if (PyErr_Occurred() != NULL) {
25037 0 : return false;
25038 : }
25039 0 : if (test_var > uint_max) {
25040 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25041 : PyLong_Type.tp_name, uint_max, test_var);
25042 0 : return false;
25043 : }
25044 0 : *r->in.display_name_length = test_var;
25045 : } else {
25046 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25047 : PyLong_Type.tp_name);
25048 0 : return false;
25049 : }
25050 : }
25051 : }
25052 0 : return true;
25053 : }
25054 :
25055 0 : static PyObject *unpack_py_svcctl_GetServiceDisplayNameA_args_out(struct svcctl_GetServiceDisplayNameA *r)
25056 : {
25057 : PyObject *result;
25058 : PyObject *py_display_name;
25059 : PyObject *py_display_name_length;
25060 0 : result = PyTuple_New(2);
25061 0 : if (*r->out.display_name == NULL) {
25062 0 : py_display_name = Py_None;
25063 0 : Py_INCREF(py_display_name);
25064 : } else {
25065 0 : if (*r->out.display_name == NULL) {
25066 0 : py_display_name = Py_None;
25067 0 : Py_INCREF(py_display_name);
25068 : } else {
25069 0 : py_display_name = PyUnicode_Decode(*r->out.display_name, strlen(*r->out.display_name), "utf-8", "ignore");
25070 : }
25071 : }
25072 0 : PyTuple_SetItem(result, 0, py_display_name);
25073 0 : if (r->out.display_name_length == NULL) {
25074 0 : py_display_name_length = Py_None;
25075 0 : Py_INCREF(py_display_name_length);
25076 : } else {
25077 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
25078 : }
25079 0 : PyTuple_SetItem(result, 1, py_display_name_length);
25080 0 : if (!W_ERROR_IS_OK(r->out.result)) {
25081 0 : PyErr_SetWERROR(r->out.result);
25082 0 : return NULL;
25083 : }
25084 :
25085 0 : return result;
25086 : }
25087 :
25088 :
25089 0 : static PyObject *py_svcctl_GetServiceKeyNameA_in_get_handle(PyObject *obj, void *closure)
25090 : {
25091 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
25092 : PyObject *py_handle;
25093 0 : if (object->in.handle == NULL) {
25094 0 : Py_RETURN_NONE;
25095 : }
25096 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
25097 0 : return py_handle;
25098 : }
25099 :
25100 0 : static int py_svcctl_GetServiceKeyNameA_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
25101 : {
25102 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25103 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
25104 0 : if (value == NULL) {
25105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
25106 0 : return -1;
25107 : }
25108 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
25109 0 : if (object->in.handle == NULL) {
25110 0 : PyErr_NoMemory();
25111 0 : return -1;
25112 : }
25113 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25114 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25115 0 : PyErr_NoMemory();
25116 0 : return -1;
25117 : }
25118 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
25119 0 : return 0;
25120 : }
25121 :
25122 0 : static PyObject *py_svcctl_GetServiceKeyNameA_in_get_service_name(PyObject *obj, void *closure)
25123 : {
25124 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
25125 : PyObject *py_service_name;
25126 0 : if (object->in.service_name == NULL) {
25127 0 : Py_RETURN_NONE;
25128 : }
25129 0 : if (object->in.service_name == NULL) {
25130 0 : py_service_name = Py_None;
25131 0 : Py_INCREF(py_service_name);
25132 : } else {
25133 0 : if (object->in.service_name == NULL) {
25134 0 : py_service_name = Py_None;
25135 0 : Py_INCREF(py_service_name);
25136 : } else {
25137 0 : py_service_name = PyUnicode_Decode(object->in.service_name, strlen(object->in.service_name), "utf-8", "ignore");
25138 : }
25139 : }
25140 0 : return py_service_name;
25141 : }
25142 :
25143 0 : static int py_svcctl_GetServiceKeyNameA_in_set_service_name(PyObject *py_obj, PyObject *value, void *closure)
25144 : {
25145 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25146 0 : if (value == NULL) {
25147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.service_name");
25148 0 : return -1;
25149 : }
25150 0 : if (value == Py_None) {
25151 0 : object->in.service_name = NULL;
25152 : } else {
25153 0 : object->in.service_name = NULL;
25154 : {
25155 : const char *test_str;
25156 : const char *talloc_str;
25157 0 : PyObject *unicode = NULL;
25158 0 : if (PyUnicode_Check(value)) {
25159 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
25160 0 : if (unicode == NULL) {
25161 0 : PyErr_NoMemory();
25162 0 : return -1;
25163 : }
25164 0 : test_str = PyBytes_AS_STRING(unicode);
25165 0 : } else if (PyBytes_Check(value)) {
25166 0 : test_str = PyBytes_AS_STRING(value);
25167 : } else {
25168 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
25169 0 : return -1;
25170 : }
25171 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
25172 0 : if (unicode != NULL) {
25173 0 : Py_DECREF(unicode);
25174 : }
25175 0 : if (talloc_str == NULL) {
25176 0 : PyErr_NoMemory();
25177 0 : return -1;
25178 : }
25179 0 : object->in.service_name = talloc_str;
25180 : }
25181 : }
25182 0 : return 0;
25183 : }
25184 :
25185 0 : static PyObject *py_svcctl_GetServiceKeyNameA_out_get_key_name(PyObject *obj, void *closure)
25186 : {
25187 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
25188 : PyObject *py_key_name;
25189 0 : if (object->out.key_name == NULL) {
25190 0 : Py_RETURN_NONE;
25191 : }
25192 0 : if (*object->out.key_name == NULL) {
25193 0 : py_key_name = Py_None;
25194 0 : Py_INCREF(py_key_name);
25195 : } else {
25196 0 : if (*object->out.key_name == NULL) {
25197 0 : py_key_name = Py_None;
25198 0 : Py_INCREF(py_key_name);
25199 : } else {
25200 0 : py_key_name = PyUnicode_Decode(*object->out.key_name, strlen(*object->out.key_name), "utf-8", "ignore");
25201 : }
25202 : }
25203 0 : return py_key_name;
25204 : }
25205 :
25206 0 : static int py_svcctl_GetServiceKeyNameA_out_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
25207 : {
25208 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25209 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.key_name));
25210 0 : if (value == NULL) {
25211 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.key_name");
25212 0 : return -1;
25213 : }
25214 0 : object->out.key_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.key_name);
25215 0 : if (object->out.key_name == NULL) {
25216 0 : PyErr_NoMemory();
25217 0 : return -1;
25218 : }
25219 0 : if (value == Py_None) {
25220 0 : *object->out.key_name = NULL;
25221 : } else {
25222 0 : *object->out.key_name = NULL;
25223 : {
25224 : const char *test_str;
25225 : const char *talloc_str;
25226 0 : PyObject *unicode = NULL;
25227 0 : if (PyUnicode_Check(value)) {
25228 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
25229 0 : if (unicode == NULL) {
25230 0 : PyErr_NoMemory();
25231 0 : return -1;
25232 : }
25233 0 : test_str = PyBytes_AS_STRING(unicode);
25234 0 : } else if (PyBytes_Check(value)) {
25235 0 : test_str = PyBytes_AS_STRING(value);
25236 : } else {
25237 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
25238 0 : return -1;
25239 : }
25240 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
25241 0 : if (unicode != NULL) {
25242 0 : Py_DECREF(unicode);
25243 : }
25244 0 : if (talloc_str == NULL) {
25245 0 : PyErr_NoMemory();
25246 0 : return -1;
25247 : }
25248 0 : *object->out.key_name = talloc_str;
25249 : }
25250 : }
25251 0 : return 0;
25252 : }
25253 :
25254 0 : static PyObject *py_svcctl_GetServiceKeyNameA_in_get_display_name_length(PyObject *obj, void *closure)
25255 : {
25256 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
25257 : PyObject *py_display_name_length;
25258 0 : if (object->in.display_name_length == NULL) {
25259 0 : Py_RETURN_NONE;
25260 : }
25261 0 : if (object->in.display_name_length == NULL) {
25262 0 : py_display_name_length = Py_None;
25263 0 : Py_INCREF(py_display_name_length);
25264 : } else {
25265 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->in.display_name_length);
25266 : }
25267 0 : return py_display_name_length;
25268 : }
25269 :
25270 0 : static int py_svcctl_GetServiceKeyNameA_in_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
25271 : {
25272 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25273 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.display_name_length));
25274 0 : if (value == NULL) {
25275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.display_name_length");
25276 0 : return -1;
25277 : }
25278 0 : if (value == Py_None) {
25279 0 : object->in.display_name_length = NULL;
25280 : } else {
25281 0 : object->in.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.display_name_length);
25282 0 : if (object->in.display_name_length == NULL) {
25283 0 : PyErr_NoMemory();
25284 0 : return -1;
25285 : }
25286 : {
25287 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.display_name_length));
25288 0 : if (PyLong_Check(value)) {
25289 : unsigned long long test_var;
25290 0 : test_var = PyLong_AsUnsignedLongLong(value);
25291 0 : if (PyErr_Occurred() != NULL) {
25292 0 : return -1;
25293 : }
25294 0 : if (test_var > uint_max) {
25295 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25296 : PyLong_Type.tp_name, uint_max, test_var);
25297 0 : return -1;
25298 : }
25299 0 : *object->in.display_name_length = test_var;
25300 : } else {
25301 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25302 : PyLong_Type.tp_name);
25303 0 : return -1;
25304 : }
25305 : }
25306 : }
25307 0 : return 0;
25308 : }
25309 :
25310 0 : static PyObject *py_svcctl_GetServiceKeyNameA_out_get_display_name_length(PyObject *obj, void *closure)
25311 : {
25312 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
25313 : PyObject *py_display_name_length;
25314 0 : if (object->out.display_name_length == NULL) {
25315 0 : Py_RETURN_NONE;
25316 : }
25317 0 : if (object->out.display_name_length == NULL) {
25318 0 : py_display_name_length = Py_None;
25319 0 : Py_INCREF(py_display_name_length);
25320 : } else {
25321 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*object->out.display_name_length);
25322 : }
25323 0 : return py_display_name_length;
25324 : }
25325 :
25326 0 : static int py_svcctl_GetServiceKeyNameA_out_set_display_name_length(PyObject *py_obj, PyObject *value, void *closure)
25327 : {
25328 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25329 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.display_name_length));
25330 0 : if (value == NULL) {
25331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.display_name_length");
25332 0 : return -1;
25333 : }
25334 0 : if (value == Py_None) {
25335 0 : object->out.display_name_length = NULL;
25336 : } else {
25337 0 : object->out.display_name_length = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.display_name_length);
25338 0 : if (object->out.display_name_length == NULL) {
25339 0 : PyErr_NoMemory();
25340 0 : return -1;
25341 : }
25342 : {
25343 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.display_name_length));
25344 0 : if (PyLong_Check(value)) {
25345 : unsigned long long test_var;
25346 0 : test_var = PyLong_AsUnsignedLongLong(value);
25347 0 : if (PyErr_Occurred() != NULL) {
25348 0 : return -1;
25349 : }
25350 0 : if (test_var > uint_max) {
25351 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25352 : PyLong_Type.tp_name, uint_max, test_var);
25353 0 : return -1;
25354 : }
25355 0 : *object->out.display_name_length = test_var;
25356 : } else {
25357 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25358 : PyLong_Type.tp_name);
25359 0 : return -1;
25360 : }
25361 : }
25362 : }
25363 0 : return 0;
25364 : }
25365 :
25366 0 : static PyObject *py_svcctl_GetServiceKeyNameA_get_result(PyObject *obj, void *closure)
25367 : {
25368 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(obj);
25369 : PyObject *py_result;
25370 0 : py_result = PyErr_FromWERROR(object->out.result);
25371 0 : return py_result;
25372 : }
25373 :
25374 0 : static int py_svcctl_GetServiceKeyNameA_set_result(PyObject *py_obj, PyObject *value, void *closure)
25375 : {
25376 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25377 0 : if (value == NULL) {
25378 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25379 0 : return -1;
25380 : }
25381 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
25382 0 : return 0;
25383 : }
25384 :
25385 : static PyGetSetDef py_svcctl_GetServiceKeyNameA_getsetters[] = {
25386 : {
25387 : .name = discard_const_p(char, "in_handle"),
25388 : .get = py_svcctl_GetServiceKeyNameA_in_get_handle,
25389 : .set = py_svcctl_GetServiceKeyNameA_in_set_handle,
25390 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25391 : },
25392 : {
25393 : .name = discard_const_p(char, "in_service_name"),
25394 : .get = py_svcctl_GetServiceKeyNameA_in_get_service_name,
25395 : .set = py_svcctl_GetServiceKeyNameA_in_set_service_name,
25396 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
25397 : },
25398 : {
25399 : .name = discard_const_p(char, "out_key_name"),
25400 : .get = py_svcctl_GetServiceKeyNameA_out_get_key_name,
25401 : .set = py_svcctl_GetServiceKeyNameA_out_set_key_name,
25402 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
25403 : },
25404 : {
25405 : .name = discard_const_p(char, "in_display_name_length"),
25406 : .get = py_svcctl_GetServiceKeyNameA_in_get_display_name_length,
25407 : .set = py_svcctl_GetServiceKeyNameA_in_set_display_name_length,
25408 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25409 : },
25410 : {
25411 : .name = discard_const_p(char, "out_display_name_length"),
25412 : .get = py_svcctl_GetServiceKeyNameA_out_get_display_name_length,
25413 : .set = py_svcctl_GetServiceKeyNameA_out_set_display_name_length,
25414 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25415 : },
25416 : {
25417 : .name = discard_const_p(char, "result"),
25418 : .get = py_svcctl_GetServiceKeyNameA_get_result,
25419 : .set = py_svcctl_GetServiceKeyNameA_set_result,
25420 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
25421 : },
25422 : { .name = NULL }
25423 : };
25424 :
25425 0 : static PyObject *py_svcctl_GetServiceKeyNameA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25426 : {
25427 0 : PyObject *self = pytalloc_new(struct svcctl_GetServiceKeyNameA, type);
25428 0 : struct svcctl_GetServiceKeyNameA *_self = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(self);
25429 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25430 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
25431 0 : return self;
25432 : }
25433 :
25434 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25435 : {
25436 :
25437 :
25438 0 : return PyLong_FromLong(33);
25439 : }
25440 :
25441 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
25442 : {
25443 0 : const struct ndr_interface_call *call = NULL;
25444 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25445 0 : PyObject *ret = NULL;
25446 0 : struct ndr_push *push = NULL;
25447 : DATA_BLOB blob;
25448 : enum ndr_err_code err;
25449 :
25450 0 : if (ndr_table_svcctl.num_calls < 34) {
25451 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameA_ndr_pack");
25452 0 : return NULL;
25453 : }
25454 0 : call = &ndr_table_svcctl.calls[33];
25455 :
25456 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25457 0 : if (push == NULL) {
25458 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25459 0 : return NULL;
25460 : }
25461 :
25462 0 : push->flags |= ndr_push_flags;
25463 :
25464 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25465 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25466 0 : TALLOC_FREE(push);
25467 0 : PyErr_SetNdrError(err);
25468 0 : return NULL;
25469 : }
25470 0 : blob = ndr_push_blob(push);
25471 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25472 0 : TALLOC_FREE(push);
25473 0 : return ret;
25474 : }
25475 :
25476 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25477 : {
25478 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25479 0 : PyObject *bigendian_obj = NULL;
25480 0 : PyObject *ndr64_obj = NULL;
25481 0 : uint32_t ndr_push_flags = 0;
25482 :
25483 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25484 : discard_const_p(char *, kwnames),
25485 : &bigendian_obj,
25486 : &ndr64_obj)) {
25487 0 : return NULL;
25488 : }
25489 :
25490 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25491 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25492 : }
25493 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25494 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25495 : }
25496 :
25497 0 : return py_svcctl_GetServiceKeyNameA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25498 : }
25499 :
25500 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25501 : {
25502 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25503 0 : PyObject *bigendian_obj = NULL;
25504 0 : PyObject *ndr64_obj = NULL;
25505 0 : uint32_t ndr_push_flags = 0;
25506 :
25507 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25508 : discard_const_p(char *, kwnames),
25509 : &bigendian_obj,
25510 : &ndr64_obj)) {
25511 0 : return NULL;
25512 : }
25513 :
25514 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25515 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25516 : }
25517 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25518 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25519 : }
25520 :
25521 0 : return py_svcctl_GetServiceKeyNameA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25522 : }
25523 :
25524 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
25525 : {
25526 0 : const struct ndr_interface_call *call = NULL;
25527 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25528 0 : struct ndr_pull *pull = NULL;
25529 : enum ndr_err_code err;
25530 :
25531 0 : if (ndr_table_svcctl.num_calls < 34) {
25532 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameA_ndr_unpack");
25533 0 : return NULL;
25534 : }
25535 0 : call = &ndr_table_svcctl.calls[33];
25536 :
25537 0 : pull = ndr_pull_init_blob(blob, object);
25538 0 : if (pull == NULL) {
25539 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25540 0 : return NULL;
25541 : }
25542 :
25543 0 : pull->flags |= ndr_pull_flags;
25544 :
25545 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25546 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25547 0 : TALLOC_FREE(pull);
25548 0 : PyErr_SetNdrError(err);
25549 0 : return NULL;
25550 : }
25551 0 : if (!allow_remaining) {
25552 : uint32_t highest_ofs;
25553 :
25554 0 : if (pull->offset > pull->relative_highest_offset) {
25555 0 : highest_ofs = pull->offset;
25556 : } else {
25557 0 : highest_ofs = pull->relative_highest_offset;
25558 : }
25559 0 : if (highest_ofs < pull->data_size) {
25560 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25561 : "not all bytes consumed ofs[%u] size[%u]",
25562 : highest_ofs, pull->data_size);
25563 0 : TALLOC_FREE(pull);
25564 0 : PyErr_SetNdrError(err);
25565 0 : return NULL;
25566 : }
25567 : }
25568 :
25569 0 : TALLOC_FREE(pull);
25570 0 : Py_RETURN_NONE;
25571 : }
25572 :
25573 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25574 : {
25575 : DATA_BLOB blob;
25576 0 : Py_ssize_t blob_length = 0;
25577 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25578 0 : PyObject *bigendian_obj = NULL;
25579 0 : PyObject *ndr64_obj = NULL;
25580 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25581 0 : PyObject *allow_remaining_obj = NULL;
25582 0 : bool allow_remaining = false;
25583 :
25584 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25585 : discard_const_p(char *, kwnames),
25586 : &blob.data, &blob_length,
25587 : &bigendian_obj,
25588 : &ndr64_obj,
25589 : &allow_remaining_obj)) {
25590 0 : return NULL;
25591 : }
25592 0 : blob.length = blob_length;
25593 :
25594 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25595 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25596 : }
25597 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25598 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25599 : }
25600 :
25601 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25602 0 : allow_remaining = true;
25603 : }
25604 :
25605 0 : return py_svcctl_GetServiceKeyNameA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25606 : }
25607 :
25608 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25609 : {
25610 : DATA_BLOB blob;
25611 0 : Py_ssize_t blob_length = 0;
25612 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25613 0 : PyObject *bigendian_obj = NULL;
25614 0 : PyObject *ndr64_obj = NULL;
25615 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25616 0 : PyObject *allow_remaining_obj = NULL;
25617 0 : bool allow_remaining = false;
25618 :
25619 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25620 : discard_const_p(char *, kwnames),
25621 : &blob.data, &blob_length,
25622 : &bigendian_obj,
25623 : &ndr64_obj,
25624 : &allow_remaining_obj)) {
25625 0 : return NULL;
25626 : }
25627 0 : blob.length = blob_length;
25628 :
25629 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25630 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25631 : }
25632 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25633 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25634 : }
25635 :
25636 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25637 0 : allow_remaining = true;
25638 : }
25639 :
25640 0 : return py_svcctl_GetServiceKeyNameA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25641 : }
25642 :
25643 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
25644 : {
25645 0 : const struct ndr_interface_call *call = NULL;
25646 0 : struct svcctl_GetServiceKeyNameA *object = (struct svcctl_GetServiceKeyNameA *)pytalloc_get_ptr(py_obj);
25647 : PyObject *ret;
25648 : char *retstr;
25649 :
25650 0 : if (ndr_table_svcctl.num_calls < 34) {
25651 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_GetServiceKeyNameA_ndr_print");
25652 0 : return NULL;
25653 : }
25654 0 : call = &ndr_table_svcctl.calls[33];
25655 :
25656 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25657 0 : ret = PyUnicode_FromString(retstr);
25658 0 : TALLOC_FREE(retstr);
25659 :
25660 0 : return ret;
25661 : }
25662 :
25663 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25664 : {
25665 0 : return py_svcctl_GetServiceKeyNameA_ndr_print(py_obj, "svcctl_GetServiceKeyNameA_in", NDR_IN);
25666 : }
25667 :
25668 0 : static PyObject *py_svcctl_GetServiceKeyNameA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25669 : {
25670 0 : return py_svcctl_GetServiceKeyNameA_ndr_print(py_obj, "svcctl_GetServiceKeyNameA_out", NDR_OUT);
25671 : }
25672 :
25673 : static PyMethodDef py_svcctl_GetServiceKeyNameA_methods[] = {
25674 : { "opnum", (PyCFunction)py_svcctl_GetServiceKeyNameA_ndr_opnum, METH_NOARGS|METH_CLASS,
25675 : "svcctl.GetServiceKeyNameA.opnum() -> 33 (0x21) " },
25676 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25677 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25678 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25679 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25680 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25681 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25682 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_GetServiceKeyNameA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25683 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25684 : { "__ndr_print_in__", (PyCFunction)py_svcctl_GetServiceKeyNameA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25685 : { "__ndr_print_out__", (PyCFunction)py_svcctl_GetServiceKeyNameA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25686 : { NULL, NULL, 0, NULL }
25687 : };
25688 :
25689 :
25690 : static PyTypeObject svcctl_GetServiceKeyNameA_Type = {
25691 : PyVarObject_HEAD_INIT(NULL, 0)
25692 : .tp_name = "svcctl.GetServiceKeyNameA",
25693 : .tp_getset = py_svcctl_GetServiceKeyNameA_getsetters,
25694 : .tp_methods = py_svcctl_GetServiceKeyNameA_methods,
25695 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25696 : .tp_new = py_svcctl_GetServiceKeyNameA_new,
25697 : };
25698 :
25699 0 : static bool pack_py_svcctl_GetServiceKeyNameA_args_in(PyObject *args, PyObject *kwargs, struct svcctl_GetServiceKeyNameA *r)
25700 : {
25701 : PyObject *py_handle;
25702 : PyObject *py_service_name;
25703 : PyObject *py_display_name_length;
25704 0 : const char *kwnames[] = {
25705 : "handle", "service_name", "display_name_length", NULL
25706 : };
25707 :
25708 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_GetServiceKeyNameA", discard_const_p(char *, kwnames), &py_handle, &py_service_name, &py_display_name_length)) {
25709 0 : return false;
25710 : }
25711 :
25712 0 : if (py_handle == NULL) {
25713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
25714 0 : return false;
25715 : }
25716 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
25717 0 : if (r->in.handle == NULL) {
25718 0 : PyErr_NoMemory();
25719 0 : return false;
25720 : }
25721 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
25722 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
25723 0 : PyErr_NoMemory();
25724 0 : return false;
25725 : }
25726 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
25727 0 : if (py_service_name == NULL) {
25728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.service_name");
25729 0 : return false;
25730 : }
25731 0 : if (py_service_name == Py_None) {
25732 0 : r->in.service_name = NULL;
25733 : } else {
25734 0 : r->in.service_name = NULL;
25735 : {
25736 : const char *test_str;
25737 : const char *talloc_str;
25738 0 : PyObject *unicode = NULL;
25739 0 : if (PyUnicode_Check(py_service_name)) {
25740 0 : unicode = PyUnicode_AsEncodedString(py_service_name, "utf-8", "ignore");
25741 0 : if (unicode == NULL) {
25742 0 : PyErr_NoMemory();
25743 0 : return false;
25744 : }
25745 0 : test_str = PyBytes_AS_STRING(unicode);
25746 0 : } else if (PyBytes_Check(py_service_name)) {
25747 0 : test_str = PyBytes_AS_STRING(py_service_name);
25748 : } else {
25749 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_service_name)->tp_name);
25750 0 : return false;
25751 : }
25752 0 : talloc_str = talloc_strdup(r, test_str);
25753 0 : if (unicode != NULL) {
25754 0 : Py_DECREF(unicode);
25755 : }
25756 0 : if (talloc_str == NULL) {
25757 0 : PyErr_NoMemory();
25758 0 : return false;
25759 : }
25760 0 : r->in.service_name = talloc_str;
25761 : }
25762 : }
25763 0 : if (py_display_name_length == NULL) {
25764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.display_name_length");
25765 0 : return false;
25766 : }
25767 0 : if (py_display_name_length == Py_None) {
25768 0 : r->in.display_name_length = NULL;
25769 : } else {
25770 0 : r->in.display_name_length = talloc_ptrtype(r, r->in.display_name_length);
25771 0 : if (r->in.display_name_length == NULL) {
25772 0 : PyErr_NoMemory();
25773 0 : return false;
25774 : }
25775 : {
25776 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.display_name_length));
25777 0 : if (PyLong_Check(py_display_name_length)) {
25778 : unsigned long long test_var;
25779 0 : test_var = PyLong_AsUnsignedLongLong(py_display_name_length);
25780 0 : if (PyErr_Occurred() != NULL) {
25781 0 : return false;
25782 : }
25783 0 : if (test_var > uint_max) {
25784 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25785 : PyLong_Type.tp_name, uint_max, test_var);
25786 0 : return false;
25787 : }
25788 0 : *r->in.display_name_length = test_var;
25789 : } else {
25790 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25791 : PyLong_Type.tp_name);
25792 0 : return false;
25793 : }
25794 : }
25795 : }
25796 0 : return true;
25797 : }
25798 :
25799 0 : static PyObject *unpack_py_svcctl_GetServiceKeyNameA_args_out(struct svcctl_GetServiceKeyNameA *r)
25800 : {
25801 : PyObject *result;
25802 : PyObject *py_key_name;
25803 : PyObject *py_display_name_length;
25804 0 : result = PyTuple_New(2);
25805 0 : if (*r->out.key_name == NULL) {
25806 0 : py_key_name = Py_None;
25807 0 : Py_INCREF(py_key_name);
25808 : } else {
25809 0 : if (*r->out.key_name == NULL) {
25810 0 : py_key_name = Py_None;
25811 0 : Py_INCREF(py_key_name);
25812 : } else {
25813 0 : py_key_name = PyUnicode_Decode(*r->out.key_name, strlen(*r->out.key_name), "utf-8", "ignore");
25814 : }
25815 : }
25816 0 : PyTuple_SetItem(result, 0, py_key_name);
25817 0 : if (r->out.display_name_length == NULL) {
25818 0 : py_display_name_length = Py_None;
25819 0 : Py_INCREF(py_display_name_length);
25820 : } else {
25821 0 : py_display_name_length = PyLong_FromUnsignedLongLong((uint32_t)*r->out.display_name_length);
25822 : }
25823 0 : PyTuple_SetItem(result, 1, py_display_name_length);
25824 0 : if (!W_ERROR_IS_OK(r->out.result)) {
25825 0 : PyErr_SetWERROR(r->out.result);
25826 0 : return NULL;
25827 : }
25828 :
25829 0 : return result;
25830 : }
25831 :
25832 :
25833 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_in_get_handle(PyObject *obj, void *closure)
25834 : {
25835 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
25836 : PyObject *py_handle;
25837 0 : if (object->in.handle == NULL) {
25838 0 : Py_RETURN_NONE;
25839 : }
25840 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
25841 0 : return py_handle;
25842 : }
25843 :
25844 0 : static int py_svcctl_ChangeServiceConfig2A_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
25845 : {
25846 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
25847 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
25848 0 : if (value == NULL) {
25849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
25850 0 : return -1;
25851 : }
25852 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
25853 0 : if (object->in.handle == NULL) {
25854 0 : PyErr_NoMemory();
25855 0 : return -1;
25856 : }
25857 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25858 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25859 0 : PyErr_NoMemory();
25860 0 : return -1;
25861 : }
25862 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
25863 0 : return 0;
25864 : }
25865 :
25866 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_in_get_info_level(PyObject *obj, void *closure)
25867 : {
25868 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
25869 : PyObject *py_info_level;
25870 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
25871 0 : return py_info_level;
25872 : }
25873 :
25874 0 : static int py_svcctl_ChangeServiceConfig2A_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
25875 : {
25876 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
25877 0 : if (value == NULL) {
25878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
25879 0 : return -1;
25880 : }
25881 : {
25882 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
25883 0 : if (PyLong_Check(value)) {
25884 : unsigned long long test_var;
25885 0 : test_var = PyLong_AsUnsignedLongLong(value);
25886 0 : if (PyErr_Occurred() != NULL) {
25887 0 : return -1;
25888 : }
25889 0 : if (test_var > uint_max) {
25890 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25891 : PyLong_Type.tp_name, uint_max, test_var);
25892 0 : return -1;
25893 : }
25894 0 : object->in.info_level = test_var;
25895 : } else {
25896 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25897 : PyLong_Type.tp_name);
25898 0 : return -1;
25899 : }
25900 : }
25901 0 : return 0;
25902 : }
25903 :
25904 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_in_get_info(PyObject *obj, void *closure)
25905 : {
25906 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
25907 : PyObject *py_info;
25908 0 : if (object->in.info == NULL) {
25909 0 : Py_RETURN_NONE;
25910 : }
25911 0 : if (object->in.info == NULL) {
25912 0 : py_info = Py_None;
25913 0 : Py_INCREF(py_info);
25914 : } else {
25915 0 : py_info = PyLong_FromLong((uint16_t)*object->in.info);
25916 : }
25917 0 : return py_info;
25918 : }
25919 :
25920 0 : static int py_svcctl_ChangeServiceConfig2A_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
25921 : {
25922 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
25923 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
25924 0 : if (value == NULL) {
25925 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
25926 0 : return -1;
25927 : }
25928 0 : if (value == Py_None) {
25929 0 : object->in.info = NULL;
25930 : } else {
25931 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
25932 0 : if (object->in.info == NULL) {
25933 0 : PyErr_NoMemory();
25934 0 : return -1;
25935 : }
25936 : {
25937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.info));
25938 0 : if (PyLong_Check(value)) {
25939 : unsigned long long test_var;
25940 0 : test_var = PyLong_AsUnsignedLongLong(value);
25941 0 : if (PyErr_Occurred() != NULL) {
25942 0 : return -1;
25943 : }
25944 0 : if (test_var > uint_max) {
25945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25946 : PyLong_Type.tp_name, uint_max, test_var);
25947 0 : return -1;
25948 : }
25949 0 : *object->in.info = test_var;
25950 : } else {
25951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25952 : PyLong_Type.tp_name);
25953 0 : return -1;
25954 : }
25955 : }
25956 : }
25957 0 : return 0;
25958 : }
25959 :
25960 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_get_result(PyObject *obj, void *closure)
25961 : {
25962 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(obj);
25963 : PyObject *py_result;
25964 0 : py_result = PyErr_FromWERROR(object->out.result);
25965 0 : return py_result;
25966 : }
25967 :
25968 0 : static int py_svcctl_ChangeServiceConfig2A_set_result(PyObject *py_obj, PyObject *value, void *closure)
25969 : {
25970 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
25971 0 : if (value == NULL) {
25972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25973 0 : return -1;
25974 : }
25975 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
25976 0 : return 0;
25977 : }
25978 :
25979 : static PyGetSetDef py_svcctl_ChangeServiceConfig2A_getsetters[] = {
25980 : {
25981 : .name = discard_const_p(char, "in_handle"),
25982 : .get = py_svcctl_ChangeServiceConfig2A_in_get_handle,
25983 : .set = py_svcctl_ChangeServiceConfig2A_in_set_handle,
25984 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25985 : },
25986 : {
25987 : .name = discard_const_p(char, "in_info_level"),
25988 : .get = py_svcctl_ChangeServiceConfig2A_in_get_info_level,
25989 : .set = py_svcctl_ChangeServiceConfig2A_in_set_info_level,
25990 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25991 : },
25992 : {
25993 : .name = discard_const_p(char, "in_info"),
25994 : .get = py_svcctl_ChangeServiceConfig2A_in_get_info,
25995 : .set = py_svcctl_ChangeServiceConfig2A_in_set_info,
25996 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
25997 : },
25998 : {
25999 : .name = discard_const_p(char, "result"),
26000 : .get = py_svcctl_ChangeServiceConfig2A_get_result,
26001 : .set = py_svcctl_ChangeServiceConfig2A_set_result,
26002 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
26003 : },
26004 : { .name = NULL }
26005 : };
26006 :
26007 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26008 : {
26009 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfig2A, type);
26010 0 : struct svcctl_ChangeServiceConfig2A *_self = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(self);
26011 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26012 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
26013 0 : return self;
26014 : }
26015 :
26016 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26017 : {
26018 :
26019 :
26020 0 : return PyLong_FromLong(36);
26021 : }
26022 :
26023 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
26024 : {
26025 0 : const struct ndr_interface_call *call = NULL;
26026 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
26027 0 : PyObject *ret = NULL;
26028 0 : struct ndr_push *push = NULL;
26029 : DATA_BLOB blob;
26030 : enum ndr_err_code err;
26031 :
26032 0 : if (ndr_table_svcctl.num_calls < 37) {
26033 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2A_ndr_pack");
26034 0 : return NULL;
26035 : }
26036 0 : call = &ndr_table_svcctl.calls[36];
26037 :
26038 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26039 0 : if (push == NULL) {
26040 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26041 0 : return NULL;
26042 : }
26043 :
26044 0 : push->flags |= ndr_push_flags;
26045 :
26046 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26047 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26048 0 : TALLOC_FREE(push);
26049 0 : PyErr_SetNdrError(err);
26050 0 : return NULL;
26051 : }
26052 0 : blob = ndr_push_blob(push);
26053 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26054 0 : TALLOC_FREE(push);
26055 0 : return ret;
26056 : }
26057 :
26058 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26059 : {
26060 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26061 0 : PyObject *bigendian_obj = NULL;
26062 0 : PyObject *ndr64_obj = NULL;
26063 0 : uint32_t ndr_push_flags = 0;
26064 :
26065 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26066 : discard_const_p(char *, kwnames),
26067 : &bigendian_obj,
26068 : &ndr64_obj)) {
26069 0 : return NULL;
26070 : }
26071 :
26072 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26073 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26074 : }
26075 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26076 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26077 : }
26078 :
26079 0 : return py_svcctl_ChangeServiceConfig2A_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26080 : }
26081 :
26082 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26083 : {
26084 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26085 0 : PyObject *bigendian_obj = NULL;
26086 0 : PyObject *ndr64_obj = NULL;
26087 0 : uint32_t ndr_push_flags = 0;
26088 :
26089 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26090 : discard_const_p(char *, kwnames),
26091 : &bigendian_obj,
26092 : &ndr64_obj)) {
26093 0 : return NULL;
26094 : }
26095 :
26096 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26097 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26098 : }
26099 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26100 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26101 : }
26102 :
26103 0 : return py_svcctl_ChangeServiceConfig2A_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26104 : }
26105 :
26106 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
26107 : {
26108 0 : const struct ndr_interface_call *call = NULL;
26109 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
26110 0 : struct ndr_pull *pull = NULL;
26111 : enum ndr_err_code err;
26112 :
26113 0 : if (ndr_table_svcctl.num_calls < 37) {
26114 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2A_ndr_unpack");
26115 0 : return NULL;
26116 : }
26117 0 : call = &ndr_table_svcctl.calls[36];
26118 :
26119 0 : pull = ndr_pull_init_blob(blob, object);
26120 0 : if (pull == NULL) {
26121 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26122 0 : return NULL;
26123 : }
26124 :
26125 0 : pull->flags |= ndr_pull_flags;
26126 :
26127 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26128 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26129 0 : TALLOC_FREE(pull);
26130 0 : PyErr_SetNdrError(err);
26131 0 : return NULL;
26132 : }
26133 0 : if (!allow_remaining) {
26134 : uint32_t highest_ofs;
26135 :
26136 0 : if (pull->offset > pull->relative_highest_offset) {
26137 0 : highest_ofs = pull->offset;
26138 : } else {
26139 0 : highest_ofs = pull->relative_highest_offset;
26140 : }
26141 0 : if (highest_ofs < pull->data_size) {
26142 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26143 : "not all bytes consumed ofs[%u] size[%u]",
26144 : highest_ofs, pull->data_size);
26145 0 : TALLOC_FREE(pull);
26146 0 : PyErr_SetNdrError(err);
26147 0 : return NULL;
26148 : }
26149 : }
26150 :
26151 0 : TALLOC_FREE(pull);
26152 0 : Py_RETURN_NONE;
26153 : }
26154 :
26155 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26156 : {
26157 : DATA_BLOB blob;
26158 0 : Py_ssize_t blob_length = 0;
26159 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26160 0 : PyObject *bigendian_obj = NULL;
26161 0 : PyObject *ndr64_obj = NULL;
26162 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26163 0 : PyObject *allow_remaining_obj = NULL;
26164 0 : bool allow_remaining = false;
26165 :
26166 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26167 : discard_const_p(char *, kwnames),
26168 : &blob.data, &blob_length,
26169 : &bigendian_obj,
26170 : &ndr64_obj,
26171 : &allow_remaining_obj)) {
26172 0 : return NULL;
26173 : }
26174 0 : blob.length = blob_length;
26175 :
26176 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26177 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26178 : }
26179 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26180 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26181 : }
26182 :
26183 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26184 0 : allow_remaining = true;
26185 : }
26186 :
26187 0 : return py_svcctl_ChangeServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26188 : }
26189 :
26190 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26191 : {
26192 : DATA_BLOB blob;
26193 0 : Py_ssize_t blob_length = 0;
26194 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26195 0 : PyObject *bigendian_obj = NULL;
26196 0 : PyObject *ndr64_obj = NULL;
26197 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26198 0 : PyObject *allow_remaining_obj = NULL;
26199 0 : bool allow_remaining = false;
26200 :
26201 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26202 : discard_const_p(char *, kwnames),
26203 : &blob.data, &blob_length,
26204 : &bigendian_obj,
26205 : &ndr64_obj,
26206 : &allow_remaining_obj)) {
26207 0 : return NULL;
26208 : }
26209 0 : blob.length = blob_length;
26210 :
26211 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26212 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26213 : }
26214 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26215 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26216 : }
26217 :
26218 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26219 0 : allow_remaining = true;
26220 : }
26221 :
26222 0 : return py_svcctl_ChangeServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26223 : }
26224 :
26225 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
26226 : {
26227 0 : const struct ndr_interface_call *call = NULL;
26228 0 : struct svcctl_ChangeServiceConfig2A *object = (struct svcctl_ChangeServiceConfig2A *)pytalloc_get_ptr(py_obj);
26229 : PyObject *ret;
26230 : char *retstr;
26231 :
26232 0 : if (ndr_table_svcctl.num_calls < 37) {
26233 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2A_ndr_print");
26234 0 : return NULL;
26235 : }
26236 0 : call = &ndr_table_svcctl.calls[36];
26237 :
26238 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26239 0 : ret = PyUnicode_FromString(retstr);
26240 0 : TALLOC_FREE(retstr);
26241 :
26242 0 : return ret;
26243 : }
26244 :
26245 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26246 : {
26247 0 : return py_svcctl_ChangeServiceConfig2A_ndr_print(py_obj, "svcctl_ChangeServiceConfig2A_in", NDR_IN);
26248 : }
26249 :
26250 0 : static PyObject *py_svcctl_ChangeServiceConfig2A_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26251 : {
26252 0 : return py_svcctl_ChangeServiceConfig2A_ndr_print(py_obj, "svcctl_ChangeServiceConfig2A_out", NDR_OUT);
26253 : }
26254 :
26255 : static PyMethodDef py_svcctl_ChangeServiceConfig2A_methods[] = {
26256 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfig2A_ndr_opnum, METH_NOARGS|METH_CLASS,
26257 : "svcctl.ChangeServiceConfig2A.opnum() -> 36 (0x24) " },
26258 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26259 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26260 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26261 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26262 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26263 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26264 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2A_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26265 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26266 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfig2A_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26267 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfig2A_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26268 : { NULL, NULL, 0, NULL }
26269 : };
26270 :
26271 :
26272 : static PyTypeObject svcctl_ChangeServiceConfig2A_Type = {
26273 : PyVarObject_HEAD_INIT(NULL, 0)
26274 : .tp_name = "svcctl.ChangeServiceConfig2A",
26275 : .tp_getset = py_svcctl_ChangeServiceConfig2A_getsetters,
26276 : .tp_methods = py_svcctl_ChangeServiceConfig2A_methods,
26277 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26278 : .tp_new = py_svcctl_ChangeServiceConfig2A_new,
26279 : };
26280 :
26281 0 : static bool pack_py_svcctl_ChangeServiceConfig2A_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfig2A *r)
26282 : {
26283 : PyObject *py_handle;
26284 : PyObject *py_info_level;
26285 : PyObject *py_info;
26286 0 : const char *kwnames[] = {
26287 : "handle", "info_level", "info", NULL
26288 : };
26289 :
26290 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_ChangeServiceConfig2A", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_info)) {
26291 0 : return false;
26292 : }
26293 :
26294 0 : if (py_handle == NULL) {
26295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
26296 0 : return false;
26297 : }
26298 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
26299 0 : if (r->in.handle == NULL) {
26300 0 : PyErr_NoMemory();
26301 0 : return false;
26302 : }
26303 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
26304 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
26305 0 : PyErr_NoMemory();
26306 0 : return false;
26307 : }
26308 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
26309 0 : if (py_info_level == NULL) {
26310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
26311 0 : return false;
26312 : }
26313 : {
26314 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
26315 0 : if (PyLong_Check(py_info_level)) {
26316 : unsigned long long test_var;
26317 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
26318 0 : if (PyErr_Occurred() != NULL) {
26319 0 : return false;
26320 : }
26321 0 : if (test_var > uint_max) {
26322 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26323 : PyLong_Type.tp_name, uint_max, test_var);
26324 0 : return false;
26325 : }
26326 0 : r->in.info_level = test_var;
26327 : } else {
26328 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26329 : PyLong_Type.tp_name);
26330 0 : return false;
26331 : }
26332 : }
26333 0 : if (py_info == NULL) {
26334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
26335 0 : return false;
26336 : }
26337 0 : if (py_info == Py_None) {
26338 0 : r->in.info = NULL;
26339 : } else {
26340 0 : r->in.info = talloc_ptrtype(r, r->in.info);
26341 0 : if (r->in.info == NULL) {
26342 0 : PyErr_NoMemory();
26343 0 : return false;
26344 : }
26345 : {
26346 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.info));
26347 0 : if (PyLong_Check(py_info)) {
26348 : unsigned long long test_var;
26349 0 : test_var = PyLong_AsUnsignedLongLong(py_info);
26350 0 : if (PyErr_Occurred() != NULL) {
26351 0 : return false;
26352 : }
26353 0 : if (test_var > uint_max) {
26354 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26355 : PyLong_Type.tp_name, uint_max, test_var);
26356 0 : return false;
26357 : }
26358 0 : *r->in.info = test_var;
26359 : } else {
26360 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26361 : PyLong_Type.tp_name);
26362 0 : return false;
26363 : }
26364 : }
26365 : }
26366 0 : return true;
26367 : }
26368 :
26369 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfig2A_args_out(struct svcctl_ChangeServiceConfig2A *r)
26370 : {
26371 : PyObject *result;
26372 0 : result = Py_None;
26373 0 : Py_INCREF(result);
26374 0 : if (!W_ERROR_IS_OK(r->out.result)) {
26375 0 : PyErr_SetWERROR(r->out.result);
26376 0 : return NULL;
26377 : }
26378 :
26379 0 : return result;
26380 : }
26381 :
26382 :
26383 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_in_get_handle(PyObject *obj, void *closure)
26384 : {
26385 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
26386 : PyObject *py_handle;
26387 0 : if (object->in.handle == NULL) {
26388 0 : Py_RETURN_NONE;
26389 : }
26390 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
26391 0 : return py_handle;
26392 : }
26393 :
26394 0 : static int py_svcctl_ChangeServiceConfig2W_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
26395 : {
26396 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
26397 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
26398 0 : if (value == NULL) {
26399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
26400 0 : return -1;
26401 : }
26402 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
26403 0 : if (object->in.handle == NULL) {
26404 0 : PyErr_NoMemory();
26405 0 : return -1;
26406 : }
26407 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26408 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26409 0 : PyErr_NoMemory();
26410 0 : return -1;
26411 : }
26412 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
26413 0 : return 0;
26414 : }
26415 :
26416 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_in_get_info_level(PyObject *obj, void *closure)
26417 : {
26418 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
26419 : PyObject *py_info_level;
26420 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
26421 0 : return py_info_level;
26422 : }
26423 :
26424 0 : static int py_svcctl_ChangeServiceConfig2W_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
26425 : {
26426 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
26427 0 : if (value == NULL) {
26428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
26429 0 : return -1;
26430 : }
26431 : {
26432 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
26433 0 : if (PyLong_Check(value)) {
26434 : unsigned long long test_var;
26435 0 : test_var = PyLong_AsUnsignedLongLong(value);
26436 0 : if (PyErr_Occurred() != NULL) {
26437 0 : return -1;
26438 : }
26439 0 : if (test_var > uint_max) {
26440 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26441 : PyLong_Type.tp_name, uint_max, test_var);
26442 0 : return -1;
26443 : }
26444 0 : object->in.info_level = test_var;
26445 : } else {
26446 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26447 : PyLong_Type.tp_name);
26448 0 : return -1;
26449 : }
26450 : }
26451 0 : return 0;
26452 : }
26453 :
26454 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_in_get_info(PyObject *obj, void *closure)
26455 : {
26456 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
26457 : PyObject *py_info;
26458 0 : if (object->in.info == NULL) {
26459 0 : Py_RETURN_NONE;
26460 : }
26461 0 : if (object->in.info == NULL) {
26462 0 : py_info = Py_None;
26463 0 : Py_INCREF(py_info);
26464 : } else {
26465 0 : py_info = PyLong_FromLong((uint16_t)*object->in.info);
26466 : }
26467 0 : return py_info;
26468 : }
26469 :
26470 0 : static int py_svcctl_ChangeServiceConfig2W_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
26471 : {
26472 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
26473 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
26474 0 : if (value == NULL) {
26475 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
26476 0 : return -1;
26477 : }
26478 0 : if (value == Py_None) {
26479 0 : object->in.info = NULL;
26480 : } else {
26481 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
26482 0 : if (object->in.info == NULL) {
26483 0 : PyErr_NoMemory();
26484 0 : return -1;
26485 : }
26486 : {
26487 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.info));
26488 0 : if (PyLong_Check(value)) {
26489 : unsigned long long test_var;
26490 0 : test_var = PyLong_AsUnsignedLongLong(value);
26491 0 : if (PyErr_Occurred() != NULL) {
26492 0 : return -1;
26493 : }
26494 0 : if (test_var > uint_max) {
26495 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26496 : PyLong_Type.tp_name, uint_max, test_var);
26497 0 : return -1;
26498 : }
26499 0 : *object->in.info = test_var;
26500 : } else {
26501 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26502 : PyLong_Type.tp_name);
26503 0 : return -1;
26504 : }
26505 : }
26506 : }
26507 0 : return 0;
26508 : }
26509 :
26510 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_get_result(PyObject *obj, void *closure)
26511 : {
26512 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(obj);
26513 : PyObject *py_result;
26514 0 : py_result = PyErr_FromWERROR(object->out.result);
26515 0 : return py_result;
26516 : }
26517 :
26518 0 : static int py_svcctl_ChangeServiceConfig2W_set_result(PyObject *py_obj, PyObject *value, void *closure)
26519 : {
26520 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
26521 0 : if (value == NULL) {
26522 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26523 0 : return -1;
26524 : }
26525 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
26526 0 : return 0;
26527 : }
26528 :
26529 : static PyGetSetDef py_svcctl_ChangeServiceConfig2W_getsetters[] = {
26530 : {
26531 : .name = discard_const_p(char, "in_handle"),
26532 : .get = py_svcctl_ChangeServiceConfig2W_in_get_handle,
26533 : .set = py_svcctl_ChangeServiceConfig2W_in_set_handle,
26534 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26535 : },
26536 : {
26537 : .name = discard_const_p(char, "in_info_level"),
26538 : .get = py_svcctl_ChangeServiceConfig2W_in_get_info_level,
26539 : .set = py_svcctl_ChangeServiceConfig2W_in_set_info_level,
26540 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26541 : },
26542 : {
26543 : .name = discard_const_p(char, "in_info"),
26544 : .get = py_svcctl_ChangeServiceConfig2W_in_get_info,
26545 : .set = py_svcctl_ChangeServiceConfig2W_in_set_info,
26546 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
26547 : },
26548 : {
26549 : .name = discard_const_p(char, "result"),
26550 : .get = py_svcctl_ChangeServiceConfig2W_get_result,
26551 : .set = py_svcctl_ChangeServiceConfig2W_set_result,
26552 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
26553 : },
26554 : { .name = NULL }
26555 : };
26556 :
26557 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26558 : {
26559 0 : PyObject *self = pytalloc_new(struct svcctl_ChangeServiceConfig2W, type);
26560 0 : struct svcctl_ChangeServiceConfig2W *_self = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(self);
26561 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26562 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
26563 0 : return self;
26564 : }
26565 :
26566 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26567 : {
26568 :
26569 :
26570 0 : return PyLong_FromLong(37);
26571 : }
26572 :
26573 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
26574 : {
26575 0 : const struct ndr_interface_call *call = NULL;
26576 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
26577 0 : PyObject *ret = NULL;
26578 0 : struct ndr_push *push = NULL;
26579 : DATA_BLOB blob;
26580 : enum ndr_err_code err;
26581 :
26582 0 : if (ndr_table_svcctl.num_calls < 38) {
26583 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2W_ndr_pack");
26584 0 : return NULL;
26585 : }
26586 0 : call = &ndr_table_svcctl.calls[37];
26587 :
26588 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26589 0 : if (push == NULL) {
26590 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26591 0 : return NULL;
26592 : }
26593 :
26594 0 : push->flags |= ndr_push_flags;
26595 :
26596 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26597 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26598 0 : TALLOC_FREE(push);
26599 0 : PyErr_SetNdrError(err);
26600 0 : return NULL;
26601 : }
26602 0 : blob = ndr_push_blob(push);
26603 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26604 0 : TALLOC_FREE(push);
26605 0 : return ret;
26606 : }
26607 :
26608 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26609 : {
26610 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26611 0 : PyObject *bigendian_obj = NULL;
26612 0 : PyObject *ndr64_obj = NULL;
26613 0 : uint32_t ndr_push_flags = 0;
26614 :
26615 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26616 : discard_const_p(char *, kwnames),
26617 : &bigendian_obj,
26618 : &ndr64_obj)) {
26619 0 : return NULL;
26620 : }
26621 :
26622 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26623 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26624 : }
26625 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26626 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26627 : }
26628 :
26629 0 : return py_svcctl_ChangeServiceConfig2W_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26630 : }
26631 :
26632 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26633 : {
26634 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26635 0 : PyObject *bigendian_obj = NULL;
26636 0 : PyObject *ndr64_obj = NULL;
26637 0 : uint32_t ndr_push_flags = 0;
26638 :
26639 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26640 : discard_const_p(char *, kwnames),
26641 : &bigendian_obj,
26642 : &ndr64_obj)) {
26643 0 : return NULL;
26644 : }
26645 :
26646 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26647 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26648 : }
26649 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26650 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26651 : }
26652 :
26653 0 : return py_svcctl_ChangeServiceConfig2W_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26654 : }
26655 :
26656 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
26657 : {
26658 0 : const struct ndr_interface_call *call = NULL;
26659 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
26660 0 : struct ndr_pull *pull = NULL;
26661 : enum ndr_err_code err;
26662 :
26663 0 : if (ndr_table_svcctl.num_calls < 38) {
26664 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2W_ndr_unpack");
26665 0 : return NULL;
26666 : }
26667 0 : call = &ndr_table_svcctl.calls[37];
26668 :
26669 0 : pull = ndr_pull_init_blob(blob, object);
26670 0 : if (pull == NULL) {
26671 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26672 0 : return NULL;
26673 : }
26674 :
26675 0 : pull->flags |= ndr_pull_flags;
26676 :
26677 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26678 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26679 0 : TALLOC_FREE(pull);
26680 0 : PyErr_SetNdrError(err);
26681 0 : return NULL;
26682 : }
26683 0 : if (!allow_remaining) {
26684 : uint32_t highest_ofs;
26685 :
26686 0 : if (pull->offset > pull->relative_highest_offset) {
26687 0 : highest_ofs = pull->offset;
26688 : } else {
26689 0 : highest_ofs = pull->relative_highest_offset;
26690 : }
26691 0 : if (highest_ofs < pull->data_size) {
26692 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26693 : "not all bytes consumed ofs[%u] size[%u]",
26694 : highest_ofs, pull->data_size);
26695 0 : TALLOC_FREE(pull);
26696 0 : PyErr_SetNdrError(err);
26697 0 : return NULL;
26698 : }
26699 : }
26700 :
26701 0 : TALLOC_FREE(pull);
26702 0 : Py_RETURN_NONE;
26703 : }
26704 :
26705 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26706 : {
26707 : DATA_BLOB blob;
26708 0 : Py_ssize_t blob_length = 0;
26709 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26710 0 : PyObject *bigendian_obj = NULL;
26711 0 : PyObject *ndr64_obj = NULL;
26712 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26713 0 : PyObject *allow_remaining_obj = NULL;
26714 0 : bool allow_remaining = false;
26715 :
26716 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26717 : discard_const_p(char *, kwnames),
26718 : &blob.data, &blob_length,
26719 : &bigendian_obj,
26720 : &ndr64_obj,
26721 : &allow_remaining_obj)) {
26722 0 : return NULL;
26723 : }
26724 0 : blob.length = blob_length;
26725 :
26726 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26727 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26728 : }
26729 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26730 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26731 : }
26732 :
26733 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26734 0 : allow_remaining = true;
26735 : }
26736 :
26737 0 : return py_svcctl_ChangeServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26738 : }
26739 :
26740 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26741 : {
26742 : DATA_BLOB blob;
26743 0 : Py_ssize_t blob_length = 0;
26744 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26745 0 : PyObject *bigendian_obj = NULL;
26746 0 : PyObject *ndr64_obj = NULL;
26747 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26748 0 : PyObject *allow_remaining_obj = NULL;
26749 0 : bool allow_remaining = false;
26750 :
26751 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26752 : discard_const_p(char *, kwnames),
26753 : &blob.data, &blob_length,
26754 : &bigendian_obj,
26755 : &ndr64_obj,
26756 : &allow_remaining_obj)) {
26757 0 : return NULL;
26758 : }
26759 0 : blob.length = blob_length;
26760 :
26761 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26762 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26763 : }
26764 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26765 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26766 : }
26767 :
26768 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26769 0 : allow_remaining = true;
26770 : }
26771 :
26772 0 : return py_svcctl_ChangeServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26773 : }
26774 :
26775 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
26776 : {
26777 0 : const struct ndr_interface_call *call = NULL;
26778 0 : struct svcctl_ChangeServiceConfig2W *object = (struct svcctl_ChangeServiceConfig2W *)pytalloc_get_ptr(py_obj);
26779 : PyObject *ret;
26780 : char *retstr;
26781 :
26782 0 : if (ndr_table_svcctl.num_calls < 38) {
26783 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_ChangeServiceConfig2W_ndr_print");
26784 0 : return NULL;
26785 : }
26786 0 : call = &ndr_table_svcctl.calls[37];
26787 :
26788 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26789 0 : ret = PyUnicode_FromString(retstr);
26790 0 : TALLOC_FREE(retstr);
26791 :
26792 0 : return ret;
26793 : }
26794 :
26795 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26796 : {
26797 0 : return py_svcctl_ChangeServiceConfig2W_ndr_print(py_obj, "svcctl_ChangeServiceConfig2W_in", NDR_IN);
26798 : }
26799 :
26800 0 : static PyObject *py_svcctl_ChangeServiceConfig2W_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26801 : {
26802 0 : return py_svcctl_ChangeServiceConfig2W_ndr_print(py_obj, "svcctl_ChangeServiceConfig2W_out", NDR_OUT);
26803 : }
26804 :
26805 : static PyMethodDef py_svcctl_ChangeServiceConfig2W_methods[] = {
26806 : { "opnum", (PyCFunction)py_svcctl_ChangeServiceConfig2W_ndr_opnum, METH_NOARGS|METH_CLASS,
26807 : "svcctl.ChangeServiceConfig2W.opnum() -> 37 (0x25) " },
26808 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26809 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26810 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26811 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26812 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26813 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26814 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_ChangeServiceConfig2W_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26815 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26816 : { "__ndr_print_in__", (PyCFunction)py_svcctl_ChangeServiceConfig2W_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26817 : { "__ndr_print_out__", (PyCFunction)py_svcctl_ChangeServiceConfig2W_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26818 : { NULL, NULL, 0, NULL }
26819 : };
26820 :
26821 :
26822 : static PyTypeObject svcctl_ChangeServiceConfig2W_Type = {
26823 : PyVarObject_HEAD_INIT(NULL, 0)
26824 : .tp_name = "svcctl.ChangeServiceConfig2W",
26825 : .tp_getset = py_svcctl_ChangeServiceConfig2W_getsetters,
26826 : .tp_methods = py_svcctl_ChangeServiceConfig2W_methods,
26827 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26828 : .tp_new = py_svcctl_ChangeServiceConfig2W_new,
26829 : };
26830 :
26831 0 : static bool pack_py_svcctl_ChangeServiceConfig2W_args_in(PyObject *args, PyObject *kwargs, struct svcctl_ChangeServiceConfig2W *r)
26832 : {
26833 : PyObject *py_handle;
26834 : PyObject *py_info_level;
26835 : PyObject *py_info;
26836 0 : const char *kwnames[] = {
26837 : "handle", "info_level", "info", NULL
26838 : };
26839 :
26840 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_ChangeServiceConfig2W", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_info)) {
26841 0 : return false;
26842 : }
26843 :
26844 0 : if (py_handle == NULL) {
26845 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
26846 0 : return false;
26847 : }
26848 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
26849 0 : if (r->in.handle == NULL) {
26850 0 : PyErr_NoMemory();
26851 0 : return false;
26852 : }
26853 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
26854 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
26855 0 : PyErr_NoMemory();
26856 0 : return false;
26857 : }
26858 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
26859 0 : if (py_info_level == NULL) {
26860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
26861 0 : return false;
26862 : }
26863 : {
26864 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
26865 0 : if (PyLong_Check(py_info_level)) {
26866 : unsigned long long test_var;
26867 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
26868 0 : if (PyErr_Occurred() != NULL) {
26869 0 : return false;
26870 : }
26871 0 : if (test_var > uint_max) {
26872 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26873 : PyLong_Type.tp_name, uint_max, test_var);
26874 0 : return false;
26875 : }
26876 0 : r->in.info_level = test_var;
26877 : } else {
26878 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26879 : PyLong_Type.tp_name);
26880 0 : return false;
26881 : }
26882 : }
26883 0 : if (py_info == NULL) {
26884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
26885 0 : return false;
26886 : }
26887 0 : if (py_info == Py_None) {
26888 0 : r->in.info = NULL;
26889 : } else {
26890 0 : r->in.info = talloc_ptrtype(r, r->in.info);
26891 0 : if (r->in.info == NULL) {
26892 0 : PyErr_NoMemory();
26893 0 : return false;
26894 : }
26895 : {
26896 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.info));
26897 0 : if (PyLong_Check(py_info)) {
26898 : unsigned long long test_var;
26899 0 : test_var = PyLong_AsUnsignedLongLong(py_info);
26900 0 : if (PyErr_Occurred() != NULL) {
26901 0 : return false;
26902 : }
26903 0 : if (test_var > uint_max) {
26904 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26905 : PyLong_Type.tp_name, uint_max, test_var);
26906 0 : return false;
26907 : }
26908 0 : *r->in.info = test_var;
26909 : } else {
26910 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26911 : PyLong_Type.tp_name);
26912 0 : return false;
26913 : }
26914 : }
26915 : }
26916 0 : return true;
26917 : }
26918 :
26919 0 : static PyObject *unpack_py_svcctl_ChangeServiceConfig2W_args_out(struct svcctl_ChangeServiceConfig2W *r)
26920 : {
26921 : PyObject *result;
26922 0 : result = Py_None;
26923 0 : Py_INCREF(result);
26924 0 : if (!W_ERROR_IS_OK(r->out.result)) {
26925 0 : PyErr_SetWERROR(r->out.result);
26926 0 : return NULL;
26927 : }
26928 :
26929 0 : return result;
26930 : }
26931 :
26932 :
26933 0 : static PyObject *py_svcctl_QueryServiceConfig2A_in_get_handle(PyObject *obj, void *closure)
26934 : {
26935 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
26936 : PyObject *py_handle;
26937 0 : if (object->in.handle == NULL) {
26938 0 : Py_RETURN_NONE;
26939 : }
26940 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
26941 0 : return py_handle;
26942 : }
26943 :
26944 0 : static int py_svcctl_QueryServiceConfig2A_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
26945 : {
26946 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
26947 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
26948 0 : if (value == NULL) {
26949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
26950 0 : return -1;
26951 : }
26952 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
26953 0 : if (object->in.handle == NULL) {
26954 0 : PyErr_NoMemory();
26955 0 : return -1;
26956 : }
26957 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26958 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26959 0 : PyErr_NoMemory();
26960 0 : return -1;
26961 : }
26962 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
26963 0 : return 0;
26964 : }
26965 :
26966 0 : static PyObject *py_svcctl_QueryServiceConfig2A_in_get_info_level(PyObject *obj, void *closure)
26967 : {
26968 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
26969 : PyObject *py_info_level;
26970 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
26971 0 : return py_info_level;
26972 : }
26973 :
26974 0 : static int py_svcctl_QueryServiceConfig2A_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
26975 : {
26976 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
26977 0 : if (value == NULL) {
26978 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
26979 0 : return -1;
26980 : }
26981 : {
26982 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
26983 0 : if (PyLong_Check(value)) {
26984 : unsigned long long test_var;
26985 0 : test_var = PyLong_AsUnsignedLongLong(value);
26986 0 : if (PyErr_Occurred() != NULL) {
26987 0 : return -1;
26988 : }
26989 0 : if (test_var > uint_max) {
26990 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26991 : PyLong_Type.tp_name, uint_max, test_var);
26992 0 : return -1;
26993 : }
26994 0 : object->in.info_level = test_var;
26995 : } else {
26996 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26997 : PyLong_Type.tp_name);
26998 0 : return -1;
26999 : }
27000 : }
27001 0 : return 0;
27002 : }
27003 :
27004 0 : static PyObject *py_svcctl_QueryServiceConfig2A_out_get_buffer(PyObject *obj, void *closure)
27005 : {
27006 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
27007 : PyObject *py_buffer;
27008 0 : py_buffer = PyList_New(object->in.offered);
27009 0 : if (py_buffer == NULL) {
27010 0 : return NULL;
27011 : }
27012 : {
27013 : int buffer_cntr_0;
27014 0 : for (buffer_cntr_0 = 0; buffer_cntr_0 < (object->in.offered); buffer_cntr_0++) {
27015 : PyObject *py_buffer_0;
27016 0 : py_buffer_0 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_0]);
27017 0 : PyList_SetItem(py_buffer, buffer_cntr_0, py_buffer_0);
27018 : }
27019 : }
27020 0 : return py_buffer;
27021 : }
27022 :
27023 0 : static int py_svcctl_QueryServiceConfig2A_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
27024 : {
27025 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
27026 0 : if (value == NULL) {
27027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
27028 0 : return -1;
27029 : }
27030 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
27031 : {
27032 : int buffer_cntr_0;
27033 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
27034 0 : if (!object->out.buffer) { return -1;; }
27035 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
27036 0 : for (buffer_cntr_0 = 0; buffer_cntr_0 < PyList_GET_SIZE(value); buffer_cntr_0++) {
27037 0 : if (PyList_GET_ITEM(value, buffer_cntr_0) == NULL) {
27038 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_0]");
27039 0 : return -1;
27040 : }
27041 : {
27042 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_0]));
27043 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_0))) {
27044 : unsigned long long test_var;
27045 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_0));
27046 0 : if (PyErr_Occurred() != NULL) {
27047 0 : return -1;
27048 : }
27049 0 : if (test_var > uint_max) {
27050 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27051 : PyLong_Type.tp_name, uint_max, test_var);
27052 0 : return -1;
27053 : }
27054 0 : object->out.buffer[buffer_cntr_0] = test_var;
27055 : } else {
27056 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27057 : PyLong_Type.tp_name);
27058 0 : return -1;
27059 : }
27060 : }
27061 : }
27062 : }
27063 0 : return 0;
27064 : }
27065 :
27066 0 : static PyObject *py_svcctl_QueryServiceConfig2A_in_get_offered(PyObject *obj, void *closure)
27067 : {
27068 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
27069 : PyObject *py_offered;
27070 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
27071 0 : return py_offered;
27072 : }
27073 :
27074 0 : static int py_svcctl_QueryServiceConfig2A_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
27075 : {
27076 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
27077 0 : if (value == NULL) {
27078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
27079 0 : return -1;
27080 : }
27081 : {
27082 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
27083 0 : if (PyLong_Check(value)) {
27084 : unsigned long long test_var;
27085 0 : test_var = PyLong_AsUnsignedLongLong(value);
27086 0 : if (PyErr_Occurred() != NULL) {
27087 0 : return -1;
27088 : }
27089 0 : if (test_var > uint_max) {
27090 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27091 : PyLong_Type.tp_name, uint_max, test_var);
27092 0 : return -1;
27093 : }
27094 0 : object->in.offered = test_var;
27095 : } else {
27096 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27097 : PyLong_Type.tp_name);
27098 0 : return -1;
27099 : }
27100 : }
27101 0 : return 0;
27102 : }
27103 :
27104 0 : static PyObject *py_svcctl_QueryServiceConfig2A_out_get_needed(PyObject *obj, void *closure)
27105 : {
27106 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
27107 : PyObject *py_needed;
27108 0 : if (object->out.needed == NULL) {
27109 0 : Py_RETURN_NONE;
27110 : }
27111 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
27112 0 : return py_needed;
27113 : }
27114 :
27115 0 : static int py_svcctl_QueryServiceConfig2A_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
27116 : {
27117 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
27118 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
27119 0 : if (value == NULL) {
27120 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
27121 0 : return -1;
27122 : }
27123 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
27124 0 : if (object->out.needed == NULL) {
27125 0 : PyErr_NoMemory();
27126 0 : return -1;
27127 : }
27128 : {
27129 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
27130 0 : if (PyLong_Check(value)) {
27131 : unsigned long long test_var;
27132 0 : test_var = PyLong_AsUnsignedLongLong(value);
27133 0 : if (PyErr_Occurred() != NULL) {
27134 0 : return -1;
27135 : }
27136 0 : if (test_var > uint_max) {
27137 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27138 : PyLong_Type.tp_name, uint_max, test_var);
27139 0 : return -1;
27140 : }
27141 0 : *object->out.needed = test_var;
27142 : } else {
27143 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27144 : PyLong_Type.tp_name);
27145 0 : return -1;
27146 : }
27147 : }
27148 0 : return 0;
27149 : }
27150 :
27151 0 : static PyObject *py_svcctl_QueryServiceConfig2A_get_result(PyObject *obj, void *closure)
27152 : {
27153 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(obj);
27154 : PyObject *py_result;
27155 0 : py_result = PyErr_FromWERROR(object->out.result);
27156 0 : return py_result;
27157 : }
27158 :
27159 0 : static int py_svcctl_QueryServiceConfig2A_set_result(PyObject *py_obj, PyObject *value, void *closure)
27160 : {
27161 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
27162 0 : if (value == NULL) {
27163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27164 0 : return -1;
27165 : }
27166 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
27167 0 : return 0;
27168 : }
27169 :
27170 : static PyGetSetDef py_svcctl_QueryServiceConfig2A_getsetters[] = {
27171 : {
27172 : .name = discard_const_p(char, "in_handle"),
27173 : .get = py_svcctl_QueryServiceConfig2A_in_get_handle,
27174 : .set = py_svcctl_QueryServiceConfig2A_in_set_handle,
27175 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27176 : },
27177 : {
27178 : .name = discard_const_p(char, "in_info_level"),
27179 : .get = py_svcctl_QueryServiceConfig2A_in_get_info_level,
27180 : .set = py_svcctl_QueryServiceConfig2A_in_set_info_level,
27181 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ConfigLevel")
27182 : },
27183 : {
27184 : .name = discard_const_p(char, "out_buffer"),
27185 : .get = py_svcctl_QueryServiceConfig2A_out_get_buffer,
27186 : .set = py_svcctl_QueryServiceConfig2A_out_set_buffer,
27187 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
27188 : },
27189 : {
27190 : .name = discard_const_p(char, "in_offered"),
27191 : .get = py_svcctl_QueryServiceConfig2A_in_get_offered,
27192 : .set = py_svcctl_QueryServiceConfig2A_in_set_offered,
27193 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27194 : },
27195 : {
27196 : .name = discard_const_p(char, "out_needed"),
27197 : .get = py_svcctl_QueryServiceConfig2A_out_get_needed,
27198 : .set = py_svcctl_QueryServiceConfig2A_out_set_needed,
27199 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27200 : },
27201 : {
27202 : .name = discard_const_p(char, "result"),
27203 : .get = py_svcctl_QueryServiceConfig2A_get_result,
27204 : .set = py_svcctl_QueryServiceConfig2A_set_result,
27205 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
27206 : },
27207 : { .name = NULL }
27208 : };
27209 :
27210 0 : static PyObject *py_svcctl_QueryServiceConfig2A_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27211 : {
27212 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfig2A, type);
27213 0 : struct svcctl_QueryServiceConfig2A *_self = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(self);
27214 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27215 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27216 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
27217 0 : return self;
27218 : }
27219 :
27220 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27221 : {
27222 :
27223 :
27224 0 : return PyLong_FromLong(38);
27225 : }
27226 :
27227 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
27228 : {
27229 0 : const struct ndr_interface_call *call = NULL;
27230 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
27231 0 : PyObject *ret = NULL;
27232 0 : struct ndr_push *push = NULL;
27233 : DATA_BLOB blob;
27234 : enum ndr_err_code err;
27235 :
27236 0 : if (ndr_table_svcctl.num_calls < 39) {
27237 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2A_ndr_pack");
27238 0 : return NULL;
27239 : }
27240 0 : call = &ndr_table_svcctl.calls[38];
27241 :
27242 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27243 0 : if (push == NULL) {
27244 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27245 0 : return NULL;
27246 : }
27247 :
27248 0 : push->flags |= ndr_push_flags;
27249 :
27250 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27251 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27252 0 : TALLOC_FREE(push);
27253 0 : PyErr_SetNdrError(err);
27254 0 : return NULL;
27255 : }
27256 0 : blob = ndr_push_blob(push);
27257 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27258 0 : TALLOC_FREE(push);
27259 0 : return ret;
27260 : }
27261 :
27262 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27263 : {
27264 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27265 0 : PyObject *bigendian_obj = NULL;
27266 0 : PyObject *ndr64_obj = NULL;
27267 0 : uint32_t ndr_push_flags = 0;
27268 :
27269 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27270 : discard_const_p(char *, kwnames),
27271 : &bigendian_obj,
27272 : &ndr64_obj)) {
27273 0 : return NULL;
27274 : }
27275 :
27276 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27277 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27278 : }
27279 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27280 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27281 : }
27282 :
27283 0 : return py_svcctl_QueryServiceConfig2A_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27284 : }
27285 :
27286 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27287 : {
27288 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27289 0 : PyObject *bigendian_obj = NULL;
27290 0 : PyObject *ndr64_obj = NULL;
27291 0 : uint32_t ndr_push_flags = 0;
27292 :
27293 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27294 : discard_const_p(char *, kwnames),
27295 : &bigendian_obj,
27296 : &ndr64_obj)) {
27297 0 : return NULL;
27298 : }
27299 :
27300 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27301 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27302 : }
27303 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27304 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27305 : }
27306 :
27307 0 : return py_svcctl_QueryServiceConfig2A_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27308 : }
27309 :
27310 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
27311 : {
27312 0 : const struct ndr_interface_call *call = NULL;
27313 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
27314 0 : struct ndr_pull *pull = NULL;
27315 : enum ndr_err_code err;
27316 :
27317 0 : if (ndr_table_svcctl.num_calls < 39) {
27318 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2A_ndr_unpack");
27319 0 : return NULL;
27320 : }
27321 0 : call = &ndr_table_svcctl.calls[38];
27322 :
27323 0 : pull = ndr_pull_init_blob(blob, object);
27324 0 : if (pull == NULL) {
27325 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27326 0 : return NULL;
27327 : }
27328 :
27329 0 : pull->flags |= ndr_pull_flags;
27330 :
27331 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27332 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27333 0 : TALLOC_FREE(pull);
27334 0 : PyErr_SetNdrError(err);
27335 0 : return NULL;
27336 : }
27337 0 : if (!allow_remaining) {
27338 : uint32_t highest_ofs;
27339 :
27340 0 : if (pull->offset > pull->relative_highest_offset) {
27341 0 : highest_ofs = pull->offset;
27342 : } else {
27343 0 : highest_ofs = pull->relative_highest_offset;
27344 : }
27345 0 : if (highest_ofs < pull->data_size) {
27346 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27347 : "not all bytes consumed ofs[%u] size[%u]",
27348 : highest_ofs, pull->data_size);
27349 0 : TALLOC_FREE(pull);
27350 0 : PyErr_SetNdrError(err);
27351 0 : return NULL;
27352 : }
27353 : }
27354 :
27355 0 : TALLOC_FREE(pull);
27356 0 : Py_RETURN_NONE;
27357 : }
27358 :
27359 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27360 : {
27361 : 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 : uint32_t 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_in__",
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_QueryServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27392 : }
27393 :
27394 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27395 : {
27396 : DATA_BLOB blob;
27397 0 : Py_ssize_t blob_length = 0;
27398 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27399 0 : PyObject *bigendian_obj = NULL;
27400 0 : PyObject *ndr64_obj = NULL;
27401 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27402 0 : PyObject *allow_remaining_obj = NULL;
27403 0 : bool allow_remaining = false;
27404 :
27405 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27406 : discard_const_p(char *, kwnames),
27407 : &blob.data, &blob_length,
27408 : &bigendian_obj,
27409 : &ndr64_obj,
27410 : &allow_remaining_obj)) {
27411 0 : return NULL;
27412 : }
27413 0 : blob.length = blob_length;
27414 :
27415 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27416 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27417 : }
27418 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27419 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27420 : }
27421 :
27422 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27423 0 : allow_remaining = true;
27424 : }
27425 :
27426 0 : return py_svcctl_QueryServiceConfig2A_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27427 : }
27428 :
27429 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
27430 : {
27431 0 : const struct ndr_interface_call *call = NULL;
27432 0 : struct svcctl_QueryServiceConfig2A *object = (struct svcctl_QueryServiceConfig2A *)pytalloc_get_ptr(py_obj);
27433 : PyObject *ret;
27434 : char *retstr;
27435 :
27436 0 : if (ndr_table_svcctl.num_calls < 39) {
27437 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2A_ndr_print");
27438 0 : return NULL;
27439 : }
27440 0 : call = &ndr_table_svcctl.calls[38];
27441 :
27442 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27443 0 : ret = PyUnicode_FromString(retstr);
27444 0 : TALLOC_FREE(retstr);
27445 :
27446 0 : return ret;
27447 : }
27448 :
27449 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27450 : {
27451 0 : return py_svcctl_QueryServiceConfig2A_ndr_print(py_obj, "svcctl_QueryServiceConfig2A_in", NDR_IN);
27452 : }
27453 :
27454 0 : static PyObject *py_svcctl_QueryServiceConfig2A_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27455 : {
27456 0 : return py_svcctl_QueryServiceConfig2A_ndr_print(py_obj, "svcctl_QueryServiceConfig2A_out", NDR_OUT);
27457 : }
27458 :
27459 : static PyMethodDef py_svcctl_QueryServiceConfig2A_methods[] = {
27460 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfig2A_ndr_opnum, METH_NOARGS|METH_CLASS,
27461 : "svcctl.QueryServiceConfig2A.opnum() -> 38 (0x26) " },
27462 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27463 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27464 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27465 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27466 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27467 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27468 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2A_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27469 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27470 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfig2A_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27471 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfig2A_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27472 : { NULL, NULL, 0, NULL }
27473 : };
27474 :
27475 :
27476 : static PyTypeObject svcctl_QueryServiceConfig2A_Type = {
27477 : PyVarObject_HEAD_INIT(NULL, 0)
27478 : .tp_name = "svcctl.QueryServiceConfig2A",
27479 : .tp_getset = py_svcctl_QueryServiceConfig2A_getsetters,
27480 : .tp_methods = py_svcctl_QueryServiceConfig2A_methods,
27481 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27482 : .tp_new = py_svcctl_QueryServiceConfig2A_new,
27483 : };
27484 :
27485 0 : static bool pack_py_svcctl_QueryServiceConfig2A_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfig2A *r)
27486 : {
27487 : PyObject *py_handle;
27488 : PyObject *py_info_level;
27489 : PyObject *py_offered;
27490 0 : const char *kwnames[] = {
27491 : "handle", "info_level", "offered", NULL
27492 : };
27493 :
27494 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceConfig2A", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_offered)) {
27495 0 : return false;
27496 : }
27497 :
27498 0 : if (py_handle == NULL) {
27499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
27500 0 : return false;
27501 : }
27502 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
27503 0 : if (r->in.handle == NULL) {
27504 0 : PyErr_NoMemory();
27505 0 : return false;
27506 : }
27507 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
27508 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
27509 0 : PyErr_NoMemory();
27510 0 : return false;
27511 : }
27512 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
27513 0 : if (py_info_level == NULL) {
27514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
27515 0 : return false;
27516 : }
27517 : {
27518 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
27519 0 : if (PyLong_Check(py_info_level)) {
27520 : unsigned long long test_var;
27521 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
27522 0 : if (PyErr_Occurred() != NULL) {
27523 0 : return false;
27524 : }
27525 0 : if (test_var > uint_max) {
27526 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27527 : PyLong_Type.tp_name, uint_max, test_var);
27528 0 : return false;
27529 : }
27530 0 : r->in.info_level = test_var;
27531 : } else {
27532 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27533 : PyLong_Type.tp_name);
27534 0 : return false;
27535 : }
27536 : }
27537 0 : if (py_offered == NULL) {
27538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
27539 0 : return false;
27540 : }
27541 : {
27542 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
27543 0 : if (PyLong_Check(py_offered)) {
27544 : unsigned long long test_var;
27545 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
27546 0 : if (PyErr_Occurred() != NULL) {
27547 0 : return false;
27548 : }
27549 0 : if (test_var > uint_max) {
27550 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27551 : PyLong_Type.tp_name, uint_max, test_var);
27552 0 : return false;
27553 : }
27554 0 : r->in.offered = test_var;
27555 : } else {
27556 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27557 : PyLong_Type.tp_name);
27558 0 : return false;
27559 : }
27560 : }
27561 0 : return true;
27562 : }
27563 :
27564 0 : static PyObject *unpack_py_svcctl_QueryServiceConfig2A_args_out(struct svcctl_QueryServiceConfig2A *r)
27565 : {
27566 : PyObject *result;
27567 : PyObject *py_buffer;
27568 : PyObject *py_needed;
27569 0 : result = PyTuple_New(2);
27570 0 : py_buffer = PyList_New(r->in.offered);
27571 0 : if (py_buffer == NULL) {
27572 0 : return NULL;
27573 : }
27574 : {
27575 : int buffer_cntr_0;
27576 0 : for (buffer_cntr_0 = 0; buffer_cntr_0 < (r->in.offered); buffer_cntr_0++) {
27577 : PyObject *py_buffer_0;
27578 0 : py_buffer_0 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_0]);
27579 0 : PyList_SetItem(py_buffer, buffer_cntr_0, py_buffer_0);
27580 : }
27581 : }
27582 0 : PyTuple_SetItem(result, 0, py_buffer);
27583 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
27584 0 : PyTuple_SetItem(result, 1, py_needed);
27585 0 : if (!W_ERROR_IS_OK(r->out.result)) {
27586 0 : PyErr_SetWERROR(r->out.result);
27587 0 : return NULL;
27588 : }
27589 :
27590 0 : return result;
27591 : }
27592 :
27593 :
27594 0 : static PyObject *py_svcctl_QueryServiceConfig2W_in_get_handle(PyObject *obj, void *closure)
27595 : {
27596 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
27597 : PyObject *py_handle;
27598 0 : if (object->in.handle == NULL) {
27599 0 : Py_RETURN_NONE;
27600 : }
27601 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
27602 0 : return py_handle;
27603 : }
27604 :
27605 0 : static int py_svcctl_QueryServiceConfig2W_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27606 : {
27607 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27608 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27609 0 : if (value == NULL) {
27610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27611 0 : return -1;
27612 : }
27613 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27614 0 : if (object->in.handle == NULL) {
27615 0 : PyErr_NoMemory();
27616 0 : return -1;
27617 : }
27618 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27619 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27620 0 : PyErr_NoMemory();
27621 0 : return -1;
27622 : }
27623 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27624 0 : return 0;
27625 : }
27626 :
27627 0 : static PyObject *py_svcctl_QueryServiceConfig2W_in_get_info_level(PyObject *obj, void *closure)
27628 : {
27629 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
27630 : PyObject *py_info_level;
27631 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
27632 0 : return py_info_level;
27633 : }
27634 :
27635 0 : static int py_svcctl_QueryServiceConfig2W_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
27636 : {
27637 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27638 0 : if (value == NULL) {
27639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
27640 0 : return -1;
27641 : }
27642 : {
27643 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
27644 0 : if (PyLong_Check(value)) {
27645 : unsigned long long test_var;
27646 0 : test_var = PyLong_AsUnsignedLongLong(value);
27647 0 : if (PyErr_Occurred() != NULL) {
27648 0 : return -1;
27649 : }
27650 0 : if (test_var > uint_max) {
27651 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27652 : PyLong_Type.tp_name, uint_max, test_var);
27653 0 : return -1;
27654 : }
27655 0 : object->in.info_level = test_var;
27656 : } else {
27657 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27658 : PyLong_Type.tp_name);
27659 0 : return -1;
27660 : }
27661 : }
27662 0 : return 0;
27663 : }
27664 :
27665 0 : static PyObject *py_svcctl_QueryServiceConfig2W_out_get_buffer(PyObject *obj, void *closure)
27666 : {
27667 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
27668 : PyObject *py_buffer;
27669 0 : if (object->out.buffer == NULL) {
27670 0 : Py_RETURN_NONE;
27671 : }
27672 0 : py_buffer = PyList_New(object->in.offered);
27673 0 : if (py_buffer == NULL) {
27674 0 : return NULL;
27675 : }
27676 : {
27677 : int buffer_cntr_1;
27678 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
27679 : PyObject *py_buffer_1;
27680 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_1]);
27681 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
27682 : }
27683 : }
27684 0 : return py_buffer;
27685 : }
27686 :
27687 0 : static int py_svcctl_QueryServiceConfig2W_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
27688 : {
27689 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27690 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
27691 0 : if (value == NULL) {
27692 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
27693 0 : return -1;
27694 : }
27695 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
27696 0 : if (object->out.buffer == NULL) {
27697 0 : PyErr_NoMemory();
27698 0 : return -1;
27699 : }
27700 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
27701 : {
27702 : int buffer_cntr_1;
27703 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
27704 0 : if (!object->out.buffer) { return -1;; }
27705 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
27706 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
27707 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
27708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_1]");
27709 0 : return -1;
27710 : }
27711 : {
27712 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_1]));
27713 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
27714 : unsigned long long test_var;
27715 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
27716 0 : if (PyErr_Occurred() != NULL) {
27717 0 : return -1;
27718 : }
27719 0 : if (test_var > uint_max) {
27720 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27721 : PyLong_Type.tp_name, uint_max, test_var);
27722 0 : return -1;
27723 : }
27724 0 : object->out.buffer[buffer_cntr_1] = test_var;
27725 : } else {
27726 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27727 : PyLong_Type.tp_name);
27728 0 : return -1;
27729 : }
27730 : }
27731 : }
27732 : }
27733 0 : return 0;
27734 : }
27735 :
27736 0 : static PyObject *py_svcctl_QueryServiceConfig2W_in_get_offered(PyObject *obj, void *closure)
27737 : {
27738 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
27739 : PyObject *py_offered;
27740 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
27741 0 : return py_offered;
27742 : }
27743 :
27744 0 : static int py_svcctl_QueryServiceConfig2W_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
27745 : {
27746 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27747 0 : if (value == NULL) {
27748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
27749 0 : return -1;
27750 : }
27751 : {
27752 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
27753 0 : if (PyLong_Check(value)) {
27754 : unsigned long long test_var;
27755 0 : test_var = PyLong_AsUnsignedLongLong(value);
27756 0 : if (PyErr_Occurred() != NULL) {
27757 0 : return -1;
27758 : }
27759 0 : if (test_var > uint_max) {
27760 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27761 : PyLong_Type.tp_name, uint_max, test_var);
27762 0 : return -1;
27763 : }
27764 0 : object->in.offered = test_var;
27765 : } else {
27766 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27767 : PyLong_Type.tp_name);
27768 0 : return -1;
27769 : }
27770 : }
27771 0 : return 0;
27772 : }
27773 :
27774 0 : static PyObject *py_svcctl_QueryServiceConfig2W_out_get_needed(PyObject *obj, void *closure)
27775 : {
27776 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
27777 : PyObject *py_needed;
27778 0 : if (object->out.needed == NULL) {
27779 0 : Py_RETURN_NONE;
27780 : }
27781 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
27782 0 : return py_needed;
27783 : }
27784 :
27785 0 : static int py_svcctl_QueryServiceConfig2W_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
27786 : {
27787 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27788 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
27789 0 : if (value == NULL) {
27790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
27791 0 : return -1;
27792 : }
27793 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
27794 0 : if (object->out.needed == NULL) {
27795 0 : PyErr_NoMemory();
27796 0 : return -1;
27797 : }
27798 : {
27799 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
27800 0 : if (PyLong_Check(value)) {
27801 : unsigned long long test_var;
27802 0 : test_var = PyLong_AsUnsignedLongLong(value);
27803 0 : if (PyErr_Occurred() != NULL) {
27804 0 : return -1;
27805 : }
27806 0 : if (test_var > uint_max) {
27807 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27808 : PyLong_Type.tp_name, uint_max, test_var);
27809 0 : return -1;
27810 : }
27811 0 : *object->out.needed = test_var;
27812 : } else {
27813 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27814 : PyLong_Type.tp_name);
27815 0 : return -1;
27816 : }
27817 : }
27818 0 : return 0;
27819 : }
27820 :
27821 0 : static PyObject *py_svcctl_QueryServiceConfig2W_get_result(PyObject *obj, void *closure)
27822 : {
27823 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(obj);
27824 : PyObject *py_result;
27825 0 : py_result = PyErr_FromWERROR(object->out.result);
27826 0 : return py_result;
27827 : }
27828 :
27829 0 : static int py_svcctl_QueryServiceConfig2W_set_result(PyObject *py_obj, PyObject *value, void *closure)
27830 : {
27831 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27832 0 : if (value == NULL) {
27833 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27834 0 : return -1;
27835 : }
27836 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
27837 0 : return 0;
27838 : }
27839 :
27840 : static PyGetSetDef py_svcctl_QueryServiceConfig2W_getsetters[] = {
27841 : {
27842 : .name = discard_const_p(char, "in_handle"),
27843 : .get = py_svcctl_QueryServiceConfig2W_in_get_handle,
27844 : .set = py_svcctl_QueryServiceConfig2W_in_set_handle,
27845 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27846 : },
27847 : {
27848 : .name = discard_const_p(char, "in_info_level"),
27849 : .get = py_svcctl_QueryServiceConfig2W_in_get_info_level,
27850 : .set = py_svcctl_QueryServiceConfig2W_in_set_info_level,
27851 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ConfigLevel")
27852 : },
27853 : {
27854 : .name = discard_const_p(char, "out_buffer"),
27855 : .get = py_svcctl_QueryServiceConfig2W_out_get_buffer,
27856 : .set = py_svcctl_QueryServiceConfig2W_out_set_buffer,
27857 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
27858 : },
27859 : {
27860 : .name = discard_const_p(char, "in_offered"),
27861 : .get = py_svcctl_QueryServiceConfig2W_in_get_offered,
27862 : .set = py_svcctl_QueryServiceConfig2W_in_set_offered,
27863 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27864 : },
27865 : {
27866 : .name = discard_const_p(char, "out_needed"),
27867 : .get = py_svcctl_QueryServiceConfig2W_out_get_needed,
27868 : .set = py_svcctl_QueryServiceConfig2W_out_set_needed,
27869 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27870 : },
27871 : {
27872 : .name = discard_const_p(char, "result"),
27873 : .get = py_svcctl_QueryServiceConfig2W_get_result,
27874 : .set = py_svcctl_QueryServiceConfig2W_set_result,
27875 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
27876 : },
27877 : { .name = NULL }
27878 : };
27879 :
27880 0 : static PyObject *py_svcctl_QueryServiceConfig2W_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27881 : {
27882 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceConfig2W, type);
27883 0 : struct svcctl_QueryServiceConfig2W *_self = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(self);
27884 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27885 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27886 0 : _self->out.buffer = talloc_zero(mem_ctx, uint8_t);
27887 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
27888 0 : return self;
27889 : }
27890 :
27891 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27892 : {
27893 :
27894 :
27895 0 : return PyLong_FromLong(39);
27896 : }
27897 :
27898 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
27899 : {
27900 0 : const struct ndr_interface_call *call = NULL;
27901 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27902 0 : PyObject *ret = NULL;
27903 0 : struct ndr_push *push = NULL;
27904 : DATA_BLOB blob;
27905 : enum ndr_err_code err;
27906 :
27907 0 : if (ndr_table_svcctl.num_calls < 40) {
27908 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2W_ndr_pack");
27909 0 : return NULL;
27910 : }
27911 0 : call = &ndr_table_svcctl.calls[39];
27912 :
27913 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27914 0 : if (push == NULL) {
27915 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27916 0 : return NULL;
27917 : }
27918 :
27919 0 : push->flags |= ndr_push_flags;
27920 :
27921 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27922 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27923 0 : TALLOC_FREE(push);
27924 0 : PyErr_SetNdrError(err);
27925 0 : return NULL;
27926 : }
27927 0 : blob = ndr_push_blob(push);
27928 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27929 0 : TALLOC_FREE(push);
27930 0 : return ret;
27931 : }
27932 :
27933 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27934 : {
27935 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27936 0 : PyObject *bigendian_obj = NULL;
27937 0 : PyObject *ndr64_obj = NULL;
27938 0 : uint32_t ndr_push_flags = 0;
27939 :
27940 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27941 : discard_const_p(char *, kwnames),
27942 : &bigendian_obj,
27943 : &ndr64_obj)) {
27944 0 : return NULL;
27945 : }
27946 :
27947 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27948 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27949 : }
27950 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27951 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27952 : }
27953 :
27954 0 : return py_svcctl_QueryServiceConfig2W_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27955 : }
27956 :
27957 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27958 : {
27959 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27960 0 : PyObject *bigendian_obj = NULL;
27961 0 : PyObject *ndr64_obj = NULL;
27962 0 : uint32_t ndr_push_flags = 0;
27963 :
27964 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27965 : discard_const_p(char *, kwnames),
27966 : &bigendian_obj,
27967 : &ndr64_obj)) {
27968 0 : return NULL;
27969 : }
27970 :
27971 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27972 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27973 : }
27974 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27975 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27976 : }
27977 :
27978 0 : return py_svcctl_QueryServiceConfig2W_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27979 : }
27980 :
27981 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
27982 : {
27983 0 : const struct ndr_interface_call *call = NULL;
27984 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
27985 0 : struct ndr_pull *pull = NULL;
27986 : enum ndr_err_code err;
27987 :
27988 0 : if (ndr_table_svcctl.num_calls < 40) {
27989 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2W_ndr_unpack");
27990 0 : return NULL;
27991 : }
27992 0 : call = &ndr_table_svcctl.calls[39];
27993 :
27994 0 : pull = ndr_pull_init_blob(blob, object);
27995 0 : if (pull == NULL) {
27996 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27997 0 : return NULL;
27998 : }
27999 :
28000 0 : pull->flags |= ndr_pull_flags;
28001 :
28002 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28003 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28004 0 : TALLOC_FREE(pull);
28005 0 : PyErr_SetNdrError(err);
28006 0 : return NULL;
28007 : }
28008 0 : if (!allow_remaining) {
28009 : uint32_t highest_ofs;
28010 :
28011 0 : if (pull->offset > pull->relative_highest_offset) {
28012 0 : highest_ofs = pull->offset;
28013 : } else {
28014 0 : highest_ofs = pull->relative_highest_offset;
28015 : }
28016 0 : if (highest_ofs < pull->data_size) {
28017 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28018 : "not all bytes consumed ofs[%u] size[%u]",
28019 : highest_ofs, pull->data_size);
28020 0 : TALLOC_FREE(pull);
28021 0 : PyErr_SetNdrError(err);
28022 0 : return NULL;
28023 : }
28024 : }
28025 :
28026 0 : TALLOC_FREE(pull);
28027 0 : Py_RETURN_NONE;
28028 : }
28029 :
28030 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28031 : {
28032 : DATA_BLOB blob;
28033 0 : Py_ssize_t blob_length = 0;
28034 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28035 0 : PyObject *bigendian_obj = NULL;
28036 0 : PyObject *ndr64_obj = NULL;
28037 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28038 0 : PyObject *allow_remaining_obj = NULL;
28039 0 : bool allow_remaining = false;
28040 :
28041 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28042 : discard_const_p(char *, kwnames),
28043 : &blob.data, &blob_length,
28044 : &bigendian_obj,
28045 : &ndr64_obj,
28046 : &allow_remaining_obj)) {
28047 0 : return NULL;
28048 : }
28049 0 : blob.length = blob_length;
28050 :
28051 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28052 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28053 : }
28054 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28055 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28056 : }
28057 :
28058 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28059 0 : allow_remaining = true;
28060 : }
28061 :
28062 0 : return py_svcctl_QueryServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28063 : }
28064 :
28065 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28066 : {
28067 : DATA_BLOB blob;
28068 0 : Py_ssize_t blob_length = 0;
28069 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28070 0 : PyObject *bigendian_obj = NULL;
28071 0 : PyObject *ndr64_obj = NULL;
28072 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28073 0 : PyObject *allow_remaining_obj = NULL;
28074 0 : bool allow_remaining = false;
28075 :
28076 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28077 : discard_const_p(char *, kwnames),
28078 : &blob.data, &blob_length,
28079 : &bigendian_obj,
28080 : &ndr64_obj,
28081 : &allow_remaining_obj)) {
28082 0 : return NULL;
28083 : }
28084 0 : blob.length = blob_length;
28085 :
28086 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28087 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28088 : }
28089 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28090 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28091 : }
28092 :
28093 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28094 0 : allow_remaining = true;
28095 : }
28096 :
28097 0 : return py_svcctl_QueryServiceConfig2W_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28098 : }
28099 :
28100 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
28101 : {
28102 0 : const struct ndr_interface_call *call = NULL;
28103 0 : struct svcctl_QueryServiceConfig2W *object = (struct svcctl_QueryServiceConfig2W *)pytalloc_get_ptr(py_obj);
28104 : PyObject *ret;
28105 : char *retstr;
28106 :
28107 0 : if (ndr_table_svcctl.num_calls < 40) {
28108 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceConfig2W_ndr_print");
28109 0 : return NULL;
28110 : }
28111 0 : call = &ndr_table_svcctl.calls[39];
28112 :
28113 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28114 0 : ret = PyUnicode_FromString(retstr);
28115 0 : TALLOC_FREE(retstr);
28116 :
28117 0 : return ret;
28118 : }
28119 :
28120 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28121 : {
28122 0 : return py_svcctl_QueryServiceConfig2W_ndr_print(py_obj, "svcctl_QueryServiceConfig2W_in", NDR_IN);
28123 : }
28124 :
28125 0 : static PyObject *py_svcctl_QueryServiceConfig2W_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28126 : {
28127 0 : return py_svcctl_QueryServiceConfig2W_ndr_print(py_obj, "svcctl_QueryServiceConfig2W_out", NDR_OUT);
28128 : }
28129 :
28130 : static PyMethodDef py_svcctl_QueryServiceConfig2W_methods[] = {
28131 : { "opnum", (PyCFunction)py_svcctl_QueryServiceConfig2W_ndr_opnum, METH_NOARGS|METH_CLASS,
28132 : "svcctl.QueryServiceConfig2W.opnum() -> 39 (0x27) " },
28133 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28134 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28135 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28136 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28137 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28138 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28139 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceConfig2W_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28140 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28141 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceConfig2W_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28142 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceConfig2W_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28143 : { NULL, NULL, 0, NULL }
28144 : };
28145 :
28146 :
28147 : static PyTypeObject svcctl_QueryServiceConfig2W_Type = {
28148 : PyVarObject_HEAD_INIT(NULL, 0)
28149 : .tp_name = "svcctl.QueryServiceConfig2W",
28150 : .tp_getset = py_svcctl_QueryServiceConfig2W_getsetters,
28151 : .tp_methods = py_svcctl_QueryServiceConfig2W_methods,
28152 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28153 : .tp_new = py_svcctl_QueryServiceConfig2W_new,
28154 : };
28155 :
28156 0 : static bool pack_py_svcctl_QueryServiceConfig2W_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceConfig2W *r)
28157 : {
28158 : PyObject *py_handle;
28159 : PyObject *py_info_level;
28160 : PyObject *py_offered;
28161 0 : const char *kwnames[] = {
28162 : "handle", "info_level", "offered", NULL
28163 : };
28164 :
28165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceConfig2W", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_offered)) {
28166 0 : return false;
28167 : }
28168 :
28169 0 : if (py_handle == NULL) {
28170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
28171 0 : return false;
28172 : }
28173 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
28174 0 : if (r->in.handle == NULL) {
28175 0 : PyErr_NoMemory();
28176 0 : return false;
28177 : }
28178 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
28179 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
28180 0 : PyErr_NoMemory();
28181 0 : return false;
28182 : }
28183 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
28184 0 : if (py_info_level == NULL) {
28185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
28186 0 : return false;
28187 : }
28188 : {
28189 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
28190 0 : if (PyLong_Check(py_info_level)) {
28191 : unsigned long long test_var;
28192 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
28193 0 : if (PyErr_Occurred() != NULL) {
28194 0 : return false;
28195 : }
28196 0 : if (test_var > uint_max) {
28197 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28198 : PyLong_Type.tp_name, uint_max, test_var);
28199 0 : return false;
28200 : }
28201 0 : r->in.info_level = test_var;
28202 : } else {
28203 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28204 : PyLong_Type.tp_name);
28205 0 : return false;
28206 : }
28207 : }
28208 0 : if (py_offered == NULL) {
28209 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
28210 0 : return false;
28211 : }
28212 : {
28213 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
28214 0 : if (PyLong_Check(py_offered)) {
28215 : unsigned long long test_var;
28216 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
28217 0 : if (PyErr_Occurred() != NULL) {
28218 0 : return false;
28219 : }
28220 0 : if (test_var > uint_max) {
28221 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28222 : PyLong_Type.tp_name, uint_max, test_var);
28223 0 : return false;
28224 : }
28225 0 : r->in.offered = test_var;
28226 : } else {
28227 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28228 : PyLong_Type.tp_name);
28229 0 : return false;
28230 : }
28231 : }
28232 0 : return true;
28233 : }
28234 :
28235 0 : static PyObject *unpack_py_svcctl_QueryServiceConfig2W_args_out(struct svcctl_QueryServiceConfig2W *r)
28236 : {
28237 : PyObject *result;
28238 : PyObject *py_buffer;
28239 : PyObject *py_needed;
28240 0 : result = PyTuple_New(2);
28241 0 : py_buffer = PyList_New(r->in.offered);
28242 0 : if (py_buffer == NULL) {
28243 0 : return NULL;
28244 : }
28245 : {
28246 : int buffer_cntr_1;
28247 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
28248 : PyObject *py_buffer_1;
28249 0 : py_buffer_1 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_1]);
28250 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
28251 : }
28252 : }
28253 0 : PyTuple_SetItem(result, 0, py_buffer);
28254 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
28255 0 : PyTuple_SetItem(result, 1, py_needed);
28256 0 : if (!W_ERROR_IS_OK(r->out.result)) {
28257 0 : PyErr_SetWERROR(r->out.result);
28258 0 : return NULL;
28259 : }
28260 :
28261 0 : return result;
28262 : }
28263 :
28264 :
28265 0 : static PyObject *py_svcctl_QueryServiceStatusEx_in_get_handle(PyObject *obj, void *closure)
28266 : {
28267 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
28268 : PyObject *py_handle;
28269 0 : if (object->in.handle == NULL) {
28270 0 : Py_RETURN_NONE;
28271 : }
28272 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
28273 0 : return py_handle;
28274 : }
28275 :
28276 0 : static int py_svcctl_QueryServiceStatusEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28277 : {
28278 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28279 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
28280 0 : if (value == NULL) {
28281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
28282 0 : return -1;
28283 : }
28284 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
28285 0 : if (object->in.handle == NULL) {
28286 0 : PyErr_NoMemory();
28287 0 : return -1;
28288 : }
28289 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28290 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28291 0 : PyErr_NoMemory();
28292 0 : return -1;
28293 : }
28294 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28295 0 : return 0;
28296 : }
28297 :
28298 0 : static PyObject *py_svcctl_QueryServiceStatusEx_in_get_info_level(PyObject *obj, void *closure)
28299 : {
28300 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
28301 : PyObject *py_info_level;
28302 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
28303 0 : return py_info_level;
28304 : }
28305 :
28306 0 : static int py_svcctl_QueryServiceStatusEx_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
28307 : {
28308 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28309 0 : if (value == NULL) {
28310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
28311 0 : return -1;
28312 : }
28313 : {
28314 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
28315 0 : if (PyLong_Check(value)) {
28316 : unsigned long long test_var;
28317 0 : test_var = PyLong_AsUnsignedLongLong(value);
28318 0 : if (PyErr_Occurred() != NULL) {
28319 0 : return -1;
28320 : }
28321 0 : if (test_var > uint_max) {
28322 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28323 : PyLong_Type.tp_name, uint_max, test_var);
28324 0 : return -1;
28325 : }
28326 0 : object->in.info_level = test_var;
28327 : } else {
28328 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28329 : PyLong_Type.tp_name);
28330 0 : return -1;
28331 : }
28332 : }
28333 0 : return 0;
28334 : }
28335 :
28336 0 : static PyObject *py_svcctl_QueryServiceStatusEx_out_get_buffer(PyObject *obj, void *closure)
28337 : {
28338 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
28339 : PyObject *py_buffer;
28340 0 : if (object->out.buffer == NULL) {
28341 0 : Py_RETURN_NONE;
28342 : }
28343 0 : py_buffer = PyList_New(object->in.offered);
28344 0 : if (py_buffer == NULL) {
28345 0 : return NULL;
28346 : }
28347 : {
28348 : int buffer_cntr_1;
28349 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
28350 : PyObject *py_buffer_1;
28351 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->out.buffer[buffer_cntr_1]);
28352 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
28353 : }
28354 : }
28355 0 : return py_buffer;
28356 : }
28357 :
28358 0 : static int py_svcctl_QueryServiceStatusEx_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
28359 : {
28360 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28361 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
28362 0 : if (value == NULL) {
28363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
28364 0 : return -1;
28365 : }
28366 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
28367 0 : if (object->out.buffer == NULL) {
28368 0 : PyErr_NoMemory();
28369 0 : return -1;
28370 : }
28371 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
28372 : {
28373 : int buffer_cntr_1;
28374 0 : object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
28375 0 : if (!object->out.buffer) { return -1;; }
28376 0 : talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
28377 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
28378 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
28379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer[buffer_cntr_1]");
28380 0 : return -1;
28381 : }
28382 : {
28383 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.buffer[buffer_cntr_1]));
28384 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
28385 : unsigned long long test_var;
28386 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
28387 0 : if (PyErr_Occurred() != NULL) {
28388 0 : return -1;
28389 : }
28390 0 : if (test_var > uint_max) {
28391 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28392 : PyLong_Type.tp_name, uint_max, test_var);
28393 0 : return -1;
28394 : }
28395 0 : object->out.buffer[buffer_cntr_1] = test_var;
28396 : } else {
28397 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28398 : PyLong_Type.tp_name);
28399 0 : return -1;
28400 : }
28401 : }
28402 : }
28403 : }
28404 0 : return 0;
28405 : }
28406 :
28407 0 : static PyObject *py_svcctl_QueryServiceStatusEx_in_get_offered(PyObject *obj, void *closure)
28408 : {
28409 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
28410 : PyObject *py_offered;
28411 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
28412 0 : return py_offered;
28413 : }
28414 :
28415 0 : static int py_svcctl_QueryServiceStatusEx_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
28416 : {
28417 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28418 0 : if (value == NULL) {
28419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
28420 0 : return -1;
28421 : }
28422 : {
28423 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
28424 0 : if (PyLong_Check(value)) {
28425 : unsigned long long test_var;
28426 0 : test_var = PyLong_AsUnsignedLongLong(value);
28427 0 : if (PyErr_Occurred() != NULL) {
28428 0 : return -1;
28429 : }
28430 0 : if (test_var > uint_max) {
28431 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28432 : PyLong_Type.tp_name, uint_max, test_var);
28433 0 : return -1;
28434 : }
28435 0 : object->in.offered = test_var;
28436 : } else {
28437 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28438 : PyLong_Type.tp_name);
28439 0 : return -1;
28440 : }
28441 : }
28442 0 : return 0;
28443 : }
28444 :
28445 0 : static PyObject *py_svcctl_QueryServiceStatusEx_out_get_needed(PyObject *obj, void *closure)
28446 : {
28447 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
28448 : PyObject *py_needed;
28449 0 : if (object->out.needed == NULL) {
28450 0 : Py_RETURN_NONE;
28451 : }
28452 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
28453 0 : return py_needed;
28454 : }
28455 :
28456 0 : static int py_svcctl_QueryServiceStatusEx_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
28457 : {
28458 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28459 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
28460 0 : if (value == NULL) {
28461 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
28462 0 : return -1;
28463 : }
28464 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
28465 0 : if (object->out.needed == NULL) {
28466 0 : PyErr_NoMemory();
28467 0 : return -1;
28468 : }
28469 : {
28470 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
28471 0 : if (PyLong_Check(value)) {
28472 : unsigned long long test_var;
28473 0 : test_var = PyLong_AsUnsignedLongLong(value);
28474 0 : if (PyErr_Occurred() != NULL) {
28475 0 : return -1;
28476 : }
28477 0 : if (test_var > uint_max) {
28478 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28479 : PyLong_Type.tp_name, uint_max, test_var);
28480 0 : return -1;
28481 : }
28482 0 : *object->out.needed = test_var;
28483 : } else {
28484 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28485 : PyLong_Type.tp_name);
28486 0 : return -1;
28487 : }
28488 : }
28489 0 : return 0;
28490 : }
28491 :
28492 0 : static PyObject *py_svcctl_QueryServiceStatusEx_get_result(PyObject *obj, void *closure)
28493 : {
28494 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(obj);
28495 : PyObject *py_result;
28496 0 : py_result = PyErr_FromWERROR(object->out.result);
28497 0 : return py_result;
28498 : }
28499 :
28500 0 : static int py_svcctl_QueryServiceStatusEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
28501 : {
28502 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28503 0 : if (value == NULL) {
28504 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28505 0 : return -1;
28506 : }
28507 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
28508 0 : return 0;
28509 : }
28510 :
28511 : static PyGetSetDef py_svcctl_QueryServiceStatusEx_getsetters[] = {
28512 : {
28513 : .name = discard_const_p(char, "in_handle"),
28514 : .get = py_svcctl_QueryServiceStatusEx_in_get_handle,
28515 : .set = py_svcctl_QueryServiceStatusEx_in_set_handle,
28516 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28517 : },
28518 : {
28519 : .name = discard_const_p(char, "in_info_level"),
28520 : .get = py_svcctl_QueryServiceStatusEx_in_get_info_level,
28521 : .set = py_svcctl_QueryServiceStatusEx_in_set_info_level,
28522 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_StatusLevel")
28523 : },
28524 : {
28525 : .name = discard_const_p(char, "out_buffer"),
28526 : .get = py_svcctl_QueryServiceStatusEx_out_get_buffer,
28527 : .set = py_svcctl_QueryServiceStatusEx_out_set_buffer,
28528 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
28529 : },
28530 : {
28531 : .name = discard_const_p(char, "in_offered"),
28532 : .get = py_svcctl_QueryServiceStatusEx_in_get_offered,
28533 : .set = py_svcctl_QueryServiceStatusEx_in_set_offered,
28534 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
28535 : },
28536 : {
28537 : .name = discard_const_p(char, "out_needed"),
28538 : .get = py_svcctl_QueryServiceStatusEx_out_get_needed,
28539 : .set = py_svcctl_QueryServiceStatusEx_out_set_needed,
28540 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
28541 : },
28542 : {
28543 : .name = discard_const_p(char, "result"),
28544 : .get = py_svcctl_QueryServiceStatusEx_get_result,
28545 : .set = py_svcctl_QueryServiceStatusEx_set_result,
28546 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
28547 : },
28548 : { .name = NULL }
28549 : };
28550 :
28551 0 : static PyObject *py_svcctl_QueryServiceStatusEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28552 : {
28553 0 : PyObject *self = pytalloc_new(struct svcctl_QueryServiceStatusEx, type);
28554 0 : struct svcctl_QueryServiceStatusEx *_self = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(self);
28555 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28556 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28557 0 : _self->out.buffer = talloc_zero(mem_ctx, uint8_t);
28558 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
28559 0 : return self;
28560 : }
28561 :
28562 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28563 : {
28564 :
28565 :
28566 0 : return PyLong_FromLong(40);
28567 : }
28568 :
28569 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
28570 : {
28571 0 : const struct ndr_interface_call *call = NULL;
28572 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28573 0 : PyObject *ret = NULL;
28574 0 : struct ndr_push *push = NULL;
28575 : DATA_BLOB blob;
28576 : enum ndr_err_code err;
28577 :
28578 0 : if (ndr_table_svcctl.num_calls < 41) {
28579 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatusEx_ndr_pack");
28580 0 : return NULL;
28581 : }
28582 0 : call = &ndr_table_svcctl.calls[40];
28583 :
28584 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28585 0 : if (push == NULL) {
28586 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28587 0 : return NULL;
28588 : }
28589 :
28590 0 : push->flags |= ndr_push_flags;
28591 :
28592 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28593 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28594 0 : TALLOC_FREE(push);
28595 0 : PyErr_SetNdrError(err);
28596 0 : return NULL;
28597 : }
28598 0 : blob = ndr_push_blob(push);
28599 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28600 0 : TALLOC_FREE(push);
28601 0 : return ret;
28602 : }
28603 :
28604 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28605 : {
28606 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28607 0 : PyObject *bigendian_obj = NULL;
28608 0 : PyObject *ndr64_obj = NULL;
28609 0 : uint32_t ndr_push_flags = 0;
28610 :
28611 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28612 : discard_const_p(char *, kwnames),
28613 : &bigendian_obj,
28614 : &ndr64_obj)) {
28615 0 : return NULL;
28616 : }
28617 :
28618 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28619 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28620 : }
28621 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28622 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28623 : }
28624 :
28625 0 : return py_svcctl_QueryServiceStatusEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28626 : }
28627 :
28628 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28629 : {
28630 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28631 0 : PyObject *bigendian_obj = NULL;
28632 0 : PyObject *ndr64_obj = NULL;
28633 0 : uint32_t ndr_push_flags = 0;
28634 :
28635 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28636 : discard_const_p(char *, kwnames),
28637 : &bigendian_obj,
28638 : &ndr64_obj)) {
28639 0 : return NULL;
28640 : }
28641 :
28642 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28643 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28644 : }
28645 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28646 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28647 : }
28648 :
28649 0 : return py_svcctl_QueryServiceStatusEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28650 : }
28651 :
28652 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
28653 : {
28654 0 : const struct ndr_interface_call *call = NULL;
28655 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28656 0 : struct ndr_pull *pull = NULL;
28657 : enum ndr_err_code err;
28658 :
28659 0 : if (ndr_table_svcctl.num_calls < 41) {
28660 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatusEx_ndr_unpack");
28661 0 : return NULL;
28662 : }
28663 0 : call = &ndr_table_svcctl.calls[40];
28664 :
28665 0 : pull = ndr_pull_init_blob(blob, object);
28666 0 : if (pull == NULL) {
28667 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28668 0 : return NULL;
28669 : }
28670 :
28671 0 : pull->flags |= ndr_pull_flags;
28672 :
28673 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28674 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28675 0 : TALLOC_FREE(pull);
28676 0 : PyErr_SetNdrError(err);
28677 0 : return NULL;
28678 : }
28679 0 : if (!allow_remaining) {
28680 : uint32_t highest_ofs;
28681 :
28682 0 : if (pull->offset > pull->relative_highest_offset) {
28683 0 : highest_ofs = pull->offset;
28684 : } else {
28685 0 : highest_ofs = pull->relative_highest_offset;
28686 : }
28687 0 : if (highest_ofs < pull->data_size) {
28688 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28689 : "not all bytes consumed ofs[%u] size[%u]",
28690 : highest_ofs, pull->data_size);
28691 0 : TALLOC_FREE(pull);
28692 0 : PyErr_SetNdrError(err);
28693 0 : return NULL;
28694 : }
28695 : }
28696 :
28697 0 : TALLOC_FREE(pull);
28698 0 : Py_RETURN_NONE;
28699 : }
28700 :
28701 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28702 : {
28703 : DATA_BLOB blob;
28704 0 : Py_ssize_t blob_length = 0;
28705 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28706 0 : PyObject *bigendian_obj = NULL;
28707 0 : PyObject *ndr64_obj = NULL;
28708 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28709 0 : PyObject *allow_remaining_obj = NULL;
28710 0 : bool allow_remaining = false;
28711 :
28712 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28713 : discard_const_p(char *, kwnames),
28714 : &blob.data, &blob_length,
28715 : &bigendian_obj,
28716 : &ndr64_obj,
28717 : &allow_remaining_obj)) {
28718 0 : return NULL;
28719 : }
28720 0 : blob.length = blob_length;
28721 :
28722 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28723 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28724 : }
28725 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28726 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28727 : }
28728 :
28729 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28730 0 : allow_remaining = true;
28731 : }
28732 :
28733 0 : return py_svcctl_QueryServiceStatusEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28734 : }
28735 :
28736 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28737 : {
28738 : DATA_BLOB blob;
28739 0 : Py_ssize_t blob_length = 0;
28740 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28741 0 : PyObject *bigendian_obj = NULL;
28742 0 : PyObject *ndr64_obj = NULL;
28743 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28744 0 : PyObject *allow_remaining_obj = NULL;
28745 0 : bool allow_remaining = false;
28746 :
28747 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28748 : discard_const_p(char *, kwnames),
28749 : &blob.data, &blob_length,
28750 : &bigendian_obj,
28751 : &ndr64_obj,
28752 : &allow_remaining_obj)) {
28753 0 : return NULL;
28754 : }
28755 0 : blob.length = blob_length;
28756 :
28757 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28758 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28759 : }
28760 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28761 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28762 : }
28763 :
28764 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28765 0 : allow_remaining = true;
28766 : }
28767 :
28768 0 : return py_svcctl_QueryServiceStatusEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28769 : }
28770 :
28771 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
28772 : {
28773 0 : const struct ndr_interface_call *call = NULL;
28774 0 : struct svcctl_QueryServiceStatusEx *object = (struct svcctl_QueryServiceStatusEx *)pytalloc_get_ptr(py_obj);
28775 : PyObject *ret;
28776 : char *retstr;
28777 :
28778 0 : if (ndr_table_svcctl.num_calls < 41) {
28779 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_svcctl_QueryServiceStatusEx_ndr_print");
28780 0 : return NULL;
28781 : }
28782 0 : call = &ndr_table_svcctl.calls[40];
28783 :
28784 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28785 0 : ret = PyUnicode_FromString(retstr);
28786 0 : TALLOC_FREE(retstr);
28787 :
28788 0 : return ret;
28789 : }
28790 :
28791 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28792 : {
28793 0 : return py_svcctl_QueryServiceStatusEx_ndr_print(py_obj, "svcctl_QueryServiceStatusEx_in", NDR_IN);
28794 : }
28795 :
28796 0 : static PyObject *py_svcctl_QueryServiceStatusEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28797 : {
28798 0 : return py_svcctl_QueryServiceStatusEx_ndr_print(py_obj, "svcctl_QueryServiceStatusEx_out", NDR_OUT);
28799 : }
28800 :
28801 : static PyMethodDef py_svcctl_QueryServiceStatusEx_methods[] = {
28802 : { "opnum", (PyCFunction)py_svcctl_QueryServiceStatusEx_ndr_opnum, METH_NOARGS|METH_CLASS,
28803 : "svcctl.QueryServiceStatusEx.opnum() -> 40 (0x28) " },
28804 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28805 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28806 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28807 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28808 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28809 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28810 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_svcctl_QueryServiceStatusEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28811 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28812 : { "__ndr_print_in__", (PyCFunction)py_svcctl_QueryServiceStatusEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28813 : { "__ndr_print_out__", (PyCFunction)py_svcctl_QueryServiceStatusEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28814 : { NULL, NULL, 0, NULL }
28815 : };
28816 :
28817 :
28818 : static PyTypeObject svcctl_QueryServiceStatusEx_Type = {
28819 : PyVarObject_HEAD_INIT(NULL, 0)
28820 : .tp_name = "svcctl.QueryServiceStatusEx",
28821 : .tp_getset = py_svcctl_QueryServiceStatusEx_getsetters,
28822 : .tp_methods = py_svcctl_QueryServiceStatusEx_methods,
28823 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28824 : .tp_new = py_svcctl_QueryServiceStatusEx_new,
28825 : };
28826 :
28827 0 : static bool pack_py_svcctl_QueryServiceStatusEx_args_in(PyObject *args, PyObject *kwargs, struct svcctl_QueryServiceStatusEx *r)
28828 : {
28829 : PyObject *py_handle;
28830 : PyObject *py_info_level;
28831 : PyObject *py_offered;
28832 0 : const char *kwnames[] = {
28833 : "handle", "info_level", "offered", NULL
28834 : };
28835 :
28836 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:svcctl_QueryServiceStatusEx", discard_const_p(char *, kwnames), &py_handle, &py_info_level, &py_offered)) {
28837 0 : return false;
28838 : }
28839 :
28840 0 : if (py_handle == NULL) {
28841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
28842 0 : return false;
28843 : }
28844 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
28845 0 : if (r->in.handle == NULL) {
28846 0 : PyErr_NoMemory();
28847 0 : return false;
28848 : }
28849 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
28850 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
28851 0 : PyErr_NoMemory();
28852 0 : return false;
28853 : }
28854 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
28855 0 : if (py_info_level == NULL) {
28856 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
28857 0 : return false;
28858 : }
28859 : {
28860 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
28861 0 : if (PyLong_Check(py_info_level)) {
28862 : unsigned long long test_var;
28863 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
28864 0 : if (PyErr_Occurred() != NULL) {
28865 0 : return false;
28866 : }
28867 0 : if (test_var > uint_max) {
28868 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28869 : PyLong_Type.tp_name, uint_max, test_var);
28870 0 : return false;
28871 : }
28872 0 : r->in.info_level = test_var;
28873 : } else {
28874 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28875 : PyLong_Type.tp_name);
28876 0 : return false;
28877 : }
28878 : }
28879 0 : if (py_offered == NULL) {
28880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
28881 0 : return false;
28882 : }
28883 : {
28884 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
28885 0 : if (PyLong_Check(py_offered)) {
28886 : unsigned long long test_var;
28887 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
28888 0 : if (PyErr_Occurred() != NULL) {
28889 0 : return false;
28890 : }
28891 0 : if (test_var > uint_max) {
28892 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28893 : PyLong_Type.tp_name, uint_max, test_var);
28894 0 : return false;
28895 : }
28896 0 : r->in.offered = test_var;
28897 : } else {
28898 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28899 : PyLong_Type.tp_name);
28900 0 : return false;
28901 : }
28902 : }
28903 0 : return true;
28904 : }
28905 :
28906 0 : static PyObject *unpack_py_svcctl_QueryServiceStatusEx_args_out(struct svcctl_QueryServiceStatusEx *r)
28907 : {
28908 : PyObject *result;
28909 : PyObject *py_buffer;
28910 : PyObject *py_needed;
28911 0 : result = PyTuple_New(2);
28912 0 : py_buffer = PyList_New(r->in.offered);
28913 0 : if (py_buffer == NULL) {
28914 0 : return NULL;
28915 : }
28916 : {
28917 : int buffer_cntr_1;
28918 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
28919 : PyObject *py_buffer_1;
28920 0 : py_buffer_1 = PyLong_FromLong((uint16_t)r->out.buffer[buffer_cntr_1]);
28921 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
28922 : }
28923 : }
28924 0 : PyTuple_SetItem(result, 0, py_buffer);
28925 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
28926 0 : PyTuple_SetItem(result, 1, py_needed);
28927 0 : if (!W_ERROR_IS_OK(r->out.result)) {
28928 0 : PyErr_SetWERROR(r->out.result);
28929 0 : return NULL;
28930 : }
28931 :
28932 0 : return result;
28933 : }
28934 :
28935 :
28936 0 : static PyObject *py_EnumServicesStatusExA_in_get_scmanager(PyObject *obj, void *closure)
28937 : {
28938 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
28939 : PyObject *py_scmanager;
28940 0 : if (object->in.scmanager == NULL) {
28941 0 : Py_RETURN_NONE;
28942 : }
28943 0 : py_scmanager = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager, object->in.scmanager);
28944 0 : return py_scmanager;
28945 : }
28946 :
28947 0 : static int py_EnumServicesStatusExA_in_set_scmanager(PyObject *py_obj, PyObject *value, void *closure)
28948 : {
28949 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
28950 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager));
28951 0 : if (value == NULL) {
28952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager");
28953 0 : return -1;
28954 : }
28955 0 : object->in.scmanager = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager);
28956 0 : if (object->in.scmanager == NULL) {
28957 0 : PyErr_NoMemory();
28958 0 : return -1;
28959 : }
28960 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28961 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28962 0 : PyErr_NoMemory();
28963 0 : return -1;
28964 : }
28965 0 : object->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(value);
28966 0 : return 0;
28967 : }
28968 :
28969 0 : static PyObject *py_EnumServicesStatusExA_in_get_info_level(PyObject *obj, void *closure)
28970 : {
28971 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
28972 : PyObject *py_info_level;
28973 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
28974 0 : return py_info_level;
28975 : }
28976 :
28977 0 : static int py_EnumServicesStatusExA_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
28978 : {
28979 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
28980 0 : if (value == NULL) {
28981 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
28982 0 : return -1;
28983 : }
28984 : {
28985 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
28986 0 : if (PyLong_Check(value)) {
28987 : unsigned long long test_var;
28988 0 : test_var = PyLong_AsUnsignedLongLong(value);
28989 0 : if (PyErr_Occurred() != NULL) {
28990 0 : return -1;
28991 : }
28992 0 : if (test_var > uint_max) {
28993 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28994 : PyLong_Type.tp_name, uint_max, test_var);
28995 0 : return -1;
28996 : }
28997 0 : object->in.info_level = test_var;
28998 : } else {
28999 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29000 : PyLong_Type.tp_name);
29001 0 : return -1;
29002 : }
29003 : }
29004 0 : return 0;
29005 : }
29006 :
29007 0 : static PyObject *py_EnumServicesStatusExA_in_get_type(PyObject *obj, void *closure)
29008 : {
29009 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29010 : PyObject *py_type;
29011 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
29012 0 : return py_type;
29013 : }
29014 :
29015 0 : static int py_EnumServicesStatusExA_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
29016 : {
29017 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29018 0 : if (value == NULL) {
29019 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
29020 0 : return -1;
29021 : }
29022 : {
29023 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
29024 0 : if (PyLong_Check(value)) {
29025 : unsigned long long test_var;
29026 0 : test_var = PyLong_AsUnsignedLongLong(value);
29027 0 : if (PyErr_Occurred() != NULL) {
29028 0 : return -1;
29029 : }
29030 0 : if (test_var > uint_max) {
29031 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29032 : PyLong_Type.tp_name, uint_max, test_var);
29033 0 : return -1;
29034 : }
29035 0 : object->in.type = test_var;
29036 : } else {
29037 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29038 : PyLong_Type.tp_name);
29039 0 : return -1;
29040 : }
29041 : }
29042 0 : return 0;
29043 : }
29044 :
29045 0 : static PyObject *py_EnumServicesStatusExA_in_get_state(PyObject *obj, void *closure)
29046 : {
29047 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29048 : PyObject *py_state;
29049 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
29050 0 : return py_state;
29051 : }
29052 :
29053 0 : static int py_EnumServicesStatusExA_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
29054 : {
29055 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29056 0 : if (value == NULL) {
29057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
29058 0 : return -1;
29059 : }
29060 : {
29061 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
29062 0 : if (PyLong_Check(value)) {
29063 : unsigned long long test_var;
29064 0 : test_var = PyLong_AsUnsignedLongLong(value);
29065 0 : if (PyErr_Occurred() != NULL) {
29066 0 : return -1;
29067 : }
29068 0 : if (test_var > uint_max) {
29069 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29070 : PyLong_Type.tp_name, uint_max, test_var);
29071 0 : return -1;
29072 : }
29073 0 : object->in.state = test_var;
29074 : } else {
29075 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29076 : PyLong_Type.tp_name);
29077 0 : return -1;
29078 : }
29079 : }
29080 0 : return 0;
29081 : }
29082 :
29083 0 : static PyObject *py_EnumServicesStatusExA_out_get_services(PyObject *obj, void *closure)
29084 : {
29085 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29086 : PyObject *py_services;
29087 0 : py_services = PyList_New(object->in.offered);
29088 0 : if (py_services == NULL) {
29089 0 : return NULL;
29090 : }
29091 : {
29092 : int services_cntr_0;
29093 0 : for (services_cntr_0 = 0; services_cntr_0 < (object->in.offered); services_cntr_0++) {
29094 : PyObject *py_services_0;
29095 0 : py_services_0 = PyLong_FromLong((uint16_t)object->out.services[services_cntr_0]);
29096 0 : PyList_SetItem(py_services, services_cntr_0, py_services_0);
29097 : }
29098 : }
29099 0 : return py_services;
29100 : }
29101 :
29102 0 : static int py_EnumServicesStatusExA_out_set_services(PyObject *py_obj, PyObject *value, void *closure)
29103 : {
29104 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29105 0 : if (value == NULL) {
29106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services");
29107 0 : return -1;
29108 : }
29109 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
29110 : {
29111 : int services_cntr_0;
29112 0 : object->out.services = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services, PyList_GET_SIZE(value));
29113 0 : if (!object->out.services) { return -1;; }
29114 0 : talloc_set_name_const(object->out.services, "ARRAY: object->out.services");
29115 0 : for (services_cntr_0 = 0; services_cntr_0 < PyList_GET_SIZE(value); services_cntr_0++) {
29116 0 : if (PyList_GET_ITEM(value, services_cntr_0) == NULL) {
29117 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services[services_cntr_0]");
29118 0 : return -1;
29119 : }
29120 : {
29121 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.services[services_cntr_0]));
29122 0 : if (PyLong_Check(PyList_GET_ITEM(value, services_cntr_0))) {
29123 : unsigned long long test_var;
29124 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, services_cntr_0));
29125 0 : if (PyErr_Occurred() != NULL) {
29126 0 : return -1;
29127 : }
29128 0 : if (test_var > uint_max) {
29129 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29130 : PyLong_Type.tp_name, uint_max, test_var);
29131 0 : return -1;
29132 : }
29133 0 : object->out.services[services_cntr_0] = test_var;
29134 : } else {
29135 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29136 : PyLong_Type.tp_name);
29137 0 : return -1;
29138 : }
29139 : }
29140 : }
29141 : }
29142 0 : return 0;
29143 : }
29144 :
29145 0 : static PyObject *py_EnumServicesStatusExA_in_get_offered(PyObject *obj, void *closure)
29146 : {
29147 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29148 : PyObject *py_offered;
29149 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
29150 0 : return py_offered;
29151 : }
29152 :
29153 0 : static int py_EnumServicesStatusExA_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
29154 : {
29155 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29156 0 : if (value == NULL) {
29157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
29158 0 : return -1;
29159 : }
29160 : {
29161 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
29162 0 : if (PyLong_Check(value)) {
29163 : unsigned long long test_var;
29164 0 : test_var = PyLong_AsUnsignedLongLong(value);
29165 0 : if (PyErr_Occurred() != NULL) {
29166 0 : return -1;
29167 : }
29168 0 : if (test_var > uint_max) {
29169 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29170 : PyLong_Type.tp_name, uint_max, test_var);
29171 0 : return -1;
29172 : }
29173 0 : object->in.offered = test_var;
29174 : } else {
29175 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29176 : PyLong_Type.tp_name);
29177 0 : return -1;
29178 : }
29179 : }
29180 0 : return 0;
29181 : }
29182 :
29183 0 : static PyObject *py_EnumServicesStatusExA_out_get_needed(PyObject *obj, void *closure)
29184 : {
29185 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29186 : PyObject *py_needed;
29187 0 : if (object->out.needed == NULL) {
29188 0 : Py_RETURN_NONE;
29189 : }
29190 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
29191 0 : return py_needed;
29192 : }
29193 :
29194 0 : static int py_EnumServicesStatusExA_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
29195 : {
29196 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29197 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
29198 0 : if (value == NULL) {
29199 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
29200 0 : return -1;
29201 : }
29202 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
29203 0 : if (object->out.needed == NULL) {
29204 0 : PyErr_NoMemory();
29205 0 : return -1;
29206 : }
29207 : {
29208 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
29209 0 : if (PyLong_Check(value)) {
29210 : unsigned long long test_var;
29211 0 : test_var = PyLong_AsUnsignedLongLong(value);
29212 0 : if (PyErr_Occurred() != NULL) {
29213 0 : return -1;
29214 : }
29215 0 : if (test_var > uint_max) {
29216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29217 : PyLong_Type.tp_name, uint_max, test_var);
29218 0 : return -1;
29219 : }
29220 0 : *object->out.needed = test_var;
29221 : } else {
29222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29223 : PyLong_Type.tp_name);
29224 0 : return -1;
29225 : }
29226 : }
29227 0 : return 0;
29228 : }
29229 :
29230 0 : static PyObject *py_EnumServicesStatusExA_out_get_service_returned(PyObject *obj, void *closure)
29231 : {
29232 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29233 : PyObject *py_service_returned;
29234 0 : if (object->out.service_returned == NULL) {
29235 0 : Py_RETURN_NONE;
29236 : }
29237 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.service_returned);
29238 0 : return py_service_returned;
29239 : }
29240 :
29241 0 : static int py_EnumServicesStatusExA_out_set_service_returned(PyObject *py_obj, PyObject *value, void *closure)
29242 : {
29243 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29244 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_returned));
29245 0 : if (value == NULL) {
29246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_returned");
29247 0 : return -1;
29248 : }
29249 0 : object->out.service_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_returned);
29250 0 : if (object->out.service_returned == NULL) {
29251 0 : PyErr_NoMemory();
29252 0 : return -1;
29253 : }
29254 : {
29255 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.service_returned));
29256 0 : if (PyLong_Check(value)) {
29257 : unsigned long long test_var;
29258 0 : test_var = PyLong_AsUnsignedLongLong(value);
29259 0 : if (PyErr_Occurred() != NULL) {
29260 0 : return -1;
29261 : }
29262 0 : if (test_var > uint_max) {
29263 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29264 : PyLong_Type.tp_name, uint_max, test_var);
29265 0 : return -1;
29266 : }
29267 0 : *object->out.service_returned = test_var;
29268 : } else {
29269 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29270 : PyLong_Type.tp_name);
29271 0 : return -1;
29272 : }
29273 : }
29274 0 : return 0;
29275 : }
29276 :
29277 0 : static PyObject *py_EnumServicesStatusExA_in_get_resume_handle(PyObject *obj, void *closure)
29278 : {
29279 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29280 : PyObject *py_resume_handle;
29281 0 : if (object->in.resume_handle == NULL) {
29282 0 : Py_RETURN_NONE;
29283 : }
29284 0 : if (object->in.resume_handle == NULL) {
29285 0 : py_resume_handle = Py_None;
29286 0 : Py_INCREF(py_resume_handle);
29287 : } else {
29288 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
29289 : }
29290 0 : return py_resume_handle;
29291 : }
29292 :
29293 0 : static int py_EnumServicesStatusExA_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
29294 : {
29295 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29296 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
29297 0 : if (value == NULL) {
29298 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
29299 0 : return -1;
29300 : }
29301 0 : if (value == Py_None) {
29302 0 : object->in.resume_handle = NULL;
29303 : } else {
29304 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
29305 0 : if (object->in.resume_handle == NULL) {
29306 0 : PyErr_NoMemory();
29307 0 : return -1;
29308 : }
29309 : {
29310 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
29311 0 : if (PyLong_Check(value)) {
29312 : unsigned long long test_var;
29313 0 : test_var = PyLong_AsUnsignedLongLong(value);
29314 0 : if (PyErr_Occurred() != NULL) {
29315 0 : return -1;
29316 : }
29317 0 : if (test_var > uint_max) {
29318 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29319 : PyLong_Type.tp_name, uint_max, test_var);
29320 0 : return -1;
29321 : }
29322 0 : *object->in.resume_handle = test_var;
29323 : } else {
29324 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29325 : PyLong_Type.tp_name);
29326 0 : return -1;
29327 : }
29328 : }
29329 : }
29330 0 : return 0;
29331 : }
29332 :
29333 0 : static PyObject *py_EnumServicesStatusExA_out_get_resume_handle(PyObject *obj, void *closure)
29334 : {
29335 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29336 : PyObject *py_resume_handle;
29337 0 : if (object->out.resume_handle == NULL) {
29338 0 : Py_RETURN_NONE;
29339 : }
29340 0 : if (object->out.resume_handle == NULL) {
29341 0 : py_resume_handle = Py_None;
29342 0 : Py_INCREF(py_resume_handle);
29343 : } else {
29344 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
29345 : }
29346 0 : return py_resume_handle;
29347 : }
29348 :
29349 0 : static int py_EnumServicesStatusExA_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
29350 : {
29351 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29352 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
29353 0 : if (value == NULL) {
29354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
29355 0 : return -1;
29356 : }
29357 0 : if (value == Py_None) {
29358 0 : object->out.resume_handle = NULL;
29359 : } else {
29360 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
29361 0 : if (object->out.resume_handle == NULL) {
29362 0 : PyErr_NoMemory();
29363 0 : return -1;
29364 : }
29365 : {
29366 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
29367 0 : if (PyLong_Check(value)) {
29368 : unsigned long long test_var;
29369 0 : test_var = PyLong_AsUnsignedLongLong(value);
29370 0 : if (PyErr_Occurred() != NULL) {
29371 0 : return -1;
29372 : }
29373 0 : if (test_var > uint_max) {
29374 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29375 : PyLong_Type.tp_name, uint_max, test_var);
29376 0 : return -1;
29377 : }
29378 0 : *object->out.resume_handle = test_var;
29379 : } else {
29380 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29381 : PyLong_Type.tp_name);
29382 0 : return -1;
29383 : }
29384 : }
29385 : }
29386 0 : return 0;
29387 : }
29388 :
29389 0 : static PyObject *py_EnumServicesStatusExA_out_get_group_name(PyObject *obj, void *closure)
29390 : {
29391 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29392 : PyObject *py_group_name;
29393 0 : if (object->out.group_name == NULL) {
29394 0 : Py_RETURN_NONE;
29395 : }
29396 0 : if (*object->out.group_name == NULL) {
29397 0 : py_group_name = Py_None;
29398 0 : Py_INCREF(py_group_name);
29399 : } else {
29400 0 : if (*object->out.group_name == NULL) {
29401 0 : py_group_name = Py_None;
29402 0 : Py_INCREF(py_group_name);
29403 : } else {
29404 0 : py_group_name = PyUnicode_Decode(*object->out.group_name, strlen(*object->out.group_name), "utf-8", "ignore");
29405 : }
29406 : }
29407 0 : return py_group_name;
29408 : }
29409 :
29410 0 : static int py_EnumServicesStatusExA_out_set_group_name(PyObject *py_obj, PyObject *value, void *closure)
29411 : {
29412 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29413 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_name));
29414 0 : if (value == NULL) {
29415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_name");
29416 0 : return -1;
29417 : }
29418 0 : object->out.group_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_name);
29419 0 : if (object->out.group_name == NULL) {
29420 0 : PyErr_NoMemory();
29421 0 : return -1;
29422 : }
29423 0 : if (value == Py_None) {
29424 0 : *object->out.group_name = NULL;
29425 : } else {
29426 0 : *object->out.group_name = NULL;
29427 : {
29428 : const char *test_str;
29429 : const char *talloc_str;
29430 0 : PyObject *unicode = NULL;
29431 0 : if (PyUnicode_Check(value)) {
29432 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
29433 0 : if (unicode == NULL) {
29434 0 : PyErr_NoMemory();
29435 0 : return -1;
29436 : }
29437 0 : test_str = PyBytes_AS_STRING(unicode);
29438 0 : } else if (PyBytes_Check(value)) {
29439 0 : test_str = PyBytes_AS_STRING(value);
29440 : } else {
29441 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
29442 0 : return -1;
29443 : }
29444 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
29445 0 : if (unicode != NULL) {
29446 0 : Py_DECREF(unicode);
29447 : }
29448 0 : if (talloc_str == NULL) {
29449 0 : PyErr_NoMemory();
29450 0 : return -1;
29451 : }
29452 0 : *object->out.group_name = talloc_str;
29453 : }
29454 : }
29455 0 : return 0;
29456 : }
29457 :
29458 0 : static PyObject *py_EnumServicesStatusExA_get_result(PyObject *obj, void *closure)
29459 : {
29460 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(obj);
29461 : PyObject *py_result;
29462 0 : py_result = PyErr_FromWERROR(object->out.result);
29463 0 : return py_result;
29464 : }
29465 :
29466 0 : static int py_EnumServicesStatusExA_set_result(PyObject *py_obj, PyObject *value, void *closure)
29467 : {
29468 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29469 0 : if (value == NULL) {
29470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29471 0 : return -1;
29472 : }
29473 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
29474 0 : return 0;
29475 : }
29476 :
29477 : static PyGetSetDef py_EnumServicesStatusExA_getsetters[] = {
29478 : {
29479 : .name = discard_const_p(char, "in_scmanager"),
29480 : .get = py_EnumServicesStatusExA_in_get_scmanager,
29481 : .set = py_EnumServicesStatusExA_in_set_scmanager,
29482 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29483 : },
29484 : {
29485 : .name = discard_const_p(char, "in_info_level"),
29486 : .get = py_EnumServicesStatusExA_in_get_info_level,
29487 : .set = py_EnumServicesStatusExA_in_set_info_level,
29488 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29489 : },
29490 : {
29491 : .name = discard_const_p(char, "in_type"),
29492 : .get = py_EnumServicesStatusExA_in_get_type,
29493 : .set = py_EnumServicesStatusExA_in_set_type,
29494 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29495 : },
29496 : {
29497 : .name = discard_const_p(char, "in_state"),
29498 : .get = py_EnumServicesStatusExA_in_get_state,
29499 : .set = py_EnumServicesStatusExA_in_set_state,
29500 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
29501 : },
29502 : {
29503 : .name = discard_const_p(char, "out_services"),
29504 : .get = py_EnumServicesStatusExA_out_get_services,
29505 : .set = py_EnumServicesStatusExA_out_set_services,
29506 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
29507 : },
29508 : {
29509 : .name = discard_const_p(char, "in_offered"),
29510 : .get = py_EnumServicesStatusExA_in_get_offered,
29511 : .set = py_EnumServicesStatusExA_in_set_offered,
29512 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29513 : },
29514 : {
29515 : .name = discard_const_p(char, "out_needed"),
29516 : .get = py_EnumServicesStatusExA_out_get_needed,
29517 : .set = py_EnumServicesStatusExA_out_set_needed,
29518 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29519 : },
29520 : {
29521 : .name = discard_const_p(char, "out_service_returned"),
29522 : .get = py_EnumServicesStatusExA_out_get_service_returned,
29523 : .set = py_EnumServicesStatusExA_out_set_service_returned,
29524 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29525 : },
29526 : {
29527 : .name = discard_const_p(char, "in_resume_handle"),
29528 : .get = py_EnumServicesStatusExA_in_get_resume_handle,
29529 : .set = py_EnumServicesStatusExA_in_set_resume_handle,
29530 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29531 : },
29532 : {
29533 : .name = discard_const_p(char, "out_resume_handle"),
29534 : .get = py_EnumServicesStatusExA_out_get_resume_handle,
29535 : .set = py_EnumServicesStatusExA_out_set_resume_handle,
29536 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
29537 : },
29538 : {
29539 : .name = discard_const_p(char, "out_group_name"),
29540 : .get = py_EnumServicesStatusExA_out_get_group_name,
29541 : .set = py_EnumServicesStatusExA_out_set_group_name,
29542 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29543 : },
29544 : {
29545 : .name = discard_const_p(char, "result"),
29546 : .get = py_EnumServicesStatusExA_get_result,
29547 : .set = py_EnumServicesStatusExA_set_result,
29548 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
29549 : },
29550 : { .name = NULL }
29551 : };
29552 :
29553 0 : static PyObject *py_EnumServicesStatusExA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29554 : {
29555 0 : PyObject *self = pytalloc_new(struct EnumServicesStatusExA, type);
29556 0 : struct EnumServicesStatusExA *_self = (struct EnumServicesStatusExA *)pytalloc_get_ptr(self);
29557 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29558 0 : _self->in.scmanager = talloc_zero(mem_ctx, struct policy_handle);
29559 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
29560 0 : _self->out.service_returned = talloc_zero(mem_ctx, uint32_t);
29561 0 : return self;
29562 : }
29563 :
29564 0 : static PyObject *py_EnumServicesStatusExA_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29565 : {
29566 :
29567 :
29568 0 : return PyLong_FromLong(41);
29569 : }
29570 :
29571 0 : static PyObject *py_EnumServicesStatusExA_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
29572 : {
29573 0 : const struct ndr_interface_call *call = NULL;
29574 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29575 0 : PyObject *ret = NULL;
29576 0 : struct ndr_push *push = NULL;
29577 : DATA_BLOB blob;
29578 : enum ndr_err_code err;
29579 :
29580 0 : if (ndr_table_svcctl.num_calls < 42) {
29581 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_EnumServicesStatusExA_ndr_pack");
29582 0 : return NULL;
29583 : }
29584 0 : call = &ndr_table_svcctl.calls[41];
29585 :
29586 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29587 0 : if (push == NULL) {
29588 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29589 0 : return NULL;
29590 : }
29591 :
29592 0 : push->flags |= ndr_push_flags;
29593 :
29594 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29595 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29596 0 : TALLOC_FREE(push);
29597 0 : PyErr_SetNdrError(err);
29598 0 : return NULL;
29599 : }
29600 0 : blob = ndr_push_blob(push);
29601 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29602 0 : TALLOC_FREE(push);
29603 0 : return ret;
29604 : }
29605 :
29606 0 : static PyObject *py_EnumServicesStatusExA_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29607 : {
29608 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29609 0 : PyObject *bigendian_obj = NULL;
29610 0 : PyObject *ndr64_obj = NULL;
29611 0 : uint32_t ndr_push_flags = 0;
29612 :
29613 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29614 : discard_const_p(char *, kwnames),
29615 : &bigendian_obj,
29616 : &ndr64_obj)) {
29617 0 : return NULL;
29618 : }
29619 :
29620 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29621 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29622 : }
29623 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29624 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29625 : }
29626 :
29627 0 : return py_EnumServicesStatusExA_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29628 : }
29629 :
29630 0 : static PyObject *py_EnumServicesStatusExA_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29631 : {
29632 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29633 0 : PyObject *bigendian_obj = NULL;
29634 0 : PyObject *ndr64_obj = NULL;
29635 0 : uint32_t ndr_push_flags = 0;
29636 :
29637 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29638 : discard_const_p(char *, kwnames),
29639 : &bigendian_obj,
29640 : &ndr64_obj)) {
29641 0 : return NULL;
29642 : }
29643 :
29644 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29645 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29646 : }
29647 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29648 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29649 : }
29650 :
29651 0 : return py_EnumServicesStatusExA_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29652 : }
29653 :
29654 0 : static PyObject *py_EnumServicesStatusExA_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
29655 : {
29656 0 : const struct ndr_interface_call *call = NULL;
29657 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29658 0 : struct ndr_pull *pull = NULL;
29659 : enum ndr_err_code err;
29660 :
29661 0 : if (ndr_table_svcctl.num_calls < 42) {
29662 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_EnumServicesStatusExA_ndr_unpack");
29663 0 : return NULL;
29664 : }
29665 0 : call = &ndr_table_svcctl.calls[41];
29666 :
29667 0 : pull = ndr_pull_init_blob(blob, object);
29668 0 : if (pull == NULL) {
29669 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29670 0 : return NULL;
29671 : }
29672 :
29673 0 : pull->flags |= ndr_pull_flags;
29674 :
29675 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29676 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29677 0 : TALLOC_FREE(pull);
29678 0 : PyErr_SetNdrError(err);
29679 0 : return NULL;
29680 : }
29681 0 : if (!allow_remaining) {
29682 : uint32_t highest_ofs;
29683 :
29684 0 : if (pull->offset > pull->relative_highest_offset) {
29685 0 : highest_ofs = pull->offset;
29686 : } else {
29687 0 : highest_ofs = pull->relative_highest_offset;
29688 : }
29689 0 : if (highest_ofs < pull->data_size) {
29690 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29691 : "not all bytes consumed ofs[%u] size[%u]",
29692 : highest_ofs, pull->data_size);
29693 0 : TALLOC_FREE(pull);
29694 0 : PyErr_SetNdrError(err);
29695 0 : return NULL;
29696 : }
29697 : }
29698 :
29699 0 : TALLOC_FREE(pull);
29700 0 : Py_RETURN_NONE;
29701 : }
29702 :
29703 0 : static PyObject *py_EnumServicesStatusExA_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29704 : {
29705 : DATA_BLOB blob;
29706 0 : Py_ssize_t blob_length = 0;
29707 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29708 0 : PyObject *bigendian_obj = NULL;
29709 0 : PyObject *ndr64_obj = NULL;
29710 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29711 0 : PyObject *allow_remaining_obj = NULL;
29712 0 : bool allow_remaining = false;
29713 :
29714 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29715 : discard_const_p(char *, kwnames),
29716 : &blob.data, &blob_length,
29717 : &bigendian_obj,
29718 : &ndr64_obj,
29719 : &allow_remaining_obj)) {
29720 0 : return NULL;
29721 : }
29722 0 : blob.length = blob_length;
29723 :
29724 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29725 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29726 : }
29727 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29728 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29729 : }
29730 :
29731 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29732 0 : allow_remaining = true;
29733 : }
29734 :
29735 0 : return py_EnumServicesStatusExA_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29736 : }
29737 :
29738 0 : static PyObject *py_EnumServicesStatusExA_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29739 : {
29740 : DATA_BLOB blob;
29741 0 : Py_ssize_t blob_length = 0;
29742 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29743 0 : PyObject *bigendian_obj = NULL;
29744 0 : PyObject *ndr64_obj = NULL;
29745 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29746 0 : PyObject *allow_remaining_obj = NULL;
29747 0 : bool allow_remaining = false;
29748 :
29749 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29750 : discard_const_p(char *, kwnames),
29751 : &blob.data, &blob_length,
29752 : &bigendian_obj,
29753 : &ndr64_obj,
29754 : &allow_remaining_obj)) {
29755 0 : return NULL;
29756 : }
29757 0 : blob.length = blob_length;
29758 :
29759 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29760 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29761 : }
29762 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29763 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29764 : }
29765 :
29766 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29767 0 : allow_remaining = true;
29768 : }
29769 :
29770 0 : return py_EnumServicesStatusExA_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29771 : }
29772 :
29773 0 : static PyObject *py_EnumServicesStatusExA_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
29774 : {
29775 0 : const struct ndr_interface_call *call = NULL;
29776 0 : struct EnumServicesStatusExA *object = (struct EnumServicesStatusExA *)pytalloc_get_ptr(py_obj);
29777 : PyObject *ret;
29778 : char *retstr;
29779 :
29780 0 : if (ndr_table_svcctl.num_calls < 42) {
29781 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_EnumServicesStatusExA_ndr_print");
29782 0 : return NULL;
29783 : }
29784 0 : call = &ndr_table_svcctl.calls[41];
29785 :
29786 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29787 0 : ret = PyUnicode_FromString(retstr);
29788 0 : TALLOC_FREE(retstr);
29789 :
29790 0 : return ret;
29791 : }
29792 :
29793 0 : static PyObject *py_EnumServicesStatusExA_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29794 : {
29795 0 : return py_EnumServicesStatusExA_ndr_print(py_obj, "EnumServicesStatusExA_in", NDR_IN);
29796 : }
29797 :
29798 0 : static PyObject *py_EnumServicesStatusExA_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29799 : {
29800 0 : return py_EnumServicesStatusExA_ndr_print(py_obj, "EnumServicesStatusExA_out", NDR_OUT);
29801 : }
29802 :
29803 : static PyMethodDef py_EnumServicesStatusExA_methods[] = {
29804 : { "opnum", (PyCFunction)py_EnumServicesStatusExA_ndr_opnum, METH_NOARGS|METH_CLASS,
29805 : "svcctl.EnumServicesStatusExA.opnum() -> 41 (0x29) " },
29806 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExA_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29807 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29808 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExA_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29809 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29810 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExA_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29811 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29812 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExA_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29813 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29814 : { "__ndr_print_in__", (PyCFunction)py_EnumServicesStatusExA_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29815 : { "__ndr_print_out__", (PyCFunction)py_EnumServicesStatusExA_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29816 : { NULL, NULL, 0, NULL }
29817 : };
29818 :
29819 :
29820 : static PyTypeObject EnumServicesStatusExA_Type = {
29821 : PyVarObject_HEAD_INIT(NULL, 0)
29822 : .tp_name = "svcctl.EnumServicesStatusExA",
29823 : .tp_getset = py_EnumServicesStatusExA_getsetters,
29824 : .tp_methods = py_EnumServicesStatusExA_methods,
29825 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29826 : .tp_new = py_EnumServicesStatusExA_new,
29827 : };
29828 :
29829 0 : static bool pack_py_EnumServicesStatusExA_args_in(PyObject *args, PyObject *kwargs, struct EnumServicesStatusExA *r)
29830 : {
29831 : PyObject *py_scmanager;
29832 : PyObject *py_info_level;
29833 : PyObject *py_type;
29834 : PyObject *py_state;
29835 : PyObject *py_offered;
29836 : PyObject *py_resume_handle;
29837 0 : const char *kwnames[] = {
29838 : "scmanager", "info_level", "type", "state", "offered", "resume_handle", NULL
29839 : };
29840 :
29841 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:EnumServicesStatusExA", discard_const_p(char *, kwnames), &py_scmanager, &py_info_level, &py_type, &py_state, &py_offered, &py_resume_handle)) {
29842 0 : return false;
29843 : }
29844 :
29845 0 : if (py_scmanager == NULL) {
29846 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager");
29847 0 : return false;
29848 : }
29849 0 : r->in.scmanager = talloc_ptrtype(r, r->in.scmanager);
29850 0 : if (r->in.scmanager == NULL) {
29851 0 : PyErr_NoMemory();
29852 0 : return false;
29853 : }
29854 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager, return false;);
29855 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager)) == NULL) {
29856 0 : PyErr_NoMemory();
29857 0 : return false;
29858 : }
29859 0 : r->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(py_scmanager);
29860 0 : if (py_info_level == NULL) {
29861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
29862 0 : return false;
29863 : }
29864 : {
29865 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
29866 0 : if (PyLong_Check(py_info_level)) {
29867 : unsigned long long test_var;
29868 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
29869 0 : if (PyErr_Occurred() != NULL) {
29870 0 : return false;
29871 : }
29872 0 : if (test_var > uint_max) {
29873 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29874 : PyLong_Type.tp_name, uint_max, test_var);
29875 0 : return false;
29876 : }
29877 0 : r->in.info_level = test_var;
29878 : } else {
29879 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29880 : PyLong_Type.tp_name);
29881 0 : return false;
29882 : }
29883 : }
29884 0 : if (py_type == NULL) {
29885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
29886 0 : return false;
29887 : }
29888 : {
29889 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
29890 0 : if (PyLong_Check(py_type)) {
29891 : unsigned long long test_var;
29892 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
29893 0 : if (PyErr_Occurred() != NULL) {
29894 0 : return false;
29895 : }
29896 0 : if (test_var > uint_max) {
29897 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29898 : PyLong_Type.tp_name, uint_max, test_var);
29899 0 : return false;
29900 : }
29901 0 : r->in.type = test_var;
29902 : } else {
29903 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29904 : PyLong_Type.tp_name);
29905 0 : return false;
29906 : }
29907 : }
29908 0 : if (py_state == NULL) {
29909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
29910 0 : return false;
29911 : }
29912 : {
29913 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
29914 0 : if (PyLong_Check(py_state)) {
29915 : unsigned long long test_var;
29916 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
29917 0 : if (PyErr_Occurred() != NULL) {
29918 0 : return false;
29919 : }
29920 0 : if (test_var > uint_max) {
29921 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29922 : PyLong_Type.tp_name, uint_max, test_var);
29923 0 : return false;
29924 : }
29925 0 : r->in.state = test_var;
29926 : } else {
29927 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29928 : PyLong_Type.tp_name);
29929 0 : return false;
29930 : }
29931 : }
29932 0 : if (py_offered == NULL) {
29933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
29934 0 : return false;
29935 : }
29936 : {
29937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
29938 0 : if (PyLong_Check(py_offered)) {
29939 : unsigned long long test_var;
29940 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
29941 0 : if (PyErr_Occurred() != NULL) {
29942 0 : return false;
29943 : }
29944 0 : if (test_var > uint_max) {
29945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29946 : PyLong_Type.tp_name, uint_max, test_var);
29947 0 : return false;
29948 : }
29949 0 : r->in.offered = test_var;
29950 : } else {
29951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29952 : PyLong_Type.tp_name);
29953 0 : return false;
29954 : }
29955 : }
29956 0 : if (py_resume_handle == NULL) {
29957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
29958 0 : return false;
29959 : }
29960 0 : if (py_resume_handle == Py_None) {
29961 0 : r->in.resume_handle = NULL;
29962 : } else {
29963 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
29964 0 : if (r->in.resume_handle == NULL) {
29965 0 : PyErr_NoMemory();
29966 0 : return false;
29967 : }
29968 : {
29969 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
29970 0 : if (PyLong_Check(py_resume_handle)) {
29971 : unsigned long long test_var;
29972 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
29973 0 : if (PyErr_Occurred() != NULL) {
29974 0 : return false;
29975 : }
29976 0 : if (test_var > uint_max) {
29977 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29978 : PyLong_Type.tp_name, uint_max, test_var);
29979 0 : return false;
29980 : }
29981 0 : *r->in.resume_handle = test_var;
29982 : } else {
29983 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29984 : PyLong_Type.tp_name);
29985 0 : return false;
29986 : }
29987 : }
29988 : }
29989 0 : return true;
29990 : }
29991 :
29992 0 : static PyObject *unpack_py_EnumServicesStatusExA_args_out(struct EnumServicesStatusExA *r)
29993 : {
29994 : PyObject *result;
29995 : PyObject *py_services;
29996 : PyObject *py_needed;
29997 : PyObject *py_service_returned;
29998 : PyObject *py_resume_handle;
29999 : PyObject *py_group_name;
30000 0 : result = PyTuple_New(5);
30001 0 : py_services = PyList_New(r->in.offered);
30002 0 : if (py_services == NULL) {
30003 0 : return NULL;
30004 : }
30005 : {
30006 : int services_cntr_0;
30007 0 : for (services_cntr_0 = 0; services_cntr_0 < (r->in.offered); services_cntr_0++) {
30008 : PyObject *py_services_0;
30009 0 : py_services_0 = PyLong_FromLong((uint16_t)r->out.services[services_cntr_0]);
30010 0 : PyList_SetItem(py_services, services_cntr_0, py_services_0);
30011 : }
30012 : }
30013 0 : PyTuple_SetItem(result, 0, py_services);
30014 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
30015 0 : PyTuple_SetItem(result, 1, py_needed);
30016 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.service_returned);
30017 0 : PyTuple_SetItem(result, 2, py_service_returned);
30018 0 : if (r->out.resume_handle == NULL) {
30019 0 : py_resume_handle = Py_None;
30020 0 : Py_INCREF(py_resume_handle);
30021 : } else {
30022 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
30023 : }
30024 0 : PyTuple_SetItem(result, 3, py_resume_handle);
30025 0 : if (*r->out.group_name == NULL) {
30026 0 : py_group_name = Py_None;
30027 0 : Py_INCREF(py_group_name);
30028 : } else {
30029 0 : if (*r->out.group_name == NULL) {
30030 0 : py_group_name = Py_None;
30031 0 : Py_INCREF(py_group_name);
30032 : } else {
30033 0 : py_group_name = PyUnicode_Decode(*r->out.group_name, strlen(*r->out.group_name), "utf-8", "ignore");
30034 : }
30035 : }
30036 0 : PyTuple_SetItem(result, 4, py_group_name);
30037 0 : if (!W_ERROR_IS_OK(r->out.result)) {
30038 0 : PyErr_SetWERROR(r->out.result);
30039 0 : return NULL;
30040 : }
30041 :
30042 0 : return result;
30043 : }
30044 :
30045 :
30046 0 : static PyObject *py_EnumServicesStatusExW_in_get_scmanager(PyObject *obj, void *closure)
30047 : {
30048 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30049 : PyObject *py_scmanager;
30050 0 : if (object->in.scmanager == NULL) {
30051 0 : Py_RETURN_NONE;
30052 : }
30053 0 : py_scmanager = pytalloc_reference_ex(policy_handle_Type, object->in.scmanager, object->in.scmanager);
30054 0 : return py_scmanager;
30055 : }
30056 :
30057 0 : static int py_EnumServicesStatusExW_in_set_scmanager(PyObject *py_obj, PyObject *value, void *closure)
30058 : {
30059 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30060 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.scmanager));
30061 0 : if (value == NULL) {
30062 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.scmanager");
30063 0 : return -1;
30064 : }
30065 0 : object->in.scmanager = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.scmanager);
30066 0 : if (object->in.scmanager == NULL) {
30067 0 : PyErr_NoMemory();
30068 0 : return -1;
30069 : }
30070 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30071 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30072 0 : PyErr_NoMemory();
30073 0 : return -1;
30074 : }
30075 0 : object->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(value);
30076 0 : return 0;
30077 : }
30078 :
30079 0 : static PyObject *py_EnumServicesStatusExW_in_get_info_level(PyObject *obj, void *closure)
30080 : {
30081 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30082 : PyObject *py_info_level;
30083 0 : py_info_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.info_level);
30084 0 : return py_info_level;
30085 : }
30086 :
30087 0 : static int py_EnumServicesStatusExW_in_set_info_level(PyObject *py_obj, PyObject *value, void *closure)
30088 : {
30089 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30090 0 : if (value == NULL) {
30091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_level");
30092 0 : return -1;
30093 : }
30094 : {
30095 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.info_level));
30096 0 : if (PyLong_Check(value)) {
30097 : unsigned long long test_var;
30098 0 : test_var = PyLong_AsUnsignedLongLong(value);
30099 0 : if (PyErr_Occurred() != NULL) {
30100 0 : return -1;
30101 : }
30102 0 : if (test_var > uint_max) {
30103 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30104 : PyLong_Type.tp_name, uint_max, test_var);
30105 0 : return -1;
30106 : }
30107 0 : object->in.info_level = test_var;
30108 : } else {
30109 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30110 : PyLong_Type.tp_name);
30111 0 : return -1;
30112 : }
30113 : }
30114 0 : return 0;
30115 : }
30116 :
30117 0 : static PyObject *py_EnumServicesStatusExW_in_get_type(PyObject *obj, void *closure)
30118 : {
30119 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30120 : PyObject *py_type;
30121 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.type);
30122 0 : return py_type;
30123 : }
30124 :
30125 0 : static int py_EnumServicesStatusExW_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
30126 : {
30127 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30128 0 : if (value == NULL) {
30129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
30130 0 : return -1;
30131 : }
30132 : {
30133 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
30134 0 : if (PyLong_Check(value)) {
30135 : unsigned long long test_var;
30136 0 : test_var = PyLong_AsUnsignedLongLong(value);
30137 0 : if (PyErr_Occurred() != NULL) {
30138 0 : return -1;
30139 : }
30140 0 : if (test_var > uint_max) {
30141 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30142 : PyLong_Type.tp_name, uint_max, test_var);
30143 0 : return -1;
30144 : }
30145 0 : object->in.type = test_var;
30146 : } else {
30147 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30148 : PyLong_Type.tp_name);
30149 0 : return -1;
30150 : }
30151 : }
30152 0 : return 0;
30153 : }
30154 :
30155 0 : static PyObject *py_EnumServicesStatusExW_in_get_state(PyObject *obj, void *closure)
30156 : {
30157 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30158 : PyObject *py_state;
30159 0 : py_state = PyLong_FromUnsignedLongLong((uint32_t)object->in.state);
30160 0 : return py_state;
30161 : }
30162 :
30163 0 : static int py_EnumServicesStatusExW_in_set_state(PyObject *py_obj, PyObject *value, void *closure)
30164 : {
30165 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30166 0 : if (value == NULL) {
30167 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.state");
30168 0 : return -1;
30169 : }
30170 : {
30171 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.state));
30172 0 : if (PyLong_Check(value)) {
30173 : unsigned long long test_var;
30174 0 : test_var = PyLong_AsUnsignedLongLong(value);
30175 0 : if (PyErr_Occurred() != NULL) {
30176 0 : return -1;
30177 : }
30178 0 : if (test_var > uint_max) {
30179 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30180 : PyLong_Type.tp_name, uint_max, test_var);
30181 0 : return -1;
30182 : }
30183 0 : object->in.state = test_var;
30184 : } else {
30185 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30186 : PyLong_Type.tp_name);
30187 0 : return -1;
30188 : }
30189 : }
30190 0 : return 0;
30191 : }
30192 :
30193 0 : static PyObject *py_EnumServicesStatusExW_out_get_services(PyObject *obj, void *closure)
30194 : {
30195 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30196 : PyObject *py_services;
30197 0 : if (object->out.services == NULL) {
30198 0 : Py_RETURN_NONE;
30199 : }
30200 0 : py_services = PyList_New(object->in.offered);
30201 0 : if (py_services == NULL) {
30202 0 : return NULL;
30203 : }
30204 : {
30205 : int services_cntr_1;
30206 0 : for (services_cntr_1 = 0; services_cntr_1 < (object->in.offered); services_cntr_1++) {
30207 : PyObject *py_services_1;
30208 0 : py_services_1 = PyLong_FromLong((uint16_t)object->out.services[services_cntr_1]);
30209 0 : PyList_SetItem(py_services, services_cntr_1, py_services_1);
30210 : }
30211 : }
30212 0 : return py_services;
30213 : }
30214 :
30215 0 : static int py_EnumServicesStatusExW_out_set_services(PyObject *py_obj, PyObject *value, void *closure)
30216 : {
30217 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30218 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.services));
30219 0 : if (value == NULL) {
30220 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services");
30221 0 : return -1;
30222 : }
30223 0 : object->out.services = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services);
30224 0 : if (object->out.services == NULL) {
30225 0 : PyErr_NoMemory();
30226 0 : return -1;
30227 : }
30228 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
30229 : {
30230 : int services_cntr_1;
30231 0 : object->out.services = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.services, PyList_GET_SIZE(value));
30232 0 : if (!object->out.services) { return -1;; }
30233 0 : talloc_set_name_const(object->out.services, "ARRAY: object->out.services");
30234 0 : for (services_cntr_1 = 0; services_cntr_1 < PyList_GET_SIZE(value); services_cntr_1++) {
30235 0 : if (PyList_GET_ITEM(value, services_cntr_1) == NULL) {
30236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.services[services_cntr_1]");
30237 0 : return -1;
30238 : }
30239 : {
30240 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.services[services_cntr_1]));
30241 0 : if (PyLong_Check(PyList_GET_ITEM(value, services_cntr_1))) {
30242 : unsigned long long test_var;
30243 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, services_cntr_1));
30244 0 : if (PyErr_Occurred() != NULL) {
30245 0 : return -1;
30246 : }
30247 0 : if (test_var > uint_max) {
30248 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30249 : PyLong_Type.tp_name, uint_max, test_var);
30250 0 : return -1;
30251 : }
30252 0 : object->out.services[services_cntr_1] = test_var;
30253 : } else {
30254 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30255 : PyLong_Type.tp_name);
30256 0 : return -1;
30257 : }
30258 : }
30259 : }
30260 : }
30261 0 : return 0;
30262 : }
30263 :
30264 0 : static PyObject *py_EnumServicesStatusExW_in_get_offered(PyObject *obj, void *closure)
30265 : {
30266 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30267 : PyObject *py_offered;
30268 0 : py_offered = PyLong_FromUnsignedLongLong((uint32_t)object->in.offered);
30269 0 : return py_offered;
30270 : }
30271 :
30272 0 : static int py_EnumServicesStatusExW_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
30273 : {
30274 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30275 0 : if (value == NULL) {
30276 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.offered");
30277 0 : return -1;
30278 : }
30279 : {
30280 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
30281 0 : if (PyLong_Check(value)) {
30282 : unsigned long long test_var;
30283 0 : test_var = PyLong_AsUnsignedLongLong(value);
30284 0 : if (PyErr_Occurred() != NULL) {
30285 0 : return -1;
30286 : }
30287 0 : if (test_var > uint_max) {
30288 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30289 : PyLong_Type.tp_name, uint_max, test_var);
30290 0 : return -1;
30291 : }
30292 0 : object->in.offered = test_var;
30293 : } else {
30294 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30295 : PyLong_Type.tp_name);
30296 0 : return -1;
30297 : }
30298 : }
30299 0 : return 0;
30300 : }
30301 :
30302 0 : static PyObject *py_EnumServicesStatusExW_out_get_needed(PyObject *obj, void *closure)
30303 : {
30304 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30305 : PyObject *py_needed;
30306 0 : if (object->out.needed == NULL) {
30307 0 : Py_RETURN_NONE;
30308 : }
30309 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*object->out.needed);
30310 0 : return py_needed;
30311 : }
30312 :
30313 0 : static int py_EnumServicesStatusExW_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
30314 : {
30315 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30316 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
30317 0 : if (value == NULL) {
30318 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.needed");
30319 0 : return -1;
30320 : }
30321 0 : object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
30322 0 : if (object->out.needed == NULL) {
30323 0 : PyErr_NoMemory();
30324 0 : return -1;
30325 : }
30326 : {
30327 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
30328 0 : if (PyLong_Check(value)) {
30329 : unsigned long long test_var;
30330 0 : test_var = PyLong_AsUnsignedLongLong(value);
30331 0 : if (PyErr_Occurred() != NULL) {
30332 0 : return -1;
30333 : }
30334 0 : if (test_var > uint_max) {
30335 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30336 : PyLong_Type.tp_name, uint_max, test_var);
30337 0 : return -1;
30338 : }
30339 0 : *object->out.needed = test_var;
30340 : } else {
30341 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30342 : PyLong_Type.tp_name);
30343 0 : return -1;
30344 : }
30345 : }
30346 0 : return 0;
30347 : }
30348 :
30349 0 : static PyObject *py_EnumServicesStatusExW_out_get_service_returned(PyObject *obj, void *closure)
30350 : {
30351 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30352 : PyObject *py_service_returned;
30353 0 : if (object->out.service_returned == NULL) {
30354 0 : Py_RETURN_NONE;
30355 : }
30356 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.service_returned);
30357 0 : return py_service_returned;
30358 : }
30359 :
30360 0 : static int py_EnumServicesStatusExW_out_set_service_returned(PyObject *py_obj, PyObject *value, void *closure)
30361 : {
30362 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30363 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.service_returned));
30364 0 : if (value == NULL) {
30365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.service_returned");
30366 0 : return -1;
30367 : }
30368 0 : object->out.service_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.service_returned);
30369 0 : if (object->out.service_returned == NULL) {
30370 0 : PyErr_NoMemory();
30371 0 : return -1;
30372 : }
30373 : {
30374 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.service_returned));
30375 0 : if (PyLong_Check(value)) {
30376 : unsigned long long test_var;
30377 0 : test_var = PyLong_AsUnsignedLongLong(value);
30378 0 : if (PyErr_Occurred() != NULL) {
30379 0 : return -1;
30380 : }
30381 0 : if (test_var > uint_max) {
30382 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30383 : PyLong_Type.tp_name, uint_max, test_var);
30384 0 : return -1;
30385 : }
30386 0 : *object->out.service_returned = test_var;
30387 : } else {
30388 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30389 : PyLong_Type.tp_name);
30390 0 : return -1;
30391 : }
30392 : }
30393 0 : return 0;
30394 : }
30395 :
30396 0 : static PyObject *py_EnumServicesStatusExW_in_get_resume_handle(PyObject *obj, void *closure)
30397 : {
30398 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30399 : PyObject *py_resume_handle;
30400 0 : if (object->in.resume_handle == NULL) {
30401 0 : Py_RETURN_NONE;
30402 : }
30403 0 : if (object->in.resume_handle == NULL) {
30404 0 : py_resume_handle = Py_None;
30405 0 : Py_INCREF(py_resume_handle);
30406 : } else {
30407 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
30408 : }
30409 0 : return py_resume_handle;
30410 : }
30411 :
30412 0 : static int py_EnumServicesStatusExW_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
30413 : {
30414 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30415 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
30416 0 : if (value == NULL) {
30417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
30418 0 : return -1;
30419 : }
30420 0 : if (value == Py_None) {
30421 0 : object->in.resume_handle = NULL;
30422 : } else {
30423 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
30424 0 : if (object->in.resume_handle == NULL) {
30425 0 : PyErr_NoMemory();
30426 0 : return -1;
30427 : }
30428 : {
30429 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
30430 0 : if (PyLong_Check(value)) {
30431 : unsigned long long test_var;
30432 0 : test_var = PyLong_AsUnsignedLongLong(value);
30433 0 : if (PyErr_Occurred() != NULL) {
30434 0 : return -1;
30435 : }
30436 0 : if (test_var > uint_max) {
30437 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30438 : PyLong_Type.tp_name, uint_max, test_var);
30439 0 : return -1;
30440 : }
30441 0 : *object->in.resume_handle = test_var;
30442 : } else {
30443 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30444 : PyLong_Type.tp_name);
30445 0 : return -1;
30446 : }
30447 : }
30448 : }
30449 0 : return 0;
30450 : }
30451 :
30452 0 : static PyObject *py_EnumServicesStatusExW_out_get_resume_handle(PyObject *obj, void *closure)
30453 : {
30454 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30455 : PyObject *py_resume_handle;
30456 0 : if (object->out.resume_handle == NULL) {
30457 0 : Py_RETURN_NONE;
30458 : }
30459 0 : if (object->out.resume_handle == NULL) {
30460 0 : py_resume_handle = Py_None;
30461 0 : Py_INCREF(py_resume_handle);
30462 : } else {
30463 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
30464 : }
30465 0 : return py_resume_handle;
30466 : }
30467 :
30468 0 : static int py_EnumServicesStatusExW_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
30469 : {
30470 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30471 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
30472 0 : if (value == NULL) {
30473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
30474 0 : return -1;
30475 : }
30476 0 : if (value == Py_None) {
30477 0 : object->out.resume_handle = NULL;
30478 : } else {
30479 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
30480 0 : if (object->out.resume_handle == NULL) {
30481 0 : PyErr_NoMemory();
30482 0 : return -1;
30483 : }
30484 : {
30485 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
30486 0 : if (PyLong_Check(value)) {
30487 : unsigned long long test_var;
30488 0 : test_var = PyLong_AsUnsignedLongLong(value);
30489 0 : if (PyErr_Occurred() != NULL) {
30490 0 : return -1;
30491 : }
30492 0 : if (test_var > uint_max) {
30493 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30494 : PyLong_Type.tp_name, uint_max, test_var);
30495 0 : return -1;
30496 : }
30497 0 : *object->out.resume_handle = test_var;
30498 : } else {
30499 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30500 : PyLong_Type.tp_name);
30501 0 : return -1;
30502 : }
30503 : }
30504 : }
30505 0 : return 0;
30506 : }
30507 :
30508 0 : static PyObject *py_EnumServicesStatusExW_in_get_group_name(PyObject *obj, void *closure)
30509 : {
30510 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30511 : PyObject *py_group_name;
30512 0 : if (object->in.group_name == NULL) {
30513 0 : Py_RETURN_NONE;
30514 : }
30515 0 : if (object->in.group_name == NULL) {
30516 0 : py_group_name = Py_None;
30517 0 : Py_INCREF(py_group_name);
30518 : } else {
30519 0 : if (object->in.group_name == NULL) {
30520 0 : py_group_name = Py_None;
30521 0 : Py_INCREF(py_group_name);
30522 : } else {
30523 0 : py_group_name = PyUnicode_Decode(object->in.group_name, strlen(object->in.group_name), "utf-8", "ignore");
30524 : }
30525 : }
30526 0 : return py_group_name;
30527 : }
30528 :
30529 0 : static int py_EnumServicesStatusExW_in_set_group_name(PyObject *py_obj, PyObject *value, void *closure)
30530 : {
30531 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30532 0 : if (value == NULL) {
30533 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_name");
30534 0 : return -1;
30535 : }
30536 0 : if (value == Py_None) {
30537 0 : object->in.group_name = NULL;
30538 : } else {
30539 0 : object->in.group_name = NULL;
30540 : {
30541 : const char *test_str;
30542 : const char *talloc_str;
30543 0 : PyObject *unicode = NULL;
30544 0 : if (PyUnicode_Check(value)) {
30545 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
30546 0 : if (unicode == NULL) {
30547 0 : PyErr_NoMemory();
30548 0 : return -1;
30549 : }
30550 0 : test_str = PyBytes_AS_STRING(unicode);
30551 0 : } else if (PyBytes_Check(value)) {
30552 0 : test_str = PyBytes_AS_STRING(value);
30553 : } else {
30554 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
30555 0 : return -1;
30556 : }
30557 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
30558 0 : if (unicode != NULL) {
30559 0 : Py_DECREF(unicode);
30560 : }
30561 0 : if (talloc_str == NULL) {
30562 0 : PyErr_NoMemory();
30563 0 : return -1;
30564 : }
30565 0 : object->in.group_name = talloc_str;
30566 : }
30567 : }
30568 0 : return 0;
30569 : }
30570 :
30571 0 : static PyObject *py_EnumServicesStatusExW_get_result(PyObject *obj, void *closure)
30572 : {
30573 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(obj);
30574 : PyObject *py_result;
30575 0 : py_result = PyErr_FromWERROR(object->out.result);
30576 0 : return py_result;
30577 : }
30578 :
30579 0 : static int py_EnumServicesStatusExW_set_result(PyObject *py_obj, PyObject *value, void *closure)
30580 : {
30581 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30582 0 : if (value == NULL) {
30583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30584 0 : return -1;
30585 : }
30586 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
30587 0 : return 0;
30588 : }
30589 :
30590 : static PyGetSetDef py_EnumServicesStatusExW_getsetters[] = {
30591 : {
30592 : .name = discard_const_p(char, "in_scmanager"),
30593 : .get = py_EnumServicesStatusExW_in_get_scmanager,
30594 : .set = py_EnumServicesStatusExW_in_set_scmanager,
30595 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30596 : },
30597 : {
30598 : .name = discard_const_p(char, "in_info_level"),
30599 : .get = py_EnumServicesStatusExW_in_get_info_level,
30600 : .set = py_EnumServicesStatusExW_in_set_info_level,
30601 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30602 : },
30603 : {
30604 : .name = discard_const_p(char, "in_type"),
30605 : .get = py_EnumServicesStatusExW_in_get_type,
30606 : .set = py_EnumServicesStatusExW_in_set_type,
30607 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30608 : },
30609 : {
30610 : .name = discard_const_p(char, "in_state"),
30611 : .get = py_EnumServicesStatusExW_in_get_state,
30612 : .set = py_EnumServicesStatusExW_in_set_state,
30613 : .doc = discard_const_p(char, "PIDL-generated element of base type svcctl_ServiceState")
30614 : },
30615 : {
30616 : .name = discard_const_p(char, "out_services"),
30617 : .get = py_EnumServicesStatusExW_out_get_services,
30618 : .set = py_EnumServicesStatusExW_out_set_services,
30619 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
30620 : },
30621 : {
30622 : .name = discard_const_p(char, "in_offered"),
30623 : .get = py_EnumServicesStatusExW_in_get_offered,
30624 : .set = py_EnumServicesStatusExW_in_set_offered,
30625 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30626 : },
30627 : {
30628 : .name = discard_const_p(char, "out_needed"),
30629 : .get = py_EnumServicesStatusExW_out_get_needed,
30630 : .set = py_EnumServicesStatusExW_out_set_needed,
30631 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30632 : },
30633 : {
30634 : .name = discard_const_p(char, "out_service_returned"),
30635 : .get = py_EnumServicesStatusExW_out_get_service_returned,
30636 : .set = py_EnumServicesStatusExW_out_set_service_returned,
30637 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30638 : },
30639 : {
30640 : .name = discard_const_p(char, "in_resume_handle"),
30641 : .get = py_EnumServicesStatusExW_in_get_resume_handle,
30642 : .set = py_EnumServicesStatusExW_in_set_resume_handle,
30643 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30644 : },
30645 : {
30646 : .name = discard_const_p(char, "out_resume_handle"),
30647 : .get = py_EnumServicesStatusExW_out_get_resume_handle,
30648 : .set = py_EnumServicesStatusExW_out_set_resume_handle,
30649 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
30650 : },
30651 : {
30652 : .name = discard_const_p(char, "in_group_name"),
30653 : .get = py_EnumServicesStatusExW_in_get_group_name,
30654 : .set = py_EnumServicesStatusExW_in_set_group_name,
30655 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
30656 : },
30657 : {
30658 : .name = discard_const_p(char, "result"),
30659 : .get = py_EnumServicesStatusExW_get_result,
30660 : .set = py_EnumServicesStatusExW_set_result,
30661 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
30662 : },
30663 : { .name = NULL }
30664 : };
30665 :
30666 0 : static PyObject *py_EnumServicesStatusExW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30667 : {
30668 0 : PyObject *self = pytalloc_new(struct EnumServicesStatusExW, type);
30669 0 : struct EnumServicesStatusExW *_self = (struct EnumServicesStatusExW *)pytalloc_get_ptr(self);
30670 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30671 0 : _self->in.scmanager = talloc_zero(mem_ctx, struct policy_handle);
30672 0 : _self->out.services = talloc_zero(mem_ctx, uint8_t);
30673 0 : _self->out.needed = talloc_zero(mem_ctx, uint32_t);
30674 0 : _self->out.service_returned = talloc_zero(mem_ctx, uint32_t);
30675 0 : return self;
30676 : }
30677 :
30678 0 : static PyObject *py_EnumServicesStatusExW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30679 : {
30680 :
30681 :
30682 0 : return PyLong_FromLong(42);
30683 : }
30684 :
30685 0 : static PyObject *py_EnumServicesStatusExW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
30686 : {
30687 0 : const struct ndr_interface_call *call = NULL;
30688 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30689 0 : PyObject *ret = NULL;
30690 0 : struct ndr_push *push = NULL;
30691 : DATA_BLOB blob;
30692 : enum ndr_err_code err;
30693 :
30694 0 : if (ndr_table_svcctl.num_calls < 43) {
30695 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_EnumServicesStatusExW_ndr_pack");
30696 0 : return NULL;
30697 : }
30698 0 : call = &ndr_table_svcctl.calls[42];
30699 :
30700 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30701 0 : if (push == NULL) {
30702 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30703 0 : return NULL;
30704 : }
30705 :
30706 0 : push->flags |= ndr_push_flags;
30707 :
30708 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30709 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30710 0 : TALLOC_FREE(push);
30711 0 : PyErr_SetNdrError(err);
30712 0 : return NULL;
30713 : }
30714 0 : blob = ndr_push_blob(push);
30715 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30716 0 : TALLOC_FREE(push);
30717 0 : return ret;
30718 : }
30719 :
30720 0 : static PyObject *py_EnumServicesStatusExW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30721 : {
30722 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30723 0 : PyObject *bigendian_obj = NULL;
30724 0 : PyObject *ndr64_obj = NULL;
30725 0 : uint32_t ndr_push_flags = 0;
30726 :
30727 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30728 : discard_const_p(char *, kwnames),
30729 : &bigendian_obj,
30730 : &ndr64_obj)) {
30731 0 : return NULL;
30732 : }
30733 :
30734 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30735 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30736 : }
30737 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30738 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30739 : }
30740 :
30741 0 : return py_EnumServicesStatusExW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30742 : }
30743 :
30744 0 : static PyObject *py_EnumServicesStatusExW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30745 : {
30746 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30747 0 : PyObject *bigendian_obj = NULL;
30748 0 : PyObject *ndr64_obj = NULL;
30749 0 : uint32_t ndr_push_flags = 0;
30750 :
30751 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30752 : discard_const_p(char *, kwnames),
30753 : &bigendian_obj,
30754 : &ndr64_obj)) {
30755 0 : return NULL;
30756 : }
30757 :
30758 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30759 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30760 : }
30761 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30762 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30763 : }
30764 :
30765 0 : return py_EnumServicesStatusExW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30766 : }
30767 :
30768 0 : static PyObject *py_EnumServicesStatusExW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
30769 : {
30770 0 : const struct ndr_interface_call *call = NULL;
30771 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30772 0 : struct ndr_pull *pull = NULL;
30773 : enum ndr_err_code err;
30774 :
30775 0 : if (ndr_table_svcctl.num_calls < 43) {
30776 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_EnumServicesStatusExW_ndr_unpack");
30777 0 : return NULL;
30778 : }
30779 0 : call = &ndr_table_svcctl.calls[42];
30780 :
30781 0 : pull = ndr_pull_init_blob(blob, object);
30782 0 : if (pull == NULL) {
30783 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30784 0 : return NULL;
30785 : }
30786 :
30787 0 : pull->flags |= ndr_pull_flags;
30788 :
30789 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30790 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30791 0 : TALLOC_FREE(pull);
30792 0 : PyErr_SetNdrError(err);
30793 0 : return NULL;
30794 : }
30795 0 : if (!allow_remaining) {
30796 : uint32_t highest_ofs;
30797 :
30798 0 : if (pull->offset > pull->relative_highest_offset) {
30799 0 : highest_ofs = pull->offset;
30800 : } else {
30801 0 : highest_ofs = pull->relative_highest_offset;
30802 : }
30803 0 : if (highest_ofs < pull->data_size) {
30804 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30805 : "not all bytes consumed ofs[%u] size[%u]",
30806 : highest_ofs, pull->data_size);
30807 0 : TALLOC_FREE(pull);
30808 0 : PyErr_SetNdrError(err);
30809 0 : return NULL;
30810 : }
30811 : }
30812 :
30813 0 : TALLOC_FREE(pull);
30814 0 : Py_RETURN_NONE;
30815 : }
30816 :
30817 0 : static PyObject *py_EnumServicesStatusExW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30818 : {
30819 : DATA_BLOB blob;
30820 0 : Py_ssize_t blob_length = 0;
30821 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30822 0 : PyObject *bigendian_obj = NULL;
30823 0 : PyObject *ndr64_obj = NULL;
30824 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30825 0 : PyObject *allow_remaining_obj = NULL;
30826 0 : bool allow_remaining = false;
30827 :
30828 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30829 : discard_const_p(char *, kwnames),
30830 : &blob.data, &blob_length,
30831 : &bigendian_obj,
30832 : &ndr64_obj,
30833 : &allow_remaining_obj)) {
30834 0 : return NULL;
30835 : }
30836 0 : blob.length = blob_length;
30837 :
30838 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30839 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30840 : }
30841 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30842 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30843 : }
30844 :
30845 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30846 0 : allow_remaining = true;
30847 : }
30848 :
30849 0 : return py_EnumServicesStatusExW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30850 : }
30851 :
30852 0 : static PyObject *py_EnumServicesStatusExW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30853 : {
30854 : DATA_BLOB blob;
30855 0 : Py_ssize_t blob_length = 0;
30856 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30857 0 : PyObject *bigendian_obj = NULL;
30858 0 : PyObject *ndr64_obj = NULL;
30859 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30860 0 : PyObject *allow_remaining_obj = NULL;
30861 0 : bool allow_remaining = false;
30862 :
30863 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30864 : discard_const_p(char *, kwnames),
30865 : &blob.data, &blob_length,
30866 : &bigendian_obj,
30867 : &ndr64_obj,
30868 : &allow_remaining_obj)) {
30869 0 : return NULL;
30870 : }
30871 0 : blob.length = blob_length;
30872 :
30873 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30874 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30875 : }
30876 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30877 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30878 : }
30879 :
30880 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30881 0 : allow_remaining = true;
30882 : }
30883 :
30884 0 : return py_EnumServicesStatusExW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30885 : }
30886 :
30887 0 : static PyObject *py_EnumServicesStatusExW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
30888 : {
30889 0 : const struct ndr_interface_call *call = NULL;
30890 0 : struct EnumServicesStatusExW *object = (struct EnumServicesStatusExW *)pytalloc_get_ptr(py_obj);
30891 : PyObject *ret;
30892 : char *retstr;
30893 :
30894 0 : if (ndr_table_svcctl.num_calls < 43) {
30895 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_EnumServicesStatusExW_ndr_print");
30896 0 : return NULL;
30897 : }
30898 0 : call = &ndr_table_svcctl.calls[42];
30899 :
30900 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30901 0 : ret = PyUnicode_FromString(retstr);
30902 0 : TALLOC_FREE(retstr);
30903 :
30904 0 : return ret;
30905 : }
30906 :
30907 0 : static PyObject *py_EnumServicesStatusExW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30908 : {
30909 0 : return py_EnumServicesStatusExW_ndr_print(py_obj, "EnumServicesStatusExW_in", NDR_IN);
30910 : }
30911 :
30912 0 : static PyObject *py_EnumServicesStatusExW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30913 : {
30914 0 : return py_EnumServicesStatusExW_ndr_print(py_obj, "EnumServicesStatusExW_out", NDR_OUT);
30915 : }
30916 :
30917 : static PyMethodDef py_EnumServicesStatusExW_methods[] = {
30918 : { "opnum", (PyCFunction)py_EnumServicesStatusExW_ndr_opnum, METH_NOARGS|METH_CLASS,
30919 : "svcctl.EnumServicesStatusExW.opnum() -> 42 (0x2a) " },
30920 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30921 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30922 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30923 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30924 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30925 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30926 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_EnumServicesStatusExW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30927 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30928 : { "__ndr_print_in__", (PyCFunction)py_EnumServicesStatusExW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30929 : { "__ndr_print_out__", (PyCFunction)py_EnumServicesStatusExW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30930 : { NULL, NULL, 0, NULL }
30931 : };
30932 :
30933 :
30934 : static PyTypeObject EnumServicesStatusExW_Type = {
30935 : PyVarObject_HEAD_INIT(NULL, 0)
30936 : .tp_name = "svcctl.EnumServicesStatusExW",
30937 : .tp_getset = py_EnumServicesStatusExW_getsetters,
30938 : .tp_methods = py_EnumServicesStatusExW_methods,
30939 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30940 : .tp_new = py_EnumServicesStatusExW_new,
30941 : };
30942 :
30943 0 : static bool pack_py_EnumServicesStatusExW_args_in(PyObject *args, PyObject *kwargs, struct EnumServicesStatusExW *r)
30944 : {
30945 : PyObject *py_scmanager;
30946 : PyObject *py_info_level;
30947 : PyObject *py_type;
30948 : PyObject *py_state;
30949 : PyObject *py_offered;
30950 : PyObject *py_resume_handle;
30951 : PyObject *py_group_name;
30952 0 : const char *kwnames[] = {
30953 : "scmanager", "info_level", "type", "state", "offered", "resume_handle", "group_name", NULL
30954 : };
30955 :
30956 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:EnumServicesStatusExW", discard_const_p(char *, kwnames), &py_scmanager, &py_info_level, &py_type, &py_state, &py_offered, &py_resume_handle, &py_group_name)) {
30957 0 : return false;
30958 : }
30959 :
30960 0 : if (py_scmanager == NULL) {
30961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.scmanager");
30962 0 : return false;
30963 : }
30964 0 : r->in.scmanager = talloc_ptrtype(r, r->in.scmanager);
30965 0 : if (r->in.scmanager == NULL) {
30966 0 : PyErr_NoMemory();
30967 0 : return false;
30968 : }
30969 0 : PY_CHECK_TYPE(policy_handle_Type, py_scmanager, return false;);
30970 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_scmanager)) == NULL) {
30971 0 : PyErr_NoMemory();
30972 0 : return false;
30973 : }
30974 0 : r->in.scmanager = (struct policy_handle *)pytalloc_get_ptr(py_scmanager);
30975 0 : if (py_info_level == NULL) {
30976 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_level");
30977 0 : return false;
30978 : }
30979 : {
30980 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.info_level));
30981 0 : if (PyLong_Check(py_info_level)) {
30982 : unsigned long long test_var;
30983 0 : test_var = PyLong_AsUnsignedLongLong(py_info_level);
30984 0 : if (PyErr_Occurred() != NULL) {
30985 0 : return false;
30986 : }
30987 0 : if (test_var > uint_max) {
30988 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30989 : PyLong_Type.tp_name, uint_max, test_var);
30990 0 : return false;
30991 : }
30992 0 : r->in.info_level = test_var;
30993 : } else {
30994 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30995 : PyLong_Type.tp_name);
30996 0 : return false;
30997 : }
30998 : }
30999 0 : if (py_type == NULL) {
31000 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
31001 0 : return false;
31002 : }
31003 : {
31004 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
31005 0 : if (PyLong_Check(py_type)) {
31006 : unsigned long long test_var;
31007 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
31008 0 : if (PyErr_Occurred() != NULL) {
31009 0 : return false;
31010 : }
31011 0 : if (test_var > uint_max) {
31012 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31013 : PyLong_Type.tp_name, uint_max, test_var);
31014 0 : return false;
31015 : }
31016 0 : r->in.type = test_var;
31017 : } else {
31018 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31019 : PyLong_Type.tp_name);
31020 0 : return false;
31021 : }
31022 : }
31023 0 : if (py_state == NULL) {
31024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.state");
31025 0 : return false;
31026 : }
31027 : {
31028 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.state));
31029 0 : if (PyLong_Check(py_state)) {
31030 : unsigned long long test_var;
31031 0 : test_var = PyLong_AsUnsignedLongLong(py_state);
31032 0 : if (PyErr_Occurred() != NULL) {
31033 0 : return false;
31034 : }
31035 0 : if (test_var > uint_max) {
31036 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31037 : PyLong_Type.tp_name, uint_max, test_var);
31038 0 : return false;
31039 : }
31040 0 : r->in.state = test_var;
31041 : } else {
31042 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31043 : PyLong_Type.tp_name);
31044 0 : return false;
31045 : }
31046 : }
31047 0 : if (py_offered == NULL) {
31048 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.offered");
31049 0 : return false;
31050 : }
31051 : {
31052 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
31053 0 : if (PyLong_Check(py_offered)) {
31054 : unsigned long long test_var;
31055 0 : test_var = PyLong_AsUnsignedLongLong(py_offered);
31056 0 : if (PyErr_Occurred() != NULL) {
31057 0 : return false;
31058 : }
31059 0 : if (test_var > uint_max) {
31060 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31061 : PyLong_Type.tp_name, uint_max, test_var);
31062 0 : return false;
31063 : }
31064 0 : r->in.offered = test_var;
31065 : } else {
31066 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31067 : PyLong_Type.tp_name);
31068 0 : return false;
31069 : }
31070 : }
31071 0 : if (py_resume_handle == NULL) {
31072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
31073 0 : return false;
31074 : }
31075 0 : if (py_resume_handle == Py_None) {
31076 0 : r->in.resume_handle = NULL;
31077 : } else {
31078 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
31079 0 : if (r->in.resume_handle == NULL) {
31080 0 : PyErr_NoMemory();
31081 0 : return false;
31082 : }
31083 : {
31084 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
31085 0 : if (PyLong_Check(py_resume_handle)) {
31086 : unsigned long long test_var;
31087 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
31088 0 : if (PyErr_Occurred() != NULL) {
31089 0 : return false;
31090 : }
31091 0 : if (test_var > uint_max) {
31092 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31093 : PyLong_Type.tp_name, uint_max, test_var);
31094 0 : return false;
31095 : }
31096 0 : *r->in.resume_handle = test_var;
31097 : } else {
31098 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31099 : PyLong_Type.tp_name);
31100 0 : return false;
31101 : }
31102 : }
31103 : }
31104 0 : if (py_group_name == NULL) {
31105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_name");
31106 0 : return false;
31107 : }
31108 0 : if (py_group_name == Py_None) {
31109 0 : r->in.group_name = NULL;
31110 : } else {
31111 0 : r->in.group_name = NULL;
31112 : {
31113 : const char *test_str;
31114 : const char *talloc_str;
31115 0 : PyObject *unicode = NULL;
31116 0 : if (PyUnicode_Check(py_group_name)) {
31117 0 : unicode = PyUnicode_AsEncodedString(py_group_name, "utf-8", "ignore");
31118 0 : if (unicode == NULL) {
31119 0 : PyErr_NoMemory();
31120 0 : return false;
31121 : }
31122 0 : test_str = PyBytes_AS_STRING(unicode);
31123 0 : } else if (PyBytes_Check(py_group_name)) {
31124 0 : test_str = PyBytes_AS_STRING(py_group_name);
31125 : } else {
31126 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_group_name)->tp_name);
31127 0 : return false;
31128 : }
31129 0 : talloc_str = talloc_strdup(r, test_str);
31130 0 : if (unicode != NULL) {
31131 0 : Py_DECREF(unicode);
31132 : }
31133 0 : if (talloc_str == NULL) {
31134 0 : PyErr_NoMemory();
31135 0 : return false;
31136 : }
31137 0 : r->in.group_name = talloc_str;
31138 : }
31139 : }
31140 0 : return true;
31141 : }
31142 :
31143 0 : static PyObject *unpack_py_EnumServicesStatusExW_args_out(struct EnumServicesStatusExW *r)
31144 : {
31145 : PyObject *result;
31146 : PyObject *py_services;
31147 : PyObject *py_needed;
31148 : PyObject *py_service_returned;
31149 : PyObject *py_resume_handle;
31150 0 : result = PyTuple_New(4);
31151 0 : py_services = PyList_New(r->in.offered);
31152 0 : if (py_services == NULL) {
31153 0 : return NULL;
31154 : }
31155 : {
31156 : int services_cntr_1;
31157 0 : for (services_cntr_1 = 0; services_cntr_1 < (r->in.offered); services_cntr_1++) {
31158 : PyObject *py_services_1;
31159 0 : py_services_1 = PyLong_FromLong((uint16_t)r->out.services[services_cntr_1]);
31160 0 : PyList_SetItem(py_services, services_cntr_1, py_services_1);
31161 : }
31162 : }
31163 0 : PyTuple_SetItem(result, 0, py_services);
31164 0 : py_needed = PyLong_FromUnsignedLongLong((uint32_t)*r->out.needed);
31165 0 : PyTuple_SetItem(result, 1, py_needed);
31166 0 : py_service_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.service_returned);
31167 0 : PyTuple_SetItem(result, 2, py_service_returned);
31168 0 : if (r->out.resume_handle == NULL) {
31169 0 : py_resume_handle = Py_None;
31170 0 : Py_INCREF(py_resume_handle);
31171 : } else {
31172 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
31173 : }
31174 0 : PyTuple_SetItem(result, 3, py_resume_handle);
31175 0 : if (!W_ERROR_IS_OK(r->out.result)) {
31176 0 : PyErr_SetWERROR(r->out.result);
31177 0 : return NULL;
31178 : }
31179 :
31180 0 : return result;
31181 : }
31182 :
31183 : const struct PyNdrRpcMethodDef py_ndr_svcctl_methods[] = {
31184 : { "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 },
31185 : { "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 },
31186 : { "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 },
31187 : { "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 },
31188 : { "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 },
31189 : { "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 },
31190 : { "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 },
31191 : { "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 },
31192 : { "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 },
31193 : { "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 },
31194 : { "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 },
31195 : { "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 },
31196 : { "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 },
31197 : { "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 },
31198 : { "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 },
31199 : { "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 },
31200 : { "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 },
31201 : { "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 },
31202 : { "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 },
31203 : { "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 },
31204 : { "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 },
31205 : { "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 },
31206 : { "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 },
31207 : { "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 },
31208 : { "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 },
31209 : { "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 },
31210 : { "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 },
31211 : { "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 },
31212 : { "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 },
31213 : { "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 },
31214 : { "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 },
31215 : { "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 },
31216 : { "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 },
31217 : { "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 },
31218 : { "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 },
31219 : { "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 },
31220 : { "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 },
31221 : { "EnumServicesStatusExA", "S.EnumServicesStatusExA(scmanager, info_level, type, state, offered, resume_handle) -> (services, needed, service_returned, resume_handle, group_name)", (py_dcerpc_call_fn)dcerpc_EnumServicesStatusExA_r, (py_data_pack_fn)pack_py_EnumServicesStatusExA_args_in, (py_data_unpack_fn)unpack_py_EnumServicesStatusExA_args_out, 41, &ndr_table_svcctl },
31222 : { "EnumServicesStatusExW", "S.EnumServicesStatusExW(scmanager, info_level, type, state, offered, resume_handle, group_name) -> (services, needed, service_returned, resume_handle)", (py_dcerpc_call_fn)dcerpc_EnumServicesStatusExW_r, (py_data_pack_fn)pack_py_EnumServicesStatusExW_args_in, (py_data_unpack_fn)unpack_py_EnumServicesStatusExW_args_out, 42, &ndr_table_svcctl },
31223 : {0}
31224 : };
31225 :
31226 0 : static PyObject *interface_svcctl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31227 : {
31228 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_svcctl);
31229 : }
31230 :
31231 : #define PY_DOC_SVCCTL "Service Control"
31232 : static PyTypeObject svcctl_InterfaceType = {
31233 : PyVarObject_HEAD_INIT(NULL, 0)
31234 : .tp_name = "svcctl.svcctl",
31235 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
31236 : .tp_doc = "svcctl(binding, lp_ctx=None, credentials=None) -> connection\n"
31237 : "\n"
31238 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
31239 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
31240 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_SVCCTL,
31241 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31242 : .tp_new = interface_svcctl_new,
31243 : };
31244 :
31245 0 : static PyObject *syntax_svcctl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31246 : {
31247 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_svcctl.syntax_id);
31248 : }
31249 :
31250 : #define PY_DOC_SVCCTL_SYNTAX "Service Control"
31251 : static PyTypeObject svcctl_SyntaxType = {
31252 : PyVarObject_HEAD_INIT(NULL, 0)
31253 : .tp_name = "svcctl.svcctl_abstract_syntax",
31254 : .tp_doc = "svcctl_abstract_syntax()\n"PY_DOC_SVCCTL_SYNTAX,
31255 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31256 : .tp_new = syntax_svcctl_new,
31257 : };
31258 :
31259 : static PyMethodDef svcctl_methods[] = {
31260 : { NULL, NULL, 0, NULL }
31261 : };
31262 :
31263 : static struct PyModuleDef moduledef = {
31264 : PyModuleDef_HEAD_INIT,
31265 : .m_name = "svcctl",
31266 : .m_doc = "svcctl DCE/RPC",
31267 : .m_size = -1,
31268 : .m_methods = svcctl_methods,
31269 : };
31270 35 : MODULE_INIT_FUNC(svcctl)
31271 : {
31272 35 : PyObject *m = NULL;
31273 35 : PyObject *dep_samba_dcerpc_misc = NULL;
31274 35 : PyObject *dep_samba_dcerpc_security = NULL;
31275 35 : PyObject *dep_talloc = NULL;
31276 35 : PyObject *dep_samba_dcerpc_base = NULL;
31277 :
31278 35 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
31279 35 : if (dep_samba_dcerpc_misc == NULL)
31280 0 : goto out;
31281 :
31282 35 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
31283 35 : if (dep_samba_dcerpc_security == NULL)
31284 0 : goto out;
31285 :
31286 35 : dep_talloc = PyImport_ImportModule("talloc");
31287 35 : if (dep_talloc == NULL)
31288 0 : goto out;
31289 :
31290 35 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
31291 35 : if (dep_samba_dcerpc_base == NULL)
31292 0 : goto out;
31293 :
31294 35 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
31295 35 : if (BaseObject_Type == NULL)
31296 0 : goto out;
31297 :
31298 35 : policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
31299 35 : if (policy_handle_Type == NULL)
31300 0 : goto out;
31301 :
31302 35 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
31303 35 : if (ClientConnection_Type == NULL)
31304 0 : goto out;
31305 :
31306 35 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
31307 35 : if (ndr_syntax_id_Type == NULL)
31308 0 : goto out;
31309 :
31310 35 : SERVICE_LOCK_STATUS_Type.tp_base = BaseObject_Type;
31311 35 : SERVICE_LOCK_STATUS_Type.tp_basicsize = pytalloc_BaseObject_size();
31312 :
31313 35 : SERVICE_STATUS_Type.tp_base = BaseObject_Type;
31314 35 : SERVICE_STATUS_Type.tp_basicsize = pytalloc_BaseObject_size();
31315 :
31316 35 : SERVICE_STATUS_PROCESS_Type.tp_base = BaseObject_Type;
31317 35 : SERVICE_STATUS_PROCESS_Type.tp_basicsize = pytalloc_BaseObject_size();
31318 :
31319 35 : ENUM_SERVICE_STATUSW_Type.tp_base = BaseObject_Type;
31320 35 : ENUM_SERVICE_STATUSW_Type.tp_basicsize = pytalloc_BaseObject_size();
31321 :
31322 35 : ENUM_SERVICE_STATUSA_Type.tp_base = BaseObject_Type;
31323 35 : ENUM_SERVICE_STATUSA_Type.tp_basicsize = pytalloc_BaseObject_size();
31324 :
31325 35 : QUERY_SERVICE_CONFIG_Type.tp_base = BaseObject_Type;
31326 35 : QUERY_SERVICE_CONFIG_Type.tp_basicsize = pytalloc_BaseObject_size();
31327 :
31328 35 : svcctl_ArgumentString_Type.tp_base = BaseObject_Type;
31329 35 : svcctl_ArgumentString_Type.tp_basicsize = pytalloc_BaseObject_size();
31330 :
31331 35 : SERVICE_DESCRIPTION_Type.tp_base = BaseObject_Type;
31332 35 : SERVICE_DESCRIPTION_Type.tp_basicsize = pytalloc_BaseObject_size();
31333 :
31334 35 : SC_ACTION_Type.tp_base = BaseObject_Type;
31335 35 : SC_ACTION_Type.tp_basicsize = pytalloc_BaseObject_size();
31336 :
31337 35 : SERVICE_FAILURE_ACTIONS_Type.tp_base = BaseObject_Type;
31338 35 : SERVICE_FAILURE_ACTIONS_Type.tp_basicsize = pytalloc_BaseObject_size();
31339 :
31340 35 : svcctl_CloseServiceHandle_Type.tp_base = BaseObject_Type;
31341 35 : svcctl_CloseServiceHandle_Type.tp_basicsize = pytalloc_BaseObject_size();
31342 :
31343 35 : svcctl_ControlService_Type.tp_base = BaseObject_Type;
31344 35 : svcctl_ControlService_Type.tp_basicsize = pytalloc_BaseObject_size();
31345 :
31346 35 : svcctl_DeleteService_Type.tp_base = BaseObject_Type;
31347 35 : svcctl_DeleteService_Type.tp_basicsize = pytalloc_BaseObject_size();
31348 :
31349 35 : svcctl_LockServiceDatabase_Type.tp_base = BaseObject_Type;
31350 35 : svcctl_LockServiceDatabase_Type.tp_basicsize = pytalloc_BaseObject_size();
31351 :
31352 35 : svcctl_QueryServiceObjectSecurity_Type.tp_base = BaseObject_Type;
31353 35 : svcctl_QueryServiceObjectSecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
31354 :
31355 35 : svcctl_SetServiceObjectSecurity_Type.tp_base = BaseObject_Type;
31356 35 : svcctl_SetServiceObjectSecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
31357 :
31358 35 : svcctl_QueryServiceStatus_Type.tp_base = BaseObject_Type;
31359 35 : svcctl_QueryServiceStatus_Type.tp_basicsize = pytalloc_BaseObject_size();
31360 :
31361 35 : svcctl_UnlockServiceDatabase_Type.tp_base = BaseObject_Type;
31362 35 : svcctl_UnlockServiceDatabase_Type.tp_basicsize = pytalloc_BaseObject_size();
31363 :
31364 35 : svcctl_SCSetServiceBitsW_Type.tp_base = BaseObject_Type;
31365 35 : svcctl_SCSetServiceBitsW_Type.tp_basicsize = pytalloc_BaseObject_size();
31366 :
31367 35 : svcctl_ChangeServiceConfigW_Type.tp_base = BaseObject_Type;
31368 35 : svcctl_ChangeServiceConfigW_Type.tp_basicsize = pytalloc_BaseObject_size();
31369 :
31370 35 : svcctl_CreateServiceW_Type.tp_base = BaseObject_Type;
31371 35 : svcctl_CreateServiceW_Type.tp_basicsize = pytalloc_BaseObject_size();
31372 :
31373 35 : svcctl_EnumDependentServicesW_Type.tp_base = BaseObject_Type;
31374 35 : svcctl_EnumDependentServicesW_Type.tp_basicsize = pytalloc_BaseObject_size();
31375 :
31376 35 : svcctl_EnumServicesStatusW_Type.tp_base = BaseObject_Type;
31377 35 : svcctl_EnumServicesStatusW_Type.tp_basicsize = pytalloc_BaseObject_size();
31378 :
31379 35 : svcctl_OpenSCManagerW_Type.tp_base = BaseObject_Type;
31380 35 : svcctl_OpenSCManagerW_Type.tp_basicsize = pytalloc_BaseObject_size();
31381 :
31382 35 : svcctl_OpenServiceW_Type.tp_base = BaseObject_Type;
31383 35 : svcctl_OpenServiceW_Type.tp_basicsize = pytalloc_BaseObject_size();
31384 :
31385 35 : svcctl_QueryServiceConfigW_Type.tp_base = BaseObject_Type;
31386 35 : svcctl_QueryServiceConfigW_Type.tp_basicsize = pytalloc_BaseObject_size();
31387 :
31388 35 : svcctl_QueryServiceLockStatusW_Type.tp_base = BaseObject_Type;
31389 35 : svcctl_QueryServiceLockStatusW_Type.tp_basicsize = pytalloc_BaseObject_size();
31390 :
31391 35 : svcctl_StartServiceW_Type.tp_base = BaseObject_Type;
31392 35 : svcctl_StartServiceW_Type.tp_basicsize = pytalloc_BaseObject_size();
31393 :
31394 35 : svcctl_GetServiceDisplayNameW_Type.tp_base = BaseObject_Type;
31395 35 : svcctl_GetServiceDisplayNameW_Type.tp_basicsize = pytalloc_BaseObject_size();
31396 :
31397 35 : svcctl_GetServiceKeyNameW_Type.tp_base = BaseObject_Type;
31398 35 : svcctl_GetServiceKeyNameW_Type.tp_basicsize = pytalloc_BaseObject_size();
31399 :
31400 35 : svcctl_SCSetServiceBitsA_Type.tp_base = BaseObject_Type;
31401 35 : svcctl_SCSetServiceBitsA_Type.tp_basicsize = pytalloc_BaseObject_size();
31402 :
31403 35 : svcctl_ChangeServiceConfigA_Type.tp_base = BaseObject_Type;
31404 35 : svcctl_ChangeServiceConfigA_Type.tp_basicsize = pytalloc_BaseObject_size();
31405 :
31406 35 : svcctl_CreateServiceA_Type.tp_base = BaseObject_Type;
31407 35 : svcctl_CreateServiceA_Type.tp_basicsize = pytalloc_BaseObject_size();
31408 :
31409 35 : svcctl_EnumDependentServicesA_Type.tp_base = BaseObject_Type;
31410 35 : svcctl_EnumDependentServicesA_Type.tp_basicsize = pytalloc_BaseObject_size();
31411 :
31412 35 : svcctl_EnumServicesStatusA_Type.tp_base = BaseObject_Type;
31413 35 : svcctl_EnumServicesStatusA_Type.tp_basicsize = pytalloc_BaseObject_size();
31414 :
31415 35 : svcctl_OpenSCManagerA_Type.tp_base = BaseObject_Type;
31416 35 : svcctl_OpenSCManagerA_Type.tp_basicsize = pytalloc_BaseObject_size();
31417 :
31418 35 : svcctl_OpenServiceA_Type.tp_base = BaseObject_Type;
31419 35 : svcctl_OpenServiceA_Type.tp_basicsize = pytalloc_BaseObject_size();
31420 :
31421 35 : svcctl_QueryServiceConfigA_Type.tp_base = BaseObject_Type;
31422 35 : svcctl_QueryServiceConfigA_Type.tp_basicsize = pytalloc_BaseObject_size();
31423 :
31424 35 : svcctl_QueryServiceLockStatusA_Type.tp_base = BaseObject_Type;
31425 35 : svcctl_QueryServiceLockStatusA_Type.tp_basicsize = pytalloc_BaseObject_size();
31426 :
31427 35 : svcctl_StartServiceA_Type.tp_base = BaseObject_Type;
31428 35 : svcctl_StartServiceA_Type.tp_basicsize = pytalloc_BaseObject_size();
31429 :
31430 35 : svcctl_GetServiceDisplayNameA_Type.tp_base = BaseObject_Type;
31431 35 : svcctl_GetServiceDisplayNameA_Type.tp_basicsize = pytalloc_BaseObject_size();
31432 :
31433 35 : svcctl_GetServiceKeyNameA_Type.tp_base = BaseObject_Type;
31434 35 : svcctl_GetServiceKeyNameA_Type.tp_basicsize = pytalloc_BaseObject_size();
31435 :
31436 35 : svcctl_ChangeServiceConfig2A_Type.tp_base = BaseObject_Type;
31437 35 : svcctl_ChangeServiceConfig2A_Type.tp_basicsize = pytalloc_BaseObject_size();
31438 :
31439 35 : svcctl_ChangeServiceConfig2W_Type.tp_base = BaseObject_Type;
31440 35 : svcctl_ChangeServiceConfig2W_Type.tp_basicsize = pytalloc_BaseObject_size();
31441 :
31442 35 : svcctl_QueryServiceConfig2A_Type.tp_base = BaseObject_Type;
31443 35 : svcctl_QueryServiceConfig2A_Type.tp_basicsize = pytalloc_BaseObject_size();
31444 :
31445 35 : svcctl_QueryServiceConfig2W_Type.tp_base = BaseObject_Type;
31446 35 : svcctl_QueryServiceConfig2W_Type.tp_basicsize = pytalloc_BaseObject_size();
31447 :
31448 35 : svcctl_QueryServiceStatusEx_Type.tp_base = BaseObject_Type;
31449 35 : svcctl_QueryServiceStatusEx_Type.tp_basicsize = pytalloc_BaseObject_size();
31450 :
31451 35 : EnumServicesStatusExA_Type.tp_base = BaseObject_Type;
31452 35 : EnumServicesStatusExA_Type.tp_basicsize = pytalloc_BaseObject_size();
31453 :
31454 35 : EnumServicesStatusExW_Type.tp_base = BaseObject_Type;
31455 35 : EnumServicesStatusExW_Type.tp_basicsize = pytalloc_BaseObject_size();
31456 :
31457 35 : svcctl_InterfaceType.tp_base = ClientConnection_Type;
31458 :
31459 35 : svcctl_SyntaxType.tp_base = ndr_syntax_id_Type;
31460 35 : svcctl_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
31461 :
31462 35 : if (PyType_Ready(&SERVICE_LOCK_STATUS_Type) < 0)
31463 0 : goto out;
31464 35 : if (PyType_Ready(&SERVICE_STATUS_Type) < 0)
31465 0 : goto out;
31466 35 : if (PyType_Ready(&SERVICE_STATUS_PROCESS_Type) < 0)
31467 0 : goto out;
31468 35 : if (PyType_Ready(&ENUM_SERVICE_STATUSW_Type) < 0)
31469 0 : goto out;
31470 35 : if (PyType_Ready(&ENUM_SERVICE_STATUSA_Type) < 0)
31471 0 : goto out;
31472 35 : if (PyType_Ready(&QUERY_SERVICE_CONFIG_Type) < 0)
31473 0 : goto out;
31474 35 : if (PyType_Ready(&svcctl_ArgumentString_Type) < 0)
31475 0 : goto out;
31476 35 : if (PyType_Ready(&SERVICE_DESCRIPTION_Type) < 0)
31477 0 : goto out;
31478 35 : if (PyType_Ready(&SC_ACTION_Type) < 0)
31479 0 : goto out;
31480 35 : if (PyType_Ready(&SERVICE_FAILURE_ACTIONS_Type) < 0)
31481 0 : goto out;
31482 35 : if (PyType_Ready(&svcctl_CloseServiceHandle_Type) < 0)
31483 0 : goto out;
31484 35 : if (PyType_Ready(&svcctl_ControlService_Type) < 0)
31485 0 : goto out;
31486 35 : if (PyType_Ready(&svcctl_DeleteService_Type) < 0)
31487 0 : goto out;
31488 35 : if (PyType_Ready(&svcctl_LockServiceDatabase_Type) < 0)
31489 0 : goto out;
31490 35 : if (PyType_Ready(&svcctl_QueryServiceObjectSecurity_Type) < 0)
31491 0 : goto out;
31492 35 : if (PyType_Ready(&svcctl_SetServiceObjectSecurity_Type) < 0)
31493 0 : goto out;
31494 35 : if (PyType_Ready(&svcctl_QueryServiceStatus_Type) < 0)
31495 0 : goto out;
31496 35 : if (PyType_Ready(&svcctl_UnlockServiceDatabase_Type) < 0)
31497 0 : goto out;
31498 35 : if (PyType_Ready(&svcctl_SCSetServiceBitsW_Type) < 0)
31499 0 : goto out;
31500 35 : if (PyType_Ready(&svcctl_ChangeServiceConfigW_Type) < 0)
31501 0 : goto out;
31502 35 : if (PyType_Ready(&svcctl_CreateServiceW_Type) < 0)
31503 0 : goto out;
31504 35 : if (PyType_Ready(&svcctl_EnumDependentServicesW_Type) < 0)
31505 0 : goto out;
31506 35 : if (PyType_Ready(&svcctl_EnumServicesStatusW_Type) < 0)
31507 0 : goto out;
31508 35 : if (PyType_Ready(&svcctl_OpenSCManagerW_Type) < 0)
31509 0 : goto out;
31510 35 : if (PyType_Ready(&svcctl_OpenServiceW_Type) < 0)
31511 0 : goto out;
31512 35 : if (PyType_Ready(&svcctl_QueryServiceConfigW_Type) < 0)
31513 0 : goto out;
31514 35 : if (PyType_Ready(&svcctl_QueryServiceLockStatusW_Type) < 0)
31515 0 : goto out;
31516 35 : if (PyType_Ready(&svcctl_StartServiceW_Type) < 0)
31517 0 : goto out;
31518 35 : if (PyType_Ready(&svcctl_GetServiceDisplayNameW_Type) < 0)
31519 0 : goto out;
31520 35 : if (PyType_Ready(&svcctl_GetServiceKeyNameW_Type) < 0)
31521 0 : goto out;
31522 35 : if (PyType_Ready(&svcctl_SCSetServiceBitsA_Type) < 0)
31523 0 : goto out;
31524 35 : if (PyType_Ready(&svcctl_ChangeServiceConfigA_Type) < 0)
31525 0 : goto out;
31526 35 : if (PyType_Ready(&svcctl_CreateServiceA_Type) < 0)
31527 0 : goto out;
31528 35 : if (PyType_Ready(&svcctl_EnumDependentServicesA_Type) < 0)
31529 0 : goto out;
31530 35 : if (PyType_Ready(&svcctl_EnumServicesStatusA_Type) < 0)
31531 0 : goto out;
31532 35 : if (PyType_Ready(&svcctl_OpenSCManagerA_Type) < 0)
31533 0 : goto out;
31534 35 : if (PyType_Ready(&svcctl_OpenServiceA_Type) < 0)
31535 0 : goto out;
31536 35 : if (PyType_Ready(&svcctl_QueryServiceConfigA_Type) < 0)
31537 0 : goto out;
31538 35 : if (PyType_Ready(&svcctl_QueryServiceLockStatusA_Type) < 0)
31539 0 : goto out;
31540 35 : if (PyType_Ready(&svcctl_StartServiceA_Type) < 0)
31541 0 : goto out;
31542 35 : if (PyType_Ready(&svcctl_GetServiceDisplayNameA_Type) < 0)
31543 0 : goto out;
31544 35 : if (PyType_Ready(&svcctl_GetServiceKeyNameA_Type) < 0)
31545 0 : goto out;
31546 35 : if (PyType_Ready(&svcctl_ChangeServiceConfig2A_Type) < 0)
31547 0 : goto out;
31548 35 : if (PyType_Ready(&svcctl_ChangeServiceConfig2W_Type) < 0)
31549 0 : goto out;
31550 35 : if (PyType_Ready(&svcctl_QueryServiceConfig2A_Type) < 0)
31551 0 : goto out;
31552 35 : if (PyType_Ready(&svcctl_QueryServiceConfig2W_Type) < 0)
31553 0 : goto out;
31554 35 : if (PyType_Ready(&svcctl_QueryServiceStatusEx_Type) < 0)
31555 0 : goto out;
31556 35 : if (PyType_Ready(&EnumServicesStatusExA_Type) < 0)
31557 0 : goto out;
31558 35 : if (PyType_Ready(&EnumServicesStatusExW_Type) < 0)
31559 0 : goto out;
31560 35 : if (PyType_Ready(&svcctl_InterfaceType) < 0)
31561 0 : goto out;
31562 35 : if (PyType_Ready(&svcctl_SyntaxType) < 0)
31563 0 : goto out;
31564 35 : if (!PyInterface_AddNdrRpcMethods(&svcctl_InterfaceType, py_ndr_svcctl_methods))
31565 0 : return NULL;
31566 :
31567 : #ifdef PY_SERVICE_LOCK_STATUS_PATCH
31568 : PY_SERVICE_LOCK_STATUS_PATCH(&SERVICE_LOCK_STATUS_Type);
31569 : #endif
31570 : #ifdef PY_SERVICE_STATUS_PATCH
31571 : PY_SERVICE_STATUS_PATCH(&SERVICE_STATUS_Type);
31572 : #endif
31573 : #ifdef PY_SERVICE_STATUS_PROCESS_PATCH
31574 : PY_SERVICE_STATUS_PROCESS_PATCH(&SERVICE_STATUS_PROCESS_Type);
31575 : #endif
31576 : #ifdef PY_ENUM_SERVICE_STATUSW_PATCH
31577 : PY_ENUM_SERVICE_STATUSW_PATCH(&ENUM_SERVICE_STATUSW_Type);
31578 : #endif
31579 : #ifdef PY_ENUM_SERVICE_STATUSA_PATCH
31580 : PY_ENUM_SERVICE_STATUSA_PATCH(&ENUM_SERVICE_STATUSA_Type);
31581 : #endif
31582 : #ifdef PY_QUERY_SERVICE_CONFIG_PATCH
31583 : PY_QUERY_SERVICE_CONFIG_PATCH(&QUERY_SERVICE_CONFIG_Type);
31584 : #endif
31585 : #ifdef PY_ARGUMENTSTRING_PATCH
31586 : PY_ARGUMENTSTRING_PATCH(&svcctl_ArgumentString_Type);
31587 : #endif
31588 : #ifdef PY_SERVICE_DESCRIPTION_PATCH
31589 : PY_SERVICE_DESCRIPTION_PATCH(&SERVICE_DESCRIPTION_Type);
31590 : #endif
31591 : #ifdef PY_SC_ACTION_PATCH
31592 : PY_SC_ACTION_PATCH(&SC_ACTION_Type);
31593 : #endif
31594 : #ifdef PY_SERVICE_FAILURE_ACTIONS_PATCH
31595 : PY_SERVICE_FAILURE_ACTIONS_PATCH(&SERVICE_FAILURE_ACTIONS_Type);
31596 : #endif
31597 : #ifdef PY_CLOSESERVICEHANDLE_PATCH
31598 : PY_CLOSESERVICEHANDLE_PATCH(&svcctl_CloseServiceHandle_Type);
31599 : #endif
31600 : #ifdef PY_CONTROLSERVICE_PATCH
31601 : PY_CONTROLSERVICE_PATCH(&svcctl_ControlService_Type);
31602 : #endif
31603 : #ifdef PY_DELETESERVICE_PATCH
31604 : PY_DELETESERVICE_PATCH(&svcctl_DeleteService_Type);
31605 : #endif
31606 : #ifdef PY_LOCKSERVICEDATABASE_PATCH
31607 : PY_LOCKSERVICEDATABASE_PATCH(&svcctl_LockServiceDatabase_Type);
31608 : #endif
31609 : #ifdef PY_QUERYSERVICEOBJECTSECURITY_PATCH
31610 : PY_QUERYSERVICEOBJECTSECURITY_PATCH(&svcctl_QueryServiceObjectSecurity_Type);
31611 : #endif
31612 : #ifdef PY_SETSERVICEOBJECTSECURITY_PATCH
31613 : PY_SETSERVICEOBJECTSECURITY_PATCH(&svcctl_SetServiceObjectSecurity_Type);
31614 : #endif
31615 : #ifdef PY_QUERYSERVICESTATUS_PATCH
31616 : PY_QUERYSERVICESTATUS_PATCH(&svcctl_QueryServiceStatus_Type);
31617 : #endif
31618 : #ifdef PY_UNLOCKSERVICEDATABASE_PATCH
31619 : PY_UNLOCKSERVICEDATABASE_PATCH(&svcctl_UnlockServiceDatabase_Type);
31620 : #endif
31621 : #ifdef PY_SCSETSERVICEBITSW_PATCH
31622 : PY_SCSETSERVICEBITSW_PATCH(&svcctl_SCSetServiceBitsW_Type);
31623 : #endif
31624 : #ifdef PY_CHANGESERVICECONFIGW_PATCH
31625 : PY_CHANGESERVICECONFIGW_PATCH(&svcctl_ChangeServiceConfigW_Type);
31626 : #endif
31627 : #ifdef PY_CREATESERVICEW_PATCH
31628 : PY_CREATESERVICEW_PATCH(&svcctl_CreateServiceW_Type);
31629 : #endif
31630 : #ifdef PY_ENUMDEPENDENTSERVICESW_PATCH
31631 : PY_ENUMDEPENDENTSERVICESW_PATCH(&svcctl_EnumDependentServicesW_Type);
31632 : #endif
31633 : #ifdef PY_ENUMSERVICESSTATUSW_PATCH
31634 : PY_ENUMSERVICESSTATUSW_PATCH(&svcctl_EnumServicesStatusW_Type);
31635 : #endif
31636 : #ifdef PY_OPENSCMANAGERW_PATCH
31637 : PY_OPENSCMANAGERW_PATCH(&svcctl_OpenSCManagerW_Type);
31638 : #endif
31639 : #ifdef PY_OPENSERVICEW_PATCH
31640 : PY_OPENSERVICEW_PATCH(&svcctl_OpenServiceW_Type);
31641 : #endif
31642 : #ifdef PY_QUERYSERVICECONFIGW_PATCH
31643 : PY_QUERYSERVICECONFIGW_PATCH(&svcctl_QueryServiceConfigW_Type);
31644 : #endif
31645 : #ifdef PY_QUERYSERVICELOCKSTATUSW_PATCH
31646 : PY_QUERYSERVICELOCKSTATUSW_PATCH(&svcctl_QueryServiceLockStatusW_Type);
31647 : #endif
31648 : #ifdef PY_STARTSERVICEW_PATCH
31649 : PY_STARTSERVICEW_PATCH(&svcctl_StartServiceW_Type);
31650 : #endif
31651 : #ifdef PY_GETSERVICEDISPLAYNAMEW_PATCH
31652 : PY_GETSERVICEDISPLAYNAMEW_PATCH(&svcctl_GetServiceDisplayNameW_Type);
31653 : #endif
31654 : #ifdef PY_GETSERVICEKEYNAMEW_PATCH
31655 : PY_GETSERVICEKEYNAMEW_PATCH(&svcctl_GetServiceKeyNameW_Type);
31656 : #endif
31657 : #ifdef PY_SCSETSERVICEBITSA_PATCH
31658 : PY_SCSETSERVICEBITSA_PATCH(&svcctl_SCSetServiceBitsA_Type);
31659 : #endif
31660 : #ifdef PY_CHANGESERVICECONFIGA_PATCH
31661 : PY_CHANGESERVICECONFIGA_PATCH(&svcctl_ChangeServiceConfigA_Type);
31662 : #endif
31663 : #ifdef PY_CREATESERVICEA_PATCH
31664 : PY_CREATESERVICEA_PATCH(&svcctl_CreateServiceA_Type);
31665 : #endif
31666 : #ifdef PY_ENUMDEPENDENTSERVICESA_PATCH
31667 : PY_ENUMDEPENDENTSERVICESA_PATCH(&svcctl_EnumDependentServicesA_Type);
31668 : #endif
31669 : #ifdef PY_ENUMSERVICESSTATUSA_PATCH
31670 : PY_ENUMSERVICESSTATUSA_PATCH(&svcctl_EnumServicesStatusA_Type);
31671 : #endif
31672 : #ifdef PY_OPENSCMANAGERA_PATCH
31673 : PY_OPENSCMANAGERA_PATCH(&svcctl_OpenSCManagerA_Type);
31674 : #endif
31675 : #ifdef PY_OPENSERVICEA_PATCH
31676 : PY_OPENSERVICEA_PATCH(&svcctl_OpenServiceA_Type);
31677 : #endif
31678 : #ifdef PY_QUERYSERVICECONFIGA_PATCH
31679 : PY_QUERYSERVICECONFIGA_PATCH(&svcctl_QueryServiceConfigA_Type);
31680 : #endif
31681 : #ifdef PY_QUERYSERVICELOCKSTATUSA_PATCH
31682 : PY_QUERYSERVICELOCKSTATUSA_PATCH(&svcctl_QueryServiceLockStatusA_Type);
31683 : #endif
31684 : #ifdef PY_STARTSERVICEA_PATCH
31685 : PY_STARTSERVICEA_PATCH(&svcctl_StartServiceA_Type);
31686 : #endif
31687 : #ifdef PY_GETSERVICEDISPLAYNAMEA_PATCH
31688 : PY_GETSERVICEDISPLAYNAMEA_PATCH(&svcctl_GetServiceDisplayNameA_Type);
31689 : #endif
31690 : #ifdef PY_GETSERVICEKEYNAMEA_PATCH
31691 : PY_GETSERVICEKEYNAMEA_PATCH(&svcctl_GetServiceKeyNameA_Type);
31692 : #endif
31693 : #ifdef PY_CHANGESERVICECONFIG2A_PATCH
31694 : PY_CHANGESERVICECONFIG2A_PATCH(&svcctl_ChangeServiceConfig2A_Type);
31695 : #endif
31696 : #ifdef PY_CHANGESERVICECONFIG2W_PATCH
31697 : PY_CHANGESERVICECONFIG2W_PATCH(&svcctl_ChangeServiceConfig2W_Type);
31698 : #endif
31699 : #ifdef PY_QUERYSERVICECONFIG2A_PATCH
31700 : PY_QUERYSERVICECONFIG2A_PATCH(&svcctl_QueryServiceConfig2A_Type);
31701 : #endif
31702 : #ifdef PY_QUERYSERVICECONFIG2W_PATCH
31703 : PY_QUERYSERVICECONFIG2W_PATCH(&svcctl_QueryServiceConfig2W_Type);
31704 : #endif
31705 : #ifdef PY_QUERYSERVICESTATUSEX_PATCH
31706 : PY_QUERYSERVICESTATUSEX_PATCH(&svcctl_QueryServiceStatusEx_Type);
31707 : #endif
31708 : #ifdef PY_ENUMSERVICESSTATUSEXA_PATCH
31709 : PY_ENUMSERVICESSTATUSEXA_PATCH(&EnumServicesStatusExA_Type);
31710 : #endif
31711 : #ifdef PY_ENUMSERVICESSTATUSEXW_PATCH
31712 : PY_ENUMSERVICESSTATUSEXW_PATCH(&EnumServicesStatusExW_Type);
31713 : #endif
31714 : #ifdef PY_SVCCTL_PATCH
31715 : PY_SVCCTL_PATCH(&svcctl_InterfaceType);
31716 : #endif
31717 : #ifdef PY_SVCCTL_ABSTRACT_SYNTAX_PATCH
31718 : PY_SVCCTL_ABSTRACT_SYNTAX_PATCH(&svcctl_SyntaxType);
31719 : #endif
31720 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
31721 : PY_ABSTRACT_SYNTAX_PATCH(&svcctl_SyntaxType);
31722 : #endif
31723 :
31724 35 : m = PyModule_Create(&moduledef);
31725 35 : if (m == NULL)
31726 0 : goto out;
31727 :
31728 35 : PyModule_AddObject(m, "MAX_SERVICE_NAME_LENGTH", PyLong_FromUnsignedLongLong(256));
31729 35 : PyModule_AddObject(m, "SC_MAX_DEPEND_SIZE", PyLong_FromLong(4*1024));
31730 35 : PyModule_AddObject(m, "SC_MAX_NAME_LENGTH", PyLong_FromLong(MAX_SERVICE_NAME_LENGTH+1));
31731 35 : PyModule_AddObject(m, "SC_MAX_PATH_LENGTH", PyLong_FromLong(32*1024));
31732 35 : PyModule_AddObject(m, "SC_MAX_PWD_SIZE", PyLong_FromUnsignedLongLong(514));
31733 35 : PyModule_AddObject(m, "SC_MAX_COMPUTER_NAME_LENGTH", PyLong_FromUnsignedLongLong(1024));
31734 35 : PyModule_AddObject(m, "SC_MAX_ACCOUNT_NAME_LENGTH", PyLong_FromLong(2*1024));
31735 35 : PyModule_AddObject(m, "SC_MAX_COMMENT_LENGTH", PyLong_FromUnsignedLongLong(128));
31736 35 : PyModule_AddObject(m, "SC_MAX_ARGUMENT_LENGTH", PyLong_FromUnsignedLongLong(1024));
31737 35 : PyModule_AddObject(m, "SC_MAX_ARGUMENTS", PyLong_FromUnsignedLongLong(1024));
31738 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_NONE", PyLong_FromUnsignedLongLong(0x00000000));
31739 35 : PyModule_AddObject(m, "SERVICE_TYPE_KERNEL_DRIVER", PyLong_FromUnsignedLongLong(0x01));
31740 35 : PyModule_AddObject(m, "SERVICE_TYPE_FS_DRIVER", PyLong_FromUnsignedLongLong(0x02));
31741 35 : PyModule_AddObject(m, "SERVICE_TYPE_ADAPTER", PyLong_FromUnsignedLongLong(0x04));
31742 35 : PyModule_AddObject(m, "SERVICE_TYPE_RECOGNIZER_DRIVER", PyLong_FromUnsignedLongLong(0x08));
31743 35 : PyModule_AddObject(m, "SERVICE_TYPE_DRIVER", PyLong_FromLong(SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER));
31744 35 : PyModule_AddObject(m, "SERVICE_TYPE_WIN32_OWN_PROCESS", PyLong_FromUnsignedLongLong(0x10));
31745 35 : PyModule_AddObject(m, "SERVICE_TYPE_WIN32_SHARE_PROCESS", PyLong_FromUnsignedLongLong(0x20));
31746 35 : PyModule_AddObject(m, "SERVICE_TYPE_WIN32", PyLong_FromLong(SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS));
31747 35 : PyModule_AddObject(m, "SERVICE_TYPE_INTERACTIVE_PROCESS", PyLong_FromUnsignedLongLong(0x100));
31748 35 : 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)));
31749 35 : PyModule_AddObject(m, "SC_MANAGER_EXECUTE_ACCESS", PyLong_FromLong(SC_MANAGER_READ_ACCESS));
31750 35 : 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)));
31751 35 : PyModule_AddObject(m, "SC_MANAGER_ALL_ACCESS", PyLong_FromLong(SC_MANAGER_WRITE_ACCESS));
31752 35 : 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)));
31753 35 : PyModule_AddObject(m, "SERVICE_EXECUTE_ACCESS", PyLong_FromLong((SERVICE_READ_ACCESS|SC_RIGHT_SVC_START|SC_RIGHT_SVC_STOP|SC_RIGHT_SVC_PAUSE_CONTINUE)));
31754 35 : PyModule_AddObject(m, "SERVICE_WRITE_ACCESS", PyLong_FromLong((SEC_STD_REQUIRED|SERVICE_READ_ACCESS|SERVICE_EXECUTE_ACCESS|SC_RIGHT_SVC_CHANGE_CONFIG)));
31755 35 : PyModule_AddObject(m, "SERVICE_ALL_ACCESS", PyLong_FromLong(SERVICE_WRITE_ACCESS));
31756 35 : PyModule_AddObject(m, "SVCCTL_STATE_UNKNOWN", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_STATE_UNKNOWN));
31757 35 : PyModule_AddObject(m, "SVCCTL_STOPPED", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_STOPPED));
31758 35 : PyModule_AddObject(m, "SVCCTL_START_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_START_PENDING));
31759 35 : PyModule_AddObject(m, "SVCCTL_STOP_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_STOP_PENDING));
31760 35 : PyModule_AddObject(m, "SVCCTL_RUNNING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_RUNNING));
31761 35 : PyModule_AddObject(m, "SVCCTL_CONTINUE_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTINUE_PENDING));
31762 35 : PyModule_AddObject(m, "SVCCTL_PAUSE_PENDING", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_PAUSE_PENDING));
31763 35 : PyModule_AddObject(m, "SVCCTL_PAUSED", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_PAUSED));
31764 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_STOP", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_STOP));
31765 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_PAUSE_CONTINUE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_PAUSE_CONTINUE));
31766 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_SHUTDOWN", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_SHUTDOWN));
31767 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_PARAMCHANGE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_PARAMCHANGE));
31768 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_NETBINDCHANGE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_NETBINDCHANGE));
31769 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_HARDWAREPROFILECHANGE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_HARDWAREPROFILECHANGE));
31770 35 : PyModule_AddObject(m, "SVCCTL_ACCEPT_POWEREVENT", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_ACCEPT_POWEREVENT));
31771 35 : PyModule_AddObject(m, "SVCCTL_CONTROL_STOP", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_STOP));
31772 35 : PyModule_AddObject(m, "SVCCTL_CONTROL_PAUSE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_PAUSE));
31773 35 : PyModule_AddObject(m, "SVCCTL_CONTROL_CONTINUE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_CONTINUE));
31774 35 : PyModule_AddObject(m, "SVCCTL_CONTROL_INTERROGATE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_INTERROGATE));
31775 35 : PyModule_AddObject(m, "SVCCTL_CONTROL_SHUTDOWN", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_CONTROL_SHUTDOWN));
31776 35 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_IGNORE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_IGNORE));
31777 35 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_NORMAL", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_NORMAL));
31778 35 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_CRITICAL", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_CRITICAL));
31779 35 : PyModule_AddObject(m, "SVCCTL_SVC_ERROR_SEVERE", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SVC_ERROR_SEVERE));
31780 35 : PyModule_AddObject(m, "SVCCTL_BOOT_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_BOOT_START));
31781 35 : PyModule_AddObject(m, "SVCCTL_SYSTEM_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_SYSTEM_START));
31782 35 : PyModule_AddObject(m, "SVCCTL_AUTO_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_AUTO_START));
31783 35 : PyModule_AddObject(m, "SVCCTL_DEMAND_START", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_DEMAND_START));
31784 35 : PyModule_AddObject(m, "SVCCTL_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)SVCCTL_DISABLED));
31785 35 : PyModule_AddObject(m, "SERVICE_STATE_ACTIVE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STATE_ACTIVE));
31786 35 : PyModule_AddObject(m, "SERVICE_STATE_INACTIVE", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STATE_INACTIVE));
31787 35 : PyModule_AddObject(m, "SERVICE_STATE_ALL", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_STATE_ALL));
31788 35 : PyModule_AddObject(m, "SC_RIGHT_MGR_CONNECT", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_CONNECT));
31789 35 : PyModule_AddObject(m, "SC_RIGHT_MGR_CREATE_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_CREATE_SERVICE));
31790 35 : PyModule_AddObject(m, "SC_RIGHT_MGR_ENUMERATE_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_ENUMERATE_SERVICE));
31791 35 : PyModule_AddObject(m, "SC_RIGHT_MGR_LOCK", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_LOCK));
31792 35 : PyModule_AddObject(m, "SC_RIGHT_MGR_QUERY_LOCK_STATUS", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_QUERY_LOCK_STATUS));
31793 35 : PyModule_AddObject(m, "SC_RIGHT_MGR_MODIFY_BOOT_CONFIG", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_MGR_MODIFY_BOOT_CONFIG));
31794 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_QUERY_CONFIG", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_QUERY_CONFIG));
31795 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_CHANGE_CONFIG", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_CHANGE_CONFIG));
31796 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_QUERY_STATUS", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_QUERY_STATUS));
31797 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_ENUMERATE_DEPENDENTS", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_ENUMERATE_DEPENDENTS));
31798 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_START", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_START));
31799 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_STOP", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_STOP));
31800 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_PAUSE_CONTINUE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_PAUSE_CONTINUE));
31801 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_INTERROGATE", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_INTERROGATE));
31802 35 : PyModule_AddObject(m, "SC_RIGHT_SVC_USER_DEFINED_CONTROL", PyLong_FromUnsignedLongLong((uint32_t)SC_RIGHT_SVC_USER_DEFINED_CONTROL));
31803 35 : PyModule_AddObject(m, "SERVICE_CONFIG_DESCRIPTION", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_CONFIG_DESCRIPTION));
31804 35 : PyModule_AddObject(m, "SERVICE_CONFIG_FAILURE_ACTIONS", PyLong_FromUnsignedLongLong((uint32_t)SERVICE_CONFIG_FAILURE_ACTIONS));
31805 35 : PyModule_AddObject(m, "SC_ACTION_NONE", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_NONE));
31806 35 : PyModule_AddObject(m, "SC_ACTION_RESTART", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_RESTART));
31807 35 : PyModule_AddObject(m, "SC_ACTION_REBOOT", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_REBOOT));
31808 35 : PyModule_AddObject(m, "SC_ACTION_RUN_COMMAND", PyLong_FromUnsignedLongLong((uint32_t)SC_ACTION_RUN_COMMAND));
31809 35 : PyModule_AddObject(m, "SVC_STATUS_PROCESS_INFO", PyLong_FromUnsignedLongLong((uint32_t)SVC_STATUS_PROCESS_INFO));
31810 35 : Py_INCREF((PyObject *)(void *)&SERVICE_LOCK_STATUS_Type);
31811 35 : PyModule_AddObject(m, "SERVICE_LOCK_STATUS", (PyObject *)(void *)&SERVICE_LOCK_STATUS_Type);
31812 35 : Py_INCREF((PyObject *)(void *)&SERVICE_STATUS_Type);
31813 35 : PyModule_AddObject(m, "SERVICE_STATUS", (PyObject *)(void *)&SERVICE_STATUS_Type);
31814 35 : Py_INCREF((PyObject *)(void *)&SERVICE_STATUS_PROCESS_Type);
31815 35 : PyModule_AddObject(m, "SERVICE_STATUS_PROCESS", (PyObject *)(void *)&SERVICE_STATUS_PROCESS_Type);
31816 35 : Py_INCREF((PyObject *)(void *)&ENUM_SERVICE_STATUSW_Type);
31817 35 : PyModule_AddObject(m, "ENUM_SERVICE_STATUSW", (PyObject *)(void *)&ENUM_SERVICE_STATUSW_Type);
31818 35 : Py_INCREF((PyObject *)(void *)&ENUM_SERVICE_STATUSA_Type);
31819 35 : PyModule_AddObject(m, "ENUM_SERVICE_STATUSA", (PyObject *)(void *)&ENUM_SERVICE_STATUSA_Type);
31820 35 : Py_INCREF((PyObject *)(void *)&QUERY_SERVICE_CONFIG_Type);
31821 35 : PyModule_AddObject(m, "QUERY_SERVICE_CONFIG", (PyObject *)(void *)&QUERY_SERVICE_CONFIG_Type);
31822 35 : Py_INCREF((PyObject *)(void *)&svcctl_ArgumentString_Type);
31823 35 : PyModule_AddObject(m, "ArgumentString", (PyObject *)(void *)&svcctl_ArgumentString_Type);
31824 35 : Py_INCREF((PyObject *)(void *)&SERVICE_DESCRIPTION_Type);
31825 35 : PyModule_AddObject(m, "SERVICE_DESCRIPTION", (PyObject *)(void *)&SERVICE_DESCRIPTION_Type);
31826 35 : Py_INCREF((PyObject *)(void *)&SC_ACTION_Type);
31827 35 : PyModule_AddObject(m, "SC_ACTION", (PyObject *)(void *)&SC_ACTION_Type);
31828 35 : Py_INCREF((PyObject *)(void *)&SERVICE_FAILURE_ACTIONS_Type);
31829 35 : PyModule_AddObject(m, "SERVICE_FAILURE_ACTIONS", (PyObject *)(void *)&SERVICE_FAILURE_ACTIONS_Type);
31830 35 : Py_INCREF((PyObject *)(void *)&svcctl_CloseServiceHandle_Type);
31831 35 : PyModule_AddObject(m, "CloseServiceHandle", (PyObject *)(void *)&svcctl_CloseServiceHandle_Type);
31832 35 : Py_INCREF((PyObject *)(void *)&svcctl_ControlService_Type);
31833 35 : PyModule_AddObject(m, "ControlService", (PyObject *)(void *)&svcctl_ControlService_Type);
31834 35 : Py_INCREF((PyObject *)(void *)&svcctl_DeleteService_Type);
31835 35 : PyModule_AddObject(m, "DeleteService", (PyObject *)(void *)&svcctl_DeleteService_Type);
31836 35 : Py_INCREF((PyObject *)(void *)&svcctl_LockServiceDatabase_Type);
31837 35 : PyModule_AddObject(m, "LockServiceDatabase", (PyObject *)(void *)&svcctl_LockServiceDatabase_Type);
31838 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceObjectSecurity_Type);
31839 35 : PyModule_AddObject(m, "QueryServiceObjectSecurity", (PyObject *)(void *)&svcctl_QueryServiceObjectSecurity_Type);
31840 35 : Py_INCREF((PyObject *)(void *)&svcctl_SetServiceObjectSecurity_Type);
31841 35 : PyModule_AddObject(m, "SetServiceObjectSecurity", (PyObject *)(void *)&svcctl_SetServiceObjectSecurity_Type);
31842 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceStatus_Type);
31843 35 : PyModule_AddObject(m, "QueryServiceStatus", (PyObject *)(void *)&svcctl_QueryServiceStatus_Type);
31844 35 : Py_INCREF((PyObject *)(void *)&svcctl_UnlockServiceDatabase_Type);
31845 35 : PyModule_AddObject(m, "UnlockServiceDatabase", (PyObject *)(void *)&svcctl_UnlockServiceDatabase_Type);
31846 35 : Py_INCREF((PyObject *)(void *)&svcctl_SCSetServiceBitsW_Type);
31847 35 : PyModule_AddObject(m, "SCSetServiceBitsW", (PyObject *)(void *)&svcctl_SCSetServiceBitsW_Type);
31848 35 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfigW_Type);
31849 35 : PyModule_AddObject(m, "ChangeServiceConfigW", (PyObject *)(void *)&svcctl_ChangeServiceConfigW_Type);
31850 35 : Py_INCREF((PyObject *)(void *)&svcctl_CreateServiceW_Type);
31851 35 : PyModule_AddObject(m, "CreateServiceW", (PyObject *)(void *)&svcctl_CreateServiceW_Type);
31852 35 : Py_INCREF((PyObject *)(void *)&svcctl_EnumDependentServicesW_Type);
31853 35 : PyModule_AddObject(m, "EnumDependentServicesW", (PyObject *)(void *)&svcctl_EnumDependentServicesW_Type);
31854 35 : Py_INCREF((PyObject *)(void *)&svcctl_EnumServicesStatusW_Type);
31855 35 : PyModule_AddObject(m, "EnumServicesStatusW", (PyObject *)(void *)&svcctl_EnumServicesStatusW_Type);
31856 35 : Py_INCREF((PyObject *)(void *)&svcctl_OpenSCManagerW_Type);
31857 35 : PyModule_AddObject(m, "OpenSCManagerW", (PyObject *)(void *)&svcctl_OpenSCManagerW_Type);
31858 35 : Py_INCREF((PyObject *)(void *)&svcctl_OpenServiceW_Type);
31859 35 : PyModule_AddObject(m, "OpenServiceW", (PyObject *)(void *)&svcctl_OpenServiceW_Type);
31860 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfigW_Type);
31861 35 : PyModule_AddObject(m, "QueryServiceConfigW", (PyObject *)(void *)&svcctl_QueryServiceConfigW_Type);
31862 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceLockStatusW_Type);
31863 35 : PyModule_AddObject(m, "QueryServiceLockStatusW", (PyObject *)(void *)&svcctl_QueryServiceLockStatusW_Type);
31864 35 : Py_INCREF((PyObject *)(void *)&svcctl_StartServiceW_Type);
31865 35 : PyModule_AddObject(m, "StartServiceW", (PyObject *)(void *)&svcctl_StartServiceW_Type);
31866 35 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceDisplayNameW_Type);
31867 35 : PyModule_AddObject(m, "GetServiceDisplayNameW", (PyObject *)(void *)&svcctl_GetServiceDisplayNameW_Type);
31868 35 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceKeyNameW_Type);
31869 35 : PyModule_AddObject(m, "GetServiceKeyNameW", (PyObject *)(void *)&svcctl_GetServiceKeyNameW_Type);
31870 35 : Py_INCREF((PyObject *)(void *)&svcctl_SCSetServiceBitsA_Type);
31871 35 : PyModule_AddObject(m, "SCSetServiceBitsA", (PyObject *)(void *)&svcctl_SCSetServiceBitsA_Type);
31872 35 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfigA_Type);
31873 35 : PyModule_AddObject(m, "ChangeServiceConfigA", (PyObject *)(void *)&svcctl_ChangeServiceConfigA_Type);
31874 35 : Py_INCREF((PyObject *)(void *)&svcctl_CreateServiceA_Type);
31875 35 : PyModule_AddObject(m, "CreateServiceA", (PyObject *)(void *)&svcctl_CreateServiceA_Type);
31876 35 : Py_INCREF((PyObject *)(void *)&svcctl_EnumDependentServicesA_Type);
31877 35 : PyModule_AddObject(m, "EnumDependentServicesA", (PyObject *)(void *)&svcctl_EnumDependentServicesA_Type);
31878 35 : Py_INCREF((PyObject *)(void *)&svcctl_EnumServicesStatusA_Type);
31879 35 : PyModule_AddObject(m, "EnumServicesStatusA", (PyObject *)(void *)&svcctl_EnumServicesStatusA_Type);
31880 35 : Py_INCREF((PyObject *)(void *)&svcctl_OpenSCManagerA_Type);
31881 35 : PyModule_AddObject(m, "OpenSCManagerA", (PyObject *)(void *)&svcctl_OpenSCManagerA_Type);
31882 35 : Py_INCREF((PyObject *)(void *)&svcctl_OpenServiceA_Type);
31883 35 : PyModule_AddObject(m, "OpenServiceA", (PyObject *)(void *)&svcctl_OpenServiceA_Type);
31884 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfigA_Type);
31885 35 : PyModule_AddObject(m, "QueryServiceConfigA", (PyObject *)(void *)&svcctl_QueryServiceConfigA_Type);
31886 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceLockStatusA_Type);
31887 35 : PyModule_AddObject(m, "QueryServiceLockStatusA", (PyObject *)(void *)&svcctl_QueryServiceLockStatusA_Type);
31888 35 : Py_INCREF((PyObject *)(void *)&svcctl_StartServiceA_Type);
31889 35 : PyModule_AddObject(m, "StartServiceA", (PyObject *)(void *)&svcctl_StartServiceA_Type);
31890 35 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceDisplayNameA_Type);
31891 35 : PyModule_AddObject(m, "GetServiceDisplayNameA", (PyObject *)(void *)&svcctl_GetServiceDisplayNameA_Type);
31892 35 : Py_INCREF((PyObject *)(void *)&svcctl_GetServiceKeyNameA_Type);
31893 35 : PyModule_AddObject(m, "GetServiceKeyNameA", (PyObject *)(void *)&svcctl_GetServiceKeyNameA_Type);
31894 35 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfig2A_Type);
31895 35 : PyModule_AddObject(m, "ChangeServiceConfig2A", (PyObject *)(void *)&svcctl_ChangeServiceConfig2A_Type);
31896 35 : Py_INCREF((PyObject *)(void *)&svcctl_ChangeServiceConfig2W_Type);
31897 35 : PyModule_AddObject(m, "ChangeServiceConfig2W", (PyObject *)(void *)&svcctl_ChangeServiceConfig2W_Type);
31898 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfig2A_Type);
31899 35 : PyModule_AddObject(m, "QueryServiceConfig2A", (PyObject *)(void *)&svcctl_QueryServiceConfig2A_Type);
31900 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceConfig2W_Type);
31901 35 : PyModule_AddObject(m, "QueryServiceConfig2W", (PyObject *)(void *)&svcctl_QueryServiceConfig2W_Type);
31902 35 : Py_INCREF((PyObject *)(void *)&svcctl_QueryServiceStatusEx_Type);
31903 35 : PyModule_AddObject(m, "QueryServiceStatusEx", (PyObject *)(void *)&svcctl_QueryServiceStatusEx_Type);
31904 35 : Py_INCREF((PyObject *)(void *)&EnumServicesStatusExA_Type);
31905 35 : PyModule_AddObject(m, "EnumServicesStatusExA", (PyObject *)(void *)&EnumServicesStatusExA_Type);
31906 35 : Py_INCREF((PyObject *)(void *)&EnumServicesStatusExW_Type);
31907 35 : PyModule_AddObject(m, "EnumServicesStatusExW", (PyObject *)(void *)&EnumServicesStatusExW_Type);
31908 35 : Py_INCREF((PyObject *)(void *)&svcctl_InterfaceType);
31909 35 : PyModule_AddObject(m, "svcctl", (PyObject *)(void *)&svcctl_InterfaceType);
31910 35 : Py_INCREF((PyObject *)(void *)&svcctl_SyntaxType);
31911 35 : PyModule_AddObject(m, "svcctl_abstract_syntax", (PyObject *)(void *)&svcctl_SyntaxType);
31912 35 : Py_INCREF((PyObject *)(void *)&svcctl_SyntaxType);
31913 35 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&svcctl_SyntaxType);
31914 : #ifdef PY_MOD_SVCCTL_PATCH
31915 : PY_MOD_SVCCTL_PATCH(m);
31916 : #endif
31917 35 : out:
31918 35 : Py_XDECREF(dep_samba_dcerpc_misc);
31919 35 : Py_XDECREF(dep_samba_dcerpc_security);
31920 35 : Py_XDECREF(dep_talloc);
31921 35 : Py_XDECREF(dep_samba_dcerpc_base);
31922 35 : return m;
31923 :
31924 : }
|