r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / srv_svcctl.c
blob0211baa5836663076b82c33d36de52e954d3ba67
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_svcctl.h"
9 static BOOL api_svcctl_CloseServiceHandle(pipes_struct *p)
11 struct ndr_pull *pull;
12 struct ndr_push *push;
13 NTSTATUS status;
14 DATA_BLOB blob;
15 struct svcctl_CloseServiceHandle r;
16 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_CloseServiceHandle");
18 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
19 talloc_free(mem_ctx);
20 return False;
23 pull = ndr_pull_init_blob(&blob, mem_ctx);
24 if (pull == NULL) {
25 talloc_free(mem_ctx);
26 return False;
29 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
30 status = ndr_pull_svcctl_CloseServiceHandle(pull, NDR_IN, &r);
31 if (NT_STATUS_IS_ERR(status)) {
32 talloc_free(mem_ctx);
33 return False;
36 if (DEBUGLEVEL >= 10)
37 NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, &r);
39 ZERO_STRUCT(r.out);
40 r.out.handle = r.in.handle;
41 r.out.result = _svcctl_CloseServiceHandle(p, &r);
43 if (p->rng_fault_state) {
44 talloc_free(mem_ctx);
45 /* Return True here, srv_pipe_hnd.c will take care */
46 return True;
49 if (DEBUGLEVEL >= 10)
50 NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &r);
52 push = ndr_push_init_ctx(mem_ctx);
53 if (push == NULL) {
54 talloc_free(mem_ctx);
55 return False;
58 status = ndr_push_svcctl_CloseServiceHandle(push, NDR_OUT, &r);
59 if (NT_STATUS_IS_ERR(status)) {
60 talloc_free(mem_ctx);
61 return False;
64 blob = ndr_push_blob(push);
65 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
66 talloc_free(mem_ctx);
67 return False;
70 talloc_free(mem_ctx);
72 return True;
75 static BOOL api_svcctl_ControlService(pipes_struct *p)
77 struct ndr_pull *pull;
78 struct ndr_push *push;
79 NTSTATUS status;
80 DATA_BLOB blob;
81 struct svcctl_ControlService r;
82 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_ControlService");
84 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
85 talloc_free(mem_ctx);
86 return False;
89 pull = ndr_pull_init_blob(&blob, mem_ctx);
90 if (pull == NULL) {
91 talloc_free(mem_ctx);
92 return False;
95 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
96 status = ndr_pull_svcctl_ControlService(pull, NDR_IN, &r);
97 if (NT_STATUS_IS_ERR(status)) {
98 talloc_free(mem_ctx);
99 return False;
102 if (DEBUGLEVEL >= 10)
103 NDR_PRINT_IN_DEBUG(svcctl_ControlService, &r);
105 ZERO_STRUCT(r.out);
106 r.out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
107 if (r.out.service_status == NULL) {
108 talloc_free(mem_ctx);
109 return False;
112 r.out.result = _svcctl_ControlService(p, &r);
114 if (p->rng_fault_state) {
115 talloc_free(mem_ctx);
116 /* Return True here, srv_pipe_hnd.c will take care */
117 return True;
120 if (DEBUGLEVEL >= 10)
121 NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &r);
123 push = ndr_push_init_ctx(mem_ctx);
124 if (push == NULL) {
125 talloc_free(mem_ctx);
126 return False;
129 status = ndr_push_svcctl_ControlService(push, NDR_OUT, &r);
130 if (NT_STATUS_IS_ERR(status)) {
131 talloc_free(mem_ctx);
132 return False;
135 blob = ndr_push_blob(push);
136 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
137 talloc_free(mem_ctx);
138 return False;
141 talloc_free(mem_ctx);
143 return True;
146 static BOOL api_svcctl_DeleteService(pipes_struct *p)
148 struct ndr_pull *pull;
149 struct ndr_push *push;
150 NTSTATUS status;
151 DATA_BLOB blob;
152 struct svcctl_DeleteService r;
153 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_DeleteService");
155 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
156 talloc_free(mem_ctx);
157 return False;
160 pull = ndr_pull_init_blob(&blob, mem_ctx);
161 if (pull == NULL) {
162 talloc_free(mem_ctx);
163 return False;
166 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
167 status = ndr_pull_svcctl_DeleteService(pull, NDR_IN, &r);
168 if (NT_STATUS_IS_ERR(status)) {
169 talloc_free(mem_ctx);
170 return False;
173 if (DEBUGLEVEL >= 10)
174 NDR_PRINT_IN_DEBUG(svcctl_DeleteService, &r);
176 r.out.result = _svcctl_DeleteService(p, &r);
178 if (p->rng_fault_state) {
179 talloc_free(mem_ctx);
180 /* Return True here, srv_pipe_hnd.c will take care */
181 return True;
184 if (DEBUGLEVEL >= 10)
185 NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &r);
187 push = ndr_push_init_ctx(mem_ctx);
188 if (push == NULL) {
189 talloc_free(mem_ctx);
190 return False;
193 status = ndr_push_svcctl_DeleteService(push, NDR_OUT, &r);
194 if (NT_STATUS_IS_ERR(status)) {
195 talloc_free(mem_ctx);
196 return False;
199 blob = ndr_push_blob(push);
200 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
201 talloc_free(mem_ctx);
202 return False;
205 talloc_free(mem_ctx);
207 return True;
210 static BOOL api_svcctl_LockServiceDatabase(pipes_struct *p)
212 struct ndr_pull *pull;
213 struct ndr_push *push;
214 NTSTATUS status;
215 DATA_BLOB blob;
216 struct svcctl_LockServiceDatabase r;
217 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_LockServiceDatabase");
219 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
220 talloc_free(mem_ctx);
221 return False;
224 pull = ndr_pull_init_blob(&blob, mem_ctx);
225 if (pull == NULL) {
226 talloc_free(mem_ctx);
227 return False;
230 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
231 status = ndr_pull_svcctl_LockServiceDatabase(pull, NDR_IN, &r);
232 if (NT_STATUS_IS_ERR(status)) {
233 talloc_free(mem_ctx);
234 return False;
237 if (DEBUGLEVEL >= 10)
238 NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, &r);
240 ZERO_STRUCT(r.out);
241 r.out.lock = talloc_zero(mem_ctx, struct policy_handle);
242 if (r.out.lock == NULL) {
243 talloc_free(mem_ctx);
244 return False;
247 r.out.result = _svcctl_LockServiceDatabase(p, &r);
249 if (p->rng_fault_state) {
250 talloc_free(mem_ctx);
251 /* Return True here, srv_pipe_hnd.c will take care */
252 return True;
255 if (DEBUGLEVEL >= 10)
256 NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &r);
258 push = ndr_push_init_ctx(mem_ctx);
259 if (push == NULL) {
260 talloc_free(mem_ctx);
261 return False;
264 status = ndr_push_svcctl_LockServiceDatabase(push, NDR_OUT, &r);
265 if (NT_STATUS_IS_ERR(status)) {
266 talloc_free(mem_ctx);
267 return False;
270 blob = ndr_push_blob(push);
271 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
272 talloc_free(mem_ctx);
273 return False;
276 talloc_free(mem_ctx);
278 return True;
281 static BOOL api_svcctl_QueryServiceObjectSecurity(pipes_struct *p)
283 struct ndr_pull *pull;
284 struct ndr_push *push;
285 NTSTATUS status;
286 DATA_BLOB blob;
287 struct svcctl_QueryServiceObjectSecurity r;
288 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceObjectSecurity");
290 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
291 talloc_free(mem_ctx);
292 return False;
295 pull = ndr_pull_init_blob(&blob, mem_ctx);
296 if (pull == NULL) {
297 talloc_free(mem_ctx);
298 return False;
301 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
302 status = ndr_pull_svcctl_QueryServiceObjectSecurity(pull, NDR_IN, &r);
303 if (NT_STATUS_IS_ERR(status)) {
304 talloc_free(mem_ctx);
305 return False;
308 if (DEBUGLEVEL >= 10)
309 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &r);
311 r.out.result = _svcctl_QueryServiceObjectSecurity(p, &r);
313 if (p->rng_fault_state) {
314 talloc_free(mem_ctx);
315 /* Return True here, srv_pipe_hnd.c will take care */
316 return True;
319 if (DEBUGLEVEL >= 10)
320 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &r);
322 push = ndr_push_init_ctx(mem_ctx);
323 if (push == NULL) {
324 talloc_free(mem_ctx);
325 return False;
328 status = ndr_push_svcctl_QueryServiceObjectSecurity(push, NDR_OUT, &r);
329 if (NT_STATUS_IS_ERR(status)) {
330 talloc_free(mem_ctx);
331 return False;
334 blob = ndr_push_blob(push);
335 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
336 talloc_free(mem_ctx);
337 return False;
340 talloc_free(mem_ctx);
342 return True;
345 static BOOL api_svcctl_SetServiceObjectSecurity(pipes_struct *p)
347 struct ndr_pull *pull;
348 struct ndr_push *push;
349 NTSTATUS status;
350 DATA_BLOB blob;
351 struct svcctl_SetServiceObjectSecurity r;
352 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_SetServiceObjectSecurity");
354 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
355 talloc_free(mem_ctx);
356 return False;
359 pull = ndr_pull_init_blob(&blob, mem_ctx);
360 if (pull == NULL) {
361 talloc_free(mem_ctx);
362 return False;
365 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
366 status = ndr_pull_svcctl_SetServiceObjectSecurity(pull, NDR_IN, &r);
367 if (NT_STATUS_IS_ERR(status)) {
368 talloc_free(mem_ctx);
369 return False;
372 if (DEBUGLEVEL >= 10)
373 NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r);
375 r.out.result = _svcctl_SetServiceObjectSecurity(p, &r);
377 if (p->rng_fault_state) {
378 talloc_free(mem_ctx);
379 /* Return True here, srv_pipe_hnd.c will take care */
380 return True;
383 if (DEBUGLEVEL >= 10)
384 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r);
386 push = ndr_push_init_ctx(mem_ctx);
387 if (push == NULL) {
388 talloc_free(mem_ctx);
389 return False;
392 status = ndr_push_svcctl_SetServiceObjectSecurity(push, NDR_OUT, &r);
393 if (NT_STATUS_IS_ERR(status)) {
394 talloc_free(mem_ctx);
395 return False;
398 blob = ndr_push_blob(push);
399 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
400 talloc_free(mem_ctx);
401 return False;
404 talloc_free(mem_ctx);
406 return True;
409 static BOOL api_svcctl_QueryServiceStatus(pipes_struct *p)
411 struct ndr_pull *pull;
412 struct ndr_push *push;
413 NTSTATUS status;
414 DATA_BLOB blob;
415 struct svcctl_QueryServiceStatus r;
416 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceStatus");
418 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
419 talloc_free(mem_ctx);
420 return False;
423 pull = ndr_pull_init_blob(&blob, mem_ctx);
424 if (pull == NULL) {
425 talloc_free(mem_ctx);
426 return False;
429 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
430 status = ndr_pull_svcctl_QueryServiceStatus(pull, NDR_IN, &r);
431 if (NT_STATUS_IS_ERR(status)) {
432 talloc_free(mem_ctx);
433 return False;
436 if (DEBUGLEVEL >= 10)
437 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, &r);
439 ZERO_STRUCT(r.out);
440 r.out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
441 if (r.out.service_status == NULL) {
442 talloc_free(mem_ctx);
443 return False;
446 r.out.result = _svcctl_QueryServiceStatus(p, &r);
448 if (p->rng_fault_state) {
449 talloc_free(mem_ctx);
450 /* Return True here, srv_pipe_hnd.c will take care */
451 return True;
454 if (DEBUGLEVEL >= 10)
455 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &r);
457 push = ndr_push_init_ctx(mem_ctx);
458 if (push == NULL) {
459 talloc_free(mem_ctx);
460 return False;
463 status = ndr_push_svcctl_QueryServiceStatus(push, NDR_OUT, &r);
464 if (NT_STATUS_IS_ERR(status)) {
465 talloc_free(mem_ctx);
466 return False;
469 blob = ndr_push_blob(push);
470 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
471 talloc_free(mem_ctx);
472 return False;
475 talloc_free(mem_ctx);
477 return True;
480 static BOOL api_svcctl_SetServiceStatus(pipes_struct *p)
482 struct ndr_pull *pull;
483 struct ndr_push *push;
484 NTSTATUS status;
485 DATA_BLOB blob;
486 struct svcctl_SetServiceStatus r;
487 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_SetServiceStatus");
489 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
490 talloc_free(mem_ctx);
491 return False;
494 pull = ndr_pull_init_blob(&blob, mem_ctx);
495 if (pull == NULL) {
496 talloc_free(mem_ctx);
497 return False;
500 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
501 status = ndr_pull_svcctl_SetServiceStatus(pull, NDR_IN, &r);
502 if (NT_STATUS_IS_ERR(status)) {
503 talloc_free(mem_ctx);
504 return False;
507 if (DEBUGLEVEL >= 10)
508 NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, &r);
510 r.out.result = _svcctl_SetServiceStatus(p, &r);
512 if (p->rng_fault_state) {
513 talloc_free(mem_ctx);
514 /* Return True here, srv_pipe_hnd.c will take care */
515 return True;
518 if (DEBUGLEVEL >= 10)
519 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &r);
521 push = ndr_push_init_ctx(mem_ctx);
522 if (push == NULL) {
523 talloc_free(mem_ctx);
524 return False;
527 status = ndr_push_svcctl_SetServiceStatus(push, NDR_OUT, &r);
528 if (NT_STATUS_IS_ERR(status)) {
529 talloc_free(mem_ctx);
530 return False;
533 blob = ndr_push_blob(push);
534 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
535 talloc_free(mem_ctx);
536 return False;
539 talloc_free(mem_ctx);
541 return True;
544 static BOOL api_svcctl_UnlockServiceDatabase(pipes_struct *p)
546 struct ndr_pull *pull;
547 struct ndr_push *push;
548 NTSTATUS status;
549 DATA_BLOB blob;
550 struct svcctl_UnlockServiceDatabase r;
551 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_UnlockServiceDatabase");
553 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
554 talloc_free(mem_ctx);
555 return False;
558 pull = ndr_pull_init_blob(&blob, mem_ctx);
559 if (pull == NULL) {
560 talloc_free(mem_ctx);
561 return False;
564 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
565 status = ndr_pull_svcctl_UnlockServiceDatabase(pull, NDR_IN, &r);
566 if (NT_STATUS_IS_ERR(status)) {
567 talloc_free(mem_ctx);
568 return False;
571 if (DEBUGLEVEL >= 10)
572 NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, &r);
574 ZERO_STRUCT(r.out);
575 r.out.lock = r.in.lock;
576 r.out.result = _svcctl_UnlockServiceDatabase(p, &r);
578 if (p->rng_fault_state) {
579 talloc_free(mem_ctx);
580 /* Return True here, srv_pipe_hnd.c will take care */
581 return True;
584 if (DEBUGLEVEL >= 10)
585 NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &r);
587 push = ndr_push_init_ctx(mem_ctx);
588 if (push == NULL) {
589 talloc_free(mem_ctx);
590 return False;
593 status = ndr_push_svcctl_UnlockServiceDatabase(push, NDR_OUT, &r);
594 if (NT_STATUS_IS_ERR(status)) {
595 talloc_free(mem_ctx);
596 return False;
599 blob = ndr_push_blob(push);
600 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
601 talloc_free(mem_ctx);
602 return False;
605 talloc_free(mem_ctx);
607 return True;
610 static BOOL api_svcctl_NotifyBootConfigStatus(pipes_struct *p)
612 struct ndr_pull *pull;
613 struct ndr_push *push;
614 NTSTATUS status;
615 DATA_BLOB blob;
616 struct svcctl_NotifyBootConfigStatus r;
617 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_NotifyBootConfigStatus");
619 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
620 talloc_free(mem_ctx);
621 return False;
624 pull = ndr_pull_init_blob(&blob, mem_ctx);
625 if (pull == NULL) {
626 talloc_free(mem_ctx);
627 return False;
630 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
631 status = ndr_pull_svcctl_NotifyBootConfigStatus(pull, NDR_IN, &r);
632 if (NT_STATUS_IS_ERR(status)) {
633 talloc_free(mem_ctx);
634 return False;
637 if (DEBUGLEVEL >= 10)
638 NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, &r);
640 r.out.result = _svcctl_NotifyBootConfigStatus(p, &r);
642 if (p->rng_fault_state) {
643 talloc_free(mem_ctx);
644 /* Return True here, srv_pipe_hnd.c will take care */
645 return True;
648 if (DEBUGLEVEL >= 10)
649 NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &r);
651 push = ndr_push_init_ctx(mem_ctx);
652 if (push == NULL) {
653 talloc_free(mem_ctx);
654 return False;
657 status = ndr_push_svcctl_NotifyBootConfigStatus(push, NDR_OUT, &r);
658 if (NT_STATUS_IS_ERR(status)) {
659 talloc_free(mem_ctx);
660 return False;
663 blob = ndr_push_blob(push);
664 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
665 talloc_free(mem_ctx);
666 return False;
669 talloc_free(mem_ctx);
671 return True;
674 static BOOL api_svcctl_SCSetServiceBitsW(pipes_struct *p)
676 struct ndr_pull *pull;
677 struct ndr_push *push;
678 NTSTATUS status;
679 DATA_BLOB blob;
680 struct svcctl_SCSetServiceBitsW r;
681 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_SCSetServiceBitsW");
683 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
684 talloc_free(mem_ctx);
685 return False;
688 pull = ndr_pull_init_blob(&blob, mem_ctx);
689 if (pull == NULL) {
690 talloc_free(mem_ctx);
691 return False;
694 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
695 status = ndr_pull_svcctl_SCSetServiceBitsW(pull, NDR_IN, &r);
696 if (NT_STATUS_IS_ERR(status)) {
697 talloc_free(mem_ctx);
698 return False;
701 if (DEBUGLEVEL >= 10)
702 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, &r);
704 r.out.result = _svcctl_SCSetServiceBitsW(p, &r);
706 if (p->rng_fault_state) {
707 talloc_free(mem_ctx);
708 /* Return True here, srv_pipe_hnd.c will take care */
709 return True;
712 if (DEBUGLEVEL >= 10)
713 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &r);
715 push = ndr_push_init_ctx(mem_ctx);
716 if (push == NULL) {
717 talloc_free(mem_ctx);
718 return False;
721 status = ndr_push_svcctl_SCSetServiceBitsW(push, NDR_OUT, &r);
722 if (NT_STATUS_IS_ERR(status)) {
723 talloc_free(mem_ctx);
724 return False;
727 blob = ndr_push_blob(push);
728 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
729 talloc_free(mem_ctx);
730 return False;
733 talloc_free(mem_ctx);
735 return True;
738 static BOOL api_svcctl_ChangeServiceConfigW(pipes_struct *p)
740 struct ndr_pull *pull;
741 struct ndr_push *push;
742 NTSTATUS status;
743 DATA_BLOB blob;
744 struct svcctl_ChangeServiceConfigW r;
745 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_ChangeServiceConfigW");
747 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
748 talloc_free(mem_ctx);
749 return False;
752 pull = ndr_pull_init_blob(&blob, mem_ctx);
753 if (pull == NULL) {
754 talloc_free(mem_ctx);
755 return False;
758 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
759 status = ndr_pull_svcctl_ChangeServiceConfigW(pull, NDR_IN, &r);
760 if (NT_STATUS_IS_ERR(status)) {
761 talloc_free(mem_ctx);
762 return False;
765 if (DEBUGLEVEL >= 10)
766 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, &r);
768 ZERO_STRUCT(r.out);
769 r.out.tag_id = talloc_zero(mem_ctx, uint32_t);
770 if (r.out.tag_id == NULL) {
771 talloc_free(mem_ctx);
772 return False;
775 r.out.result = _svcctl_ChangeServiceConfigW(p, &r);
777 if (p->rng_fault_state) {
778 talloc_free(mem_ctx);
779 /* Return True here, srv_pipe_hnd.c will take care */
780 return True;
783 if (DEBUGLEVEL >= 10)
784 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &r);
786 push = ndr_push_init_ctx(mem_ctx);
787 if (push == NULL) {
788 talloc_free(mem_ctx);
789 return False;
792 status = ndr_push_svcctl_ChangeServiceConfigW(push, NDR_OUT, &r);
793 if (NT_STATUS_IS_ERR(status)) {
794 talloc_free(mem_ctx);
795 return False;
798 blob = ndr_push_blob(push);
799 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
800 talloc_free(mem_ctx);
801 return False;
804 talloc_free(mem_ctx);
806 return True;
809 static BOOL api_svcctl_CreateServiceW(pipes_struct *p)
811 struct ndr_pull *pull;
812 struct ndr_push *push;
813 NTSTATUS status;
814 DATA_BLOB blob;
815 struct svcctl_CreateServiceW r;
816 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_CreateServiceW");
818 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
819 talloc_free(mem_ctx);
820 return False;
823 pull = ndr_pull_init_blob(&blob, mem_ctx);
824 if (pull == NULL) {
825 talloc_free(mem_ctx);
826 return False;
829 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
830 status = ndr_pull_svcctl_CreateServiceW(pull, NDR_IN, &r);
831 if (NT_STATUS_IS_ERR(status)) {
832 talloc_free(mem_ctx);
833 return False;
836 if (DEBUGLEVEL >= 10)
837 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, &r);
839 ZERO_STRUCT(r.out);
840 r.out.TagId = r.in.TagId;
841 r.out.handle = talloc_zero(mem_ctx, struct policy_handle);
842 if (r.out.handle == NULL) {
843 talloc_free(mem_ctx);
844 return False;
847 r.out.result = _svcctl_CreateServiceW(p, &r);
849 if (p->rng_fault_state) {
850 talloc_free(mem_ctx);
851 /* Return True here, srv_pipe_hnd.c will take care */
852 return True;
855 if (DEBUGLEVEL >= 10)
856 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &r);
858 push = ndr_push_init_ctx(mem_ctx);
859 if (push == NULL) {
860 talloc_free(mem_ctx);
861 return False;
864 status = ndr_push_svcctl_CreateServiceW(push, NDR_OUT, &r);
865 if (NT_STATUS_IS_ERR(status)) {
866 talloc_free(mem_ctx);
867 return False;
870 blob = ndr_push_blob(push);
871 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
872 talloc_free(mem_ctx);
873 return False;
876 talloc_free(mem_ctx);
878 return True;
881 static BOOL api_svcctl_EnumDependentServicesW(pipes_struct *p)
883 struct ndr_pull *pull;
884 struct ndr_push *push;
885 NTSTATUS status;
886 DATA_BLOB blob;
887 struct svcctl_EnumDependentServicesW r;
888 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_EnumDependentServicesW");
890 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
891 talloc_free(mem_ctx);
892 return False;
895 pull = ndr_pull_init_blob(&blob, mem_ctx);
896 if (pull == NULL) {
897 talloc_free(mem_ctx);
898 return False;
901 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
902 status = ndr_pull_svcctl_EnumDependentServicesW(pull, NDR_IN, &r);
903 if (NT_STATUS_IS_ERR(status)) {
904 talloc_free(mem_ctx);
905 return False;
908 if (DEBUGLEVEL >= 10)
909 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, &r);
911 ZERO_STRUCT(r.out);
912 r.out.service_status = talloc_zero(mem_ctx, struct ENUM_SERVICE_STATUS);
913 if (r.out.service_status == NULL) {
914 talloc_free(mem_ctx);
915 return False;
918 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
919 if (r.out.bytes_needed == NULL) {
920 talloc_free(mem_ctx);
921 return False;
924 r.out.services_returned = talloc_zero(mem_ctx, uint32_t);
925 if (r.out.services_returned == NULL) {
926 talloc_free(mem_ctx);
927 return False;
930 r.out.result = _svcctl_EnumDependentServicesW(p, &r);
932 if (p->rng_fault_state) {
933 talloc_free(mem_ctx);
934 /* Return True here, srv_pipe_hnd.c will take care */
935 return True;
938 if (DEBUGLEVEL >= 10)
939 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &r);
941 push = ndr_push_init_ctx(mem_ctx);
942 if (push == NULL) {
943 talloc_free(mem_ctx);
944 return False;
947 status = ndr_push_svcctl_EnumDependentServicesW(push, NDR_OUT, &r);
948 if (NT_STATUS_IS_ERR(status)) {
949 talloc_free(mem_ctx);
950 return False;
953 blob = ndr_push_blob(push);
954 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
955 talloc_free(mem_ctx);
956 return False;
959 talloc_free(mem_ctx);
961 return True;
964 static BOOL api_svcctl_EnumServicesStatusW(pipes_struct *p)
966 struct ndr_pull *pull;
967 struct ndr_push *push;
968 NTSTATUS status;
969 DATA_BLOB blob;
970 struct svcctl_EnumServicesStatusW r;
971 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_EnumServicesStatusW");
973 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
974 talloc_free(mem_ctx);
975 return False;
978 pull = ndr_pull_init_blob(&blob, mem_ctx);
979 if (pull == NULL) {
980 talloc_free(mem_ctx);
981 return False;
984 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
985 status = ndr_pull_svcctl_EnumServicesStatusW(pull, NDR_IN, &r);
986 if (NT_STATUS_IS_ERR(status)) {
987 talloc_free(mem_ctx);
988 return False;
991 if (DEBUGLEVEL >= 10)
992 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, &r);
994 ZERO_STRUCT(r.out);
995 r.out.service = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
996 if (r.out.service == NULL) {
997 talloc_free(mem_ctx);
998 return False;
1001 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
1002 if (r.out.bytes_needed == NULL) {
1003 talloc_free(mem_ctx);
1004 return False;
1007 r.out.services_returned = talloc_zero(mem_ctx, uint32_t);
1008 if (r.out.services_returned == NULL) {
1009 talloc_free(mem_ctx);
1010 return False;
1013 r.out.resume_handle = r.in.resume_handle;
1014 r.out.result = _svcctl_EnumServicesStatusW(p, &r);
1016 if (p->rng_fault_state) {
1017 talloc_free(mem_ctx);
1018 /* Return True here, srv_pipe_hnd.c will take care */
1019 return True;
1022 if (DEBUGLEVEL >= 10)
1023 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &r);
1025 push = ndr_push_init_ctx(mem_ctx);
1026 if (push == NULL) {
1027 talloc_free(mem_ctx);
1028 return False;
1031 status = ndr_push_svcctl_EnumServicesStatusW(push, NDR_OUT, &r);
1032 if (NT_STATUS_IS_ERR(status)) {
1033 talloc_free(mem_ctx);
1034 return False;
1037 blob = ndr_push_blob(push);
1038 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1039 talloc_free(mem_ctx);
1040 return False;
1043 talloc_free(mem_ctx);
1045 return True;
1048 static BOOL api_svcctl_OpenSCManagerW(pipes_struct *p)
1050 struct ndr_pull *pull;
1051 struct ndr_push *push;
1052 NTSTATUS status;
1053 DATA_BLOB blob;
1054 struct svcctl_OpenSCManagerW r;
1055 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_OpenSCManagerW");
1057 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1058 talloc_free(mem_ctx);
1059 return False;
1062 pull = ndr_pull_init_blob(&blob, mem_ctx);
1063 if (pull == NULL) {
1064 talloc_free(mem_ctx);
1065 return False;
1068 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1069 status = ndr_pull_svcctl_OpenSCManagerW(pull, NDR_IN, &r);
1070 if (NT_STATUS_IS_ERR(status)) {
1071 talloc_free(mem_ctx);
1072 return False;
1075 if (DEBUGLEVEL >= 10)
1076 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &r);
1078 ZERO_STRUCT(r.out);
1079 r.out.handle = talloc_zero(mem_ctx, struct policy_handle);
1080 if (r.out.handle == NULL) {
1081 talloc_free(mem_ctx);
1082 return False;
1085 r.out.result = _svcctl_OpenSCManagerW(p, &r);
1087 if (p->rng_fault_state) {
1088 talloc_free(mem_ctx);
1089 /* Return True here, srv_pipe_hnd.c will take care */
1090 return True;
1093 if (DEBUGLEVEL >= 10)
1094 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r);
1096 push = ndr_push_init_ctx(mem_ctx);
1097 if (push == NULL) {
1098 talloc_free(mem_ctx);
1099 return False;
1102 status = ndr_push_svcctl_OpenSCManagerW(push, NDR_OUT, &r);
1103 if (NT_STATUS_IS_ERR(status)) {
1104 talloc_free(mem_ctx);
1105 return False;
1108 blob = ndr_push_blob(push);
1109 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1110 talloc_free(mem_ctx);
1111 return False;
1114 talloc_free(mem_ctx);
1116 return True;
1119 static BOOL api_svcctl_OpenServiceW(pipes_struct *p)
1121 struct ndr_pull *pull;
1122 struct ndr_push *push;
1123 NTSTATUS status;
1124 DATA_BLOB blob;
1125 struct svcctl_OpenServiceW r;
1126 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_OpenServiceW");
1128 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1129 talloc_free(mem_ctx);
1130 return False;
1133 pull = ndr_pull_init_blob(&blob, mem_ctx);
1134 if (pull == NULL) {
1135 talloc_free(mem_ctx);
1136 return False;
1139 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1140 status = ndr_pull_svcctl_OpenServiceW(pull, NDR_IN, &r);
1141 if (NT_STATUS_IS_ERR(status)) {
1142 talloc_free(mem_ctx);
1143 return False;
1146 if (DEBUGLEVEL >= 10)
1147 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, &r);
1149 ZERO_STRUCT(r.out);
1150 r.out.handle = talloc_zero(mem_ctx, struct policy_handle);
1151 if (r.out.handle == NULL) {
1152 talloc_free(mem_ctx);
1153 return False;
1156 r.out.result = _svcctl_OpenServiceW(p, &r);
1158 if (p->rng_fault_state) {
1159 talloc_free(mem_ctx);
1160 /* Return True here, srv_pipe_hnd.c will take care */
1161 return True;
1164 if (DEBUGLEVEL >= 10)
1165 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &r);
1167 push = ndr_push_init_ctx(mem_ctx);
1168 if (push == NULL) {
1169 talloc_free(mem_ctx);
1170 return False;
1173 status = ndr_push_svcctl_OpenServiceW(push, NDR_OUT, &r);
1174 if (NT_STATUS_IS_ERR(status)) {
1175 talloc_free(mem_ctx);
1176 return False;
1179 blob = ndr_push_blob(push);
1180 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1181 talloc_free(mem_ctx);
1182 return False;
1185 talloc_free(mem_ctx);
1187 return True;
1190 static BOOL api_svcctl_QueryServiceConfigW(pipes_struct *p)
1192 struct ndr_pull *pull;
1193 struct ndr_push *push;
1194 NTSTATUS status;
1195 DATA_BLOB blob;
1196 struct svcctl_QueryServiceConfigW r;
1197 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceConfigW");
1199 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1200 talloc_free(mem_ctx);
1201 return False;
1204 pull = ndr_pull_init_blob(&blob, mem_ctx);
1205 if (pull == NULL) {
1206 talloc_free(mem_ctx);
1207 return False;
1210 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1211 status = ndr_pull_svcctl_QueryServiceConfigW(pull, NDR_IN, &r);
1212 if (NT_STATUS_IS_ERR(status)) {
1213 talloc_free(mem_ctx);
1214 return False;
1217 if (DEBUGLEVEL >= 10)
1218 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, &r);
1220 ZERO_STRUCT(r.out);
1221 r.out.query = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
1222 if (r.out.query == NULL) {
1223 talloc_free(mem_ctx);
1224 return False;
1227 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
1228 if (r.out.bytes_needed == NULL) {
1229 talloc_free(mem_ctx);
1230 return False;
1233 r.out.result = _svcctl_QueryServiceConfigW(p, &r);
1235 if (p->rng_fault_state) {
1236 talloc_free(mem_ctx);
1237 /* Return True here, srv_pipe_hnd.c will take care */
1238 return True;
1241 if (DEBUGLEVEL >= 10)
1242 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &r);
1244 push = ndr_push_init_ctx(mem_ctx);
1245 if (push == NULL) {
1246 talloc_free(mem_ctx);
1247 return False;
1250 status = ndr_push_svcctl_QueryServiceConfigW(push, NDR_OUT, &r);
1251 if (NT_STATUS_IS_ERR(status)) {
1252 talloc_free(mem_ctx);
1253 return False;
1256 blob = ndr_push_blob(push);
1257 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1258 talloc_free(mem_ctx);
1259 return False;
1262 talloc_free(mem_ctx);
1264 return True;
1267 static BOOL api_svcctl_QueryServiceLockStatusW(pipes_struct *p)
1269 struct ndr_pull *pull;
1270 struct ndr_push *push;
1271 NTSTATUS status;
1272 DATA_BLOB blob;
1273 struct svcctl_QueryServiceLockStatusW r;
1274 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceLockStatusW");
1276 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1277 talloc_free(mem_ctx);
1278 return False;
1281 pull = ndr_pull_init_blob(&blob, mem_ctx);
1282 if (pull == NULL) {
1283 talloc_free(mem_ctx);
1284 return False;
1287 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1288 status = ndr_pull_svcctl_QueryServiceLockStatusW(pull, NDR_IN, &r);
1289 if (NT_STATUS_IS_ERR(status)) {
1290 talloc_free(mem_ctx);
1291 return False;
1294 if (DEBUGLEVEL >= 10)
1295 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, &r);
1297 ZERO_STRUCT(r.out);
1298 r.out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
1299 if (r.out.lock_status == NULL) {
1300 talloc_free(mem_ctx);
1301 return False;
1304 r.out.required_buf_size = talloc_zero(mem_ctx, uint32_t);
1305 if (r.out.required_buf_size == NULL) {
1306 talloc_free(mem_ctx);
1307 return False;
1310 r.out.result = _svcctl_QueryServiceLockStatusW(p, &r);
1312 if (p->rng_fault_state) {
1313 talloc_free(mem_ctx);
1314 /* Return True here, srv_pipe_hnd.c will take care */
1315 return True;
1318 if (DEBUGLEVEL >= 10)
1319 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &r);
1321 push = ndr_push_init_ctx(mem_ctx);
1322 if (push == NULL) {
1323 talloc_free(mem_ctx);
1324 return False;
1327 status = ndr_push_svcctl_QueryServiceLockStatusW(push, NDR_OUT, &r);
1328 if (NT_STATUS_IS_ERR(status)) {
1329 talloc_free(mem_ctx);
1330 return False;
1333 blob = ndr_push_blob(push);
1334 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1335 talloc_free(mem_ctx);
1336 return False;
1339 talloc_free(mem_ctx);
1341 return True;
1344 static BOOL api_svcctl_StartServiceW(pipes_struct *p)
1346 struct ndr_pull *pull;
1347 struct ndr_push *push;
1348 NTSTATUS status;
1349 DATA_BLOB blob;
1350 struct svcctl_StartServiceW r;
1351 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_StartServiceW");
1353 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1354 talloc_free(mem_ctx);
1355 return False;
1358 pull = ndr_pull_init_blob(&blob, mem_ctx);
1359 if (pull == NULL) {
1360 talloc_free(mem_ctx);
1361 return False;
1364 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1365 status = ndr_pull_svcctl_StartServiceW(pull, NDR_IN, &r);
1366 if (NT_STATUS_IS_ERR(status)) {
1367 talloc_free(mem_ctx);
1368 return False;
1371 if (DEBUGLEVEL >= 10)
1372 NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, &r);
1374 r.out.result = _svcctl_StartServiceW(p, &r);
1376 if (p->rng_fault_state) {
1377 talloc_free(mem_ctx);
1378 /* Return True here, srv_pipe_hnd.c will take care */
1379 return True;
1382 if (DEBUGLEVEL >= 10)
1383 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &r);
1385 push = ndr_push_init_ctx(mem_ctx);
1386 if (push == NULL) {
1387 talloc_free(mem_ctx);
1388 return False;
1391 status = ndr_push_svcctl_StartServiceW(push, NDR_OUT, &r);
1392 if (NT_STATUS_IS_ERR(status)) {
1393 talloc_free(mem_ctx);
1394 return False;
1397 blob = ndr_push_blob(push);
1398 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1399 talloc_free(mem_ctx);
1400 return False;
1403 talloc_free(mem_ctx);
1405 return True;
1408 static BOOL api_svcctl_GetServiceDisplayNameW(pipes_struct *p)
1410 struct ndr_pull *pull;
1411 struct ndr_push *push;
1412 NTSTATUS status;
1413 DATA_BLOB blob;
1414 struct svcctl_GetServiceDisplayNameW r;
1415 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_GetServiceDisplayNameW");
1417 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1418 talloc_free(mem_ctx);
1419 return False;
1422 pull = ndr_pull_init_blob(&blob, mem_ctx);
1423 if (pull == NULL) {
1424 talloc_free(mem_ctx);
1425 return False;
1428 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1429 status = ndr_pull_svcctl_GetServiceDisplayNameW(pull, NDR_IN, &r);
1430 if (NT_STATUS_IS_ERR(status)) {
1431 talloc_free(mem_ctx);
1432 return False;
1435 if (DEBUGLEVEL >= 10)
1436 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, &r);
1438 ZERO_STRUCT(r.out);
1439 r.out.display_name = talloc_zero(mem_ctx, const char *);
1440 if (r.out.display_name == NULL) {
1441 talloc_free(mem_ctx);
1442 return False;
1445 r.out.display_name_length = r.in.display_name_length;
1446 r.out.result = _svcctl_GetServiceDisplayNameW(p, &r);
1448 if (p->rng_fault_state) {
1449 talloc_free(mem_ctx);
1450 /* Return True here, srv_pipe_hnd.c will take care */
1451 return True;
1454 if (DEBUGLEVEL >= 10)
1455 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &r);
1457 push = ndr_push_init_ctx(mem_ctx);
1458 if (push == NULL) {
1459 talloc_free(mem_ctx);
1460 return False;
1463 status = ndr_push_svcctl_GetServiceDisplayNameW(push, NDR_OUT, &r);
1464 if (NT_STATUS_IS_ERR(status)) {
1465 talloc_free(mem_ctx);
1466 return False;
1469 blob = ndr_push_blob(push);
1470 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1471 talloc_free(mem_ctx);
1472 return False;
1475 talloc_free(mem_ctx);
1477 return True;
1480 static BOOL api_svcctl_GetServiceKeyNameW(pipes_struct *p)
1482 struct ndr_pull *pull;
1483 struct ndr_push *push;
1484 NTSTATUS status;
1485 DATA_BLOB blob;
1486 struct svcctl_GetServiceKeyNameW r;
1487 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_GetServiceKeyNameW");
1489 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1490 talloc_free(mem_ctx);
1491 return False;
1494 pull = ndr_pull_init_blob(&blob, mem_ctx);
1495 if (pull == NULL) {
1496 talloc_free(mem_ctx);
1497 return False;
1500 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1501 status = ndr_pull_svcctl_GetServiceKeyNameW(pull, NDR_IN, &r);
1502 if (NT_STATUS_IS_ERR(status)) {
1503 talloc_free(mem_ctx);
1504 return False;
1507 if (DEBUGLEVEL >= 10)
1508 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, &r);
1510 ZERO_STRUCT(r.out);
1511 r.out.key_name = talloc_zero(mem_ctx, const char *);
1512 if (r.out.key_name == NULL) {
1513 talloc_free(mem_ctx);
1514 return False;
1517 r.out.display_name_length = r.in.display_name_length;
1518 r.out.result = _svcctl_GetServiceKeyNameW(p, &r);
1520 if (p->rng_fault_state) {
1521 talloc_free(mem_ctx);
1522 /* Return True here, srv_pipe_hnd.c will take care */
1523 return True;
1526 if (DEBUGLEVEL >= 10)
1527 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &r);
1529 push = ndr_push_init_ctx(mem_ctx);
1530 if (push == NULL) {
1531 talloc_free(mem_ctx);
1532 return False;
1535 status = ndr_push_svcctl_GetServiceKeyNameW(push, NDR_OUT, &r);
1536 if (NT_STATUS_IS_ERR(status)) {
1537 talloc_free(mem_ctx);
1538 return False;
1541 blob = ndr_push_blob(push);
1542 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1543 talloc_free(mem_ctx);
1544 return False;
1547 talloc_free(mem_ctx);
1549 return True;
1552 static BOOL api_svcctl_SCSetServiceBitsA(pipes_struct *p)
1554 struct ndr_pull *pull;
1555 struct ndr_push *push;
1556 NTSTATUS status;
1557 DATA_BLOB blob;
1558 struct svcctl_SCSetServiceBitsA r;
1559 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_SCSetServiceBitsA");
1561 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1562 talloc_free(mem_ctx);
1563 return False;
1566 pull = ndr_pull_init_blob(&blob, mem_ctx);
1567 if (pull == NULL) {
1568 talloc_free(mem_ctx);
1569 return False;
1572 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1573 status = ndr_pull_svcctl_SCSetServiceBitsA(pull, NDR_IN, &r);
1574 if (NT_STATUS_IS_ERR(status)) {
1575 talloc_free(mem_ctx);
1576 return False;
1579 if (DEBUGLEVEL >= 10)
1580 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, &r);
1582 r.out.result = _svcctl_SCSetServiceBitsA(p, &r);
1584 if (p->rng_fault_state) {
1585 talloc_free(mem_ctx);
1586 /* Return True here, srv_pipe_hnd.c will take care */
1587 return True;
1590 if (DEBUGLEVEL >= 10)
1591 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &r);
1593 push = ndr_push_init_ctx(mem_ctx);
1594 if (push == NULL) {
1595 talloc_free(mem_ctx);
1596 return False;
1599 status = ndr_push_svcctl_SCSetServiceBitsA(push, NDR_OUT, &r);
1600 if (NT_STATUS_IS_ERR(status)) {
1601 talloc_free(mem_ctx);
1602 return False;
1605 blob = ndr_push_blob(push);
1606 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1607 talloc_free(mem_ctx);
1608 return False;
1611 talloc_free(mem_ctx);
1613 return True;
1616 static BOOL api_svcctl_ChangeServiceConfigA(pipes_struct *p)
1618 struct ndr_pull *pull;
1619 struct ndr_push *push;
1620 NTSTATUS status;
1621 DATA_BLOB blob;
1622 struct svcctl_ChangeServiceConfigA r;
1623 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_ChangeServiceConfigA");
1625 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1626 talloc_free(mem_ctx);
1627 return False;
1630 pull = ndr_pull_init_blob(&blob, mem_ctx);
1631 if (pull == NULL) {
1632 talloc_free(mem_ctx);
1633 return False;
1636 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1637 status = ndr_pull_svcctl_ChangeServiceConfigA(pull, NDR_IN, &r);
1638 if (NT_STATUS_IS_ERR(status)) {
1639 talloc_free(mem_ctx);
1640 return False;
1643 if (DEBUGLEVEL >= 10)
1644 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, &r);
1646 ZERO_STRUCT(r.out);
1647 r.out.tag_id = talloc_zero(mem_ctx, uint32_t);
1648 if (r.out.tag_id == NULL) {
1649 talloc_free(mem_ctx);
1650 return False;
1653 r.out.result = _svcctl_ChangeServiceConfigA(p, &r);
1655 if (p->rng_fault_state) {
1656 talloc_free(mem_ctx);
1657 /* Return True here, srv_pipe_hnd.c will take care */
1658 return True;
1661 if (DEBUGLEVEL >= 10)
1662 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &r);
1664 push = ndr_push_init_ctx(mem_ctx);
1665 if (push == NULL) {
1666 talloc_free(mem_ctx);
1667 return False;
1670 status = ndr_push_svcctl_ChangeServiceConfigA(push, NDR_OUT, &r);
1671 if (NT_STATUS_IS_ERR(status)) {
1672 talloc_free(mem_ctx);
1673 return False;
1676 blob = ndr_push_blob(push);
1677 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1678 talloc_free(mem_ctx);
1679 return False;
1682 talloc_free(mem_ctx);
1684 return True;
1687 static BOOL api_svcctl_CreateServiceA(pipes_struct *p)
1689 struct ndr_pull *pull;
1690 struct ndr_push *push;
1691 NTSTATUS status;
1692 DATA_BLOB blob;
1693 struct svcctl_CreateServiceA r;
1694 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_CreateServiceA");
1696 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1697 talloc_free(mem_ctx);
1698 return False;
1701 pull = ndr_pull_init_blob(&blob, mem_ctx);
1702 if (pull == NULL) {
1703 talloc_free(mem_ctx);
1704 return False;
1707 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1708 status = ndr_pull_svcctl_CreateServiceA(pull, NDR_IN, &r);
1709 if (NT_STATUS_IS_ERR(status)) {
1710 talloc_free(mem_ctx);
1711 return False;
1714 if (DEBUGLEVEL >= 10)
1715 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, &r);
1717 ZERO_STRUCT(r.out);
1718 r.out.TagId = talloc_zero(mem_ctx, uint32_t);
1719 if (r.out.TagId == NULL) {
1720 talloc_free(mem_ctx);
1721 return False;
1724 r.out.result = _svcctl_CreateServiceA(p, &r);
1726 if (p->rng_fault_state) {
1727 talloc_free(mem_ctx);
1728 /* Return True here, srv_pipe_hnd.c will take care */
1729 return True;
1732 if (DEBUGLEVEL >= 10)
1733 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &r);
1735 push = ndr_push_init_ctx(mem_ctx);
1736 if (push == NULL) {
1737 talloc_free(mem_ctx);
1738 return False;
1741 status = ndr_push_svcctl_CreateServiceA(push, NDR_OUT, &r);
1742 if (NT_STATUS_IS_ERR(status)) {
1743 talloc_free(mem_ctx);
1744 return False;
1747 blob = ndr_push_blob(push);
1748 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1749 talloc_free(mem_ctx);
1750 return False;
1753 talloc_free(mem_ctx);
1755 return True;
1758 static BOOL api_svcctl_EnumDependentServicesA(pipes_struct *p)
1760 struct ndr_pull *pull;
1761 struct ndr_push *push;
1762 NTSTATUS status;
1763 DATA_BLOB blob;
1764 struct svcctl_EnumDependentServicesA r;
1765 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_EnumDependentServicesA");
1767 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1768 talloc_free(mem_ctx);
1769 return False;
1772 pull = ndr_pull_init_blob(&blob, mem_ctx);
1773 if (pull == NULL) {
1774 talloc_free(mem_ctx);
1775 return False;
1778 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1779 status = ndr_pull_svcctl_EnumDependentServicesA(pull, NDR_IN, &r);
1780 if (NT_STATUS_IS_ERR(status)) {
1781 talloc_free(mem_ctx);
1782 return False;
1785 if (DEBUGLEVEL >= 10)
1786 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &r);
1788 ZERO_STRUCT(r.out);
1789 r.out.service_status = talloc_zero(mem_ctx, struct ENUM_SERVICE_STATUS);
1790 if (r.out.service_status == NULL) {
1791 talloc_free(mem_ctx);
1792 return False;
1795 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
1796 if (r.out.bytes_needed == NULL) {
1797 talloc_free(mem_ctx);
1798 return False;
1801 r.out.services_returned = talloc_zero(mem_ctx, uint32_t);
1802 if (r.out.services_returned == NULL) {
1803 talloc_free(mem_ctx);
1804 return False;
1807 r.out.result = _svcctl_EnumDependentServicesA(p, &r);
1809 if (p->rng_fault_state) {
1810 talloc_free(mem_ctx);
1811 /* Return True here, srv_pipe_hnd.c will take care */
1812 return True;
1815 if (DEBUGLEVEL >= 10)
1816 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &r);
1818 push = ndr_push_init_ctx(mem_ctx);
1819 if (push == NULL) {
1820 talloc_free(mem_ctx);
1821 return False;
1824 status = ndr_push_svcctl_EnumDependentServicesA(push, NDR_OUT, &r);
1825 if (NT_STATUS_IS_ERR(status)) {
1826 talloc_free(mem_ctx);
1827 return False;
1830 blob = ndr_push_blob(push);
1831 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1832 talloc_free(mem_ctx);
1833 return False;
1836 talloc_free(mem_ctx);
1838 return True;
1841 static BOOL api_svcctl_EnumServicesStatusA(pipes_struct *p)
1843 struct ndr_pull *pull;
1844 struct ndr_push *push;
1845 NTSTATUS status;
1846 DATA_BLOB blob;
1847 struct svcctl_EnumServicesStatusA r;
1848 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_EnumServicesStatusA");
1850 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1851 talloc_free(mem_ctx);
1852 return False;
1855 pull = ndr_pull_init_blob(&blob, mem_ctx);
1856 if (pull == NULL) {
1857 talloc_free(mem_ctx);
1858 return False;
1861 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1862 status = ndr_pull_svcctl_EnumServicesStatusA(pull, NDR_IN, &r);
1863 if (NT_STATUS_IS_ERR(status)) {
1864 talloc_free(mem_ctx);
1865 return False;
1868 if (DEBUGLEVEL >= 10)
1869 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, &r);
1871 ZERO_STRUCT(r.out);
1872 r.out.service = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
1873 if (r.out.service == NULL) {
1874 talloc_free(mem_ctx);
1875 return False;
1878 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
1879 if (r.out.bytes_needed == NULL) {
1880 talloc_free(mem_ctx);
1881 return False;
1884 r.out.services_returned = talloc_zero(mem_ctx, uint32_t);
1885 if (r.out.services_returned == NULL) {
1886 talloc_free(mem_ctx);
1887 return False;
1890 r.out.resume_handle = r.in.resume_handle;
1891 r.out.result = _svcctl_EnumServicesStatusA(p, &r);
1893 if (p->rng_fault_state) {
1894 talloc_free(mem_ctx);
1895 /* Return True here, srv_pipe_hnd.c will take care */
1896 return True;
1899 if (DEBUGLEVEL >= 10)
1900 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &r);
1902 push = ndr_push_init_ctx(mem_ctx);
1903 if (push == NULL) {
1904 talloc_free(mem_ctx);
1905 return False;
1908 status = ndr_push_svcctl_EnumServicesStatusA(push, NDR_OUT, &r);
1909 if (NT_STATUS_IS_ERR(status)) {
1910 talloc_free(mem_ctx);
1911 return False;
1914 blob = ndr_push_blob(push);
1915 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1916 talloc_free(mem_ctx);
1917 return False;
1920 talloc_free(mem_ctx);
1922 return True;
1925 static BOOL api_svcctl_OpenSCManagerA(pipes_struct *p)
1927 struct ndr_pull *pull;
1928 struct ndr_push *push;
1929 NTSTATUS status;
1930 DATA_BLOB blob;
1931 struct svcctl_OpenSCManagerA r;
1932 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_OpenSCManagerA");
1934 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1935 talloc_free(mem_ctx);
1936 return False;
1939 pull = ndr_pull_init_blob(&blob, mem_ctx);
1940 if (pull == NULL) {
1941 talloc_free(mem_ctx);
1942 return False;
1945 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1946 status = ndr_pull_svcctl_OpenSCManagerA(pull, NDR_IN, &r);
1947 if (NT_STATUS_IS_ERR(status)) {
1948 talloc_free(mem_ctx);
1949 return False;
1952 if (DEBUGLEVEL >= 10)
1953 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, &r);
1955 ZERO_STRUCT(r.out);
1956 r.out.handle = talloc_zero(mem_ctx, struct policy_handle);
1957 if (r.out.handle == NULL) {
1958 talloc_free(mem_ctx);
1959 return False;
1962 r.out.result = _svcctl_OpenSCManagerA(p, &r);
1964 if (p->rng_fault_state) {
1965 talloc_free(mem_ctx);
1966 /* Return True here, srv_pipe_hnd.c will take care */
1967 return True;
1970 if (DEBUGLEVEL >= 10)
1971 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &r);
1973 push = ndr_push_init_ctx(mem_ctx);
1974 if (push == NULL) {
1975 talloc_free(mem_ctx);
1976 return False;
1979 status = ndr_push_svcctl_OpenSCManagerA(push, NDR_OUT, &r);
1980 if (NT_STATUS_IS_ERR(status)) {
1981 talloc_free(mem_ctx);
1982 return False;
1985 blob = ndr_push_blob(push);
1986 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1987 talloc_free(mem_ctx);
1988 return False;
1991 talloc_free(mem_ctx);
1993 return True;
1996 static BOOL api_svcctl_OpenServiceA(pipes_struct *p)
1998 struct ndr_pull *pull;
1999 struct ndr_push *push;
2000 NTSTATUS status;
2001 DATA_BLOB blob;
2002 struct svcctl_OpenServiceA r;
2003 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_OpenServiceA");
2005 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2006 talloc_free(mem_ctx);
2007 return False;
2010 pull = ndr_pull_init_blob(&blob, mem_ctx);
2011 if (pull == NULL) {
2012 talloc_free(mem_ctx);
2013 return False;
2016 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2017 status = ndr_pull_svcctl_OpenServiceA(pull, NDR_IN, &r);
2018 if (NT_STATUS_IS_ERR(status)) {
2019 talloc_free(mem_ctx);
2020 return False;
2023 if (DEBUGLEVEL >= 10)
2024 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, &r);
2026 r.out.result = _svcctl_OpenServiceA(p, &r);
2028 if (p->rng_fault_state) {
2029 talloc_free(mem_ctx);
2030 /* Return True here, srv_pipe_hnd.c will take care */
2031 return True;
2034 if (DEBUGLEVEL >= 10)
2035 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &r);
2037 push = ndr_push_init_ctx(mem_ctx);
2038 if (push == NULL) {
2039 talloc_free(mem_ctx);
2040 return False;
2043 status = ndr_push_svcctl_OpenServiceA(push, NDR_OUT, &r);
2044 if (NT_STATUS_IS_ERR(status)) {
2045 talloc_free(mem_ctx);
2046 return False;
2049 blob = ndr_push_blob(push);
2050 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2051 talloc_free(mem_ctx);
2052 return False;
2055 talloc_free(mem_ctx);
2057 return True;
2060 static BOOL api_svcctl_QueryServiceConfigA(pipes_struct *p)
2062 struct ndr_pull *pull;
2063 struct ndr_push *push;
2064 NTSTATUS status;
2065 DATA_BLOB blob;
2066 struct svcctl_QueryServiceConfigA r;
2067 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceConfigA");
2069 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2070 talloc_free(mem_ctx);
2071 return False;
2074 pull = ndr_pull_init_blob(&blob, mem_ctx);
2075 if (pull == NULL) {
2076 talloc_free(mem_ctx);
2077 return False;
2080 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2081 status = ndr_pull_svcctl_QueryServiceConfigA(pull, NDR_IN, &r);
2082 if (NT_STATUS_IS_ERR(status)) {
2083 talloc_free(mem_ctx);
2084 return False;
2087 if (DEBUGLEVEL >= 10)
2088 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &r);
2090 ZERO_STRUCT(r.out);
2091 r.out.query = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
2092 if (r.out.query == NULL) {
2093 talloc_free(mem_ctx);
2094 return False;
2097 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
2098 if (r.out.bytes_needed == NULL) {
2099 talloc_free(mem_ctx);
2100 return False;
2103 r.out.result = _svcctl_QueryServiceConfigA(p, &r);
2105 if (p->rng_fault_state) {
2106 talloc_free(mem_ctx);
2107 /* Return True here, srv_pipe_hnd.c will take care */
2108 return True;
2111 if (DEBUGLEVEL >= 10)
2112 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r);
2114 push = ndr_push_init_ctx(mem_ctx);
2115 if (push == NULL) {
2116 talloc_free(mem_ctx);
2117 return False;
2120 status = ndr_push_svcctl_QueryServiceConfigA(push, NDR_OUT, &r);
2121 if (NT_STATUS_IS_ERR(status)) {
2122 talloc_free(mem_ctx);
2123 return False;
2126 blob = ndr_push_blob(push);
2127 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2128 talloc_free(mem_ctx);
2129 return False;
2132 talloc_free(mem_ctx);
2134 return True;
2137 static BOOL api_svcctl_QueryServiceLockStatusA(pipes_struct *p)
2139 struct ndr_pull *pull;
2140 struct ndr_push *push;
2141 NTSTATUS status;
2142 DATA_BLOB blob;
2143 struct svcctl_QueryServiceLockStatusA r;
2144 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceLockStatusA");
2146 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2147 talloc_free(mem_ctx);
2148 return False;
2151 pull = ndr_pull_init_blob(&blob, mem_ctx);
2152 if (pull == NULL) {
2153 talloc_free(mem_ctx);
2154 return False;
2157 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2158 status = ndr_pull_svcctl_QueryServiceLockStatusA(pull, NDR_IN, &r);
2159 if (NT_STATUS_IS_ERR(status)) {
2160 talloc_free(mem_ctx);
2161 return False;
2164 if (DEBUGLEVEL >= 10)
2165 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &r);
2167 ZERO_STRUCT(r.out);
2168 r.out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
2169 if (r.out.lock_status == NULL) {
2170 talloc_free(mem_ctx);
2171 return False;
2174 r.out.required_buf_size = talloc_zero(mem_ctx, uint32_t);
2175 if (r.out.required_buf_size == NULL) {
2176 talloc_free(mem_ctx);
2177 return False;
2180 r.out.result = _svcctl_QueryServiceLockStatusA(p, &r);
2182 if (p->rng_fault_state) {
2183 talloc_free(mem_ctx);
2184 /* Return True here, srv_pipe_hnd.c will take care */
2185 return True;
2188 if (DEBUGLEVEL >= 10)
2189 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r);
2191 push = ndr_push_init_ctx(mem_ctx);
2192 if (push == NULL) {
2193 talloc_free(mem_ctx);
2194 return False;
2197 status = ndr_push_svcctl_QueryServiceLockStatusA(push, NDR_OUT, &r);
2198 if (NT_STATUS_IS_ERR(status)) {
2199 talloc_free(mem_ctx);
2200 return False;
2203 blob = ndr_push_blob(push);
2204 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2205 talloc_free(mem_ctx);
2206 return False;
2209 talloc_free(mem_ctx);
2211 return True;
2214 static BOOL api_svcctl_StartServiceA(pipes_struct *p)
2216 struct ndr_pull *pull;
2217 struct ndr_push *push;
2218 NTSTATUS status;
2219 DATA_BLOB blob;
2220 struct svcctl_StartServiceA r;
2221 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_StartServiceA");
2223 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2224 talloc_free(mem_ctx);
2225 return False;
2228 pull = ndr_pull_init_blob(&blob, mem_ctx);
2229 if (pull == NULL) {
2230 talloc_free(mem_ctx);
2231 return False;
2234 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2235 status = ndr_pull_svcctl_StartServiceA(pull, NDR_IN, &r);
2236 if (NT_STATUS_IS_ERR(status)) {
2237 talloc_free(mem_ctx);
2238 return False;
2241 if (DEBUGLEVEL >= 10)
2242 NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &r);
2244 r.out.result = _svcctl_StartServiceA(p, &r);
2246 if (p->rng_fault_state) {
2247 talloc_free(mem_ctx);
2248 /* Return True here, srv_pipe_hnd.c will take care */
2249 return True;
2252 if (DEBUGLEVEL >= 10)
2253 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r);
2255 push = ndr_push_init_ctx(mem_ctx);
2256 if (push == NULL) {
2257 talloc_free(mem_ctx);
2258 return False;
2261 status = ndr_push_svcctl_StartServiceA(push, NDR_OUT, &r);
2262 if (NT_STATUS_IS_ERR(status)) {
2263 talloc_free(mem_ctx);
2264 return False;
2267 blob = ndr_push_blob(push);
2268 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2269 talloc_free(mem_ctx);
2270 return False;
2273 talloc_free(mem_ctx);
2275 return True;
2278 static BOOL api_svcctl_GetServiceDisplayNameA(pipes_struct *p)
2280 struct ndr_pull *pull;
2281 struct ndr_push *push;
2282 NTSTATUS status;
2283 DATA_BLOB blob;
2284 struct svcctl_GetServiceDisplayNameA r;
2285 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_GetServiceDisplayNameA");
2287 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2288 talloc_free(mem_ctx);
2289 return False;
2292 pull = ndr_pull_init_blob(&blob, mem_ctx);
2293 if (pull == NULL) {
2294 talloc_free(mem_ctx);
2295 return False;
2298 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2299 status = ndr_pull_svcctl_GetServiceDisplayNameA(pull, NDR_IN, &r);
2300 if (NT_STATUS_IS_ERR(status)) {
2301 talloc_free(mem_ctx);
2302 return False;
2305 if (DEBUGLEVEL >= 10)
2306 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &r);
2308 ZERO_STRUCT(r.out);
2309 r.out.display_name = talloc_zero(mem_ctx, const char *);
2310 if (r.out.display_name == NULL) {
2311 talloc_free(mem_ctx);
2312 return False;
2315 r.out.display_name_length = r.in.display_name_length;
2316 r.out.result = _svcctl_GetServiceDisplayNameA(p, &r);
2318 if (p->rng_fault_state) {
2319 talloc_free(mem_ctx);
2320 /* Return True here, srv_pipe_hnd.c will take care */
2321 return True;
2324 if (DEBUGLEVEL >= 10)
2325 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r);
2327 push = ndr_push_init_ctx(mem_ctx);
2328 if (push == NULL) {
2329 talloc_free(mem_ctx);
2330 return False;
2333 status = ndr_push_svcctl_GetServiceDisplayNameA(push, NDR_OUT, &r);
2334 if (NT_STATUS_IS_ERR(status)) {
2335 talloc_free(mem_ctx);
2336 return False;
2339 blob = ndr_push_blob(push);
2340 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2341 talloc_free(mem_ctx);
2342 return False;
2345 talloc_free(mem_ctx);
2347 return True;
2350 static BOOL api_svcctl_GetServiceKeyNameA(pipes_struct *p)
2352 struct ndr_pull *pull;
2353 struct ndr_push *push;
2354 NTSTATUS status;
2355 DATA_BLOB blob;
2356 struct svcctl_GetServiceKeyNameA r;
2357 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_GetServiceKeyNameA");
2359 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2360 talloc_free(mem_ctx);
2361 return False;
2364 pull = ndr_pull_init_blob(&blob, mem_ctx);
2365 if (pull == NULL) {
2366 talloc_free(mem_ctx);
2367 return False;
2370 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2371 status = ndr_pull_svcctl_GetServiceKeyNameA(pull, NDR_IN, &r);
2372 if (NT_STATUS_IS_ERR(status)) {
2373 talloc_free(mem_ctx);
2374 return False;
2377 if (DEBUGLEVEL >= 10)
2378 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &r);
2380 ZERO_STRUCT(r.out);
2381 r.out.key_name = talloc_zero(mem_ctx, const char *);
2382 if (r.out.key_name == NULL) {
2383 talloc_free(mem_ctx);
2384 return False;
2387 r.out.display_name_length = r.in.display_name_length;
2388 r.out.result = _svcctl_GetServiceKeyNameA(p, &r);
2390 if (p->rng_fault_state) {
2391 talloc_free(mem_ctx);
2392 /* Return True here, srv_pipe_hnd.c will take care */
2393 return True;
2396 if (DEBUGLEVEL >= 10)
2397 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r);
2399 push = ndr_push_init_ctx(mem_ctx);
2400 if (push == NULL) {
2401 talloc_free(mem_ctx);
2402 return False;
2405 status = ndr_push_svcctl_GetServiceKeyNameA(push, NDR_OUT, &r);
2406 if (NT_STATUS_IS_ERR(status)) {
2407 talloc_free(mem_ctx);
2408 return False;
2411 blob = ndr_push_blob(push);
2412 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2413 talloc_free(mem_ctx);
2414 return False;
2417 talloc_free(mem_ctx);
2419 return True;
2422 static BOOL api_svcctl_GetCurrentGroupeStateW(pipes_struct *p)
2424 struct ndr_pull *pull;
2425 struct ndr_push *push;
2426 NTSTATUS status;
2427 DATA_BLOB blob;
2428 struct svcctl_GetCurrentGroupeStateW r;
2429 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_GetCurrentGroupeStateW");
2431 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2432 talloc_free(mem_ctx);
2433 return False;
2436 pull = ndr_pull_init_blob(&blob, mem_ctx);
2437 if (pull == NULL) {
2438 talloc_free(mem_ctx);
2439 return False;
2442 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2443 status = ndr_pull_svcctl_GetCurrentGroupeStateW(pull, NDR_IN, &r);
2444 if (NT_STATUS_IS_ERR(status)) {
2445 talloc_free(mem_ctx);
2446 return False;
2449 if (DEBUGLEVEL >= 10)
2450 NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
2452 r.out.result = _svcctl_GetCurrentGroupeStateW(p, &r);
2454 if (p->rng_fault_state) {
2455 talloc_free(mem_ctx);
2456 /* Return True here, srv_pipe_hnd.c will take care */
2457 return True;
2460 if (DEBUGLEVEL >= 10)
2461 NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
2463 push = ndr_push_init_ctx(mem_ctx);
2464 if (push == NULL) {
2465 talloc_free(mem_ctx);
2466 return False;
2469 status = ndr_push_svcctl_GetCurrentGroupeStateW(push, NDR_OUT, &r);
2470 if (NT_STATUS_IS_ERR(status)) {
2471 talloc_free(mem_ctx);
2472 return False;
2475 blob = ndr_push_blob(push);
2476 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2477 talloc_free(mem_ctx);
2478 return False;
2481 talloc_free(mem_ctx);
2483 return True;
2486 static BOOL api_svcctl_EnumServiceGroupW(pipes_struct *p)
2488 struct ndr_pull *pull;
2489 struct ndr_push *push;
2490 NTSTATUS status;
2491 DATA_BLOB blob;
2492 struct svcctl_EnumServiceGroupW r;
2493 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_EnumServiceGroupW");
2495 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2496 talloc_free(mem_ctx);
2497 return False;
2500 pull = ndr_pull_init_blob(&blob, mem_ctx);
2501 if (pull == NULL) {
2502 talloc_free(mem_ctx);
2503 return False;
2506 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2507 status = ndr_pull_svcctl_EnumServiceGroupW(pull, NDR_IN, &r);
2508 if (NT_STATUS_IS_ERR(status)) {
2509 talloc_free(mem_ctx);
2510 return False;
2513 if (DEBUGLEVEL >= 10)
2514 NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &r);
2516 r.out.result = _svcctl_EnumServiceGroupW(p, &r);
2518 if (p->rng_fault_state) {
2519 talloc_free(mem_ctx);
2520 /* Return True here, srv_pipe_hnd.c will take care */
2521 return True;
2524 if (DEBUGLEVEL >= 10)
2525 NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r);
2527 push = ndr_push_init_ctx(mem_ctx);
2528 if (push == NULL) {
2529 talloc_free(mem_ctx);
2530 return False;
2533 status = ndr_push_svcctl_EnumServiceGroupW(push, NDR_OUT, &r);
2534 if (NT_STATUS_IS_ERR(status)) {
2535 talloc_free(mem_ctx);
2536 return False;
2539 blob = ndr_push_blob(push);
2540 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2541 talloc_free(mem_ctx);
2542 return False;
2545 talloc_free(mem_ctx);
2547 return True;
2550 static BOOL api_svcctl_ChangeServiceConfig2A(pipes_struct *p)
2552 struct ndr_pull *pull;
2553 struct ndr_push *push;
2554 NTSTATUS status;
2555 DATA_BLOB blob;
2556 struct svcctl_ChangeServiceConfig2A r;
2557 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_ChangeServiceConfig2A");
2559 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2560 talloc_free(mem_ctx);
2561 return False;
2564 pull = ndr_pull_init_blob(&blob, mem_ctx);
2565 if (pull == NULL) {
2566 talloc_free(mem_ctx);
2567 return False;
2570 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2571 status = ndr_pull_svcctl_ChangeServiceConfig2A(pull, NDR_IN, &r);
2572 if (NT_STATUS_IS_ERR(status)) {
2573 talloc_free(mem_ctx);
2574 return False;
2577 if (DEBUGLEVEL >= 10)
2578 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &r);
2580 r.out.result = _svcctl_ChangeServiceConfig2A(p, &r);
2582 if (p->rng_fault_state) {
2583 talloc_free(mem_ctx);
2584 /* Return True here, srv_pipe_hnd.c will take care */
2585 return True;
2588 if (DEBUGLEVEL >= 10)
2589 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r);
2591 push = ndr_push_init_ctx(mem_ctx);
2592 if (push == NULL) {
2593 talloc_free(mem_ctx);
2594 return False;
2597 status = ndr_push_svcctl_ChangeServiceConfig2A(push, NDR_OUT, &r);
2598 if (NT_STATUS_IS_ERR(status)) {
2599 talloc_free(mem_ctx);
2600 return False;
2603 blob = ndr_push_blob(push);
2604 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2605 talloc_free(mem_ctx);
2606 return False;
2609 talloc_free(mem_ctx);
2611 return True;
2614 static BOOL api_svcctl_ChangeServiceConfig2W(pipes_struct *p)
2616 struct ndr_pull *pull;
2617 struct ndr_push *push;
2618 NTSTATUS status;
2619 DATA_BLOB blob;
2620 struct svcctl_ChangeServiceConfig2W r;
2621 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_ChangeServiceConfig2W");
2623 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2624 talloc_free(mem_ctx);
2625 return False;
2628 pull = ndr_pull_init_blob(&blob, mem_ctx);
2629 if (pull == NULL) {
2630 talloc_free(mem_ctx);
2631 return False;
2634 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2635 status = ndr_pull_svcctl_ChangeServiceConfig2W(pull, NDR_IN, &r);
2636 if (NT_STATUS_IS_ERR(status)) {
2637 talloc_free(mem_ctx);
2638 return False;
2641 if (DEBUGLEVEL >= 10)
2642 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &r);
2644 r.out.result = _svcctl_ChangeServiceConfig2W(p, &r);
2646 if (p->rng_fault_state) {
2647 talloc_free(mem_ctx);
2648 /* Return True here, srv_pipe_hnd.c will take care */
2649 return True;
2652 if (DEBUGLEVEL >= 10)
2653 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r);
2655 push = ndr_push_init_ctx(mem_ctx);
2656 if (push == NULL) {
2657 talloc_free(mem_ctx);
2658 return False;
2661 status = ndr_push_svcctl_ChangeServiceConfig2W(push, NDR_OUT, &r);
2662 if (NT_STATUS_IS_ERR(status)) {
2663 talloc_free(mem_ctx);
2664 return False;
2667 blob = ndr_push_blob(push);
2668 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2669 talloc_free(mem_ctx);
2670 return False;
2673 talloc_free(mem_ctx);
2675 return True;
2678 static BOOL api_svcctl_QueryServiceConfig2A(pipes_struct *p)
2680 struct ndr_pull *pull;
2681 struct ndr_push *push;
2682 NTSTATUS status;
2683 DATA_BLOB blob;
2684 struct svcctl_QueryServiceConfig2A r;
2685 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceConfig2A");
2687 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2688 talloc_free(mem_ctx);
2689 return False;
2692 pull = ndr_pull_init_blob(&blob, mem_ctx);
2693 if (pull == NULL) {
2694 talloc_free(mem_ctx);
2695 return False;
2698 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2699 status = ndr_pull_svcctl_QueryServiceConfig2A(pull, NDR_IN, &r);
2700 if (NT_STATUS_IS_ERR(status)) {
2701 talloc_free(mem_ctx);
2702 return False;
2705 if (DEBUGLEVEL >= 10)
2706 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, &r);
2708 ZERO_STRUCT(r.out);
2709 r.out.buffer = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
2710 if (r.out.buffer == NULL) {
2711 talloc_free(mem_ctx);
2712 return False;
2715 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
2716 if (r.out.bytes_needed == NULL) {
2717 talloc_free(mem_ctx);
2718 return False;
2721 r.out.result = _svcctl_QueryServiceConfig2A(p, &r);
2723 if (p->rng_fault_state) {
2724 talloc_free(mem_ctx);
2725 /* Return True here, srv_pipe_hnd.c will take care */
2726 return True;
2729 if (DEBUGLEVEL >= 10)
2730 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &r);
2732 push = ndr_push_init_ctx(mem_ctx);
2733 if (push == NULL) {
2734 talloc_free(mem_ctx);
2735 return False;
2738 status = ndr_push_svcctl_QueryServiceConfig2A(push, NDR_OUT, &r);
2739 if (NT_STATUS_IS_ERR(status)) {
2740 talloc_free(mem_ctx);
2741 return False;
2744 blob = ndr_push_blob(push);
2745 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2746 talloc_free(mem_ctx);
2747 return False;
2750 talloc_free(mem_ctx);
2752 return True;
2755 static BOOL api_svcctl_QueryServiceConfig2W(pipes_struct *p)
2757 struct ndr_pull *pull;
2758 struct ndr_push *push;
2759 NTSTATUS status;
2760 DATA_BLOB blob;
2761 struct svcctl_QueryServiceConfig2W r;
2762 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceConfig2W");
2764 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2765 talloc_free(mem_ctx);
2766 return False;
2769 pull = ndr_pull_init_blob(&blob, mem_ctx);
2770 if (pull == NULL) {
2771 talloc_free(mem_ctx);
2772 return False;
2775 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2776 status = ndr_pull_svcctl_QueryServiceConfig2W(pull, NDR_IN, &r);
2777 if (NT_STATUS_IS_ERR(status)) {
2778 talloc_free(mem_ctx);
2779 return False;
2782 if (DEBUGLEVEL >= 10)
2783 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, &r);
2785 ZERO_STRUCT(r.out);
2786 r.out.buffer = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
2787 if (r.out.buffer == NULL) {
2788 talloc_free(mem_ctx);
2789 return False;
2792 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
2793 if (r.out.bytes_needed == NULL) {
2794 talloc_free(mem_ctx);
2795 return False;
2798 r.out.result = _svcctl_QueryServiceConfig2W(p, &r);
2800 if (p->rng_fault_state) {
2801 talloc_free(mem_ctx);
2802 /* Return True here, srv_pipe_hnd.c will take care */
2803 return True;
2806 if (DEBUGLEVEL >= 10)
2807 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &r);
2809 push = ndr_push_init_ctx(mem_ctx);
2810 if (push == NULL) {
2811 talloc_free(mem_ctx);
2812 return False;
2815 status = ndr_push_svcctl_QueryServiceConfig2W(push, NDR_OUT, &r);
2816 if (NT_STATUS_IS_ERR(status)) {
2817 talloc_free(mem_ctx);
2818 return False;
2821 blob = ndr_push_blob(push);
2822 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2823 talloc_free(mem_ctx);
2824 return False;
2827 talloc_free(mem_ctx);
2829 return True;
2832 static BOOL api_svcctl_QueryServiceStatusEx(pipes_struct *p)
2834 struct ndr_pull *pull;
2835 struct ndr_push *push;
2836 NTSTATUS status;
2837 DATA_BLOB blob;
2838 struct svcctl_QueryServiceStatusEx r;
2839 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_QueryServiceStatusEx");
2841 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2842 talloc_free(mem_ctx);
2843 return False;
2846 pull = ndr_pull_init_blob(&blob, mem_ctx);
2847 if (pull == NULL) {
2848 talloc_free(mem_ctx);
2849 return False;
2852 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2853 status = ndr_pull_svcctl_QueryServiceStatusEx(pull, NDR_IN, &r);
2854 if (NT_STATUS_IS_ERR(status)) {
2855 talloc_free(mem_ctx);
2856 return False;
2859 if (DEBUGLEVEL >= 10)
2860 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, &r);
2862 ZERO_STRUCT(r.out);
2863 r.out.buffer = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
2864 if (r.out.buffer == NULL) {
2865 talloc_free(mem_ctx);
2866 return False;
2869 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
2870 if (r.out.bytes_needed == NULL) {
2871 talloc_free(mem_ctx);
2872 return False;
2875 r.out.result = _svcctl_QueryServiceStatusEx(p, &r);
2877 if (p->rng_fault_state) {
2878 talloc_free(mem_ctx);
2879 /* Return True here, srv_pipe_hnd.c will take care */
2880 return True;
2883 if (DEBUGLEVEL >= 10)
2884 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &r);
2886 push = ndr_push_init_ctx(mem_ctx);
2887 if (push == NULL) {
2888 talloc_free(mem_ctx);
2889 return False;
2892 status = ndr_push_svcctl_QueryServiceStatusEx(push, NDR_OUT, &r);
2893 if (NT_STATUS_IS_ERR(status)) {
2894 talloc_free(mem_ctx);
2895 return False;
2898 blob = ndr_push_blob(push);
2899 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2900 talloc_free(mem_ctx);
2901 return False;
2904 talloc_free(mem_ctx);
2906 return True;
2909 static BOOL api_EnumServicesStatusExA(pipes_struct *p)
2911 struct ndr_pull *pull;
2912 struct ndr_push *push;
2913 NTSTATUS status;
2914 DATA_BLOB blob;
2915 struct EnumServicesStatusExA r;
2916 TALLOC_CTX *mem_ctx = talloc_init("api_EnumServicesStatusExA");
2918 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2919 talloc_free(mem_ctx);
2920 return False;
2923 pull = ndr_pull_init_blob(&blob, mem_ctx);
2924 if (pull == NULL) {
2925 talloc_free(mem_ctx);
2926 return False;
2929 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2930 status = ndr_pull_EnumServicesStatusExA(pull, NDR_IN, &r);
2931 if (NT_STATUS_IS_ERR(status)) {
2932 talloc_free(mem_ctx);
2933 return False;
2936 if (DEBUGLEVEL >= 10)
2937 NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, &r);
2939 ZERO_STRUCT(r.out);
2940 r.out.services = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
2941 if (r.out.services == NULL) {
2942 talloc_free(mem_ctx);
2943 return False;
2946 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
2947 if (r.out.bytes_needed == NULL) {
2948 talloc_free(mem_ctx);
2949 return False;
2952 r.out.service_returned = talloc_zero(mem_ctx, uint32_t);
2953 if (r.out.service_returned == NULL) {
2954 talloc_free(mem_ctx);
2955 return False;
2958 r.out.resume_handle = r.in.resume_handle;
2959 r.out.group_name = talloc_zero(mem_ctx, const char *);
2960 if (r.out.group_name == NULL) {
2961 talloc_free(mem_ctx);
2962 return False;
2965 r.out.result = _EnumServicesStatusExA(p, &r);
2967 if (p->rng_fault_state) {
2968 talloc_free(mem_ctx);
2969 /* Return True here, srv_pipe_hnd.c will take care */
2970 return True;
2973 if (DEBUGLEVEL >= 10)
2974 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &r);
2976 push = ndr_push_init_ctx(mem_ctx);
2977 if (push == NULL) {
2978 talloc_free(mem_ctx);
2979 return False;
2982 status = ndr_push_EnumServicesStatusExA(push, NDR_OUT, &r);
2983 if (NT_STATUS_IS_ERR(status)) {
2984 talloc_free(mem_ctx);
2985 return False;
2988 blob = ndr_push_blob(push);
2989 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2990 talloc_free(mem_ctx);
2991 return False;
2994 talloc_free(mem_ctx);
2996 return True;
2999 static BOOL api_EnumServicesStatusExW(pipes_struct *p)
3001 struct ndr_pull *pull;
3002 struct ndr_push *push;
3003 NTSTATUS status;
3004 DATA_BLOB blob;
3005 struct EnumServicesStatusExW r;
3006 TALLOC_CTX *mem_ctx = talloc_init("api_EnumServicesStatusExW");
3008 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
3009 talloc_free(mem_ctx);
3010 return False;
3013 pull = ndr_pull_init_blob(&blob, mem_ctx);
3014 if (pull == NULL) {
3015 talloc_free(mem_ctx);
3016 return False;
3019 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3020 status = ndr_pull_EnumServicesStatusExW(pull, NDR_IN, &r);
3021 if (NT_STATUS_IS_ERR(status)) {
3022 talloc_free(mem_ctx);
3023 return False;
3026 if (DEBUGLEVEL >= 10)
3027 NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, &r);
3029 ZERO_STRUCT(r.out);
3030 r.out.services = talloc_zero_array(mem_ctx, uint8_t, r.in.buf_size);
3031 if (r.out.services == NULL) {
3032 talloc_free(mem_ctx);
3033 return False;
3036 r.out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
3037 if (r.out.bytes_needed == NULL) {
3038 talloc_free(mem_ctx);
3039 return False;
3042 r.out.service_returned = talloc_zero(mem_ctx, uint32_t);
3043 if (r.out.service_returned == NULL) {
3044 talloc_free(mem_ctx);
3045 return False;
3048 r.out.resume_handle = r.in.resume_handle;
3049 r.out.group_name = talloc_zero(mem_ctx, const char *);
3050 if (r.out.group_name == NULL) {
3051 talloc_free(mem_ctx);
3052 return False;
3055 r.out.result = _EnumServicesStatusExW(p, &r);
3057 if (p->rng_fault_state) {
3058 talloc_free(mem_ctx);
3059 /* Return True here, srv_pipe_hnd.c will take care */
3060 return True;
3063 if (DEBUGLEVEL >= 10)
3064 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &r);
3066 push = ndr_push_init_ctx(mem_ctx);
3067 if (push == NULL) {
3068 talloc_free(mem_ctx);
3069 return False;
3072 status = ndr_push_EnumServicesStatusExW(push, NDR_OUT, &r);
3073 if (NT_STATUS_IS_ERR(status)) {
3074 talloc_free(mem_ctx);
3075 return False;
3078 blob = ndr_push_blob(push);
3079 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3080 talloc_free(mem_ctx);
3081 return False;
3084 talloc_free(mem_ctx);
3086 return True;
3089 static BOOL api_svcctl_SCSendTSMessage(pipes_struct *p)
3091 struct ndr_pull *pull;
3092 struct ndr_push *push;
3093 NTSTATUS status;
3094 DATA_BLOB blob;
3095 struct svcctl_SCSendTSMessage r;
3096 TALLOC_CTX *mem_ctx = talloc_init("api_svcctl_SCSendTSMessage");
3098 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
3099 talloc_free(mem_ctx);
3100 return False;
3103 pull = ndr_pull_init_blob(&blob, mem_ctx);
3104 if (pull == NULL) {
3105 talloc_free(mem_ctx);
3106 return False;
3109 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3110 status = ndr_pull_svcctl_SCSendTSMessage(pull, NDR_IN, &r);
3111 if (NT_STATUS_IS_ERR(status)) {
3112 talloc_free(mem_ctx);
3113 return False;
3116 if (DEBUGLEVEL >= 10)
3117 NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, &r);
3119 r.out.result = _svcctl_SCSendTSMessage(p, &r);
3121 if (p->rng_fault_state) {
3122 talloc_free(mem_ctx);
3123 /* Return True here, srv_pipe_hnd.c will take care */
3124 return True;
3127 if (DEBUGLEVEL >= 10)
3128 NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &r);
3130 push = ndr_push_init_ctx(mem_ctx);
3131 if (push == NULL) {
3132 talloc_free(mem_ctx);
3133 return False;
3136 status = ndr_push_svcctl_SCSendTSMessage(push, NDR_OUT, &r);
3137 if (NT_STATUS_IS_ERR(status)) {
3138 talloc_free(mem_ctx);
3139 return False;
3142 blob = ndr_push_blob(push);
3143 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3144 talloc_free(mem_ctx);
3145 return False;
3148 talloc_free(mem_ctx);
3150 return True;
3154 /* Tables */
3155 static struct api_struct api_svcctl_cmds[] =
3157 {"SVCCTL_CLOSESERVICEHANDLE", DCERPC_SVCCTL_CLOSESERVICEHANDLE, api_svcctl_CloseServiceHandle},
3158 {"SVCCTL_CONTROLSERVICE", DCERPC_SVCCTL_CONTROLSERVICE, api_svcctl_ControlService},
3159 {"SVCCTL_DELETESERVICE", DCERPC_SVCCTL_DELETESERVICE, api_svcctl_DeleteService},
3160 {"SVCCTL_LOCKSERVICEDATABASE", DCERPC_SVCCTL_LOCKSERVICEDATABASE, api_svcctl_LockServiceDatabase},
3161 {"SVCCTL_QUERYSERVICEOBJECTSECURITY", DCERPC_SVCCTL_QUERYSERVICEOBJECTSECURITY, api_svcctl_QueryServiceObjectSecurity},
3162 {"SVCCTL_SETSERVICEOBJECTSECURITY", DCERPC_SVCCTL_SETSERVICEOBJECTSECURITY, api_svcctl_SetServiceObjectSecurity},
3163 {"SVCCTL_QUERYSERVICESTATUS", DCERPC_SVCCTL_QUERYSERVICESTATUS, api_svcctl_QueryServiceStatus},
3164 {"SVCCTL_SETSERVICESTATUS", DCERPC_SVCCTL_SETSERVICESTATUS, api_svcctl_SetServiceStatus},
3165 {"SVCCTL_UNLOCKSERVICEDATABASE", DCERPC_SVCCTL_UNLOCKSERVICEDATABASE, api_svcctl_UnlockServiceDatabase},
3166 {"SVCCTL_NOTIFYBOOTCONFIGSTATUS", DCERPC_SVCCTL_NOTIFYBOOTCONFIGSTATUS, api_svcctl_NotifyBootConfigStatus},
3167 {"SVCCTL_SCSETSERVICEBITSW", DCERPC_SVCCTL_SCSETSERVICEBITSW, api_svcctl_SCSetServiceBitsW},
3168 {"SVCCTL_CHANGESERVICECONFIGW", DCERPC_SVCCTL_CHANGESERVICECONFIGW, api_svcctl_ChangeServiceConfigW},
3169 {"SVCCTL_CREATESERVICEW", DCERPC_SVCCTL_CREATESERVICEW, api_svcctl_CreateServiceW},
3170 {"SVCCTL_ENUMDEPENDENTSERVICESW", DCERPC_SVCCTL_ENUMDEPENDENTSERVICESW, api_svcctl_EnumDependentServicesW},
3171 {"SVCCTL_ENUMSERVICESSTATUSW", DCERPC_SVCCTL_ENUMSERVICESSTATUSW, api_svcctl_EnumServicesStatusW},
3172 {"SVCCTL_OPENSCMANAGERW", DCERPC_SVCCTL_OPENSCMANAGERW, api_svcctl_OpenSCManagerW},
3173 {"SVCCTL_OPENSERVICEW", DCERPC_SVCCTL_OPENSERVICEW, api_svcctl_OpenServiceW},
3174 {"SVCCTL_QUERYSERVICECONFIGW", DCERPC_SVCCTL_QUERYSERVICECONFIGW, api_svcctl_QueryServiceConfigW},
3175 {"SVCCTL_QUERYSERVICELOCKSTATUSW", DCERPC_SVCCTL_QUERYSERVICELOCKSTATUSW, api_svcctl_QueryServiceLockStatusW},
3176 {"SVCCTL_STARTSERVICEW", DCERPC_SVCCTL_STARTSERVICEW, api_svcctl_StartServiceW},
3177 {"SVCCTL_GETSERVICEDISPLAYNAMEW", DCERPC_SVCCTL_GETSERVICEDISPLAYNAMEW, api_svcctl_GetServiceDisplayNameW},
3178 {"SVCCTL_GETSERVICEKEYNAMEW", DCERPC_SVCCTL_GETSERVICEKEYNAMEW, api_svcctl_GetServiceKeyNameW},
3179 {"SVCCTL_SCSETSERVICEBITSA", DCERPC_SVCCTL_SCSETSERVICEBITSA, api_svcctl_SCSetServiceBitsA},
3180 {"SVCCTL_CHANGESERVICECONFIGA", DCERPC_SVCCTL_CHANGESERVICECONFIGA, api_svcctl_ChangeServiceConfigA},
3181 {"SVCCTL_CREATESERVICEA", DCERPC_SVCCTL_CREATESERVICEA, api_svcctl_CreateServiceA},
3182 {"SVCCTL_ENUMDEPENDENTSERVICESA", DCERPC_SVCCTL_ENUMDEPENDENTSERVICESA, api_svcctl_EnumDependentServicesA},
3183 {"SVCCTL_ENUMSERVICESSTATUSA", DCERPC_SVCCTL_ENUMSERVICESSTATUSA, api_svcctl_EnumServicesStatusA},
3184 {"SVCCTL_OPENSCMANAGERA", DCERPC_SVCCTL_OPENSCMANAGERA, api_svcctl_OpenSCManagerA},
3185 {"SVCCTL_OPENSERVICEA", DCERPC_SVCCTL_OPENSERVICEA, api_svcctl_OpenServiceA},
3186 {"SVCCTL_QUERYSERVICECONFIGA", DCERPC_SVCCTL_QUERYSERVICECONFIGA, api_svcctl_QueryServiceConfigA},
3187 {"SVCCTL_QUERYSERVICELOCKSTATUSA", DCERPC_SVCCTL_QUERYSERVICELOCKSTATUSA, api_svcctl_QueryServiceLockStatusA},
3188 {"SVCCTL_STARTSERVICEA", DCERPC_SVCCTL_STARTSERVICEA, api_svcctl_StartServiceA},
3189 {"SVCCTL_GETSERVICEDISPLAYNAMEA", DCERPC_SVCCTL_GETSERVICEDISPLAYNAMEA, api_svcctl_GetServiceDisplayNameA},
3190 {"SVCCTL_GETSERVICEKEYNAMEA", DCERPC_SVCCTL_GETSERVICEKEYNAMEA, api_svcctl_GetServiceKeyNameA},
3191 {"SVCCTL_GETCURRENTGROUPESTATEW", DCERPC_SVCCTL_GETCURRENTGROUPESTATEW, api_svcctl_GetCurrentGroupeStateW},
3192 {"SVCCTL_ENUMSERVICEGROUPW", DCERPC_SVCCTL_ENUMSERVICEGROUPW, api_svcctl_EnumServiceGroupW},
3193 {"SVCCTL_CHANGESERVICECONFIG2A", DCERPC_SVCCTL_CHANGESERVICECONFIG2A, api_svcctl_ChangeServiceConfig2A},
3194 {"SVCCTL_CHANGESERVICECONFIG2W", DCERPC_SVCCTL_CHANGESERVICECONFIG2W, api_svcctl_ChangeServiceConfig2W},
3195 {"SVCCTL_QUERYSERVICECONFIG2A", DCERPC_SVCCTL_QUERYSERVICECONFIG2A, api_svcctl_QueryServiceConfig2A},
3196 {"SVCCTL_QUERYSERVICECONFIG2W", DCERPC_SVCCTL_QUERYSERVICECONFIG2W, api_svcctl_QueryServiceConfig2W},
3197 {"SVCCTL_QUERYSERVICESTATUSEX", DCERPC_SVCCTL_QUERYSERVICESTATUSEX, api_svcctl_QueryServiceStatusEx},
3198 {"ENUMSERVICESSTATUSEXA", DCERPC_ENUMSERVICESSTATUSEXA, api_EnumServicesStatusExA},
3199 {"ENUMSERVICESSTATUSEXW", DCERPC_ENUMSERVICESSTATUSEXW, api_EnumServicesStatusExW},
3200 {"SVCCTL_SCSENDTSMESSAGE", DCERPC_SVCCTL_SCSENDTSMESSAGE, api_svcctl_SCSendTSMessage},
3203 void svcctl_get_pipe_fns(struct api_struct **fns, int *n_fns)
3205 *fns = api_svcctl_cmds;
3206 *n_fns = sizeof(api_svcctl_cmds) / sizeof(struct api_struct);
3209 NTSTATUS rpc_svcctl_init(void)
3211 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "svcctl", "svcctl", api_svcctl_cmds, sizeof(api_svcctl_cmds) / sizeof(struct api_struct));