s4:server.c - add linespace (only cosmetic)
[Samba.git] / librpc / gen_ndr / srv_svcctl.c
blobcd5a0eec65cd970e89fabbc5eaf308bf79b609c5
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 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
14 enum ndr_err_code ndr_err;
15 DATA_BLOB blob;
16 struct svcctl_CloseServiceHandle *r;
18 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CLOSESERVICEHANDLE];
20 r = talloc(talloc_tos(), struct svcctl_CloseServiceHandle);
21 if (r == NULL) {
22 return false;
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 ndr_err = call->ndr_pull(pull, NDR_IN, r);
38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39 talloc_free(r);
40 return false;
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, r);
47 ZERO_STRUCT(r->out);
48 r->out.handle = r->in.handle;
49 r->out.result = _svcctl_CloseServiceHandle(p, r);
51 if (p->rng_fault_state) {
52 talloc_free(r);
53 /* Return true here, srv_pipe_hnd.c will take care */
54 return true;
57 if (DEBUGLEVEL >= 10) {
58 NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, r);
61 push = ndr_push_init_ctx(r, NULL);
62 if (push == NULL) {
63 talloc_free(r);
64 return false;
67 ndr_err = call->ndr_push(push, NDR_OUT, r);
68 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
69 talloc_free(r);
70 return false;
73 blob = ndr_push_blob(push);
74 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
75 talloc_free(r);
76 return false;
79 talloc_free(r);
81 return true;
84 static bool api_svcctl_ControlService(pipes_struct *p)
86 const struct ndr_interface_call *call;
87 struct ndr_pull *pull;
88 struct ndr_push *push;
89 enum ndr_err_code ndr_err;
90 DATA_BLOB blob;
91 struct svcctl_ControlService *r;
93 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CONTROLSERVICE];
95 r = talloc(talloc_tos(), struct svcctl_ControlService);
96 if (r == NULL) {
97 return false;
100 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
101 talloc_free(r);
102 return false;
105 pull = ndr_pull_init_blob(&blob, r, NULL);
106 if (pull == NULL) {
107 talloc_free(r);
108 return false;
111 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
112 ndr_err = call->ndr_pull(pull, NDR_IN, r);
113 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
114 talloc_free(r);
115 return false;
118 if (DEBUGLEVEL >= 10) {
119 NDR_PRINT_IN_DEBUG(svcctl_ControlService, r);
122 ZERO_STRUCT(r->out);
123 r->out.service_status = talloc_zero(r, struct SERVICE_STATUS);
124 if (r->out.service_status == NULL) {
125 talloc_free(r);
126 return false;
129 r->out.result = _svcctl_ControlService(p, r);
131 if (p->rng_fault_state) {
132 talloc_free(r);
133 /* Return true here, srv_pipe_hnd.c will take care */
134 return true;
137 if (DEBUGLEVEL >= 10) {
138 NDR_PRINT_OUT_DEBUG(svcctl_ControlService, r);
141 push = ndr_push_init_ctx(r, NULL);
142 if (push == NULL) {
143 talloc_free(r);
144 return false;
147 ndr_err = call->ndr_push(push, NDR_OUT, r);
148 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
149 talloc_free(r);
150 return false;
153 blob = ndr_push_blob(push);
154 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
155 talloc_free(r);
156 return false;
159 talloc_free(r);
161 return true;
164 static bool api_svcctl_DeleteService(pipes_struct *p)
166 const struct ndr_interface_call *call;
167 struct ndr_pull *pull;
168 struct ndr_push *push;
169 enum ndr_err_code ndr_err;
170 DATA_BLOB blob;
171 struct svcctl_DeleteService *r;
173 call = &ndr_table_svcctl.calls[NDR_SVCCTL_DELETESERVICE];
175 r = talloc(talloc_tos(), struct svcctl_DeleteService);
176 if (r == NULL) {
177 return false;
180 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
181 talloc_free(r);
182 return false;
185 pull = ndr_pull_init_blob(&blob, r, NULL);
186 if (pull == NULL) {
187 talloc_free(r);
188 return false;
191 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
192 ndr_err = call->ndr_pull(pull, NDR_IN, r);
193 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
194 talloc_free(r);
195 return false;
198 if (DEBUGLEVEL >= 10) {
199 NDR_PRINT_IN_DEBUG(svcctl_DeleteService, r);
202 r->out.result = _svcctl_DeleteService(p, r);
204 if (p->rng_fault_state) {
205 talloc_free(r);
206 /* Return true here, srv_pipe_hnd.c will take care */
207 return true;
210 if (DEBUGLEVEL >= 10) {
211 NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, r);
214 push = ndr_push_init_ctx(r, NULL);
215 if (push == NULL) {
216 talloc_free(r);
217 return false;
220 ndr_err = call->ndr_push(push, NDR_OUT, r);
221 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
222 talloc_free(r);
223 return false;
226 blob = ndr_push_blob(push);
227 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
228 talloc_free(r);
229 return false;
232 talloc_free(r);
234 return true;
237 static bool api_svcctl_LockServiceDatabase(pipes_struct *p)
239 const struct ndr_interface_call *call;
240 struct ndr_pull *pull;
241 struct ndr_push *push;
242 enum ndr_err_code ndr_err;
243 DATA_BLOB blob;
244 struct svcctl_LockServiceDatabase *r;
246 call = &ndr_table_svcctl.calls[NDR_SVCCTL_LOCKSERVICEDATABASE];
248 r = talloc(talloc_tos(), struct svcctl_LockServiceDatabase);
249 if (r == NULL) {
250 return false;
253 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
254 talloc_free(r);
255 return false;
258 pull = ndr_pull_init_blob(&blob, r, NULL);
259 if (pull == NULL) {
260 talloc_free(r);
261 return false;
264 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
265 ndr_err = call->ndr_pull(pull, NDR_IN, r);
266 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
267 talloc_free(r);
268 return false;
271 if (DEBUGLEVEL >= 10) {
272 NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, r);
275 ZERO_STRUCT(r->out);
276 r->out.lock = talloc_zero(r, struct policy_handle);
277 if (r->out.lock == NULL) {
278 talloc_free(r);
279 return false;
282 r->out.result = _svcctl_LockServiceDatabase(p, r);
284 if (p->rng_fault_state) {
285 talloc_free(r);
286 /* Return true here, srv_pipe_hnd.c will take care */
287 return true;
290 if (DEBUGLEVEL >= 10) {
291 NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, r);
294 push = ndr_push_init_ctx(r, NULL);
295 if (push == NULL) {
296 talloc_free(r);
297 return false;
300 ndr_err = call->ndr_push(push, NDR_OUT, r);
301 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
302 talloc_free(r);
303 return false;
306 blob = ndr_push_blob(push);
307 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
308 talloc_free(r);
309 return false;
312 talloc_free(r);
314 return true;
317 static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p)
319 const struct ndr_interface_call *call;
320 struct ndr_pull *pull;
321 struct ndr_push *push;
322 enum ndr_err_code ndr_err;
323 DATA_BLOB blob;
324 struct svcctl_QueryServiceObjectSecurity *r;
326 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY];
328 r = talloc(talloc_tos(), struct svcctl_QueryServiceObjectSecurity);
329 if (r == NULL) {
330 return false;
333 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
334 talloc_free(r);
335 return false;
338 pull = ndr_pull_init_blob(&blob, r, NULL);
339 if (pull == NULL) {
340 talloc_free(r);
341 return false;
344 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
345 ndr_err = call->ndr_pull(pull, NDR_IN, r);
346 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
347 talloc_free(r);
348 return false;
351 if (DEBUGLEVEL >= 10) {
352 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, r);
355 ZERO_STRUCT(r->out);
356 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
357 if (r->out.buffer == NULL) {
358 talloc_free(r);
359 return false;
362 r->out.needed = talloc_zero(r, uint32_t);
363 if (r->out.needed == NULL) {
364 talloc_free(r);
365 return false;
368 r->out.result = _svcctl_QueryServiceObjectSecurity(p, r);
370 if (p->rng_fault_state) {
371 talloc_free(r);
372 /* Return true here, srv_pipe_hnd.c will take care */
373 return true;
376 if (DEBUGLEVEL >= 10) {
377 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, r);
380 push = ndr_push_init_ctx(r, NULL);
381 if (push == NULL) {
382 talloc_free(r);
383 return false;
386 ndr_err = call->ndr_push(push, NDR_OUT, r);
387 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
388 talloc_free(r);
389 return false;
392 blob = ndr_push_blob(push);
393 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
394 talloc_free(r);
395 return false;
398 talloc_free(r);
400 return true;
403 static bool api_svcctl_SetServiceObjectSecurity(pipes_struct *p)
405 const struct ndr_interface_call *call;
406 struct ndr_pull *pull;
407 struct ndr_push *push;
408 enum ndr_err_code ndr_err;
409 DATA_BLOB blob;
410 struct svcctl_SetServiceObjectSecurity *r;
412 call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICEOBJECTSECURITY];
414 r = talloc(talloc_tos(), struct svcctl_SetServiceObjectSecurity);
415 if (r == NULL) {
416 return false;
419 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
420 talloc_free(r);
421 return false;
424 pull = ndr_pull_init_blob(&blob, r, NULL);
425 if (pull == NULL) {
426 talloc_free(r);
427 return false;
430 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
431 ndr_err = call->ndr_pull(pull, NDR_IN, r);
432 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
433 talloc_free(r);
434 return false;
437 if (DEBUGLEVEL >= 10) {
438 NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, r);
441 r->out.result = _svcctl_SetServiceObjectSecurity(p, r);
443 if (p->rng_fault_state) {
444 talloc_free(r);
445 /* Return true here, srv_pipe_hnd.c will take care */
446 return true;
449 if (DEBUGLEVEL >= 10) {
450 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, r);
453 push = ndr_push_init_ctx(r, NULL);
454 if (push == NULL) {
455 talloc_free(r);
456 return false;
459 ndr_err = call->ndr_push(push, NDR_OUT, r);
460 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
461 talloc_free(r);
462 return false;
465 blob = ndr_push_blob(push);
466 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
467 talloc_free(r);
468 return false;
471 talloc_free(r);
473 return true;
476 static bool api_svcctl_QueryServiceStatus(pipes_struct *p)
478 const struct ndr_interface_call *call;
479 struct ndr_pull *pull;
480 struct ndr_push *push;
481 enum ndr_err_code ndr_err;
482 DATA_BLOB blob;
483 struct svcctl_QueryServiceStatus *r;
485 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUS];
487 r = talloc(talloc_tos(), struct svcctl_QueryServiceStatus);
488 if (r == NULL) {
489 return false;
492 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
493 talloc_free(r);
494 return false;
497 pull = ndr_pull_init_blob(&blob, r, NULL);
498 if (pull == NULL) {
499 talloc_free(r);
500 return false;
503 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
504 ndr_err = call->ndr_pull(pull, NDR_IN, r);
505 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
506 talloc_free(r);
507 return false;
510 if (DEBUGLEVEL >= 10) {
511 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, r);
514 ZERO_STRUCT(r->out);
515 r->out.service_status = talloc_zero(r, struct SERVICE_STATUS);
516 if (r->out.service_status == NULL) {
517 talloc_free(r);
518 return false;
521 r->out.result = _svcctl_QueryServiceStatus(p, r);
523 if (p->rng_fault_state) {
524 talloc_free(r);
525 /* Return true here, srv_pipe_hnd.c will take care */
526 return true;
529 if (DEBUGLEVEL >= 10) {
530 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, r);
533 push = ndr_push_init_ctx(r, NULL);
534 if (push == NULL) {
535 talloc_free(r);
536 return false;
539 ndr_err = call->ndr_push(push, NDR_OUT, r);
540 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
541 talloc_free(r);
542 return false;
545 blob = ndr_push_blob(push);
546 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
547 talloc_free(r);
548 return false;
551 talloc_free(r);
553 return true;
556 static bool api_svcctl_SetServiceStatus(pipes_struct *p)
558 const struct ndr_interface_call *call;
559 struct ndr_pull *pull;
560 struct ndr_push *push;
561 enum ndr_err_code ndr_err;
562 DATA_BLOB blob;
563 struct svcctl_SetServiceStatus *r;
565 call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICESTATUS];
567 r = talloc(talloc_tos(), struct svcctl_SetServiceStatus);
568 if (r == NULL) {
569 return false;
572 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
573 talloc_free(r);
574 return false;
577 pull = ndr_pull_init_blob(&blob, r, NULL);
578 if (pull == NULL) {
579 talloc_free(r);
580 return false;
583 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
584 ndr_err = call->ndr_pull(pull, NDR_IN, r);
585 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
586 talloc_free(r);
587 return false;
590 if (DEBUGLEVEL >= 10) {
591 NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, r);
594 r->out.result = _svcctl_SetServiceStatus(p, r);
596 if (p->rng_fault_state) {
597 talloc_free(r);
598 /* Return true here, srv_pipe_hnd.c will take care */
599 return true;
602 if (DEBUGLEVEL >= 10) {
603 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, r);
606 push = ndr_push_init_ctx(r, NULL);
607 if (push == NULL) {
608 talloc_free(r);
609 return false;
612 ndr_err = call->ndr_push(push, NDR_OUT, r);
613 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
614 talloc_free(r);
615 return false;
618 blob = ndr_push_blob(push);
619 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
620 talloc_free(r);
621 return false;
624 talloc_free(r);
626 return true;
629 static bool api_svcctl_UnlockServiceDatabase(pipes_struct *p)
631 const struct ndr_interface_call *call;
632 struct ndr_pull *pull;
633 struct ndr_push *push;
634 enum ndr_err_code ndr_err;
635 DATA_BLOB blob;
636 struct svcctl_UnlockServiceDatabase *r;
638 call = &ndr_table_svcctl.calls[NDR_SVCCTL_UNLOCKSERVICEDATABASE];
640 r = talloc(talloc_tos(), struct svcctl_UnlockServiceDatabase);
641 if (r == NULL) {
642 return false;
645 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
646 talloc_free(r);
647 return false;
650 pull = ndr_pull_init_blob(&blob, r, NULL);
651 if (pull == NULL) {
652 talloc_free(r);
653 return false;
656 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
657 ndr_err = call->ndr_pull(pull, NDR_IN, r);
658 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
659 talloc_free(r);
660 return false;
663 if (DEBUGLEVEL >= 10) {
664 NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, r);
667 ZERO_STRUCT(r->out);
668 r->out.lock = r->in.lock;
669 r->out.result = _svcctl_UnlockServiceDatabase(p, r);
671 if (p->rng_fault_state) {
672 talloc_free(r);
673 /* Return true here, srv_pipe_hnd.c will take care */
674 return true;
677 if (DEBUGLEVEL >= 10) {
678 NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, r);
681 push = ndr_push_init_ctx(r, NULL);
682 if (push == NULL) {
683 talloc_free(r);
684 return false;
687 ndr_err = call->ndr_push(push, NDR_OUT, r);
688 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
689 talloc_free(r);
690 return false;
693 blob = ndr_push_blob(push);
694 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
695 talloc_free(r);
696 return false;
699 talloc_free(r);
701 return true;
704 static bool api_svcctl_NotifyBootConfigStatus(pipes_struct *p)
706 const struct ndr_interface_call *call;
707 struct ndr_pull *pull;
708 struct ndr_push *push;
709 enum ndr_err_code ndr_err;
710 DATA_BLOB blob;
711 struct svcctl_NotifyBootConfigStatus *r;
713 call = &ndr_table_svcctl.calls[NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS];
715 r = talloc(talloc_tos(), struct svcctl_NotifyBootConfigStatus);
716 if (r == NULL) {
717 return false;
720 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
721 talloc_free(r);
722 return false;
725 pull = ndr_pull_init_blob(&blob, r, NULL);
726 if (pull == NULL) {
727 talloc_free(r);
728 return false;
731 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
732 ndr_err = call->ndr_pull(pull, NDR_IN, r);
733 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
734 talloc_free(r);
735 return false;
738 if (DEBUGLEVEL >= 10) {
739 NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, r);
742 r->out.result = _svcctl_NotifyBootConfigStatus(p, r);
744 if (p->rng_fault_state) {
745 talloc_free(r);
746 /* Return true here, srv_pipe_hnd.c will take care */
747 return true;
750 if (DEBUGLEVEL >= 10) {
751 NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, r);
754 push = ndr_push_init_ctx(r, NULL);
755 if (push == NULL) {
756 talloc_free(r);
757 return false;
760 ndr_err = call->ndr_push(push, NDR_OUT, r);
761 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
762 talloc_free(r);
763 return false;
766 blob = ndr_push_blob(push);
767 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
768 talloc_free(r);
769 return false;
772 talloc_free(r);
774 return true;
777 static bool api_svcctl_SCSetServiceBitsW(pipes_struct *p)
779 const struct ndr_interface_call *call;
780 struct ndr_pull *pull;
781 struct ndr_push *push;
782 enum ndr_err_code ndr_err;
783 DATA_BLOB blob;
784 struct svcctl_SCSetServiceBitsW *r;
786 call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSW];
788 r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsW);
789 if (r == NULL) {
790 return false;
793 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
794 talloc_free(r);
795 return false;
798 pull = ndr_pull_init_blob(&blob, r, NULL);
799 if (pull == NULL) {
800 talloc_free(r);
801 return false;
804 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
805 ndr_err = call->ndr_pull(pull, NDR_IN, r);
806 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
807 talloc_free(r);
808 return false;
811 if (DEBUGLEVEL >= 10) {
812 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, r);
815 r->out.result = _svcctl_SCSetServiceBitsW(p, r);
817 if (p->rng_fault_state) {
818 talloc_free(r);
819 /* Return true here, srv_pipe_hnd.c will take care */
820 return true;
823 if (DEBUGLEVEL >= 10) {
824 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, r);
827 push = ndr_push_init_ctx(r, NULL);
828 if (push == NULL) {
829 talloc_free(r);
830 return false;
833 ndr_err = call->ndr_push(push, NDR_OUT, r);
834 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
835 talloc_free(r);
836 return false;
839 blob = ndr_push_blob(push);
840 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
841 talloc_free(r);
842 return false;
845 talloc_free(r);
847 return true;
850 static bool api_svcctl_ChangeServiceConfigW(pipes_struct *p)
852 const struct ndr_interface_call *call;
853 struct ndr_pull *pull;
854 struct ndr_push *push;
855 enum ndr_err_code ndr_err;
856 DATA_BLOB blob;
857 struct svcctl_ChangeServiceConfigW *r;
859 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGW];
861 r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigW);
862 if (r == NULL) {
863 return false;
866 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
867 talloc_free(r);
868 return false;
871 pull = ndr_pull_init_blob(&blob, r, NULL);
872 if (pull == NULL) {
873 talloc_free(r);
874 return false;
877 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
878 ndr_err = call->ndr_pull(pull, NDR_IN, r);
879 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
880 talloc_free(r);
881 return false;
884 if (DEBUGLEVEL >= 10) {
885 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, r);
888 ZERO_STRUCT(r->out);
889 r->out.tag_id = talloc_zero(r, uint32_t);
890 if (r->out.tag_id == NULL) {
891 talloc_free(r);
892 return false;
895 r->out.result = _svcctl_ChangeServiceConfigW(p, r);
897 if (p->rng_fault_state) {
898 talloc_free(r);
899 /* Return true here, srv_pipe_hnd.c will take care */
900 return true;
903 if (DEBUGLEVEL >= 10) {
904 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, r);
907 push = ndr_push_init_ctx(r, NULL);
908 if (push == NULL) {
909 talloc_free(r);
910 return false;
913 ndr_err = call->ndr_push(push, NDR_OUT, r);
914 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
915 talloc_free(r);
916 return false;
919 blob = ndr_push_blob(push);
920 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
921 talloc_free(r);
922 return false;
925 talloc_free(r);
927 return true;
930 static bool api_svcctl_CreateServiceW(pipes_struct *p)
932 const struct ndr_interface_call *call;
933 struct ndr_pull *pull;
934 struct ndr_push *push;
935 enum ndr_err_code ndr_err;
936 DATA_BLOB blob;
937 struct svcctl_CreateServiceW *r;
939 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEW];
941 r = talloc(talloc_tos(), struct svcctl_CreateServiceW);
942 if (r == NULL) {
943 return false;
946 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
947 talloc_free(r);
948 return false;
951 pull = ndr_pull_init_blob(&blob, r, NULL);
952 if (pull == NULL) {
953 talloc_free(r);
954 return false;
957 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
958 ndr_err = call->ndr_pull(pull, NDR_IN, r);
959 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
960 talloc_free(r);
961 return false;
964 if (DEBUGLEVEL >= 10) {
965 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, r);
968 ZERO_STRUCT(r->out);
969 r->out.TagId = r->in.TagId;
970 r->out.handle = talloc_zero(r, struct policy_handle);
971 if (r->out.handle == NULL) {
972 talloc_free(r);
973 return false;
976 r->out.result = _svcctl_CreateServiceW(p, r);
978 if (p->rng_fault_state) {
979 talloc_free(r);
980 /* Return true here, srv_pipe_hnd.c will take care */
981 return true;
984 if (DEBUGLEVEL >= 10) {
985 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, r);
988 push = ndr_push_init_ctx(r, NULL);
989 if (push == NULL) {
990 talloc_free(r);
991 return false;
994 ndr_err = call->ndr_push(push, NDR_OUT, r);
995 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
996 talloc_free(r);
997 return false;
1000 blob = ndr_push_blob(push);
1001 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1002 talloc_free(r);
1003 return false;
1006 talloc_free(r);
1008 return true;
1011 static bool api_svcctl_EnumDependentServicesW(pipes_struct *p)
1013 const struct ndr_interface_call *call;
1014 struct ndr_pull *pull;
1015 struct ndr_push *push;
1016 enum ndr_err_code ndr_err;
1017 DATA_BLOB blob;
1018 struct svcctl_EnumDependentServicesW *r;
1020 call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESW];
1022 r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesW);
1023 if (r == NULL) {
1024 return false;
1027 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1028 talloc_free(r);
1029 return false;
1032 pull = ndr_pull_init_blob(&blob, r, NULL);
1033 if (pull == NULL) {
1034 talloc_free(r);
1035 return false;
1038 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1039 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1040 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1041 talloc_free(r);
1042 return false;
1045 if (DEBUGLEVEL >= 10) {
1046 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, r);
1049 ZERO_STRUCT(r->out);
1050 r->out.service_status = talloc_zero_array(r, uint8_t, r->in.offered);
1051 if (r->out.service_status == NULL) {
1052 talloc_free(r);
1053 return false;
1056 r->out.needed = talloc_zero(r, uint32_t);
1057 if (r->out.needed == NULL) {
1058 talloc_free(r);
1059 return false;
1062 r->out.services_returned = talloc_zero(r, uint32_t);
1063 if (r->out.services_returned == NULL) {
1064 talloc_free(r);
1065 return false;
1068 r->out.result = _svcctl_EnumDependentServicesW(p, r);
1070 if (p->rng_fault_state) {
1071 talloc_free(r);
1072 /* Return true here, srv_pipe_hnd.c will take care */
1073 return true;
1076 if (DEBUGLEVEL >= 10) {
1077 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, r);
1080 push = ndr_push_init_ctx(r, NULL);
1081 if (push == NULL) {
1082 talloc_free(r);
1083 return false;
1086 ndr_err = call->ndr_push(push, NDR_OUT, r);
1087 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1088 talloc_free(r);
1089 return false;
1092 blob = ndr_push_blob(push);
1093 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1094 talloc_free(r);
1095 return false;
1098 talloc_free(r);
1100 return true;
1103 static bool api_svcctl_EnumServicesStatusW(pipes_struct *p)
1105 const struct ndr_interface_call *call;
1106 struct ndr_pull *pull;
1107 struct ndr_push *push;
1108 enum ndr_err_code ndr_err;
1109 DATA_BLOB blob;
1110 struct svcctl_EnumServicesStatusW *r;
1112 call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSW];
1114 r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusW);
1115 if (r == NULL) {
1116 return false;
1119 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1120 talloc_free(r);
1121 return false;
1124 pull = ndr_pull_init_blob(&blob, r, NULL);
1125 if (pull == NULL) {
1126 talloc_free(r);
1127 return false;
1130 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1131 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1132 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1133 talloc_free(r);
1134 return false;
1137 if (DEBUGLEVEL >= 10) {
1138 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, r);
1141 ZERO_STRUCT(r->out);
1142 r->out.resume_handle = r->in.resume_handle;
1143 r->out.service = talloc_zero_array(r, uint8_t, r->in.offered);
1144 if (r->out.service == NULL) {
1145 talloc_free(r);
1146 return false;
1149 r->out.needed = talloc_zero(r, uint32_t);
1150 if (r->out.needed == NULL) {
1151 talloc_free(r);
1152 return false;
1155 r->out.services_returned = talloc_zero(r, uint32_t);
1156 if (r->out.services_returned == NULL) {
1157 talloc_free(r);
1158 return false;
1161 r->out.result = _svcctl_EnumServicesStatusW(p, r);
1163 if (p->rng_fault_state) {
1164 talloc_free(r);
1165 /* Return true here, srv_pipe_hnd.c will take care */
1166 return true;
1169 if (DEBUGLEVEL >= 10) {
1170 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, r);
1173 push = ndr_push_init_ctx(r, NULL);
1174 if (push == NULL) {
1175 talloc_free(r);
1176 return false;
1179 ndr_err = call->ndr_push(push, NDR_OUT, r);
1180 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1181 talloc_free(r);
1182 return false;
1185 blob = ndr_push_blob(push);
1186 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1187 talloc_free(r);
1188 return false;
1191 talloc_free(r);
1193 return true;
1196 static bool api_svcctl_OpenSCManagerW(pipes_struct *p)
1198 const struct ndr_interface_call *call;
1199 struct ndr_pull *pull;
1200 struct ndr_push *push;
1201 enum ndr_err_code ndr_err;
1202 DATA_BLOB blob;
1203 struct svcctl_OpenSCManagerW *r;
1205 call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERW];
1207 r = talloc(talloc_tos(), struct svcctl_OpenSCManagerW);
1208 if (r == NULL) {
1209 return false;
1212 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1213 talloc_free(r);
1214 return false;
1217 pull = ndr_pull_init_blob(&blob, r, NULL);
1218 if (pull == NULL) {
1219 talloc_free(r);
1220 return false;
1223 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1224 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1225 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1226 talloc_free(r);
1227 return false;
1230 if (DEBUGLEVEL >= 10) {
1231 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, r);
1234 ZERO_STRUCT(r->out);
1235 r->out.handle = talloc_zero(r, struct policy_handle);
1236 if (r->out.handle == NULL) {
1237 talloc_free(r);
1238 return false;
1241 r->out.result = _svcctl_OpenSCManagerW(p, r);
1243 if (p->rng_fault_state) {
1244 talloc_free(r);
1245 /* Return true here, srv_pipe_hnd.c will take care */
1246 return true;
1249 if (DEBUGLEVEL >= 10) {
1250 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, r);
1253 push = ndr_push_init_ctx(r, NULL);
1254 if (push == NULL) {
1255 talloc_free(r);
1256 return false;
1259 ndr_err = call->ndr_push(push, NDR_OUT, r);
1260 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1261 talloc_free(r);
1262 return false;
1265 blob = ndr_push_blob(push);
1266 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1267 talloc_free(r);
1268 return false;
1271 talloc_free(r);
1273 return true;
1276 static bool api_svcctl_OpenServiceW(pipes_struct *p)
1278 const struct ndr_interface_call *call;
1279 struct ndr_pull *pull;
1280 struct ndr_push *push;
1281 enum ndr_err_code ndr_err;
1282 DATA_BLOB blob;
1283 struct svcctl_OpenServiceW *r;
1285 call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEW];
1287 r = talloc(talloc_tos(), struct svcctl_OpenServiceW);
1288 if (r == NULL) {
1289 return false;
1292 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1293 talloc_free(r);
1294 return false;
1297 pull = ndr_pull_init_blob(&blob, r, NULL);
1298 if (pull == NULL) {
1299 talloc_free(r);
1300 return false;
1303 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1304 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1305 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1306 talloc_free(r);
1307 return false;
1310 if (DEBUGLEVEL >= 10) {
1311 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, r);
1314 ZERO_STRUCT(r->out);
1315 r->out.handle = talloc_zero(r, struct policy_handle);
1316 if (r->out.handle == NULL) {
1317 talloc_free(r);
1318 return false;
1321 r->out.result = _svcctl_OpenServiceW(p, r);
1323 if (p->rng_fault_state) {
1324 talloc_free(r);
1325 /* Return true here, srv_pipe_hnd.c will take care */
1326 return true;
1329 if (DEBUGLEVEL >= 10) {
1330 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, r);
1333 push = ndr_push_init_ctx(r, NULL);
1334 if (push == NULL) {
1335 talloc_free(r);
1336 return false;
1339 ndr_err = call->ndr_push(push, NDR_OUT, r);
1340 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1341 talloc_free(r);
1342 return false;
1345 blob = ndr_push_blob(push);
1346 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1347 talloc_free(r);
1348 return false;
1351 talloc_free(r);
1353 return true;
1356 static bool api_svcctl_QueryServiceConfigW(pipes_struct *p)
1358 const struct ndr_interface_call *call;
1359 struct ndr_pull *pull;
1360 struct ndr_push *push;
1361 enum ndr_err_code ndr_err;
1362 DATA_BLOB blob;
1363 struct svcctl_QueryServiceConfigW *r;
1365 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGW];
1367 r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigW);
1368 if (r == NULL) {
1369 return false;
1372 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1373 talloc_free(r);
1374 return false;
1377 pull = ndr_pull_init_blob(&blob, r, NULL);
1378 if (pull == NULL) {
1379 talloc_free(r);
1380 return false;
1383 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1384 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1385 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1386 talloc_free(r);
1387 return false;
1390 if (DEBUGLEVEL >= 10) {
1391 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, r);
1394 ZERO_STRUCT(r->out);
1395 r->out.query = talloc_zero(r, struct QUERY_SERVICE_CONFIG);
1396 if (r->out.query == NULL) {
1397 talloc_free(r);
1398 return false;
1401 r->out.needed = talloc_zero(r, uint32_t);
1402 if (r->out.needed == NULL) {
1403 talloc_free(r);
1404 return false;
1407 r->out.result = _svcctl_QueryServiceConfigW(p, r);
1409 if (p->rng_fault_state) {
1410 talloc_free(r);
1411 /* Return true here, srv_pipe_hnd.c will take care */
1412 return true;
1415 if (DEBUGLEVEL >= 10) {
1416 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, r);
1419 push = ndr_push_init_ctx(r, NULL);
1420 if (push == NULL) {
1421 talloc_free(r);
1422 return false;
1425 ndr_err = call->ndr_push(push, NDR_OUT, r);
1426 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1427 talloc_free(r);
1428 return false;
1431 blob = ndr_push_blob(push);
1432 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1433 talloc_free(r);
1434 return false;
1437 talloc_free(r);
1439 return true;
1442 static bool api_svcctl_QueryServiceLockStatusW(pipes_struct *p)
1444 const struct ndr_interface_call *call;
1445 struct ndr_pull *pull;
1446 struct ndr_push *push;
1447 enum ndr_err_code ndr_err;
1448 DATA_BLOB blob;
1449 struct svcctl_QueryServiceLockStatusW *r;
1451 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSW];
1453 r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusW);
1454 if (r == NULL) {
1455 return false;
1458 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1459 talloc_free(r);
1460 return false;
1463 pull = ndr_pull_init_blob(&blob, r, NULL);
1464 if (pull == NULL) {
1465 talloc_free(r);
1466 return false;
1469 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1470 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1471 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1472 talloc_free(r);
1473 return false;
1476 if (DEBUGLEVEL >= 10) {
1477 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, r);
1480 ZERO_STRUCT(r->out);
1481 r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS);
1482 if (r->out.lock_status == NULL) {
1483 talloc_free(r);
1484 return false;
1487 r->out.needed = talloc_zero(r, uint32_t);
1488 if (r->out.needed == NULL) {
1489 talloc_free(r);
1490 return false;
1493 r->out.result = _svcctl_QueryServiceLockStatusW(p, r);
1495 if (p->rng_fault_state) {
1496 talloc_free(r);
1497 /* Return true here, srv_pipe_hnd.c will take care */
1498 return true;
1501 if (DEBUGLEVEL >= 10) {
1502 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, r);
1505 push = ndr_push_init_ctx(r, NULL);
1506 if (push == NULL) {
1507 talloc_free(r);
1508 return false;
1511 ndr_err = call->ndr_push(push, NDR_OUT, r);
1512 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1513 talloc_free(r);
1514 return false;
1517 blob = ndr_push_blob(push);
1518 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1519 talloc_free(r);
1520 return false;
1523 talloc_free(r);
1525 return true;
1528 static bool api_svcctl_StartServiceW(pipes_struct *p)
1530 const struct ndr_interface_call *call;
1531 struct ndr_pull *pull;
1532 struct ndr_push *push;
1533 enum ndr_err_code ndr_err;
1534 DATA_BLOB blob;
1535 struct svcctl_StartServiceW *r;
1537 call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEW];
1539 r = talloc(talloc_tos(), struct svcctl_StartServiceW);
1540 if (r == NULL) {
1541 return false;
1544 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1545 talloc_free(r);
1546 return false;
1549 pull = ndr_pull_init_blob(&blob, r, NULL);
1550 if (pull == NULL) {
1551 talloc_free(r);
1552 return false;
1555 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1556 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1557 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1558 talloc_free(r);
1559 return false;
1562 if (DEBUGLEVEL >= 10) {
1563 NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, r);
1566 r->out.result = _svcctl_StartServiceW(p, r);
1568 if (p->rng_fault_state) {
1569 talloc_free(r);
1570 /* Return true here, srv_pipe_hnd.c will take care */
1571 return true;
1574 if (DEBUGLEVEL >= 10) {
1575 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, r);
1578 push = ndr_push_init_ctx(r, NULL);
1579 if (push == NULL) {
1580 talloc_free(r);
1581 return false;
1584 ndr_err = call->ndr_push(push, NDR_OUT, r);
1585 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1586 talloc_free(r);
1587 return false;
1590 blob = ndr_push_blob(push);
1591 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1592 talloc_free(r);
1593 return false;
1596 talloc_free(r);
1598 return true;
1601 static bool api_svcctl_GetServiceDisplayNameW(pipes_struct *p)
1603 const struct ndr_interface_call *call;
1604 struct ndr_pull *pull;
1605 struct ndr_push *push;
1606 enum ndr_err_code ndr_err;
1607 DATA_BLOB blob;
1608 struct svcctl_GetServiceDisplayNameW *r;
1610 call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEW];
1612 r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameW);
1613 if (r == NULL) {
1614 return false;
1617 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1618 talloc_free(r);
1619 return false;
1622 pull = ndr_pull_init_blob(&blob, r, NULL);
1623 if (pull == NULL) {
1624 talloc_free(r);
1625 return false;
1628 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1629 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1630 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1631 talloc_free(r);
1632 return false;
1635 if (DEBUGLEVEL >= 10) {
1636 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, r);
1639 ZERO_STRUCT(r->out);
1640 r->out.display_name_length = r->in.display_name_length;
1641 r->out.display_name = talloc_zero(r, const char *);
1642 if (r->out.display_name == NULL) {
1643 talloc_free(r);
1644 return false;
1647 r->out.result = _svcctl_GetServiceDisplayNameW(p, r);
1649 if (p->rng_fault_state) {
1650 talloc_free(r);
1651 /* Return true here, srv_pipe_hnd.c will take care */
1652 return true;
1655 if (DEBUGLEVEL >= 10) {
1656 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, r);
1659 push = ndr_push_init_ctx(r, NULL);
1660 if (push == NULL) {
1661 talloc_free(r);
1662 return false;
1665 ndr_err = call->ndr_push(push, NDR_OUT, r);
1666 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1667 talloc_free(r);
1668 return false;
1671 blob = ndr_push_blob(push);
1672 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1673 talloc_free(r);
1674 return false;
1677 talloc_free(r);
1679 return true;
1682 static bool api_svcctl_GetServiceKeyNameW(pipes_struct *p)
1684 const struct ndr_interface_call *call;
1685 struct ndr_pull *pull;
1686 struct ndr_push *push;
1687 enum ndr_err_code ndr_err;
1688 DATA_BLOB blob;
1689 struct svcctl_GetServiceKeyNameW *r;
1691 call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEW];
1693 r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameW);
1694 if (r == NULL) {
1695 return false;
1698 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1699 talloc_free(r);
1700 return false;
1703 pull = ndr_pull_init_blob(&blob, r, NULL);
1704 if (pull == NULL) {
1705 talloc_free(r);
1706 return false;
1709 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1710 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1711 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1712 talloc_free(r);
1713 return false;
1716 if (DEBUGLEVEL >= 10) {
1717 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, r);
1720 ZERO_STRUCT(r->out);
1721 r->out.display_name_length = r->in.display_name_length;
1722 r->out.key_name = talloc_zero(r, const char *);
1723 if (r->out.key_name == NULL) {
1724 talloc_free(r);
1725 return false;
1728 r->out.result = _svcctl_GetServiceKeyNameW(p, r);
1730 if (p->rng_fault_state) {
1731 talloc_free(r);
1732 /* Return true here, srv_pipe_hnd.c will take care */
1733 return true;
1736 if (DEBUGLEVEL >= 10) {
1737 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, r);
1740 push = ndr_push_init_ctx(r, NULL);
1741 if (push == NULL) {
1742 talloc_free(r);
1743 return false;
1746 ndr_err = call->ndr_push(push, NDR_OUT, r);
1747 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1748 talloc_free(r);
1749 return false;
1752 blob = ndr_push_blob(push);
1753 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1754 talloc_free(r);
1755 return false;
1758 talloc_free(r);
1760 return true;
1763 static bool api_svcctl_SCSetServiceBitsA(pipes_struct *p)
1765 const struct ndr_interface_call *call;
1766 struct ndr_pull *pull;
1767 struct ndr_push *push;
1768 enum ndr_err_code ndr_err;
1769 DATA_BLOB blob;
1770 struct svcctl_SCSetServiceBitsA *r;
1772 call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSA];
1774 r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsA);
1775 if (r == NULL) {
1776 return false;
1779 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1780 talloc_free(r);
1781 return false;
1784 pull = ndr_pull_init_blob(&blob, r, NULL);
1785 if (pull == NULL) {
1786 talloc_free(r);
1787 return false;
1790 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1791 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1792 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1793 talloc_free(r);
1794 return false;
1797 if (DEBUGLEVEL >= 10) {
1798 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, r);
1801 r->out.result = _svcctl_SCSetServiceBitsA(p, r);
1803 if (p->rng_fault_state) {
1804 talloc_free(r);
1805 /* Return true here, srv_pipe_hnd.c will take care */
1806 return true;
1809 if (DEBUGLEVEL >= 10) {
1810 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, r);
1813 push = ndr_push_init_ctx(r, NULL);
1814 if (push == NULL) {
1815 talloc_free(r);
1816 return false;
1819 ndr_err = call->ndr_push(push, NDR_OUT, r);
1820 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1821 talloc_free(r);
1822 return false;
1825 blob = ndr_push_blob(push);
1826 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1827 talloc_free(r);
1828 return false;
1831 talloc_free(r);
1833 return true;
1836 static bool api_svcctl_ChangeServiceConfigA(pipes_struct *p)
1838 const struct ndr_interface_call *call;
1839 struct ndr_pull *pull;
1840 struct ndr_push *push;
1841 enum ndr_err_code ndr_err;
1842 DATA_BLOB blob;
1843 struct svcctl_ChangeServiceConfigA *r;
1845 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGA];
1847 r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigA);
1848 if (r == NULL) {
1849 return false;
1852 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1853 talloc_free(r);
1854 return false;
1857 pull = ndr_pull_init_blob(&blob, r, NULL);
1858 if (pull == NULL) {
1859 talloc_free(r);
1860 return false;
1863 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1864 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1865 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1866 talloc_free(r);
1867 return false;
1870 if (DEBUGLEVEL >= 10) {
1871 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, r);
1874 ZERO_STRUCT(r->out);
1875 r->out.tag_id = talloc_zero(r, uint32_t);
1876 if (r->out.tag_id == NULL) {
1877 talloc_free(r);
1878 return false;
1881 r->out.result = _svcctl_ChangeServiceConfigA(p, r);
1883 if (p->rng_fault_state) {
1884 talloc_free(r);
1885 /* Return true here, srv_pipe_hnd.c will take care */
1886 return true;
1889 if (DEBUGLEVEL >= 10) {
1890 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, r);
1893 push = ndr_push_init_ctx(r, NULL);
1894 if (push == NULL) {
1895 talloc_free(r);
1896 return false;
1899 ndr_err = call->ndr_push(push, NDR_OUT, r);
1900 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1901 talloc_free(r);
1902 return false;
1905 blob = ndr_push_blob(push);
1906 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1907 talloc_free(r);
1908 return false;
1911 talloc_free(r);
1913 return true;
1916 static bool api_svcctl_CreateServiceA(pipes_struct *p)
1918 const struct ndr_interface_call *call;
1919 struct ndr_pull *pull;
1920 struct ndr_push *push;
1921 enum ndr_err_code ndr_err;
1922 DATA_BLOB blob;
1923 struct svcctl_CreateServiceA *r;
1925 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEA];
1927 r = talloc(talloc_tos(), struct svcctl_CreateServiceA);
1928 if (r == NULL) {
1929 return false;
1932 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1933 talloc_free(r);
1934 return false;
1937 pull = ndr_pull_init_blob(&blob, r, NULL);
1938 if (pull == NULL) {
1939 talloc_free(r);
1940 return false;
1943 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1944 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1945 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1946 talloc_free(r);
1947 return false;
1950 if (DEBUGLEVEL >= 10) {
1951 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, r);
1954 ZERO_STRUCT(r->out);
1955 r->out.TagId = talloc_zero(r, uint32_t);
1956 if (r->out.TagId == NULL) {
1957 talloc_free(r);
1958 return false;
1961 r->out.result = _svcctl_CreateServiceA(p, r);
1963 if (p->rng_fault_state) {
1964 talloc_free(r);
1965 /* Return true here, srv_pipe_hnd.c will take care */
1966 return true;
1969 if (DEBUGLEVEL >= 10) {
1970 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, r);
1973 push = ndr_push_init_ctx(r, NULL);
1974 if (push == NULL) {
1975 talloc_free(r);
1976 return false;
1979 ndr_err = call->ndr_push(push, NDR_OUT, r);
1980 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1981 talloc_free(r);
1982 return false;
1985 blob = ndr_push_blob(push);
1986 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1987 talloc_free(r);
1988 return false;
1991 talloc_free(r);
1993 return true;
1996 static bool api_svcctl_EnumDependentServicesA(pipes_struct *p)
1998 const struct ndr_interface_call *call;
1999 struct ndr_pull *pull;
2000 struct ndr_push *push;
2001 enum ndr_err_code ndr_err;
2002 DATA_BLOB blob;
2003 struct svcctl_EnumDependentServicesA *r;
2005 call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESA];
2007 r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesA);
2008 if (r == NULL) {
2009 return false;
2012 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2013 talloc_free(r);
2014 return false;
2017 pull = ndr_pull_init_blob(&blob, r, NULL);
2018 if (pull == NULL) {
2019 talloc_free(r);
2020 return false;
2023 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2024 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2025 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2026 talloc_free(r);
2027 return false;
2030 if (DEBUGLEVEL >= 10) {
2031 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, r);
2034 ZERO_STRUCT(r->out);
2035 r->out.service_status = talloc_zero(r, struct ENUM_SERVICE_STATUSA);
2036 if (r->out.service_status == NULL) {
2037 talloc_free(r);
2038 return false;
2041 r->out.needed = talloc_zero(r, uint32_t);
2042 if (r->out.needed == NULL) {
2043 talloc_free(r);
2044 return false;
2047 r->out.services_returned = talloc_zero(r, uint32_t);
2048 if (r->out.services_returned == NULL) {
2049 talloc_free(r);
2050 return false;
2053 r->out.result = _svcctl_EnumDependentServicesA(p, r);
2055 if (p->rng_fault_state) {
2056 talloc_free(r);
2057 /* Return true here, srv_pipe_hnd.c will take care */
2058 return true;
2061 if (DEBUGLEVEL >= 10) {
2062 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, r);
2065 push = ndr_push_init_ctx(r, NULL);
2066 if (push == NULL) {
2067 talloc_free(r);
2068 return false;
2071 ndr_err = call->ndr_push(push, NDR_OUT, r);
2072 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2073 talloc_free(r);
2074 return false;
2077 blob = ndr_push_blob(push);
2078 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2079 talloc_free(r);
2080 return false;
2083 talloc_free(r);
2085 return true;
2088 static bool api_svcctl_EnumServicesStatusA(pipes_struct *p)
2090 const struct ndr_interface_call *call;
2091 struct ndr_pull *pull;
2092 struct ndr_push *push;
2093 enum ndr_err_code ndr_err;
2094 DATA_BLOB blob;
2095 struct svcctl_EnumServicesStatusA *r;
2097 call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSA];
2099 r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusA);
2100 if (r == NULL) {
2101 return false;
2104 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2105 talloc_free(r);
2106 return false;
2109 pull = ndr_pull_init_blob(&blob, r, NULL);
2110 if (pull == NULL) {
2111 talloc_free(r);
2112 return false;
2115 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2116 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2117 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2118 talloc_free(r);
2119 return false;
2122 if (DEBUGLEVEL >= 10) {
2123 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, r);
2126 ZERO_STRUCT(r->out);
2127 r->out.resume_handle = r->in.resume_handle;
2128 r->out.service = talloc_zero_array(r, uint8_t, r->in.offered);
2129 if (r->out.service == NULL) {
2130 talloc_free(r);
2131 return false;
2134 r->out.needed = talloc_zero(r, uint32_t);
2135 if (r->out.needed == NULL) {
2136 talloc_free(r);
2137 return false;
2140 r->out.services_returned = talloc_zero(r, uint32_t);
2141 if (r->out.services_returned == NULL) {
2142 talloc_free(r);
2143 return false;
2146 r->out.result = _svcctl_EnumServicesStatusA(p, r);
2148 if (p->rng_fault_state) {
2149 talloc_free(r);
2150 /* Return true here, srv_pipe_hnd.c will take care */
2151 return true;
2154 if (DEBUGLEVEL >= 10) {
2155 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, r);
2158 push = ndr_push_init_ctx(r, NULL);
2159 if (push == NULL) {
2160 talloc_free(r);
2161 return false;
2164 ndr_err = call->ndr_push(push, NDR_OUT, r);
2165 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2166 talloc_free(r);
2167 return false;
2170 blob = ndr_push_blob(push);
2171 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2172 talloc_free(r);
2173 return false;
2176 talloc_free(r);
2178 return true;
2181 static bool api_svcctl_OpenSCManagerA(pipes_struct *p)
2183 const struct ndr_interface_call *call;
2184 struct ndr_pull *pull;
2185 struct ndr_push *push;
2186 enum ndr_err_code ndr_err;
2187 DATA_BLOB blob;
2188 struct svcctl_OpenSCManagerA *r;
2190 call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERA];
2192 r = talloc(talloc_tos(), struct svcctl_OpenSCManagerA);
2193 if (r == NULL) {
2194 return false;
2197 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2198 talloc_free(r);
2199 return false;
2202 pull = ndr_pull_init_blob(&blob, r, NULL);
2203 if (pull == NULL) {
2204 talloc_free(r);
2205 return false;
2208 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2209 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2210 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2211 talloc_free(r);
2212 return false;
2215 if (DEBUGLEVEL >= 10) {
2216 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, r);
2219 ZERO_STRUCT(r->out);
2220 r->out.handle = talloc_zero(r, struct policy_handle);
2221 if (r->out.handle == NULL) {
2222 talloc_free(r);
2223 return false;
2226 r->out.result = _svcctl_OpenSCManagerA(p, r);
2228 if (p->rng_fault_state) {
2229 talloc_free(r);
2230 /* Return true here, srv_pipe_hnd.c will take care */
2231 return true;
2234 if (DEBUGLEVEL >= 10) {
2235 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, r);
2238 push = ndr_push_init_ctx(r, NULL);
2239 if (push == NULL) {
2240 talloc_free(r);
2241 return false;
2244 ndr_err = call->ndr_push(push, NDR_OUT, r);
2245 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2246 talloc_free(r);
2247 return false;
2250 blob = ndr_push_blob(push);
2251 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2252 talloc_free(r);
2253 return false;
2256 talloc_free(r);
2258 return true;
2261 static bool api_svcctl_OpenServiceA(pipes_struct *p)
2263 const struct ndr_interface_call *call;
2264 struct ndr_pull *pull;
2265 struct ndr_push *push;
2266 enum ndr_err_code ndr_err;
2267 DATA_BLOB blob;
2268 struct svcctl_OpenServiceA *r;
2270 call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEA];
2272 r = talloc(talloc_tos(), struct svcctl_OpenServiceA);
2273 if (r == NULL) {
2274 return false;
2277 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2278 talloc_free(r);
2279 return false;
2282 pull = ndr_pull_init_blob(&blob, r, NULL);
2283 if (pull == NULL) {
2284 talloc_free(r);
2285 return false;
2288 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2289 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2290 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2291 talloc_free(r);
2292 return false;
2295 if (DEBUGLEVEL >= 10) {
2296 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, r);
2299 r->out.result = _svcctl_OpenServiceA(p, r);
2301 if (p->rng_fault_state) {
2302 talloc_free(r);
2303 /* Return true here, srv_pipe_hnd.c will take care */
2304 return true;
2307 if (DEBUGLEVEL >= 10) {
2308 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, r);
2311 push = ndr_push_init_ctx(r, NULL);
2312 if (push == NULL) {
2313 talloc_free(r);
2314 return false;
2317 ndr_err = call->ndr_push(push, NDR_OUT, r);
2318 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2319 talloc_free(r);
2320 return false;
2323 blob = ndr_push_blob(push);
2324 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2325 talloc_free(r);
2326 return false;
2329 talloc_free(r);
2331 return true;
2334 static bool api_svcctl_QueryServiceConfigA(pipes_struct *p)
2336 const struct ndr_interface_call *call;
2337 struct ndr_pull *pull;
2338 struct ndr_push *push;
2339 enum ndr_err_code ndr_err;
2340 DATA_BLOB blob;
2341 struct svcctl_QueryServiceConfigA *r;
2343 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGA];
2345 r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigA);
2346 if (r == NULL) {
2347 return false;
2350 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2351 talloc_free(r);
2352 return false;
2355 pull = ndr_pull_init_blob(&blob, r, NULL);
2356 if (pull == NULL) {
2357 talloc_free(r);
2358 return false;
2361 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2362 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2363 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2364 talloc_free(r);
2365 return false;
2368 if (DEBUGLEVEL >= 10) {
2369 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, r);
2372 ZERO_STRUCT(r->out);
2373 r->out.query = talloc_zero_array(r, uint8_t, r->in.offered);
2374 if (r->out.query == NULL) {
2375 talloc_free(r);
2376 return false;
2379 r->out.needed = talloc_zero(r, uint32_t);
2380 if (r->out.needed == NULL) {
2381 talloc_free(r);
2382 return false;
2385 r->out.result = _svcctl_QueryServiceConfigA(p, r);
2387 if (p->rng_fault_state) {
2388 talloc_free(r);
2389 /* Return true here, srv_pipe_hnd.c will take care */
2390 return true;
2393 if (DEBUGLEVEL >= 10) {
2394 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, r);
2397 push = ndr_push_init_ctx(r, NULL);
2398 if (push == NULL) {
2399 talloc_free(r);
2400 return false;
2403 ndr_err = call->ndr_push(push, NDR_OUT, r);
2404 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2405 talloc_free(r);
2406 return false;
2409 blob = ndr_push_blob(push);
2410 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2411 talloc_free(r);
2412 return false;
2415 talloc_free(r);
2417 return true;
2420 static bool api_svcctl_QueryServiceLockStatusA(pipes_struct *p)
2422 const struct ndr_interface_call *call;
2423 struct ndr_pull *pull;
2424 struct ndr_push *push;
2425 enum ndr_err_code ndr_err;
2426 DATA_BLOB blob;
2427 struct svcctl_QueryServiceLockStatusA *r;
2429 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSA];
2431 r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusA);
2432 if (r == NULL) {
2433 return false;
2436 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2437 talloc_free(r);
2438 return false;
2441 pull = ndr_pull_init_blob(&blob, r, NULL);
2442 if (pull == NULL) {
2443 talloc_free(r);
2444 return false;
2447 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2448 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2449 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2450 talloc_free(r);
2451 return false;
2454 if (DEBUGLEVEL >= 10) {
2455 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, r);
2458 ZERO_STRUCT(r->out);
2459 r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS);
2460 if (r->out.lock_status == NULL) {
2461 talloc_free(r);
2462 return false;
2465 r->out.needed = talloc_zero(r, uint32_t);
2466 if (r->out.needed == NULL) {
2467 talloc_free(r);
2468 return false;
2471 r->out.result = _svcctl_QueryServiceLockStatusA(p, r);
2473 if (p->rng_fault_state) {
2474 talloc_free(r);
2475 /* Return true here, srv_pipe_hnd.c will take care */
2476 return true;
2479 if (DEBUGLEVEL >= 10) {
2480 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, r);
2483 push = ndr_push_init_ctx(r, NULL);
2484 if (push == NULL) {
2485 talloc_free(r);
2486 return false;
2489 ndr_err = call->ndr_push(push, NDR_OUT, r);
2490 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2491 talloc_free(r);
2492 return false;
2495 blob = ndr_push_blob(push);
2496 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2497 talloc_free(r);
2498 return false;
2501 talloc_free(r);
2503 return true;
2506 static bool api_svcctl_StartServiceA(pipes_struct *p)
2508 const struct ndr_interface_call *call;
2509 struct ndr_pull *pull;
2510 struct ndr_push *push;
2511 enum ndr_err_code ndr_err;
2512 DATA_BLOB blob;
2513 struct svcctl_StartServiceA *r;
2515 call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEA];
2517 r = talloc(talloc_tos(), struct svcctl_StartServiceA);
2518 if (r == NULL) {
2519 return false;
2522 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2523 talloc_free(r);
2524 return false;
2527 pull = ndr_pull_init_blob(&blob, r, NULL);
2528 if (pull == NULL) {
2529 talloc_free(r);
2530 return false;
2533 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2534 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2535 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2536 talloc_free(r);
2537 return false;
2540 if (DEBUGLEVEL >= 10) {
2541 NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, r);
2544 r->out.result = _svcctl_StartServiceA(p, r);
2546 if (p->rng_fault_state) {
2547 talloc_free(r);
2548 /* Return true here, srv_pipe_hnd.c will take care */
2549 return true;
2552 if (DEBUGLEVEL >= 10) {
2553 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, r);
2556 push = ndr_push_init_ctx(r, NULL);
2557 if (push == NULL) {
2558 talloc_free(r);
2559 return false;
2562 ndr_err = call->ndr_push(push, NDR_OUT, r);
2563 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2564 talloc_free(r);
2565 return false;
2568 blob = ndr_push_blob(push);
2569 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2570 talloc_free(r);
2571 return false;
2574 talloc_free(r);
2576 return true;
2579 static bool api_svcctl_GetServiceDisplayNameA(pipes_struct *p)
2581 const struct ndr_interface_call *call;
2582 struct ndr_pull *pull;
2583 struct ndr_push *push;
2584 enum ndr_err_code ndr_err;
2585 DATA_BLOB blob;
2586 struct svcctl_GetServiceDisplayNameA *r;
2588 call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEA];
2590 r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameA);
2591 if (r == NULL) {
2592 return false;
2595 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2596 talloc_free(r);
2597 return false;
2600 pull = ndr_pull_init_blob(&blob, r, NULL);
2601 if (pull == NULL) {
2602 talloc_free(r);
2603 return false;
2606 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2607 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2608 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2609 talloc_free(r);
2610 return false;
2613 if (DEBUGLEVEL >= 10) {
2614 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, r);
2617 ZERO_STRUCT(r->out);
2618 r->out.display_name_length = r->in.display_name_length;
2619 r->out.display_name = talloc_zero(r, const char *);
2620 if (r->out.display_name == NULL) {
2621 talloc_free(r);
2622 return false;
2625 r->out.result = _svcctl_GetServiceDisplayNameA(p, r);
2627 if (p->rng_fault_state) {
2628 talloc_free(r);
2629 /* Return true here, srv_pipe_hnd.c will take care */
2630 return true;
2633 if (DEBUGLEVEL >= 10) {
2634 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, r);
2637 push = ndr_push_init_ctx(r, NULL);
2638 if (push == NULL) {
2639 talloc_free(r);
2640 return false;
2643 ndr_err = call->ndr_push(push, NDR_OUT, r);
2644 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2645 talloc_free(r);
2646 return false;
2649 blob = ndr_push_blob(push);
2650 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2651 talloc_free(r);
2652 return false;
2655 talloc_free(r);
2657 return true;
2660 static bool api_svcctl_GetServiceKeyNameA(pipes_struct *p)
2662 const struct ndr_interface_call *call;
2663 struct ndr_pull *pull;
2664 struct ndr_push *push;
2665 enum ndr_err_code ndr_err;
2666 DATA_BLOB blob;
2667 struct svcctl_GetServiceKeyNameA *r;
2669 call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEA];
2671 r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameA);
2672 if (r == NULL) {
2673 return false;
2676 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2677 talloc_free(r);
2678 return false;
2681 pull = ndr_pull_init_blob(&blob, r, NULL);
2682 if (pull == NULL) {
2683 talloc_free(r);
2684 return false;
2687 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2688 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2689 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2690 talloc_free(r);
2691 return false;
2694 if (DEBUGLEVEL >= 10) {
2695 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, r);
2698 ZERO_STRUCT(r->out);
2699 r->out.display_name_length = r->in.display_name_length;
2700 r->out.key_name = talloc_zero(r, const char *);
2701 if (r->out.key_name == NULL) {
2702 talloc_free(r);
2703 return false;
2706 r->out.result = _svcctl_GetServiceKeyNameA(p, r);
2708 if (p->rng_fault_state) {
2709 talloc_free(r);
2710 /* Return true here, srv_pipe_hnd.c will take care */
2711 return true;
2714 if (DEBUGLEVEL >= 10) {
2715 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, r);
2718 push = ndr_push_init_ctx(r, NULL);
2719 if (push == NULL) {
2720 talloc_free(r);
2721 return false;
2724 ndr_err = call->ndr_push(push, NDR_OUT, r);
2725 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2726 talloc_free(r);
2727 return false;
2730 blob = ndr_push_blob(push);
2731 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2732 talloc_free(r);
2733 return false;
2736 talloc_free(r);
2738 return true;
2741 static bool api_svcctl_GetCurrentGroupeStateW(pipes_struct *p)
2743 const struct ndr_interface_call *call;
2744 struct ndr_pull *pull;
2745 struct ndr_push *push;
2746 enum ndr_err_code ndr_err;
2747 DATA_BLOB blob;
2748 struct svcctl_GetCurrentGroupeStateW *r;
2750 call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETCURRENTGROUPESTATEW];
2752 r = talloc(talloc_tos(), struct svcctl_GetCurrentGroupeStateW);
2753 if (r == NULL) {
2754 return false;
2757 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2758 talloc_free(r);
2759 return false;
2762 pull = ndr_pull_init_blob(&blob, r, NULL);
2763 if (pull == NULL) {
2764 talloc_free(r);
2765 return false;
2768 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2769 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2770 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2771 talloc_free(r);
2772 return false;
2775 if (DEBUGLEVEL >= 10) {
2776 NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, r);
2779 r->out.result = _svcctl_GetCurrentGroupeStateW(p, r);
2781 if (p->rng_fault_state) {
2782 talloc_free(r);
2783 /* Return true here, srv_pipe_hnd.c will take care */
2784 return true;
2787 if (DEBUGLEVEL >= 10) {
2788 NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, r);
2791 push = ndr_push_init_ctx(r, NULL);
2792 if (push == NULL) {
2793 talloc_free(r);
2794 return false;
2797 ndr_err = call->ndr_push(push, NDR_OUT, r);
2798 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2799 talloc_free(r);
2800 return false;
2803 blob = ndr_push_blob(push);
2804 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2805 talloc_free(r);
2806 return false;
2809 talloc_free(r);
2811 return true;
2814 static bool api_svcctl_EnumServiceGroupW(pipes_struct *p)
2816 const struct ndr_interface_call *call;
2817 struct ndr_pull *pull;
2818 struct ndr_push *push;
2819 enum ndr_err_code ndr_err;
2820 DATA_BLOB blob;
2821 struct svcctl_EnumServiceGroupW *r;
2823 call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICEGROUPW];
2825 r = talloc(talloc_tos(), struct svcctl_EnumServiceGroupW);
2826 if (r == NULL) {
2827 return false;
2830 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2831 talloc_free(r);
2832 return false;
2835 pull = ndr_pull_init_blob(&blob, r, NULL);
2836 if (pull == NULL) {
2837 talloc_free(r);
2838 return false;
2841 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2842 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2843 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2844 talloc_free(r);
2845 return false;
2848 if (DEBUGLEVEL >= 10) {
2849 NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, r);
2852 r->out.result = _svcctl_EnumServiceGroupW(p, r);
2854 if (p->rng_fault_state) {
2855 talloc_free(r);
2856 /* Return true here, srv_pipe_hnd.c will take care */
2857 return true;
2860 if (DEBUGLEVEL >= 10) {
2861 NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, r);
2864 push = ndr_push_init_ctx(r, NULL);
2865 if (push == NULL) {
2866 talloc_free(r);
2867 return false;
2870 ndr_err = call->ndr_push(push, NDR_OUT, r);
2871 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2872 talloc_free(r);
2873 return false;
2876 blob = ndr_push_blob(push);
2877 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2878 talloc_free(r);
2879 return false;
2882 talloc_free(r);
2884 return true;
2887 static bool api_svcctl_ChangeServiceConfig2A(pipes_struct *p)
2889 const struct ndr_interface_call *call;
2890 struct ndr_pull *pull;
2891 struct ndr_push *push;
2892 enum ndr_err_code ndr_err;
2893 DATA_BLOB blob;
2894 struct svcctl_ChangeServiceConfig2A *r;
2896 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2A];
2898 r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2A);
2899 if (r == NULL) {
2900 return false;
2903 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2904 talloc_free(r);
2905 return false;
2908 pull = ndr_pull_init_blob(&blob, r, NULL);
2909 if (pull == NULL) {
2910 talloc_free(r);
2911 return false;
2914 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2915 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2916 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2917 talloc_free(r);
2918 return false;
2921 if (DEBUGLEVEL >= 10) {
2922 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, r);
2925 r->out.result = _svcctl_ChangeServiceConfig2A(p, r);
2927 if (p->rng_fault_state) {
2928 talloc_free(r);
2929 /* Return true here, srv_pipe_hnd.c will take care */
2930 return true;
2933 if (DEBUGLEVEL >= 10) {
2934 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, r);
2937 push = ndr_push_init_ctx(r, NULL);
2938 if (push == NULL) {
2939 talloc_free(r);
2940 return false;
2943 ndr_err = call->ndr_push(push, NDR_OUT, r);
2944 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2945 talloc_free(r);
2946 return false;
2949 blob = ndr_push_blob(push);
2950 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2951 talloc_free(r);
2952 return false;
2955 talloc_free(r);
2957 return true;
2960 static bool api_svcctl_ChangeServiceConfig2W(pipes_struct *p)
2962 const struct ndr_interface_call *call;
2963 struct ndr_pull *pull;
2964 struct ndr_push *push;
2965 enum ndr_err_code ndr_err;
2966 DATA_BLOB blob;
2967 struct svcctl_ChangeServiceConfig2W *r;
2969 call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2W];
2971 r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2W);
2972 if (r == NULL) {
2973 return false;
2976 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2977 talloc_free(r);
2978 return false;
2981 pull = ndr_pull_init_blob(&blob, r, NULL);
2982 if (pull == NULL) {
2983 talloc_free(r);
2984 return false;
2987 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2988 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2989 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2990 talloc_free(r);
2991 return false;
2994 if (DEBUGLEVEL >= 10) {
2995 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, r);
2998 r->out.result = _svcctl_ChangeServiceConfig2W(p, r);
3000 if (p->rng_fault_state) {
3001 talloc_free(r);
3002 /* Return true here, srv_pipe_hnd.c will take care */
3003 return true;
3006 if (DEBUGLEVEL >= 10) {
3007 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, r);
3010 push = ndr_push_init_ctx(r, NULL);
3011 if (push == NULL) {
3012 talloc_free(r);
3013 return false;
3016 ndr_err = call->ndr_push(push, NDR_OUT, r);
3017 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3018 talloc_free(r);
3019 return false;
3022 blob = ndr_push_blob(push);
3023 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3024 talloc_free(r);
3025 return false;
3028 talloc_free(r);
3030 return true;
3033 static bool api_svcctl_QueryServiceConfig2A(pipes_struct *p)
3035 const struct ndr_interface_call *call;
3036 struct ndr_pull *pull;
3037 struct ndr_push *push;
3038 enum ndr_err_code ndr_err;
3039 DATA_BLOB blob;
3040 struct svcctl_QueryServiceConfig2A *r;
3042 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2A];
3044 r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2A);
3045 if (r == NULL) {
3046 return false;
3049 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3050 talloc_free(r);
3051 return false;
3054 pull = ndr_pull_init_blob(&blob, r, NULL);
3055 if (pull == NULL) {
3056 talloc_free(r);
3057 return false;
3060 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3061 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3062 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3063 talloc_free(r);
3064 return false;
3067 if (DEBUGLEVEL >= 10) {
3068 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, r);
3071 ZERO_STRUCT(r->out);
3072 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
3073 if (r->out.buffer == NULL) {
3074 talloc_free(r);
3075 return false;
3078 r->out.needed = talloc_zero(r, uint32_t);
3079 if (r->out.needed == NULL) {
3080 talloc_free(r);
3081 return false;
3084 r->out.result = _svcctl_QueryServiceConfig2A(p, r);
3086 if (p->rng_fault_state) {
3087 talloc_free(r);
3088 /* Return true here, srv_pipe_hnd.c will take care */
3089 return true;
3092 if (DEBUGLEVEL >= 10) {
3093 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, r);
3096 push = ndr_push_init_ctx(r, NULL);
3097 if (push == NULL) {
3098 talloc_free(r);
3099 return false;
3102 ndr_err = call->ndr_push(push, NDR_OUT, r);
3103 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3104 talloc_free(r);
3105 return false;
3108 blob = ndr_push_blob(push);
3109 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3110 talloc_free(r);
3111 return false;
3114 talloc_free(r);
3116 return true;
3119 static bool api_svcctl_QueryServiceConfig2W(pipes_struct *p)
3121 const struct ndr_interface_call *call;
3122 struct ndr_pull *pull;
3123 struct ndr_push *push;
3124 enum ndr_err_code ndr_err;
3125 DATA_BLOB blob;
3126 struct svcctl_QueryServiceConfig2W *r;
3128 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2W];
3130 r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2W);
3131 if (r == NULL) {
3132 return false;
3135 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3136 talloc_free(r);
3137 return false;
3140 pull = ndr_pull_init_blob(&blob, r, NULL);
3141 if (pull == NULL) {
3142 talloc_free(r);
3143 return false;
3146 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3147 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3148 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3149 talloc_free(r);
3150 return false;
3153 if (DEBUGLEVEL >= 10) {
3154 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, r);
3157 ZERO_STRUCT(r->out);
3158 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
3159 if (r->out.buffer == NULL) {
3160 talloc_free(r);
3161 return false;
3164 r->out.needed = talloc_zero(r, uint32_t);
3165 if (r->out.needed == NULL) {
3166 talloc_free(r);
3167 return false;
3170 r->out.result = _svcctl_QueryServiceConfig2W(p, r);
3172 if (p->rng_fault_state) {
3173 talloc_free(r);
3174 /* Return true here, srv_pipe_hnd.c will take care */
3175 return true;
3178 if (DEBUGLEVEL >= 10) {
3179 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, r);
3182 push = ndr_push_init_ctx(r, NULL);
3183 if (push == NULL) {
3184 talloc_free(r);
3185 return false;
3188 ndr_err = call->ndr_push(push, NDR_OUT, r);
3189 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3190 talloc_free(r);
3191 return false;
3194 blob = ndr_push_blob(push);
3195 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3196 talloc_free(r);
3197 return false;
3200 talloc_free(r);
3202 return true;
3205 static bool api_svcctl_QueryServiceStatusEx(pipes_struct *p)
3207 const struct ndr_interface_call *call;
3208 struct ndr_pull *pull;
3209 struct ndr_push *push;
3210 enum ndr_err_code ndr_err;
3211 DATA_BLOB blob;
3212 struct svcctl_QueryServiceStatusEx *r;
3214 call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUSEX];
3216 r = talloc(talloc_tos(), struct svcctl_QueryServiceStatusEx);
3217 if (r == NULL) {
3218 return false;
3221 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3222 talloc_free(r);
3223 return false;
3226 pull = ndr_pull_init_blob(&blob, r, NULL);
3227 if (pull == NULL) {
3228 talloc_free(r);
3229 return false;
3232 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3233 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3234 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3235 talloc_free(r);
3236 return false;
3239 if (DEBUGLEVEL >= 10) {
3240 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, r);
3243 ZERO_STRUCT(r->out);
3244 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
3245 if (r->out.buffer == NULL) {
3246 talloc_free(r);
3247 return false;
3250 r->out.needed = talloc_zero(r, uint32_t);
3251 if (r->out.needed == NULL) {
3252 talloc_free(r);
3253 return false;
3256 r->out.result = _svcctl_QueryServiceStatusEx(p, r);
3258 if (p->rng_fault_state) {
3259 talloc_free(r);
3260 /* Return true here, srv_pipe_hnd.c will take care */
3261 return true;
3264 if (DEBUGLEVEL >= 10) {
3265 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, r);
3268 push = ndr_push_init_ctx(r, NULL);
3269 if (push == NULL) {
3270 talloc_free(r);
3271 return false;
3274 ndr_err = call->ndr_push(push, NDR_OUT, r);
3275 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3276 talloc_free(r);
3277 return false;
3280 blob = ndr_push_blob(push);
3281 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3282 talloc_free(r);
3283 return false;
3286 talloc_free(r);
3288 return true;
3291 static bool api_EnumServicesStatusExA(pipes_struct *p)
3293 const struct ndr_interface_call *call;
3294 struct ndr_pull *pull;
3295 struct ndr_push *push;
3296 enum ndr_err_code ndr_err;
3297 DATA_BLOB blob;
3298 struct EnumServicesStatusExA *r;
3300 call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXA];
3302 r = talloc(talloc_tos(), struct EnumServicesStatusExA);
3303 if (r == NULL) {
3304 return false;
3307 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3308 talloc_free(r);
3309 return false;
3312 pull = ndr_pull_init_blob(&blob, r, NULL);
3313 if (pull == NULL) {
3314 talloc_free(r);
3315 return false;
3318 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3319 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3320 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3321 talloc_free(r);
3322 return false;
3325 if (DEBUGLEVEL >= 10) {
3326 NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, r);
3329 ZERO_STRUCT(r->out);
3330 r->out.resume_handle = r->in.resume_handle;
3331 r->out.services = talloc_zero_array(r, uint8_t, r->in.offered);
3332 if (r->out.services == NULL) {
3333 talloc_free(r);
3334 return false;
3337 r->out.needed = talloc_zero(r, uint32_t);
3338 if (r->out.needed == NULL) {
3339 talloc_free(r);
3340 return false;
3343 r->out.service_returned = talloc_zero(r, uint32_t);
3344 if (r->out.service_returned == NULL) {
3345 talloc_free(r);
3346 return false;
3349 r->out.group_name = talloc_zero(r, const char *);
3350 if (r->out.group_name == NULL) {
3351 talloc_free(r);
3352 return false;
3355 r->out.result = _EnumServicesStatusExA(p, r);
3357 if (p->rng_fault_state) {
3358 talloc_free(r);
3359 /* Return true here, srv_pipe_hnd.c will take care */
3360 return true;
3363 if (DEBUGLEVEL >= 10) {
3364 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, r);
3367 push = ndr_push_init_ctx(r, NULL);
3368 if (push == NULL) {
3369 talloc_free(r);
3370 return false;
3373 ndr_err = call->ndr_push(push, NDR_OUT, r);
3374 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3375 talloc_free(r);
3376 return false;
3379 blob = ndr_push_blob(push);
3380 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3381 talloc_free(r);
3382 return false;
3385 talloc_free(r);
3387 return true;
3390 static bool api_EnumServicesStatusExW(pipes_struct *p)
3392 const struct ndr_interface_call *call;
3393 struct ndr_pull *pull;
3394 struct ndr_push *push;
3395 enum ndr_err_code ndr_err;
3396 DATA_BLOB blob;
3397 struct EnumServicesStatusExW *r;
3399 call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXW];
3401 r = talloc(talloc_tos(), struct EnumServicesStatusExW);
3402 if (r == NULL) {
3403 return false;
3406 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3407 talloc_free(r);
3408 return false;
3411 pull = ndr_pull_init_blob(&blob, r, NULL);
3412 if (pull == NULL) {
3413 talloc_free(r);
3414 return false;
3417 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3418 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3419 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3420 talloc_free(r);
3421 return false;
3424 if (DEBUGLEVEL >= 10) {
3425 NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, r);
3428 ZERO_STRUCT(r->out);
3429 r->out.resume_handle = r->in.resume_handle;
3430 r->out.services = talloc_zero_array(r, uint8_t, r->in.offered);
3431 if (r->out.services == NULL) {
3432 talloc_free(r);
3433 return false;
3436 r->out.needed = talloc_zero(r, uint32_t);
3437 if (r->out.needed == NULL) {
3438 talloc_free(r);
3439 return false;
3442 r->out.service_returned = talloc_zero(r, uint32_t);
3443 if (r->out.service_returned == NULL) {
3444 talloc_free(r);
3445 return false;
3448 r->out.result = _EnumServicesStatusExW(p, r);
3450 if (p->rng_fault_state) {
3451 talloc_free(r);
3452 /* Return true here, srv_pipe_hnd.c will take care */
3453 return true;
3456 if (DEBUGLEVEL >= 10) {
3457 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, r);
3460 push = ndr_push_init_ctx(r, NULL);
3461 if (push == NULL) {
3462 talloc_free(r);
3463 return false;
3466 ndr_err = call->ndr_push(push, NDR_OUT, r);
3467 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3468 talloc_free(r);
3469 return false;
3472 blob = ndr_push_blob(push);
3473 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3474 talloc_free(r);
3475 return false;
3478 talloc_free(r);
3480 return true;
3483 static bool api_svcctl_SCSendTSMessage(pipes_struct *p)
3485 const struct ndr_interface_call *call;
3486 struct ndr_pull *pull;
3487 struct ndr_push *push;
3488 enum ndr_err_code ndr_err;
3489 DATA_BLOB blob;
3490 struct svcctl_SCSendTSMessage *r;
3492 call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSENDTSMESSAGE];
3494 r = talloc(talloc_tos(), struct svcctl_SCSendTSMessage);
3495 if (r == NULL) {
3496 return false;
3499 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3500 talloc_free(r);
3501 return false;
3504 pull = ndr_pull_init_blob(&blob, r, NULL);
3505 if (pull == NULL) {
3506 talloc_free(r);
3507 return false;
3510 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3511 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3512 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3513 talloc_free(r);
3514 return false;
3517 if (DEBUGLEVEL >= 10) {
3518 NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, r);
3521 r->out.result = _svcctl_SCSendTSMessage(p, r);
3523 if (p->rng_fault_state) {
3524 talloc_free(r);
3525 /* Return true here, srv_pipe_hnd.c will take care */
3526 return true;
3529 if (DEBUGLEVEL >= 10) {
3530 NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, r);
3533 push = ndr_push_init_ctx(r, NULL);
3534 if (push == NULL) {
3535 talloc_free(r);
3536 return false;
3539 ndr_err = call->ndr_push(push, NDR_OUT, r);
3540 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3541 talloc_free(r);
3542 return false;
3545 blob = ndr_push_blob(push);
3546 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3547 talloc_free(r);
3548 return false;
3551 talloc_free(r);
3553 return true;
3557 /* Tables */
3558 static struct api_struct api_svcctl_cmds[] =
3560 {"SVCCTL_CLOSESERVICEHANDLE", NDR_SVCCTL_CLOSESERVICEHANDLE, api_svcctl_CloseServiceHandle},
3561 {"SVCCTL_CONTROLSERVICE", NDR_SVCCTL_CONTROLSERVICE, api_svcctl_ControlService},
3562 {"SVCCTL_DELETESERVICE", NDR_SVCCTL_DELETESERVICE, api_svcctl_DeleteService},
3563 {"SVCCTL_LOCKSERVICEDATABASE", NDR_SVCCTL_LOCKSERVICEDATABASE, api_svcctl_LockServiceDatabase},
3564 {"SVCCTL_QUERYSERVICEOBJECTSECURITY", NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, api_svcctl_QueryServiceObjectSecurity},
3565 {"SVCCTL_SETSERVICEOBJECTSECURITY", NDR_SVCCTL_SETSERVICEOBJECTSECURITY, api_svcctl_SetServiceObjectSecurity},
3566 {"SVCCTL_QUERYSERVICESTATUS", NDR_SVCCTL_QUERYSERVICESTATUS, api_svcctl_QueryServiceStatus},
3567 {"SVCCTL_SETSERVICESTATUS", NDR_SVCCTL_SETSERVICESTATUS, api_svcctl_SetServiceStatus},
3568 {"SVCCTL_UNLOCKSERVICEDATABASE", NDR_SVCCTL_UNLOCKSERVICEDATABASE, api_svcctl_UnlockServiceDatabase},
3569 {"SVCCTL_NOTIFYBOOTCONFIGSTATUS", NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS, api_svcctl_NotifyBootConfigStatus},
3570 {"SVCCTL_SCSETSERVICEBITSW", NDR_SVCCTL_SCSETSERVICEBITSW, api_svcctl_SCSetServiceBitsW},
3571 {"SVCCTL_CHANGESERVICECONFIGW", NDR_SVCCTL_CHANGESERVICECONFIGW, api_svcctl_ChangeServiceConfigW},
3572 {"SVCCTL_CREATESERVICEW", NDR_SVCCTL_CREATESERVICEW, api_svcctl_CreateServiceW},
3573 {"SVCCTL_ENUMDEPENDENTSERVICESW", NDR_SVCCTL_ENUMDEPENDENTSERVICESW, api_svcctl_EnumDependentServicesW},
3574 {"SVCCTL_ENUMSERVICESSTATUSW", NDR_SVCCTL_ENUMSERVICESSTATUSW, api_svcctl_EnumServicesStatusW},
3575 {"SVCCTL_OPENSCMANAGERW", NDR_SVCCTL_OPENSCMANAGERW, api_svcctl_OpenSCManagerW},
3576 {"SVCCTL_OPENSERVICEW", NDR_SVCCTL_OPENSERVICEW, api_svcctl_OpenServiceW},
3577 {"SVCCTL_QUERYSERVICECONFIGW", NDR_SVCCTL_QUERYSERVICECONFIGW, api_svcctl_QueryServiceConfigW},
3578 {"SVCCTL_QUERYSERVICELOCKSTATUSW", NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, api_svcctl_QueryServiceLockStatusW},
3579 {"SVCCTL_STARTSERVICEW", NDR_SVCCTL_STARTSERVICEW, api_svcctl_StartServiceW},
3580 {"SVCCTL_GETSERVICEDISPLAYNAMEW", NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, api_svcctl_GetServiceDisplayNameW},
3581 {"SVCCTL_GETSERVICEKEYNAMEW", NDR_SVCCTL_GETSERVICEKEYNAMEW, api_svcctl_GetServiceKeyNameW},
3582 {"SVCCTL_SCSETSERVICEBITSA", NDR_SVCCTL_SCSETSERVICEBITSA, api_svcctl_SCSetServiceBitsA},
3583 {"SVCCTL_CHANGESERVICECONFIGA", NDR_SVCCTL_CHANGESERVICECONFIGA, api_svcctl_ChangeServiceConfigA},
3584 {"SVCCTL_CREATESERVICEA", NDR_SVCCTL_CREATESERVICEA, api_svcctl_CreateServiceA},
3585 {"SVCCTL_ENUMDEPENDENTSERVICESA", NDR_SVCCTL_ENUMDEPENDENTSERVICESA, api_svcctl_EnumDependentServicesA},
3586 {"SVCCTL_ENUMSERVICESSTATUSA", NDR_SVCCTL_ENUMSERVICESSTATUSA, api_svcctl_EnumServicesStatusA},
3587 {"SVCCTL_OPENSCMANAGERA", NDR_SVCCTL_OPENSCMANAGERA, api_svcctl_OpenSCManagerA},
3588 {"SVCCTL_OPENSERVICEA", NDR_SVCCTL_OPENSERVICEA, api_svcctl_OpenServiceA},
3589 {"SVCCTL_QUERYSERVICECONFIGA", NDR_SVCCTL_QUERYSERVICECONFIGA, api_svcctl_QueryServiceConfigA},
3590 {"SVCCTL_QUERYSERVICELOCKSTATUSA", NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, api_svcctl_QueryServiceLockStatusA},
3591 {"SVCCTL_STARTSERVICEA", NDR_SVCCTL_STARTSERVICEA, api_svcctl_StartServiceA},
3592 {"SVCCTL_GETSERVICEDISPLAYNAMEA", NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, api_svcctl_GetServiceDisplayNameA},
3593 {"SVCCTL_GETSERVICEKEYNAMEA", NDR_SVCCTL_GETSERVICEKEYNAMEA, api_svcctl_GetServiceKeyNameA},
3594 {"SVCCTL_GETCURRENTGROUPESTATEW", NDR_SVCCTL_GETCURRENTGROUPESTATEW, api_svcctl_GetCurrentGroupeStateW},
3595 {"SVCCTL_ENUMSERVICEGROUPW", NDR_SVCCTL_ENUMSERVICEGROUPW, api_svcctl_EnumServiceGroupW},
3596 {"SVCCTL_CHANGESERVICECONFIG2A", NDR_SVCCTL_CHANGESERVICECONFIG2A, api_svcctl_ChangeServiceConfig2A},
3597 {"SVCCTL_CHANGESERVICECONFIG2W", NDR_SVCCTL_CHANGESERVICECONFIG2W, api_svcctl_ChangeServiceConfig2W},
3598 {"SVCCTL_QUERYSERVICECONFIG2A", NDR_SVCCTL_QUERYSERVICECONFIG2A, api_svcctl_QueryServiceConfig2A},
3599 {"SVCCTL_QUERYSERVICECONFIG2W", NDR_SVCCTL_QUERYSERVICECONFIG2W, api_svcctl_QueryServiceConfig2W},
3600 {"SVCCTL_QUERYSERVICESTATUSEX", NDR_SVCCTL_QUERYSERVICESTATUSEX, api_svcctl_QueryServiceStatusEx},
3601 {"ENUMSERVICESSTATUSEXA", NDR_ENUMSERVICESSTATUSEXA, api_EnumServicesStatusExA},
3602 {"ENUMSERVICESSTATUSEXW", NDR_ENUMSERVICESSTATUSEXW, api_EnumServicesStatusExW},
3603 {"SVCCTL_SCSENDTSMESSAGE", NDR_SVCCTL_SCSENDTSMESSAGE, api_svcctl_SCSendTSMessage},
3606 void svcctl_get_pipe_fns(struct api_struct **fns, int *n_fns)
3608 *fns = api_svcctl_cmds;
3609 *n_fns = sizeof(api_svcctl_cmds) / sizeof(struct api_struct);
3612 NTSTATUS rpc_svcctl_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
3614 if (cli->pipes_struct == NULL) {
3615 return NT_STATUS_INVALID_PARAMETER;
3618 switch (opnum)
3620 case NDR_SVCCTL_CLOSESERVICEHANDLE: {
3621 struct svcctl_CloseServiceHandle *r = (struct svcctl_CloseServiceHandle *)_r;
3622 ZERO_STRUCT(r->out);
3623 r->out.handle = r->in.handle;
3624 r->out.result = _svcctl_CloseServiceHandle(cli->pipes_struct, r);
3625 return NT_STATUS_OK;
3628 case NDR_SVCCTL_CONTROLSERVICE: {
3629 struct svcctl_ControlService *r = (struct svcctl_ControlService *)_r;
3630 ZERO_STRUCT(r->out);
3631 r->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
3632 if (r->out.service_status == NULL) {
3633 return NT_STATUS_NO_MEMORY;
3636 r->out.result = _svcctl_ControlService(cli->pipes_struct, r);
3637 return NT_STATUS_OK;
3640 case NDR_SVCCTL_DELETESERVICE: {
3641 struct svcctl_DeleteService *r = (struct svcctl_DeleteService *)_r;
3642 r->out.result = _svcctl_DeleteService(cli->pipes_struct, r);
3643 return NT_STATUS_OK;
3646 case NDR_SVCCTL_LOCKSERVICEDATABASE: {
3647 struct svcctl_LockServiceDatabase *r = (struct svcctl_LockServiceDatabase *)_r;
3648 ZERO_STRUCT(r->out);
3649 r->out.lock = talloc_zero(mem_ctx, struct policy_handle);
3650 if (r->out.lock == NULL) {
3651 return NT_STATUS_NO_MEMORY;
3654 r->out.result = _svcctl_LockServiceDatabase(cli->pipes_struct, r);
3655 return NT_STATUS_OK;
3658 case NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY: {
3659 struct svcctl_QueryServiceObjectSecurity *r = (struct svcctl_QueryServiceObjectSecurity *)_r;
3660 ZERO_STRUCT(r->out);
3661 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
3662 if (r->out.buffer == NULL) {
3663 return NT_STATUS_NO_MEMORY;
3666 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3667 if (r->out.needed == NULL) {
3668 return NT_STATUS_NO_MEMORY;
3671 r->out.result = _svcctl_QueryServiceObjectSecurity(cli->pipes_struct, r);
3672 return NT_STATUS_OK;
3675 case NDR_SVCCTL_SETSERVICEOBJECTSECURITY: {
3676 struct svcctl_SetServiceObjectSecurity *r = (struct svcctl_SetServiceObjectSecurity *)_r;
3677 r->out.result = _svcctl_SetServiceObjectSecurity(cli->pipes_struct, r);
3678 return NT_STATUS_OK;
3681 case NDR_SVCCTL_QUERYSERVICESTATUS: {
3682 struct svcctl_QueryServiceStatus *r = (struct svcctl_QueryServiceStatus *)_r;
3683 ZERO_STRUCT(r->out);
3684 r->out.service_status = talloc_zero(mem_ctx, struct SERVICE_STATUS);
3685 if (r->out.service_status == NULL) {
3686 return NT_STATUS_NO_MEMORY;
3689 r->out.result = _svcctl_QueryServiceStatus(cli->pipes_struct, r);
3690 return NT_STATUS_OK;
3693 case NDR_SVCCTL_SETSERVICESTATUS: {
3694 struct svcctl_SetServiceStatus *r = (struct svcctl_SetServiceStatus *)_r;
3695 r->out.result = _svcctl_SetServiceStatus(cli->pipes_struct, r);
3696 return NT_STATUS_OK;
3699 case NDR_SVCCTL_UNLOCKSERVICEDATABASE: {
3700 struct svcctl_UnlockServiceDatabase *r = (struct svcctl_UnlockServiceDatabase *)_r;
3701 ZERO_STRUCT(r->out);
3702 r->out.lock = r->in.lock;
3703 r->out.result = _svcctl_UnlockServiceDatabase(cli->pipes_struct, r);
3704 return NT_STATUS_OK;
3707 case NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS: {
3708 struct svcctl_NotifyBootConfigStatus *r = (struct svcctl_NotifyBootConfigStatus *)_r;
3709 r->out.result = _svcctl_NotifyBootConfigStatus(cli->pipes_struct, r);
3710 return NT_STATUS_OK;
3713 case NDR_SVCCTL_SCSETSERVICEBITSW: {
3714 struct svcctl_SCSetServiceBitsW *r = (struct svcctl_SCSetServiceBitsW *)_r;
3715 r->out.result = _svcctl_SCSetServiceBitsW(cli->pipes_struct, r);
3716 return NT_STATUS_OK;
3719 case NDR_SVCCTL_CHANGESERVICECONFIGW: {
3720 struct svcctl_ChangeServiceConfigW *r = (struct svcctl_ChangeServiceConfigW *)_r;
3721 ZERO_STRUCT(r->out);
3722 r->out.tag_id = talloc_zero(mem_ctx, uint32_t);
3723 if (r->out.tag_id == NULL) {
3724 return NT_STATUS_NO_MEMORY;
3727 r->out.result = _svcctl_ChangeServiceConfigW(cli->pipes_struct, r);
3728 return NT_STATUS_OK;
3731 case NDR_SVCCTL_CREATESERVICEW: {
3732 struct svcctl_CreateServiceW *r = (struct svcctl_CreateServiceW *)_r;
3733 ZERO_STRUCT(r->out);
3734 r->out.TagId = r->in.TagId;
3735 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3736 if (r->out.handle == NULL) {
3737 return NT_STATUS_NO_MEMORY;
3740 r->out.result = _svcctl_CreateServiceW(cli->pipes_struct, r);
3741 return NT_STATUS_OK;
3744 case NDR_SVCCTL_ENUMDEPENDENTSERVICESW: {
3745 struct svcctl_EnumDependentServicesW *r = (struct svcctl_EnumDependentServicesW *)_r;
3746 ZERO_STRUCT(r->out);
3747 r->out.service_status = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
3748 if (r->out.service_status == NULL) {
3749 return NT_STATUS_NO_MEMORY;
3752 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3753 if (r->out.needed == NULL) {
3754 return NT_STATUS_NO_MEMORY;
3757 r->out.services_returned = talloc_zero(mem_ctx, uint32_t);
3758 if (r->out.services_returned == NULL) {
3759 return NT_STATUS_NO_MEMORY;
3762 r->out.result = _svcctl_EnumDependentServicesW(cli->pipes_struct, r);
3763 return NT_STATUS_OK;
3766 case NDR_SVCCTL_ENUMSERVICESSTATUSW: {
3767 struct svcctl_EnumServicesStatusW *r = (struct svcctl_EnumServicesStatusW *)_r;
3768 ZERO_STRUCT(r->out);
3769 r->out.resume_handle = r->in.resume_handle;
3770 r->out.service = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
3771 if (r->out.service == NULL) {
3772 return NT_STATUS_NO_MEMORY;
3775 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3776 if (r->out.needed == NULL) {
3777 return NT_STATUS_NO_MEMORY;
3780 r->out.services_returned = talloc_zero(mem_ctx, uint32_t);
3781 if (r->out.services_returned == NULL) {
3782 return NT_STATUS_NO_MEMORY;
3785 r->out.result = _svcctl_EnumServicesStatusW(cli->pipes_struct, r);
3786 return NT_STATUS_OK;
3789 case NDR_SVCCTL_OPENSCMANAGERW: {
3790 struct svcctl_OpenSCManagerW *r = (struct svcctl_OpenSCManagerW *)_r;
3791 ZERO_STRUCT(r->out);
3792 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3793 if (r->out.handle == NULL) {
3794 return NT_STATUS_NO_MEMORY;
3797 r->out.result = _svcctl_OpenSCManagerW(cli->pipes_struct, r);
3798 return NT_STATUS_OK;
3801 case NDR_SVCCTL_OPENSERVICEW: {
3802 struct svcctl_OpenServiceW *r = (struct svcctl_OpenServiceW *)_r;
3803 ZERO_STRUCT(r->out);
3804 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3805 if (r->out.handle == NULL) {
3806 return NT_STATUS_NO_MEMORY;
3809 r->out.result = _svcctl_OpenServiceW(cli->pipes_struct, r);
3810 return NT_STATUS_OK;
3813 case NDR_SVCCTL_QUERYSERVICECONFIGW: {
3814 struct svcctl_QueryServiceConfigW *r = (struct svcctl_QueryServiceConfigW *)_r;
3815 ZERO_STRUCT(r->out);
3816 r->out.query = talloc_zero(mem_ctx, struct QUERY_SERVICE_CONFIG);
3817 if (r->out.query == NULL) {
3818 return NT_STATUS_NO_MEMORY;
3821 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3822 if (r->out.needed == NULL) {
3823 return NT_STATUS_NO_MEMORY;
3826 r->out.result = _svcctl_QueryServiceConfigW(cli->pipes_struct, r);
3827 return NT_STATUS_OK;
3830 case NDR_SVCCTL_QUERYSERVICELOCKSTATUSW: {
3831 struct svcctl_QueryServiceLockStatusW *r = (struct svcctl_QueryServiceLockStatusW *)_r;
3832 ZERO_STRUCT(r->out);
3833 r->out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
3834 if (r->out.lock_status == NULL) {
3835 return NT_STATUS_NO_MEMORY;
3838 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3839 if (r->out.needed == NULL) {
3840 return NT_STATUS_NO_MEMORY;
3843 r->out.result = _svcctl_QueryServiceLockStatusW(cli->pipes_struct, r);
3844 return NT_STATUS_OK;
3847 case NDR_SVCCTL_STARTSERVICEW: {
3848 struct svcctl_StartServiceW *r = (struct svcctl_StartServiceW *)_r;
3849 r->out.result = _svcctl_StartServiceW(cli->pipes_struct, r);
3850 return NT_STATUS_OK;
3853 case NDR_SVCCTL_GETSERVICEDISPLAYNAMEW: {
3854 struct svcctl_GetServiceDisplayNameW *r = (struct svcctl_GetServiceDisplayNameW *)_r;
3855 ZERO_STRUCT(r->out);
3856 r->out.display_name_length = r->in.display_name_length;
3857 r->out.display_name = talloc_zero(mem_ctx, const char *);
3858 if (r->out.display_name == NULL) {
3859 return NT_STATUS_NO_MEMORY;
3862 r->out.result = _svcctl_GetServiceDisplayNameW(cli->pipes_struct, r);
3863 return NT_STATUS_OK;
3866 case NDR_SVCCTL_GETSERVICEKEYNAMEW: {
3867 struct svcctl_GetServiceKeyNameW *r = (struct svcctl_GetServiceKeyNameW *)_r;
3868 ZERO_STRUCT(r->out);
3869 r->out.display_name_length = r->in.display_name_length;
3870 r->out.key_name = talloc_zero(mem_ctx, const char *);
3871 if (r->out.key_name == NULL) {
3872 return NT_STATUS_NO_MEMORY;
3875 r->out.result = _svcctl_GetServiceKeyNameW(cli->pipes_struct, r);
3876 return NT_STATUS_OK;
3879 case NDR_SVCCTL_SCSETSERVICEBITSA: {
3880 struct svcctl_SCSetServiceBitsA *r = (struct svcctl_SCSetServiceBitsA *)_r;
3881 r->out.result = _svcctl_SCSetServiceBitsA(cli->pipes_struct, r);
3882 return NT_STATUS_OK;
3885 case NDR_SVCCTL_CHANGESERVICECONFIGA: {
3886 struct svcctl_ChangeServiceConfigA *r = (struct svcctl_ChangeServiceConfigA *)_r;
3887 ZERO_STRUCT(r->out);
3888 r->out.tag_id = talloc_zero(mem_ctx, uint32_t);
3889 if (r->out.tag_id == NULL) {
3890 return NT_STATUS_NO_MEMORY;
3893 r->out.result = _svcctl_ChangeServiceConfigA(cli->pipes_struct, r);
3894 return NT_STATUS_OK;
3897 case NDR_SVCCTL_CREATESERVICEA: {
3898 struct svcctl_CreateServiceA *r = (struct svcctl_CreateServiceA *)_r;
3899 ZERO_STRUCT(r->out);
3900 r->out.TagId = talloc_zero(mem_ctx, uint32_t);
3901 if (r->out.TagId == NULL) {
3902 return NT_STATUS_NO_MEMORY;
3905 r->out.result = _svcctl_CreateServiceA(cli->pipes_struct, r);
3906 return NT_STATUS_OK;
3909 case NDR_SVCCTL_ENUMDEPENDENTSERVICESA: {
3910 struct svcctl_EnumDependentServicesA *r = (struct svcctl_EnumDependentServicesA *)_r;
3911 ZERO_STRUCT(r->out);
3912 r->out.service_status = talloc_zero(mem_ctx, struct ENUM_SERVICE_STATUSA);
3913 if (r->out.service_status == NULL) {
3914 return NT_STATUS_NO_MEMORY;
3917 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3918 if (r->out.needed == NULL) {
3919 return NT_STATUS_NO_MEMORY;
3922 r->out.services_returned = talloc_zero(mem_ctx, uint32_t);
3923 if (r->out.services_returned == NULL) {
3924 return NT_STATUS_NO_MEMORY;
3927 r->out.result = _svcctl_EnumDependentServicesA(cli->pipes_struct, r);
3928 return NT_STATUS_OK;
3931 case NDR_SVCCTL_ENUMSERVICESSTATUSA: {
3932 struct svcctl_EnumServicesStatusA *r = (struct svcctl_EnumServicesStatusA *)_r;
3933 ZERO_STRUCT(r->out);
3934 r->out.resume_handle = r->in.resume_handle;
3935 r->out.service = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
3936 if (r->out.service == NULL) {
3937 return NT_STATUS_NO_MEMORY;
3940 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3941 if (r->out.needed == NULL) {
3942 return NT_STATUS_NO_MEMORY;
3945 r->out.services_returned = talloc_zero(mem_ctx, uint32_t);
3946 if (r->out.services_returned == NULL) {
3947 return NT_STATUS_NO_MEMORY;
3950 r->out.result = _svcctl_EnumServicesStatusA(cli->pipes_struct, r);
3951 return NT_STATUS_OK;
3954 case NDR_SVCCTL_OPENSCMANAGERA: {
3955 struct svcctl_OpenSCManagerA *r = (struct svcctl_OpenSCManagerA *)_r;
3956 ZERO_STRUCT(r->out);
3957 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3958 if (r->out.handle == NULL) {
3959 return NT_STATUS_NO_MEMORY;
3962 r->out.result = _svcctl_OpenSCManagerA(cli->pipes_struct, r);
3963 return NT_STATUS_OK;
3966 case NDR_SVCCTL_OPENSERVICEA: {
3967 struct svcctl_OpenServiceA *r = (struct svcctl_OpenServiceA *)_r;
3968 r->out.result = _svcctl_OpenServiceA(cli->pipes_struct, r);
3969 return NT_STATUS_OK;
3972 case NDR_SVCCTL_QUERYSERVICECONFIGA: {
3973 struct svcctl_QueryServiceConfigA *r = (struct svcctl_QueryServiceConfigA *)_r;
3974 ZERO_STRUCT(r->out);
3975 r->out.query = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
3976 if (r->out.query == NULL) {
3977 return NT_STATUS_NO_MEMORY;
3980 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3981 if (r->out.needed == NULL) {
3982 return NT_STATUS_NO_MEMORY;
3985 r->out.result = _svcctl_QueryServiceConfigA(cli->pipes_struct, r);
3986 return NT_STATUS_OK;
3989 case NDR_SVCCTL_QUERYSERVICELOCKSTATUSA: {
3990 struct svcctl_QueryServiceLockStatusA *r = (struct svcctl_QueryServiceLockStatusA *)_r;
3991 ZERO_STRUCT(r->out);
3992 r->out.lock_status = talloc_zero(mem_ctx, struct SERVICE_LOCK_STATUS);
3993 if (r->out.lock_status == NULL) {
3994 return NT_STATUS_NO_MEMORY;
3997 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3998 if (r->out.needed == NULL) {
3999 return NT_STATUS_NO_MEMORY;
4002 r->out.result = _svcctl_QueryServiceLockStatusA(cli->pipes_struct, r);
4003 return NT_STATUS_OK;
4006 case NDR_SVCCTL_STARTSERVICEA: {
4007 struct svcctl_StartServiceA *r = (struct svcctl_StartServiceA *)_r;
4008 r->out.result = _svcctl_StartServiceA(cli->pipes_struct, r);
4009 return NT_STATUS_OK;
4012 case NDR_SVCCTL_GETSERVICEDISPLAYNAMEA: {
4013 struct svcctl_GetServiceDisplayNameA *r = (struct svcctl_GetServiceDisplayNameA *)_r;
4014 ZERO_STRUCT(r->out);
4015 r->out.display_name_length = r->in.display_name_length;
4016 r->out.display_name = talloc_zero(mem_ctx, const char *);
4017 if (r->out.display_name == NULL) {
4018 return NT_STATUS_NO_MEMORY;
4021 r->out.result = _svcctl_GetServiceDisplayNameA(cli->pipes_struct, r);
4022 return NT_STATUS_OK;
4025 case NDR_SVCCTL_GETSERVICEKEYNAMEA: {
4026 struct svcctl_GetServiceKeyNameA *r = (struct svcctl_GetServiceKeyNameA *)_r;
4027 ZERO_STRUCT(r->out);
4028 r->out.display_name_length = r->in.display_name_length;
4029 r->out.key_name = talloc_zero(mem_ctx, const char *);
4030 if (r->out.key_name == NULL) {
4031 return NT_STATUS_NO_MEMORY;
4034 r->out.result = _svcctl_GetServiceKeyNameA(cli->pipes_struct, r);
4035 return NT_STATUS_OK;
4038 case NDR_SVCCTL_GETCURRENTGROUPESTATEW: {
4039 struct svcctl_GetCurrentGroupeStateW *r = (struct svcctl_GetCurrentGroupeStateW *)_r;
4040 r->out.result = _svcctl_GetCurrentGroupeStateW(cli->pipes_struct, r);
4041 return NT_STATUS_OK;
4044 case NDR_SVCCTL_ENUMSERVICEGROUPW: {
4045 struct svcctl_EnumServiceGroupW *r = (struct svcctl_EnumServiceGroupW *)_r;
4046 r->out.result = _svcctl_EnumServiceGroupW(cli->pipes_struct, r);
4047 return NT_STATUS_OK;
4050 case NDR_SVCCTL_CHANGESERVICECONFIG2A: {
4051 struct svcctl_ChangeServiceConfig2A *r = (struct svcctl_ChangeServiceConfig2A *)_r;
4052 r->out.result = _svcctl_ChangeServiceConfig2A(cli->pipes_struct, r);
4053 return NT_STATUS_OK;
4056 case NDR_SVCCTL_CHANGESERVICECONFIG2W: {
4057 struct svcctl_ChangeServiceConfig2W *r = (struct svcctl_ChangeServiceConfig2W *)_r;
4058 r->out.result = _svcctl_ChangeServiceConfig2W(cli->pipes_struct, r);
4059 return NT_STATUS_OK;
4062 case NDR_SVCCTL_QUERYSERVICECONFIG2A: {
4063 struct svcctl_QueryServiceConfig2A *r = (struct svcctl_QueryServiceConfig2A *)_r;
4064 ZERO_STRUCT(r->out);
4065 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
4066 if (r->out.buffer == NULL) {
4067 return NT_STATUS_NO_MEMORY;
4070 r->out.needed = talloc_zero(mem_ctx, uint32_t);
4071 if (r->out.needed == NULL) {
4072 return NT_STATUS_NO_MEMORY;
4075 r->out.result = _svcctl_QueryServiceConfig2A(cli->pipes_struct, r);
4076 return NT_STATUS_OK;
4079 case NDR_SVCCTL_QUERYSERVICECONFIG2W: {
4080 struct svcctl_QueryServiceConfig2W *r = (struct svcctl_QueryServiceConfig2W *)_r;
4081 ZERO_STRUCT(r->out);
4082 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
4083 if (r->out.buffer == NULL) {
4084 return NT_STATUS_NO_MEMORY;
4087 r->out.needed = talloc_zero(mem_ctx, uint32_t);
4088 if (r->out.needed == NULL) {
4089 return NT_STATUS_NO_MEMORY;
4092 r->out.result = _svcctl_QueryServiceConfig2W(cli->pipes_struct, r);
4093 return NT_STATUS_OK;
4096 case NDR_SVCCTL_QUERYSERVICESTATUSEX: {
4097 struct svcctl_QueryServiceStatusEx *r = (struct svcctl_QueryServiceStatusEx *)_r;
4098 ZERO_STRUCT(r->out);
4099 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
4100 if (r->out.buffer == NULL) {
4101 return NT_STATUS_NO_MEMORY;
4104 r->out.needed = talloc_zero(mem_ctx, uint32_t);
4105 if (r->out.needed == NULL) {
4106 return NT_STATUS_NO_MEMORY;
4109 r->out.result = _svcctl_QueryServiceStatusEx(cli->pipes_struct, r);
4110 return NT_STATUS_OK;
4113 case NDR_ENUMSERVICESSTATUSEXA: {
4114 struct EnumServicesStatusExA *r = (struct EnumServicesStatusExA *)_r;
4115 ZERO_STRUCT(r->out);
4116 r->out.resume_handle = r->in.resume_handle;
4117 r->out.services = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
4118 if (r->out.services == NULL) {
4119 return NT_STATUS_NO_MEMORY;
4122 r->out.needed = talloc_zero(mem_ctx, uint32_t);
4123 if (r->out.needed == NULL) {
4124 return NT_STATUS_NO_MEMORY;
4127 r->out.service_returned = talloc_zero(mem_ctx, uint32_t);
4128 if (r->out.service_returned == NULL) {
4129 return NT_STATUS_NO_MEMORY;
4132 r->out.group_name = talloc_zero(mem_ctx, const char *);
4133 if (r->out.group_name == NULL) {
4134 return NT_STATUS_NO_MEMORY;
4137 r->out.result = _EnumServicesStatusExA(cli->pipes_struct, r);
4138 return NT_STATUS_OK;
4141 case NDR_ENUMSERVICESSTATUSEXW: {
4142 struct EnumServicesStatusExW *r = (struct EnumServicesStatusExW *)_r;
4143 ZERO_STRUCT(r->out);
4144 r->out.resume_handle = r->in.resume_handle;
4145 r->out.services = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
4146 if (r->out.services == NULL) {
4147 return NT_STATUS_NO_MEMORY;
4150 r->out.needed = talloc_zero(mem_ctx, uint32_t);
4151 if (r->out.needed == NULL) {
4152 return NT_STATUS_NO_MEMORY;
4155 r->out.service_returned = talloc_zero(mem_ctx, uint32_t);
4156 if (r->out.service_returned == NULL) {
4157 return NT_STATUS_NO_MEMORY;
4160 r->out.result = _EnumServicesStatusExW(cli->pipes_struct, r);
4161 return NT_STATUS_OK;
4164 case NDR_SVCCTL_SCSENDTSMESSAGE: {
4165 struct svcctl_SCSendTSMessage *r = (struct svcctl_SCSendTSMessage *)_r;
4166 r->out.result = _svcctl_SCSendTSMessage(cli->pipes_struct, r);
4167 return NT_STATUS_OK;
4170 default:
4171 return NT_STATUS_NOT_IMPLEMENTED;
4175 NTSTATUS rpc_svcctl_init(void)
4177 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "svcctl", "svcctl", &ndr_table_svcctl, api_svcctl_cmds, sizeof(api_svcctl_cmds) / sizeof(struct api_struct));