1d4719858ddfc9a88a573cf788fd96d8d6a1152b
[sfrench/samba-autobuild/.git] / source / librpc / gen_ndr / srv_svcctl.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_svcctl.h"
8
9 static bool api_svcctl_CloseServiceHandle(pipes_struct *p)
10 {
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;
17         
18         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CLOSESERVICEHANDLE];
19         
20         r = talloc(NULL, struct svcctl_CloseServiceHandle);
21         if (r == NULL) {
22                 return False;
23         }
24         
25         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26                 talloc_free(r);
27                 return False;
28         }
29         
30         pull = ndr_pull_init_blob(&blob, r);
31         if (pull == NULL) {
32                 talloc_free(r);
33                 return False;
34         }
35         
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;
41         }
42         
43         if (DEBUGLEVEL >= 10)
44                 NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, r);
45         
46         ZERO_STRUCT(r->out);
47         r->out.handle = r->in.handle;
48         r->out.result = _svcctl_CloseServiceHandle(p, r);
49         
50         if (p->rng_fault_state) {
51                 talloc_free(r);
52                 /* Return True here, srv_pipe_hnd.c will take care */
53                 return True;
54         }
55         
56         if (DEBUGLEVEL >= 10)
57                 NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, r);
58         
59         push = ndr_push_init_ctx(r);
60         if (push == NULL) {
61                 talloc_free(r);
62                 return False;
63         }
64         
65         ndr_err = call->ndr_push(push, NDR_OUT, r);
66         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
67                 talloc_free(r);
68                 return False;
69         }
70         
71         blob = ndr_push_blob(push);
72         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
73                 talloc_free(r);
74                 return False;
75         }
76         
77         talloc_free(r);
78         
79         return True;
80 }
81
82 static bool api_svcctl_ControlService(pipes_struct *p)
83 {
84         const struct ndr_interface_call *call;
85         struct ndr_pull *pull;
86         struct ndr_push *push;
87         enum ndr_err_code ndr_err;
88         DATA_BLOB blob;
89         struct svcctl_ControlService *r;
90         
91         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CONTROLSERVICE];
92         
93         r = talloc(NULL, struct svcctl_ControlService);
94         if (r == NULL) {
95                 return False;
96         }
97         
98         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
99                 talloc_free(r);
100                 return False;
101         }
102         
103         pull = ndr_pull_init_blob(&blob, r);
104         if (pull == NULL) {
105                 talloc_free(r);
106                 return False;
107         }
108         
109         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
110         ndr_err = call->ndr_pull(pull, NDR_IN, r);
111         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
112                 talloc_free(r);
113                 return False;
114         }
115         
116         if (DEBUGLEVEL >= 10)
117                 NDR_PRINT_IN_DEBUG(svcctl_ControlService, r);
118         
119         ZERO_STRUCT(r->out);
120         r->out.service_status = talloc_zero(r, struct SERVICE_STATUS);
121         if (r->out.service_status == NULL) {
122                 talloc_free(r);
123                 return False;
124         }
125         
126         r->out.result = _svcctl_ControlService(p, r);
127         
128         if (p->rng_fault_state) {
129                 talloc_free(r);
130                 /* Return True here, srv_pipe_hnd.c will take care */
131                 return True;
132         }
133         
134         if (DEBUGLEVEL >= 10)
135                 NDR_PRINT_OUT_DEBUG(svcctl_ControlService, r);
136         
137         push = ndr_push_init_ctx(r);
138         if (push == NULL) {
139                 talloc_free(r);
140                 return False;
141         }
142         
143         ndr_err = call->ndr_push(push, NDR_OUT, r);
144         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
145                 talloc_free(r);
146                 return False;
147         }
148         
149         blob = ndr_push_blob(push);
150         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
151                 talloc_free(r);
152                 return False;
153         }
154         
155         talloc_free(r);
156         
157         return True;
158 }
159
160 static bool api_svcctl_DeleteService(pipes_struct *p)
161 {
162         const struct ndr_interface_call *call;
163         struct ndr_pull *pull;
164         struct ndr_push *push;
165         enum ndr_err_code ndr_err;
166         DATA_BLOB blob;
167         struct svcctl_DeleteService *r;
168         
169         call = &ndr_table_svcctl.calls[NDR_SVCCTL_DELETESERVICE];
170         
171         r = talloc(NULL, struct svcctl_DeleteService);
172         if (r == NULL) {
173                 return False;
174         }
175         
176         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
177                 talloc_free(r);
178                 return False;
179         }
180         
181         pull = ndr_pull_init_blob(&blob, r);
182         if (pull == NULL) {
183                 talloc_free(r);
184                 return False;
185         }
186         
187         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
188         ndr_err = call->ndr_pull(pull, NDR_IN, r);
189         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
190                 talloc_free(r);
191                 return False;
192         }
193         
194         if (DEBUGLEVEL >= 10)
195                 NDR_PRINT_IN_DEBUG(svcctl_DeleteService, r);
196         
197         r->out.result = _svcctl_DeleteService(p, r);
198         
199         if (p->rng_fault_state) {
200                 talloc_free(r);
201                 /* Return True here, srv_pipe_hnd.c will take care */
202                 return True;
203         }
204         
205         if (DEBUGLEVEL >= 10)
206                 NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, r);
207         
208         push = ndr_push_init_ctx(r);
209         if (push == NULL) {
210                 talloc_free(r);
211                 return False;
212         }
213         
214         ndr_err = call->ndr_push(push, NDR_OUT, r);
215         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
216                 talloc_free(r);
217                 return False;
218         }
219         
220         blob = ndr_push_blob(push);
221         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
222                 talloc_free(r);
223                 return False;
224         }
225         
226         talloc_free(r);
227         
228         return True;
229 }
230
231 static bool api_svcctl_LockServiceDatabase(pipes_struct *p)
232 {
233         const struct ndr_interface_call *call;
234         struct ndr_pull *pull;
235         struct ndr_push *push;
236         enum ndr_err_code ndr_err;
237         DATA_BLOB blob;
238         struct svcctl_LockServiceDatabase *r;
239         
240         call = &ndr_table_svcctl.calls[NDR_SVCCTL_LOCKSERVICEDATABASE];
241         
242         r = talloc(NULL, struct svcctl_LockServiceDatabase);
243         if (r == NULL) {
244                 return False;
245         }
246         
247         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
248                 talloc_free(r);
249                 return False;
250         }
251         
252         pull = ndr_pull_init_blob(&blob, r);
253         if (pull == NULL) {
254                 talloc_free(r);
255                 return False;
256         }
257         
258         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
259         ndr_err = call->ndr_pull(pull, NDR_IN, r);
260         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
261                 talloc_free(r);
262                 return False;
263         }
264         
265         if (DEBUGLEVEL >= 10)
266                 NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, r);
267         
268         ZERO_STRUCT(r->out);
269         r->out.lock = talloc_zero(r, struct policy_handle);
270         if (r->out.lock == NULL) {
271                 talloc_free(r);
272                 return False;
273         }
274         
275         r->out.result = _svcctl_LockServiceDatabase(p, r);
276         
277         if (p->rng_fault_state) {
278                 talloc_free(r);
279                 /* Return True here, srv_pipe_hnd.c will take care */
280                 return True;
281         }
282         
283         if (DEBUGLEVEL >= 10)
284                 NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, r);
285         
286         push = ndr_push_init_ctx(r);
287         if (push == NULL) {
288                 talloc_free(r);
289                 return False;
290         }
291         
292         ndr_err = call->ndr_push(push, NDR_OUT, r);
293         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
294                 talloc_free(r);
295                 return False;
296         }
297         
298         blob = ndr_push_blob(push);
299         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
300                 talloc_free(r);
301                 return False;
302         }
303         
304         talloc_free(r);
305         
306         return True;
307 }
308
309 static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p)
310 {
311         const struct ndr_interface_call *call;
312         struct ndr_pull *pull;
313         struct ndr_push *push;
314         enum ndr_err_code ndr_err;
315         DATA_BLOB blob;
316         struct svcctl_QueryServiceObjectSecurity *r;
317         
318         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY];
319         
320         r = talloc(NULL, struct svcctl_QueryServiceObjectSecurity);
321         if (r == NULL) {
322                 return False;
323         }
324         
325         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
326                 talloc_free(r);
327                 return False;
328         }
329         
330         pull = ndr_pull_init_blob(&blob, r);
331         if (pull == NULL) {
332                 talloc_free(r);
333                 return False;
334         }
335         
336         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
337         ndr_err = call->ndr_pull(pull, NDR_IN, r);
338         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
339                 talloc_free(r);
340                 return False;
341         }
342         
343         if (DEBUGLEVEL >= 10)
344                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, r);
345         
346         r->out.result = _svcctl_QueryServiceObjectSecurity(p, r);
347         
348         if (p->rng_fault_state) {
349                 talloc_free(r);
350                 /* Return True here, srv_pipe_hnd.c will take care */
351                 return True;
352         }
353         
354         if (DEBUGLEVEL >= 10)
355                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, r);
356         
357         push = ndr_push_init_ctx(r);
358         if (push == NULL) {
359                 talloc_free(r);
360                 return False;
361         }
362         
363         ndr_err = call->ndr_push(push, NDR_OUT, r);
364         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
365                 talloc_free(r);
366                 return False;
367         }
368         
369         blob = ndr_push_blob(push);
370         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
371                 talloc_free(r);
372                 return False;
373         }
374         
375         talloc_free(r);
376         
377         return True;
378 }
379
380 static bool api_svcctl_SetServiceObjectSecurity(pipes_struct *p)
381 {
382         const struct ndr_interface_call *call;
383         struct ndr_pull *pull;
384         struct ndr_push *push;
385         enum ndr_err_code ndr_err;
386         DATA_BLOB blob;
387         struct svcctl_SetServiceObjectSecurity *r;
388         
389         call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICEOBJECTSECURITY];
390         
391         r = talloc(NULL, struct svcctl_SetServiceObjectSecurity);
392         if (r == NULL) {
393                 return False;
394         }
395         
396         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
397                 talloc_free(r);
398                 return False;
399         }
400         
401         pull = ndr_pull_init_blob(&blob, r);
402         if (pull == NULL) {
403                 talloc_free(r);
404                 return False;
405         }
406         
407         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
408         ndr_err = call->ndr_pull(pull, NDR_IN, r);
409         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
410                 talloc_free(r);
411                 return False;
412         }
413         
414         if (DEBUGLEVEL >= 10)
415                 NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, r);
416         
417         r->out.result = _svcctl_SetServiceObjectSecurity(p, r);
418         
419         if (p->rng_fault_state) {
420                 talloc_free(r);
421                 /* Return True here, srv_pipe_hnd.c will take care */
422                 return True;
423         }
424         
425         if (DEBUGLEVEL >= 10)
426                 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, r);
427         
428         push = ndr_push_init_ctx(r);
429         if (push == NULL) {
430                 talloc_free(r);
431                 return False;
432         }
433         
434         ndr_err = call->ndr_push(push, NDR_OUT, r);
435         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
436                 talloc_free(r);
437                 return False;
438         }
439         
440         blob = ndr_push_blob(push);
441         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
442                 talloc_free(r);
443                 return False;
444         }
445         
446         talloc_free(r);
447         
448         return True;
449 }
450
451 static bool api_svcctl_QueryServiceStatus(pipes_struct *p)
452 {
453         const struct ndr_interface_call *call;
454         struct ndr_pull *pull;
455         struct ndr_push *push;
456         enum ndr_err_code ndr_err;
457         DATA_BLOB blob;
458         struct svcctl_QueryServiceStatus *r;
459         
460         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUS];
461         
462         r = talloc(NULL, struct svcctl_QueryServiceStatus);
463         if (r == NULL) {
464                 return False;
465         }
466         
467         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
468                 talloc_free(r);
469                 return False;
470         }
471         
472         pull = ndr_pull_init_blob(&blob, r);
473         if (pull == NULL) {
474                 talloc_free(r);
475                 return False;
476         }
477         
478         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
479         ndr_err = call->ndr_pull(pull, NDR_IN, r);
480         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
481                 talloc_free(r);
482                 return False;
483         }
484         
485         if (DEBUGLEVEL >= 10)
486                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, r);
487         
488         ZERO_STRUCT(r->out);
489         r->out.service_status = talloc_zero(r, struct SERVICE_STATUS);
490         if (r->out.service_status == NULL) {
491                 talloc_free(r);
492                 return False;
493         }
494         
495         r->out.result = _svcctl_QueryServiceStatus(p, r);
496         
497         if (p->rng_fault_state) {
498                 talloc_free(r);
499                 /* Return True here, srv_pipe_hnd.c will take care */
500                 return True;
501         }
502         
503         if (DEBUGLEVEL >= 10)
504                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, r);
505         
506         push = ndr_push_init_ctx(r);
507         if (push == NULL) {
508                 talloc_free(r);
509                 return False;
510         }
511         
512         ndr_err = call->ndr_push(push, NDR_OUT, r);
513         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
514                 talloc_free(r);
515                 return False;
516         }
517         
518         blob = ndr_push_blob(push);
519         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
520                 talloc_free(r);
521                 return False;
522         }
523         
524         talloc_free(r);
525         
526         return True;
527 }
528
529 static bool api_svcctl_SetServiceStatus(pipes_struct *p)
530 {
531         const struct ndr_interface_call *call;
532         struct ndr_pull *pull;
533         struct ndr_push *push;
534         enum ndr_err_code ndr_err;
535         DATA_BLOB blob;
536         struct svcctl_SetServiceStatus *r;
537         
538         call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICESTATUS];
539         
540         r = talloc(NULL, struct svcctl_SetServiceStatus);
541         if (r == NULL) {
542                 return False;
543         }
544         
545         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
546                 talloc_free(r);
547                 return False;
548         }
549         
550         pull = ndr_pull_init_blob(&blob, r);
551         if (pull == NULL) {
552                 talloc_free(r);
553                 return False;
554         }
555         
556         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
557         ndr_err = call->ndr_pull(pull, NDR_IN, r);
558         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
559                 talloc_free(r);
560                 return False;
561         }
562         
563         if (DEBUGLEVEL >= 10)
564                 NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, r);
565         
566         r->out.result = _svcctl_SetServiceStatus(p, r);
567         
568         if (p->rng_fault_state) {
569                 talloc_free(r);
570                 /* Return True here, srv_pipe_hnd.c will take care */
571                 return True;
572         }
573         
574         if (DEBUGLEVEL >= 10)
575                 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, r);
576         
577         push = ndr_push_init_ctx(r);
578         if (push == NULL) {
579                 talloc_free(r);
580                 return False;
581         }
582         
583         ndr_err = call->ndr_push(push, NDR_OUT, r);
584         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
585                 talloc_free(r);
586                 return False;
587         }
588         
589         blob = ndr_push_blob(push);
590         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
591                 talloc_free(r);
592                 return False;
593         }
594         
595         talloc_free(r);
596         
597         return True;
598 }
599
600 static bool api_svcctl_UnlockServiceDatabase(pipes_struct *p)
601 {
602         const struct ndr_interface_call *call;
603         struct ndr_pull *pull;
604         struct ndr_push *push;
605         enum ndr_err_code ndr_err;
606         DATA_BLOB blob;
607         struct svcctl_UnlockServiceDatabase *r;
608         
609         call = &ndr_table_svcctl.calls[NDR_SVCCTL_UNLOCKSERVICEDATABASE];
610         
611         r = talloc(NULL, struct svcctl_UnlockServiceDatabase);
612         if (r == NULL) {
613                 return False;
614         }
615         
616         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
617                 talloc_free(r);
618                 return False;
619         }
620         
621         pull = ndr_pull_init_blob(&blob, r);
622         if (pull == NULL) {
623                 talloc_free(r);
624                 return False;
625         }
626         
627         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
628         ndr_err = call->ndr_pull(pull, NDR_IN, r);
629         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
630                 talloc_free(r);
631                 return False;
632         }
633         
634         if (DEBUGLEVEL >= 10)
635                 NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, r);
636         
637         ZERO_STRUCT(r->out);
638         r->out.lock = r->in.lock;
639         r->out.result = _svcctl_UnlockServiceDatabase(p, r);
640         
641         if (p->rng_fault_state) {
642                 talloc_free(r);
643                 /* Return True here, srv_pipe_hnd.c will take care */
644                 return True;
645         }
646         
647         if (DEBUGLEVEL >= 10)
648                 NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, r);
649         
650         push = ndr_push_init_ctx(r);
651         if (push == NULL) {
652                 talloc_free(r);
653                 return False;
654         }
655         
656         ndr_err = call->ndr_push(push, NDR_OUT, r);
657         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
658                 talloc_free(r);
659                 return False;
660         }
661         
662         blob = ndr_push_blob(push);
663         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
664                 talloc_free(r);
665                 return False;
666         }
667         
668         talloc_free(r);
669         
670         return True;
671 }
672
673 static bool api_svcctl_NotifyBootConfigStatus(pipes_struct *p)
674 {
675         const struct ndr_interface_call *call;
676         struct ndr_pull *pull;
677         struct ndr_push *push;
678         enum ndr_err_code ndr_err;
679         DATA_BLOB blob;
680         struct svcctl_NotifyBootConfigStatus *r;
681         
682         call = &ndr_table_svcctl.calls[NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS];
683         
684         r = talloc(NULL, struct svcctl_NotifyBootConfigStatus);
685         if (r == NULL) {
686                 return False;
687         }
688         
689         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
690                 talloc_free(r);
691                 return False;
692         }
693         
694         pull = ndr_pull_init_blob(&blob, r);
695         if (pull == NULL) {
696                 talloc_free(r);
697                 return False;
698         }
699         
700         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
701         ndr_err = call->ndr_pull(pull, NDR_IN, r);
702         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
703                 talloc_free(r);
704                 return False;
705         }
706         
707         if (DEBUGLEVEL >= 10)
708                 NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, r);
709         
710         r->out.result = _svcctl_NotifyBootConfigStatus(p, r);
711         
712         if (p->rng_fault_state) {
713                 talloc_free(r);
714                 /* Return True here, srv_pipe_hnd.c will take care */
715                 return True;
716         }
717         
718         if (DEBUGLEVEL >= 10)
719                 NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, r);
720         
721         push = ndr_push_init_ctx(r);
722         if (push == NULL) {
723                 talloc_free(r);
724                 return False;
725         }
726         
727         ndr_err = call->ndr_push(push, NDR_OUT, r);
728         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
729                 talloc_free(r);
730                 return False;
731         }
732         
733         blob = ndr_push_blob(push);
734         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
735                 talloc_free(r);
736                 return False;
737         }
738         
739         talloc_free(r);
740         
741         return True;
742 }
743
744 static bool api_svcctl_SCSetServiceBitsW(pipes_struct *p)
745 {
746         const struct ndr_interface_call *call;
747         struct ndr_pull *pull;
748         struct ndr_push *push;
749         enum ndr_err_code ndr_err;
750         DATA_BLOB blob;
751         struct svcctl_SCSetServiceBitsW *r;
752         
753         call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSW];
754         
755         r = talloc(NULL, struct svcctl_SCSetServiceBitsW);
756         if (r == NULL) {
757                 return False;
758         }
759         
760         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
761                 talloc_free(r);
762                 return False;
763         }
764         
765         pull = ndr_pull_init_blob(&blob, r);
766         if (pull == NULL) {
767                 talloc_free(r);
768                 return False;
769         }
770         
771         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
772         ndr_err = call->ndr_pull(pull, NDR_IN, r);
773         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
774                 talloc_free(r);
775                 return False;
776         }
777         
778         if (DEBUGLEVEL >= 10)
779                 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, r);
780         
781         r->out.result = _svcctl_SCSetServiceBitsW(p, r);
782         
783         if (p->rng_fault_state) {
784                 talloc_free(r);
785                 /* Return True here, srv_pipe_hnd.c will take care */
786                 return True;
787         }
788         
789         if (DEBUGLEVEL >= 10)
790                 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, r);
791         
792         push = ndr_push_init_ctx(r);
793         if (push == NULL) {
794                 talloc_free(r);
795                 return False;
796         }
797         
798         ndr_err = call->ndr_push(push, NDR_OUT, r);
799         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
800                 talloc_free(r);
801                 return False;
802         }
803         
804         blob = ndr_push_blob(push);
805         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
806                 talloc_free(r);
807                 return False;
808         }
809         
810         talloc_free(r);
811         
812         return True;
813 }
814
815 static bool api_svcctl_ChangeServiceConfigW(pipes_struct *p)
816 {
817         const struct ndr_interface_call *call;
818         struct ndr_pull *pull;
819         struct ndr_push *push;
820         enum ndr_err_code ndr_err;
821         DATA_BLOB blob;
822         struct svcctl_ChangeServiceConfigW *r;
823         
824         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGW];
825         
826         r = talloc(NULL, struct svcctl_ChangeServiceConfigW);
827         if (r == NULL) {
828                 return False;
829         }
830         
831         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
832                 talloc_free(r);
833                 return False;
834         }
835         
836         pull = ndr_pull_init_blob(&blob, r);
837         if (pull == NULL) {
838                 talloc_free(r);
839                 return False;
840         }
841         
842         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
843         ndr_err = call->ndr_pull(pull, NDR_IN, r);
844         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
845                 talloc_free(r);
846                 return False;
847         }
848         
849         if (DEBUGLEVEL >= 10)
850                 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, r);
851         
852         ZERO_STRUCT(r->out);
853         r->out.tag_id = talloc_zero(r, uint32_t);
854         if (r->out.tag_id == NULL) {
855                 talloc_free(r);
856                 return False;
857         }
858         
859         r->out.result = _svcctl_ChangeServiceConfigW(p, r);
860         
861         if (p->rng_fault_state) {
862                 talloc_free(r);
863                 /* Return True here, srv_pipe_hnd.c will take care */
864                 return True;
865         }
866         
867         if (DEBUGLEVEL >= 10)
868                 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, r);
869         
870         push = ndr_push_init_ctx(r);
871         if (push == NULL) {
872                 talloc_free(r);
873                 return False;
874         }
875         
876         ndr_err = call->ndr_push(push, NDR_OUT, r);
877         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
878                 talloc_free(r);
879                 return False;
880         }
881         
882         blob = ndr_push_blob(push);
883         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
884                 talloc_free(r);
885                 return False;
886         }
887         
888         talloc_free(r);
889         
890         return True;
891 }
892
893 static bool api_svcctl_CreateServiceW(pipes_struct *p)
894 {
895         const struct ndr_interface_call *call;
896         struct ndr_pull *pull;
897         struct ndr_push *push;
898         enum ndr_err_code ndr_err;
899         DATA_BLOB blob;
900         struct svcctl_CreateServiceW *r;
901         
902         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEW];
903         
904         r = talloc(NULL, struct svcctl_CreateServiceW);
905         if (r == NULL) {
906                 return False;
907         }
908         
909         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
910                 talloc_free(r);
911                 return False;
912         }
913         
914         pull = ndr_pull_init_blob(&blob, r);
915         if (pull == NULL) {
916                 talloc_free(r);
917                 return False;
918         }
919         
920         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
921         ndr_err = call->ndr_pull(pull, NDR_IN, r);
922         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
923                 talloc_free(r);
924                 return False;
925         }
926         
927         if (DEBUGLEVEL >= 10)
928                 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, r);
929         
930         ZERO_STRUCT(r->out);
931         r->out.TagId = r->in.TagId;
932         r->out.handle = talloc_zero(r, struct policy_handle);
933         if (r->out.handle == NULL) {
934                 talloc_free(r);
935                 return False;
936         }
937         
938         r->out.result = _svcctl_CreateServiceW(p, r);
939         
940         if (p->rng_fault_state) {
941                 talloc_free(r);
942                 /* Return True here, srv_pipe_hnd.c will take care */
943                 return True;
944         }
945         
946         if (DEBUGLEVEL >= 10)
947                 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, r);
948         
949         push = ndr_push_init_ctx(r);
950         if (push == NULL) {
951                 talloc_free(r);
952                 return False;
953         }
954         
955         ndr_err = call->ndr_push(push, NDR_OUT, r);
956         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
957                 talloc_free(r);
958                 return False;
959         }
960         
961         blob = ndr_push_blob(push);
962         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
963                 talloc_free(r);
964                 return False;
965         }
966         
967         talloc_free(r);
968         
969         return True;
970 }
971
972 static bool api_svcctl_EnumDependentServicesW(pipes_struct *p)
973 {
974         const struct ndr_interface_call *call;
975         struct ndr_pull *pull;
976         struct ndr_push *push;
977         enum ndr_err_code ndr_err;
978         DATA_BLOB blob;
979         struct svcctl_EnumDependentServicesW *r;
980         
981         call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESW];
982         
983         r = talloc(NULL, struct svcctl_EnumDependentServicesW);
984         if (r == NULL) {
985                 return False;
986         }
987         
988         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
989                 talloc_free(r);
990                 return False;
991         }
992         
993         pull = ndr_pull_init_blob(&blob, r);
994         if (pull == NULL) {
995                 talloc_free(r);
996                 return False;
997         }
998         
999         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1000         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1001         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1002                 talloc_free(r);
1003                 return False;
1004         }
1005         
1006         if (DEBUGLEVEL >= 10)
1007                 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, r);
1008         
1009         ZERO_STRUCT(r->out);
1010         r->out.service_status = talloc_zero(r, struct ENUM_SERVICE_STATUS);
1011         if (r->out.service_status == NULL) {
1012                 talloc_free(r);
1013                 return False;
1014         }
1015         
1016         r->out.bytes_needed = talloc_zero(r, uint32_t);
1017         if (r->out.bytes_needed == NULL) {
1018                 talloc_free(r);
1019                 return False;
1020         }
1021         
1022         r->out.services_returned = talloc_zero(r, uint32_t);
1023         if (r->out.services_returned == NULL) {
1024                 talloc_free(r);
1025                 return False;
1026         }
1027         
1028         r->out.result = _svcctl_EnumDependentServicesW(p, r);
1029         
1030         if (p->rng_fault_state) {
1031                 talloc_free(r);
1032                 /* Return True here, srv_pipe_hnd.c will take care */
1033                 return True;
1034         }
1035         
1036         if (DEBUGLEVEL >= 10)
1037                 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, r);
1038         
1039         push = ndr_push_init_ctx(r);
1040         if (push == NULL) {
1041                 talloc_free(r);
1042                 return False;
1043         }
1044         
1045         ndr_err = call->ndr_push(push, NDR_OUT, r);
1046         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1047                 talloc_free(r);
1048                 return False;
1049         }
1050         
1051         blob = ndr_push_blob(push);
1052         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1053                 talloc_free(r);
1054                 return False;
1055         }
1056         
1057         talloc_free(r);
1058         
1059         return True;
1060 }
1061
1062 static bool api_svcctl_EnumServicesStatusW(pipes_struct *p)
1063 {
1064         const struct ndr_interface_call *call;
1065         struct ndr_pull *pull;
1066         struct ndr_push *push;
1067         enum ndr_err_code ndr_err;
1068         DATA_BLOB blob;
1069         struct svcctl_EnumServicesStatusW *r;
1070         
1071         call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSW];
1072         
1073         r = talloc(NULL, struct svcctl_EnumServicesStatusW);
1074         if (r == NULL) {
1075                 return False;
1076         }
1077         
1078         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1079                 talloc_free(r);
1080                 return False;
1081         }
1082         
1083         pull = ndr_pull_init_blob(&blob, r);
1084         if (pull == NULL) {
1085                 talloc_free(r);
1086                 return False;
1087         }
1088         
1089         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1090         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1091         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1092                 talloc_free(r);
1093                 return False;
1094         }
1095         
1096         if (DEBUGLEVEL >= 10)
1097                 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, r);
1098         
1099         ZERO_STRUCT(r->out);
1100         r->out.service = talloc_zero_array(r, uint8_t, r->in.buf_size);
1101         if (r->out.service == NULL) {
1102                 talloc_free(r);
1103                 return False;
1104         }
1105         
1106         r->out.bytes_needed = talloc_zero(r, uint32_t);
1107         if (r->out.bytes_needed == NULL) {
1108                 talloc_free(r);
1109                 return False;
1110         }
1111         
1112         r->out.services_returned = talloc_zero(r, uint32_t);
1113         if (r->out.services_returned == NULL) {
1114                 talloc_free(r);
1115                 return False;
1116         }
1117         
1118         r->out.resume_handle = r->in.resume_handle;
1119         r->out.result = _svcctl_EnumServicesStatusW(p, r);
1120         
1121         if (p->rng_fault_state) {
1122                 talloc_free(r);
1123                 /* Return True here, srv_pipe_hnd.c will take care */
1124                 return True;
1125         }
1126         
1127         if (DEBUGLEVEL >= 10)
1128                 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, r);
1129         
1130         push = ndr_push_init_ctx(r);
1131         if (push == NULL) {
1132                 talloc_free(r);
1133                 return False;
1134         }
1135         
1136         ndr_err = call->ndr_push(push, NDR_OUT, r);
1137         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1138                 talloc_free(r);
1139                 return False;
1140         }
1141         
1142         blob = ndr_push_blob(push);
1143         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1144                 talloc_free(r);
1145                 return False;
1146         }
1147         
1148         talloc_free(r);
1149         
1150         return True;
1151 }
1152
1153 static bool api_svcctl_OpenSCManagerW(pipes_struct *p)
1154 {
1155         const struct ndr_interface_call *call;
1156         struct ndr_pull *pull;
1157         struct ndr_push *push;
1158         enum ndr_err_code ndr_err;
1159         DATA_BLOB blob;
1160         struct svcctl_OpenSCManagerW *r;
1161         
1162         call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERW];
1163         
1164         r = talloc(NULL, struct svcctl_OpenSCManagerW);
1165         if (r == NULL) {
1166                 return False;
1167         }
1168         
1169         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1170                 talloc_free(r);
1171                 return False;
1172         }
1173         
1174         pull = ndr_pull_init_blob(&blob, r);
1175         if (pull == NULL) {
1176                 talloc_free(r);
1177                 return False;
1178         }
1179         
1180         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1181         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1182         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1183                 talloc_free(r);
1184                 return False;
1185         }
1186         
1187         if (DEBUGLEVEL >= 10)
1188                 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, r);
1189         
1190         ZERO_STRUCT(r->out);
1191         r->out.handle = talloc_zero(r, struct policy_handle);
1192         if (r->out.handle == NULL) {
1193                 talloc_free(r);
1194                 return False;
1195         }
1196         
1197         r->out.result = _svcctl_OpenSCManagerW(p, r);
1198         
1199         if (p->rng_fault_state) {
1200                 talloc_free(r);
1201                 /* Return True here, srv_pipe_hnd.c will take care */
1202                 return True;
1203         }
1204         
1205         if (DEBUGLEVEL >= 10)
1206                 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, r);
1207         
1208         push = ndr_push_init_ctx(r);
1209         if (push == NULL) {
1210                 talloc_free(r);
1211                 return False;
1212         }
1213         
1214         ndr_err = call->ndr_push(push, NDR_OUT, r);
1215         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1216                 talloc_free(r);
1217                 return False;
1218         }
1219         
1220         blob = ndr_push_blob(push);
1221         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1222                 talloc_free(r);
1223                 return False;
1224         }
1225         
1226         talloc_free(r);
1227         
1228         return True;
1229 }
1230
1231 static bool api_svcctl_OpenServiceW(pipes_struct *p)
1232 {
1233         const struct ndr_interface_call *call;
1234         struct ndr_pull *pull;
1235         struct ndr_push *push;
1236         enum ndr_err_code ndr_err;
1237         DATA_BLOB blob;
1238         struct svcctl_OpenServiceW *r;
1239         
1240         call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEW];
1241         
1242         r = talloc(NULL, struct svcctl_OpenServiceW);
1243         if (r == NULL) {
1244                 return False;
1245         }
1246         
1247         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1248                 talloc_free(r);
1249                 return False;
1250         }
1251         
1252         pull = ndr_pull_init_blob(&blob, r);
1253         if (pull == NULL) {
1254                 talloc_free(r);
1255                 return False;
1256         }
1257         
1258         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1259         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1260         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1261                 talloc_free(r);
1262                 return False;
1263         }
1264         
1265         if (DEBUGLEVEL >= 10)
1266                 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, r);
1267         
1268         ZERO_STRUCT(r->out);
1269         r->out.handle = talloc_zero(r, struct policy_handle);
1270         if (r->out.handle == NULL) {
1271                 talloc_free(r);
1272                 return False;
1273         }
1274         
1275         r->out.result = _svcctl_OpenServiceW(p, r);
1276         
1277         if (p->rng_fault_state) {
1278                 talloc_free(r);
1279                 /* Return True here, srv_pipe_hnd.c will take care */
1280                 return True;
1281         }
1282         
1283         if (DEBUGLEVEL >= 10)
1284                 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, r);
1285         
1286         push = ndr_push_init_ctx(r);
1287         if (push == NULL) {
1288                 talloc_free(r);
1289                 return False;
1290         }
1291         
1292         ndr_err = call->ndr_push(push, NDR_OUT, r);
1293         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1294                 talloc_free(r);
1295                 return False;
1296         }
1297         
1298         blob = ndr_push_blob(push);
1299         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1300                 talloc_free(r);
1301                 return False;
1302         }
1303         
1304         talloc_free(r);
1305         
1306         return True;
1307 }
1308
1309 static bool api_svcctl_QueryServiceConfigW(pipes_struct *p)
1310 {
1311         const struct ndr_interface_call *call;
1312         struct ndr_pull *pull;
1313         struct ndr_push *push;
1314         enum ndr_err_code ndr_err;
1315         DATA_BLOB blob;
1316         struct svcctl_QueryServiceConfigW *r;
1317         
1318         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGW];
1319         
1320         r = talloc(NULL, struct svcctl_QueryServiceConfigW);
1321         if (r == NULL) {
1322                 return False;
1323         }
1324         
1325         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1326                 talloc_free(r);
1327                 return False;
1328         }
1329         
1330         pull = ndr_pull_init_blob(&blob, r);
1331         if (pull == NULL) {
1332                 talloc_free(r);
1333                 return False;
1334         }
1335         
1336         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1337         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1338         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1339                 talloc_free(r);
1340                 return False;
1341         }
1342         
1343         if (DEBUGLEVEL >= 10)
1344                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, r);
1345         
1346         ZERO_STRUCT(r->out);
1347         r->out.query = talloc_zero_array(r, uint8_t, r->in.buf_size);
1348         if (r->out.query == NULL) {
1349                 talloc_free(r);
1350                 return False;
1351         }
1352         
1353         r->out.bytes_needed = talloc_zero(r, uint32_t);
1354         if (r->out.bytes_needed == NULL) {
1355                 talloc_free(r);
1356                 return False;
1357         }
1358         
1359         r->out.result = _svcctl_QueryServiceConfigW(p, r);
1360         
1361         if (p->rng_fault_state) {
1362                 talloc_free(r);
1363                 /* Return True here, srv_pipe_hnd.c will take care */
1364                 return True;
1365         }
1366         
1367         if (DEBUGLEVEL >= 10)
1368                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, r);
1369         
1370         push = ndr_push_init_ctx(r);
1371         if (push == NULL) {
1372                 talloc_free(r);
1373                 return False;
1374         }
1375         
1376         ndr_err = call->ndr_push(push, NDR_OUT, r);
1377         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1378                 talloc_free(r);
1379                 return False;
1380         }
1381         
1382         blob = ndr_push_blob(push);
1383         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1384                 talloc_free(r);
1385                 return False;
1386         }
1387         
1388         talloc_free(r);
1389         
1390         return True;
1391 }
1392
1393 static bool api_svcctl_QueryServiceLockStatusW(pipes_struct *p)
1394 {
1395         const struct ndr_interface_call *call;
1396         struct ndr_pull *pull;
1397         struct ndr_push *push;
1398         enum ndr_err_code ndr_err;
1399         DATA_BLOB blob;
1400         struct svcctl_QueryServiceLockStatusW *r;
1401         
1402         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSW];
1403         
1404         r = talloc(NULL, struct svcctl_QueryServiceLockStatusW);
1405         if (r == NULL) {
1406                 return False;
1407         }
1408         
1409         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1410                 talloc_free(r);
1411                 return False;
1412         }
1413         
1414         pull = ndr_pull_init_blob(&blob, r);
1415         if (pull == NULL) {
1416                 talloc_free(r);
1417                 return False;
1418         }
1419         
1420         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1421         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1422         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1423                 talloc_free(r);
1424                 return False;
1425         }
1426         
1427         if (DEBUGLEVEL >= 10)
1428                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, r);
1429         
1430         ZERO_STRUCT(r->out);
1431         r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS);
1432         if (r->out.lock_status == NULL) {
1433                 talloc_free(r);
1434                 return False;
1435         }
1436         
1437         r->out.required_buf_size = talloc_zero(r, uint32_t);
1438         if (r->out.required_buf_size == NULL) {
1439                 talloc_free(r);
1440                 return False;
1441         }
1442         
1443         r->out.result = _svcctl_QueryServiceLockStatusW(p, r);
1444         
1445         if (p->rng_fault_state) {
1446                 talloc_free(r);
1447                 /* Return True here, srv_pipe_hnd.c will take care */
1448                 return True;
1449         }
1450         
1451         if (DEBUGLEVEL >= 10)
1452                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, r);
1453         
1454         push = ndr_push_init_ctx(r);
1455         if (push == NULL) {
1456                 talloc_free(r);
1457                 return False;
1458         }
1459         
1460         ndr_err = call->ndr_push(push, NDR_OUT, r);
1461         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1462                 talloc_free(r);
1463                 return False;
1464         }
1465         
1466         blob = ndr_push_blob(push);
1467         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1468                 talloc_free(r);
1469                 return False;
1470         }
1471         
1472         talloc_free(r);
1473         
1474         return True;
1475 }
1476
1477 static bool api_svcctl_StartServiceW(pipes_struct *p)
1478 {
1479         const struct ndr_interface_call *call;
1480         struct ndr_pull *pull;
1481         struct ndr_push *push;
1482         enum ndr_err_code ndr_err;
1483         DATA_BLOB blob;
1484         struct svcctl_StartServiceW *r;
1485         
1486         call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEW];
1487         
1488         r = talloc(NULL, struct svcctl_StartServiceW);
1489         if (r == NULL) {
1490                 return False;
1491         }
1492         
1493         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1494                 talloc_free(r);
1495                 return False;
1496         }
1497         
1498         pull = ndr_pull_init_blob(&blob, r);
1499         if (pull == NULL) {
1500                 talloc_free(r);
1501                 return False;
1502         }
1503         
1504         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1505         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1506         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1507                 talloc_free(r);
1508                 return False;
1509         }
1510         
1511         if (DEBUGLEVEL >= 10)
1512                 NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, r);
1513         
1514         r->out.result = _svcctl_StartServiceW(p, r);
1515         
1516         if (p->rng_fault_state) {
1517                 talloc_free(r);
1518                 /* Return True here, srv_pipe_hnd.c will take care */
1519                 return True;
1520         }
1521         
1522         if (DEBUGLEVEL >= 10)
1523                 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, r);
1524         
1525         push = ndr_push_init_ctx(r);
1526         if (push == NULL) {
1527                 talloc_free(r);
1528                 return False;
1529         }
1530         
1531         ndr_err = call->ndr_push(push, NDR_OUT, r);
1532         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1533                 talloc_free(r);
1534                 return False;
1535         }
1536         
1537         blob = ndr_push_blob(push);
1538         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1539                 talloc_free(r);
1540                 return False;
1541         }
1542         
1543         talloc_free(r);
1544         
1545         return True;
1546 }
1547
1548 static bool api_svcctl_GetServiceDisplayNameW(pipes_struct *p)
1549 {
1550         const struct ndr_interface_call *call;
1551         struct ndr_pull *pull;
1552         struct ndr_push *push;
1553         enum ndr_err_code ndr_err;
1554         DATA_BLOB blob;
1555         struct svcctl_GetServiceDisplayNameW *r;
1556         
1557         call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEW];
1558         
1559         r = talloc(NULL, struct svcctl_GetServiceDisplayNameW);
1560         if (r == NULL) {
1561                 return False;
1562         }
1563         
1564         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1565                 talloc_free(r);
1566                 return False;
1567         }
1568         
1569         pull = ndr_pull_init_blob(&blob, r);
1570         if (pull == NULL) {
1571                 talloc_free(r);
1572                 return False;
1573         }
1574         
1575         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1576         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1577         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1578                 talloc_free(r);
1579                 return False;
1580         }
1581         
1582         if (DEBUGLEVEL >= 10)
1583                 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, r);
1584         
1585         ZERO_STRUCT(r->out);
1586         r->out.display_name = talloc_zero(r, const char *);
1587         if (r->out.display_name == NULL) {
1588                 talloc_free(r);
1589                 return False;
1590         }
1591         
1592         r->out.display_name_length = r->in.display_name_length;
1593         r->out.result = _svcctl_GetServiceDisplayNameW(p, r);
1594         
1595         if (p->rng_fault_state) {
1596                 talloc_free(r);
1597                 /* Return True here, srv_pipe_hnd.c will take care */
1598                 return True;
1599         }
1600         
1601         if (DEBUGLEVEL >= 10)
1602                 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, r);
1603         
1604         push = ndr_push_init_ctx(r);
1605         if (push == NULL) {
1606                 talloc_free(r);
1607                 return False;
1608         }
1609         
1610         ndr_err = call->ndr_push(push, NDR_OUT, r);
1611         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1612                 talloc_free(r);
1613                 return False;
1614         }
1615         
1616         blob = ndr_push_blob(push);
1617         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1618                 talloc_free(r);
1619                 return False;
1620         }
1621         
1622         talloc_free(r);
1623         
1624         return True;
1625 }
1626
1627 static bool api_svcctl_GetServiceKeyNameW(pipes_struct *p)
1628 {
1629         const struct ndr_interface_call *call;
1630         struct ndr_pull *pull;
1631         struct ndr_push *push;
1632         enum ndr_err_code ndr_err;
1633         DATA_BLOB blob;
1634         struct svcctl_GetServiceKeyNameW *r;
1635         
1636         call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEW];
1637         
1638         r = talloc(NULL, struct svcctl_GetServiceKeyNameW);
1639         if (r == NULL) {
1640                 return False;
1641         }
1642         
1643         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1644                 talloc_free(r);
1645                 return False;
1646         }
1647         
1648         pull = ndr_pull_init_blob(&blob, r);
1649         if (pull == NULL) {
1650                 talloc_free(r);
1651                 return False;
1652         }
1653         
1654         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1655         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1656         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1657                 talloc_free(r);
1658                 return False;
1659         }
1660         
1661         if (DEBUGLEVEL >= 10)
1662                 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, r);
1663         
1664         ZERO_STRUCT(r->out);
1665         r->out.key_name = talloc_zero(r, const char *);
1666         if (r->out.key_name == NULL) {
1667                 talloc_free(r);
1668                 return False;
1669         }
1670         
1671         r->out.display_name_length = r->in.display_name_length;
1672         r->out.result = _svcctl_GetServiceKeyNameW(p, r);
1673         
1674         if (p->rng_fault_state) {
1675                 talloc_free(r);
1676                 /* Return True here, srv_pipe_hnd.c will take care */
1677                 return True;
1678         }
1679         
1680         if (DEBUGLEVEL >= 10)
1681                 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, r);
1682         
1683         push = ndr_push_init_ctx(r);
1684         if (push == NULL) {
1685                 talloc_free(r);
1686                 return False;
1687         }
1688         
1689         ndr_err = call->ndr_push(push, NDR_OUT, r);
1690         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1691                 talloc_free(r);
1692                 return False;
1693         }
1694         
1695         blob = ndr_push_blob(push);
1696         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1697                 talloc_free(r);
1698                 return False;
1699         }
1700         
1701         talloc_free(r);
1702         
1703         return True;
1704 }
1705
1706 static bool api_svcctl_SCSetServiceBitsA(pipes_struct *p)
1707 {
1708         const struct ndr_interface_call *call;
1709         struct ndr_pull *pull;
1710         struct ndr_push *push;
1711         enum ndr_err_code ndr_err;
1712         DATA_BLOB blob;
1713         struct svcctl_SCSetServiceBitsA *r;
1714         
1715         call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSA];
1716         
1717         r = talloc(NULL, struct svcctl_SCSetServiceBitsA);
1718         if (r == NULL) {
1719                 return False;
1720         }
1721         
1722         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1723                 talloc_free(r);
1724                 return False;
1725         }
1726         
1727         pull = ndr_pull_init_blob(&blob, r);
1728         if (pull == NULL) {
1729                 talloc_free(r);
1730                 return False;
1731         }
1732         
1733         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1734         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1735         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1736                 talloc_free(r);
1737                 return False;
1738         }
1739         
1740         if (DEBUGLEVEL >= 10)
1741                 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, r);
1742         
1743         r->out.result = _svcctl_SCSetServiceBitsA(p, r);
1744         
1745         if (p->rng_fault_state) {
1746                 talloc_free(r);
1747                 /* Return True here, srv_pipe_hnd.c will take care */
1748                 return True;
1749         }
1750         
1751         if (DEBUGLEVEL >= 10)
1752                 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, r);
1753         
1754         push = ndr_push_init_ctx(r);
1755         if (push == NULL) {
1756                 talloc_free(r);
1757                 return False;
1758         }
1759         
1760         ndr_err = call->ndr_push(push, NDR_OUT, r);
1761         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1762                 talloc_free(r);
1763                 return False;
1764         }
1765         
1766         blob = ndr_push_blob(push);
1767         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1768                 talloc_free(r);
1769                 return False;
1770         }
1771         
1772         talloc_free(r);
1773         
1774         return True;
1775 }
1776
1777 static bool api_svcctl_ChangeServiceConfigA(pipes_struct *p)
1778 {
1779         const struct ndr_interface_call *call;
1780         struct ndr_pull *pull;
1781         struct ndr_push *push;
1782         enum ndr_err_code ndr_err;
1783         DATA_BLOB blob;
1784         struct svcctl_ChangeServiceConfigA *r;
1785         
1786         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGA];
1787         
1788         r = talloc(NULL, struct svcctl_ChangeServiceConfigA);
1789         if (r == NULL) {
1790                 return False;
1791         }
1792         
1793         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1794                 talloc_free(r);
1795                 return False;
1796         }
1797         
1798         pull = ndr_pull_init_blob(&blob, r);
1799         if (pull == NULL) {
1800                 talloc_free(r);
1801                 return False;
1802         }
1803         
1804         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1805         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1806         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1807                 talloc_free(r);
1808                 return False;
1809         }
1810         
1811         if (DEBUGLEVEL >= 10)
1812                 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, r);
1813         
1814         ZERO_STRUCT(r->out);
1815         r->out.tag_id = talloc_zero(r, uint32_t);
1816         if (r->out.tag_id == NULL) {
1817                 talloc_free(r);
1818                 return False;
1819         }
1820         
1821         r->out.result = _svcctl_ChangeServiceConfigA(p, r);
1822         
1823         if (p->rng_fault_state) {
1824                 talloc_free(r);
1825                 /* Return True here, srv_pipe_hnd.c will take care */
1826                 return True;
1827         }
1828         
1829         if (DEBUGLEVEL >= 10)
1830                 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, r);
1831         
1832         push = ndr_push_init_ctx(r);
1833         if (push == NULL) {
1834                 talloc_free(r);
1835                 return False;
1836         }
1837         
1838         ndr_err = call->ndr_push(push, NDR_OUT, r);
1839         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1840                 talloc_free(r);
1841                 return False;
1842         }
1843         
1844         blob = ndr_push_blob(push);
1845         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1846                 talloc_free(r);
1847                 return False;
1848         }
1849         
1850         talloc_free(r);
1851         
1852         return True;
1853 }
1854
1855 static bool api_svcctl_CreateServiceA(pipes_struct *p)
1856 {
1857         const struct ndr_interface_call *call;
1858         struct ndr_pull *pull;
1859         struct ndr_push *push;
1860         enum ndr_err_code ndr_err;
1861         DATA_BLOB blob;
1862         struct svcctl_CreateServiceA *r;
1863         
1864         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEA];
1865         
1866         r = talloc(NULL, struct svcctl_CreateServiceA);
1867         if (r == NULL) {
1868                 return False;
1869         }
1870         
1871         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1872                 talloc_free(r);
1873                 return False;
1874         }
1875         
1876         pull = ndr_pull_init_blob(&blob, r);
1877         if (pull == NULL) {
1878                 talloc_free(r);
1879                 return False;
1880         }
1881         
1882         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1883         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1884         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1885                 talloc_free(r);
1886                 return False;
1887         }
1888         
1889         if (DEBUGLEVEL >= 10)
1890                 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, r);
1891         
1892         ZERO_STRUCT(r->out);
1893         r->out.TagId = talloc_zero(r, uint32_t);
1894         if (r->out.TagId == NULL) {
1895                 talloc_free(r);
1896                 return False;
1897         }
1898         
1899         r->out.result = _svcctl_CreateServiceA(p, r);
1900         
1901         if (p->rng_fault_state) {
1902                 talloc_free(r);
1903                 /* Return True here, srv_pipe_hnd.c will take care */
1904                 return True;
1905         }
1906         
1907         if (DEBUGLEVEL >= 10)
1908                 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, r);
1909         
1910         push = ndr_push_init_ctx(r);
1911         if (push == NULL) {
1912                 talloc_free(r);
1913                 return False;
1914         }
1915         
1916         ndr_err = call->ndr_push(push, NDR_OUT, r);
1917         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1918                 talloc_free(r);
1919                 return False;
1920         }
1921         
1922         blob = ndr_push_blob(push);
1923         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1924                 talloc_free(r);
1925                 return False;
1926         }
1927         
1928         talloc_free(r);
1929         
1930         return True;
1931 }
1932
1933 static bool api_svcctl_EnumDependentServicesA(pipes_struct *p)
1934 {
1935         const struct ndr_interface_call *call;
1936         struct ndr_pull *pull;
1937         struct ndr_push *push;
1938         enum ndr_err_code ndr_err;
1939         DATA_BLOB blob;
1940         struct svcctl_EnumDependentServicesA *r;
1941         
1942         call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESA];
1943         
1944         r = talloc(NULL, struct svcctl_EnumDependentServicesA);
1945         if (r == NULL) {
1946                 return False;
1947         }
1948         
1949         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1950                 talloc_free(r);
1951                 return False;
1952         }
1953         
1954         pull = ndr_pull_init_blob(&blob, r);
1955         if (pull == NULL) {
1956                 talloc_free(r);
1957                 return False;
1958         }
1959         
1960         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1961         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1962         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1963                 talloc_free(r);
1964                 return False;
1965         }
1966         
1967         if (DEBUGLEVEL >= 10)
1968                 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, r);
1969         
1970         ZERO_STRUCT(r->out);
1971         r->out.service_status = talloc_zero(r, struct ENUM_SERVICE_STATUS);
1972         if (r->out.service_status == NULL) {
1973                 talloc_free(r);
1974                 return False;
1975         }
1976         
1977         r->out.bytes_needed = talloc_zero(r, uint32_t);
1978         if (r->out.bytes_needed == NULL) {
1979                 talloc_free(r);
1980                 return False;
1981         }
1982         
1983         r->out.services_returned = talloc_zero(r, uint32_t);
1984         if (r->out.services_returned == NULL) {
1985                 talloc_free(r);
1986                 return False;
1987         }
1988         
1989         r->out.result = _svcctl_EnumDependentServicesA(p, r);
1990         
1991         if (p->rng_fault_state) {
1992                 talloc_free(r);
1993                 /* Return True here, srv_pipe_hnd.c will take care */
1994                 return True;
1995         }
1996         
1997         if (DEBUGLEVEL >= 10)
1998                 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, r);
1999         
2000         push = ndr_push_init_ctx(r);
2001         if (push == NULL) {
2002                 talloc_free(r);
2003                 return False;
2004         }
2005         
2006         ndr_err = call->ndr_push(push, NDR_OUT, r);
2007         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2008                 talloc_free(r);
2009                 return False;
2010         }
2011         
2012         blob = ndr_push_blob(push);
2013         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2014                 talloc_free(r);
2015                 return False;
2016         }
2017         
2018         talloc_free(r);
2019         
2020         return True;
2021 }
2022
2023 static bool api_svcctl_EnumServicesStatusA(pipes_struct *p)
2024 {
2025         const struct ndr_interface_call *call;
2026         struct ndr_pull *pull;
2027         struct ndr_push *push;
2028         enum ndr_err_code ndr_err;
2029         DATA_BLOB blob;
2030         struct svcctl_EnumServicesStatusA *r;
2031         
2032         call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSA];
2033         
2034         r = talloc(NULL, struct svcctl_EnumServicesStatusA);
2035         if (r == NULL) {
2036                 return False;
2037         }
2038         
2039         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2040                 talloc_free(r);
2041                 return False;
2042         }
2043         
2044         pull = ndr_pull_init_blob(&blob, r);
2045         if (pull == NULL) {
2046                 talloc_free(r);
2047                 return False;
2048         }
2049         
2050         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2051         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2052         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2053                 talloc_free(r);
2054                 return False;
2055         }
2056         
2057         if (DEBUGLEVEL >= 10)
2058                 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, r);
2059         
2060         ZERO_STRUCT(r->out);
2061         r->out.service = talloc_zero_array(r, uint8_t, r->in.buf_size);
2062         if (r->out.service == NULL) {
2063                 talloc_free(r);
2064                 return False;
2065         }
2066         
2067         r->out.bytes_needed = talloc_zero(r, uint32_t);
2068         if (r->out.bytes_needed == NULL) {
2069                 talloc_free(r);
2070                 return False;
2071         }
2072         
2073         r->out.services_returned = talloc_zero(r, uint32_t);
2074         if (r->out.services_returned == NULL) {
2075                 talloc_free(r);
2076                 return False;
2077         }
2078         
2079         r->out.resume_handle = r->in.resume_handle;
2080         r->out.result = _svcctl_EnumServicesStatusA(p, r);
2081         
2082         if (p->rng_fault_state) {
2083                 talloc_free(r);
2084                 /* Return True here, srv_pipe_hnd.c will take care */
2085                 return True;
2086         }
2087         
2088         if (DEBUGLEVEL >= 10)
2089                 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, r);
2090         
2091         push = ndr_push_init_ctx(r);
2092         if (push == NULL) {
2093                 talloc_free(r);
2094                 return False;
2095         }
2096         
2097         ndr_err = call->ndr_push(push, NDR_OUT, r);
2098         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2099                 talloc_free(r);
2100                 return False;
2101         }
2102         
2103         blob = ndr_push_blob(push);
2104         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2105                 talloc_free(r);
2106                 return False;
2107         }
2108         
2109         talloc_free(r);
2110         
2111         return True;
2112 }
2113
2114 static bool api_svcctl_OpenSCManagerA(pipes_struct *p)
2115 {
2116         const struct ndr_interface_call *call;
2117         struct ndr_pull *pull;
2118         struct ndr_push *push;
2119         enum ndr_err_code ndr_err;
2120         DATA_BLOB blob;
2121         struct svcctl_OpenSCManagerA *r;
2122         
2123         call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERA];
2124         
2125         r = talloc(NULL, struct svcctl_OpenSCManagerA);
2126         if (r == NULL) {
2127                 return False;
2128         }
2129         
2130         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2131                 talloc_free(r);
2132                 return False;
2133         }
2134         
2135         pull = ndr_pull_init_blob(&blob, r);
2136         if (pull == NULL) {
2137                 talloc_free(r);
2138                 return False;
2139         }
2140         
2141         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2142         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2143         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2144                 talloc_free(r);
2145                 return False;
2146         }
2147         
2148         if (DEBUGLEVEL >= 10)
2149                 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, r);
2150         
2151         ZERO_STRUCT(r->out);
2152         r->out.handle = talloc_zero(r, struct policy_handle);
2153         if (r->out.handle == NULL) {
2154                 talloc_free(r);
2155                 return False;
2156         }
2157         
2158         r->out.result = _svcctl_OpenSCManagerA(p, r);
2159         
2160         if (p->rng_fault_state) {
2161                 talloc_free(r);
2162                 /* Return True here, srv_pipe_hnd.c will take care */
2163                 return True;
2164         }
2165         
2166         if (DEBUGLEVEL >= 10)
2167                 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, r);
2168         
2169         push = ndr_push_init_ctx(r);
2170         if (push == NULL) {
2171                 talloc_free(r);
2172                 return False;
2173         }
2174         
2175         ndr_err = call->ndr_push(push, NDR_OUT, r);
2176         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2177                 talloc_free(r);
2178                 return False;
2179         }
2180         
2181         blob = ndr_push_blob(push);
2182         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2183                 talloc_free(r);
2184                 return False;
2185         }
2186         
2187         talloc_free(r);
2188         
2189         return True;
2190 }
2191
2192 static bool api_svcctl_OpenServiceA(pipes_struct *p)
2193 {
2194         const struct ndr_interface_call *call;
2195         struct ndr_pull *pull;
2196         struct ndr_push *push;
2197         enum ndr_err_code ndr_err;
2198         DATA_BLOB blob;
2199         struct svcctl_OpenServiceA *r;
2200         
2201         call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEA];
2202         
2203         r = talloc(NULL, struct svcctl_OpenServiceA);
2204         if (r == NULL) {
2205                 return False;
2206         }
2207         
2208         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2209                 talloc_free(r);
2210                 return False;
2211         }
2212         
2213         pull = ndr_pull_init_blob(&blob, r);
2214         if (pull == NULL) {
2215                 talloc_free(r);
2216                 return False;
2217         }
2218         
2219         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2220         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2221         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2222                 talloc_free(r);
2223                 return False;
2224         }
2225         
2226         if (DEBUGLEVEL >= 10)
2227                 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, r);
2228         
2229         r->out.result = _svcctl_OpenServiceA(p, r);
2230         
2231         if (p->rng_fault_state) {
2232                 talloc_free(r);
2233                 /* Return True here, srv_pipe_hnd.c will take care */
2234                 return True;
2235         }
2236         
2237         if (DEBUGLEVEL >= 10)
2238                 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, r);
2239         
2240         push = ndr_push_init_ctx(r);
2241         if (push == NULL) {
2242                 talloc_free(r);
2243                 return False;
2244         }
2245         
2246         ndr_err = call->ndr_push(push, NDR_OUT, r);
2247         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2248                 talloc_free(r);
2249                 return False;
2250         }
2251         
2252         blob = ndr_push_blob(push);
2253         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2254                 talloc_free(r);
2255                 return False;
2256         }
2257         
2258         talloc_free(r);
2259         
2260         return True;
2261 }
2262
2263 static bool api_svcctl_QueryServiceConfigA(pipes_struct *p)
2264 {
2265         const struct ndr_interface_call *call;
2266         struct ndr_pull *pull;
2267         struct ndr_push *push;
2268         enum ndr_err_code ndr_err;
2269         DATA_BLOB blob;
2270         struct svcctl_QueryServiceConfigA *r;
2271         
2272         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGA];
2273         
2274         r = talloc(NULL, struct svcctl_QueryServiceConfigA);
2275         if (r == NULL) {
2276                 return False;
2277         }
2278         
2279         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2280                 talloc_free(r);
2281                 return False;
2282         }
2283         
2284         pull = ndr_pull_init_blob(&blob, r);
2285         if (pull == NULL) {
2286                 talloc_free(r);
2287                 return False;
2288         }
2289         
2290         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2291         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2292         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2293                 talloc_free(r);
2294                 return False;
2295         }
2296         
2297         if (DEBUGLEVEL >= 10)
2298                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, r);
2299         
2300         ZERO_STRUCT(r->out);
2301         r->out.query = talloc_zero_array(r, uint8_t, r->in.buf_size);
2302         if (r->out.query == NULL) {
2303                 talloc_free(r);
2304                 return False;
2305         }
2306         
2307         r->out.bytes_needed = talloc_zero(r, uint32_t);
2308         if (r->out.bytes_needed == NULL) {
2309                 talloc_free(r);
2310                 return False;
2311         }
2312         
2313         r->out.result = _svcctl_QueryServiceConfigA(p, r);
2314         
2315         if (p->rng_fault_state) {
2316                 talloc_free(r);
2317                 /* Return True here, srv_pipe_hnd.c will take care */
2318                 return True;
2319         }
2320         
2321         if (DEBUGLEVEL >= 10)
2322                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, r);
2323         
2324         push = ndr_push_init_ctx(r);
2325         if (push == NULL) {
2326                 talloc_free(r);
2327                 return False;
2328         }
2329         
2330         ndr_err = call->ndr_push(push, NDR_OUT, r);
2331         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2332                 talloc_free(r);
2333                 return False;
2334         }
2335         
2336         blob = ndr_push_blob(push);
2337         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2338                 talloc_free(r);
2339                 return False;
2340         }
2341         
2342         talloc_free(r);
2343         
2344         return True;
2345 }
2346
2347 static bool api_svcctl_QueryServiceLockStatusA(pipes_struct *p)
2348 {
2349         const struct ndr_interface_call *call;
2350         struct ndr_pull *pull;
2351         struct ndr_push *push;
2352         enum ndr_err_code ndr_err;
2353         DATA_BLOB blob;
2354         struct svcctl_QueryServiceLockStatusA *r;
2355         
2356         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSA];
2357         
2358         r = talloc(NULL, struct svcctl_QueryServiceLockStatusA);
2359         if (r == NULL) {
2360                 return False;
2361         }
2362         
2363         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2364                 talloc_free(r);
2365                 return False;
2366         }
2367         
2368         pull = ndr_pull_init_blob(&blob, r);
2369         if (pull == NULL) {
2370                 talloc_free(r);
2371                 return False;
2372         }
2373         
2374         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2375         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2376         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2377                 talloc_free(r);
2378                 return False;
2379         }
2380         
2381         if (DEBUGLEVEL >= 10)
2382                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, r);
2383         
2384         ZERO_STRUCT(r->out);
2385         r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS);
2386         if (r->out.lock_status == NULL) {
2387                 talloc_free(r);
2388                 return False;
2389         }
2390         
2391         r->out.required_buf_size = talloc_zero(r, uint32_t);
2392         if (r->out.required_buf_size == NULL) {
2393                 talloc_free(r);
2394                 return False;
2395         }
2396         
2397         r->out.result = _svcctl_QueryServiceLockStatusA(p, r);
2398         
2399         if (p->rng_fault_state) {
2400                 talloc_free(r);
2401                 /* Return True here, srv_pipe_hnd.c will take care */
2402                 return True;
2403         }
2404         
2405         if (DEBUGLEVEL >= 10)
2406                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, r);
2407         
2408         push = ndr_push_init_ctx(r);
2409         if (push == NULL) {
2410                 talloc_free(r);
2411                 return False;
2412         }
2413         
2414         ndr_err = call->ndr_push(push, NDR_OUT, r);
2415         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2416                 talloc_free(r);
2417                 return False;
2418         }
2419         
2420         blob = ndr_push_blob(push);
2421         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2422                 talloc_free(r);
2423                 return False;
2424         }
2425         
2426         talloc_free(r);
2427         
2428         return True;
2429 }
2430
2431 static bool api_svcctl_StartServiceA(pipes_struct *p)
2432 {
2433         const struct ndr_interface_call *call;
2434         struct ndr_pull *pull;
2435         struct ndr_push *push;
2436         enum ndr_err_code ndr_err;
2437         DATA_BLOB blob;
2438         struct svcctl_StartServiceA *r;
2439         
2440         call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEA];
2441         
2442         r = talloc(NULL, struct svcctl_StartServiceA);
2443         if (r == NULL) {
2444                 return False;
2445         }
2446         
2447         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2448                 talloc_free(r);
2449                 return False;
2450         }
2451         
2452         pull = ndr_pull_init_blob(&blob, r);
2453         if (pull == NULL) {
2454                 talloc_free(r);
2455                 return False;
2456         }
2457         
2458         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2459         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2460         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2461                 talloc_free(r);
2462                 return False;
2463         }
2464         
2465         if (DEBUGLEVEL >= 10)
2466                 NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, r);
2467         
2468         r->out.result = _svcctl_StartServiceA(p, r);
2469         
2470         if (p->rng_fault_state) {
2471                 talloc_free(r);
2472                 /* Return True here, srv_pipe_hnd.c will take care */
2473                 return True;
2474         }
2475         
2476         if (DEBUGLEVEL >= 10)
2477                 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, r);
2478         
2479         push = ndr_push_init_ctx(r);
2480         if (push == NULL) {
2481                 talloc_free(r);
2482                 return False;
2483         }
2484         
2485         ndr_err = call->ndr_push(push, NDR_OUT, r);
2486         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2487                 talloc_free(r);
2488                 return False;
2489         }
2490         
2491         blob = ndr_push_blob(push);
2492         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2493                 talloc_free(r);
2494                 return False;
2495         }
2496         
2497         talloc_free(r);
2498         
2499         return True;
2500 }
2501
2502 static bool api_svcctl_GetServiceDisplayNameA(pipes_struct *p)
2503 {
2504         const struct ndr_interface_call *call;
2505         struct ndr_pull *pull;
2506         struct ndr_push *push;
2507         enum ndr_err_code ndr_err;
2508         DATA_BLOB blob;
2509         struct svcctl_GetServiceDisplayNameA *r;
2510         
2511         call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEA];
2512         
2513         r = talloc(NULL, struct svcctl_GetServiceDisplayNameA);
2514         if (r == NULL) {
2515                 return False;
2516         }
2517         
2518         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2519                 talloc_free(r);
2520                 return False;
2521         }
2522         
2523         pull = ndr_pull_init_blob(&blob, r);
2524         if (pull == NULL) {
2525                 talloc_free(r);
2526                 return False;
2527         }
2528         
2529         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2530         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2531         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2532                 talloc_free(r);
2533                 return False;
2534         }
2535         
2536         if (DEBUGLEVEL >= 10)
2537                 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, r);
2538         
2539         ZERO_STRUCT(r->out);
2540         r->out.display_name = talloc_zero(r, const char *);
2541         if (r->out.display_name == NULL) {
2542                 talloc_free(r);
2543                 return False;
2544         }
2545         
2546         r->out.display_name_length = r->in.display_name_length;
2547         r->out.result = _svcctl_GetServiceDisplayNameA(p, r);
2548         
2549         if (p->rng_fault_state) {
2550                 talloc_free(r);
2551                 /* Return True here, srv_pipe_hnd.c will take care */
2552                 return True;
2553         }
2554         
2555         if (DEBUGLEVEL >= 10)
2556                 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, r);
2557         
2558         push = ndr_push_init_ctx(r);
2559         if (push == NULL) {
2560                 talloc_free(r);
2561                 return False;
2562         }
2563         
2564         ndr_err = call->ndr_push(push, NDR_OUT, r);
2565         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2566                 talloc_free(r);
2567                 return False;
2568         }
2569         
2570         blob = ndr_push_blob(push);
2571         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2572                 talloc_free(r);
2573                 return False;
2574         }
2575         
2576         talloc_free(r);
2577         
2578         return True;
2579 }
2580
2581 static bool api_svcctl_GetServiceKeyNameA(pipes_struct *p)
2582 {
2583         const struct ndr_interface_call *call;
2584         struct ndr_pull *pull;
2585         struct ndr_push *push;
2586         enum ndr_err_code ndr_err;
2587         DATA_BLOB blob;
2588         struct svcctl_GetServiceKeyNameA *r;
2589         
2590         call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEA];
2591         
2592         r = talloc(NULL, struct svcctl_GetServiceKeyNameA);
2593         if (r == NULL) {
2594                 return False;
2595         }
2596         
2597         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2598                 talloc_free(r);
2599                 return False;
2600         }
2601         
2602         pull = ndr_pull_init_blob(&blob, r);
2603         if (pull == NULL) {
2604                 talloc_free(r);
2605                 return False;
2606         }
2607         
2608         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2609         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2610         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2611                 talloc_free(r);
2612                 return False;
2613         }
2614         
2615         if (DEBUGLEVEL >= 10)
2616                 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, r);
2617         
2618         ZERO_STRUCT(r->out);
2619         r->out.key_name = talloc_zero(r, const char *);
2620         if (r->out.key_name == NULL) {
2621                 talloc_free(r);
2622                 return False;
2623         }
2624         
2625         r->out.display_name_length = r->in.display_name_length;
2626         r->out.result = _svcctl_GetServiceKeyNameA(p, r);
2627         
2628         if (p->rng_fault_state) {
2629                 talloc_free(r);
2630                 /* Return True here, srv_pipe_hnd.c will take care */
2631                 return True;
2632         }
2633         
2634         if (DEBUGLEVEL >= 10)
2635                 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, r);
2636         
2637         push = ndr_push_init_ctx(r);
2638         if (push == NULL) {
2639                 talloc_free(r);
2640                 return False;
2641         }
2642         
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;
2647         }
2648         
2649         blob = ndr_push_blob(push);
2650         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2651                 talloc_free(r);
2652                 return False;
2653         }
2654         
2655         talloc_free(r);
2656         
2657         return True;
2658 }
2659
2660 static bool api_svcctl_GetCurrentGroupeStateW(pipes_struct *p)
2661 {
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_GetCurrentGroupeStateW *r;
2668         
2669         call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETCURRENTGROUPESTATEW];
2670         
2671         r = talloc(NULL, struct svcctl_GetCurrentGroupeStateW);
2672         if (r == NULL) {
2673                 return False;
2674         }
2675         
2676         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2677                 talloc_free(r);
2678                 return False;
2679         }
2680         
2681         pull = ndr_pull_init_blob(&blob, r);
2682         if (pull == NULL) {
2683                 talloc_free(r);
2684                 return False;
2685         }
2686         
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;
2692         }
2693         
2694         if (DEBUGLEVEL >= 10)
2695                 NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, r);
2696         
2697         r->out.result = _svcctl_GetCurrentGroupeStateW(p, r);
2698         
2699         if (p->rng_fault_state) {
2700                 talloc_free(r);
2701                 /* Return True here, srv_pipe_hnd.c will take care */
2702                 return True;
2703         }
2704         
2705         if (DEBUGLEVEL >= 10)
2706                 NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, r);
2707         
2708         push = ndr_push_init_ctx(r);
2709         if (push == NULL) {
2710                 talloc_free(r);
2711                 return False;
2712         }
2713         
2714         ndr_err = call->ndr_push(push, NDR_OUT, r);
2715         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2716                 talloc_free(r);
2717                 return False;
2718         }
2719         
2720         blob = ndr_push_blob(push);
2721         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2722                 talloc_free(r);
2723                 return False;
2724         }
2725         
2726         talloc_free(r);
2727         
2728         return True;
2729 }
2730
2731 static bool api_svcctl_EnumServiceGroupW(pipes_struct *p)
2732 {
2733         const struct ndr_interface_call *call;
2734         struct ndr_pull *pull;
2735         struct ndr_push *push;
2736         enum ndr_err_code ndr_err;
2737         DATA_BLOB blob;
2738         struct svcctl_EnumServiceGroupW *r;
2739         
2740         call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICEGROUPW];
2741         
2742         r = talloc(NULL, struct svcctl_EnumServiceGroupW);
2743         if (r == NULL) {
2744                 return False;
2745         }
2746         
2747         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2748                 talloc_free(r);
2749                 return False;
2750         }
2751         
2752         pull = ndr_pull_init_blob(&blob, r);
2753         if (pull == NULL) {
2754                 talloc_free(r);
2755                 return False;
2756         }
2757         
2758         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2759         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2760         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2761                 talloc_free(r);
2762                 return False;
2763         }
2764         
2765         if (DEBUGLEVEL >= 10)
2766                 NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, r);
2767         
2768         r->out.result = _svcctl_EnumServiceGroupW(p, r);
2769         
2770         if (p->rng_fault_state) {
2771                 talloc_free(r);
2772                 /* Return True here, srv_pipe_hnd.c will take care */
2773                 return True;
2774         }
2775         
2776         if (DEBUGLEVEL >= 10)
2777                 NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, r);
2778         
2779         push = ndr_push_init_ctx(r);
2780         if (push == NULL) {
2781                 talloc_free(r);
2782                 return False;
2783         }
2784         
2785         ndr_err = call->ndr_push(push, NDR_OUT, r);
2786         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2787                 talloc_free(r);
2788                 return False;
2789         }
2790         
2791         blob = ndr_push_blob(push);
2792         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2793                 talloc_free(r);
2794                 return False;
2795         }
2796         
2797         talloc_free(r);
2798         
2799         return True;
2800 }
2801
2802 static bool api_svcctl_ChangeServiceConfig2A(pipes_struct *p)
2803 {
2804         const struct ndr_interface_call *call;
2805         struct ndr_pull *pull;
2806         struct ndr_push *push;
2807         enum ndr_err_code ndr_err;
2808         DATA_BLOB blob;
2809         struct svcctl_ChangeServiceConfig2A *r;
2810         
2811         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2A];
2812         
2813         r = talloc(NULL, struct svcctl_ChangeServiceConfig2A);
2814         if (r == NULL) {
2815                 return False;
2816         }
2817         
2818         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2819                 talloc_free(r);
2820                 return False;
2821         }
2822         
2823         pull = ndr_pull_init_blob(&blob, r);
2824         if (pull == NULL) {
2825                 talloc_free(r);
2826                 return False;
2827         }
2828         
2829         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2830         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2831         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2832                 talloc_free(r);
2833                 return False;
2834         }
2835         
2836         if (DEBUGLEVEL >= 10)
2837                 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, r);
2838         
2839         r->out.result = _svcctl_ChangeServiceConfig2A(p, r);
2840         
2841         if (p->rng_fault_state) {
2842                 talloc_free(r);
2843                 /* Return True here, srv_pipe_hnd.c will take care */
2844                 return True;
2845         }
2846         
2847         if (DEBUGLEVEL >= 10)
2848                 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, r);
2849         
2850         push = ndr_push_init_ctx(r);
2851         if (push == NULL) {
2852                 talloc_free(r);
2853                 return False;
2854         }
2855         
2856         ndr_err = call->ndr_push(push, NDR_OUT, r);
2857         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2858                 talloc_free(r);
2859                 return False;
2860         }
2861         
2862         blob = ndr_push_blob(push);
2863         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2864                 talloc_free(r);
2865                 return False;
2866         }
2867         
2868         talloc_free(r);
2869         
2870         return True;
2871 }
2872
2873 static bool api_svcctl_ChangeServiceConfig2W(pipes_struct *p)
2874 {
2875         const struct ndr_interface_call *call;
2876         struct ndr_pull *pull;
2877         struct ndr_push *push;
2878         enum ndr_err_code ndr_err;
2879         DATA_BLOB blob;
2880         struct svcctl_ChangeServiceConfig2W *r;
2881         
2882         call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2W];
2883         
2884         r = talloc(NULL, struct svcctl_ChangeServiceConfig2W);
2885         if (r == NULL) {
2886                 return False;
2887         }
2888         
2889         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2890                 talloc_free(r);
2891                 return False;
2892         }
2893         
2894         pull = ndr_pull_init_blob(&blob, r);
2895         if (pull == NULL) {
2896                 talloc_free(r);
2897                 return False;
2898         }
2899         
2900         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2901         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2902         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2903                 talloc_free(r);
2904                 return False;
2905         }
2906         
2907         if (DEBUGLEVEL >= 10)
2908                 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, r);
2909         
2910         r->out.result = _svcctl_ChangeServiceConfig2W(p, r);
2911         
2912         if (p->rng_fault_state) {
2913                 talloc_free(r);
2914                 /* Return True here, srv_pipe_hnd.c will take care */
2915                 return True;
2916         }
2917         
2918         if (DEBUGLEVEL >= 10)
2919                 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, r);
2920         
2921         push = ndr_push_init_ctx(r);
2922         if (push == NULL) {
2923                 talloc_free(r);
2924                 return False;
2925         }
2926         
2927         ndr_err = call->ndr_push(push, NDR_OUT, r);
2928         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2929                 talloc_free(r);
2930                 return False;
2931         }
2932         
2933         blob = ndr_push_blob(push);
2934         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2935                 talloc_free(r);
2936                 return False;
2937         }
2938         
2939         talloc_free(r);
2940         
2941         return True;
2942 }
2943
2944 static bool api_svcctl_QueryServiceConfig2A(pipes_struct *p)
2945 {
2946         const struct ndr_interface_call *call;
2947         struct ndr_pull *pull;
2948         struct ndr_push *push;
2949         enum ndr_err_code ndr_err;
2950         DATA_BLOB blob;
2951         struct svcctl_QueryServiceConfig2A *r;
2952         
2953         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2A];
2954         
2955         r = talloc(NULL, struct svcctl_QueryServiceConfig2A);
2956         if (r == NULL) {
2957                 return False;
2958         }
2959         
2960         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2961                 talloc_free(r);
2962                 return False;
2963         }
2964         
2965         pull = ndr_pull_init_blob(&blob, r);
2966         if (pull == NULL) {
2967                 talloc_free(r);
2968                 return False;
2969         }
2970         
2971         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2972         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2973         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2974                 talloc_free(r);
2975                 return False;
2976         }
2977         
2978         if (DEBUGLEVEL >= 10)
2979                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, r);
2980         
2981         ZERO_STRUCT(r->out);
2982         r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size);
2983         if (r->out.buffer == NULL) {
2984                 talloc_free(r);
2985                 return False;
2986         }
2987         
2988         r->out.bytes_needed = talloc_zero(r, uint32_t);
2989         if (r->out.bytes_needed == NULL) {
2990                 talloc_free(r);
2991                 return False;
2992         }
2993         
2994         r->out.result = _svcctl_QueryServiceConfig2A(p, r);
2995         
2996         if (p->rng_fault_state) {
2997                 talloc_free(r);
2998                 /* Return True here, srv_pipe_hnd.c will take care */
2999                 return True;
3000         }
3001         
3002         if (DEBUGLEVEL >= 10)
3003                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, r);
3004         
3005         push = ndr_push_init_ctx(r);
3006         if (push == NULL) {
3007                 talloc_free(r);
3008                 return False;
3009         }
3010         
3011         ndr_err = call->ndr_push(push, NDR_OUT, r);
3012         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3013                 talloc_free(r);
3014                 return False;
3015         }
3016         
3017         blob = ndr_push_blob(push);
3018         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3019                 talloc_free(r);
3020                 return False;
3021         }
3022         
3023         talloc_free(r);
3024         
3025         return True;
3026 }
3027
3028 static bool api_svcctl_QueryServiceConfig2W(pipes_struct *p)
3029 {
3030         const struct ndr_interface_call *call;
3031         struct ndr_pull *pull;
3032         struct ndr_push *push;
3033         enum ndr_err_code ndr_err;
3034         DATA_BLOB blob;
3035         struct svcctl_QueryServiceConfig2W *r;
3036         
3037         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2W];
3038         
3039         r = talloc(NULL, struct svcctl_QueryServiceConfig2W);
3040         if (r == NULL) {
3041                 return False;
3042         }
3043         
3044         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3045                 talloc_free(r);
3046                 return False;
3047         }
3048         
3049         pull = ndr_pull_init_blob(&blob, r);
3050         if (pull == NULL) {
3051                 talloc_free(r);
3052                 return False;
3053         }
3054         
3055         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3056         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3057         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3058                 talloc_free(r);
3059                 return False;
3060         }
3061         
3062         if (DEBUGLEVEL >= 10)
3063                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, r);
3064         
3065         ZERO_STRUCT(r->out);
3066         r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size);
3067         if (r->out.buffer == NULL) {
3068                 talloc_free(r);
3069                 return False;
3070         }
3071         
3072         r->out.bytes_needed = talloc_zero(r, uint32_t);
3073         if (r->out.bytes_needed == NULL) {
3074                 talloc_free(r);
3075                 return False;
3076         }
3077         
3078         r->out.result = _svcctl_QueryServiceConfig2W(p, r);
3079         
3080         if (p->rng_fault_state) {
3081                 talloc_free(r);
3082                 /* Return True here, srv_pipe_hnd.c will take care */
3083                 return True;
3084         }
3085         
3086         if (DEBUGLEVEL >= 10)
3087                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, r);
3088         
3089         push = ndr_push_init_ctx(r);
3090         if (push == NULL) {
3091                 talloc_free(r);
3092                 return False;
3093         }
3094         
3095         ndr_err = call->ndr_push(push, NDR_OUT, r);
3096         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3097                 talloc_free(r);
3098                 return False;
3099         }
3100         
3101         blob = ndr_push_blob(push);
3102         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3103                 talloc_free(r);
3104                 return False;
3105         }
3106         
3107         talloc_free(r);
3108         
3109         return True;
3110 }
3111
3112 static bool api_svcctl_QueryServiceStatusEx(pipes_struct *p)
3113 {
3114         const struct ndr_interface_call *call;
3115         struct ndr_pull *pull;
3116         struct ndr_push *push;
3117         enum ndr_err_code ndr_err;
3118         DATA_BLOB blob;
3119         struct svcctl_QueryServiceStatusEx *r;
3120         
3121         call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUSEX];
3122         
3123         r = talloc(NULL, struct svcctl_QueryServiceStatusEx);
3124         if (r == NULL) {
3125                 return False;
3126         }
3127         
3128         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3129                 talloc_free(r);
3130                 return False;
3131         }
3132         
3133         pull = ndr_pull_init_blob(&blob, r);
3134         if (pull == NULL) {
3135                 talloc_free(r);
3136                 return False;
3137         }
3138         
3139         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3140         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3141         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3142                 talloc_free(r);
3143                 return False;
3144         }
3145         
3146         if (DEBUGLEVEL >= 10)
3147                 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, r);
3148         
3149         ZERO_STRUCT(r->out);
3150         r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size);
3151         if (r->out.buffer == NULL) {
3152                 talloc_free(r);
3153                 return False;
3154         }
3155         
3156         r->out.bytes_needed = talloc_zero(r, uint32_t);
3157         if (r->out.bytes_needed == NULL) {
3158                 talloc_free(r);
3159                 return False;
3160         }
3161         
3162         r->out.result = _svcctl_QueryServiceStatusEx(p, r);
3163         
3164         if (p->rng_fault_state) {
3165                 talloc_free(r);
3166                 /* Return True here, srv_pipe_hnd.c will take care */
3167                 return True;
3168         }
3169         
3170         if (DEBUGLEVEL >= 10)
3171                 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, r);
3172         
3173         push = ndr_push_init_ctx(r);
3174         if (push == NULL) {
3175                 talloc_free(r);
3176                 return False;
3177         }
3178         
3179         ndr_err = call->ndr_push(push, NDR_OUT, r);
3180         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3181                 talloc_free(r);
3182                 return False;
3183         }
3184         
3185         blob = ndr_push_blob(push);
3186         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3187                 talloc_free(r);
3188                 return False;
3189         }
3190         
3191         talloc_free(r);
3192         
3193         return True;
3194 }
3195
3196 static bool api_EnumServicesStatusExA(pipes_struct *p)
3197 {
3198         const struct ndr_interface_call *call;
3199         struct ndr_pull *pull;
3200         struct ndr_push *push;
3201         enum ndr_err_code ndr_err;
3202         DATA_BLOB blob;
3203         struct EnumServicesStatusExA *r;
3204         
3205         call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXA];
3206         
3207         r = talloc(NULL, struct EnumServicesStatusExA);
3208         if (r == NULL) {
3209                 return False;
3210         }
3211         
3212         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3213                 talloc_free(r);
3214                 return False;
3215         }
3216         
3217         pull = ndr_pull_init_blob(&blob, r);
3218         if (pull == NULL) {
3219                 talloc_free(r);
3220                 return False;
3221         }
3222         
3223         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3224         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3225         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3226                 talloc_free(r);
3227                 return False;
3228         }
3229         
3230         if (DEBUGLEVEL >= 10)
3231                 NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, r);
3232         
3233         ZERO_STRUCT(r->out);
3234         r->out.services = talloc_zero_array(r, uint8_t, r->in.buf_size);
3235         if (r->out.services == NULL) {
3236                 talloc_free(r);
3237                 return False;
3238         }
3239         
3240         r->out.bytes_needed = talloc_zero(r, uint32_t);
3241         if (r->out.bytes_needed == NULL) {
3242                 talloc_free(r);
3243                 return False;
3244         }
3245         
3246         r->out.service_returned = talloc_zero(r, uint32_t);
3247         if (r->out.service_returned == NULL) {
3248                 talloc_free(r);
3249                 return False;
3250         }
3251         
3252         r->out.resume_handle = r->in.resume_handle;
3253         r->out.group_name = talloc_zero(r, const char *);
3254         if (r->out.group_name == NULL) {
3255                 talloc_free(r);
3256                 return False;
3257         }
3258         
3259         r->out.result = _EnumServicesStatusExA(p, r);
3260         
3261         if (p->rng_fault_state) {
3262                 talloc_free(r);
3263                 /* Return True here, srv_pipe_hnd.c will take care */
3264                 return True;
3265         }
3266         
3267         if (DEBUGLEVEL >= 10)
3268                 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, r);
3269         
3270         push = ndr_push_init_ctx(r);
3271         if (push == NULL) {
3272                 talloc_free(r);
3273                 return False;
3274         }
3275         
3276         ndr_err = call->ndr_push(push, NDR_OUT, r);
3277         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3278                 talloc_free(r);
3279                 return False;
3280         }
3281         
3282         blob = ndr_push_blob(push);
3283         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3284                 talloc_free(r);
3285                 return False;
3286         }
3287         
3288         talloc_free(r);
3289         
3290         return True;
3291 }
3292
3293 static bool api_EnumServicesStatusExW(pipes_struct *p)
3294 {
3295         const struct ndr_interface_call *call;
3296         struct ndr_pull *pull;
3297         struct ndr_push *push;
3298         enum ndr_err_code ndr_err;
3299         DATA_BLOB blob;
3300         struct EnumServicesStatusExW *r;
3301         
3302         call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXW];
3303         
3304         r = talloc(NULL, struct EnumServicesStatusExW);
3305         if (r == NULL) {
3306                 return False;
3307         }
3308         
3309         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3310                 talloc_free(r);
3311                 return False;
3312         }
3313         
3314         pull = ndr_pull_init_blob(&blob, r);
3315         if (pull == NULL) {
3316                 talloc_free(r);
3317                 return False;
3318         }
3319         
3320         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3321         ndr_err = call->ndr_pull(pull, NDR_IN, r);
3322         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3323                 talloc_free(r);
3324                 return False;
3325         }
3326         
3327         if (DEBUGLEVEL >= 10)
3328                 NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, r);
3329         
3330         ZERO_STRUCT(r->out);
3331         r->out.services = talloc_zero_array(r, uint8_t, r->in.buf_size);
3332         if (r->out.services == NULL) {
3333                 talloc_free(r);
3334                 return False;
3335         }
3336         
3337         r->out.bytes_needed = talloc_zero(r, uint32_t);
3338         if (r->out.bytes_needed == NULL) {
3339                 talloc_free(r);
3340                 return False;
3341         }
3342         
3343         r->out.service_returned = talloc_zero(r, uint32_t);
3344         if (r->out.service_returned == NULL) {
3345                 talloc_free(r);
3346                 return False;
3347         }
3348         
3349         r->out.resume_handle = r->in.resume_handle;
3350         r->out.group_name = talloc_zero(r, const char *);
3351         if (r->out.group_name == NULL) {
3352                 talloc_free(r);
3353                 return False;
3354         }
3355         
3356         r->out.result = _EnumServicesStatusExW(p, r);
3357         
3358         if (p->rng_fault_state) {
3359                 talloc_free(r);
3360                 /* Return True here, srv_pipe_hnd.c will take care */
3361                 return True;
3362         }
3363         
3364         if (DEBUGLEVEL >= 10)
3365                 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, r);
3366         
3367         push = ndr_push_init_ctx(r);
3368         if (push == NULL) {
3369                 talloc_free(r);
3370                 return False;
3371         }
3372         
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;
3377         }
3378         
3379         blob = ndr_push_blob(push);
3380         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3381                 talloc_free(r);
3382                 return False;
3383         }
3384         
3385         talloc_free(r);
3386         
3387         return True;
3388 }
3389
3390 static bool api_svcctl_SCSendTSMessage(pipes_struct *p)
3391 {
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 svcctl_SCSendTSMessage *r;
3398         
3399         call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSENDTSMESSAGE];
3400         
3401         r = talloc(NULL, struct svcctl_SCSendTSMessage);
3402         if (r == NULL) {
3403                 return False;
3404         }
3405         
3406         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3407                 talloc_free(r);
3408                 return False;
3409         }
3410         
3411         pull = ndr_pull_init_blob(&blob, r);
3412         if (pull == NULL) {
3413                 talloc_free(r);
3414                 return False;
3415         }
3416         
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;
3422         }
3423         
3424         if (DEBUGLEVEL >= 10)
3425                 NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, r);
3426         
3427         r->out.result = _svcctl_SCSendTSMessage(p, r);
3428         
3429         if (p->rng_fault_state) {
3430                 talloc_free(r);
3431                 /* Return True here, srv_pipe_hnd.c will take care */
3432                 return True;
3433         }
3434         
3435         if (DEBUGLEVEL >= 10)
3436                 NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, r);
3437         
3438         push = ndr_push_init_ctx(r);
3439         if (push == NULL) {
3440                 talloc_free(r);
3441                 return False;
3442         }
3443         
3444         ndr_err = call->ndr_push(push, NDR_OUT, r);
3445         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3446                 talloc_free(r);
3447                 return False;
3448         }
3449         
3450         blob = ndr_push_blob(push);
3451         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3452                 talloc_free(r);
3453                 return False;
3454         }
3455         
3456         talloc_free(r);
3457         
3458         return True;
3459 }
3460
3461
3462 /* Tables */
3463 static struct api_struct api_svcctl_cmds[] = 
3464 {
3465         {"SVCCTL_CLOSESERVICEHANDLE", NDR_SVCCTL_CLOSESERVICEHANDLE, api_svcctl_CloseServiceHandle},
3466         {"SVCCTL_CONTROLSERVICE", NDR_SVCCTL_CONTROLSERVICE, api_svcctl_ControlService},
3467         {"SVCCTL_DELETESERVICE", NDR_SVCCTL_DELETESERVICE, api_svcctl_DeleteService},
3468         {"SVCCTL_LOCKSERVICEDATABASE", NDR_SVCCTL_LOCKSERVICEDATABASE, api_svcctl_LockServiceDatabase},
3469         {"SVCCTL_QUERYSERVICEOBJECTSECURITY", NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, api_svcctl_QueryServiceObjectSecurity},
3470         {"SVCCTL_SETSERVICEOBJECTSECURITY", NDR_SVCCTL_SETSERVICEOBJECTSECURITY, api_svcctl_SetServiceObjectSecurity},
3471         {"SVCCTL_QUERYSERVICESTATUS", NDR_SVCCTL_QUERYSERVICESTATUS, api_svcctl_QueryServiceStatus},
3472         {"SVCCTL_SETSERVICESTATUS", NDR_SVCCTL_SETSERVICESTATUS, api_svcctl_SetServiceStatus},
3473         {"SVCCTL_UNLOCKSERVICEDATABASE", NDR_SVCCTL_UNLOCKSERVICEDATABASE, api_svcctl_UnlockServiceDatabase},
3474         {"SVCCTL_NOTIFYBOOTCONFIGSTATUS", NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS, api_svcctl_NotifyBootConfigStatus},
3475         {"SVCCTL_SCSETSERVICEBITSW", NDR_SVCCTL_SCSETSERVICEBITSW, api_svcctl_SCSetServiceBitsW},
3476         {"SVCCTL_CHANGESERVICECONFIGW", NDR_SVCCTL_CHANGESERVICECONFIGW, api_svcctl_ChangeServiceConfigW},
3477         {"SVCCTL_CREATESERVICEW", NDR_SVCCTL_CREATESERVICEW, api_svcctl_CreateServiceW},
3478         {"SVCCTL_ENUMDEPENDENTSERVICESW", NDR_SVCCTL_ENUMDEPENDENTSERVICESW, api_svcctl_EnumDependentServicesW},
3479         {"SVCCTL_ENUMSERVICESSTATUSW", NDR_SVCCTL_ENUMSERVICESSTATUSW, api_svcctl_EnumServicesStatusW},
3480         {"SVCCTL_OPENSCMANAGERW", NDR_SVCCTL_OPENSCMANAGERW, api_svcctl_OpenSCManagerW},
3481         {"SVCCTL_OPENSERVICEW", NDR_SVCCTL_OPENSERVICEW, api_svcctl_OpenServiceW},
3482         {"SVCCTL_QUERYSERVICECONFIGW", NDR_SVCCTL_QUERYSERVICECONFIGW, api_svcctl_QueryServiceConfigW},
3483         {"SVCCTL_QUERYSERVICELOCKSTATUSW", NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, api_svcctl_QueryServiceLockStatusW},
3484         {"SVCCTL_STARTSERVICEW", NDR_SVCCTL_STARTSERVICEW, api_svcctl_StartServiceW},
3485         {"SVCCTL_GETSERVICEDISPLAYNAMEW", NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, api_svcctl_GetServiceDisplayNameW},
3486         {"SVCCTL_GETSERVICEKEYNAMEW", NDR_SVCCTL_GETSERVICEKEYNAMEW, api_svcctl_GetServiceKeyNameW},
3487         {"SVCCTL_SCSETSERVICEBITSA", NDR_SVCCTL_SCSETSERVICEBITSA, api_svcctl_SCSetServiceBitsA},
3488         {"SVCCTL_CHANGESERVICECONFIGA", NDR_SVCCTL_CHANGESERVICECONFIGA, api_svcctl_ChangeServiceConfigA},
3489         {"SVCCTL_CREATESERVICEA", NDR_SVCCTL_CREATESERVICEA, api_svcctl_CreateServiceA},
3490         {"SVCCTL_ENUMDEPENDENTSERVICESA", NDR_SVCCTL_ENUMDEPENDENTSERVICESA, api_svcctl_EnumDependentServicesA},
3491         {"SVCCTL_ENUMSERVICESSTATUSA", NDR_SVCCTL_ENUMSERVICESSTATUSA, api_svcctl_EnumServicesStatusA},
3492         {"SVCCTL_OPENSCMANAGERA", NDR_SVCCTL_OPENSCMANAGERA, api_svcctl_OpenSCManagerA},
3493         {"SVCCTL_OPENSERVICEA", NDR_SVCCTL_OPENSERVICEA, api_svcctl_OpenServiceA},
3494         {"SVCCTL_QUERYSERVICECONFIGA", NDR_SVCCTL_QUERYSERVICECONFIGA, api_svcctl_QueryServiceConfigA},
3495         {"SVCCTL_QUERYSERVICELOCKSTATUSA", NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, api_svcctl_QueryServiceLockStatusA},
3496         {"SVCCTL_STARTSERVICEA", NDR_SVCCTL_STARTSERVICEA, api_svcctl_StartServiceA},
3497         {"SVCCTL_GETSERVICEDISPLAYNAMEA", NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, api_svcctl_GetServiceDisplayNameA},
3498         {"SVCCTL_GETSERVICEKEYNAMEA", NDR_SVCCTL_GETSERVICEKEYNAMEA, api_svcctl_GetServiceKeyNameA},
3499         {"SVCCTL_GETCURRENTGROUPESTATEW", NDR_SVCCTL_GETCURRENTGROUPESTATEW, api_svcctl_GetCurrentGroupeStateW},
3500         {"SVCCTL_ENUMSERVICEGROUPW", NDR_SVCCTL_ENUMSERVICEGROUPW, api_svcctl_EnumServiceGroupW},
3501         {"SVCCTL_CHANGESERVICECONFIG2A", NDR_SVCCTL_CHANGESERVICECONFIG2A, api_svcctl_ChangeServiceConfig2A},
3502         {"SVCCTL_CHANGESERVICECONFIG2W", NDR_SVCCTL_CHANGESERVICECONFIG2W, api_svcctl_ChangeServiceConfig2W},
3503         {"SVCCTL_QUERYSERVICECONFIG2A", NDR_SVCCTL_QUERYSERVICECONFIG2A, api_svcctl_QueryServiceConfig2A},
3504         {"SVCCTL_QUERYSERVICECONFIG2W", NDR_SVCCTL_QUERYSERVICECONFIG2W, api_svcctl_QueryServiceConfig2W},
3505         {"SVCCTL_QUERYSERVICESTATUSEX", NDR_SVCCTL_QUERYSERVICESTATUSEX, api_svcctl_QueryServiceStatusEx},
3506         {"ENUMSERVICESSTATUSEXA", NDR_ENUMSERVICESSTATUSEXA, api_EnumServicesStatusExA},
3507         {"ENUMSERVICESSTATUSEXW", NDR_ENUMSERVICESSTATUSEXW, api_EnumServicesStatusExW},
3508         {"SVCCTL_SCSENDTSMESSAGE", NDR_SVCCTL_SCSENDTSMESSAGE, api_svcctl_SCSendTSMessage},
3509 };
3510
3511 void svcctl_get_pipe_fns(struct api_struct **fns, int *n_fns)
3512 {
3513         *fns = api_svcctl_cmds;
3514         *n_fns = sizeof(api_svcctl_cmds) / sizeof(struct api_struct);
3515 }
3516
3517 NTSTATUS rpc_svcctl_init(void)
3518 {
3519         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "svcctl", "svcctl", api_svcctl_cmds, sizeof(api_svcctl_cmds) / sizeof(struct api_struct));
3520 }