s4-smbtorture: simplify test_PrinterInfo_DevMode a bit.
[Samba/nascimento.git] / librpc / gen_ndr / ndr_svcctl.c
blobf4d5a70b4003b8667431f45c1986b9d573df16f1
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_svcctl.h"
6 #include "librpc/gen_ndr/ndr_misc.h"
7 #include "librpc/gen_ndr/ndr_security.h"
8 static enum ndr_err_code ndr_push_SERVICE_LOCK_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_LOCK_STATUS *r)
10 if (ndr_flags & NDR_SCALARS) {
11 NDR_CHECK(ndr_push_align(ndr, 5));
12 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_locked));
13 NDR_CHECK(ndr_push_unique_ptr(ndr, r->lock_owner));
14 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_duration));
15 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
17 if (ndr_flags & NDR_BUFFERS) {
18 if (r->lock_owner) {
19 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16)));
20 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
21 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16)));
22 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lock_owner, ndr_charset_length(r->lock_owner, CH_UTF16), sizeof(uint16_t), CH_UTF16));
25 return NDR_ERR_SUCCESS;
28 static enum ndr_err_code ndr_pull_SERVICE_LOCK_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_LOCK_STATUS *r)
30 uint32_t _ptr_lock_owner;
31 TALLOC_CTX *_mem_save_lock_owner_0;
32 if (ndr_flags & NDR_SCALARS) {
33 NDR_CHECK(ndr_pull_align(ndr, 5));
34 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_locked));
35 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lock_owner));
36 if (_ptr_lock_owner) {
37 NDR_PULL_ALLOC(ndr, r->lock_owner);
38 } else {
39 r->lock_owner = NULL;
41 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_duration));
42 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
44 if (ndr_flags & NDR_BUFFERS) {
45 if (r->lock_owner) {
46 _mem_save_lock_owner_0 = NDR_PULL_GET_MEM_CTX(ndr);
47 NDR_PULL_SET_MEM_CTX(ndr, r->lock_owner, 0);
48 NDR_CHECK(ndr_pull_array_size(ndr, &r->lock_owner));
49 NDR_CHECK(ndr_pull_array_length(ndr, &r->lock_owner));
50 if (ndr_get_array_length(ndr, &r->lock_owner) > ndr_get_array_size(ndr, &r->lock_owner)) {
51 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lock_owner), ndr_get_array_length(ndr, &r->lock_owner));
53 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t)));
54 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lock_owner, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t), CH_UTF16));
55 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_owner_0, 0);
58 return NDR_ERR_SUCCESS;
61 _PUBLIC_ void ndr_print_SERVICE_LOCK_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_LOCK_STATUS *r)
63 ndr_print_struct(ndr, name, "SERVICE_LOCK_STATUS");
64 ndr->depth++;
65 ndr_print_uint32(ndr, "is_locked", r->is_locked);
66 ndr_print_ptr(ndr, "lock_owner", r->lock_owner);
67 ndr->depth++;
68 if (r->lock_owner) {
69 ndr_print_string(ndr, "lock_owner", r->lock_owner);
71 ndr->depth--;
72 ndr_print_uint32(ndr, "lock_duration", r->lock_duration);
73 ndr->depth--;
76 static enum ndr_err_code ndr_push_svcctl_ServiceStatus(struct ndr_push *ndr, int ndr_flags, enum svcctl_ServiceStatus r)
78 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
79 return NDR_ERR_SUCCESS;
82 static enum ndr_err_code ndr_pull_svcctl_ServiceStatus(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ServiceStatus *r)
84 uint32_t v;
85 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
86 *r = v;
87 return NDR_ERR_SUCCESS;
90 _PUBLIC_ void ndr_print_svcctl_ServiceStatus(struct ndr_print *ndr, const char *name, enum svcctl_ServiceStatus r)
92 const char *val = NULL;
94 switch (r) {
95 case SVCCTL_STATE_UNKNOWN: val = "SVCCTL_STATE_UNKNOWN"; break;
96 case SVCCTL_STOPPED: val = "SVCCTL_STOPPED"; break;
97 case SVCCTL_START_PENDING: val = "SVCCTL_START_PENDING"; break;
98 case SVCCTL_STOP_PENDING: val = "SVCCTL_STOP_PENDING"; break;
99 case SVCCTL_RUNNING: val = "SVCCTL_RUNNING"; break;
100 case SVCCTL_CONTINUE_PENDING: val = "SVCCTL_CONTINUE_PENDING"; break;
101 case SVCCTL_PAUSE_PENDING: val = "SVCCTL_PAUSE_PENDING"; break;
102 case SVCCTL_PAUSED: val = "SVCCTL_PAUSED"; break;
104 ndr_print_enum(ndr, name, "ENUM", val, r);
107 static enum ndr_err_code ndr_push_svcctl_ControlsAccepted(struct ndr_push *ndr, int ndr_flags, uint32_t r)
109 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
110 return NDR_ERR_SUCCESS;
113 static enum ndr_err_code ndr_pull_svcctl_ControlsAccepted(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
115 uint32_t v;
116 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
117 *r = v;
118 return NDR_ERR_SUCCESS;
121 _PUBLIC_ void ndr_print_svcctl_ControlsAccepted(struct ndr_print *ndr, const char *name, uint32_t r)
123 ndr_print_uint32(ndr, name, r);
124 ndr->depth++;
125 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_STOP", SVCCTL_ACCEPT_STOP, r);
126 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_PAUSE_CONTINUE", SVCCTL_ACCEPT_PAUSE_CONTINUE, r);
127 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_SHUTDOWN", SVCCTL_ACCEPT_SHUTDOWN, r);
128 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_PARAMCHANGE", SVCCTL_ACCEPT_PARAMCHANGE, r);
129 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_NETBINDCHANGE", SVCCTL_ACCEPT_NETBINDCHANGE, r);
130 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_HARDWAREPROFILECHANGE", SVCCTL_ACCEPT_HARDWAREPROFILECHANGE, r);
131 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_POWEREVENT", SVCCTL_ACCEPT_POWEREVENT, r);
132 ndr->depth--;
135 static enum ndr_err_code ndr_push_SERVICE_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_STATUS *r)
137 if (ndr_flags & NDR_SCALARS) {
138 NDR_CHECK(ndr_push_align(ndr, 4));
139 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->type));
140 NDR_CHECK(ndr_push_svcctl_ServiceStatus(ndr, NDR_SCALARS, r->state));
141 NDR_CHECK(ndr_push_svcctl_ControlsAccepted(ndr, NDR_SCALARS, r->controls_accepted));
142 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->win32_exit_code));
143 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_exit_code));
144 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->check_point));
145 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wait_hint));
146 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
148 if (ndr_flags & NDR_BUFFERS) {
150 return NDR_ERR_SUCCESS;
153 static enum ndr_err_code ndr_pull_SERVICE_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_STATUS *r)
155 if (ndr_flags & NDR_SCALARS) {
156 NDR_CHECK(ndr_pull_align(ndr, 4));
157 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type));
158 NDR_CHECK(ndr_pull_svcctl_ServiceStatus(ndr, NDR_SCALARS, &r->state));
159 NDR_CHECK(ndr_pull_svcctl_ControlsAccepted(ndr, NDR_SCALARS, &r->controls_accepted));
160 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->win32_exit_code));
161 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_exit_code));
162 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->check_point));
163 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wait_hint));
164 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
166 if (ndr_flags & NDR_BUFFERS) {
168 return NDR_ERR_SUCCESS;
171 _PUBLIC_ void ndr_print_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS *r)
173 ndr_print_struct(ndr, name, "SERVICE_STATUS");
174 ndr->depth++;
175 ndr_print_uint32(ndr, "type", r->type);
176 ndr_print_svcctl_ServiceStatus(ndr, "state", r->state);
177 ndr_print_svcctl_ControlsAccepted(ndr, "controls_accepted", r->controls_accepted);
178 ndr_print_WERROR(ndr, "win32_exit_code", r->win32_exit_code);
179 ndr_print_uint32(ndr, "service_exit_code", r->service_exit_code);
180 ndr_print_uint32(ndr, "check_point", r->check_point);
181 ndr_print_uint32(ndr, "wait_hint", r->wait_hint);
182 ndr->depth--;
185 _PUBLIC_ enum ndr_err_code ndr_push_SERVICE_STATUS_PROCESS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_STATUS_PROCESS *r)
187 if (ndr_flags & NDR_SCALARS) {
188 NDR_CHECK(ndr_push_align(ndr, 4));
189 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
190 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->process_id));
191 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_flags));
192 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
194 if (ndr_flags & NDR_BUFFERS) {
196 return NDR_ERR_SUCCESS;
199 _PUBLIC_ enum ndr_err_code ndr_pull_SERVICE_STATUS_PROCESS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_STATUS_PROCESS *r)
201 if (ndr_flags & NDR_SCALARS) {
202 NDR_CHECK(ndr_pull_align(ndr, 4));
203 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
204 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->process_id));
205 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_flags));
206 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
208 if (ndr_flags & NDR_BUFFERS) {
210 return NDR_ERR_SUCCESS;
213 _PUBLIC_ void ndr_print_SERVICE_STATUS_PROCESS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS_PROCESS *r)
215 ndr_print_struct(ndr, name, "SERVICE_STATUS_PROCESS");
216 ndr->depth++;
217 ndr_print_SERVICE_STATUS(ndr, "status", &r->status);
218 ndr_print_uint32(ndr, "process_id", r->process_id);
219 ndr_print_uint32(ndr, "service_flags", r->service_flags);
220 ndr->depth--;
223 _PUBLIC_ enum ndr_err_code ndr_push_ENUM_SERVICE_STATUSW(struct ndr_push *ndr, int ndr_flags, const struct ENUM_SERVICE_STATUSW *r)
225 if (ndr_flags & NDR_SCALARS) {
226 NDR_CHECK(ndr_push_align(ndr, 5));
228 uint32_t _flags_save_string = ndr->flags;
229 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
230 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->service_name));
231 ndr->flags = _flags_save_string;
234 uint32_t _flags_save_string = ndr->flags;
235 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
236 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name));
237 ndr->flags = _flags_save_string;
239 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
240 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
242 if (ndr_flags & NDR_BUFFERS) {
244 uint32_t _flags_save_string = ndr->flags;
245 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
246 if (r->service_name) {
247 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->service_name));
248 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->service_name));
250 ndr->flags = _flags_save_string;
253 uint32_t _flags_save_string = ndr->flags;
254 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
255 if (r->display_name) {
256 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->display_name));
257 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name));
259 ndr->flags = _flags_save_string;
262 return NDR_ERR_SUCCESS;
265 _PUBLIC_ enum ndr_err_code ndr_pull_ENUM_SERVICE_STATUSW(struct ndr_pull *ndr, int ndr_flags, struct ENUM_SERVICE_STATUSW *r)
267 uint32_t _ptr_service_name;
268 TALLOC_CTX *_mem_save_service_name_0;
269 uint32_t _ptr_display_name;
270 TALLOC_CTX *_mem_save_display_name_0;
271 if (ndr_flags & NDR_SCALARS) {
272 NDR_CHECK(ndr_pull_align(ndr, 5));
274 uint32_t _flags_save_string = ndr->flags;
275 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
276 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
277 if (_ptr_service_name) {
278 NDR_PULL_ALLOC(ndr, r->service_name);
279 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->service_name, _ptr_service_name));
280 } else {
281 r->service_name = NULL;
283 ndr->flags = _flags_save_string;
286 uint32_t _flags_save_string = ndr->flags;
287 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
288 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
289 if (_ptr_display_name) {
290 NDR_PULL_ALLOC(ndr, r->display_name);
291 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name));
292 } else {
293 r->display_name = NULL;
295 ndr->flags = _flags_save_string;
297 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
298 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
300 if (ndr_flags & NDR_BUFFERS) {
302 uint32_t _flags_save_string = ndr->flags;
303 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
304 if (r->service_name) {
305 uint32_t _relative_save_offset;
306 _relative_save_offset = ndr->offset;
307 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->service_name));
308 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
309 NDR_PULL_SET_MEM_CTX(ndr, r->service_name, 0);
310 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->service_name));
311 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
312 if (ndr->offset > ndr->relative_highest_offset) {
313 ndr->relative_highest_offset = ndr->offset;
315 ndr->offset = _relative_save_offset;
317 ndr->flags = _flags_save_string;
320 uint32_t _flags_save_string = ndr->flags;
321 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
322 if (r->display_name) {
323 uint32_t _relative_save_offset;
324 _relative_save_offset = ndr->offset;
325 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name));
326 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
327 NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0);
328 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name));
329 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
330 if (ndr->offset > ndr->relative_highest_offset) {
331 ndr->relative_highest_offset = ndr->offset;
333 ndr->offset = _relative_save_offset;
335 ndr->flags = _flags_save_string;
338 return NDR_ERR_SUCCESS;
341 _PUBLIC_ void ndr_print_ENUM_SERVICE_STATUSW(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUSW *r)
343 ndr_print_struct(ndr, name, "ENUM_SERVICE_STATUSW");
344 ndr->depth++;
345 ndr_print_ptr(ndr, "service_name", r->service_name);
346 ndr->depth++;
347 if (r->service_name) {
348 ndr_print_string(ndr, "service_name", r->service_name);
350 ndr->depth--;
351 ndr_print_ptr(ndr, "display_name", r->display_name);
352 ndr->depth++;
353 if (r->display_name) {
354 ndr_print_string(ndr, "display_name", r->display_name);
356 ndr->depth--;
357 ndr_print_SERVICE_STATUS(ndr, "status", &r->status);
358 ndr->depth--;
361 _PUBLIC_ size_t ndr_size_ENUM_SERVICE_STATUSW(const struct ENUM_SERVICE_STATUSW *r, struct smb_iconv_convenience *ic, int flags)
363 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSW, ic);
366 _PUBLIC_ enum ndr_err_code ndr_push_ENUM_SERVICE_STATUSA(struct ndr_push *ndr, int ndr_flags, const struct ENUM_SERVICE_STATUSA *r)
368 if (ndr_flags & NDR_SCALARS) {
369 NDR_CHECK(ndr_push_align(ndr, 5));
371 uint32_t _flags_save_string = ndr->flags;
372 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
373 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->service_name));
374 ndr->flags = _flags_save_string;
377 uint32_t _flags_save_string = ndr->flags;
378 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
379 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name));
380 ndr->flags = _flags_save_string;
382 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
383 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
385 if (ndr_flags & NDR_BUFFERS) {
387 uint32_t _flags_save_string = ndr->flags;
388 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
389 if (r->service_name) {
390 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->service_name));
391 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->service_name));
393 ndr->flags = _flags_save_string;
396 uint32_t _flags_save_string = ndr->flags;
397 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
398 if (r->display_name) {
399 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->display_name));
400 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name));
402 ndr->flags = _flags_save_string;
405 return NDR_ERR_SUCCESS;
408 _PUBLIC_ enum ndr_err_code ndr_pull_ENUM_SERVICE_STATUSA(struct ndr_pull *ndr, int ndr_flags, struct ENUM_SERVICE_STATUSA *r)
410 uint32_t _ptr_service_name;
411 TALLOC_CTX *_mem_save_service_name_0;
412 uint32_t _ptr_display_name;
413 TALLOC_CTX *_mem_save_display_name_0;
414 if (ndr_flags & NDR_SCALARS) {
415 NDR_CHECK(ndr_pull_align(ndr, 5));
417 uint32_t _flags_save_string = ndr->flags;
418 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
419 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
420 if (_ptr_service_name) {
421 NDR_PULL_ALLOC(ndr, r->service_name);
422 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->service_name, _ptr_service_name));
423 } else {
424 r->service_name = NULL;
426 ndr->flags = _flags_save_string;
429 uint32_t _flags_save_string = ndr->flags;
430 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
431 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
432 if (_ptr_display_name) {
433 NDR_PULL_ALLOC(ndr, r->display_name);
434 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name));
435 } else {
436 r->display_name = NULL;
438 ndr->flags = _flags_save_string;
440 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
441 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
443 if (ndr_flags & NDR_BUFFERS) {
445 uint32_t _flags_save_string = ndr->flags;
446 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
447 if (r->service_name) {
448 uint32_t _relative_save_offset;
449 _relative_save_offset = ndr->offset;
450 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->service_name));
451 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
452 NDR_PULL_SET_MEM_CTX(ndr, r->service_name, 0);
453 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->service_name));
454 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
455 if (ndr->offset > ndr->relative_highest_offset) {
456 ndr->relative_highest_offset = ndr->offset;
458 ndr->offset = _relative_save_offset;
460 ndr->flags = _flags_save_string;
463 uint32_t _flags_save_string = ndr->flags;
464 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
465 if (r->display_name) {
466 uint32_t _relative_save_offset;
467 _relative_save_offset = ndr->offset;
468 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name));
469 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
470 NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0);
471 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name));
472 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
473 if (ndr->offset > ndr->relative_highest_offset) {
474 ndr->relative_highest_offset = ndr->offset;
476 ndr->offset = _relative_save_offset;
478 ndr->flags = _flags_save_string;
481 return NDR_ERR_SUCCESS;
484 _PUBLIC_ void ndr_print_ENUM_SERVICE_STATUSA(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUSA *r)
486 ndr_print_struct(ndr, name, "ENUM_SERVICE_STATUSA");
487 ndr->depth++;
488 ndr_print_ptr(ndr, "service_name", r->service_name);
489 ndr->depth++;
490 if (r->service_name) {
491 ndr_print_string(ndr, "service_name", r->service_name);
493 ndr->depth--;
494 ndr_print_ptr(ndr, "display_name", r->display_name);
495 ndr->depth++;
496 if (r->display_name) {
497 ndr_print_string(ndr, "display_name", r->display_name);
499 ndr->depth--;
500 ndr_print_SERVICE_STATUS(ndr, "status", &r->status);
501 ndr->depth--;
504 _PUBLIC_ size_t ndr_size_ENUM_SERVICE_STATUSA(const struct ENUM_SERVICE_STATUSA *r, struct smb_iconv_convenience *ic, int flags)
506 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSA, ic);
509 _PUBLIC_ enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r)
511 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
512 return NDR_ERR_SUCCESS;
515 _PUBLIC_ enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
517 uint32_t v;
518 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
519 *r = v;
520 return NDR_ERR_SUCCESS;
523 _PUBLIC_ void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r)
525 ndr_print_uint32(ndr, name, r);
526 ndr->depth++;
527 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WORKSTATION", SV_TYPE_WORKSTATION, r);
528 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER", SV_TYPE_SERVER, r);
529 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SQLSERVER", SV_TYPE_SQLSERVER, r);
530 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_CTRL", SV_TYPE_DOMAIN_CTRL, r);
531 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_BAKCTRL", SV_TYPE_DOMAIN_BAKCTRL, r);
532 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_TIME_SOURCE", SV_TYPE_TIME_SOURCE, r);
533 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_AFP", SV_TYPE_AFP, r);
534 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NOVELL", SV_TYPE_NOVELL, r);
535 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MEMBER", SV_TYPE_DOMAIN_MEMBER, r);
536 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_PRINTQ_SERVER", SV_TYPE_PRINTQ_SERVER, r);
537 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DIALIN_SERVER", SV_TYPE_DIALIN_SERVER, r);
538 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_UNIX", SV_TYPE_SERVER_UNIX, r);
539 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NT", SV_TYPE_NT, r);
540 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WFW", SV_TYPE_WFW, r);
541 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_MFPN", SV_TYPE_SERVER_MFPN, r);
542 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_NT", SV_TYPE_SERVER_NT, r);
543 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_POTENTIAL_BROWSER", SV_TYPE_POTENTIAL_BROWSER, r);
544 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_BACKUP_BROWSER", SV_TYPE_BACKUP_BROWSER, r);
545 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_MASTER_BROWSER", SV_TYPE_MASTER_BROWSER, r);
546 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MASTER", SV_TYPE_DOMAIN_MASTER, r);
547 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_OSF", SV_TYPE_SERVER_OSF, r);
548 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_VMS", SV_TYPE_SERVER_VMS, r);
549 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WIN95_PLUS", SV_TYPE_WIN95_PLUS, r);
550 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DFS_SERVER", SV_TYPE_DFS_SERVER, r);
551 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_ALTERNATE_XPORT", SV_TYPE_ALTERNATE_XPORT, r);
552 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_LOCAL_LIST_ONLY", SV_TYPE_LOCAL_LIST_ONLY, r);
553 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_ENUM", SV_TYPE_DOMAIN_ENUM, r);
554 ndr->depth--;
557 static enum ndr_err_code ndr_push_SERVICE_CONTROL(struct ndr_push *ndr, int ndr_flags, enum SERVICE_CONTROL r)
559 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
560 return NDR_ERR_SUCCESS;
563 static enum ndr_err_code ndr_pull_SERVICE_CONTROL(struct ndr_pull *ndr, int ndr_flags, enum SERVICE_CONTROL *r)
565 uint32_t v;
566 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
567 *r = v;
568 return NDR_ERR_SUCCESS;
571 _PUBLIC_ void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r)
573 const char *val = NULL;
575 switch (r) {
576 case SVCCTL_CONTROL_STOP: val = "SVCCTL_CONTROL_STOP"; break;
577 case SVCCTL_CONTROL_PAUSE: val = "SVCCTL_CONTROL_PAUSE"; break;
578 case SVCCTL_CONTROL_CONTINUE: val = "SVCCTL_CONTROL_CONTINUE"; break;
579 case SVCCTL_CONTROL_INTERROGATE: val = "SVCCTL_CONTROL_INTERROGATE"; break;
580 case SVCCTL_CONTROL_SHUTDOWN: val = "SVCCTL_CONTROL_SHUTDOWN"; break;
582 ndr_print_enum(ndr, name, "ENUM", val, r);
585 static enum ndr_err_code ndr_push_svcctl_ErrorControl(struct ndr_push *ndr, int ndr_flags, enum svcctl_ErrorControl r)
587 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
588 return NDR_ERR_SUCCESS;
591 static enum ndr_err_code ndr_pull_svcctl_ErrorControl(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ErrorControl *r)
593 uint32_t v;
594 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
595 *r = v;
596 return NDR_ERR_SUCCESS;
599 _PUBLIC_ void ndr_print_svcctl_ErrorControl(struct ndr_print *ndr, const char *name, enum svcctl_ErrorControl r)
601 const char *val = NULL;
603 switch (r) {
604 case SVCCTL_SVC_ERROR_IGNORE: val = "SVCCTL_SVC_ERROR_IGNORE"; break;
605 case SVCCTL_SVC_ERROR_NORMAL: val = "SVCCTL_SVC_ERROR_NORMAL"; break;
606 case SVCCTL_SVC_ERROR_CRITICAL: val = "SVCCTL_SVC_ERROR_CRITICAL"; break;
607 case SVCCTL_SVC_ERROR_SEVERE: val = "SVCCTL_SVC_ERROR_SEVERE"; break;
609 ndr_print_enum(ndr, name, "ENUM", val, r);
612 static enum ndr_err_code ndr_push_svcctl_StartType(struct ndr_push *ndr, int ndr_flags, enum svcctl_StartType r)
614 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
615 return NDR_ERR_SUCCESS;
618 static enum ndr_err_code ndr_pull_svcctl_StartType(struct ndr_pull *ndr, int ndr_flags, enum svcctl_StartType *r)
620 uint32_t v;
621 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
622 *r = v;
623 return NDR_ERR_SUCCESS;
626 _PUBLIC_ void ndr_print_svcctl_StartType(struct ndr_print *ndr, const char *name, enum svcctl_StartType r)
628 const char *val = NULL;
630 switch (r) {
631 case SVCCTL_BOOT_START: val = "SVCCTL_BOOT_START"; break;
632 case SVCCTL_SYSTEM_START: val = "SVCCTL_SYSTEM_START"; break;
633 case SVCCTL_AUTO_START: val = "SVCCTL_AUTO_START"; break;
634 case SVCCTL_DEMAND_START: val = "SVCCTL_DEMAND_START"; break;
635 case SVCCTL_DISABLED: val = "SVCCTL_DISABLED"; break;
637 ndr_print_enum(ndr, name, "ENUM", val, r);
640 static enum ndr_err_code ndr_push_svcctl_ServiceState(struct ndr_push *ndr, int ndr_flags, enum svcctl_ServiceState r)
642 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
643 return NDR_ERR_SUCCESS;
646 static enum ndr_err_code ndr_pull_svcctl_ServiceState(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ServiceState *r)
648 uint32_t v;
649 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
650 *r = v;
651 return NDR_ERR_SUCCESS;
654 _PUBLIC_ void ndr_print_svcctl_ServiceState(struct ndr_print *ndr, const char *name, enum svcctl_ServiceState r)
656 const char *val = NULL;
658 switch (r) {
659 case SERVICE_STATE_ACTIVE: val = "SERVICE_STATE_ACTIVE"; break;
660 case SERVICE_STATE_INACTIVE: val = "SERVICE_STATE_INACTIVE"; break;
661 case SERVICE_STATE_ALL: val = "SERVICE_STATE_ALL"; break;
663 ndr_print_enum(ndr, name, "ENUM", val, r);
666 static enum ndr_err_code ndr_push_svcctl_MgrAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
668 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
669 return NDR_ERR_SUCCESS;
672 static enum ndr_err_code ndr_pull_svcctl_MgrAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
674 uint32_t v;
675 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
676 *r = v;
677 return NDR_ERR_SUCCESS;
680 _PUBLIC_ void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
682 ndr_print_uint32(ndr, name, r);
683 ndr->depth++;
684 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CONNECT", SC_RIGHT_MGR_CONNECT, r);
685 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CREATE_SERVICE", SC_RIGHT_MGR_CREATE_SERVICE, r);
686 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_ENUMERATE_SERVICE", SC_RIGHT_MGR_ENUMERATE_SERVICE, r);
687 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_LOCK", SC_RIGHT_MGR_LOCK, r);
688 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_QUERY_LOCK_STATUS", SC_RIGHT_MGR_QUERY_LOCK_STATUS, r);
689 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_MODIFY_BOOT_CONFIG", SC_RIGHT_MGR_MODIFY_BOOT_CONFIG, r);
690 ndr->depth--;
693 static enum ndr_err_code ndr_push_svcctl_ServiceAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
695 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
696 return NDR_ERR_SUCCESS;
699 static enum ndr_err_code ndr_pull_svcctl_ServiceAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
701 uint32_t v;
702 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
703 *r = v;
704 return NDR_ERR_SUCCESS;
707 _PUBLIC_ void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
709 ndr_print_uint32(ndr, name, r);
710 ndr->depth++;
711 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_CONFIG", SC_RIGHT_SVC_QUERY_CONFIG, r);
712 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_CHANGE_CONFIG", SC_RIGHT_SVC_CHANGE_CONFIG, r);
713 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_STATUS", SC_RIGHT_SVC_QUERY_STATUS, r);
714 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_ENUMERATE_DEPENDENTS", SC_RIGHT_SVC_ENUMERATE_DEPENDENTS, r);
715 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_START", SC_RIGHT_SVC_START, r);
716 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_STOP", SC_RIGHT_SVC_STOP, r);
717 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_PAUSE_CONTINUE", SC_RIGHT_SVC_PAUSE_CONTINUE, r);
718 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_INTERROGATE", SC_RIGHT_SVC_INTERROGATE, r);
719 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_USER_DEFINED_CONTROL", SC_RIGHT_SVC_USER_DEFINED_CONTROL, r);
720 ndr->depth--;
723 _PUBLIC_ enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r)
725 if (ndr_flags & NDR_SCALARS) {
726 NDR_CHECK(ndr_push_align(ndr, 5));
727 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_type));
728 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->start_type));
729 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->error_control));
730 NDR_CHECK(ndr_push_unique_ptr(ndr, r->executablepath));
731 NDR_CHECK(ndr_push_unique_ptr(ndr, r->loadordergroup));
732 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tag_id));
733 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependencies));
734 NDR_CHECK(ndr_push_unique_ptr(ndr, r->startname));
735 NDR_CHECK(ndr_push_unique_ptr(ndr, r->displayname));
736 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
738 if (ndr_flags & NDR_BUFFERS) {
739 if (r->executablepath) {
740 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16)));
741 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
742 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16)));
743 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->executablepath, ndr_charset_length(r->executablepath, CH_UTF16), sizeof(uint16_t), CH_UTF16));
745 if (r->loadordergroup) {
746 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16)));
747 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
748 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16)));
749 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->loadordergroup, ndr_charset_length(r->loadordergroup, CH_UTF16), sizeof(uint16_t), CH_UTF16));
751 if (r->dependencies) {
752 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16)));
753 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
754 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16)));
755 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dependencies, ndr_charset_length(r->dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16));
757 if (r->startname) {
758 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16)));
759 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
760 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16)));
761 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->startname, ndr_charset_length(r->startname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
763 if (r->displayname) {
764 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16)));
765 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
766 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16)));
767 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->displayname, ndr_charset_length(r->displayname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
770 return NDR_ERR_SUCCESS;
773 _PUBLIC_ enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r)
775 uint32_t _ptr_executablepath;
776 TALLOC_CTX *_mem_save_executablepath_0;
777 uint32_t _ptr_loadordergroup;
778 TALLOC_CTX *_mem_save_loadordergroup_0;
779 uint32_t _ptr_dependencies;
780 TALLOC_CTX *_mem_save_dependencies_0;
781 uint32_t _ptr_startname;
782 TALLOC_CTX *_mem_save_startname_0;
783 uint32_t _ptr_displayname;
784 TALLOC_CTX *_mem_save_displayname_0;
785 if (ndr_flags & NDR_SCALARS) {
786 NDR_CHECK(ndr_pull_align(ndr, 5));
787 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_type));
788 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->start_type));
789 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->error_control));
790 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_executablepath));
791 if (_ptr_executablepath) {
792 NDR_PULL_ALLOC(ndr, r->executablepath);
793 } else {
794 r->executablepath = NULL;
796 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_loadordergroup));
797 if (_ptr_loadordergroup) {
798 NDR_PULL_ALLOC(ndr, r->loadordergroup);
799 } else {
800 r->loadordergroup = NULL;
802 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tag_id));
803 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
804 if (_ptr_dependencies) {
805 NDR_PULL_ALLOC(ndr, r->dependencies);
806 } else {
807 r->dependencies = NULL;
809 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_startname));
810 if (_ptr_startname) {
811 NDR_PULL_ALLOC(ndr, r->startname);
812 } else {
813 r->startname = NULL;
815 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_displayname));
816 if (_ptr_displayname) {
817 NDR_PULL_ALLOC(ndr, r->displayname);
818 } else {
819 r->displayname = NULL;
821 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
823 if (ndr_flags & NDR_BUFFERS) {
824 if (r->executablepath) {
825 _mem_save_executablepath_0 = NDR_PULL_GET_MEM_CTX(ndr);
826 NDR_PULL_SET_MEM_CTX(ndr, r->executablepath, 0);
827 NDR_CHECK(ndr_pull_array_size(ndr, &r->executablepath));
828 NDR_CHECK(ndr_pull_array_length(ndr, &r->executablepath));
829 if (ndr_get_array_length(ndr, &r->executablepath) > ndr_get_array_size(ndr, &r->executablepath)) {
830 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->executablepath), ndr_get_array_length(ndr, &r->executablepath));
832 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t)));
833 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->executablepath, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t), CH_UTF16));
834 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_executablepath_0, 0);
836 if (r->loadordergroup) {
837 _mem_save_loadordergroup_0 = NDR_PULL_GET_MEM_CTX(ndr);
838 NDR_PULL_SET_MEM_CTX(ndr, r->loadordergroup, 0);
839 NDR_CHECK(ndr_pull_array_size(ndr, &r->loadordergroup));
840 NDR_CHECK(ndr_pull_array_length(ndr, &r->loadordergroup));
841 if (ndr_get_array_length(ndr, &r->loadordergroup) > ndr_get_array_size(ndr, &r->loadordergroup)) {
842 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->loadordergroup), ndr_get_array_length(ndr, &r->loadordergroup));
844 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t)));
845 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->loadordergroup, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t), CH_UTF16));
846 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_loadordergroup_0, 0);
848 if (r->dependencies) {
849 _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
850 NDR_PULL_SET_MEM_CTX(ndr, r->dependencies, 0);
851 NDR_CHECK(ndr_pull_array_size(ndr, &r->dependencies));
852 NDR_CHECK(ndr_pull_array_length(ndr, &r->dependencies));
853 if (ndr_get_array_length(ndr, &r->dependencies) > ndr_get_array_size(ndr, &r->dependencies)) {
854 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dependencies), ndr_get_array_length(ndr, &r->dependencies));
856 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t)));
857 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dependencies, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t), CH_UTF16));
858 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
860 if (r->startname) {
861 _mem_save_startname_0 = NDR_PULL_GET_MEM_CTX(ndr);
862 NDR_PULL_SET_MEM_CTX(ndr, r->startname, 0);
863 NDR_CHECK(ndr_pull_array_size(ndr, &r->startname));
864 NDR_CHECK(ndr_pull_array_length(ndr, &r->startname));
865 if (ndr_get_array_length(ndr, &r->startname) > ndr_get_array_size(ndr, &r->startname)) {
866 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->startname), ndr_get_array_length(ndr, &r->startname));
868 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t)));
869 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->startname, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t), CH_UTF16));
870 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_startname_0, 0);
872 if (r->displayname) {
873 _mem_save_displayname_0 = NDR_PULL_GET_MEM_CTX(ndr);
874 NDR_PULL_SET_MEM_CTX(ndr, r->displayname, 0);
875 NDR_CHECK(ndr_pull_array_size(ndr, &r->displayname));
876 NDR_CHECK(ndr_pull_array_length(ndr, &r->displayname));
877 if (ndr_get_array_length(ndr, &r->displayname) > ndr_get_array_size(ndr, &r->displayname)) {
878 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->displayname), ndr_get_array_length(ndr, &r->displayname));
880 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t)));
881 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->displayname, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t), CH_UTF16));
882 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_displayname_0, 0);
885 return NDR_ERR_SUCCESS;
888 _PUBLIC_ void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r)
890 ndr_print_struct(ndr, name, "QUERY_SERVICE_CONFIG");
891 ndr->depth++;
892 ndr_print_uint32(ndr, "service_type", r->service_type);
893 ndr_print_svcctl_StartType(ndr, "start_type", r->start_type);
894 ndr_print_svcctl_ErrorControl(ndr, "error_control", r->error_control);
895 ndr_print_ptr(ndr, "executablepath", r->executablepath);
896 ndr->depth++;
897 if (r->executablepath) {
898 ndr_print_string(ndr, "executablepath", r->executablepath);
900 ndr->depth--;
901 ndr_print_ptr(ndr, "loadordergroup", r->loadordergroup);
902 ndr->depth++;
903 if (r->loadordergroup) {
904 ndr_print_string(ndr, "loadordergroup", r->loadordergroup);
906 ndr->depth--;
907 ndr_print_uint32(ndr, "tag_id", r->tag_id);
908 ndr_print_ptr(ndr, "dependencies", r->dependencies);
909 ndr->depth++;
910 if (r->dependencies) {
911 ndr_print_string(ndr, "dependencies", r->dependencies);
913 ndr->depth--;
914 ndr_print_ptr(ndr, "startname", r->startname);
915 ndr->depth++;
916 if (r->startname) {
917 ndr_print_string(ndr, "startname", r->startname);
919 ndr->depth--;
920 ndr_print_ptr(ndr, "displayname", r->displayname);
921 ndr->depth++;
922 if (r->displayname) {
923 ndr_print_string(ndr, "displayname", r->displayname);
925 ndr->depth--;
926 ndr->depth--;
929 _PUBLIC_ size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, struct smb_iconv_convenience *ic, int flags)
931 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG, ic);
934 static enum ndr_err_code ndr_push_svcctl_ArgumentString(struct ndr_push *ndr, int ndr_flags, const struct svcctl_ArgumentString *r)
936 if (ndr_flags & NDR_SCALARS) {
937 NDR_CHECK(ndr_push_align(ndr, 5));
938 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string));
939 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
941 if (ndr_flags & NDR_BUFFERS) {
942 if (r->string) {
943 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->string, CH_UTF16)));
944 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
945 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->string, CH_UTF16)));
946 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, ndr_charset_length(r->string, CH_UTF16), sizeof(uint16_t), CH_UTF16));
949 return NDR_ERR_SUCCESS;
952 static enum ndr_err_code ndr_pull_svcctl_ArgumentString(struct ndr_pull *ndr, int ndr_flags, struct svcctl_ArgumentString *r)
954 uint32_t _ptr_string;
955 TALLOC_CTX *_mem_save_string_0;
956 if (ndr_flags & NDR_SCALARS) {
957 NDR_CHECK(ndr_pull_align(ndr, 5));
958 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string));
959 if (_ptr_string) {
960 NDR_PULL_ALLOC(ndr, r->string);
961 } else {
962 r->string = NULL;
964 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
966 if (ndr_flags & NDR_BUFFERS) {
967 if (r->string) {
968 _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr);
969 NDR_PULL_SET_MEM_CTX(ndr, r->string, 0);
970 NDR_CHECK(ndr_pull_array_size(ndr, &r->string));
971 NDR_CHECK(ndr_pull_array_length(ndr, &r->string));
972 if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) {
973 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string));
975 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t)));
976 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t), CH_UTF16));
977 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0);
980 return NDR_ERR_SUCCESS;
983 _PUBLIC_ void ndr_print_svcctl_ArgumentString(struct ndr_print *ndr, const char *name, const struct svcctl_ArgumentString *r)
985 ndr_print_struct(ndr, name, "svcctl_ArgumentString");
986 ndr->depth++;
987 ndr_print_ptr(ndr, "string", r->string);
988 ndr->depth++;
989 if (r->string) {
990 ndr_print_string(ndr, "string", r->string);
992 ndr->depth--;
993 ndr->depth--;
996 static enum ndr_err_code ndr_push_svcctl_ConfigLevel(struct ndr_push *ndr, int ndr_flags, enum svcctl_ConfigLevel r)
998 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
999 return NDR_ERR_SUCCESS;
1002 static enum ndr_err_code ndr_pull_svcctl_ConfigLevel(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ConfigLevel *r)
1004 uint32_t v;
1005 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
1006 *r = v;
1007 return NDR_ERR_SUCCESS;
1010 _PUBLIC_ void ndr_print_svcctl_ConfigLevel(struct ndr_print *ndr, const char *name, enum svcctl_ConfigLevel r)
1012 const char *val = NULL;
1014 switch (r) {
1015 case SERVICE_CONFIG_DESCRIPTION: val = "SERVICE_CONFIG_DESCRIPTION"; break;
1016 case SERVICE_CONFIG_FAILURE_ACTIONS: val = "SERVICE_CONFIG_FAILURE_ACTIONS"; break;
1018 ndr_print_enum(ndr, name, "ENUM", val, r);
1021 _PUBLIC_ enum ndr_err_code ndr_push_SERVICE_DESCRIPTION(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_DESCRIPTION *r)
1023 if (ndr_flags & NDR_SCALARS) {
1024 NDR_CHECK(ndr_push_align(ndr, 5));
1026 uint32_t _flags_save_string = ndr->flags;
1027 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1028 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->description));
1029 ndr->flags = _flags_save_string;
1031 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1033 if (ndr_flags & NDR_BUFFERS) {
1035 uint32_t _flags_save_string = ndr->flags;
1036 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1037 if (r->description) {
1038 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->description));
1039 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->description));
1041 ndr->flags = _flags_save_string;
1044 return NDR_ERR_SUCCESS;
1047 _PUBLIC_ enum ndr_err_code ndr_pull_SERVICE_DESCRIPTION(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_DESCRIPTION *r)
1049 uint32_t _ptr_description;
1050 TALLOC_CTX *_mem_save_description_0;
1051 if (ndr_flags & NDR_SCALARS) {
1052 NDR_CHECK(ndr_pull_align(ndr, 5));
1054 uint32_t _flags_save_string = ndr->flags;
1055 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1056 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_description));
1057 if (_ptr_description) {
1058 NDR_PULL_ALLOC(ndr, r->description);
1059 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->description, _ptr_description));
1060 } else {
1061 r->description = NULL;
1063 ndr->flags = _flags_save_string;
1065 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1067 if (ndr_flags & NDR_BUFFERS) {
1069 uint32_t _flags_save_string = ndr->flags;
1070 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1071 if (r->description) {
1072 uint32_t _relative_save_offset;
1073 _relative_save_offset = ndr->offset;
1074 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->description));
1075 _mem_save_description_0 = NDR_PULL_GET_MEM_CTX(ndr);
1076 NDR_PULL_SET_MEM_CTX(ndr, r->description, 0);
1077 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->description));
1078 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_description_0, 0);
1079 if (ndr->offset > ndr->relative_highest_offset) {
1080 ndr->relative_highest_offset = ndr->offset;
1082 ndr->offset = _relative_save_offset;
1084 ndr->flags = _flags_save_string;
1087 return NDR_ERR_SUCCESS;
1090 _PUBLIC_ void ndr_print_SERVICE_DESCRIPTION(struct ndr_print *ndr, const char *name, const struct SERVICE_DESCRIPTION *r)
1092 ndr_print_struct(ndr, name, "SERVICE_DESCRIPTION");
1093 ndr->depth++;
1094 ndr_print_ptr(ndr, "description", r->description);
1095 ndr->depth++;
1096 if (r->description) {
1097 ndr_print_string(ndr, "description", r->description);
1099 ndr->depth--;
1100 ndr->depth--;
1103 _PUBLIC_ size_t ndr_size_SERVICE_DESCRIPTION(const struct SERVICE_DESCRIPTION *r, struct smb_iconv_convenience *ic, int flags)
1105 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_SERVICE_DESCRIPTION, ic);
1108 static enum ndr_err_code ndr_push_SC_ACTION_TYPE(struct ndr_push *ndr, int ndr_flags, enum SC_ACTION_TYPE r)
1110 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
1111 return NDR_ERR_SUCCESS;
1114 static enum ndr_err_code ndr_pull_SC_ACTION_TYPE(struct ndr_pull *ndr, int ndr_flags, enum SC_ACTION_TYPE *r)
1116 uint32_t v;
1117 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
1118 *r = v;
1119 return NDR_ERR_SUCCESS;
1122 _PUBLIC_ void ndr_print_SC_ACTION_TYPE(struct ndr_print *ndr, const char *name, enum SC_ACTION_TYPE r)
1124 const char *val = NULL;
1126 switch (r) {
1127 case SC_ACTION_NONE: val = "SC_ACTION_NONE"; break;
1128 case SC_ACTION_RESTART: val = "SC_ACTION_RESTART"; break;
1129 case SC_ACTION_REBOOT: val = "SC_ACTION_REBOOT"; break;
1130 case SC_ACTION_RUN_COMMAND: val = "SC_ACTION_RUN_COMMAND"; break;
1132 ndr_print_enum(ndr, name, "ENUM", val, r);
1135 static enum ndr_err_code ndr_push_SC_ACTION(struct ndr_push *ndr, int ndr_flags, const struct SC_ACTION *r)
1137 if (ndr_flags & NDR_SCALARS) {
1138 NDR_CHECK(ndr_push_align(ndr, 4));
1139 NDR_CHECK(ndr_push_SC_ACTION_TYPE(ndr, NDR_SCALARS, r->type));
1140 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->delay));
1141 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1143 if (ndr_flags & NDR_BUFFERS) {
1145 return NDR_ERR_SUCCESS;
1148 static enum ndr_err_code ndr_pull_SC_ACTION(struct ndr_pull *ndr, int ndr_flags, struct SC_ACTION *r)
1150 if (ndr_flags & NDR_SCALARS) {
1151 NDR_CHECK(ndr_pull_align(ndr, 4));
1152 NDR_CHECK(ndr_pull_SC_ACTION_TYPE(ndr, NDR_SCALARS, &r->type));
1153 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->delay));
1154 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1156 if (ndr_flags & NDR_BUFFERS) {
1158 return NDR_ERR_SUCCESS;
1161 _PUBLIC_ void ndr_print_SC_ACTION(struct ndr_print *ndr, const char *name, const struct SC_ACTION *r)
1163 ndr_print_struct(ndr, name, "SC_ACTION");
1164 ndr->depth++;
1165 ndr_print_SC_ACTION_TYPE(ndr, "type", r->type);
1166 ndr_print_uint32(ndr, "delay", r->delay);
1167 ndr->depth--;
1170 _PUBLIC_ enum ndr_err_code ndr_push_SERVICE_FAILURE_ACTIONS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_FAILURE_ACTIONS *r)
1172 uint32_t cntr_actions_1;
1173 if (ndr_flags & NDR_SCALARS) {
1174 NDR_CHECK(ndr_push_align(ndr, 5));
1175 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reset_period));
1177 uint32_t _flags_save_string = ndr->flags;
1178 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1179 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->rebootmsg));
1180 ndr->flags = _flags_save_string;
1183 uint32_t _flags_save_string = ndr->flags;
1184 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1185 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->command));
1186 ndr->flags = _flags_save_string;
1188 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_actions));
1189 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->actions));
1190 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1192 if (ndr_flags & NDR_BUFFERS) {
1194 uint32_t _flags_save_string = ndr->flags;
1195 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1196 if (r->rebootmsg) {
1197 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->rebootmsg));
1198 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->rebootmsg));
1200 ndr->flags = _flags_save_string;
1203 uint32_t _flags_save_string = ndr->flags;
1204 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1205 if (r->command) {
1206 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->command));
1207 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->command));
1209 ndr->flags = _flags_save_string;
1211 if (r->actions) {
1212 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->actions));
1213 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_actions));
1214 for (cntr_actions_1 = 0; cntr_actions_1 < r->num_actions; cntr_actions_1++) {
1215 NDR_CHECK(ndr_push_SC_ACTION(ndr, NDR_SCALARS, &r->actions[cntr_actions_1]));
1219 return NDR_ERR_SUCCESS;
1222 _PUBLIC_ enum ndr_err_code ndr_pull_SERVICE_FAILURE_ACTIONS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_FAILURE_ACTIONS *r)
1224 uint32_t _ptr_rebootmsg;
1225 TALLOC_CTX *_mem_save_rebootmsg_0;
1226 uint32_t _ptr_command;
1227 TALLOC_CTX *_mem_save_command_0;
1228 uint32_t _ptr_actions;
1229 uint32_t cntr_actions_1;
1230 TALLOC_CTX *_mem_save_actions_0;
1231 TALLOC_CTX *_mem_save_actions_1;
1232 if (ndr_flags & NDR_SCALARS) {
1233 NDR_CHECK(ndr_pull_align(ndr, 5));
1234 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reset_period));
1236 uint32_t _flags_save_string = ndr->flags;
1237 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1238 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rebootmsg));
1239 if (_ptr_rebootmsg) {
1240 NDR_PULL_ALLOC(ndr, r->rebootmsg);
1241 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->rebootmsg, _ptr_rebootmsg));
1242 } else {
1243 r->rebootmsg = NULL;
1245 ndr->flags = _flags_save_string;
1248 uint32_t _flags_save_string = ndr->flags;
1249 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1250 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_command));
1251 if (_ptr_command) {
1252 NDR_PULL_ALLOC(ndr, r->command);
1253 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->command, _ptr_command));
1254 } else {
1255 r->command = NULL;
1257 ndr->flags = _flags_save_string;
1259 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_actions));
1260 if (r->num_actions > 1024) {
1261 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1263 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_actions));
1264 if (_ptr_actions) {
1265 NDR_PULL_ALLOC(ndr, r->actions);
1266 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->actions, _ptr_actions));
1267 } else {
1268 r->actions = NULL;
1270 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1272 if (ndr_flags & NDR_BUFFERS) {
1274 uint32_t _flags_save_string = ndr->flags;
1275 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1276 if (r->rebootmsg) {
1277 uint32_t _relative_save_offset;
1278 _relative_save_offset = ndr->offset;
1279 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->rebootmsg));
1280 _mem_save_rebootmsg_0 = NDR_PULL_GET_MEM_CTX(ndr);
1281 NDR_PULL_SET_MEM_CTX(ndr, r->rebootmsg, 0);
1282 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->rebootmsg));
1283 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rebootmsg_0, 0);
1284 if (ndr->offset > ndr->relative_highest_offset) {
1285 ndr->relative_highest_offset = ndr->offset;
1287 ndr->offset = _relative_save_offset;
1289 ndr->flags = _flags_save_string;
1292 uint32_t _flags_save_string = ndr->flags;
1293 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1294 if (r->command) {
1295 uint32_t _relative_save_offset;
1296 _relative_save_offset = ndr->offset;
1297 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->command));
1298 _mem_save_command_0 = NDR_PULL_GET_MEM_CTX(ndr);
1299 NDR_PULL_SET_MEM_CTX(ndr, r->command, 0);
1300 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->command));
1301 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_command_0, 0);
1302 if (ndr->offset > ndr->relative_highest_offset) {
1303 ndr->relative_highest_offset = ndr->offset;
1305 ndr->offset = _relative_save_offset;
1307 ndr->flags = _flags_save_string;
1309 if (r->actions) {
1310 uint32_t _relative_save_offset;
1311 _relative_save_offset = ndr->offset;
1312 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->actions));
1313 _mem_save_actions_0 = NDR_PULL_GET_MEM_CTX(ndr);
1314 NDR_PULL_SET_MEM_CTX(ndr, r->actions, 0);
1315 NDR_CHECK(ndr_pull_array_size(ndr, &r->actions));
1316 NDR_PULL_ALLOC_N(ndr, r->actions, ndr_get_array_size(ndr, &r->actions));
1317 _mem_save_actions_1 = NDR_PULL_GET_MEM_CTX(ndr);
1318 NDR_PULL_SET_MEM_CTX(ndr, r->actions, 0);
1319 for (cntr_actions_1 = 0; cntr_actions_1 < r->num_actions; cntr_actions_1++) {
1320 NDR_CHECK(ndr_pull_SC_ACTION(ndr, NDR_SCALARS, &r->actions[cntr_actions_1]));
1322 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_actions_1, 0);
1323 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_actions_0, 0);
1324 if (ndr->offset > ndr->relative_highest_offset) {
1325 ndr->relative_highest_offset = ndr->offset;
1327 ndr->offset = _relative_save_offset;
1329 if (r->actions) {
1330 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->actions, r->num_actions));
1333 return NDR_ERR_SUCCESS;
1336 _PUBLIC_ void ndr_print_SERVICE_FAILURE_ACTIONS(struct ndr_print *ndr, const char *name, const struct SERVICE_FAILURE_ACTIONS *r)
1338 uint32_t cntr_actions_1;
1339 ndr_print_struct(ndr, name, "SERVICE_FAILURE_ACTIONS");
1340 ndr->depth++;
1341 ndr_print_uint32(ndr, "reset_period", r->reset_period);
1342 ndr_print_ptr(ndr, "rebootmsg", r->rebootmsg);
1343 ndr->depth++;
1344 if (r->rebootmsg) {
1345 ndr_print_string(ndr, "rebootmsg", r->rebootmsg);
1347 ndr->depth--;
1348 ndr_print_ptr(ndr, "command", r->command);
1349 ndr->depth++;
1350 if (r->command) {
1351 ndr_print_string(ndr, "command", r->command);
1353 ndr->depth--;
1354 ndr_print_uint32(ndr, "num_actions", r->num_actions);
1355 ndr_print_ptr(ndr, "actions", r->actions);
1356 ndr->depth++;
1357 if (r->actions) {
1358 ndr->print(ndr, "%s: ARRAY(%d)", "actions", (int)r->num_actions);
1359 ndr->depth++;
1360 for (cntr_actions_1=0;cntr_actions_1<r->num_actions;cntr_actions_1++) {
1361 char *idx_1=NULL;
1362 if (asprintf(&idx_1, "[%d]", cntr_actions_1) != -1) {
1363 ndr_print_SC_ACTION(ndr, "actions", &r->actions[cntr_actions_1]);
1364 free(idx_1);
1367 ndr->depth--;
1369 ndr->depth--;
1370 ndr->depth--;
1373 _PUBLIC_ size_t ndr_size_SERVICE_FAILURE_ACTIONS(const struct SERVICE_FAILURE_ACTIONS *r, struct smb_iconv_convenience *ic, int flags)
1375 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_SERVICE_FAILURE_ACTIONS, ic);
1378 static enum ndr_err_code ndr_push_svcctl_StatusLevel(struct ndr_push *ndr, int ndr_flags, enum svcctl_StatusLevel r)
1380 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
1381 return NDR_ERR_SUCCESS;
1384 static enum ndr_err_code ndr_pull_svcctl_StatusLevel(struct ndr_pull *ndr, int ndr_flags, enum svcctl_StatusLevel *r)
1386 uint32_t v;
1387 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
1388 *r = v;
1389 return NDR_ERR_SUCCESS;
1392 _PUBLIC_ void ndr_print_svcctl_StatusLevel(struct ndr_print *ndr, const char *name, enum svcctl_StatusLevel r)
1394 const char *val = NULL;
1396 switch (r) {
1397 case SVC_STATUS_PROCESS_INFO: val = "SVC_STATUS_PROCESS_INFO"; break;
1399 ndr_print_enum(ndr, name, "ENUM", val, r);
1402 static enum ndr_err_code ndr_push_svcctl_CloseServiceHandle(struct ndr_push *ndr, int flags, const struct svcctl_CloseServiceHandle *r)
1404 if (flags & NDR_IN) {
1405 if (r->in.handle == NULL) {
1406 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1408 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1410 if (flags & NDR_OUT) {
1411 if (r->out.handle == NULL) {
1412 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1414 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
1415 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1417 return NDR_ERR_SUCCESS;
1420 static enum ndr_err_code ndr_pull_svcctl_CloseServiceHandle(struct ndr_pull *ndr, int flags, struct svcctl_CloseServiceHandle *r)
1422 TALLOC_CTX *_mem_save_handle_0;
1423 if (flags & NDR_IN) {
1424 ZERO_STRUCT(r->out);
1426 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1427 NDR_PULL_ALLOC(ndr, r->in.handle);
1429 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1430 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1431 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1432 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1433 NDR_PULL_ALLOC(ndr, r->out.handle);
1434 *r->out.handle = *r->in.handle;
1436 if (flags & NDR_OUT) {
1437 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1438 NDR_PULL_ALLOC(ndr, r->out.handle);
1440 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1441 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
1442 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
1443 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1444 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1446 return NDR_ERR_SUCCESS;
1449 _PUBLIC_ void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r)
1451 ndr_print_struct(ndr, name, "svcctl_CloseServiceHandle");
1452 ndr->depth++;
1453 if (flags & NDR_SET_VALUES) {
1454 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1456 if (flags & NDR_IN) {
1457 ndr_print_struct(ndr, "in", "svcctl_CloseServiceHandle");
1458 ndr->depth++;
1459 ndr_print_ptr(ndr, "handle", r->in.handle);
1460 ndr->depth++;
1461 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1462 ndr->depth--;
1463 ndr->depth--;
1465 if (flags & NDR_OUT) {
1466 ndr_print_struct(ndr, "out", "svcctl_CloseServiceHandle");
1467 ndr->depth++;
1468 ndr_print_ptr(ndr, "handle", r->out.handle);
1469 ndr->depth++;
1470 ndr_print_policy_handle(ndr, "handle", r->out.handle);
1471 ndr->depth--;
1472 ndr_print_WERROR(ndr, "result", r->out.result);
1473 ndr->depth--;
1475 ndr->depth--;
1478 static enum ndr_err_code ndr_push_svcctl_ControlService(struct ndr_push *ndr, int flags, const struct svcctl_ControlService *r)
1480 if (flags & NDR_IN) {
1481 if (r->in.handle == NULL) {
1482 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1484 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1485 NDR_CHECK(ndr_push_SERVICE_CONTROL(ndr, NDR_SCALARS, r->in.control));
1487 if (flags & NDR_OUT) {
1488 if (r->out.service_status == NULL) {
1489 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1491 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1492 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1494 return NDR_ERR_SUCCESS;
1497 static enum ndr_err_code ndr_pull_svcctl_ControlService(struct ndr_pull *ndr, int flags, struct svcctl_ControlService *r)
1499 TALLOC_CTX *_mem_save_handle_0;
1500 TALLOC_CTX *_mem_save_service_status_0;
1501 if (flags & NDR_IN) {
1502 ZERO_STRUCT(r->out);
1504 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1505 NDR_PULL_ALLOC(ndr, r->in.handle);
1507 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1508 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1509 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1510 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1511 NDR_CHECK(ndr_pull_SERVICE_CONTROL(ndr, NDR_SCALARS, &r->in.control));
1512 NDR_PULL_ALLOC(ndr, r->out.service_status);
1513 ZERO_STRUCTP(r->out.service_status);
1515 if (flags & NDR_OUT) {
1516 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1517 NDR_PULL_ALLOC(ndr, r->out.service_status);
1519 _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
1520 NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC);
1521 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1522 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC);
1523 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1525 return NDR_ERR_SUCCESS;
1528 _PUBLIC_ void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r)
1530 ndr_print_struct(ndr, name, "svcctl_ControlService");
1531 ndr->depth++;
1532 if (flags & NDR_SET_VALUES) {
1533 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1535 if (flags & NDR_IN) {
1536 ndr_print_struct(ndr, "in", "svcctl_ControlService");
1537 ndr->depth++;
1538 ndr_print_ptr(ndr, "handle", r->in.handle);
1539 ndr->depth++;
1540 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1541 ndr->depth--;
1542 ndr_print_SERVICE_CONTROL(ndr, "control", r->in.control);
1543 ndr->depth--;
1545 if (flags & NDR_OUT) {
1546 ndr_print_struct(ndr, "out", "svcctl_ControlService");
1547 ndr->depth++;
1548 ndr_print_ptr(ndr, "service_status", r->out.service_status);
1549 ndr->depth++;
1550 ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status);
1551 ndr->depth--;
1552 ndr_print_WERROR(ndr, "result", r->out.result);
1553 ndr->depth--;
1555 ndr->depth--;
1558 static enum ndr_err_code ndr_push_svcctl_DeleteService(struct ndr_push *ndr, int flags, const struct svcctl_DeleteService *r)
1560 if (flags & NDR_IN) {
1561 if (r->in.handle == NULL) {
1562 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1564 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1566 if (flags & NDR_OUT) {
1567 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1569 return NDR_ERR_SUCCESS;
1572 static enum ndr_err_code ndr_pull_svcctl_DeleteService(struct ndr_pull *ndr, int flags, struct svcctl_DeleteService *r)
1574 TALLOC_CTX *_mem_save_handle_0;
1575 if (flags & NDR_IN) {
1576 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1577 NDR_PULL_ALLOC(ndr, r->in.handle);
1579 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1580 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1581 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1582 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1584 if (flags & NDR_OUT) {
1585 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1587 return NDR_ERR_SUCCESS;
1590 _PUBLIC_ void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r)
1592 ndr_print_struct(ndr, name, "svcctl_DeleteService");
1593 ndr->depth++;
1594 if (flags & NDR_SET_VALUES) {
1595 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1597 if (flags & NDR_IN) {
1598 ndr_print_struct(ndr, "in", "svcctl_DeleteService");
1599 ndr->depth++;
1600 ndr_print_ptr(ndr, "handle", r->in.handle);
1601 ndr->depth++;
1602 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1603 ndr->depth--;
1604 ndr->depth--;
1606 if (flags & NDR_OUT) {
1607 ndr_print_struct(ndr, "out", "svcctl_DeleteService");
1608 ndr->depth++;
1609 ndr_print_WERROR(ndr, "result", r->out.result);
1610 ndr->depth--;
1612 ndr->depth--;
1615 static enum ndr_err_code ndr_push_svcctl_LockServiceDatabase(struct ndr_push *ndr, int flags, const struct svcctl_LockServiceDatabase *r)
1617 if (flags & NDR_IN) {
1618 if (r->in.handle == NULL) {
1619 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1621 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1623 if (flags & NDR_OUT) {
1624 if (r->out.lock == NULL) {
1625 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1627 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.lock));
1628 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1630 return NDR_ERR_SUCCESS;
1633 static enum ndr_err_code ndr_pull_svcctl_LockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_LockServiceDatabase *r)
1635 TALLOC_CTX *_mem_save_handle_0;
1636 TALLOC_CTX *_mem_save_lock_0;
1637 if (flags & NDR_IN) {
1638 ZERO_STRUCT(r->out);
1640 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1641 NDR_PULL_ALLOC(ndr, r->in.handle);
1643 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1644 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1645 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1646 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1647 NDR_PULL_ALLOC(ndr, r->out.lock);
1648 ZERO_STRUCTP(r->out.lock);
1650 if (flags & NDR_OUT) {
1651 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1652 NDR_PULL_ALLOC(ndr, r->out.lock);
1654 _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr);
1655 NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC);
1656 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock));
1657 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC);
1658 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1660 return NDR_ERR_SUCCESS;
1663 _PUBLIC_ void ndr_print_svcctl_LockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_LockServiceDatabase *r)
1665 ndr_print_struct(ndr, name, "svcctl_LockServiceDatabase");
1666 ndr->depth++;
1667 if (flags & NDR_SET_VALUES) {
1668 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1670 if (flags & NDR_IN) {
1671 ndr_print_struct(ndr, "in", "svcctl_LockServiceDatabase");
1672 ndr->depth++;
1673 ndr_print_ptr(ndr, "handle", r->in.handle);
1674 ndr->depth++;
1675 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1676 ndr->depth--;
1677 ndr->depth--;
1679 if (flags & NDR_OUT) {
1680 ndr_print_struct(ndr, "out", "svcctl_LockServiceDatabase");
1681 ndr->depth++;
1682 ndr_print_ptr(ndr, "lock", r->out.lock);
1683 ndr->depth++;
1684 ndr_print_policy_handle(ndr, "lock", r->out.lock);
1685 ndr->depth--;
1686 ndr_print_WERROR(ndr, "result", r->out.result);
1687 ndr->depth--;
1689 ndr->depth--;
1692 static enum ndr_err_code ndr_push_svcctl_QueryServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceObjectSecurity *r)
1694 if (flags & NDR_IN) {
1695 if (r->in.handle == NULL) {
1696 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1698 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1699 NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.security_flags));
1700 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
1702 if (flags & NDR_OUT) {
1703 if (r->out.buffer == NULL) {
1704 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1706 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
1707 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
1708 if (r->out.needed == NULL) {
1709 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1711 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
1712 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1714 return NDR_ERR_SUCCESS;
1717 static enum ndr_err_code ndr_pull_svcctl_QueryServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceObjectSecurity *r)
1719 TALLOC_CTX *_mem_save_handle_0;
1720 TALLOC_CTX *_mem_save_needed_0;
1721 if (flags & NDR_IN) {
1722 ZERO_STRUCT(r->out);
1724 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1725 NDR_PULL_ALLOC(ndr, r->in.handle);
1727 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1728 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1729 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1730 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1731 NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.security_flags));
1732 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
1733 if (r->in.offered > 0x40000) {
1734 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1736 NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
1737 memset(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer));
1738 NDR_PULL_ALLOC(ndr, r->out.needed);
1739 ZERO_STRUCTP(r->out.needed);
1741 if (flags & NDR_OUT) {
1742 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
1743 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1744 NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
1746 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)));
1747 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1748 NDR_PULL_ALLOC(ndr, r->out.needed);
1750 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
1751 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
1752 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
1753 if (*r->out.needed > 0x40000) {
1754 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1756 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
1757 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1758 if (r->out.buffer) {
1759 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered));
1762 return NDR_ERR_SUCCESS;
1765 _PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceObjectSecurity *r)
1767 ndr_print_struct(ndr, name, "svcctl_QueryServiceObjectSecurity");
1768 ndr->depth++;
1769 if (flags & NDR_SET_VALUES) {
1770 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1772 if (flags & NDR_IN) {
1773 ndr_print_struct(ndr, "in", "svcctl_QueryServiceObjectSecurity");
1774 ndr->depth++;
1775 ndr_print_ptr(ndr, "handle", r->in.handle);
1776 ndr->depth++;
1777 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1778 ndr->depth--;
1779 ndr_print_security_secinfo(ndr, "security_flags", r->in.security_flags);
1780 ndr_print_uint32(ndr, "offered", r->in.offered);
1781 ndr->depth--;
1783 if (flags & NDR_OUT) {
1784 ndr_print_struct(ndr, "out", "svcctl_QueryServiceObjectSecurity");
1785 ndr->depth++;
1786 ndr_print_ptr(ndr, "buffer", r->out.buffer);
1787 ndr->depth++;
1788 ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
1789 ndr->depth--;
1790 ndr_print_ptr(ndr, "needed", r->out.needed);
1791 ndr->depth++;
1792 ndr_print_uint32(ndr, "needed", *r->out.needed);
1793 ndr->depth--;
1794 ndr_print_WERROR(ndr, "result", r->out.result);
1795 ndr->depth--;
1797 ndr->depth--;
1800 static enum ndr_err_code ndr_push_svcctl_SetServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceObjectSecurity *r)
1802 if (flags & NDR_IN) {
1803 if (r->in.handle == NULL) {
1804 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1806 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1807 NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.security_flags));
1808 if (r->in.buffer == NULL) {
1809 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1811 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
1812 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.offered));
1813 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
1815 if (flags & NDR_OUT) {
1816 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1818 return NDR_ERR_SUCCESS;
1821 static enum ndr_err_code ndr_pull_svcctl_SetServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceObjectSecurity *r)
1823 TALLOC_CTX *_mem_save_handle_0;
1824 if (flags & NDR_IN) {
1825 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1826 NDR_PULL_ALLOC(ndr, r->in.handle);
1828 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1829 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1830 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1831 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1832 NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.security_flags));
1833 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer));
1834 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1835 NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer));
1837 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)));
1838 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
1839 if (r->in.buffer) {
1840 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.offered));
1843 if (flags & NDR_OUT) {
1844 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1846 return NDR_ERR_SUCCESS;
1849 _PUBLIC_ void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceObjectSecurity *r)
1851 ndr_print_struct(ndr, name, "svcctl_SetServiceObjectSecurity");
1852 ndr->depth++;
1853 if (flags & NDR_SET_VALUES) {
1854 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1856 if (flags & NDR_IN) {
1857 ndr_print_struct(ndr, "in", "svcctl_SetServiceObjectSecurity");
1858 ndr->depth++;
1859 ndr_print_ptr(ndr, "handle", r->in.handle);
1860 ndr->depth++;
1861 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1862 ndr->depth--;
1863 ndr_print_security_secinfo(ndr, "security_flags", r->in.security_flags);
1864 ndr_print_ptr(ndr, "buffer", r->in.buffer);
1865 ndr->depth++;
1866 ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.offered);
1867 ndr->depth--;
1868 ndr_print_uint32(ndr, "offered", r->in.offered);
1869 ndr->depth--;
1871 if (flags & NDR_OUT) {
1872 ndr_print_struct(ndr, "out", "svcctl_SetServiceObjectSecurity");
1873 ndr->depth++;
1874 ndr_print_WERROR(ndr, "result", r->out.result);
1875 ndr->depth--;
1877 ndr->depth--;
1880 static enum ndr_err_code ndr_push_svcctl_QueryServiceStatus(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceStatus *r)
1882 if (flags & NDR_IN) {
1883 if (r->in.handle == NULL) {
1884 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1886 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1888 if (flags & NDR_OUT) {
1889 if (r->out.service_status == NULL) {
1890 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1892 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1893 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1895 return NDR_ERR_SUCCESS;
1898 static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceStatus *r)
1900 TALLOC_CTX *_mem_save_handle_0;
1901 TALLOC_CTX *_mem_save_service_status_0;
1902 if (flags & NDR_IN) {
1903 ZERO_STRUCT(r->out);
1905 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1906 NDR_PULL_ALLOC(ndr, r->in.handle);
1908 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1909 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1910 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1911 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1912 NDR_PULL_ALLOC(ndr, r->out.service_status);
1913 ZERO_STRUCTP(r->out.service_status);
1915 if (flags & NDR_OUT) {
1916 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1917 NDR_PULL_ALLOC(ndr, r->out.service_status);
1919 _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
1920 NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC);
1921 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1922 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC);
1923 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1925 return NDR_ERR_SUCCESS;
1928 _PUBLIC_ void ndr_print_svcctl_QueryServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatus *r)
1930 ndr_print_struct(ndr, name, "svcctl_QueryServiceStatus");
1931 ndr->depth++;
1932 if (flags & NDR_SET_VALUES) {
1933 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1935 if (flags & NDR_IN) {
1936 ndr_print_struct(ndr, "in", "svcctl_QueryServiceStatus");
1937 ndr->depth++;
1938 ndr_print_ptr(ndr, "handle", r->in.handle);
1939 ndr->depth++;
1940 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1941 ndr->depth--;
1942 ndr->depth--;
1944 if (flags & NDR_OUT) {
1945 ndr_print_struct(ndr, "out", "svcctl_QueryServiceStatus");
1946 ndr->depth++;
1947 ndr_print_ptr(ndr, "service_status", r->out.service_status);
1948 ndr->depth++;
1949 ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status);
1950 ndr->depth--;
1951 ndr_print_WERROR(ndr, "result", r->out.result);
1952 ndr->depth--;
1954 ndr->depth--;
1957 static enum ndr_err_code ndr_push_svcctl_SetServiceStatus(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceStatus *r)
1959 if (flags & NDR_IN) {
1961 if (flags & NDR_OUT) {
1962 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1964 return NDR_ERR_SUCCESS;
1967 static enum ndr_err_code ndr_pull_svcctl_SetServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceStatus *r)
1969 if (flags & NDR_IN) {
1971 if (flags & NDR_OUT) {
1972 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1974 return NDR_ERR_SUCCESS;
1977 _PUBLIC_ void ndr_print_svcctl_SetServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceStatus *r)
1979 ndr_print_struct(ndr, name, "svcctl_SetServiceStatus");
1980 ndr->depth++;
1981 if (flags & NDR_SET_VALUES) {
1982 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1984 if (flags & NDR_IN) {
1985 ndr_print_struct(ndr, "in", "svcctl_SetServiceStatus");
1986 ndr->depth++;
1987 ndr->depth--;
1989 if (flags & NDR_OUT) {
1990 ndr_print_struct(ndr, "out", "svcctl_SetServiceStatus");
1991 ndr->depth++;
1992 ndr_print_WERROR(ndr, "result", r->out.result);
1993 ndr->depth--;
1995 ndr->depth--;
1998 static enum ndr_err_code ndr_push_svcctl_UnlockServiceDatabase(struct ndr_push *ndr, int flags, const struct svcctl_UnlockServiceDatabase *r)
2000 if (flags & NDR_IN) {
2001 if (r->in.lock == NULL) {
2002 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2004 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.lock));
2006 if (flags & NDR_OUT) {
2007 if (r->out.lock == NULL) {
2008 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2010 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.lock));
2011 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2013 return NDR_ERR_SUCCESS;
2016 static enum ndr_err_code ndr_pull_svcctl_UnlockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_UnlockServiceDatabase *r)
2018 TALLOC_CTX *_mem_save_lock_0;
2019 if (flags & NDR_IN) {
2020 ZERO_STRUCT(r->out);
2022 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2023 NDR_PULL_ALLOC(ndr, r->in.lock);
2025 _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr);
2026 NDR_PULL_SET_MEM_CTX(ndr, r->in.lock, LIBNDR_FLAG_REF_ALLOC);
2027 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.lock));
2028 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC);
2029 NDR_PULL_ALLOC(ndr, r->out.lock);
2030 *r->out.lock = *r->in.lock;
2032 if (flags & NDR_OUT) {
2033 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2034 NDR_PULL_ALLOC(ndr, r->out.lock);
2036 _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr);
2037 NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC);
2038 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock));
2039 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC);
2040 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2042 return NDR_ERR_SUCCESS;
2045 _PUBLIC_ void ndr_print_svcctl_UnlockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_UnlockServiceDatabase *r)
2047 ndr_print_struct(ndr, name, "svcctl_UnlockServiceDatabase");
2048 ndr->depth++;
2049 if (flags & NDR_SET_VALUES) {
2050 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2052 if (flags & NDR_IN) {
2053 ndr_print_struct(ndr, "in", "svcctl_UnlockServiceDatabase");
2054 ndr->depth++;
2055 ndr_print_ptr(ndr, "lock", r->in.lock);
2056 ndr->depth++;
2057 ndr_print_policy_handle(ndr, "lock", r->in.lock);
2058 ndr->depth--;
2059 ndr->depth--;
2061 if (flags & NDR_OUT) {
2062 ndr_print_struct(ndr, "out", "svcctl_UnlockServiceDatabase");
2063 ndr->depth++;
2064 ndr_print_ptr(ndr, "lock", r->out.lock);
2065 ndr->depth++;
2066 ndr_print_policy_handle(ndr, "lock", r->out.lock);
2067 ndr->depth--;
2068 ndr_print_WERROR(ndr, "result", r->out.result);
2069 ndr->depth--;
2071 ndr->depth--;
2074 static enum ndr_err_code ndr_push_svcctl_NotifyBootConfigStatus(struct ndr_push *ndr, int flags, const struct svcctl_NotifyBootConfigStatus *r)
2076 if (flags & NDR_IN) {
2078 if (flags & NDR_OUT) {
2079 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2081 return NDR_ERR_SUCCESS;
2084 static enum ndr_err_code ndr_pull_svcctl_NotifyBootConfigStatus(struct ndr_pull *ndr, int flags, struct svcctl_NotifyBootConfigStatus *r)
2086 if (flags & NDR_IN) {
2088 if (flags & NDR_OUT) {
2089 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2091 return NDR_ERR_SUCCESS;
2094 _PUBLIC_ void ndr_print_svcctl_NotifyBootConfigStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_NotifyBootConfigStatus *r)
2096 ndr_print_struct(ndr, name, "svcctl_NotifyBootConfigStatus");
2097 ndr->depth++;
2098 if (flags & NDR_SET_VALUES) {
2099 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2101 if (flags & NDR_IN) {
2102 ndr_print_struct(ndr, "in", "svcctl_NotifyBootConfigStatus");
2103 ndr->depth++;
2104 ndr->depth--;
2106 if (flags & NDR_OUT) {
2107 ndr_print_struct(ndr, "out", "svcctl_NotifyBootConfigStatus");
2108 ndr->depth++;
2109 ndr_print_WERROR(ndr, "result", r->out.result);
2110 ndr->depth--;
2112 ndr->depth--;
2115 static enum ndr_err_code ndr_push_svcctl_SCSetServiceBitsW(struct ndr_push *ndr, int flags, const struct svcctl_SCSetServiceBitsW *r)
2117 if (flags & NDR_IN) {
2118 if (r->in.handle == NULL) {
2119 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2121 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2122 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bits));
2123 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bitson));
2124 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.immediate));
2126 if (flags & NDR_OUT) {
2127 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2129 return NDR_ERR_SUCCESS;
2132 static enum ndr_err_code ndr_pull_svcctl_SCSetServiceBitsW(struct ndr_pull *ndr, int flags, struct svcctl_SCSetServiceBitsW *r)
2134 TALLOC_CTX *_mem_save_handle_0;
2135 if (flags & NDR_IN) {
2136 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2137 NDR_PULL_ALLOC(ndr, r->in.handle);
2139 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2140 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2141 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2142 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2143 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bits));
2144 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bitson));
2145 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.immediate));
2147 if (flags & NDR_OUT) {
2148 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2150 return NDR_ERR_SUCCESS;
2153 _PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsW *r)
2155 ndr_print_struct(ndr, name, "svcctl_SCSetServiceBitsW");
2156 ndr->depth++;
2157 if (flags & NDR_SET_VALUES) {
2158 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2160 if (flags & NDR_IN) {
2161 ndr_print_struct(ndr, "in", "svcctl_SCSetServiceBitsW");
2162 ndr->depth++;
2163 ndr_print_ptr(ndr, "handle", r->in.handle);
2164 ndr->depth++;
2165 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2166 ndr->depth--;
2167 ndr_print_uint32(ndr, "bits", r->in.bits);
2168 ndr_print_uint32(ndr, "bitson", r->in.bitson);
2169 ndr_print_uint32(ndr, "immediate", r->in.immediate);
2170 ndr->depth--;
2172 if (flags & NDR_OUT) {
2173 ndr_print_struct(ndr, "out", "svcctl_SCSetServiceBitsW");
2174 ndr->depth++;
2175 ndr_print_WERROR(ndr, "result", r->out.result);
2176 ndr->depth--;
2178 ndr->depth--;
2181 static enum ndr_err_code ndr_push_svcctl_ChangeServiceConfigW(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfigW *r)
2183 if (flags & NDR_IN) {
2184 if (r->in.handle == NULL) {
2185 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2187 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2188 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
2189 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->in.start_type));
2190 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->in.error_control));
2191 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path));
2192 if (r->in.binary_path) {
2193 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2194 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2195 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2196 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2198 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.load_order_group));
2199 if (r->in.load_order_group) {
2200 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16)));
2201 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2202 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16)));
2203 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.load_order_group, ndr_charset_length(r->in.load_order_group, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2205 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies));
2206 if (r->in.dependencies) {
2207 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
2208 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2209 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
2210 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2212 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name));
2213 if (r->in.service_start_name) {
2214 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2215 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2216 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2217 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2219 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password));
2220 if (r->in.password) {
2221 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
2222 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2223 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
2224 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2226 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name));
2227 if (r->in.display_name) {
2228 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_name, CH_UTF16)));
2229 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2230 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_name, CH_UTF16)));
2231 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.display_name, ndr_charset_length(r->in.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2234 if (flags & NDR_OUT) {
2235 if (r->out.tag_id == NULL) {
2236 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2238 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.tag_id));
2239 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2241 return NDR_ERR_SUCCESS;
2244 static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfigW *r)
2246 uint32_t _ptr_binary_path;
2247 uint32_t _ptr_load_order_group;
2248 uint32_t _ptr_dependencies;
2249 uint32_t _ptr_service_start_name;
2250 uint32_t _ptr_password;
2251 uint32_t _ptr_display_name;
2252 TALLOC_CTX *_mem_save_handle_0;
2253 TALLOC_CTX *_mem_save_binary_path_0;
2254 TALLOC_CTX *_mem_save_load_order_group_0;
2255 TALLOC_CTX *_mem_save_tag_id_0;
2256 TALLOC_CTX *_mem_save_dependencies_0;
2257 TALLOC_CTX *_mem_save_service_start_name_0;
2258 TALLOC_CTX *_mem_save_password_0;
2259 TALLOC_CTX *_mem_save_display_name_0;
2260 if (flags & NDR_IN) {
2261 ZERO_STRUCT(r->out);
2263 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2264 NDR_PULL_ALLOC(ndr, r->in.handle);
2266 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2267 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2268 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2269 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2270 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
2271 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->in.start_type));
2272 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->in.error_control));
2273 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path));
2274 if (_ptr_binary_path) {
2275 NDR_PULL_ALLOC(ndr, r->in.binary_path);
2276 } else {
2277 r->in.binary_path = NULL;
2279 if (r->in.binary_path) {
2280 _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
2281 NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0);
2282 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path));
2283 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path));
2284 if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) {
2285 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path));
2287 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t)));
2288 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16));
2289 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0);
2291 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_load_order_group));
2292 if (_ptr_load_order_group) {
2293 NDR_PULL_ALLOC(ndr, r->in.load_order_group);
2294 } else {
2295 r->in.load_order_group = NULL;
2297 if (r->in.load_order_group) {
2298 _mem_save_load_order_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
2299 NDR_PULL_SET_MEM_CTX(ndr, r->in.load_order_group, 0);
2300 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.load_order_group));
2301 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.load_order_group));
2302 if (ndr_get_array_length(ndr, &r->in.load_order_group) > ndr_get_array_size(ndr, &r->in.load_order_group)) {
2303 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.load_order_group), ndr_get_array_length(ndr, &r->in.load_order_group));
2305 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t)));
2306 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.load_order_group, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t), CH_UTF16));
2307 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_load_order_group_0, 0);
2309 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
2310 if (_ptr_dependencies) {
2311 NDR_PULL_ALLOC(ndr, r->in.dependencies);
2312 } else {
2313 r->in.dependencies = NULL;
2315 if (r->in.dependencies) {
2316 _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
2317 NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0);
2318 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies));
2319 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies));
2320 if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) {
2321 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies));
2323 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t)));
2324 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16));
2325 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
2327 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name));
2328 if (_ptr_service_start_name) {
2329 NDR_PULL_ALLOC(ndr, r->in.service_start_name);
2330 } else {
2331 r->in.service_start_name = NULL;
2333 if (r->in.service_start_name) {
2334 _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2335 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0);
2336 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name));
2337 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name));
2338 if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) {
2339 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name));
2341 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t)));
2342 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16));
2343 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0);
2345 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
2346 if (_ptr_password) {
2347 NDR_PULL_ALLOC(ndr, r->in.password);
2348 } else {
2349 r->in.password = NULL;
2351 if (r->in.password) {
2352 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
2353 NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0);
2354 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password));
2355 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password));
2356 if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) {
2357 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password));
2359 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t)));
2360 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16));
2361 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
2363 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
2364 if (_ptr_display_name) {
2365 NDR_PULL_ALLOC(ndr, r->in.display_name);
2366 } else {
2367 r->in.display_name = NULL;
2369 if (r->in.display_name) {
2370 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2371 NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name, 0);
2372 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.display_name));
2373 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.display_name));
2374 if (ndr_get_array_length(ndr, &r->in.display_name) > ndr_get_array_size(ndr, &r->in.display_name)) {
2375 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.display_name), ndr_get_array_length(ndr, &r->in.display_name));
2377 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t)));
2378 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.display_name, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t), CH_UTF16));
2379 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
2381 NDR_PULL_ALLOC(ndr, r->out.tag_id);
2382 ZERO_STRUCTP(r->out.tag_id);
2384 if (flags & NDR_OUT) {
2385 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2386 NDR_PULL_ALLOC(ndr, r->out.tag_id);
2388 _mem_save_tag_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
2389 NDR_PULL_SET_MEM_CTX(ndr, r->out.tag_id, LIBNDR_FLAG_REF_ALLOC);
2390 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.tag_id));
2391 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tag_id_0, LIBNDR_FLAG_REF_ALLOC);
2392 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2394 return NDR_ERR_SUCCESS;
2397 _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigW *r)
2399 ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfigW");
2400 ndr->depth++;
2401 if (flags & NDR_SET_VALUES) {
2402 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2404 if (flags & NDR_IN) {
2405 ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfigW");
2406 ndr->depth++;
2407 ndr_print_ptr(ndr, "handle", r->in.handle);
2408 ndr->depth++;
2409 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2410 ndr->depth--;
2411 ndr_print_uint32(ndr, "type", r->in.type);
2412 ndr_print_svcctl_StartType(ndr, "start_type", r->in.start_type);
2413 ndr_print_svcctl_ErrorControl(ndr, "error_control", r->in.error_control);
2414 ndr_print_ptr(ndr, "binary_path", r->in.binary_path);
2415 ndr->depth++;
2416 if (r->in.binary_path) {
2417 ndr_print_string(ndr, "binary_path", r->in.binary_path);
2419 ndr->depth--;
2420 ndr_print_ptr(ndr, "load_order_group", r->in.load_order_group);
2421 ndr->depth++;
2422 if (r->in.load_order_group) {
2423 ndr_print_string(ndr, "load_order_group", r->in.load_order_group);
2425 ndr->depth--;
2426 ndr_print_ptr(ndr, "dependencies", r->in.dependencies);
2427 ndr->depth++;
2428 if (r->in.dependencies) {
2429 ndr_print_string(ndr, "dependencies", r->in.dependencies);
2431 ndr->depth--;
2432 ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name);
2433 ndr->depth++;
2434 if (r->in.service_start_name) {
2435 ndr_print_string(ndr, "service_start_name", r->in.service_start_name);
2437 ndr->depth--;
2438 ndr_print_ptr(ndr, "password", r->in.password);
2439 ndr->depth++;
2440 if (r->in.password) {
2441 ndr_print_string(ndr, "password", r->in.password);
2443 ndr->depth--;
2444 ndr_print_ptr(ndr, "display_name", r->in.display_name);
2445 ndr->depth++;
2446 if (r->in.display_name) {
2447 ndr_print_string(ndr, "display_name", r->in.display_name);
2449 ndr->depth--;
2450 ndr->depth--;
2452 if (flags & NDR_OUT) {
2453 ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfigW");
2454 ndr->depth++;
2455 ndr_print_ptr(ndr, "tag_id", r->out.tag_id);
2456 ndr->depth++;
2457 ndr_print_uint32(ndr, "tag_id", *r->out.tag_id);
2458 ndr->depth--;
2459 ndr_print_WERROR(ndr, "result", r->out.result);
2460 ndr->depth--;
2462 ndr->depth--;
2465 static enum ndr_err_code ndr_push_svcctl_CreateServiceW(struct ndr_push *ndr, int flags, const struct svcctl_CreateServiceW *r)
2467 if (flags & NDR_IN) {
2468 if (r->in.scmanager_handle == NULL) {
2469 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2471 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
2472 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
2473 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2474 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
2475 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2476 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DisplayName));
2477 if (r->in.DisplayName) {
2478 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16)));
2479 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2480 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16)));
2481 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DisplayName, ndr_charset_length(r->in.DisplayName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2483 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.desired_access));
2484 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
2485 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->in.start_type));
2486 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->in.error_control));
2487 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2488 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2489 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2490 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2491 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.LoadOrderGroupKey));
2492 if (r->in.LoadOrderGroupKey) {
2493 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16)));
2494 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2495 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16)));
2496 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.LoadOrderGroupKey, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2498 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.TagId));
2499 if (r->in.TagId) {
2500 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.TagId));
2502 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies));
2503 if (r->in.dependencies) {
2504 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.dependencies_size));
2505 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, r->in.dependencies_size));
2507 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dependencies_size));
2508 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name));
2509 if (r->in.service_start_name) {
2510 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2511 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2512 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2513 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2515 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password));
2516 if (r->in.password) {
2517 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.password_size));
2518 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.password, r->in.password_size));
2520 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.password_size));
2522 if (flags & NDR_OUT) {
2523 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.TagId));
2524 if (r->out.TagId) {
2525 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId));
2527 if (r->out.handle == NULL) {
2528 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2530 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
2531 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2533 return NDR_ERR_SUCCESS;
2536 static enum ndr_err_code ndr_pull_svcctl_CreateServiceW(struct ndr_pull *ndr, int flags, struct svcctl_CreateServiceW *r)
2538 uint32_t _ptr_DisplayName;
2539 uint32_t _ptr_LoadOrderGroupKey;
2540 uint32_t _ptr_TagId;
2541 uint32_t _ptr_dependencies;
2542 uint32_t _ptr_service_start_name;
2543 uint32_t _ptr_password;
2544 TALLOC_CTX *_mem_save_scmanager_handle_0;
2545 TALLOC_CTX *_mem_save_DisplayName_0;
2546 TALLOC_CTX *_mem_save_LoadOrderGroupKey_0;
2547 TALLOC_CTX *_mem_save_TagId_0;
2548 TALLOC_CTX *_mem_save_dependencies_0;
2549 TALLOC_CTX *_mem_save_service_start_name_0;
2550 TALLOC_CTX *_mem_save_password_0;
2551 TALLOC_CTX *_mem_save_handle_0;
2552 if (flags & NDR_IN) {
2553 ZERO_STRUCT(r->out);
2555 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2556 NDR_PULL_ALLOC(ndr, r->in.scmanager_handle);
2558 _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2559 NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC);
2560 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
2561 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC);
2562 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName));
2563 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName));
2564 if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) {
2565 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName));
2567 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t)));
2568 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16));
2569 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DisplayName));
2570 if (_ptr_DisplayName) {
2571 NDR_PULL_ALLOC(ndr, r->in.DisplayName);
2572 } else {
2573 r->in.DisplayName = NULL;
2575 if (r->in.DisplayName) {
2576 _mem_save_DisplayName_0 = NDR_PULL_GET_MEM_CTX(ndr);
2577 NDR_PULL_SET_MEM_CTX(ndr, r->in.DisplayName, 0);
2578 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DisplayName));
2579 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DisplayName));
2580 if (ndr_get_array_length(ndr, &r->in.DisplayName) > ndr_get_array_size(ndr, &r->in.DisplayName)) {
2581 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DisplayName), ndr_get_array_length(ndr, &r->in.DisplayName));
2583 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t)));
2584 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DisplayName, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t), CH_UTF16));
2585 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DisplayName_0, 0);
2587 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.desired_access));
2588 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
2589 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->in.start_type));
2590 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->in.error_control));
2591 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path));
2592 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path));
2593 if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) {
2594 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path));
2596 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t)));
2597 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16));
2598 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LoadOrderGroupKey));
2599 if (_ptr_LoadOrderGroupKey) {
2600 NDR_PULL_ALLOC(ndr, r->in.LoadOrderGroupKey);
2601 } else {
2602 r->in.LoadOrderGroupKey = NULL;
2604 if (r->in.LoadOrderGroupKey) {
2605 _mem_save_LoadOrderGroupKey_0 = NDR_PULL_GET_MEM_CTX(ndr);
2606 NDR_PULL_SET_MEM_CTX(ndr, r->in.LoadOrderGroupKey, 0);
2607 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.LoadOrderGroupKey));
2608 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.LoadOrderGroupKey));
2609 if (ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey) > ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey)) {
2610 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey), ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey));
2612 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t)));
2613 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.LoadOrderGroupKey, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t), CH_UTF16));
2614 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LoadOrderGroupKey_0, 0);
2616 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId));
2617 if (_ptr_TagId) {
2618 NDR_PULL_ALLOC(ndr, r->in.TagId);
2619 } else {
2620 r->in.TagId = NULL;
2622 if (r->in.TagId) {
2623 _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr);
2624 NDR_PULL_SET_MEM_CTX(ndr, r->in.TagId, 0);
2625 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.TagId));
2626 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0);
2628 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
2629 if (_ptr_dependencies) {
2630 NDR_PULL_ALLOC(ndr, r->in.dependencies);
2631 } else {
2632 r->in.dependencies = NULL;
2634 if (r->in.dependencies) {
2635 _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
2636 NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0);
2637 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies));
2638 NDR_PULL_ALLOC_N(ndr, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies));
2639 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies)));
2640 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
2642 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dependencies_size));
2643 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name));
2644 if (_ptr_service_start_name) {
2645 NDR_PULL_ALLOC(ndr, r->in.service_start_name);
2646 } else {
2647 r->in.service_start_name = NULL;
2649 if (r->in.service_start_name) {
2650 _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2651 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0);
2652 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name));
2653 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name));
2654 if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) {
2655 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name));
2657 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t)));
2658 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16));
2659 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0);
2661 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
2662 if (_ptr_password) {
2663 NDR_PULL_ALLOC(ndr, r->in.password);
2664 } else {
2665 r->in.password = NULL;
2667 if (r->in.password) {
2668 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
2669 NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0);
2670 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password));
2671 NDR_PULL_ALLOC_N(ndr, r->in.password, ndr_get_array_size(ndr, &r->in.password));
2672 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.password, ndr_get_array_size(ndr, &r->in.password)));
2673 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
2675 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.password_size));
2676 NDR_PULL_ALLOC(ndr, r->out.handle);
2677 ZERO_STRUCTP(r->out.handle);
2678 if (r->in.dependencies) {
2679 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.dependencies, r->in.dependencies_size));
2681 if (r->in.password) {
2682 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.password, r->in.password_size));
2685 if (flags & NDR_OUT) {
2686 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId));
2687 if (_ptr_TagId) {
2688 NDR_PULL_ALLOC(ndr, r->out.TagId);
2689 } else {
2690 r->out.TagId = NULL;
2692 if (r->out.TagId) {
2693 _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr);
2694 NDR_PULL_SET_MEM_CTX(ndr, r->out.TagId, 0);
2695 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.TagId));
2696 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0);
2698 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2699 NDR_PULL_ALLOC(ndr, r->out.handle);
2701 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2702 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
2703 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
2704 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2705 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2707 return NDR_ERR_SUCCESS;
2710 _PUBLIC_ void ndr_print_svcctl_CreateServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceW *r)
2712 ndr_print_struct(ndr, name, "svcctl_CreateServiceW");
2713 ndr->depth++;
2714 if (flags & NDR_SET_VALUES) {
2715 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2717 if (flags & NDR_IN) {
2718 ndr_print_struct(ndr, "in", "svcctl_CreateServiceW");
2719 ndr->depth++;
2720 ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle);
2721 ndr->depth++;
2722 ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle);
2723 ndr->depth--;
2724 ndr_print_string(ndr, "ServiceName", r->in.ServiceName);
2725 ndr_print_ptr(ndr, "DisplayName", r->in.DisplayName);
2726 ndr->depth++;
2727 if (r->in.DisplayName) {
2728 ndr_print_string(ndr, "DisplayName", r->in.DisplayName);
2730 ndr->depth--;
2731 ndr_print_uint32(ndr, "desired_access", r->in.desired_access);
2732 ndr_print_uint32(ndr, "type", r->in.type);
2733 ndr_print_svcctl_StartType(ndr, "start_type", r->in.start_type);
2734 ndr_print_svcctl_ErrorControl(ndr, "error_control", r->in.error_control);
2735 ndr_print_string(ndr, "binary_path", r->in.binary_path);
2736 ndr_print_ptr(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey);
2737 ndr->depth++;
2738 if (r->in.LoadOrderGroupKey) {
2739 ndr_print_string(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey);
2741 ndr->depth--;
2742 ndr_print_ptr(ndr, "TagId", r->in.TagId);
2743 ndr->depth++;
2744 if (r->in.TagId) {
2745 ndr_print_uint32(ndr, "TagId", *r->in.TagId);
2747 ndr->depth--;
2748 ndr_print_ptr(ndr, "dependencies", r->in.dependencies);
2749 ndr->depth++;
2750 if (r->in.dependencies) {
2751 ndr_print_array_uint8(ndr, "dependencies", r->in.dependencies, r->in.dependencies_size);
2753 ndr->depth--;
2754 ndr_print_uint32(ndr, "dependencies_size", r->in.dependencies_size);
2755 ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name);
2756 ndr->depth++;
2757 if (r->in.service_start_name) {
2758 ndr_print_string(ndr, "service_start_name", r->in.service_start_name);
2760 ndr->depth--;
2761 ndr_print_ptr(ndr, "password", r->in.password);
2762 ndr->depth++;
2763 if (r->in.password) {
2764 ndr_print_array_uint8(ndr, "password", r->in.password, r->in.password_size);
2766 ndr->depth--;
2767 ndr_print_uint32(ndr, "password_size", r->in.password_size);
2768 ndr->depth--;
2770 if (flags & NDR_OUT) {
2771 ndr_print_struct(ndr, "out", "svcctl_CreateServiceW");
2772 ndr->depth++;
2773 ndr_print_ptr(ndr, "TagId", r->out.TagId);
2774 ndr->depth++;
2775 if (r->out.TagId) {
2776 ndr_print_uint32(ndr, "TagId", *r->out.TagId);
2778 ndr->depth--;
2779 ndr_print_ptr(ndr, "handle", r->out.handle);
2780 ndr->depth++;
2781 ndr_print_policy_handle(ndr, "handle", r->out.handle);
2782 ndr->depth--;
2783 ndr_print_WERROR(ndr, "result", r->out.result);
2784 ndr->depth--;
2786 ndr->depth--;
2789 static enum ndr_err_code ndr_push_svcctl_EnumDependentServicesW(struct ndr_push *ndr, int flags, const struct svcctl_EnumDependentServicesW *r)
2791 if (flags & NDR_IN) {
2792 if (r->in.service == NULL) {
2793 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2795 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.service));
2796 NDR_CHECK(ndr_push_svcctl_ServiceState(ndr, NDR_SCALARS, r->in.state));
2797 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
2799 if (flags & NDR_OUT) {
2800 if (r->out.service_status == NULL) {
2801 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2803 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
2804 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service_status, r->in.offered));
2805 if (r->out.needed == NULL) {
2806 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2808 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
2809 if (r->out.services_returned == NULL) {
2810 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2812 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned));
2813 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2815 return NDR_ERR_SUCCESS;
2818 static enum ndr_err_code ndr_pull_svcctl_EnumDependentServicesW(struct ndr_pull *ndr, int flags, struct svcctl_EnumDependentServicesW *r)
2820 TALLOC_CTX *_mem_save_service_0;
2821 TALLOC_CTX *_mem_save_needed_0;
2822 TALLOC_CTX *_mem_save_services_returned_0;
2823 if (flags & NDR_IN) {
2824 ZERO_STRUCT(r->out);
2826 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2827 NDR_PULL_ALLOC(ndr, r->in.service);
2829 _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr);
2830 NDR_PULL_SET_MEM_CTX(ndr, r->in.service, LIBNDR_FLAG_REF_ALLOC);
2831 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.service));
2832 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, LIBNDR_FLAG_REF_ALLOC);
2833 NDR_CHECK(ndr_pull_svcctl_ServiceState(ndr, NDR_SCALARS, &r->in.state));
2834 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
2835 if (r->in.offered > 0x40000) {
2836 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2838 NDR_PULL_ALLOC_N(ndr, r->out.service_status, r->in.offered);
2839 memset(r->out.service_status, 0, (r->in.offered) * sizeof(*r->out.service_status));
2840 NDR_PULL_ALLOC(ndr, r->out.needed);
2841 ZERO_STRUCTP(r->out.needed);
2842 NDR_PULL_ALLOC(ndr, r->out.services_returned);
2843 ZERO_STRUCTP(r->out.services_returned);
2845 if (flags & NDR_OUT) {
2846 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service_status));
2847 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2848 NDR_PULL_ALLOC_N(ndr, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status));
2850 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status)));
2851 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2852 NDR_PULL_ALLOC(ndr, r->out.needed);
2854 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
2855 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
2856 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
2857 if (*r->out.needed > 0x40000) {
2858 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2860 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
2861 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2862 NDR_PULL_ALLOC(ndr, r->out.services_returned);
2864 _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
2865 NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC);
2866 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned));
2867 if (*r->out.services_returned > 0x40000) {
2868 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2870 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC);
2871 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2872 if (r->out.service_status) {
2873 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service_status, r->in.offered));
2876 return NDR_ERR_SUCCESS;
2879 _PUBLIC_ void ndr_print_svcctl_EnumDependentServicesW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesW *r)
2881 ndr_print_struct(ndr, name, "svcctl_EnumDependentServicesW");
2882 ndr->depth++;
2883 if (flags & NDR_SET_VALUES) {
2884 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2886 if (flags & NDR_IN) {
2887 ndr_print_struct(ndr, "in", "svcctl_EnumDependentServicesW");
2888 ndr->depth++;
2889 ndr_print_ptr(ndr, "service", r->in.service);
2890 ndr->depth++;
2891 ndr_print_policy_handle(ndr, "service", r->in.service);
2892 ndr->depth--;
2893 ndr_print_svcctl_ServiceState(ndr, "state", r->in.state);
2894 ndr_print_uint32(ndr, "offered", r->in.offered);
2895 ndr->depth--;
2897 if (flags & NDR_OUT) {
2898 ndr_print_struct(ndr, "out", "svcctl_EnumDependentServicesW");
2899 ndr->depth++;
2900 ndr_print_ptr(ndr, "service_status", r->out.service_status);
2901 ndr->depth++;
2902 ndr_print_array_uint8(ndr, "service_status", r->out.service_status, r->in.offered);
2903 ndr->depth--;
2904 ndr_print_ptr(ndr, "needed", r->out.needed);
2905 ndr->depth++;
2906 ndr_print_uint32(ndr, "needed", *r->out.needed);
2907 ndr->depth--;
2908 ndr_print_ptr(ndr, "services_returned", r->out.services_returned);
2909 ndr->depth++;
2910 ndr_print_uint32(ndr, "services_returned", *r->out.services_returned);
2911 ndr->depth--;
2912 ndr_print_WERROR(ndr, "result", r->out.result);
2913 ndr->depth--;
2915 ndr->depth--;
2918 static enum ndr_err_code ndr_push_svcctl_EnumServicesStatusW(struct ndr_push *ndr, int flags, const struct svcctl_EnumServicesStatusW *r)
2920 if (flags & NDR_IN) {
2921 if (r->in.handle == NULL) {
2922 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2924 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2925 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
2926 NDR_CHECK(ndr_push_svcctl_ServiceState(ndr, NDR_SCALARS, r->in.state));
2927 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
2928 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle));
2929 if (r->in.resume_handle) {
2930 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle));
2933 if (flags & NDR_OUT) {
2934 if (r->out.service == NULL) {
2935 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2937 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
2938 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service, r->in.offered));
2939 if (r->out.needed == NULL) {
2940 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2942 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
2943 if (r->out.services_returned == NULL) {
2944 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2946 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned));
2947 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle));
2948 if (r->out.resume_handle) {
2949 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle));
2951 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2953 return NDR_ERR_SUCCESS;
2956 static enum ndr_err_code ndr_pull_svcctl_EnumServicesStatusW(struct ndr_pull *ndr, int flags, struct svcctl_EnumServicesStatusW *r)
2958 uint32_t _ptr_resume_handle;
2959 TALLOC_CTX *_mem_save_handle_0;
2960 TALLOC_CTX *_mem_save_needed_0;
2961 TALLOC_CTX *_mem_save_services_returned_0;
2962 TALLOC_CTX *_mem_save_resume_handle_0;
2963 if (flags & NDR_IN) {
2964 ZERO_STRUCT(r->out);
2966 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2967 NDR_PULL_ALLOC(ndr, r->in.handle);
2969 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2970 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2971 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2972 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2973 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
2974 NDR_CHECK(ndr_pull_svcctl_ServiceState(ndr, NDR_SCALARS, &r->in.state));
2975 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
2976 if (r->in.offered > 0x40000) {
2977 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2979 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
2980 if (_ptr_resume_handle) {
2981 NDR_PULL_ALLOC(ndr, r->in.resume_handle);
2982 } else {
2983 r->in.resume_handle = NULL;
2985 if (r->in.resume_handle) {
2986 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2987 NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0);
2988 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle));
2989 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
2991 NDR_PULL_ALLOC_N(ndr, r->out.service, r->in.offered);
2992 memset(r->out.service, 0, (r->in.offered) * sizeof(*r->out.service));
2993 NDR_PULL_ALLOC(ndr, r->out.needed);
2994 ZERO_STRUCTP(r->out.needed);
2995 NDR_PULL_ALLOC(ndr, r->out.services_returned);
2996 ZERO_STRUCTP(r->out.services_returned);
2998 if (flags & NDR_OUT) {
2999 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service));
3000 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3001 NDR_PULL_ALLOC_N(ndr, r->out.service, ndr_get_array_size(ndr, &r->out.service));
3003 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service, ndr_get_array_size(ndr, &r->out.service)));
3004 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3005 NDR_PULL_ALLOC(ndr, r->out.needed);
3007 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
3008 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
3009 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
3010 if (*r->out.needed > 0x40000) {
3011 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3013 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
3014 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3015 NDR_PULL_ALLOC(ndr, r->out.services_returned);
3017 _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
3018 NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC);
3019 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned));
3020 if (*r->out.services_returned > 0x40000) {
3021 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3023 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC);
3024 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
3025 if (_ptr_resume_handle) {
3026 NDR_PULL_ALLOC(ndr, r->out.resume_handle);
3027 } else {
3028 r->out.resume_handle = NULL;
3030 if (r->out.resume_handle) {
3031 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3032 NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0);
3033 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle));
3034 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
3036 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3037 if (r->out.service) {
3038 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service, r->in.offered));
3041 return NDR_ERR_SUCCESS;
3044 _PUBLIC_ void ndr_print_svcctl_EnumServicesStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusW *r)
3046 ndr_print_struct(ndr, name, "svcctl_EnumServicesStatusW");
3047 ndr->depth++;
3048 if (flags & NDR_SET_VALUES) {
3049 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3051 if (flags & NDR_IN) {
3052 ndr_print_struct(ndr, "in", "svcctl_EnumServicesStatusW");
3053 ndr->depth++;
3054 ndr_print_ptr(ndr, "handle", r->in.handle);
3055 ndr->depth++;
3056 ndr_print_policy_handle(ndr, "handle", r->in.handle);
3057 ndr->depth--;
3058 ndr_print_uint32(ndr, "type", r->in.type);
3059 ndr_print_svcctl_ServiceState(ndr, "state", r->in.state);
3060 ndr_print_uint32(ndr, "offered", r->in.offered);
3061 ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle);
3062 ndr->depth++;
3063 if (r->in.resume_handle) {
3064 ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle);
3066 ndr->depth--;
3067 ndr->depth--;
3069 if (flags & NDR_OUT) {
3070 ndr_print_struct(ndr, "out", "svcctl_EnumServicesStatusW");
3071 ndr->depth++;
3072 ndr_print_ptr(ndr, "service", r->out.service);
3073 ndr->depth++;
3074 ndr_print_array_uint8(ndr, "service", r->out.service, r->in.offered);
3075 ndr->depth--;
3076 ndr_print_ptr(ndr, "needed", r->out.needed);
3077 ndr->depth++;
3078 ndr_print_uint32(ndr, "needed", *r->out.needed);
3079 ndr->depth--;
3080 ndr_print_ptr(ndr, "services_returned", r->out.services_returned);
3081 ndr->depth++;
3082 ndr_print_uint32(ndr, "services_returned", *r->out.services_returned);
3083 ndr->depth--;
3084 ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle);
3085 ndr->depth++;
3086 if (r->out.resume_handle) {
3087 ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle);
3089 ndr->depth--;
3090 ndr_print_WERROR(ndr, "result", r->out.result);
3091 ndr->depth--;
3093 ndr->depth--;
3096 static enum ndr_err_code ndr_push_svcctl_OpenSCManagerW(struct ndr_push *ndr, int flags, const struct svcctl_OpenSCManagerW *r)
3098 if (flags & NDR_IN) {
3099 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.MachineName));
3100 if (r->in.MachineName) {
3101 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16)));
3102 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3103 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16)));
3104 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.MachineName, ndr_charset_length(r->in.MachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3106 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DatabaseName));
3107 if (r->in.DatabaseName) {
3108 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16)));
3109 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3110 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16)));
3111 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DatabaseName, ndr_charset_length(r->in.DatabaseName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3113 NDR_CHECK(ndr_push_svcctl_MgrAccessMask(ndr, NDR_SCALARS, r->in.access_mask));
3115 if (flags & NDR_OUT) {
3116 if (r->out.handle == NULL) {
3117 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3119 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
3120 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
3122 return NDR_ERR_SUCCESS;
3125 static enum ndr_err_code ndr_pull_svcctl_OpenSCManagerW(struct ndr_pull *ndr, int flags, struct svcctl_OpenSCManagerW *r)
3127 uint32_t _ptr_MachineName;
3128 uint32_t _ptr_DatabaseName;
3129 TALLOC_CTX *_mem_save_MachineName_0;
3130 TALLOC_CTX *_mem_save_DatabaseName_0;
3131 TALLOC_CTX *_mem_save_handle_0;
3132 if (flags & NDR_IN) {
3133 ZERO_STRUCT(r->out);
3135 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_MachineName));
3136 if (_ptr_MachineName) {
3137 NDR_PULL_ALLOC(ndr, r->in.MachineName);
3138 } else {
3139 r->in.MachineName = NULL;
3141 if (r->in.MachineName) {
3142 _mem_save_MachineName_0 = NDR_PULL_GET_MEM_CTX(ndr);
3143 NDR_PULL_SET_MEM_CTX(ndr, r->in.MachineName, 0);
3144 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.MachineName));
3145 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.MachineName));
3146 if (ndr_get_array_length(ndr, &r->in.MachineName) > ndr_get_array_size(ndr, &r->in.MachineName)) {
3147 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.MachineName), ndr_get_array_length(ndr, &r->in.MachineName));
3149 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t)));
3150 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.MachineName, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t), CH_UTF16));
3151 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_MachineName_0, 0);
3153 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DatabaseName));
3154 if (_ptr_DatabaseName) {
3155 NDR_PULL_ALLOC(ndr, r->in.DatabaseName);
3156 } else {
3157 r->in.DatabaseName = NULL;
3159 if (r->in.DatabaseName) {
3160 _mem_save_DatabaseName_0 = NDR_PULL_GET_MEM_CTX(ndr);
3161 NDR_PULL_SET_MEM_CTX(ndr, r->in.DatabaseName, 0);
3162 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DatabaseName));
3163 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DatabaseName));
3164 if (ndr_get_array_length(ndr, &r->in.DatabaseName) > ndr_get_array_size(ndr, &r->in.DatabaseName)) {
3165 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DatabaseName), ndr_get_array_length(ndr, &r->in.DatabaseName));
3167 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t)));
3168 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DatabaseName, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t), CH_UTF16));
3169 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DatabaseName_0, 0);
3171 NDR_CHECK(ndr_pull_svcctl_MgrAccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
3172 NDR_PULL_ALLOC(ndr, r->out.handle);
3173 ZERO_STRUCTP(r->out.handle);
3175 if (flags & NDR_OUT) {
3176 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3177 NDR_PULL_ALLOC(ndr, r->out.handle);
3179 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3180 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
3181 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
3182 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
3183 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3185 return NDR_ERR_SUCCESS;
3188 _PUBLIC_ void ndr_print_svcctl_OpenSCManagerW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerW *r)
3190 ndr_print_struct(ndr, name, "svcctl_OpenSCManagerW");
3191 ndr->depth++;
3192 if (flags & NDR_SET_VALUES) {
3193 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3195 if (flags & NDR_IN) {
3196 ndr_print_struct(ndr, "in", "svcctl_OpenSCManagerW");
3197 ndr->depth++;
3198 ndr_print_ptr(ndr, "MachineName", r->in.MachineName);
3199 ndr->depth++;
3200 if (r->in.MachineName) {
3201 ndr_print_string(ndr, "MachineName", r->in.MachineName);
3203 ndr->depth--;
3204 ndr_print_ptr(ndr, "DatabaseName", r->in.DatabaseName);
3205 ndr->depth++;
3206 if (r->in.DatabaseName) {
3207 ndr_print_string(ndr, "DatabaseName", r->in.DatabaseName);
3209 ndr->depth--;
3210 ndr_print_svcctl_MgrAccessMask(ndr, "access_mask", r->in.access_mask);
3211 ndr->depth--;
3213 if (flags & NDR_OUT) {
3214 ndr_print_struct(ndr, "out", "svcctl_OpenSCManagerW");
3215 ndr->depth++;
3216 ndr_print_ptr(ndr, "handle", r->out.handle);
3217 ndr->depth++;
3218 ndr_print_policy_handle(ndr, "handle", r->out.handle);
3219 ndr->depth--;
3220 ndr_print_WERROR(ndr, "result", r->out.result);
3221 ndr->depth--;
3223 ndr->depth--;
3226 static enum ndr_err_code ndr_push_svcctl_OpenServiceW(struct ndr_push *ndr, int flags, const struct svcctl_OpenServiceW *r)
3228 if (flags & NDR_IN) {
3229 if (r->in.scmanager_handle == NULL) {
3230 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3232 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
3233 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
3234 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3235 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
3236 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3237 NDR_CHECK(ndr_push_svcctl_ServiceAccessMask(ndr, NDR_SCALARS, r->in.access_mask));
3239 if (flags & NDR_OUT) {
3240 if (r->out.handle == NULL) {
3241 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3243 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
3244 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
3246 return NDR_ERR_SUCCESS;
3249 static enum ndr_err_code ndr_pull_svcctl_OpenServiceW(struct ndr_pull *ndr, int flags, struct svcctl_OpenServiceW *r)
3251 TALLOC_CTX *_mem_save_scmanager_handle_0;
3252 TALLOC_CTX *_mem_save_handle_0;
3253 if (flags & NDR_IN) {
3254 ZERO_STRUCT(r->out);
3256 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3257 NDR_PULL_ALLOC(ndr, r->in.scmanager_handle);
3259 _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3260 NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC);
3261 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
3262 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC);
3263 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName));
3264 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName));
3265 if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) {
3266 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName));
3268 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t)));
3269 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16));
3270 NDR_CHECK(ndr_pull_svcctl_ServiceAccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
3271 NDR_PULL_ALLOC(ndr, r->out.handle);
3272 ZERO_STRUCTP(r->out.handle);
3274 if (flags & NDR_OUT) {
3275 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3276 NDR_PULL_ALLOC(ndr, r->out.handle);
3278 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3279 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
3280 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
3281 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
3282 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3284 return NDR_ERR_SUCCESS;
3287 _PUBLIC_ void ndr_print_svcctl_OpenServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceW *r)
3289 ndr_print_struct(ndr, name, "svcctl_OpenServiceW");
3290 ndr->depth++;
3291 if (flags & NDR_SET_VALUES) {
3292 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3294 if (flags & NDR_IN) {
3295 ndr_print_struct(ndr, "in", "svcctl_OpenServiceW");
3296 ndr->depth++;
3297 ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle);
3298 ndr->depth++;
3299 ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle);
3300 ndr->depth--;
3301 ndr_print_string(ndr, "ServiceName", r->in.ServiceName);
3302 ndr_print_svcctl_ServiceAccessMask(ndr, "access_mask", r->in.access_mask);
3303 ndr->depth--;
3305 if (flags & NDR_OUT) {
3306 ndr_print_struct(ndr, "out", "svcctl_OpenServiceW");
3307 ndr->depth++;
3308 ndr_print_ptr(ndr, "handle", r->out.handle);
3309 ndr->depth++;
3310 ndr_print_policy_handle(ndr, "handle", r->out.handle);
3311 ndr->depth--;
3312 ndr_print_WERROR(ndr, "result", r->out.result);
3313 ndr->depth--;
3315 ndr->depth--;
3318 static enum ndr_err_code ndr_push_svcctl_QueryServiceConfigW(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfigW *r)
3320 if (flags & NDR_IN) {
3321 if (r->in.handle == NULL) {
3322 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3324 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3325 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
3327 if (flags & NDR_OUT) {
3328 if (r->out.query == NULL) {
3329 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3331 NDR_CHECK(ndr_push_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
3332 if (r->out.needed == NULL) {
3333 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3335 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
3336 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
3338 return NDR_ERR_SUCCESS;
3341 static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfigW *r)
3343 TALLOC_CTX *_mem_save_handle_0;
3344 TALLOC_CTX *_mem_save_query_0;
3345 TALLOC_CTX *_mem_save_needed_0;
3346 if (flags & NDR_IN) {
3347 ZERO_STRUCT(r->out);
3349 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3350 NDR_PULL_ALLOC(ndr, r->in.handle);
3352 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3353 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
3354 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3355 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
3356 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
3357 if (r->in.offered > 8192) {
3358 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3360 NDR_PULL_ALLOC(ndr, r->out.query);
3361 ZERO_STRUCTP(r->out.query);
3362 NDR_PULL_ALLOC(ndr, r->out.needed);
3363 ZERO_STRUCTP(r->out.needed);
3365 if (flags & NDR_OUT) {
3366 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3367 NDR_PULL_ALLOC(ndr, r->out.query);
3369 _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
3370 NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
3371 NDR_CHECK(ndr_pull_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
3372 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
3373 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3374 NDR_PULL_ALLOC(ndr, r->out.needed);
3376 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
3377 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
3378 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
3379 if (*r->out.needed > 8192) {
3380 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3382 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
3383 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3385 return NDR_ERR_SUCCESS;
3388 _PUBLIC_ void ndr_print_svcctl_QueryServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigW *r)
3390 ndr_print_struct(ndr, name, "svcctl_QueryServiceConfigW");
3391 ndr->depth++;
3392 if (flags & NDR_SET_VALUES) {
3393 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3395 if (flags & NDR_IN) {
3396 ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfigW");
3397 ndr->depth++;
3398 ndr_print_ptr(ndr, "handle", r->in.handle);
3399 ndr->depth++;
3400 ndr_print_policy_handle(ndr, "handle", r->in.handle);
3401 ndr->depth--;
3402 ndr_print_uint32(ndr, "offered", r->in.offered);
3403 ndr->depth--;
3405 if (flags & NDR_OUT) {
3406 ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfigW");
3407 ndr->depth++;
3408 ndr_print_ptr(ndr, "query", r->out.query);
3409 ndr->depth++;
3410 ndr_print_QUERY_SERVICE_CONFIG(ndr, "query", r->out.query);
3411 ndr->depth--;
3412 ndr_print_ptr(ndr, "needed", r->out.needed);
3413 ndr->depth++;
3414 ndr_print_uint32(ndr, "needed", *r->out.needed);
3415 ndr->depth--;
3416 ndr_print_WERROR(ndr, "result", r->out.result);
3417 ndr->depth--;
3419 ndr->depth--;
3422 static enum ndr_err_code ndr_push_svcctl_QueryServiceLockStatusW(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceLockStatusW *r)
3424 if (flags & NDR_IN) {
3425 if (r->in.handle == NULL) {
3426 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3428 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3429 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
3431 if (flags & NDR_OUT) {
3432 if (r->out.lock_status == NULL) {
3433 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3435 NDR_CHECK(ndr_push_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status));
3436 if (r->out.needed == NULL) {
3437 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3439 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
3440 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
3442 return NDR_ERR_SUCCESS;
3445 static enum ndr_err_code ndr_pull_svcctl_QueryServiceLockStatusW(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceLockStatusW *r)
3447 TALLOC_CTX *_mem_save_handle_0;
3448 TALLOC_CTX *_mem_save_lock_status_0;
3449 TALLOC_CTX *_mem_save_needed_0;
3450 if (flags & NDR_IN) {
3451 ZERO_STRUCT(r->out);
3453 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3454 NDR_PULL_ALLOC(ndr, r->in.handle);
3456 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3457 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
3458 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3459 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
3460 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
3461 NDR_PULL_ALLOC(ndr, r->out.lock_status);
3462 ZERO_STRUCTP(r->out.lock_status);
3463 NDR_PULL_ALLOC(ndr, r->out.needed);
3464 ZERO_STRUCTP(r->out.needed);
3466 if (flags & NDR_OUT) {
3467 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3468 NDR_PULL_ALLOC(ndr, r->out.lock_status);
3470 _mem_save_lock_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
3471 NDR_PULL_SET_MEM_CTX(ndr, r->out.lock_status, LIBNDR_FLAG_REF_ALLOC);
3472 NDR_CHECK(ndr_pull_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status));
3473 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_status_0, LIBNDR_FLAG_REF_ALLOC);
3474 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3475 NDR_PULL_ALLOC(ndr, r->out.needed);
3477 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
3478 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
3479 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
3480 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
3481 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3483 return NDR_ERR_SUCCESS;
3486 _PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusW *r)
3488 ndr_print_struct(ndr, name, "svcctl_QueryServiceLockStatusW");
3489 ndr->depth++;
3490 if (flags & NDR_SET_VALUES) {
3491 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3493 if (flags & NDR_IN) {
3494 ndr_print_struct(ndr, "in", "svcctl_QueryServiceLockStatusW");
3495 ndr->depth++;
3496 ndr_print_ptr(ndr, "handle", r->in.handle);
3497 ndr->depth++;
3498 ndr_print_policy_handle(ndr, "handle", r->in.handle);
3499 ndr->depth--;
3500 ndr_print_uint32(ndr, "offered", r->in.offered);
3501 ndr->depth--;
3503 if (flags & NDR_OUT) {
3504 ndr_print_struct(ndr, "out", "svcctl_QueryServiceLockStatusW");
3505 ndr->depth++;
3506 ndr_print_ptr(ndr, "lock_status", r->out.lock_status);
3507 ndr->depth++;
3508 ndr_print_SERVICE_LOCK_STATUS(ndr, "lock_status", r->out.lock_status);
3509 ndr->depth--;
3510 ndr_print_ptr(ndr, "needed", r->out.needed);
3511 ndr->depth++;
3512 ndr_print_uint32(ndr, "needed", *r->out.needed);
3513 ndr->depth--;
3514 ndr_print_WERROR(ndr, "result", r->out.result);
3515 ndr->depth--;
3517 ndr->depth--;
3520 static enum ndr_err_code ndr_push_svcctl_StartServiceW(struct ndr_push *ndr, int flags, const struct svcctl_StartServiceW *r)
3522 uint32_t cntr_Arguments_1;
3523 if (flags & NDR_IN) {
3524 if (r->in.handle == NULL) {
3525 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3527 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3528 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs));
3529 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments));
3530 if (r->in.Arguments) {
3531 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.NumArgs));
3532 for (cntr_Arguments_1 = 0; cntr_Arguments_1 < r->in.NumArgs; cntr_Arguments_1++) {
3533 NDR_CHECK(ndr_push_svcctl_ArgumentString(ndr, NDR_SCALARS, &r->in.Arguments[cntr_Arguments_1]));
3535 for (cntr_Arguments_1 = 0; cntr_Arguments_1 < r->in.NumArgs; cntr_Arguments_1++) {
3536 NDR_CHECK(ndr_push_svcctl_ArgumentString(ndr, NDR_BUFFERS, &r->in.Arguments[cntr_Arguments_1]));
3540 if (flags & NDR_OUT) {
3541 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
3543 return NDR_ERR_SUCCESS;
3546 static enum ndr_err_code ndr_pull_svcctl_StartServiceW(struct ndr_pull *ndr, int flags, struct svcctl_StartServiceW *r)
3548 uint32_t _ptr_Arguments;
3549 uint32_t cntr_Arguments_1;
3550 TALLOC_CTX *_mem_save_handle_0;
3551 TALLOC_CTX *_mem_save_Arguments_0;
3552 TALLOC_CTX *_mem_save_Arguments_1;
3553 if (flags & NDR_IN) {
3554 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3555 NDR_PULL_ALLOC(ndr, r->in.handle);
3557 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3558 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
3559 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3560 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
3561 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.NumArgs));
3562 if (r->in.NumArgs > SC_MAX_ARGUMENTS) {
3563 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3565 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Arguments));
3566 if (_ptr_Arguments) {
3567 NDR_PULL_ALLOC(ndr, r->in.Arguments);
3568 } else {
3569 r->in.Arguments = NULL;
3571 if (r->in.Arguments) {
3572 _mem_save_Arguments_0 = NDR_PULL_GET_MEM_CTX(ndr);
3573 NDR_PULL_SET_MEM_CTX(ndr, r->in.Arguments, 0);
3574 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Arguments));
3575 NDR_PULL_ALLOC_N(ndr, r->in.Arguments, ndr_get_array_size(ndr, &r->in.Arguments));
3576 _mem_save_Arguments_1 = NDR_PULL_GET_MEM_CTX(ndr);
3577 NDR_PULL_SET_MEM_CTX(ndr, r->in.Arguments, 0);
3578 for (cntr_Arguments_1 = 0; cntr_Arguments_1 < r->in.NumArgs; cntr_Arguments_1++) {
3579 NDR_CHECK(ndr_pull_svcctl_ArgumentString(ndr, NDR_SCALARS, &r->in.Arguments[cntr_Arguments_1]));
3581 for (cntr_Arguments_1 = 0; cntr_Arguments_1 < r->in.NumArgs; cntr_Arguments_1++) {
3582 NDR_CHECK(ndr_pull_svcctl_ArgumentString(ndr, NDR_BUFFERS, &r->in.Arguments[cntr_Arguments_1]));
3584 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Arguments_1, 0);
3585 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Arguments_0, 0);
3587 if (r->in.Arguments) {
3588 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.Arguments, r->in.NumArgs));
3591 if (flags & NDR_OUT) {
3592 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3594 return NDR_ERR_SUCCESS;
3597 _PUBLIC_ void ndr_print_svcctl_StartServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceW *r)
3599 uint32_t cntr_Arguments_1;
3600 ndr_print_struct(ndr, name, "svcctl_StartServiceW");
3601 ndr->depth++;
3602 if (flags & NDR_SET_VALUES) {
3603 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3605 if (flags & NDR_IN) {
3606 ndr_print_struct(ndr, "in", "svcctl_StartServiceW");
3607 ndr->depth++;
3608 ndr_print_ptr(ndr, "handle", r->in.handle);
3609 ndr->depth++;
3610 ndr_print_policy_handle(ndr, "handle", r->in.handle);
3611 ndr->depth--;
3612 ndr_print_uint32(ndr, "NumArgs", r->in.NumArgs);
3613 ndr_print_ptr(ndr, "Arguments", r->in.Arguments);
3614 ndr->depth++;
3615 if (r->in.Arguments) {
3616 ndr->print(ndr, "%s: ARRAY(%d)", "Arguments", (int)r->in.NumArgs);
3617 ndr->depth++;
3618 for (cntr_Arguments_1=0;cntr_Arguments_1<r->in.NumArgs;cntr_Arguments_1++) {
3619 char *idx_1=NULL;
3620 if (asprintf(&idx_1, "[%d]", cntr_Arguments_1) != -1) {
3621 ndr_print_svcctl_ArgumentString(ndr, "Arguments", &r->in.Arguments[cntr_Arguments_1]);
3622 free(idx_1);
3625 ndr->depth--;
3627 ndr->depth--;
3628 ndr->depth--;
3630 if (flags & NDR_OUT) {
3631 ndr_print_struct(ndr, "out", "svcctl_StartServiceW");
3632 ndr->depth++;
3633 ndr_print_WERROR(ndr, "result", r->out.result);
3634 ndr->depth--;
3636 ndr->depth--;
3639 static enum ndr_err_code ndr_push_svcctl_GetServiceDisplayNameW(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceDisplayNameW *r)
3641 if (flags & NDR_IN) {
3642 if (r->in.handle == NULL) {
3643 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3645 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3646 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name));
3647 if (r->in.service_name) {
3648 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
3649 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3650 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
3651 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3653 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length));
3654 if (r->in.display_name_length) {
3655 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length));
3658 if (flags & NDR_OUT) {
3659 if (r->out.display_name == NULL) {
3660 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3662 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name));
3663 if (*r->out.display_name) {
3664 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16)));
3665 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3666 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16)));
3667 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3669 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length));
3670 if (r->out.display_name_length) {
3671 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length));
3673 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
3675 return NDR_ERR_SUCCESS;
3678 static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameW(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceDisplayNameW *r)
3680 uint32_t _ptr_service_name;
3681 uint32_t _ptr_display_name;
3682 uint32_t _ptr_display_name_length;
3683 TALLOC_CTX *_mem_save_handle_0;
3684 TALLOC_CTX *_mem_save_service_name_0;
3685 TALLOC_CTX *_mem_save_display_name_0;
3686 TALLOC_CTX *_mem_save_display_name_1;
3687 TALLOC_CTX *_mem_save_display_name_length_0;
3688 if (flags & NDR_IN) {
3689 ZERO_STRUCT(r->out);
3691 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3692 NDR_PULL_ALLOC(ndr, r->in.handle);
3694 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3695 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
3696 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3697 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
3698 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
3699 if (_ptr_service_name) {
3700 NDR_PULL_ALLOC(ndr, r->in.service_name);
3701 } else {
3702 r->in.service_name = NULL;
3704 if (r->in.service_name) {
3705 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
3706 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0);
3707 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name));
3708 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name));
3709 if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) {
3710 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name));
3712 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t)));
3713 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16));
3714 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
3716 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
3717 if (_ptr_display_name_length) {
3718 NDR_PULL_ALLOC(ndr, r->in.display_name_length);
3719 } else {
3720 r->in.display_name_length = NULL;
3722 if (r->in.display_name_length) {
3723 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
3724 NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0);
3725 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length));
3726 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
3728 NDR_PULL_ALLOC(ndr, r->out.display_name);
3729 ZERO_STRUCTP(r->out.display_name);
3731 if (flags & NDR_OUT) {
3732 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3733 NDR_PULL_ALLOC(ndr, r->out.display_name);
3735 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
3736 NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC);
3737 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
3738 if (_ptr_display_name) {
3739 NDR_PULL_ALLOC(ndr, *r->out.display_name);
3740 } else {
3741 *r->out.display_name = NULL;
3743 if (*r->out.display_name) {
3744 _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
3745 NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0);
3746 NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name));
3747 NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name));
3748 if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_name)) {
3749 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.display_name), ndr_get_array_length(ndr, r->out.display_name));
3751 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t)));
3752 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16));
3753 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0);
3755 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC);
3756 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
3757 if (_ptr_display_name_length) {
3758 NDR_PULL_ALLOC(ndr, r->out.display_name_length);
3759 } else {
3760 r->out.display_name_length = NULL;
3762 if (r->out.display_name_length) {
3763 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
3764 NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0);
3765 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length));
3766 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
3768 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3770 return NDR_ERR_SUCCESS;
3773 _PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameW *r)
3775 ndr_print_struct(ndr, name, "svcctl_GetServiceDisplayNameW");
3776 ndr->depth++;
3777 if (flags & NDR_SET_VALUES) {
3778 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3780 if (flags & NDR_IN) {
3781 ndr_print_struct(ndr, "in", "svcctl_GetServiceDisplayNameW");
3782 ndr->depth++;
3783 ndr_print_ptr(ndr, "handle", r->in.handle);
3784 ndr->depth++;
3785 ndr_print_policy_handle(ndr, "handle", r->in.handle);
3786 ndr->depth--;
3787 ndr_print_ptr(ndr, "service_name", r->in.service_name);
3788 ndr->depth++;
3789 if (r->in.service_name) {
3790 ndr_print_string(ndr, "service_name", r->in.service_name);
3792 ndr->depth--;
3793 ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length);
3794 ndr->depth++;
3795 if (r->in.display_name_length) {
3796 ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length);
3798 ndr->depth--;
3799 ndr->depth--;
3801 if (flags & NDR_OUT) {
3802 ndr_print_struct(ndr, "out", "svcctl_GetServiceDisplayNameW");
3803 ndr->depth++;
3804 ndr_print_ptr(ndr, "display_name", r->out.display_name);
3805 ndr->depth++;
3806 ndr_print_ptr(ndr, "display_name", *r->out.display_name);
3807 ndr->depth++;
3808 if (*r->out.display_name) {
3809 ndr_print_string(ndr, "display_name", *r->out.display_name);
3811 ndr->depth--;
3812 ndr->depth--;
3813 ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length);
3814 ndr->depth++;
3815 if (r->out.display_name_length) {
3816 ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length);
3818 ndr->depth--;
3819 ndr_print_WERROR(ndr, "result", r->out.result);
3820 ndr->depth--;
3822 ndr->depth--;
3825 static enum ndr_err_code ndr_push_svcctl_GetServiceKeyNameW(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceKeyNameW *r)
3827 if (flags & NDR_IN) {
3828 if (r->in.handle == NULL) {
3829 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3831 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3832 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name));
3833 if (r->in.service_name) {
3834 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
3835 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3836 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
3837 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3839 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length));
3840 if (r->in.display_name_length) {
3841 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length));
3844 if (flags & NDR_OUT) {
3845 if (r->out.key_name == NULL) {
3846 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3848 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name));
3849 if (*r->out.key_name) {
3850 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16)));
3851 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
3852 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16)));
3853 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3855 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length));
3856 if (r->out.display_name_length) {
3857 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length));
3859 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
3861 return NDR_ERR_SUCCESS;
3864 static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameW(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceKeyNameW *r)
3866 uint32_t _ptr_service_name;
3867 uint32_t _ptr_key_name;
3868 uint32_t _ptr_display_name_length;
3869 TALLOC_CTX *_mem_save_handle_0;
3870 TALLOC_CTX *_mem_save_service_name_0;
3871 TALLOC_CTX *_mem_save_key_name_0;
3872 TALLOC_CTX *_mem_save_key_name_1;
3873 TALLOC_CTX *_mem_save_display_name_length_0;
3874 if (flags & NDR_IN) {
3875 ZERO_STRUCT(r->out);
3877 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3878 NDR_PULL_ALLOC(ndr, r->in.handle);
3880 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
3881 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
3882 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
3883 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
3884 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
3885 if (_ptr_service_name) {
3886 NDR_PULL_ALLOC(ndr, r->in.service_name);
3887 } else {
3888 r->in.service_name = NULL;
3890 if (r->in.service_name) {
3891 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
3892 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0);
3893 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name));
3894 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name));
3895 if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) {
3896 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name));
3898 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t)));
3899 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16));
3900 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
3902 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
3903 if (_ptr_display_name_length) {
3904 NDR_PULL_ALLOC(ndr, r->in.display_name_length);
3905 } else {
3906 r->in.display_name_length = NULL;
3908 if (r->in.display_name_length) {
3909 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
3910 NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0);
3911 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length));
3912 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
3914 NDR_PULL_ALLOC(ndr, r->out.key_name);
3915 ZERO_STRUCTP(r->out.key_name);
3917 if (flags & NDR_OUT) {
3918 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
3919 NDR_PULL_ALLOC(ndr, r->out.key_name);
3921 _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
3922 NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC);
3923 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name));
3924 if (_ptr_key_name) {
3925 NDR_PULL_ALLOC(ndr, *r->out.key_name);
3926 } else {
3927 *r->out.key_name = NULL;
3929 if (*r->out.key_name) {
3930 _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
3931 NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0);
3932 NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name));
3933 NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name));
3934 if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_name)) {
3935 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.key_name), ndr_get_array_length(ndr, r->out.key_name));
3937 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t)));
3938 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16));
3939 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0);
3941 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC);
3942 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
3943 if (_ptr_display_name_length) {
3944 NDR_PULL_ALLOC(ndr, r->out.display_name_length);
3945 } else {
3946 r->out.display_name_length = NULL;
3948 if (r->out.display_name_length) {
3949 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
3950 NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0);
3951 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length));
3952 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
3954 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
3956 return NDR_ERR_SUCCESS;
3959 _PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameW *r)
3961 ndr_print_struct(ndr, name, "svcctl_GetServiceKeyNameW");
3962 ndr->depth++;
3963 if (flags & NDR_SET_VALUES) {
3964 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
3966 if (flags & NDR_IN) {
3967 ndr_print_struct(ndr, "in", "svcctl_GetServiceKeyNameW");
3968 ndr->depth++;
3969 ndr_print_ptr(ndr, "handle", r->in.handle);
3970 ndr->depth++;
3971 ndr_print_policy_handle(ndr, "handle", r->in.handle);
3972 ndr->depth--;
3973 ndr_print_ptr(ndr, "service_name", r->in.service_name);
3974 ndr->depth++;
3975 if (r->in.service_name) {
3976 ndr_print_string(ndr, "service_name", r->in.service_name);
3978 ndr->depth--;
3979 ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length);
3980 ndr->depth++;
3981 if (r->in.display_name_length) {
3982 ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length);
3984 ndr->depth--;
3985 ndr->depth--;
3987 if (flags & NDR_OUT) {
3988 ndr_print_struct(ndr, "out", "svcctl_GetServiceKeyNameW");
3989 ndr->depth++;
3990 ndr_print_ptr(ndr, "key_name", r->out.key_name);
3991 ndr->depth++;
3992 ndr_print_ptr(ndr, "key_name", *r->out.key_name);
3993 ndr->depth++;
3994 if (*r->out.key_name) {
3995 ndr_print_string(ndr, "key_name", *r->out.key_name);
3997 ndr->depth--;
3998 ndr->depth--;
3999 ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length);
4000 ndr->depth++;
4001 if (r->out.display_name_length) {
4002 ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length);
4004 ndr->depth--;
4005 ndr_print_WERROR(ndr, "result", r->out.result);
4006 ndr->depth--;
4008 ndr->depth--;
4011 static enum ndr_err_code ndr_push_svcctl_SCSetServiceBitsA(struct ndr_push *ndr, int flags, const struct svcctl_SCSetServiceBitsA *r)
4013 if (flags & NDR_IN) {
4014 if (r->in.handle == NULL) {
4015 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4017 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4018 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bits));
4019 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bitson));
4020 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.immediate));
4022 if (flags & NDR_OUT) {
4023 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
4025 return NDR_ERR_SUCCESS;
4028 static enum ndr_err_code ndr_pull_svcctl_SCSetServiceBitsA(struct ndr_pull *ndr, int flags, struct svcctl_SCSetServiceBitsA *r)
4030 TALLOC_CTX *_mem_save_handle_0;
4031 if (flags & NDR_IN) {
4032 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4033 NDR_PULL_ALLOC(ndr, r->in.handle);
4035 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
4036 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
4037 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4038 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
4039 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bits));
4040 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bitson));
4041 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.immediate));
4043 if (flags & NDR_OUT) {
4044 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
4046 return NDR_ERR_SUCCESS;
4049 _PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsA *r)
4051 ndr_print_struct(ndr, name, "svcctl_SCSetServiceBitsA");
4052 ndr->depth++;
4053 if (flags & NDR_SET_VALUES) {
4054 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
4056 if (flags & NDR_IN) {
4057 ndr_print_struct(ndr, "in", "svcctl_SCSetServiceBitsA");
4058 ndr->depth++;
4059 ndr_print_ptr(ndr, "handle", r->in.handle);
4060 ndr->depth++;
4061 ndr_print_policy_handle(ndr, "handle", r->in.handle);
4062 ndr->depth--;
4063 ndr_print_uint32(ndr, "bits", r->in.bits);
4064 ndr_print_uint32(ndr, "bitson", r->in.bitson);
4065 ndr_print_uint32(ndr, "immediate", r->in.immediate);
4066 ndr->depth--;
4068 if (flags & NDR_OUT) {
4069 ndr_print_struct(ndr, "out", "svcctl_SCSetServiceBitsA");
4070 ndr->depth++;
4071 ndr_print_WERROR(ndr, "result", r->out.result);
4072 ndr->depth--;
4074 ndr->depth--;
4077 static enum ndr_err_code ndr_push_svcctl_ChangeServiceConfigA(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfigA *r)
4079 if (flags & NDR_IN) {
4080 if (r->in.handle == NULL) {
4081 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4083 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4084 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
4085 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->in.start_type));
4086 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->in.error_control));
4087 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path));
4088 if (r->in.binary_path) {
4089 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
4090 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4091 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
4092 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4094 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.load_order_group));
4095 if (r->in.load_order_group) {
4096 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16)));
4097 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4098 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16)));
4099 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.load_order_group, ndr_charset_length(r->in.load_order_group, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4101 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies));
4102 if (r->in.dependencies) {
4103 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
4104 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4105 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
4106 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4108 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name));
4109 if (r->in.service_start_name) {
4110 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
4111 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4112 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
4113 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4115 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password));
4116 if (r->in.password) {
4117 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
4118 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4119 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
4120 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4122 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name));
4123 if (r->in.display_name) {
4124 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_name, CH_UTF16)));
4125 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4126 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_name, CH_UTF16)));
4127 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.display_name, ndr_charset_length(r->in.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4130 if (flags & NDR_OUT) {
4131 if (r->out.tag_id == NULL) {
4132 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4134 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.tag_id));
4135 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
4137 return NDR_ERR_SUCCESS;
4140 static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfigA(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfigA *r)
4142 uint32_t _ptr_binary_path;
4143 uint32_t _ptr_load_order_group;
4144 uint32_t _ptr_dependencies;
4145 uint32_t _ptr_service_start_name;
4146 uint32_t _ptr_password;
4147 uint32_t _ptr_display_name;
4148 TALLOC_CTX *_mem_save_handle_0;
4149 TALLOC_CTX *_mem_save_binary_path_0;
4150 TALLOC_CTX *_mem_save_load_order_group_0;
4151 TALLOC_CTX *_mem_save_tag_id_0;
4152 TALLOC_CTX *_mem_save_dependencies_0;
4153 TALLOC_CTX *_mem_save_service_start_name_0;
4154 TALLOC_CTX *_mem_save_password_0;
4155 TALLOC_CTX *_mem_save_display_name_0;
4156 if (flags & NDR_IN) {
4157 ZERO_STRUCT(r->out);
4159 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4160 NDR_PULL_ALLOC(ndr, r->in.handle);
4162 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
4163 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
4164 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4165 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
4166 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
4167 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->in.start_type));
4168 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->in.error_control));
4169 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path));
4170 if (_ptr_binary_path) {
4171 NDR_PULL_ALLOC(ndr, r->in.binary_path);
4172 } else {
4173 r->in.binary_path = NULL;
4175 if (r->in.binary_path) {
4176 _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
4177 NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0);
4178 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path));
4179 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path));
4180 if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) {
4181 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path));
4183 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t)));
4184 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16));
4185 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0);
4187 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_load_order_group));
4188 if (_ptr_load_order_group) {
4189 NDR_PULL_ALLOC(ndr, r->in.load_order_group);
4190 } else {
4191 r->in.load_order_group = NULL;
4193 if (r->in.load_order_group) {
4194 _mem_save_load_order_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
4195 NDR_PULL_SET_MEM_CTX(ndr, r->in.load_order_group, 0);
4196 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.load_order_group));
4197 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.load_order_group));
4198 if (ndr_get_array_length(ndr, &r->in.load_order_group) > ndr_get_array_size(ndr, &r->in.load_order_group)) {
4199 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.load_order_group), ndr_get_array_length(ndr, &r->in.load_order_group));
4201 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t)));
4202 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.load_order_group, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t), CH_UTF16));
4203 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_load_order_group_0, 0);
4205 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
4206 if (_ptr_dependencies) {
4207 NDR_PULL_ALLOC(ndr, r->in.dependencies);
4208 } else {
4209 r->in.dependencies = NULL;
4211 if (r->in.dependencies) {
4212 _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
4213 NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0);
4214 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies));
4215 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies));
4216 if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) {
4217 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies));
4219 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t)));
4220 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16));
4221 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
4223 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name));
4224 if (_ptr_service_start_name) {
4225 NDR_PULL_ALLOC(ndr, r->in.service_start_name);
4226 } else {
4227 r->in.service_start_name = NULL;
4229 if (r->in.service_start_name) {
4230 _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
4231 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0);
4232 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name));
4233 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name));
4234 if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) {
4235 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name));
4237 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t)));
4238 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16));
4239 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0);
4241 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
4242 if (_ptr_password) {
4243 NDR_PULL_ALLOC(ndr, r->in.password);
4244 } else {
4245 r->in.password = NULL;
4247 if (r->in.password) {
4248 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
4249 NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0);
4250 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password));
4251 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password));
4252 if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) {
4253 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password));
4255 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t)));
4256 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16));
4257 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
4259 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
4260 if (_ptr_display_name) {
4261 NDR_PULL_ALLOC(ndr, r->in.display_name);
4262 } else {
4263 r->in.display_name = NULL;
4265 if (r->in.display_name) {
4266 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
4267 NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name, 0);
4268 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.display_name));
4269 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.display_name));
4270 if (ndr_get_array_length(ndr, &r->in.display_name) > ndr_get_array_size(ndr, &r->in.display_name)) {
4271 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.display_name), ndr_get_array_length(ndr, &r->in.display_name));
4273 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t)));
4274 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.display_name, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t), CH_UTF16));
4275 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
4277 NDR_PULL_ALLOC(ndr, r->out.tag_id);
4278 ZERO_STRUCTP(r->out.tag_id);
4280 if (flags & NDR_OUT) {
4281 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4282 NDR_PULL_ALLOC(ndr, r->out.tag_id);
4284 _mem_save_tag_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
4285 NDR_PULL_SET_MEM_CTX(ndr, r->out.tag_id, LIBNDR_FLAG_REF_ALLOC);
4286 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.tag_id));
4287 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tag_id_0, LIBNDR_FLAG_REF_ALLOC);
4288 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
4290 return NDR_ERR_SUCCESS;
4293 _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigA *r)
4295 ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfigA");
4296 ndr->depth++;
4297 if (flags & NDR_SET_VALUES) {
4298 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
4300 if (flags & NDR_IN) {
4301 ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfigA");
4302 ndr->depth++;
4303 ndr_print_ptr(ndr, "handle", r->in.handle);
4304 ndr->depth++;
4305 ndr_print_policy_handle(ndr, "handle", r->in.handle);
4306 ndr->depth--;
4307 ndr_print_uint32(ndr, "type", r->in.type);
4308 ndr_print_svcctl_StartType(ndr, "start_type", r->in.start_type);
4309 ndr_print_svcctl_ErrorControl(ndr, "error_control", r->in.error_control);
4310 ndr_print_ptr(ndr, "binary_path", r->in.binary_path);
4311 ndr->depth++;
4312 if (r->in.binary_path) {
4313 ndr_print_string(ndr, "binary_path", r->in.binary_path);
4315 ndr->depth--;
4316 ndr_print_ptr(ndr, "load_order_group", r->in.load_order_group);
4317 ndr->depth++;
4318 if (r->in.load_order_group) {
4319 ndr_print_string(ndr, "load_order_group", r->in.load_order_group);
4321 ndr->depth--;
4322 ndr_print_ptr(ndr, "dependencies", r->in.dependencies);
4323 ndr->depth++;
4324 if (r->in.dependencies) {
4325 ndr_print_string(ndr, "dependencies", r->in.dependencies);
4327 ndr->depth--;
4328 ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name);
4329 ndr->depth++;
4330 if (r->in.service_start_name) {
4331 ndr_print_string(ndr, "service_start_name", r->in.service_start_name);
4333 ndr->depth--;
4334 ndr_print_ptr(ndr, "password", r->in.password);
4335 ndr->depth++;
4336 if (r->in.password) {
4337 ndr_print_string(ndr, "password", r->in.password);
4339 ndr->depth--;
4340 ndr_print_ptr(ndr, "display_name", r->in.display_name);
4341 ndr->depth++;
4342 if (r->in.display_name) {
4343 ndr_print_string(ndr, "display_name", r->in.display_name);
4345 ndr->depth--;
4346 ndr->depth--;
4348 if (flags & NDR_OUT) {
4349 ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfigA");
4350 ndr->depth++;
4351 ndr_print_ptr(ndr, "tag_id", r->out.tag_id);
4352 ndr->depth++;
4353 ndr_print_uint32(ndr, "tag_id", *r->out.tag_id);
4354 ndr->depth--;
4355 ndr_print_WERROR(ndr, "result", r->out.result);
4356 ndr->depth--;
4358 ndr->depth--;
4361 static enum ndr_err_code ndr_push_svcctl_CreateServiceA(struct ndr_push *ndr, int flags, const struct svcctl_CreateServiceA *r)
4363 if (flags & NDR_IN) {
4364 if (r->in.handle == NULL) {
4365 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4367 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4368 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName));
4369 if (r->in.ServiceName) {
4370 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
4371 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4372 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
4373 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4375 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DisplayName));
4376 if (r->in.DisplayName) {
4377 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16)));
4378 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4379 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16)));
4380 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DisplayName, ndr_charset_length(r->in.DisplayName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4382 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.desired_access));
4383 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
4384 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->in.start_type));
4385 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->in.error_control));
4386 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path));
4387 if (r->in.binary_path) {
4388 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
4389 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4390 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
4391 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4393 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.LoadOrderGroupKey));
4394 if (r->in.LoadOrderGroupKey) {
4395 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16)));
4396 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4397 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16)));
4398 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.LoadOrderGroupKey, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4400 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies));
4401 if (r->in.dependencies) {
4402 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
4403 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4404 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
4405 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4407 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name));
4408 if (r->in.service_start_name) {
4409 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
4410 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4411 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
4412 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4414 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password));
4415 if (r->in.password) {
4416 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
4417 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4418 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
4419 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4422 if (flags & NDR_OUT) {
4423 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.TagId));
4424 if (r->out.TagId) {
4425 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId));
4427 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
4429 return NDR_ERR_SUCCESS;
4432 static enum ndr_err_code ndr_pull_svcctl_CreateServiceA(struct ndr_pull *ndr, int flags, struct svcctl_CreateServiceA *r)
4434 uint32_t _ptr_ServiceName;
4435 uint32_t _ptr_DisplayName;
4436 uint32_t _ptr_binary_path;
4437 uint32_t _ptr_LoadOrderGroupKey;
4438 uint32_t _ptr_TagId;
4439 uint32_t _ptr_dependencies;
4440 uint32_t _ptr_service_start_name;
4441 uint32_t _ptr_password;
4442 TALLOC_CTX *_mem_save_handle_0;
4443 TALLOC_CTX *_mem_save_ServiceName_0;
4444 TALLOC_CTX *_mem_save_DisplayName_0;
4445 TALLOC_CTX *_mem_save_binary_path_0;
4446 TALLOC_CTX *_mem_save_LoadOrderGroupKey_0;
4447 TALLOC_CTX *_mem_save_TagId_0;
4448 TALLOC_CTX *_mem_save_dependencies_0;
4449 TALLOC_CTX *_mem_save_service_start_name_0;
4450 TALLOC_CTX *_mem_save_password_0;
4451 if (flags & NDR_IN) {
4452 ZERO_STRUCT(r->out);
4454 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4455 NDR_PULL_ALLOC(ndr, r->in.handle);
4457 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
4458 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
4459 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4460 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
4461 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ServiceName));
4462 if (_ptr_ServiceName) {
4463 NDR_PULL_ALLOC(ndr, r->in.ServiceName);
4464 } else {
4465 r->in.ServiceName = NULL;
4467 if (r->in.ServiceName) {
4468 _mem_save_ServiceName_0 = NDR_PULL_GET_MEM_CTX(ndr);
4469 NDR_PULL_SET_MEM_CTX(ndr, r->in.ServiceName, 0);
4470 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName));
4471 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName));
4472 if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) {
4473 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName));
4475 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t)));
4476 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16));
4477 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ServiceName_0, 0);
4479 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DisplayName));
4480 if (_ptr_DisplayName) {
4481 NDR_PULL_ALLOC(ndr, r->in.DisplayName);
4482 } else {
4483 r->in.DisplayName = NULL;
4485 if (r->in.DisplayName) {
4486 _mem_save_DisplayName_0 = NDR_PULL_GET_MEM_CTX(ndr);
4487 NDR_PULL_SET_MEM_CTX(ndr, r->in.DisplayName, 0);
4488 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DisplayName));
4489 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DisplayName));
4490 if (ndr_get_array_length(ndr, &r->in.DisplayName) > ndr_get_array_size(ndr, &r->in.DisplayName)) {
4491 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DisplayName), ndr_get_array_length(ndr, &r->in.DisplayName));
4493 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t)));
4494 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DisplayName, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t), CH_UTF16));
4495 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DisplayName_0, 0);
4497 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.desired_access));
4498 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
4499 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->in.start_type));
4500 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->in.error_control));
4501 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path));
4502 if (_ptr_binary_path) {
4503 NDR_PULL_ALLOC(ndr, r->in.binary_path);
4504 } else {
4505 r->in.binary_path = NULL;
4507 if (r->in.binary_path) {
4508 _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
4509 NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0);
4510 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path));
4511 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path));
4512 if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) {
4513 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path));
4515 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t)));
4516 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16));
4517 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0);
4519 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LoadOrderGroupKey));
4520 if (_ptr_LoadOrderGroupKey) {
4521 NDR_PULL_ALLOC(ndr, r->in.LoadOrderGroupKey);
4522 } else {
4523 r->in.LoadOrderGroupKey = NULL;
4525 if (r->in.LoadOrderGroupKey) {
4526 _mem_save_LoadOrderGroupKey_0 = NDR_PULL_GET_MEM_CTX(ndr);
4527 NDR_PULL_SET_MEM_CTX(ndr, r->in.LoadOrderGroupKey, 0);
4528 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.LoadOrderGroupKey));
4529 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.LoadOrderGroupKey));
4530 if (ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey) > ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey)) {
4531 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey), ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey));
4533 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t)));
4534 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.LoadOrderGroupKey, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t), CH_UTF16));
4535 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LoadOrderGroupKey_0, 0);
4537 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
4538 if (_ptr_dependencies) {
4539 NDR_PULL_ALLOC(ndr, r->in.dependencies);
4540 } else {
4541 r->in.dependencies = NULL;
4543 if (r->in.dependencies) {
4544 _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
4545 NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0);
4546 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies));
4547 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies));
4548 if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) {
4549 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies));
4551 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t)));
4552 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16));
4553 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
4555 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name));
4556 if (_ptr_service_start_name) {
4557 NDR_PULL_ALLOC(ndr, r->in.service_start_name);
4558 } else {
4559 r->in.service_start_name = NULL;
4561 if (r->in.service_start_name) {
4562 _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
4563 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0);
4564 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name));
4565 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name));
4566 if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) {
4567 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name));
4569 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t)));
4570 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16));
4571 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0);
4573 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
4574 if (_ptr_password) {
4575 NDR_PULL_ALLOC(ndr, r->in.password);
4576 } else {
4577 r->in.password = NULL;
4579 if (r->in.password) {
4580 _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
4581 NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0);
4582 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password));
4583 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password));
4584 if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) {
4585 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password));
4587 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t)));
4588 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16));
4589 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
4592 if (flags & NDR_OUT) {
4593 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId));
4594 if (_ptr_TagId) {
4595 NDR_PULL_ALLOC(ndr, r->out.TagId);
4596 } else {
4597 r->out.TagId = NULL;
4599 if (r->out.TagId) {
4600 _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr);
4601 NDR_PULL_SET_MEM_CTX(ndr, r->out.TagId, 0);
4602 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.TagId));
4603 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0);
4605 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
4607 return NDR_ERR_SUCCESS;
4610 _PUBLIC_ void ndr_print_svcctl_CreateServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceA *r)
4612 ndr_print_struct(ndr, name, "svcctl_CreateServiceA");
4613 ndr->depth++;
4614 if (flags & NDR_SET_VALUES) {
4615 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
4617 if (flags & NDR_IN) {
4618 ndr_print_struct(ndr, "in", "svcctl_CreateServiceA");
4619 ndr->depth++;
4620 ndr_print_ptr(ndr, "handle", r->in.handle);
4621 ndr->depth++;
4622 ndr_print_policy_handle(ndr, "handle", r->in.handle);
4623 ndr->depth--;
4624 ndr_print_ptr(ndr, "ServiceName", r->in.ServiceName);
4625 ndr->depth++;
4626 if (r->in.ServiceName) {
4627 ndr_print_string(ndr, "ServiceName", r->in.ServiceName);
4629 ndr->depth--;
4630 ndr_print_ptr(ndr, "DisplayName", r->in.DisplayName);
4631 ndr->depth++;
4632 if (r->in.DisplayName) {
4633 ndr_print_string(ndr, "DisplayName", r->in.DisplayName);
4635 ndr->depth--;
4636 ndr_print_uint32(ndr, "desired_access", r->in.desired_access);
4637 ndr_print_uint32(ndr, "type", r->in.type);
4638 ndr_print_svcctl_StartType(ndr, "start_type", r->in.start_type);
4639 ndr_print_svcctl_ErrorControl(ndr, "error_control", r->in.error_control);
4640 ndr_print_ptr(ndr, "binary_path", r->in.binary_path);
4641 ndr->depth++;
4642 if (r->in.binary_path) {
4643 ndr_print_string(ndr, "binary_path", r->in.binary_path);
4645 ndr->depth--;
4646 ndr_print_ptr(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey);
4647 ndr->depth++;
4648 if (r->in.LoadOrderGroupKey) {
4649 ndr_print_string(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey);
4651 ndr->depth--;
4652 ndr_print_ptr(ndr, "dependencies", r->in.dependencies);
4653 ndr->depth++;
4654 if (r->in.dependencies) {
4655 ndr_print_string(ndr, "dependencies", r->in.dependencies);
4657 ndr->depth--;
4658 ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name);
4659 ndr->depth++;
4660 if (r->in.service_start_name) {
4661 ndr_print_string(ndr, "service_start_name", r->in.service_start_name);
4663 ndr->depth--;
4664 ndr_print_ptr(ndr, "password", r->in.password);
4665 ndr->depth++;
4666 if (r->in.password) {
4667 ndr_print_string(ndr, "password", r->in.password);
4669 ndr->depth--;
4670 ndr->depth--;
4672 if (flags & NDR_OUT) {
4673 ndr_print_struct(ndr, "out", "svcctl_CreateServiceA");
4674 ndr->depth++;
4675 ndr_print_ptr(ndr, "TagId", r->out.TagId);
4676 ndr->depth++;
4677 if (r->out.TagId) {
4678 ndr_print_uint32(ndr, "TagId", *r->out.TagId);
4680 ndr->depth--;
4681 ndr_print_WERROR(ndr, "result", r->out.result);
4682 ndr->depth--;
4684 ndr->depth--;
4687 static enum ndr_err_code ndr_push_svcctl_EnumDependentServicesA(struct ndr_push *ndr, int flags, const struct svcctl_EnumDependentServicesA *r)
4689 if (flags & NDR_IN) {
4690 if (r->in.service == NULL) {
4691 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4693 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.service));
4694 NDR_CHECK(ndr_push_svcctl_ServiceState(ndr, NDR_SCALARS, r->in.state));
4695 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
4697 if (flags & NDR_OUT) {
4698 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.service_status));
4699 if (r->out.service_status) {
4700 NDR_CHECK(ndr_push_ENUM_SERVICE_STATUSA(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.service_status));
4702 if (r->out.needed == NULL) {
4703 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4705 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
4706 if (r->out.services_returned == NULL) {
4707 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4709 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned));
4710 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
4712 return NDR_ERR_SUCCESS;
4715 static enum ndr_err_code ndr_pull_svcctl_EnumDependentServicesA(struct ndr_pull *ndr, int flags, struct svcctl_EnumDependentServicesA *r)
4717 uint32_t _ptr_service_status;
4718 TALLOC_CTX *_mem_save_service_0;
4719 TALLOC_CTX *_mem_save_service_status_0;
4720 TALLOC_CTX *_mem_save_needed_0;
4721 TALLOC_CTX *_mem_save_services_returned_0;
4722 if (flags & NDR_IN) {
4723 ZERO_STRUCT(r->out);
4725 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4726 NDR_PULL_ALLOC(ndr, r->in.service);
4728 _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr);
4729 NDR_PULL_SET_MEM_CTX(ndr, r->in.service, LIBNDR_FLAG_REF_ALLOC);
4730 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.service));
4731 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, LIBNDR_FLAG_REF_ALLOC);
4732 NDR_CHECK(ndr_pull_svcctl_ServiceState(ndr, NDR_SCALARS, &r->in.state));
4733 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
4734 NDR_PULL_ALLOC(ndr, r->out.needed);
4735 ZERO_STRUCTP(r->out.needed);
4736 NDR_PULL_ALLOC(ndr, r->out.services_returned);
4737 ZERO_STRUCTP(r->out.services_returned);
4739 if (flags & NDR_OUT) {
4740 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_status));
4741 if (_ptr_service_status) {
4742 NDR_PULL_ALLOC(ndr, r->out.service_status);
4743 } else {
4744 r->out.service_status = NULL;
4746 if (r->out.service_status) {
4747 _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
4748 NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, 0);
4749 NDR_CHECK(ndr_pull_ENUM_SERVICE_STATUSA(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.service_status));
4750 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, 0);
4752 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4753 NDR_PULL_ALLOC(ndr, r->out.needed);
4755 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
4756 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
4757 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
4758 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
4759 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4760 NDR_PULL_ALLOC(ndr, r->out.services_returned);
4762 _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
4763 NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC);
4764 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned));
4765 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC);
4766 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
4768 return NDR_ERR_SUCCESS;
4771 _PUBLIC_ void ndr_print_svcctl_EnumDependentServicesA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesA *r)
4773 ndr_print_struct(ndr, name, "svcctl_EnumDependentServicesA");
4774 ndr->depth++;
4775 if (flags & NDR_SET_VALUES) {
4776 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
4778 if (flags & NDR_IN) {
4779 ndr_print_struct(ndr, "in", "svcctl_EnumDependentServicesA");
4780 ndr->depth++;
4781 ndr_print_ptr(ndr, "service", r->in.service);
4782 ndr->depth++;
4783 ndr_print_policy_handle(ndr, "service", r->in.service);
4784 ndr->depth--;
4785 ndr_print_svcctl_ServiceState(ndr, "state", r->in.state);
4786 ndr_print_uint32(ndr, "offered", r->in.offered);
4787 ndr->depth--;
4789 if (flags & NDR_OUT) {
4790 ndr_print_struct(ndr, "out", "svcctl_EnumDependentServicesA");
4791 ndr->depth++;
4792 ndr_print_ptr(ndr, "service_status", r->out.service_status);
4793 ndr->depth++;
4794 if (r->out.service_status) {
4795 ndr_print_ENUM_SERVICE_STATUSA(ndr, "service_status", r->out.service_status);
4797 ndr->depth--;
4798 ndr_print_ptr(ndr, "needed", r->out.needed);
4799 ndr->depth++;
4800 ndr_print_uint32(ndr, "needed", *r->out.needed);
4801 ndr->depth--;
4802 ndr_print_ptr(ndr, "services_returned", r->out.services_returned);
4803 ndr->depth++;
4804 ndr_print_uint32(ndr, "services_returned", *r->out.services_returned);
4805 ndr->depth--;
4806 ndr_print_WERROR(ndr, "result", r->out.result);
4807 ndr->depth--;
4809 ndr->depth--;
4812 static enum ndr_err_code ndr_push_svcctl_EnumServicesStatusA(struct ndr_push *ndr, int flags, const struct svcctl_EnumServicesStatusA *r)
4814 if (flags & NDR_IN) {
4815 if (r->in.handle == NULL) {
4816 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4818 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4819 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
4820 NDR_CHECK(ndr_push_svcctl_ServiceState(ndr, NDR_SCALARS, r->in.state));
4821 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
4822 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle));
4823 if (r->in.resume_handle) {
4824 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle));
4827 if (flags & NDR_OUT) {
4828 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
4829 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service, r->in.offered));
4830 if (r->out.needed == NULL) {
4831 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4833 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
4834 if (r->out.services_returned == NULL) {
4835 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4837 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned));
4838 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle));
4839 if (r->out.resume_handle) {
4840 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle));
4842 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
4844 return NDR_ERR_SUCCESS;
4847 static enum ndr_err_code ndr_pull_svcctl_EnumServicesStatusA(struct ndr_pull *ndr, int flags, struct svcctl_EnumServicesStatusA *r)
4849 uint32_t _ptr_resume_handle;
4850 TALLOC_CTX *_mem_save_handle_0;
4851 TALLOC_CTX *_mem_save_needed_0;
4852 TALLOC_CTX *_mem_save_services_returned_0;
4853 TALLOC_CTX *_mem_save_resume_handle_0;
4854 if (flags & NDR_IN) {
4855 ZERO_STRUCT(r->out);
4857 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4858 NDR_PULL_ALLOC(ndr, r->in.handle);
4860 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
4861 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
4862 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
4863 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
4864 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
4865 NDR_CHECK(ndr_pull_svcctl_ServiceState(ndr, NDR_SCALARS, &r->in.state));
4866 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
4867 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
4868 if (_ptr_resume_handle) {
4869 NDR_PULL_ALLOC(ndr, r->in.resume_handle);
4870 } else {
4871 r->in.resume_handle = NULL;
4873 if (r->in.resume_handle) {
4874 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
4875 NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0);
4876 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle));
4877 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
4879 NDR_PULL_ALLOC(ndr, r->out.needed);
4880 ZERO_STRUCTP(r->out.needed);
4881 NDR_PULL_ALLOC(ndr, r->out.services_returned);
4882 ZERO_STRUCTP(r->out.services_returned);
4884 if (flags & NDR_OUT) {
4885 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service));
4886 NDR_PULL_ALLOC_N(ndr, r->out.service, ndr_get_array_size(ndr, &r->out.service));
4887 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service, ndr_get_array_size(ndr, &r->out.service)));
4888 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4889 NDR_PULL_ALLOC(ndr, r->out.needed);
4891 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
4892 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
4893 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
4894 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
4895 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
4896 NDR_PULL_ALLOC(ndr, r->out.services_returned);
4898 _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
4899 NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC);
4900 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned));
4901 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC);
4902 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
4903 if (_ptr_resume_handle) {
4904 NDR_PULL_ALLOC(ndr, r->out.resume_handle);
4905 } else {
4906 r->out.resume_handle = NULL;
4908 if (r->out.resume_handle) {
4909 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
4910 NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0);
4911 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle));
4912 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
4914 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
4915 if (r->out.service) {
4916 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service, r->in.offered));
4919 return NDR_ERR_SUCCESS;
4922 _PUBLIC_ void ndr_print_svcctl_EnumServicesStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusA *r)
4924 ndr_print_struct(ndr, name, "svcctl_EnumServicesStatusA");
4925 ndr->depth++;
4926 if (flags & NDR_SET_VALUES) {
4927 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
4929 if (flags & NDR_IN) {
4930 ndr_print_struct(ndr, "in", "svcctl_EnumServicesStatusA");
4931 ndr->depth++;
4932 ndr_print_ptr(ndr, "handle", r->in.handle);
4933 ndr->depth++;
4934 ndr_print_policy_handle(ndr, "handle", r->in.handle);
4935 ndr->depth--;
4936 ndr_print_uint32(ndr, "type", r->in.type);
4937 ndr_print_svcctl_ServiceState(ndr, "state", r->in.state);
4938 ndr_print_uint32(ndr, "offered", r->in.offered);
4939 ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle);
4940 ndr->depth++;
4941 if (r->in.resume_handle) {
4942 ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle);
4944 ndr->depth--;
4945 ndr->depth--;
4947 if (flags & NDR_OUT) {
4948 ndr_print_struct(ndr, "out", "svcctl_EnumServicesStatusA");
4949 ndr->depth++;
4950 ndr_print_array_uint8(ndr, "service", r->out.service, r->in.offered);
4951 ndr_print_ptr(ndr, "needed", r->out.needed);
4952 ndr->depth++;
4953 ndr_print_uint32(ndr, "needed", *r->out.needed);
4954 ndr->depth--;
4955 ndr_print_ptr(ndr, "services_returned", r->out.services_returned);
4956 ndr->depth++;
4957 ndr_print_uint32(ndr, "services_returned", *r->out.services_returned);
4958 ndr->depth--;
4959 ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle);
4960 ndr->depth++;
4961 if (r->out.resume_handle) {
4962 ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle);
4964 ndr->depth--;
4965 ndr_print_WERROR(ndr, "result", r->out.result);
4966 ndr->depth--;
4968 ndr->depth--;
4971 static enum ndr_err_code ndr_push_svcctl_OpenSCManagerA(struct ndr_push *ndr, int flags, const struct svcctl_OpenSCManagerA *r)
4973 if (flags & NDR_IN) {
4974 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.MachineName));
4975 if (r->in.MachineName) {
4976 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16)));
4977 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4978 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16)));
4979 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.MachineName, ndr_charset_length(r->in.MachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4981 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DatabaseName));
4982 if (r->in.DatabaseName) {
4983 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16)));
4984 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
4985 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16)));
4986 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DatabaseName, ndr_charset_length(r->in.DatabaseName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4988 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask));
4990 if (flags & NDR_OUT) {
4991 if (r->out.handle == NULL) {
4992 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
4994 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
4995 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
4997 return NDR_ERR_SUCCESS;
5000 static enum ndr_err_code ndr_pull_svcctl_OpenSCManagerA(struct ndr_pull *ndr, int flags, struct svcctl_OpenSCManagerA *r)
5002 uint32_t _ptr_MachineName;
5003 uint32_t _ptr_DatabaseName;
5004 TALLOC_CTX *_mem_save_MachineName_0;
5005 TALLOC_CTX *_mem_save_DatabaseName_0;
5006 TALLOC_CTX *_mem_save_handle_0;
5007 if (flags & NDR_IN) {
5008 ZERO_STRUCT(r->out);
5010 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_MachineName));
5011 if (_ptr_MachineName) {
5012 NDR_PULL_ALLOC(ndr, r->in.MachineName);
5013 } else {
5014 r->in.MachineName = NULL;
5016 if (r->in.MachineName) {
5017 _mem_save_MachineName_0 = NDR_PULL_GET_MEM_CTX(ndr);
5018 NDR_PULL_SET_MEM_CTX(ndr, r->in.MachineName, 0);
5019 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.MachineName));
5020 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.MachineName));
5021 if (ndr_get_array_length(ndr, &r->in.MachineName) > ndr_get_array_size(ndr, &r->in.MachineName)) {
5022 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.MachineName), ndr_get_array_length(ndr, &r->in.MachineName));
5024 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t)));
5025 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.MachineName, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t), CH_UTF16));
5026 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_MachineName_0, 0);
5028 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DatabaseName));
5029 if (_ptr_DatabaseName) {
5030 NDR_PULL_ALLOC(ndr, r->in.DatabaseName);
5031 } else {
5032 r->in.DatabaseName = NULL;
5034 if (r->in.DatabaseName) {
5035 _mem_save_DatabaseName_0 = NDR_PULL_GET_MEM_CTX(ndr);
5036 NDR_PULL_SET_MEM_CTX(ndr, r->in.DatabaseName, 0);
5037 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DatabaseName));
5038 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DatabaseName));
5039 if (ndr_get_array_length(ndr, &r->in.DatabaseName) > ndr_get_array_size(ndr, &r->in.DatabaseName)) {
5040 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DatabaseName), ndr_get_array_length(ndr, &r->in.DatabaseName));
5042 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t)));
5043 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DatabaseName, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t), CH_UTF16));
5044 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DatabaseName_0, 0);
5046 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask));
5047 NDR_PULL_ALLOC(ndr, r->out.handle);
5048 ZERO_STRUCTP(r->out.handle);
5050 if (flags & NDR_OUT) {
5051 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5052 NDR_PULL_ALLOC(ndr, r->out.handle);
5054 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5055 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
5056 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
5057 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
5058 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5060 return NDR_ERR_SUCCESS;
5063 _PUBLIC_ void ndr_print_svcctl_OpenSCManagerA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerA *r)
5065 ndr_print_struct(ndr, name, "svcctl_OpenSCManagerA");
5066 ndr->depth++;
5067 if (flags & NDR_SET_VALUES) {
5068 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5070 if (flags & NDR_IN) {
5071 ndr_print_struct(ndr, "in", "svcctl_OpenSCManagerA");
5072 ndr->depth++;
5073 ndr_print_ptr(ndr, "MachineName", r->in.MachineName);
5074 ndr->depth++;
5075 if (r->in.MachineName) {
5076 ndr_print_string(ndr, "MachineName", r->in.MachineName);
5078 ndr->depth--;
5079 ndr_print_ptr(ndr, "DatabaseName", r->in.DatabaseName);
5080 ndr->depth++;
5081 if (r->in.DatabaseName) {
5082 ndr_print_string(ndr, "DatabaseName", r->in.DatabaseName);
5084 ndr->depth--;
5085 ndr_print_uint32(ndr, "access_mask", r->in.access_mask);
5086 ndr->depth--;
5088 if (flags & NDR_OUT) {
5089 ndr_print_struct(ndr, "out", "svcctl_OpenSCManagerA");
5090 ndr->depth++;
5091 ndr_print_ptr(ndr, "handle", r->out.handle);
5092 ndr->depth++;
5093 ndr_print_policy_handle(ndr, "handle", r->out.handle);
5094 ndr->depth--;
5095 ndr_print_WERROR(ndr, "result", r->out.result);
5096 ndr->depth--;
5098 ndr->depth--;
5101 static enum ndr_err_code ndr_push_svcctl_OpenServiceA(struct ndr_push *ndr, int flags, const struct svcctl_OpenServiceA *r)
5103 if (flags & NDR_IN) {
5104 if (r->in.scmanager_handle == NULL) {
5105 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5107 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
5108 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName));
5109 if (r->in.ServiceName) {
5110 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
5111 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5112 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
5113 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5115 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask));
5117 if (flags & NDR_OUT) {
5118 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5120 return NDR_ERR_SUCCESS;
5123 static enum ndr_err_code ndr_pull_svcctl_OpenServiceA(struct ndr_pull *ndr, int flags, struct svcctl_OpenServiceA *r)
5125 uint32_t _ptr_ServiceName;
5126 TALLOC_CTX *_mem_save_scmanager_handle_0;
5127 TALLOC_CTX *_mem_save_ServiceName_0;
5128 if (flags & NDR_IN) {
5129 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5130 NDR_PULL_ALLOC(ndr, r->in.scmanager_handle);
5132 _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5133 NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC);
5134 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
5135 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC);
5136 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ServiceName));
5137 if (_ptr_ServiceName) {
5138 NDR_PULL_ALLOC(ndr, r->in.ServiceName);
5139 } else {
5140 r->in.ServiceName = NULL;
5142 if (r->in.ServiceName) {
5143 _mem_save_ServiceName_0 = NDR_PULL_GET_MEM_CTX(ndr);
5144 NDR_PULL_SET_MEM_CTX(ndr, r->in.ServiceName, 0);
5145 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName));
5146 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName));
5147 if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) {
5148 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName));
5150 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t)));
5151 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16));
5152 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ServiceName_0, 0);
5154 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask));
5156 if (flags & NDR_OUT) {
5157 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5159 return NDR_ERR_SUCCESS;
5162 _PUBLIC_ void ndr_print_svcctl_OpenServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceA *r)
5164 ndr_print_struct(ndr, name, "svcctl_OpenServiceA");
5165 ndr->depth++;
5166 if (flags & NDR_SET_VALUES) {
5167 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5169 if (flags & NDR_IN) {
5170 ndr_print_struct(ndr, "in", "svcctl_OpenServiceA");
5171 ndr->depth++;
5172 ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle);
5173 ndr->depth++;
5174 ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle);
5175 ndr->depth--;
5176 ndr_print_ptr(ndr, "ServiceName", r->in.ServiceName);
5177 ndr->depth++;
5178 if (r->in.ServiceName) {
5179 ndr_print_string(ndr, "ServiceName", r->in.ServiceName);
5181 ndr->depth--;
5182 ndr_print_uint32(ndr, "access_mask", r->in.access_mask);
5183 ndr->depth--;
5185 if (flags & NDR_OUT) {
5186 ndr_print_struct(ndr, "out", "svcctl_OpenServiceA");
5187 ndr->depth++;
5188 ndr_print_WERROR(ndr, "result", r->out.result);
5189 ndr->depth--;
5191 ndr->depth--;
5194 static enum ndr_err_code ndr_push_svcctl_QueryServiceConfigA(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfigA *r)
5196 if (flags & NDR_IN) {
5197 if (r->in.handle == NULL) {
5198 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5200 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5201 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
5203 if (flags & NDR_OUT) {
5204 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.offered));
5205 if (r->out.needed == NULL) {
5206 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5208 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
5209 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5211 return NDR_ERR_SUCCESS;
5214 static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigA(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfigA *r)
5216 TALLOC_CTX *_mem_save_handle_0;
5217 TALLOC_CTX *_mem_save_needed_0;
5218 if (flags & NDR_IN) {
5219 ZERO_STRUCT(r->out);
5221 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5222 NDR_PULL_ALLOC(ndr, r->in.handle);
5224 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5225 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
5226 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5227 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
5228 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
5229 NDR_PULL_ALLOC(ndr, r->out.needed);
5230 ZERO_STRUCTP(r->out.needed);
5232 if (flags & NDR_OUT) {
5233 NDR_PULL_ALLOC_N(ndr, r->out.query, r->in.offered);
5234 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.offered));
5235 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5236 NDR_PULL_ALLOC(ndr, r->out.needed);
5238 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
5239 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
5240 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
5241 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
5242 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5244 return NDR_ERR_SUCCESS;
5247 _PUBLIC_ void ndr_print_svcctl_QueryServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigA *r)
5249 ndr_print_struct(ndr, name, "svcctl_QueryServiceConfigA");
5250 ndr->depth++;
5251 if (flags & NDR_SET_VALUES) {
5252 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5254 if (flags & NDR_IN) {
5255 ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfigA");
5256 ndr->depth++;
5257 ndr_print_ptr(ndr, "handle", r->in.handle);
5258 ndr->depth++;
5259 ndr_print_policy_handle(ndr, "handle", r->in.handle);
5260 ndr->depth--;
5261 ndr_print_uint32(ndr, "offered", r->in.offered);
5262 ndr->depth--;
5264 if (flags & NDR_OUT) {
5265 ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfigA");
5266 ndr->depth++;
5267 ndr_print_array_uint8(ndr, "query", r->out.query, r->in.offered);
5268 ndr_print_ptr(ndr, "needed", r->out.needed);
5269 ndr->depth++;
5270 ndr_print_uint32(ndr, "needed", *r->out.needed);
5271 ndr->depth--;
5272 ndr_print_WERROR(ndr, "result", r->out.result);
5273 ndr->depth--;
5275 ndr->depth--;
5278 static enum ndr_err_code ndr_push_svcctl_QueryServiceLockStatusA(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceLockStatusA *r)
5280 if (flags & NDR_IN) {
5281 if (r->in.handle == NULL) {
5282 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5284 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5285 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
5287 if (flags & NDR_OUT) {
5288 if (r->out.lock_status == NULL) {
5289 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5291 NDR_CHECK(ndr_push_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status));
5292 if (r->out.needed == NULL) {
5293 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5295 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
5296 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5298 return NDR_ERR_SUCCESS;
5301 static enum ndr_err_code ndr_pull_svcctl_QueryServiceLockStatusA(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceLockStatusA *r)
5303 TALLOC_CTX *_mem_save_handle_0;
5304 TALLOC_CTX *_mem_save_lock_status_0;
5305 TALLOC_CTX *_mem_save_needed_0;
5306 if (flags & NDR_IN) {
5307 ZERO_STRUCT(r->out);
5309 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5310 NDR_PULL_ALLOC(ndr, r->in.handle);
5312 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5313 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
5314 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5315 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
5316 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
5317 NDR_PULL_ALLOC(ndr, r->out.lock_status);
5318 ZERO_STRUCTP(r->out.lock_status);
5319 NDR_PULL_ALLOC(ndr, r->out.needed);
5320 ZERO_STRUCTP(r->out.needed);
5322 if (flags & NDR_OUT) {
5323 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5324 NDR_PULL_ALLOC(ndr, r->out.lock_status);
5326 _mem_save_lock_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
5327 NDR_PULL_SET_MEM_CTX(ndr, r->out.lock_status, LIBNDR_FLAG_REF_ALLOC);
5328 NDR_CHECK(ndr_pull_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status));
5329 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_status_0, LIBNDR_FLAG_REF_ALLOC);
5330 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5331 NDR_PULL_ALLOC(ndr, r->out.needed);
5333 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
5334 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
5335 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
5336 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
5337 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5339 return NDR_ERR_SUCCESS;
5342 _PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusA *r)
5344 ndr_print_struct(ndr, name, "svcctl_QueryServiceLockStatusA");
5345 ndr->depth++;
5346 if (flags & NDR_SET_VALUES) {
5347 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5349 if (flags & NDR_IN) {
5350 ndr_print_struct(ndr, "in", "svcctl_QueryServiceLockStatusA");
5351 ndr->depth++;
5352 ndr_print_ptr(ndr, "handle", r->in.handle);
5353 ndr->depth++;
5354 ndr_print_policy_handle(ndr, "handle", r->in.handle);
5355 ndr->depth--;
5356 ndr_print_uint32(ndr, "offered", r->in.offered);
5357 ndr->depth--;
5359 if (flags & NDR_OUT) {
5360 ndr_print_struct(ndr, "out", "svcctl_QueryServiceLockStatusA");
5361 ndr->depth++;
5362 ndr_print_ptr(ndr, "lock_status", r->out.lock_status);
5363 ndr->depth++;
5364 ndr_print_SERVICE_LOCK_STATUS(ndr, "lock_status", r->out.lock_status);
5365 ndr->depth--;
5366 ndr_print_ptr(ndr, "needed", r->out.needed);
5367 ndr->depth++;
5368 ndr_print_uint32(ndr, "needed", *r->out.needed);
5369 ndr->depth--;
5370 ndr_print_WERROR(ndr, "result", r->out.result);
5371 ndr->depth--;
5373 ndr->depth--;
5376 static enum ndr_err_code ndr_push_svcctl_StartServiceA(struct ndr_push *ndr, int flags, const struct svcctl_StartServiceA *r)
5378 if (flags & NDR_IN) {
5379 if (r->in.handle == NULL) {
5380 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5382 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5383 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs));
5384 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments));
5385 if (r->in.Arguments) {
5386 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16)));
5387 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5388 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16)));
5389 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Arguments, ndr_charset_length(r->in.Arguments, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5392 if (flags & NDR_OUT) {
5393 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5395 return NDR_ERR_SUCCESS;
5398 static enum ndr_err_code ndr_pull_svcctl_StartServiceA(struct ndr_pull *ndr, int flags, struct svcctl_StartServiceA *r)
5400 uint32_t _ptr_Arguments;
5401 TALLOC_CTX *_mem_save_handle_0;
5402 TALLOC_CTX *_mem_save_Arguments_0;
5403 if (flags & NDR_IN) {
5404 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5405 NDR_PULL_ALLOC(ndr, r->in.handle);
5407 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5408 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
5409 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5410 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
5411 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.NumArgs));
5412 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Arguments));
5413 if (_ptr_Arguments) {
5414 NDR_PULL_ALLOC(ndr, r->in.Arguments);
5415 } else {
5416 r->in.Arguments = NULL;
5418 if (r->in.Arguments) {
5419 _mem_save_Arguments_0 = NDR_PULL_GET_MEM_CTX(ndr);
5420 NDR_PULL_SET_MEM_CTX(ndr, r->in.Arguments, 0);
5421 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Arguments));
5422 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Arguments));
5423 if (ndr_get_array_length(ndr, &r->in.Arguments) > ndr_get_array_size(ndr, &r->in.Arguments)) {
5424 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Arguments), ndr_get_array_length(ndr, &r->in.Arguments));
5426 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t)));
5427 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Arguments, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t), CH_UTF16));
5428 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Arguments_0, 0);
5431 if (flags & NDR_OUT) {
5432 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5434 return NDR_ERR_SUCCESS;
5437 _PUBLIC_ void ndr_print_svcctl_StartServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceA *r)
5439 ndr_print_struct(ndr, name, "svcctl_StartServiceA");
5440 ndr->depth++;
5441 if (flags & NDR_SET_VALUES) {
5442 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5444 if (flags & NDR_IN) {
5445 ndr_print_struct(ndr, "in", "svcctl_StartServiceA");
5446 ndr->depth++;
5447 ndr_print_ptr(ndr, "handle", r->in.handle);
5448 ndr->depth++;
5449 ndr_print_policy_handle(ndr, "handle", r->in.handle);
5450 ndr->depth--;
5451 ndr_print_uint32(ndr, "NumArgs", r->in.NumArgs);
5452 ndr_print_ptr(ndr, "Arguments", r->in.Arguments);
5453 ndr->depth++;
5454 if (r->in.Arguments) {
5455 ndr_print_string(ndr, "Arguments", r->in.Arguments);
5457 ndr->depth--;
5458 ndr->depth--;
5460 if (flags & NDR_OUT) {
5461 ndr_print_struct(ndr, "out", "svcctl_StartServiceA");
5462 ndr->depth++;
5463 ndr_print_WERROR(ndr, "result", r->out.result);
5464 ndr->depth--;
5466 ndr->depth--;
5469 static enum ndr_err_code ndr_push_svcctl_GetServiceDisplayNameA(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceDisplayNameA *r)
5471 if (flags & NDR_IN) {
5472 if (r->in.handle == NULL) {
5473 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5475 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5476 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name));
5477 if (r->in.service_name) {
5478 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
5479 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5480 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
5481 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5483 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length));
5484 if (r->in.display_name_length) {
5485 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length));
5488 if (flags & NDR_OUT) {
5489 if (r->out.display_name == NULL) {
5490 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5492 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name));
5493 if (*r->out.display_name) {
5494 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16)));
5495 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5496 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16)));
5497 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5499 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length));
5500 if (r->out.display_name_length) {
5501 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length));
5503 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5505 return NDR_ERR_SUCCESS;
5508 static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameA(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceDisplayNameA *r)
5510 uint32_t _ptr_service_name;
5511 uint32_t _ptr_display_name;
5512 uint32_t _ptr_display_name_length;
5513 TALLOC_CTX *_mem_save_handle_0;
5514 TALLOC_CTX *_mem_save_service_name_0;
5515 TALLOC_CTX *_mem_save_display_name_0;
5516 TALLOC_CTX *_mem_save_display_name_1;
5517 TALLOC_CTX *_mem_save_display_name_length_0;
5518 if (flags & NDR_IN) {
5519 ZERO_STRUCT(r->out);
5521 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5522 NDR_PULL_ALLOC(ndr, r->in.handle);
5524 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5525 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
5526 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5527 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
5528 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
5529 if (_ptr_service_name) {
5530 NDR_PULL_ALLOC(ndr, r->in.service_name);
5531 } else {
5532 r->in.service_name = NULL;
5534 if (r->in.service_name) {
5535 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5536 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0);
5537 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name));
5538 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name));
5539 if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) {
5540 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name));
5542 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t)));
5543 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16));
5544 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
5546 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
5547 if (_ptr_display_name_length) {
5548 NDR_PULL_ALLOC(ndr, r->in.display_name_length);
5549 } else {
5550 r->in.display_name_length = NULL;
5552 if (r->in.display_name_length) {
5553 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
5554 NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0);
5555 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length));
5556 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
5558 NDR_PULL_ALLOC(ndr, r->out.display_name);
5559 ZERO_STRUCTP(r->out.display_name);
5561 if (flags & NDR_OUT) {
5562 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5563 NDR_PULL_ALLOC(ndr, r->out.display_name);
5565 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5566 NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC);
5567 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
5568 if (_ptr_display_name) {
5569 NDR_PULL_ALLOC(ndr, *r->out.display_name);
5570 } else {
5571 *r->out.display_name = NULL;
5573 if (*r->out.display_name) {
5574 _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
5575 NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0);
5576 NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name));
5577 NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name));
5578 if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_name)) {
5579 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.display_name), ndr_get_array_length(ndr, r->out.display_name));
5581 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t)));
5582 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16));
5583 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0);
5585 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC);
5586 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
5587 if (_ptr_display_name_length) {
5588 NDR_PULL_ALLOC(ndr, r->out.display_name_length);
5589 } else {
5590 r->out.display_name_length = NULL;
5592 if (r->out.display_name_length) {
5593 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
5594 NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0);
5595 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length));
5596 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
5598 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5600 return NDR_ERR_SUCCESS;
5603 _PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameA *r)
5605 ndr_print_struct(ndr, name, "svcctl_GetServiceDisplayNameA");
5606 ndr->depth++;
5607 if (flags & NDR_SET_VALUES) {
5608 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5610 if (flags & NDR_IN) {
5611 ndr_print_struct(ndr, "in", "svcctl_GetServiceDisplayNameA");
5612 ndr->depth++;
5613 ndr_print_ptr(ndr, "handle", r->in.handle);
5614 ndr->depth++;
5615 ndr_print_policy_handle(ndr, "handle", r->in.handle);
5616 ndr->depth--;
5617 ndr_print_ptr(ndr, "service_name", r->in.service_name);
5618 ndr->depth++;
5619 if (r->in.service_name) {
5620 ndr_print_string(ndr, "service_name", r->in.service_name);
5622 ndr->depth--;
5623 ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length);
5624 ndr->depth++;
5625 if (r->in.display_name_length) {
5626 ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length);
5628 ndr->depth--;
5629 ndr->depth--;
5631 if (flags & NDR_OUT) {
5632 ndr_print_struct(ndr, "out", "svcctl_GetServiceDisplayNameA");
5633 ndr->depth++;
5634 ndr_print_ptr(ndr, "display_name", r->out.display_name);
5635 ndr->depth++;
5636 ndr_print_ptr(ndr, "display_name", *r->out.display_name);
5637 ndr->depth++;
5638 if (*r->out.display_name) {
5639 ndr_print_string(ndr, "display_name", *r->out.display_name);
5641 ndr->depth--;
5642 ndr->depth--;
5643 ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length);
5644 ndr->depth++;
5645 if (r->out.display_name_length) {
5646 ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length);
5648 ndr->depth--;
5649 ndr_print_WERROR(ndr, "result", r->out.result);
5650 ndr->depth--;
5652 ndr->depth--;
5655 static enum ndr_err_code ndr_push_svcctl_GetServiceKeyNameA(struct ndr_push *ndr, int flags, const struct svcctl_GetServiceKeyNameA *r)
5657 if (flags & NDR_IN) {
5658 if (r->in.handle == NULL) {
5659 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5661 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5662 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name));
5663 if (r->in.service_name) {
5664 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
5665 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5666 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_name, CH_UTF16)));
5667 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5669 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length));
5670 if (r->in.display_name_length) {
5671 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length));
5674 if (flags & NDR_OUT) {
5675 if (r->out.key_name == NULL) {
5676 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5678 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name));
5679 if (*r->out.key_name) {
5680 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16)));
5681 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
5682 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16)));
5683 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5685 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length));
5686 if (r->out.display_name_length) {
5687 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length));
5689 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5691 return NDR_ERR_SUCCESS;
5694 static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameA(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceKeyNameA *r)
5696 uint32_t _ptr_service_name;
5697 uint32_t _ptr_key_name;
5698 uint32_t _ptr_display_name_length;
5699 TALLOC_CTX *_mem_save_handle_0;
5700 TALLOC_CTX *_mem_save_service_name_0;
5701 TALLOC_CTX *_mem_save_key_name_0;
5702 TALLOC_CTX *_mem_save_key_name_1;
5703 TALLOC_CTX *_mem_save_display_name_length_0;
5704 if (flags & NDR_IN) {
5705 ZERO_STRUCT(r->out);
5707 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5708 NDR_PULL_ALLOC(ndr, r->in.handle);
5710 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5711 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
5712 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5713 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
5714 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
5715 if (_ptr_service_name) {
5716 NDR_PULL_ALLOC(ndr, r->in.service_name);
5717 } else {
5718 r->in.service_name = NULL;
5720 if (r->in.service_name) {
5721 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5722 NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0);
5723 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name));
5724 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name));
5725 if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) {
5726 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name));
5728 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t)));
5729 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16));
5730 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
5732 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
5733 if (_ptr_display_name_length) {
5734 NDR_PULL_ALLOC(ndr, r->in.display_name_length);
5735 } else {
5736 r->in.display_name_length = NULL;
5738 if (r->in.display_name_length) {
5739 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
5740 NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0);
5741 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length));
5742 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
5744 NDR_PULL_ALLOC(ndr, r->out.key_name);
5745 ZERO_STRUCTP(r->out.key_name);
5747 if (flags & NDR_OUT) {
5748 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5749 NDR_PULL_ALLOC(ndr, r->out.key_name);
5751 _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5752 NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC);
5753 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name));
5754 if (_ptr_key_name) {
5755 NDR_PULL_ALLOC(ndr, *r->out.key_name);
5756 } else {
5757 *r->out.key_name = NULL;
5759 if (*r->out.key_name) {
5760 _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
5761 NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0);
5762 NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name));
5763 NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name));
5764 if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_name)) {
5765 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.key_name), ndr_get_array_length(ndr, r->out.key_name));
5767 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t)));
5768 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16));
5769 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0);
5771 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC);
5772 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length));
5773 if (_ptr_display_name_length) {
5774 NDR_PULL_ALLOC(ndr, r->out.display_name_length);
5775 } else {
5776 r->out.display_name_length = NULL;
5778 if (r->out.display_name_length) {
5779 _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
5780 NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0);
5781 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length));
5782 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0);
5784 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5786 return NDR_ERR_SUCCESS;
5789 _PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameA *r)
5791 ndr_print_struct(ndr, name, "svcctl_GetServiceKeyNameA");
5792 ndr->depth++;
5793 if (flags & NDR_SET_VALUES) {
5794 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5796 if (flags & NDR_IN) {
5797 ndr_print_struct(ndr, "in", "svcctl_GetServiceKeyNameA");
5798 ndr->depth++;
5799 ndr_print_ptr(ndr, "handle", r->in.handle);
5800 ndr->depth++;
5801 ndr_print_policy_handle(ndr, "handle", r->in.handle);
5802 ndr->depth--;
5803 ndr_print_ptr(ndr, "service_name", r->in.service_name);
5804 ndr->depth++;
5805 if (r->in.service_name) {
5806 ndr_print_string(ndr, "service_name", r->in.service_name);
5808 ndr->depth--;
5809 ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length);
5810 ndr->depth++;
5811 if (r->in.display_name_length) {
5812 ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length);
5814 ndr->depth--;
5815 ndr->depth--;
5817 if (flags & NDR_OUT) {
5818 ndr_print_struct(ndr, "out", "svcctl_GetServiceKeyNameA");
5819 ndr->depth++;
5820 ndr_print_ptr(ndr, "key_name", r->out.key_name);
5821 ndr->depth++;
5822 ndr_print_ptr(ndr, "key_name", *r->out.key_name);
5823 ndr->depth++;
5824 if (*r->out.key_name) {
5825 ndr_print_string(ndr, "key_name", *r->out.key_name);
5827 ndr->depth--;
5828 ndr->depth--;
5829 ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length);
5830 ndr->depth++;
5831 if (r->out.display_name_length) {
5832 ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length);
5834 ndr->depth--;
5835 ndr_print_WERROR(ndr, "result", r->out.result);
5836 ndr->depth--;
5838 ndr->depth--;
5841 static enum ndr_err_code ndr_push_svcctl_GetCurrentGroupeStateW(struct ndr_push *ndr, int flags, const struct svcctl_GetCurrentGroupeStateW *r)
5843 if (flags & NDR_IN) {
5845 if (flags & NDR_OUT) {
5846 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5848 return NDR_ERR_SUCCESS;
5851 static enum ndr_err_code ndr_pull_svcctl_GetCurrentGroupeStateW(struct ndr_pull *ndr, int flags, struct svcctl_GetCurrentGroupeStateW *r)
5853 if (flags & NDR_IN) {
5855 if (flags & NDR_OUT) {
5856 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5858 return NDR_ERR_SUCCESS;
5861 _PUBLIC_ void ndr_print_svcctl_GetCurrentGroupeStateW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetCurrentGroupeStateW *r)
5863 ndr_print_struct(ndr, name, "svcctl_GetCurrentGroupeStateW");
5864 ndr->depth++;
5865 if (flags & NDR_SET_VALUES) {
5866 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5868 if (flags & NDR_IN) {
5869 ndr_print_struct(ndr, "in", "svcctl_GetCurrentGroupeStateW");
5870 ndr->depth++;
5871 ndr->depth--;
5873 if (flags & NDR_OUT) {
5874 ndr_print_struct(ndr, "out", "svcctl_GetCurrentGroupeStateW");
5875 ndr->depth++;
5876 ndr_print_WERROR(ndr, "result", r->out.result);
5877 ndr->depth--;
5879 ndr->depth--;
5882 static enum ndr_err_code ndr_push_svcctl_EnumServiceGroupW(struct ndr_push *ndr, int flags, const struct svcctl_EnumServiceGroupW *r)
5884 if (flags & NDR_IN) {
5886 if (flags & NDR_OUT) {
5887 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5889 return NDR_ERR_SUCCESS;
5892 static enum ndr_err_code ndr_pull_svcctl_EnumServiceGroupW(struct ndr_pull *ndr, int flags, struct svcctl_EnumServiceGroupW *r)
5894 if (flags & NDR_IN) {
5896 if (flags & NDR_OUT) {
5897 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5899 return NDR_ERR_SUCCESS;
5902 _PUBLIC_ void ndr_print_svcctl_EnumServiceGroupW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServiceGroupW *r)
5904 ndr_print_struct(ndr, name, "svcctl_EnumServiceGroupW");
5905 ndr->depth++;
5906 if (flags & NDR_SET_VALUES) {
5907 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5909 if (flags & NDR_IN) {
5910 ndr_print_struct(ndr, "in", "svcctl_EnumServiceGroupW");
5911 ndr->depth++;
5912 ndr->depth--;
5914 if (flags & NDR_OUT) {
5915 ndr_print_struct(ndr, "out", "svcctl_EnumServiceGroupW");
5916 ndr->depth++;
5917 ndr_print_WERROR(ndr, "result", r->out.result);
5918 ndr->depth--;
5920 ndr->depth--;
5923 static enum ndr_err_code ndr_push_svcctl_ChangeServiceConfig2A(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfig2A *r)
5925 if (flags & NDR_IN) {
5926 if (r->in.handle == NULL) {
5927 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
5929 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5930 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level));
5931 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info));
5932 if (r->in.info) {
5933 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.info));
5936 if (flags & NDR_OUT) {
5937 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
5939 return NDR_ERR_SUCCESS;
5942 static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfig2A(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfig2A *r)
5944 uint32_t _ptr_info;
5945 TALLOC_CTX *_mem_save_handle_0;
5946 TALLOC_CTX *_mem_save_info_0;
5947 if (flags & NDR_IN) {
5948 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
5949 NDR_PULL_ALLOC(ndr, r->in.handle);
5951 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
5952 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
5953 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
5954 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
5955 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level));
5956 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
5957 if (_ptr_info) {
5958 NDR_PULL_ALLOC(ndr, r->in.info);
5959 } else {
5960 r->in.info = NULL;
5962 if (r->in.info) {
5963 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
5964 NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0);
5965 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.info));
5966 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
5969 if (flags & NDR_OUT) {
5970 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
5972 return NDR_ERR_SUCCESS;
5975 _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2A *r)
5977 ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfig2A");
5978 ndr->depth++;
5979 if (flags & NDR_SET_VALUES) {
5980 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
5982 if (flags & NDR_IN) {
5983 ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfig2A");
5984 ndr->depth++;
5985 ndr_print_ptr(ndr, "handle", r->in.handle);
5986 ndr->depth++;
5987 ndr_print_policy_handle(ndr, "handle", r->in.handle);
5988 ndr->depth--;
5989 ndr_print_uint32(ndr, "info_level", r->in.info_level);
5990 ndr_print_ptr(ndr, "info", r->in.info);
5991 ndr->depth++;
5992 if (r->in.info) {
5993 ndr_print_uint8(ndr, "info", *r->in.info);
5995 ndr->depth--;
5996 ndr->depth--;
5998 if (flags & NDR_OUT) {
5999 ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfig2A");
6000 ndr->depth++;
6001 ndr_print_WERROR(ndr, "result", r->out.result);
6002 ndr->depth--;
6004 ndr->depth--;
6007 static enum ndr_err_code ndr_push_svcctl_ChangeServiceConfig2W(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfig2W *r)
6009 if (flags & NDR_IN) {
6010 if (r->in.handle == NULL) {
6011 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6013 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6014 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level));
6015 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info));
6016 if (r->in.info) {
6017 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.info));
6020 if (flags & NDR_OUT) {
6021 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
6023 return NDR_ERR_SUCCESS;
6026 static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfig2W(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfig2W *r)
6028 uint32_t _ptr_info;
6029 TALLOC_CTX *_mem_save_handle_0;
6030 TALLOC_CTX *_mem_save_info_0;
6031 if (flags & NDR_IN) {
6032 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6033 NDR_PULL_ALLOC(ndr, r->in.handle);
6035 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6036 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
6037 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6038 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
6039 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level));
6040 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
6041 if (_ptr_info) {
6042 NDR_PULL_ALLOC(ndr, r->in.info);
6043 } else {
6044 r->in.info = NULL;
6046 if (r->in.info) {
6047 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
6048 NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0);
6049 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.info));
6050 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
6053 if (flags & NDR_OUT) {
6054 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
6056 return NDR_ERR_SUCCESS;
6059 _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2W *r)
6061 ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfig2W");
6062 ndr->depth++;
6063 if (flags & NDR_SET_VALUES) {
6064 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
6066 if (flags & NDR_IN) {
6067 ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfig2W");
6068 ndr->depth++;
6069 ndr_print_ptr(ndr, "handle", r->in.handle);
6070 ndr->depth++;
6071 ndr_print_policy_handle(ndr, "handle", r->in.handle);
6072 ndr->depth--;
6073 ndr_print_uint32(ndr, "info_level", r->in.info_level);
6074 ndr_print_ptr(ndr, "info", r->in.info);
6075 ndr->depth++;
6076 if (r->in.info) {
6077 ndr_print_uint8(ndr, "info", *r->in.info);
6079 ndr->depth--;
6080 ndr->depth--;
6082 if (flags & NDR_OUT) {
6083 ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfig2W");
6084 ndr->depth++;
6085 ndr_print_WERROR(ndr, "result", r->out.result);
6086 ndr->depth--;
6088 ndr->depth--;
6091 static enum ndr_err_code ndr_push_svcctl_QueryServiceConfig2A(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfig2A *r)
6093 if (flags & NDR_IN) {
6094 if (r->in.handle == NULL) {
6095 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6097 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6098 NDR_CHECK(ndr_push_svcctl_ConfigLevel(ndr, NDR_SCALARS, r->in.info_level));
6099 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
6101 if (flags & NDR_OUT) {
6102 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
6103 if (r->out.needed == NULL) {
6104 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6106 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
6107 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
6109 return NDR_ERR_SUCCESS;
6112 static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2A(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfig2A *r)
6114 TALLOC_CTX *_mem_save_handle_0;
6115 TALLOC_CTX *_mem_save_needed_0;
6116 if (flags & NDR_IN) {
6117 ZERO_STRUCT(r->out);
6119 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6120 NDR_PULL_ALLOC(ndr, r->in.handle);
6122 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6123 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
6124 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6125 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
6126 NDR_CHECK(ndr_pull_svcctl_ConfigLevel(ndr, NDR_SCALARS, &r->in.info_level));
6127 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
6128 NDR_PULL_ALLOC(ndr, r->out.needed);
6129 ZERO_STRUCTP(r->out.needed);
6131 if (flags & NDR_OUT) {
6132 NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
6133 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
6134 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6135 NDR_PULL_ALLOC(ndr, r->out.needed);
6137 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
6138 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
6139 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
6140 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
6141 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
6143 return NDR_ERR_SUCCESS;
6146 _PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2A *r)
6148 ndr_print_struct(ndr, name, "svcctl_QueryServiceConfig2A");
6149 ndr->depth++;
6150 if (flags & NDR_SET_VALUES) {
6151 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
6153 if (flags & NDR_IN) {
6154 ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfig2A");
6155 ndr->depth++;
6156 ndr_print_ptr(ndr, "handle", r->in.handle);
6157 ndr->depth++;
6158 ndr_print_policy_handle(ndr, "handle", r->in.handle);
6159 ndr->depth--;
6160 ndr_print_svcctl_ConfigLevel(ndr, "info_level", r->in.info_level);
6161 ndr_print_uint32(ndr, "offered", r->in.offered);
6162 ndr->depth--;
6164 if (flags & NDR_OUT) {
6165 ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfig2A");
6166 ndr->depth++;
6167 ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
6168 ndr_print_ptr(ndr, "needed", r->out.needed);
6169 ndr->depth++;
6170 ndr_print_uint32(ndr, "needed", *r->out.needed);
6171 ndr->depth--;
6172 ndr_print_WERROR(ndr, "result", r->out.result);
6173 ndr->depth--;
6175 ndr->depth--;
6178 static enum ndr_err_code ndr_push_svcctl_QueryServiceConfig2W(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceConfig2W *r)
6180 if (flags & NDR_IN) {
6181 if (r->in.handle == NULL) {
6182 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6184 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6185 NDR_CHECK(ndr_push_svcctl_ConfigLevel(ndr, NDR_SCALARS, r->in.info_level));
6186 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
6188 if (flags & NDR_OUT) {
6189 if (r->out.buffer == NULL) {
6190 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6192 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
6193 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
6194 if (r->out.needed == NULL) {
6195 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6197 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
6198 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
6200 return NDR_ERR_SUCCESS;
6203 static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2W(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfig2W *r)
6205 TALLOC_CTX *_mem_save_handle_0;
6206 TALLOC_CTX *_mem_save_needed_0;
6207 if (flags & NDR_IN) {
6208 ZERO_STRUCT(r->out);
6210 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6211 NDR_PULL_ALLOC(ndr, r->in.handle);
6213 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6214 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
6215 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6216 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
6217 NDR_CHECK(ndr_pull_svcctl_ConfigLevel(ndr, NDR_SCALARS, &r->in.info_level));
6218 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
6219 if (r->in.offered > 8192) {
6220 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6222 NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
6223 memset(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer));
6224 NDR_PULL_ALLOC(ndr, r->out.needed);
6225 ZERO_STRUCTP(r->out.needed);
6227 if (flags & NDR_OUT) {
6228 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
6229 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6230 NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
6232 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)));
6233 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6234 NDR_PULL_ALLOC(ndr, r->out.needed);
6236 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
6237 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
6238 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
6239 if (*r->out.needed > 8192) {
6240 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6242 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
6243 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
6244 if (r->out.buffer) {
6245 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered));
6248 return NDR_ERR_SUCCESS;
6251 _PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2W *r)
6253 ndr_print_struct(ndr, name, "svcctl_QueryServiceConfig2W");
6254 ndr->depth++;
6255 if (flags & NDR_SET_VALUES) {
6256 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
6258 if (flags & NDR_IN) {
6259 ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfig2W");
6260 ndr->depth++;
6261 ndr_print_ptr(ndr, "handle", r->in.handle);
6262 ndr->depth++;
6263 ndr_print_policy_handle(ndr, "handle", r->in.handle);
6264 ndr->depth--;
6265 ndr_print_svcctl_ConfigLevel(ndr, "info_level", r->in.info_level);
6266 ndr_print_uint32(ndr, "offered", r->in.offered);
6267 ndr->depth--;
6269 if (flags & NDR_OUT) {
6270 ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfig2W");
6271 ndr->depth++;
6272 ndr_print_ptr(ndr, "buffer", r->out.buffer);
6273 ndr->depth++;
6274 ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
6275 ndr->depth--;
6276 ndr_print_ptr(ndr, "needed", r->out.needed);
6277 ndr->depth++;
6278 ndr_print_uint32(ndr, "needed", *r->out.needed);
6279 ndr->depth--;
6280 ndr_print_WERROR(ndr, "result", r->out.result);
6281 ndr->depth--;
6283 ndr->depth--;
6286 static enum ndr_err_code ndr_push_svcctl_QueryServiceStatusEx(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceStatusEx *r)
6288 if (flags & NDR_IN) {
6289 if (r->in.handle == NULL) {
6290 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6292 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6293 NDR_CHECK(ndr_push_svcctl_StatusLevel(ndr, NDR_SCALARS, r->in.info_level));
6294 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
6296 if (flags & NDR_OUT) {
6297 if (r->out.buffer == NULL) {
6298 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6300 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
6301 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
6302 if (r->out.needed == NULL) {
6303 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6305 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
6306 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
6308 return NDR_ERR_SUCCESS;
6311 static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatusEx(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceStatusEx *r)
6313 TALLOC_CTX *_mem_save_handle_0;
6314 TALLOC_CTX *_mem_save_needed_0;
6315 if (flags & NDR_IN) {
6316 ZERO_STRUCT(r->out);
6318 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6319 NDR_PULL_ALLOC(ndr, r->in.handle);
6321 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6322 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
6323 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
6324 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
6325 NDR_CHECK(ndr_pull_svcctl_StatusLevel(ndr, NDR_SCALARS, &r->in.info_level));
6326 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
6327 if (r->in.offered > 8192) {
6328 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6330 NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
6331 memset(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer));
6332 NDR_PULL_ALLOC(ndr, r->out.needed);
6333 ZERO_STRUCTP(r->out.needed);
6335 if (flags & NDR_OUT) {
6336 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
6337 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6338 NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
6340 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)));
6341 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6342 NDR_PULL_ALLOC(ndr, r->out.needed);
6344 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
6345 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
6346 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
6347 if (*r->out.needed > 8192) {
6348 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6350 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
6351 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
6352 if (r->out.buffer) {
6353 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered));
6356 return NDR_ERR_SUCCESS;
6359 _PUBLIC_ void ndr_print_svcctl_QueryServiceStatusEx(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatusEx *r)
6361 ndr_print_struct(ndr, name, "svcctl_QueryServiceStatusEx");
6362 ndr->depth++;
6363 if (flags & NDR_SET_VALUES) {
6364 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
6366 if (flags & NDR_IN) {
6367 ndr_print_struct(ndr, "in", "svcctl_QueryServiceStatusEx");
6368 ndr->depth++;
6369 ndr_print_ptr(ndr, "handle", r->in.handle);
6370 ndr->depth++;
6371 ndr_print_policy_handle(ndr, "handle", r->in.handle);
6372 ndr->depth--;
6373 ndr_print_svcctl_StatusLevel(ndr, "info_level", r->in.info_level);
6374 ndr_print_uint32(ndr, "offered", r->in.offered);
6375 ndr->depth--;
6377 if (flags & NDR_OUT) {
6378 ndr_print_struct(ndr, "out", "svcctl_QueryServiceStatusEx");
6379 ndr->depth++;
6380 ndr_print_ptr(ndr, "buffer", r->out.buffer);
6381 ndr->depth++;
6382 ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
6383 ndr->depth--;
6384 ndr_print_ptr(ndr, "needed", r->out.needed);
6385 ndr->depth++;
6386 ndr_print_uint32(ndr, "needed", *r->out.needed);
6387 ndr->depth--;
6388 ndr_print_WERROR(ndr, "result", r->out.result);
6389 ndr->depth--;
6391 ndr->depth--;
6394 static enum ndr_err_code ndr_push_EnumServicesStatusExA(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExA *r)
6396 if (flags & NDR_IN) {
6397 if (r->in.scmanager == NULL) {
6398 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6400 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager));
6401 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level));
6402 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
6403 NDR_CHECK(ndr_push_svcctl_ServiceState(ndr, NDR_SCALARS, r->in.state));
6404 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
6405 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle));
6406 if (r->in.resume_handle) {
6407 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle));
6410 if (flags & NDR_OUT) {
6411 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.offered));
6412 if (r->out.needed == NULL) {
6413 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6415 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
6416 if (r->out.service_returned == NULL) {
6417 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6419 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.service_returned));
6420 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle));
6421 if (r->out.resume_handle) {
6422 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle));
6424 if (r->out.group_name == NULL) {
6425 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6427 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.group_name));
6428 if (*r->out.group_name) {
6429 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16)));
6430 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6431 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16)));
6432 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.group_name, ndr_charset_length(*r->out.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6434 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
6436 return NDR_ERR_SUCCESS;
6439 static enum ndr_err_code ndr_pull_EnumServicesStatusExA(struct ndr_pull *ndr, int flags, struct EnumServicesStatusExA *r)
6441 uint32_t _ptr_resume_handle;
6442 uint32_t _ptr_group_name;
6443 TALLOC_CTX *_mem_save_scmanager_0;
6444 TALLOC_CTX *_mem_save_needed_0;
6445 TALLOC_CTX *_mem_save_service_returned_0;
6446 TALLOC_CTX *_mem_save_resume_handle_0;
6447 TALLOC_CTX *_mem_save_group_name_0;
6448 TALLOC_CTX *_mem_save_group_name_1;
6449 if (flags & NDR_IN) {
6450 ZERO_STRUCT(r->out);
6452 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6453 NDR_PULL_ALLOC(ndr, r->in.scmanager);
6455 _mem_save_scmanager_0 = NDR_PULL_GET_MEM_CTX(ndr);
6456 NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager, LIBNDR_FLAG_REF_ALLOC);
6457 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager));
6458 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_0, LIBNDR_FLAG_REF_ALLOC);
6459 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level));
6460 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
6461 NDR_CHECK(ndr_pull_svcctl_ServiceState(ndr, NDR_SCALARS, &r->in.state));
6462 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
6463 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
6464 if (_ptr_resume_handle) {
6465 NDR_PULL_ALLOC(ndr, r->in.resume_handle);
6466 } else {
6467 r->in.resume_handle = NULL;
6469 if (r->in.resume_handle) {
6470 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6471 NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0);
6472 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle));
6473 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
6475 NDR_PULL_ALLOC(ndr, r->out.needed);
6476 ZERO_STRUCTP(r->out.needed);
6477 NDR_PULL_ALLOC(ndr, r->out.service_returned);
6478 ZERO_STRUCTP(r->out.service_returned);
6479 NDR_PULL_ALLOC(ndr, r->out.group_name);
6480 ZERO_STRUCTP(r->out.group_name);
6482 if (flags & NDR_OUT) {
6483 NDR_PULL_ALLOC_N(ndr, r->out.services, r->in.offered);
6484 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.offered));
6485 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6486 NDR_PULL_ALLOC(ndr, r->out.needed);
6488 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
6489 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
6490 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
6491 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
6492 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6493 NDR_PULL_ALLOC(ndr, r->out.service_returned);
6495 _mem_save_service_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
6496 NDR_PULL_SET_MEM_CTX(ndr, r->out.service_returned, LIBNDR_FLAG_REF_ALLOC);
6497 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.service_returned));
6498 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_returned_0, LIBNDR_FLAG_REF_ALLOC);
6499 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
6500 if (_ptr_resume_handle) {
6501 NDR_PULL_ALLOC(ndr, r->out.resume_handle);
6502 } else {
6503 r->out.resume_handle = NULL;
6505 if (r->out.resume_handle) {
6506 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6507 NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0);
6508 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle));
6509 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
6511 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6512 NDR_PULL_ALLOC(ndr, r->out.group_name);
6514 _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6515 NDR_PULL_SET_MEM_CTX(ndr, r->out.group_name, LIBNDR_FLAG_REF_ALLOC);
6516 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name));
6517 if (_ptr_group_name) {
6518 NDR_PULL_ALLOC(ndr, *r->out.group_name);
6519 } else {
6520 *r->out.group_name = NULL;
6522 if (*r->out.group_name) {
6523 _mem_save_group_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
6524 NDR_PULL_SET_MEM_CTX(ndr, *r->out.group_name, 0);
6525 NDR_CHECK(ndr_pull_array_size(ndr, r->out.group_name));
6526 NDR_CHECK(ndr_pull_array_length(ndr, r->out.group_name));
6527 if (ndr_get_array_length(ndr, r->out.group_name) > ndr_get_array_size(ndr, r->out.group_name)) {
6528 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.group_name), ndr_get_array_length(ndr, r->out.group_name));
6530 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t)));
6531 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.group_name, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t), CH_UTF16));
6532 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_1, 0);
6534 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, LIBNDR_FLAG_REF_ALLOC);
6535 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
6537 return NDR_ERR_SUCCESS;
6540 _PUBLIC_ void ndr_print_EnumServicesStatusExA(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExA *r)
6542 ndr_print_struct(ndr, name, "EnumServicesStatusExA");
6543 ndr->depth++;
6544 if (flags & NDR_SET_VALUES) {
6545 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
6547 if (flags & NDR_IN) {
6548 ndr_print_struct(ndr, "in", "EnumServicesStatusExA");
6549 ndr->depth++;
6550 ndr_print_ptr(ndr, "scmanager", r->in.scmanager);
6551 ndr->depth++;
6552 ndr_print_policy_handle(ndr, "scmanager", r->in.scmanager);
6553 ndr->depth--;
6554 ndr_print_uint32(ndr, "info_level", r->in.info_level);
6555 ndr_print_uint32(ndr, "type", r->in.type);
6556 ndr_print_svcctl_ServiceState(ndr, "state", r->in.state);
6557 ndr_print_uint32(ndr, "offered", r->in.offered);
6558 ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle);
6559 ndr->depth++;
6560 if (r->in.resume_handle) {
6561 ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle);
6563 ndr->depth--;
6564 ndr->depth--;
6566 if (flags & NDR_OUT) {
6567 ndr_print_struct(ndr, "out", "EnumServicesStatusExA");
6568 ndr->depth++;
6569 ndr_print_array_uint8(ndr, "services", r->out.services, r->in.offered);
6570 ndr_print_ptr(ndr, "needed", r->out.needed);
6571 ndr->depth++;
6572 ndr_print_uint32(ndr, "needed", *r->out.needed);
6573 ndr->depth--;
6574 ndr_print_ptr(ndr, "service_returned", r->out.service_returned);
6575 ndr->depth++;
6576 ndr_print_uint32(ndr, "service_returned", *r->out.service_returned);
6577 ndr->depth--;
6578 ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle);
6579 ndr->depth++;
6580 if (r->out.resume_handle) {
6581 ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle);
6583 ndr->depth--;
6584 ndr_print_ptr(ndr, "group_name", r->out.group_name);
6585 ndr->depth++;
6586 ndr_print_ptr(ndr, "group_name", *r->out.group_name);
6587 ndr->depth++;
6588 if (*r->out.group_name) {
6589 ndr_print_string(ndr, "group_name", *r->out.group_name);
6591 ndr->depth--;
6592 ndr->depth--;
6593 ndr_print_WERROR(ndr, "result", r->out.result);
6594 ndr->depth--;
6596 ndr->depth--;
6599 static enum ndr_err_code ndr_push_EnumServicesStatusExW(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExW *r)
6601 if (flags & NDR_IN) {
6602 if (r->in.scmanager == NULL) {
6603 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6605 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager));
6606 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level));
6607 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
6608 NDR_CHECK(ndr_push_svcctl_ServiceState(ndr, NDR_SCALARS, r->in.state));
6609 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
6610 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle));
6611 if (r->in.resume_handle) {
6612 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle));
6614 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.group_name));
6615 if (r->in.group_name) {
6616 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.group_name, CH_UTF16)));
6617 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
6618 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.group_name, CH_UTF16)));
6619 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.group_name, ndr_charset_length(r->in.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6622 if (flags & NDR_OUT) {
6623 if (r->out.services == NULL) {
6624 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6626 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.offered));
6627 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.offered));
6628 if (r->out.needed == NULL) {
6629 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6631 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
6632 if (r->out.service_returned == NULL) {
6633 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
6635 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.service_returned));
6636 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle));
6637 if (r->out.resume_handle) {
6638 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle));
6640 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
6642 return NDR_ERR_SUCCESS;
6645 static enum ndr_err_code ndr_pull_EnumServicesStatusExW(struct ndr_pull *ndr, int flags, struct EnumServicesStatusExW *r)
6647 uint32_t _ptr_resume_handle;
6648 uint32_t _ptr_group_name;
6649 TALLOC_CTX *_mem_save_scmanager_0;
6650 TALLOC_CTX *_mem_save_needed_0;
6651 TALLOC_CTX *_mem_save_service_returned_0;
6652 TALLOC_CTX *_mem_save_resume_handle_0;
6653 TALLOC_CTX *_mem_save_group_name_0;
6654 if (flags & NDR_IN) {
6655 ZERO_STRUCT(r->out);
6657 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6658 NDR_PULL_ALLOC(ndr, r->in.scmanager);
6660 _mem_save_scmanager_0 = NDR_PULL_GET_MEM_CTX(ndr);
6661 NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager, LIBNDR_FLAG_REF_ALLOC);
6662 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager));
6663 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_0, LIBNDR_FLAG_REF_ALLOC);
6664 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level));
6665 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
6666 NDR_CHECK(ndr_pull_svcctl_ServiceState(ndr, NDR_SCALARS, &r->in.state));
6667 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
6668 if (r->in.offered > 0x40000) {
6669 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6671 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
6672 if (_ptr_resume_handle) {
6673 NDR_PULL_ALLOC(ndr, r->in.resume_handle);
6674 } else {
6675 r->in.resume_handle = NULL;
6677 if (r->in.resume_handle) {
6678 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6679 NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0);
6680 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle));
6681 if (*r->in.resume_handle > 0x40000) {
6682 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6684 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
6686 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name));
6687 if (_ptr_group_name) {
6688 NDR_PULL_ALLOC(ndr, r->in.group_name);
6689 } else {
6690 r->in.group_name = NULL;
6692 if (r->in.group_name) {
6693 _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6694 NDR_PULL_SET_MEM_CTX(ndr, r->in.group_name, 0);
6695 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.group_name));
6696 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.group_name));
6697 if (ndr_get_array_length(ndr, &r->in.group_name) > ndr_get_array_size(ndr, &r->in.group_name)) {
6698 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.group_name), ndr_get_array_length(ndr, &r->in.group_name));
6700 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.group_name), sizeof(uint16_t)));
6701 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.group_name, ndr_get_array_length(ndr, &r->in.group_name), sizeof(uint16_t), CH_UTF16));
6702 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, 0);
6704 NDR_PULL_ALLOC_N(ndr, r->out.services, r->in.offered);
6705 memset(r->out.services, 0, (r->in.offered) * sizeof(*r->out.services));
6706 NDR_PULL_ALLOC(ndr, r->out.needed);
6707 ZERO_STRUCTP(r->out.needed);
6708 NDR_PULL_ALLOC(ndr, r->out.service_returned);
6709 ZERO_STRUCTP(r->out.service_returned);
6711 if (flags & NDR_OUT) {
6712 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.services));
6713 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6714 NDR_PULL_ALLOC_N(ndr, r->out.services, ndr_get_array_size(ndr, &r->out.services));
6716 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.services, ndr_get_array_size(ndr, &r->out.services)));
6717 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6718 NDR_PULL_ALLOC(ndr, r->out.needed);
6720 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
6721 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
6722 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
6723 if (*r->out.needed > 0x40000) {
6724 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6726 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
6727 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
6728 NDR_PULL_ALLOC(ndr, r->out.service_returned);
6730 _mem_save_service_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
6731 NDR_PULL_SET_MEM_CTX(ndr, r->out.service_returned, LIBNDR_FLAG_REF_ALLOC);
6732 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.service_returned));
6733 if (*r->out.service_returned > 0x40000) {
6734 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6736 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_returned_0, LIBNDR_FLAG_REF_ALLOC);
6737 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
6738 if (_ptr_resume_handle) {
6739 NDR_PULL_ALLOC(ndr, r->out.resume_handle);
6740 } else {
6741 r->out.resume_handle = NULL;
6743 if (r->out.resume_handle) {
6744 _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
6745 NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0);
6746 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle));
6747 if (*r->out.resume_handle > 0x40000) {
6748 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6750 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
6752 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
6753 if (r->out.services) {
6754 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.services, r->in.offered));
6757 return NDR_ERR_SUCCESS;
6760 _PUBLIC_ void ndr_print_EnumServicesStatusExW(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExW *r)
6762 ndr_print_struct(ndr, name, "EnumServicesStatusExW");
6763 ndr->depth++;
6764 if (flags & NDR_SET_VALUES) {
6765 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
6767 if (flags & NDR_IN) {
6768 ndr_print_struct(ndr, "in", "EnumServicesStatusExW");
6769 ndr->depth++;
6770 ndr_print_ptr(ndr, "scmanager", r->in.scmanager);
6771 ndr->depth++;
6772 ndr_print_policy_handle(ndr, "scmanager", r->in.scmanager);
6773 ndr->depth--;
6774 ndr_print_uint32(ndr, "info_level", r->in.info_level);
6775 ndr_print_uint32(ndr, "type", r->in.type);
6776 ndr_print_svcctl_ServiceState(ndr, "state", r->in.state);
6777 ndr_print_uint32(ndr, "offered", r->in.offered);
6778 ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle);
6779 ndr->depth++;
6780 if (r->in.resume_handle) {
6781 ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle);
6783 ndr->depth--;
6784 ndr_print_ptr(ndr, "group_name", r->in.group_name);
6785 ndr->depth++;
6786 if (r->in.group_name) {
6787 ndr_print_string(ndr, "group_name", r->in.group_name);
6789 ndr->depth--;
6790 ndr->depth--;
6792 if (flags & NDR_OUT) {
6793 ndr_print_struct(ndr, "out", "EnumServicesStatusExW");
6794 ndr->depth++;
6795 ndr_print_ptr(ndr, "services", r->out.services);
6796 ndr->depth++;
6797 ndr_print_array_uint8(ndr, "services", r->out.services, r->in.offered);
6798 ndr->depth--;
6799 ndr_print_ptr(ndr, "needed", r->out.needed);
6800 ndr->depth++;
6801 ndr_print_uint32(ndr, "needed", *r->out.needed);
6802 ndr->depth--;
6803 ndr_print_ptr(ndr, "service_returned", r->out.service_returned);
6804 ndr->depth++;
6805 ndr_print_uint32(ndr, "service_returned", *r->out.service_returned);
6806 ndr->depth--;
6807 ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle);
6808 ndr->depth++;
6809 if (r->out.resume_handle) {
6810 ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle);
6812 ndr->depth--;
6813 ndr_print_WERROR(ndr, "result", r->out.result);
6814 ndr->depth--;
6816 ndr->depth--;
6819 static enum ndr_err_code ndr_push_svcctl_SCSendTSMessage(struct ndr_push *ndr, int flags, const struct svcctl_SCSendTSMessage *r)
6821 if (flags & NDR_IN) {
6823 if (flags & NDR_OUT) {
6824 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
6826 return NDR_ERR_SUCCESS;
6829 static enum ndr_err_code ndr_pull_svcctl_SCSendTSMessage(struct ndr_pull *ndr, int flags, struct svcctl_SCSendTSMessage *r)
6831 if (flags & NDR_IN) {
6833 if (flags & NDR_OUT) {
6834 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
6836 return NDR_ERR_SUCCESS;
6839 _PUBLIC_ void ndr_print_svcctl_SCSendTSMessage(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSendTSMessage *r)
6841 ndr_print_struct(ndr, name, "svcctl_SCSendTSMessage");
6842 ndr->depth++;
6843 if (flags & NDR_SET_VALUES) {
6844 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
6846 if (flags & NDR_IN) {
6847 ndr_print_struct(ndr, "in", "svcctl_SCSendTSMessage");
6848 ndr->depth++;
6849 ndr->depth--;
6851 if (flags & NDR_OUT) {
6852 ndr_print_struct(ndr, "out", "svcctl_SCSendTSMessage");
6853 ndr->depth++;
6854 ndr_print_WERROR(ndr, "result", r->out.result);
6855 ndr->depth--;
6857 ndr->depth--;
6860 static const struct ndr_interface_call svcctl_calls[] = {
6862 "svcctl_CloseServiceHandle",
6863 sizeof(struct svcctl_CloseServiceHandle),
6864 (ndr_push_flags_fn_t) ndr_push_svcctl_CloseServiceHandle,
6865 (ndr_pull_flags_fn_t) ndr_pull_svcctl_CloseServiceHandle,
6866 (ndr_print_function_t) ndr_print_svcctl_CloseServiceHandle,
6867 false,
6870 "svcctl_ControlService",
6871 sizeof(struct svcctl_ControlService),
6872 (ndr_push_flags_fn_t) ndr_push_svcctl_ControlService,
6873 (ndr_pull_flags_fn_t) ndr_pull_svcctl_ControlService,
6874 (ndr_print_function_t) ndr_print_svcctl_ControlService,
6875 false,
6878 "svcctl_DeleteService",
6879 sizeof(struct svcctl_DeleteService),
6880 (ndr_push_flags_fn_t) ndr_push_svcctl_DeleteService,
6881 (ndr_pull_flags_fn_t) ndr_pull_svcctl_DeleteService,
6882 (ndr_print_function_t) ndr_print_svcctl_DeleteService,
6883 false,
6886 "svcctl_LockServiceDatabase",
6887 sizeof(struct svcctl_LockServiceDatabase),
6888 (ndr_push_flags_fn_t) ndr_push_svcctl_LockServiceDatabase,
6889 (ndr_pull_flags_fn_t) ndr_pull_svcctl_LockServiceDatabase,
6890 (ndr_print_function_t) ndr_print_svcctl_LockServiceDatabase,
6891 false,
6894 "svcctl_QueryServiceObjectSecurity",
6895 sizeof(struct svcctl_QueryServiceObjectSecurity),
6896 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceObjectSecurity,
6897 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceObjectSecurity,
6898 (ndr_print_function_t) ndr_print_svcctl_QueryServiceObjectSecurity,
6899 false,
6902 "svcctl_SetServiceObjectSecurity",
6903 sizeof(struct svcctl_SetServiceObjectSecurity),
6904 (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceObjectSecurity,
6905 (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceObjectSecurity,
6906 (ndr_print_function_t) ndr_print_svcctl_SetServiceObjectSecurity,
6907 false,
6910 "svcctl_QueryServiceStatus",
6911 sizeof(struct svcctl_QueryServiceStatus),
6912 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatus,
6913 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatus,
6914 (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatus,
6915 false,
6918 "svcctl_SetServiceStatus",
6919 sizeof(struct svcctl_SetServiceStatus),
6920 (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceStatus,
6921 (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceStatus,
6922 (ndr_print_function_t) ndr_print_svcctl_SetServiceStatus,
6923 false,
6926 "svcctl_UnlockServiceDatabase",
6927 sizeof(struct svcctl_UnlockServiceDatabase),
6928 (ndr_push_flags_fn_t) ndr_push_svcctl_UnlockServiceDatabase,
6929 (ndr_pull_flags_fn_t) ndr_pull_svcctl_UnlockServiceDatabase,
6930 (ndr_print_function_t) ndr_print_svcctl_UnlockServiceDatabase,
6931 false,
6934 "svcctl_NotifyBootConfigStatus",
6935 sizeof(struct svcctl_NotifyBootConfigStatus),
6936 (ndr_push_flags_fn_t) ndr_push_svcctl_NotifyBootConfigStatus,
6937 (ndr_pull_flags_fn_t) ndr_pull_svcctl_NotifyBootConfigStatus,
6938 (ndr_print_function_t) ndr_print_svcctl_NotifyBootConfigStatus,
6939 false,
6942 "svcctl_SCSetServiceBitsW",
6943 sizeof(struct svcctl_SCSetServiceBitsW),
6944 (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsW,
6945 (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsW,
6946 (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsW,
6947 false,
6950 "svcctl_ChangeServiceConfigW",
6951 sizeof(struct svcctl_ChangeServiceConfigW),
6952 (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigW,
6953 (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigW,
6954 (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigW,
6955 false,
6958 "svcctl_CreateServiceW",
6959 sizeof(struct svcctl_CreateServiceW),
6960 (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceW,
6961 (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceW,
6962 (ndr_print_function_t) ndr_print_svcctl_CreateServiceW,
6963 false,
6966 "svcctl_EnumDependentServicesW",
6967 sizeof(struct svcctl_EnumDependentServicesW),
6968 (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesW,
6969 (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesW,
6970 (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesW,
6971 false,
6974 "svcctl_EnumServicesStatusW",
6975 sizeof(struct svcctl_EnumServicesStatusW),
6976 (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusW,
6977 (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusW,
6978 (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusW,
6979 false,
6982 "svcctl_OpenSCManagerW",
6983 sizeof(struct svcctl_OpenSCManagerW),
6984 (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerW,
6985 (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerW,
6986 (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerW,
6987 false,
6990 "svcctl_OpenServiceW",
6991 sizeof(struct svcctl_OpenServiceW),
6992 (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceW,
6993 (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceW,
6994 (ndr_print_function_t) ndr_print_svcctl_OpenServiceW,
6995 false,
6998 "svcctl_QueryServiceConfigW",
6999 sizeof(struct svcctl_QueryServiceConfigW),
7000 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigW,
7001 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigW,
7002 (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigW,
7003 false,
7006 "svcctl_QueryServiceLockStatusW",
7007 sizeof(struct svcctl_QueryServiceLockStatusW),
7008 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusW,
7009 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusW,
7010 (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusW,
7011 false,
7014 "svcctl_StartServiceW",
7015 sizeof(struct svcctl_StartServiceW),
7016 (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceW,
7017 (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceW,
7018 (ndr_print_function_t) ndr_print_svcctl_StartServiceW,
7019 false,
7022 "svcctl_GetServiceDisplayNameW",
7023 sizeof(struct svcctl_GetServiceDisplayNameW),
7024 (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameW,
7025 (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameW,
7026 (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameW,
7027 false,
7030 "svcctl_GetServiceKeyNameW",
7031 sizeof(struct svcctl_GetServiceKeyNameW),
7032 (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameW,
7033 (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameW,
7034 (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameW,
7035 false,
7038 "svcctl_SCSetServiceBitsA",
7039 sizeof(struct svcctl_SCSetServiceBitsA),
7040 (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsA,
7041 (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsA,
7042 (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsA,
7043 false,
7046 "svcctl_ChangeServiceConfigA",
7047 sizeof(struct svcctl_ChangeServiceConfigA),
7048 (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigA,
7049 (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigA,
7050 (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigA,
7051 false,
7054 "svcctl_CreateServiceA",
7055 sizeof(struct svcctl_CreateServiceA),
7056 (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceA,
7057 (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceA,
7058 (ndr_print_function_t) ndr_print_svcctl_CreateServiceA,
7059 false,
7062 "svcctl_EnumDependentServicesA",
7063 sizeof(struct svcctl_EnumDependentServicesA),
7064 (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesA,
7065 (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesA,
7066 (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesA,
7067 false,
7070 "svcctl_EnumServicesStatusA",
7071 sizeof(struct svcctl_EnumServicesStatusA),
7072 (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusA,
7073 (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusA,
7074 (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusA,
7075 false,
7078 "svcctl_OpenSCManagerA",
7079 sizeof(struct svcctl_OpenSCManagerA),
7080 (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerA,
7081 (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerA,
7082 (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerA,
7083 false,
7086 "svcctl_OpenServiceA",
7087 sizeof(struct svcctl_OpenServiceA),
7088 (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceA,
7089 (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceA,
7090 (ndr_print_function_t) ndr_print_svcctl_OpenServiceA,
7091 false,
7094 "svcctl_QueryServiceConfigA",
7095 sizeof(struct svcctl_QueryServiceConfigA),
7096 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigA,
7097 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigA,
7098 (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigA,
7099 false,
7102 "svcctl_QueryServiceLockStatusA",
7103 sizeof(struct svcctl_QueryServiceLockStatusA),
7104 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusA,
7105 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusA,
7106 (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusA,
7107 false,
7110 "svcctl_StartServiceA",
7111 sizeof(struct svcctl_StartServiceA),
7112 (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceA,
7113 (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceA,
7114 (ndr_print_function_t) ndr_print_svcctl_StartServiceA,
7115 false,
7118 "svcctl_GetServiceDisplayNameA",
7119 sizeof(struct svcctl_GetServiceDisplayNameA),
7120 (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameA,
7121 (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameA,
7122 (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameA,
7123 false,
7126 "svcctl_GetServiceKeyNameA",
7127 sizeof(struct svcctl_GetServiceKeyNameA),
7128 (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameA,
7129 (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameA,
7130 (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameA,
7131 false,
7134 "svcctl_GetCurrentGroupeStateW",
7135 sizeof(struct svcctl_GetCurrentGroupeStateW),
7136 (ndr_push_flags_fn_t) ndr_push_svcctl_GetCurrentGroupeStateW,
7137 (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetCurrentGroupeStateW,
7138 (ndr_print_function_t) ndr_print_svcctl_GetCurrentGroupeStateW,
7139 false,
7142 "svcctl_EnumServiceGroupW",
7143 sizeof(struct svcctl_EnumServiceGroupW),
7144 (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServiceGroupW,
7145 (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServiceGroupW,
7146 (ndr_print_function_t) ndr_print_svcctl_EnumServiceGroupW,
7147 false,
7150 "svcctl_ChangeServiceConfig2A",
7151 sizeof(struct svcctl_ChangeServiceConfig2A),
7152 (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2A,
7153 (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2A,
7154 (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2A,
7155 false,
7158 "svcctl_ChangeServiceConfig2W",
7159 sizeof(struct svcctl_ChangeServiceConfig2W),
7160 (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2W,
7161 (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2W,
7162 (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2W,
7163 false,
7166 "svcctl_QueryServiceConfig2A",
7167 sizeof(struct svcctl_QueryServiceConfig2A),
7168 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2A,
7169 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2A,
7170 (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2A,
7171 false,
7174 "svcctl_QueryServiceConfig2W",
7175 sizeof(struct svcctl_QueryServiceConfig2W),
7176 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2W,
7177 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2W,
7178 (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2W,
7179 false,
7182 "svcctl_QueryServiceStatusEx",
7183 sizeof(struct svcctl_QueryServiceStatusEx),
7184 (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatusEx,
7185 (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatusEx,
7186 (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatusEx,
7187 false,
7190 "EnumServicesStatusExA",
7191 sizeof(struct EnumServicesStatusExA),
7192 (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExA,
7193 (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExA,
7194 (ndr_print_function_t) ndr_print_EnumServicesStatusExA,
7195 false,
7198 "EnumServicesStatusExW",
7199 sizeof(struct EnumServicesStatusExW),
7200 (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExW,
7201 (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExW,
7202 (ndr_print_function_t) ndr_print_EnumServicesStatusExW,
7203 false,
7206 "svcctl_SCSendTSMessage",
7207 sizeof(struct svcctl_SCSendTSMessage),
7208 (ndr_push_flags_fn_t) ndr_push_svcctl_SCSendTSMessage,
7209 (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSendTSMessage,
7210 (ndr_print_function_t) ndr_print_svcctl_SCSendTSMessage,
7211 false,
7213 { NULL, 0, NULL, NULL, NULL, false }
7216 static const char * const svcctl_endpoint_strings[] = {
7217 "ncacn_np:[\\pipe\\svcctl]",
7218 "ncalrpc:",
7221 static const struct ndr_interface_string_array svcctl_endpoints = {
7222 .count = 2,
7223 .names = svcctl_endpoint_strings
7226 static const char * const svcctl_authservice_strings[] = {
7227 "host",
7230 static const struct ndr_interface_string_array svcctl_authservices = {
7231 .count = 1,
7232 .names = svcctl_authservice_strings
7236 const struct ndr_interface_table ndr_table_svcctl = {
7237 .name = "svcctl",
7238 .syntax_id = {
7239 {0x367abb81,0x9844,0x35f1,{0xad,0x32},{0x98,0xf0,0x38,0x00,0x10,0x03}},
7240 NDR_SVCCTL_VERSION
7242 .helpstring = NDR_SVCCTL_HELPSTRING,
7243 .num_calls = 44,
7244 .calls = svcctl_calls,
7245 .endpoints = &svcctl_endpoints,
7246 .authservices = &svcctl_authservices