Move SMB2 constants to a separate file
[Samba/fernandojvsilva.git] / librpc / gen_ndr / cli_svcctl.c
bloba95a4e72f71a9be234d01ded8c340e5a9c883e8d
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_svcctl.h"
9 NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
10 TALLOC_CTX *mem_ctx,
11 struct policy_handle *handle /* [in,out] [ref] */,
12 WERROR *werror)
14 struct svcctl_CloseServiceHandle r;
15 NTSTATUS status;
17 /* In parameters */
18 r.in.handle = handle;
20 if (DEBUGLEVEL >= 10) {
21 NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, &r);
24 status = cli->dispatch(cli,
25 mem_ctx,
26 &ndr_table_svcctl,
27 NDR_SVCCTL_CLOSESERVICEHANDLE,
28 &r);
30 if (!NT_STATUS_IS_OK(status)) {
31 return status;
34 if (DEBUGLEVEL >= 10) {
35 NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &r);
38 if (NT_STATUS_IS_ERR(status)) {
39 return status;
42 /* Return variables */
43 *handle = *r.out.handle;
45 /* Return result */
46 if (werror) {
47 *werror = r.out.result;
50 return werror_to_ntstatus(r.out.result);
53 NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli,
54 TALLOC_CTX *mem_ctx,
55 struct policy_handle *handle /* [in] [ref] */,
56 enum SERVICE_CONTROL control /* [in] */,
57 struct SERVICE_STATUS *service_status /* [out] [ref] */,
58 WERROR *werror)
60 struct svcctl_ControlService r;
61 NTSTATUS status;
63 /* In parameters */
64 r.in.handle = handle;
65 r.in.control = control;
67 if (DEBUGLEVEL >= 10) {
68 NDR_PRINT_IN_DEBUG(svcctl_ControlService, &r);
71 status = cli->dispatch(cli,
72 mem_ctx,
73 &ndr_table_svcctl,
74 NDR_SVCCTL_CONTROLSERVICE,
75 &r);
77 if (!NT_STATUS_IS_OK(status)) {
78 return status;
81 if (DEBUGLEVEL >= 10) {
82 NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &r);
85 if (NT_STATUS_IS_ERR(status)) {
86 return status;
89 /* Return variables */
90 *service_status = *r.out.service_status;
92 /* Return result */
93 if (werror) {
94 *werror = r.out.result;
97 return werror_to_ntstatus(r.out.result);
100 NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli,
101 TALLOC_CTX *mem_ctx,
102 struct policy_handle *handle /* [in] [ref] */,
103 WERROR *werror)
105 struct svcctl_DeleteService r;
106 NTSTATUS status;
108 /* In parameters */
109 r.in.handle = handle;
111 if (DEBUGLEVEL >= 10) {
112 NDR_PRINT_IN_DEBUG(svcctl_DeleteService, &r);
115 status = cli->dispatch(cli,
116 mem_ctx,
117 &ndr_table_svcctl,
118 NDR_SVCCTL_DELETESERVICE,
119 &r);
121 if (!NT_STATUS_IS_OK(status)) {
122 return status;
125 if (DEBUGLEVEL >= 10) {
126 NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &r);
129 if (NT_STATUS_IS_ERR(status)) {
130 return status;
133 /* Return variables */
135 /* Return result */
136 if (werror) {
137 *werror = r.out.result;
140 return werror_to_ntstatus(r.out.result);
143 NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli,
144 TALLOC_CTX *mem_ctx,
145 struct policy_handle *handle /* [in] [ref] */,
146 struct policy_handle *lock /* [out] [ref] */,
147 WERROR *werror)
149 struct svcctl_LockServiceDatabase r;
150 NTSTATUS status;
152 /* In parameters */
153 r.in.handle = handle;
155 if (DEBUGLEVEL >= 10) {
156 NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, &r);
159 status = cli->dispatch(cli,
160 mem_ctx,
161 &ndr_table_svcctl,
162 NDR_SVCCTL_LOCKSERVICEDATABASE,
163 &r);
165 if (!NT_STATUS_IS_OK(status)) {
166 return status;
169 if (DEBUGLEVEL >= 10) {
170 NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &r);
173 if (NT_STATUS_IS_ERR(status)) {
174 return status;
177 /* Return variables */
178 *lock = *r.out.lock;
180 /* Return result */
181 if (werror) {
182 *werror = r.out.result;
185 return werror_to_ntstatus(r.out.result);
188 NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
189 TALLOC_CTX *mem_ctx,
190 struct policy_handle *handle /* [in] [ref] */,
191 uint32_t security_flags /* [in] */,
192 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
193 uint32_t offered /* [in] [range(0,0x40000)] */,
194 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
195 WERROR *werror)
197 struct svcctl_QueryServiceObjectSecurity r;
198 NTSTATUS status;
200 /* In parameters */
201 r.in.handle = handle;
202 r.in.security_flags = security_flags;
203 r.in.offered = offered;
205 if (DEBUGLEVEL >= 10) {
206 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &r);
209 status = cli->dispatch(cli,
210 mem_ctx,
211 &ndr_table_svcctl,
212 NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY,
213 &r);
215 if (!NT_STATUS_IS_OK(status)) {
216 return status;
219 if (DEBUGLEVEL >= 10) {
220 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &r);
223 if (NT_STATUS_IS_ERR(status)) {
224 return status;
227 /* Return variables */
228 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
229 *needed = *r.out.needed;
231 /* Return result */
232 if (werror) {
233 *werror = r.out.result;
236 return werror_to_ntstatus(r.out.result);
239 NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
240 TALLOC_CTX *mem_ctx,
241 struct policy_handle *handle /* [in] [ref] */,
242 uint32_t security_flags /* [in] */,
243 uint8_t *buffer /* [in] [ref,size_is(offered)] */,
244 uint32_t offered /* [in] */,
245 WERROR *werror)
247 struct svcctl_SetServiceObjectSecurity r;
248 NTSTATUS status;
250 /* In parameters */
251 r.in.handle = handle;
252 r.in.security_flags = security_flags;
253 r.in.buffer = buffer;
254 r.in.offered = offered;
256 if (DEBUGLEVEL >= 10) {
257 NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r);
260 status = cli->dispatch(cli,
261 mem_ctx,
262 &ndr_table_svcctl,
263 NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
264 &r);
266 if (!NT_STATUS_IS_OK(status)) {
267 return status;
270 if (DEBUGLEVEL >= 10) {
271 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r);
274 if (NT_STATUS_IS_ERR(status)) {
275 return status;
278 /* Return variables */
280 /* Return result */
281 if (werror) {
282 *werror = r.out.result;
285 return werror_to_ntstatus(r.out.result);
288 NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli,
289 TALLOC_CTX *mem_ctx,
290 struct policy_handle *handle /* [in] [ref] */,
291 struct SERVICE_STATUS *service_status /* [out] [ref] */,
292 WERROR *werror)
294 struct svcctl_QueryServiceStatus r;
295 NTSTATUS status;
297 /* In parameters */
298 r.in.handle = handle;
300 if (DEBUGLEVEL >= 10) {
301 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, &r);
304 status = cli->dispatch(cli,
305 mem_ctx,
306 &ndr_table_svcctl,
307 NDR_SVCCTL_QUERYSERVICESTATUS,
308 &r);
310 if (!NT_STATUS_IS_OK(status)) {
311 return status;
314 if (DEBUGLEVEL >= 10) {
315 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &r);
318 if (NT_STATUS_IS_ERR(status)) {
319 return status;
322 /* Return variables */
323 *service_status = *r.out.service_status;
325 /* Return result */
326 if (werror) {
327 *werror = r.out.result;
330 return werror_to_ntstatus(r.out.result);
333 NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli,
334 TALLOC_CTX *mem_ctx,
335 WERROR *werror)
337 struct svcctl_SetServiceStatus r;
338 NTSTATUS status;
340 /* In parameters */
342 if (DEBUGLEVEL >= 10) {
343 NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, &r);
346 status = cli->dispatch(cli,
347 mem_ctx,
348 &ndr_table_svcctl,
349 NDR_SVCCTL_SETSERVICESTATUS,
350 &r);
352 if (!NT_STATUS_IS_OK(status)) {
353 return status;
356 if (DEBUGLEVEL >= 10) {
357 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &r);
360 if (NT_STATUS_IS_ERR(status)) {
361 return status;
364 /* Return variables */
366 /* Return result */
367 if (werror) {
368 *werror = r.out.result;
371 return werror_to_ntstatus(r.out.result);
374 NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli,
375 TALLOC_CTX *mem_ctx,
376 struct policy_handle *lock /* [in,out] [ref] */,
377 WERROR *werror)
379 struct svcctl_UnlockServiceDatabase r;
380 NTSTATUS status;
382 /* In parameters */
383 r.in.lock = lock;
385 if (DEBUGLEVEL >= 10) {
386 NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, &r);
389 status = cli->dispatch(cli,
390 mem_ctx,
391 &ndr_table_svcctl,
392 NDR_SVCCTL_UNLOCKSERVICEDATABASE,
393 &r);
395 if (!NT_STATUS_IS_OK(status)) {
396 return status;
399 if (DEBUGLEVEL >= 10) {
400 NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &r);
403 if (NT_STATUS_IS_ERR(status)) {
404 return status;
407 /* Return variables */
408 *lock = *r.out.lock;
410 /* Return result */
411 if (werror) {
412 *werror = r.out.result;
415 return werror_to_ntstatus(r.out.result);
418 NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli,
419 TALLOC_CTX *mem_ctx,
420 WERROR *werror)
422 struct svcctl_NotifyBootConfigStatus r;
423 NTSTATUS status;
425 /* In parameters */
427 if (DEBUGLEVEL >= 10) {
428 NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, &r);
431 status = cli->dispatch(cli,
432 mem_ctx,
433 &ndr_table_svcctl,
434 NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS,
435 &r);
437 if (!NT_STATUS_IS_OK(status)) {
438 return status;
441 if (DEBUGLEVEL >= 10) {
442 NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &r);
445 if (NT_STATUS_IS_ERR(status)) {
446 return status;
449 /* Return variables */
451 /* Return result */
452 if (werror) {
453 *werror = r.out.result;
456 return werror_to_ntstatus(r.out.result);
459 NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
460 TALLOC_CTX *mem_ctx,
461 struct policy_handle *handle /* [in] [ref] */,
462 uint32_t bits /* [in] */,
463 uint32_t bitson /* [in] */,
464 uint32_t immediate /* [in] */,
465 WERROR *werror)
467 struct svcctl_SCSetServiceBitsW r;
468 NTSTATUS status;
470 /* In parameters */
471 r.in.handle = handle;
472 r.in.bits = bits;
473 r.in.bitson = bitson;
474 r.in.immediate = immediate;
476 if (DEBUGLEVEL >= 10) {
477 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, &r);
480 status = cli->dispatch(cli,
481 mem_ctx,
482 &ndr_table_svcctl,
483 NDR_SVCCTL_SCSETSERVICEBITSW,
484 &r);
486 if (!NT_STATUS_IS_OK(status)) {
487 return status;
490 if (DEBUGLEVEL >= 10) {
491 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &r);
494 if (NT_STATUS_IS_ERR(status)) {
495 return status;
498 /* Return variables */
500 /* Return result */
501 if (werror) {
502 *werror = r.out.result;
505 return werror_to_ntstatus(r.out.result);
508 NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli,
509 TALLOC_CTX *mem_ctx,
510 struct policy_handle *handle /* [in] [ref] */,
511 uint32_t type /* [in] */,
512 enum svcctl_StartType start_type /* [in] */,
513 enum svcctl_ErrorControl error_control /* [in] */,
514 const char *binary_path /* [in] [unique,charset(UTF16)] */,
515 const char *load_order_group /* [in] [unique,charset(UTF16)] */,
516 uint32_t *tag_id /* [out] [ref] */,
517 const char *dependencies /* [in] [unique,charset(UTF16)] */,
518 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
519 const char *password /* [in] [unique,charset(UTF16)] */,
520 const char *display_name /* [in] [unique,charset(UTF16)] */,
521 WERROR *werror)
523 struct svcctl_ChangeServiceConfigW r;
524 NTSTATUS status;
526 /* In parameters */
527 r.in.handle = handle;
528 r.in.type = type;
529 r.in.start_type = start_type;
530 r.in.error_control = error_control;
531 r.in.binary_path = binary_path;
532 r.in.load_order_group = load_order_group;
533 r.in.dependencies = dependencies;
534 r.in.service_start_name = service_start_name;
535 r.in.password = password;
536 r.in.display_name = display_name;
538 if (DEBUGLEVEL >= 10) {
539 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, &r);
542 status = cli->dispatch(cli,
543 mem_ctx,
544 &ndr_table_svcctl,
545 NDR_SVCCTL_CHANGESERVICECONFIGW,
546 &r);
548 if (!NT_STATUS_IS_OK(status)) {
549 return status;
552 if (DEBUGLEVEL >= 10) {
553 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &r);
556 if (NT_STATUS_IS_ERR(status)) {
557 return status;
560 /* Return variables */
561 *tag_id = *r.out.tag_id;
563 /* Return result */
564 if (werror) {
565 *werror = r.out.result;
568 return werror_to_ntstatus(r.out.result);
571 NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli,
572 TALLOC_CTX *mem_ctx,
573 struct policy_handle *scmanager_handle /* [in] [ref] */,
574 const char *ServiceName /* [in] [charset(UTF16)] */,
575 const char *DisplayName /* [in] [unique,charset(UTF16)] */,
576 uint32_t desired_access /* [in] */,
577 uint32_t type /* [in] */,
578 enum svcctl_StartType start_type /* [in] */,
579 enum svcctl_ErrorControl error_control /* [in] */,
580 const char *binary_path /* [in] [charset(UTF16)] */,
581 const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
582 uint32_t *TagId /* [in,out] [unique] */,
583 uint8_t *dependencies /* [in] [unique,size_is(dependencies_size)] */,
584 uint32_t dependencies_size /* [in] */,
585 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
586 uint8_t *password /* [in] [unique,size_is(password_size)] */,
587 uint32_t password_size /* [in] */,
588 struct policy_handle *handle /* [out] [ref] */,
589 WERROR *werror)
591 struct svcctl_CreateServiceW r;
592 NTSTATUS status;
594 /* In parameters */
595 r.in.scmanager_handle = scmanager_handle;
596 r.in.ServiceName = ServiceName;
597 r.in.DisplayName = DisplayName;
598 r.in.desired_access = desired_access;
599 r.in.type = type;
600 r.in.start_type = start_type;
601 r.in.error_control = error_control;
602 r.in.binary_path = binary_path;
603 r.in.LoadOrderGroupKey = LoadOrderGroupKey;
604 r.in.TagId = TagId;
605 r.in.dependencies = dependencies;
606 r.in.dependencies_size = dependencies_size;
607 r.in.service_start_name = service_start_name;
608 r.in.password = password;
609 r.in.password_size = password_size;
611 if (DEBUGLEVEL >= 10) {
612 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, &r);
615 status = cli->dispatch(cli,
616 mem_ctx,
617 &ndr_table_svcctl,
618 NDR_SVCCTL_CREATESERVICEW,
619 &r);
621 if (!NT_STATUS_IS_OK(status)) {
622 return status;
625 if (DEBUGLEVEL >= 10) {
626 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &r);
629 if (NT_STATUS_IS_ERR(status)) {
630 return status;
633 /* Return variables */
634 if (TagId && r.out.TagId) {
635 *TagId = *r.out.TagId;
637 *handle = *r.out.handle;
639 /* Return result */
640 if (werror) {
641 *werror = r.out.result;
644 return werror_to_ntstatus(r.out.result);
647 NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
648 TALLOC_CTX *mem_ctx,
649 struct policy_handle *service /* [in] [ref] */,
650 enum svcctl_ServiceState state /* [in] */,
651 uint8_t *service_status /* [out] [ref,size_is(offered)] */,
652 uint32_t offered /* [in] [range(0,0x40000)] */,
653 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
654 uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
655 WERROR *werror)
657 struct svcctl_EnumDependentServicesW r;
658 NTSTATUS status;
660 /* In parameters */
661 r.in.service = service;
662 r.in.state = state;
663 r.in.offered = offered;
665 if (DEBUGLEVEL >= 10) {
666 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, &r);
669 status = cli->dispatch(cli,
670 mem_ctx,
671 &ndr_table_svcctl,
672 NDR_SVCCTL_ENUMDEPENDENTSERVICESW,
673 &r);
675 if (!NT_STATUS_IS_OK(status)) {
676 return status;
679 if (DEBUGLEVEL >= 10) {
680 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &r);
683 if (NT_STATUS_IS_ERR(status)) {
684 return status;
687 /* Return variables */
688 memcpy(service_status, r.out.service_status, r.in.offered * sizeof(*service_status));
689 *needed = *r.out.needed;
690 *services_returned = *r.out.services_returned;
692 /* Return result */
693 if (werror) {
694 *werror = r.out.result;
697 return werror_to_ntstatus(r.out.result);
700 NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
701 TALLOC_CTX *mem_ctx,
702 struct policy_handle *handle /* [in] [ref] */,
703 uint32_t type /* [in] */,
704 enum svcctl_ServiceState state /* [in] */,
705 uint8_t *service /* [out] [ref,size_is(offered)] */,
706 uint32_t offered /* [in] [range(0,0x40000)] */,
707 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
708 uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
709 uint32_t *resume_handle /* [in,out] [unique] */,
710 WERROR *werror)
712 struct svcctl_EnumServicesStatusW r;
713 NTSTATUS status;
715 /* In parameters */
716 r.in.handle = handle;
717 r.in.type = type;
718 r.in.state = state;
719 r.in.offered = offered;
720 r.in.resume_handle = resume_handle;
722 if (DEBUGLEVEL >= 10) {
723 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, &r);
726 status = cli->dispatch(cli,
727 mem_ctx,
728 &ndr_table_svcctl,
729 NDR_SVCCTL_ENUMSERVICESSTATUSW,
730 &r);
732 if (!NT_STATUS_IS_OK(status)) {
733 return status;
736 if (DEBUGLEVEL >= 10) {
737 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &r);
740 if (NT_STATUS_IS_ERR(status)) {
741 return status;
744 /* Return variables */
745 memcpy(service, r.out.service, r.in.offered * sizeof(*service));
746 *needed = *r.out.needed;
747 *services_returned = *r.out.services_returned;
748 if (resume_handle && r.out.resume_handle) {
749 *resume_handle = *r.out.resume_handle;
752 /* Return result */
753 if (werror) {
754 *werror = r.out.result;
757 return werror_to_ntstatus(r.out.result);
760 NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
761 TALLOC_CTX *mem_ctx,
762 const char *MachineName /* [in] [unique,charset(UTF16)] */,
763 const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
764 uint32_t access_mask /* [in] */,
765 struct policy_handle *handle /* [out] [ref] */,
766 WERROR *werror)
768 struct svcctl_OpenSCManagerW r;
769 NTSTATUS status;
771 /* In parameters */
772 r.in.MachineName = MachineName;
773 r.in.DatabaseName = DatabaseName;
774 r.in.access_mask = access_mask;
776 if (DEBUGLEVEL >= 10) {
777 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &r);
780 status = cli->dispatch(cli,
781 mem_ctx,
782 &ndr_table_svcctl,
783 NDR_SVCCTL_OPENSCMANAGERW,
784 &r);
786 if (!NT_STATUS_IS_OK(status)) {
787 return status;
790 if (DEBUGLEVEL >= 10) {
791 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r);
794 if (NT_STATUS_IS_ERR(status)) {
795 return status;
798 /* Return variables */
799 *handle = *r.out.handle;
801 /* Return result */
802 if (werror) {
803 *werror = r.out.result;
806 return werror_to_ntstatus(r.out.result);
809 NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
810 TALLOC_CTX *mem_ctx,
811 struct policy_handle *scmanager_handle /* [in] [ref] */,
812 const char *ServiceName /* [in] [charset(UTF16)] */,
813 uint32_t access_mask /* [in] */,
814 struct policy_handle *handle /* [out] [ref] */,
815 WERROR *werror)
817 struct svcctl_OpenServiceW r;
818 NTSTATUS status;
820 /* In parameters */
821 r.in.scmanager_handle = scmanager_handle;
822 r.in.ServiceName = ServiceName;
823 r.in.access_mask = access_mask;
825 if (DEBUGLEVEL >= 10) {
826 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, &r);
829 status = cli->dispatch(cli,
830 mem_ctx,
831 &ndr_table_svcctl,
832 NDR_SVCCTL_OPENSERVICEW,
833 &r);
835 if (!NT_STATUS_IS_OK(status)) {
836 return status;
839 if (DEBUGLEVEL >= 10) {
840 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &r);
843 if (NT_STATUS_IS_ERR(status)) {
844 return status;
847 /* Return variables */
848 *handle = *r.out.handle;
850 /* Return result */
851 if (werror) {
852 *werror = r.out.result;
855 return werror_to_ntstatus(r.out.result);
858 NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
859 TALLOC_CTX *mem_ctx,
860 struct policy_handle *handle /* [in] [ref] */,
861 struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */,
862 uint32_t offered /* [in] [range(0,8192)] */,
863 uint32_t *needed /* [out] [ref,range(0,8192)] */,
864 WERROR *werror)
866 struct svcctl_QueryServiceConfigW r;
867 NTSTATUS status;
869 /* In parameters */
870 r.in.handle = handle;
871 r.in.offered = offered;
873 if (DEBUGLEVEL >= 10) {
874 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, &r);
877 status = cli->dispatch(cli,
878 mem_ctx,
879 &ndr_table_svcctl,
880 NDR_SVCCTL_QUERYSERVICECONFIGW,
881 &r);
883 if (!NT_STATUS_IS_OK(status)) {
884 return status;
887 if (DEBUGLEVEL >= 10) {
888 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &r);
891 if (NT_STATUS_IS_ERR(status)) {
892 return status;
895 /* Return variables */
896 *query = *r.out.query;
897 *needed = *r.out.needed;
899 /* Return result */
900 if (werror) {
901 *werror = r.out.result;
904 return werror_to_ntstatus(r.out.result);
907 NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
908 TALLOC_CTX *mem_ctx,
909 struct policy_handle *handle /* [in] [ref] */,
910 uint32_t offered /* [in] */,
911 struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
912 uint32_t *needed /* [out] [ref] */,
913 WERROR *werror)
915 struct svcctl_QueryServiceLockStatusW r;
916 NTSTATUS status;
918 /* In parameters */
919 r.in.handle = handle;
920 r.in.offered = offered;
922 if (DEBUGLEVEL >= 10) {
923 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, &r);
926 status = cli->dispatch(cli,
927 mem_ctx,
928 &ndr_table_svcctl,
929 NDR_SVCCTL_QUERYSERVICELOCKSTATUSW,
930 &r);
932 if (!NT_STATUS_IS_OK(status)) {
933 return status;
936 if (DEBUGLEVEL >= 10) {
937 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &r);
940 if (NT_STATUS_IS_ERR(status)) {
941 return status;
944 /* Return variables */
945 *lock_status = *r.out.lock_status;
946 *needed = *r.out.needed;
948 /* Return result */
949 if (werror) {
950 *werror = r.out.result;
953 return werror_to_ntstatus(r.out.result);
956 NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli,
957 TALLOC_CTX *mem_ctx,
958 struct policy_handle *handle /* [in] [ref] */,
959 uint32_t NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
960 struct svcctl_ArgumentString *Arguments /* [in] [unique,size_is(NumArgs)] */,
961 WERROR *werror)
963 struct svcctl_StartServiceW r;
964 NTSTATUS status;
966 /* In parameters */
967 r.in.handle = handle;
968 r.in.NumArgs = NumArgs;
969 r.in.Arguments = Arguments;
971 if (DEBUGLEVEL >= 10) {
972 NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, &r);
975 status = cli->dispatch(cli,
976 mem_ctx,
977 &ndr_table_svcctl,
978 NDR_SVCCTL_STARTSERVICEW,
979 &r);
981 if (!NT_STATUS_IS_OK(status)) {
982 return status;
985 if (DEBUGLEVEL >= 10) {
986 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &r);
989 if (NT_STATUS_IS_ERR(status)) {
990 return status;
993 /* Return variables */
995 /* Return result */
996 if (werror) {
997 *werror = r.out.result;
1000 return werror_to_ntstatus(r.out.result);
1003 NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
1004 TALLOC_CTX *mem_ctx,
1005 struct policy_handle *handle /* [in] [ref] */,
1006 const char *service_name /* [in] [unique,charset(UTF16)] */,
1007 const char **display_name /* [out] [ref,charset(UTF16)] */,
1008 uint32_t *display_name_length /* [in,out] [unique] */,
1009 WERROR *werror)
1011 struct svcctl_GetServiceDisplayNameW r;
1012 NTSTATUS status;
1014 /* In parameters */
1015 r.in.handle = handle;
1016 r.in.service_name = service_name;
1017 r.in.display_name_length = display_name_length;
1019 if (DEBUGLEVEL >= 10) {
1020 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, &r);
1023 status = cli->dispatch(cli,
1024 mem_ctx,
1025 &ndr_table_svcctl,
1026 NDR_SVCCTL_GETSERVICEDISPLAYNAMEW,
1027 &r);
1029 if (!NT_STATUS_IS_OK(status)) {
1030 return status;
1033 if (DEBUGLEVEL >= 10) {
1034 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &r);
1037 if (NT_STATUS_IS_ERR(status)) {
1038 return status;
1041 /* Return variables */
1042 *display_name = *r.out.display_name;
1043 if (display_name_length && r.out.display_name_length) {
1044 *display_name_length = *r.out.display_name_length;
1047 /* Return result */
1048 if (werror) {
1049 *werror = r.out.result;
1052 return werror_to_ntstatus(r.out.result);
1055 NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli,
1056 TALLOC_CTX *mem_ctx,
1057 struct policy_handle *handle /* [in] [ref] */,
1058 const char *service_name /* [in] [unique,charset(UTF16)] */,
1059 const char **key_name /* [out] [ref,charset(UTF16)] */,
1060 uint32_t *display_name_length /* [in,out] [unique] */,
1061 WERROR *werror)
1063 struct svcctl_GetServiceKeyNameW r;
1064 NTSTATUS status;
1066 /* In parameters */
1067 r.in.handle = handle;
1068 r.in.service_name = service_name;
1069 r.in.display_name_length = display_name_length;
1071 if (DEBUGLEVEL >= 10) {
1072 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, &r);
1075 status = cli->dispatch(cli,
1076 mem_ctx,
1077 &ndr_table_svcctl,
1078 NDR_SVCCTL_GETSERVICEKEYNAMEW,
1079 &r);
1081 if (!NT_STATUS_IS_OK(status)) {
1082 return status;
1085 if (DEBUGLEVEL >= 10) {
1086 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &r);
1089 if (NT_STATUS_IS_ERR(status)) {
1090 return status;
1093 /* Return variables */
1094 *key_name = *r.out.key_name;
1095 if (display_name_length && r.out.display_name_length) {
1096 *display_name_length = *r.out.display_name_length;
1099 /* Return result */
1100 if (werror) {
1101 *werror = r.out.result;
1104 return werror_to_ntstatus(r.out.result);
1107 NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli,
1108 TALLOC_CTX *mem_ctx,
1109 struct policy_handle *handle /* [in] [ref] */,
1110 uint32_t bits /* [in] */,
1111 uint32_t bitson /* [in] */,
1112 uint32_t immediate /* [in] */,
1113 WERROR *werror)
1115 struct svcctl_SCSetServiceBitsA r;
1116 NTSTATUS status;
1118 /* In parameters */
1119 r.in.handle = handle;
1120 r.in.bits = bits;
1121 r.in.bitson = bitson;
1122 r.in.immediate = immediate;
1124 if (DEBUGLEVEL >= 10) {
1125 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, &r);
1128 status = cli->dispatch(cli,
1129 mem_ctx,
1130 &ndr_table_svcctl,
1131 NDR_SVCCTL_SCSETSERVICEBITSA,
1132 &r);
1134 if (!NT_STATUS_IS_OK(status)) {
1135 return status;
1138 if (DEBUGLEVEL >= 10) {
1139 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &r);
1142 if (NT_STATUS_IS_ERR(status)) {
1143 return status;
1146 /* Return variables */
1148 /* Return result */
1149 if (werror) {
1150 *werror = r.out.result;
1153 return werror_to_ntstatus(r.out.result);
1156 NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli,
1157 TALLOC_CTX *mem_ctx,
1158 struct policy_handle *handle /* [in] [ref] */,
1159 uint32_t type /* [in] */,
1160 enum svcctl_StartType start_type /* [in] */,
1161 enum svcctl_ErrorControl error_control /* [in] */,
1162 const char *binary_path /* [in] [unique,charset(UTF16)] */,
1163 const char *load_order_group /* [in] [unique,charset(UTF16)] */,
1164 uint32_t *tag_id /* [out] [ref] */,
1165 const char *dependencies /* [in] [unique,charset(UTF16)] */,
1166 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
1167 const char *password /* [in] [unique,charset(UTF16)] */,
1168 const char *display_name /* [in] [unique,charset(UTF16)] */,
1169 WERROR *werror)
1171 struct svcctl_ChangeServiceConfigA r;
1172 NTSTATUS status;
1174 /* In parameters */
1175 r.in.handle = handle;
1176 r.in.type = type;
1177 r.in.start_type = start_type;
1178 r.in.error_control = error_control;
1179 r.in.binary_path = binary_path;
1180 r.in.load_order_group = load_order_group;
1181 r.in.dependencies = dependencies;
1182 r.in.service_start_name = service_start_name;
1183 r.in.password = password;
1184 r.in.display_name = display_name;
1186 if (DEBUGLEVEL >= 10) {
1187 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, &r);
1190 status = cli->dispatch(cli,
1191 mem_ctx,
1192 &ndr_table_svcctl,
1193 NDR_SVCCTL_CHANGESERVICECONFIGA,
1194 &r);
1196 if (!NT_STATUS_IS_OK(status)) {
1197 return status;
1200 if (DEBUGLEVEL >= 10) {
1201 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &r);
1204 if (NT_STATUS_IS_ERR(status)) {
1205 return status;
1208 /* Return variables */
1209 *tag_id = *r.out.tag_id;
1211 /* Return result */
1212 if (werror) {
1213 *werror = r.out.result;
1216 return werror_to_ntstatus(r.out.result);
1219 NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli,
1220 TALLOC_CTX *mem_ctx,
1221 struct policy_handle *handle /* [in] [ref] */,
1222 const char *ServiceName /* [in] [unique,charset(UTF16)] */,
1223 const char *DisplayName /* [in] [unique,charset(UTF16)] */,
1224 uint32_t desired_access /* [in] */,
1225 uint32_t type /* [in] */,
1226 enum svcctl_StartType start_type /* [in] */,
1227 enum svcctl_ErrorControl error_control /* [in] */,
1228 const char *binary_path /* [in] [unique,charset(UTF16)] */,
1229 const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
1230 uint32_t *TagId /* [out] [unique] */,
1231 const char *dependencies /* [in] [unique,charset(UTF16)] */,
1232 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
1233 const char *password /* [in] [unique,charset(UTF16)] */,
1234 WERROR *werror)
1236 struct svcctl_CreateServiceA r;
1237 NTSTATUS status;
1239 /* In parameters */
1240 r.in.handle = handle;
1241 r.in.ServiceName = ServiceName;
1242 r.in.DisplayName = DisplayName;
1243 r.in.desired_access = desired_access;
1244 r.in.type = type;
1245 r.in.start_type = start_type;
1246 r.in.error_control = error_control;
1247 r.in.binary_path = binary_path;
1248 r.in.LoadOrderGroupKey = LoadOrderGroupKey;
1249 r.in.dependencies = dependencies;
1250 r.in.service_start_name = service_start_name;
1251 r.in.password = password;
1253 if (DEBUGLEVEL >= 10) {
1254 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, &r);
1257 status = cli->dispatch(cli,
1258 mem_ctx,
1259 &ndr_table_svcctl,
1260 NDR_SVCCTL_CREATESERVICEA,
1261 &r);
1263 if (!NT_STATUS_IS_OK(status)) {
1264 return status;
1267 if (DEBUGLEVEL >= 10) {
1268 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &r);
1271 if (NT_STATUS_IS_ERR(status)) {
1272 return status;
1275 /* Return variables */
1276 if (TagId && r.out.TagId) {
1277 *TagId = *r.out.TagId;
1280 /* Return result */
1281 if (werror) {
1282 *werror = r.out.result;
1285 return werror_to_ntstatus(r.out.result);
1288 NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
1289 TALLOC_CTX *mem_ctx,
1290 struct policy_handle *service /* [in] [ref] */,
1291 enum svcctl_ServiceState state /* [in] */,
1292 struct ENUM_SERVICE_STATUSA *service_status /* [out] [unique] */,
1293 uint32_t offered /* [in] */,
1294 uint32_t *needed /* [out] [ref] */,
1295 uint32_t *services_returned /* [out] [ref] */,
1296 WERROR *werror)
1298 struct svcctl_EnumDependentServicesA r;
1299 NTSTATUS status;
1301 /* In parameters */
1302 r.in.service = service;
1303 r.in.state = state;
1304 r.in.offered = offered;
1306 if (DEBUGLEVEL >= 10) {
1307 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &r);
1310 status = cli->dispatch(cli,
1311 mem_ctx,
1312 &ndr_table_svcctl,
1313 NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
1314 &r);
1316 if (!NT_STATUS_IS_OK(status)) {
1317 return status;
1320 if (DEBUGLEVEL >= 10) {
1321 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &r);
1324 if (NT_STATUS_IS_ERR(status)) {
1325 return status;
1328 /* Return variables */
1329 if (service_status && r.out.service_status) {
1330 *service_status = *r.out.service_status;
1332 *needed = *r.out.needed;
1333 *services_returned = *r.out.services_returned;
1335 /* Return result */
1336 if (werror) {
1337 *werror = r.out.result;
1340 return werror_to_ntstatus(r.out.result);
1343 NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
1344 TALLOC_CTX *mem_ctx,
1345 struct policy_handle *handle /* [in] [ref] */,
1346 uint32_t type /* [in] */,
1347 enum svcctl_ServiceState state /* [in] */,
1348 uint32_t offered /* [in] */,
1349 uint8_t *service /* [out] [size_is(offered)] */,
1350 uint32_t *needed /* [out] [ref] */,
1351 uint32_t *services_returned /* [out] [ref] */,
1352 uint32_t *resume_handle /* [in,out] [unique] */,
1353 WERROR *werror)
1355 struct svcctl_EnumServicesStatusA r;
1356 NTSTATUS status;
1358 /* In parameters */
1359 r.in.handle = handle;
1360 r.in.type = type;
1361 r.in.state = state;
1362 r.in.offered = offered;
1363 r.in.resume_handle = resume_handle;
1365 if (DEBUGLEVEL >= 10) {
1366 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, &r);
1369 status = cli->dispatch(cli,
1370 mem_ctx,
1371 &ndr_table_svcctl,
1372 NDR_SVCCTL_ENUMSERVICESSTATUSA,
1373 &r);
1375 if (!NT_STATUS_IS_OK(status)) {
1376 return status;
1379 if (DEBUGLEVEL >= 10) {
1380 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &r);
1383 if (NT_STATUS_IS_ERR(status)) {
1384 return status;
1387 /* Return variables */
1388 memcpy(service, r.out.service, r.in.offered * sizeof(*service));
1389 *needed = *r.out.needed;
1390 *services_returned = *r.out.services_returned;
1391 if (resume_handle && r.out.resume_handle) {
1392 *resume_handle = *r.out.resume_handle;
1395 /* Return result */
1396 if (werror) {
1397 *werror = r.out.result;
1400 return werror_to_ntstatus(r.out.result);
1403 NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli,
1404 TALLOC_CTX *mem_ctx,
1405 const char *MachineName /* [in] [unique,charset(UTF16)] */,
1406 const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
1407 uint32_t access_mask /* [in] */,
1408 struct policy_handle *handle /* [out] [ref] */,
1409 WERROR *werror)
1411 struct svcctl_OpenSCManagerA r;
1412 NTSTATUS status;
1414 /* In parameters */
1415 r.in.MachineName = MachineName;
1416 r.in.DatabaseName = DatabaseName;
1417 r.in.access_mask = access_mask;
1419 if (DEBUGLEVEL >= 10) {
1420 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, &r);
1423 status = cli->dispatch(cli,
1424 mem_ctx,
1425 &ndr_table_svcctl,
1426 NDR_SVCCTL_OPENSCMANAGERA,
1427 &r);
1429 if (!NT_STATUS_IS_OK(status)) {
1430 return status;
1433 if (DEBUGLEVEL >= 10) {
1434 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &r);
1437 if (NT_STATUS_IS_ERR(status)) {
1438 return status;
1441 /* Return variables */
1442 *handle = *r.out.handle;
1444 /* Return result */
1445 if (werror) {
1446 *werror = r.out.result;
1449 return werror_to_ntstatus(r.out.result);
1452 NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli,
1453 TALLOC_CTX *mem_ctx,
1454 struct policy_handle *scmanager_handle /* [in] [ref] */,
1455 const char *ServiceName /* [in] [unique,charset(UTF16)] */,
1456 uint32_t access_mask /* [in] */,
1457 WERROR *werror)
1459 struct svcctl_OpenServiceA r;
1460 NTSTATUS status;
1462 /* In parameters */
1463 r.in.scmanager_handle = scmanager_handle;
1464 r.in.ServiceName = ServiceName;
1465 r.in.access_mask = access_mask;
1467 if (DEBUGLEVEL >= 10) {
1468 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, &r);
1471 status = cli->dispatch(cli,
1472 mem_ctx,
1473 &ndr_table_svcctl,
1474 NDR_SVCCTL_OPENSERVICEA,
1475 &r);
1477 if (!NT_STATUS_IS_OK(status)) {
1478 return status;
1481 if (DEBUGLEVEL >= 10) {
1482 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &r);
1485 if (NT_STATUS_IS_ERR(status)) {
1486 return status;
1489 /* Return variables */
1491 /* Return result */
1492 if (werror) {
1493 *werror = r.out.result;
1496 return werror_to_ntstatus(r.out.result);
1499 NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
1500 TALLOC_CTX *mem_ctx,
1501 struct policy_handle *handle /* [in] [ref] */,
1502 uint8_t *query /* [out] */,
1503 uint32_t offered /* [in] */,
1504 uint32_t *needed /* [out] [ref] */,
1505 WERROR *werror)
1507 struct svcctl_QueryServiceConfigA r;
1508 NTSTATUS status;
1510 /* In parameters */
1511 r.in.handle = handle;
1512 r.in.offered = offered;
1514 if (DEBUGLEVEL >= 10) {
1515 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &r);
1518 status = cli->dispatch(cli,
1519 mem_ctx,
1520 &ndr_table_svcctl,
1521 NDR_SVCCTL_QUERYSERVICECONFIGA,
1522 &r);
1524 if (!NT_STATUS_IS_OK(status)) {
1525 return status;
1528 if (DEBUGLEVEL >= 10) {
1529 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r);
1532 if (NT_STATUS_IS_ERR(status)) {
1533 return status;
1536 /* Return variables */
1537 memcpy(query, r.out.query, r.in.offered * sizeof(*query));
1538 *needed = *r.out.needed;
1540 /* Return result */
1541 if (werror) {
1542 *werror = r.out.result;
1545 return werror_to_ntstatus(r.out.result);
1548 NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
1549 TALLOC_CTX *mem_ctx,
1550 struct policy_handle *handle /* [in] [ref] */,
1551 uint32_t offered /* [in] */,
1552 struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
1553 uint32_t *needed /* [out] [ref] */,
1554 WERROR *werror)
1556 struct svcctl_QueryServiceLockStatusA r;
1557 NTSTATUS status;
1559 /* In parameters */
1560 r.in.handle = handle;
1561 r.in.offered = offered;
1563 if (DEBUGLEVEL >= 10) {
1564 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &r);
1567 status = cli->dispatch(cli,
1568 mem_ctx,
1569 &ndr_table_svcctl,
1570 NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
1571 &r);
1573 if (!NT_STATUS_IS_OK(status)) {
1574 return status;
1577 if (DEBUGLEVEL >= 10) {
1578 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r);
1581 if (NT_STATUS_IS_ERR(status)) {
1582 return status;
1585 /* Return variables */
1586 *lock_status = *r.out.lock_status;
1587 *needed = *r.out.needed;
1589 /* Return result */
1590 if (werror) {
1591 *werror = r.out.result;
1594 return werror_to_ntstatus(r.out.result);
1597 NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli,
1598 TALLOC_CTX *mem_ctx,
1599 struct policy_handle *handle /* [in] [ref] */,
1600 uint32_t NumArgs /* [in] */,
1601 const char *Arguments /* [in] [unique,charset(UTF16)] */,
1602 WERROR *werror)
1604 struct svcctl_StartServiceA r;
1605 NTSTATUS status;
1607 /* In parameters */
1608 r.in.handle = handle;
1609 r.in.NumArgs = NumArgs;
1610 r.in.Arguments = Arguments;
1612 if (DEBUGLEVEL >= 10) {
1613 NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &r);
1616 status = cli->dispatch(cli,
1617 mem_ctx,
1618 &ndr_table_svcctl,
1619 NDR_SVCCTL_STARTSERVICEA,
1620 &r);
1622 if (!NT_STATUS_IS_OK(status)) {
1623 return status;
1626 if (DEBUGLEVEL >= 10) {
1627 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r);
1630 if (NT_STATUS_IS_ERR(status)) {
1631 return status;
1634 /* Return variables */
1636 /* Return result */
1637 if (werror) {
1638 *werror = r.out.result;
1641 return werror_to_ntstatus(r.out.result);
1644 NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
1645 TALLOC_CTX *mem_ctx,
1646 struct policy_handle *handle /* [in] [ref] */,
1647 const char *service_name /* [in] [unique,charset(UTF16)] */,
1648 const char **display_name /* [out] [ref,charset(UTF16)] */,
1649 uint32_t *display_name_length /* [in,out] [unique] */,
1650 WERROR *werror)
1652 struct svcctl_GetServiceDisplayNameA r;
1653 NTSTATUS status;
1655 /* In parameters */
1656 r.in.handle = handle;
1657 r.in.service_name = service_name;
1658 r.in.display_name_length = display_name_length;
1660 if (DEBUGLEVEL >= 10) {
1661 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &r);
1664 status = cli->dispatch(cli,
1665 mem_ctx,
1666 &ndr_table_svcctl,
1667 NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
1668 &r);
1670 if (!NT_STATUS_IS_OK(status)) {
1671 return status;
1674 if (DEBUGLEVEL >= 10) {
1675 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r);
1678 if (NT_STATUS_IS_ERR(status)) {
1679 return status;
1682 /* Return variables */
1683 *display_name = *r.out.display_name;
1684 if (display_name_length && r.out.display_name_length) {
1685 *display_name_length = *r.out.display_name_length;
1688 /* Return result */
1689 if (werror) {
1690 *werror = r.out.result;
1693 return werror_to_ntstatus(r.out.result);
1696 NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli,
1697 TALLOC_CTX *mem_ctx,
1698 struct policy_handle *handle /* [in] [ref] */,
1699 const char *service_name /* [in] [unique,charset(UTF16)] */,
1700 const char **key_name /* [out] [ref,charset(UTF16)] */,
1701 uint32_t *display_name_length /* [in,out] [unique] */,
1702 WERROR *werror)
1704 struct svcctl_GetServiceKeyNameA r;
1705 NTSTATUS status;
1707 /* In parameters */
1708 r.in.handle = handle;
1709 r.in.service_name = service_name;
1710 r.in.display_name_length = display_name_length;
1712 if (DEBUGLEVEL >= 10) {
1713 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &r);
1716 status = cli->dispatch(cli,
1717 mem_ctx,
1718 &ndr_table_svcctl,
1719 NDR_SVCCTL_GETSERVICEKEYNAMEA,
1720 &r);
1722 if (!NT_STATUS_IS_OK(status)) {
1723 return status;
1726 if (DEBUGLEVEL >= 10) {
1727 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r);
1730 if (NT_STATUS_IS_ERR(status)) {
1731 return status;
1734 /* Return variables */
1735 *key_name = *r.out.key_name;
1736 if (display_name_length && r.out.display_name_length) {
1737 *display_name_length = *r.out.display_name_length;
1740 /* Return result */
1741 if (werror) {
1742 *werror = r.out.result;
1745 return werror_to_ntstatus(r.out.result);
1748 NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
1749 TALLOC_CTX *mem_ctx,
1750 WERROR *werror)
1752 struct svcctl_GetCurrentGroupeStateW r;
1753 NTSTATUS status;
1755 /* In parameters */
1757 if (DEBUGLEVEL >= 10) {
1758 NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
1761 status = cli->dispatch(cli,
1762 mem_ctx,
1763 &ndr_table_svcctl,
1764 NDR_SVCCTL_GETCURRENTGROUPESTATEW,
1765 &r);
1767 if (!NT_STATUS_IS_OK(status)) {
1768 return status;
1771 if (DEBUGLEVEL >= 10) {
1772 NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
1775 if (NT_STATUS_IS_ERR(status)) {
1776 return status;
1779 /* Return variables */
1781 /* Return result */
1782 if (werror) {
1783 *werror = r.out.result;
1786 return werror_to_ntstatus(r.out.result);
1789 NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli,
1790 TALLOC_CTX *mem_ctx,
1791 WERROR *werror)
1793 struct svcctl_EnumServiceGroupW r;
1794 NTSTATUS status;
1796 /* In parameters */
1798 if (DEBUGLEVEL >= 10) {
1799 NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &r);
1802 status = cli->dispatch(cli,
1803 mem_ctx,
1804 &ndr_table_svcctl,
1805 NDR_SVCCTL_ENUMSERVICEGROUPW,
1806 &r);
1808 if (!NT_STATUS_IS_OK(status)) {
1809 return status;
1812 if (DEBUGLEVEL >= 10) {
1813 NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r);
1816 if (NT_STATUS_IS_ERR(status)) {
1817 return status;
1820 /* Return variables */
1822 /* Return result */
1823 if (werror) {
1824 *werror = r.out.result;
1827 return werror_to_ntstatus(r.out.result);
1830 NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
1831 TALLOC_CTX *mem_ctx,
1832 struct policy_handle *handle /* [in] [ref] */,
1833 uint32_t info_level /* [in] */,
1834 uint8_t *info /* [in] [unique] */,
1835 WERROR *werror)
1837 struct svcctl_ChangeServiceConfig2A r;
1838 NTSTATUS status;
1840 /* In parameters */
1841 r.in.handle = handle;
1842 r.in.info_level = info_level;
1843 r.in.info = info;
1845 if (DEBUGLEVEL >= 10) {
1846 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &r);
1849 status = cli->dispatch(cli,
1850 mem_ctx,
1851 &ndr_table_svcctl,
1852 NDR_SVCCTL_CHANGESERVICECONFIG2A,
1853 &r);
1855 if (!NT_STATUS_IS_OK(status)) {
1856 return status;
1859 if (DEBUGLEVEL >= 10) {
1860 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r);
1863 if (NT_STATUS_IS_ERR(status)) {
1864 return status;
1867 /* Return variables */
1869 /* Return result */
1870 if (werror) {
1871 *werror = r.out.result;
1874 return werror_to_ntstatus(r.out.result);
1877 NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli,
1878 TALLOC_CTX *mem_ctx,
1879 struct policy_handle *handle /* [in] [ref] */,
1880 uint32_t info_level /* [in] */,
1881 uint8_t *info /* [in] [unique] */,
1882 WERROR *werror)
1884 struct svcctl_ChangeServiceConfig2W r;
1885 NTSTATUS status;
1887 /* In parameters */
1888 r.in.handle = handle;
1889 r.in.info_level = info_level;
1890 r.in.info = info;
1892 if (DEBUGLEVEL >= 10) {
1893 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &r);
1896 status = cli->dispatch(cli,
1897 mem_ctx,
1898 &ndr_table_svcctl,
1899 NDR_SVCCTL_CHANGESERVICECONFIG2W,
1900 &r);
1902 if (!NT_STATUS_IS_OK(status)) {
1903 return status;
1906 if (DEBUGLEVEL >= 10) {
1907 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r);
1910 if (NT_STATUS_IS_ERR(status)) {
1911 return status;
1914 /* Return variables */
1916 /* Return result */
1917 if (werror) {
1918 *werror = r.out.result;
1921 return werror_to_ntstatus(r.out.result);
1924 NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
1925 TALLOC_CTX *mem_ctx,
1926 struct policy_handle *handle /* [in] [ref] */,
1927 enum svcctl_ConfigLevel info_level /* [in] */,
1928 uint8_t *buffer /* [out] */,
1929 uint32_t offered /* [in] */,
1930 uint32_t *needed /* [out] [ref] */,
1931 WERROR *werror)
1933 struct svcctl_QueryServiceConfig2A r;
1934 NTSTATUS status;
1936 /* In parameters */
1937 r.in.handle = handle;
1938 r.in.info_level = info_level;
1939 r.in.offered = offered;
1941 if (DEBUGLEVEL >= 10) {
1942 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, &r);
1945 status = cli->dispatch(cli,
1946 mem_ctx,
1947 &ndr_table_svcctl,
1948 NDR_SVCCTL_QUERYSERVICECONFIG2A,
1949 &r);
1951 if (!NT_STATUS_IS_OK(status)) {
1952 return status;
1955 if (DEBUGLEVEL >= 10) {
1956 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &r);
1959 if (NT_STATUS_IS_ERR(status)) {
1960 return status;
1963 /* Return variables */
1964 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
1965 *needed = *r.out.needed;
1967 /* Return result */
1968 if (werror) {
1969 *werror = r.out.result;
1972 return werror_to_ntstatus(r.out.result);
1975 NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
1976 TALLOC_CTX *mem_ctx,
1977 struct policy_handle *handle /* [in] [ref] */,
1978 enum svcctl_ConfigLevel info_level /* [in] */,
1979 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
1980 uint32_t offered /* [in] [range(0,8192)] */,
1981 uint32_t *needed /* [out] [ref,range(0,8192)] */,
1982 WERROR *werror)
1984 struct svcctl_QueryServiceConfig2W r;
1985 NTSTATUS status;
1987 /* In parameters */
1988 r.in.handle = handle;
1989 r.in.info_level = info_level;
1990 r.in.offered = offered;
1992 if (DEBUGLEVEL >= 10) {
1993 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, &r);
1996 status = cli->dispatch(cli,
1997 mem_ctx,
1998 &ndr_table_svcctl,
1999 NDR_SVCCTL_QUERYSERVICECONFIG2W,
2000 &r);
2002 if (!NT_STATUS_IS_OK(status)) {
2003 return status;
2006 if (DEBUGLEVEL >= 10) {
2007 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &r);
2010 if (NT_STATUS_IS_ERR(status)) {
2011 return status;
2014 /* Return variables */
2015 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
2016 *needed = *r.out.needed;
2018 /* Return result */
2019 if (werror) {
2020 *werror = r.out.result;
2023 return werror_to_ntstatus(r.out.result);
2026 NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
2027 TALLOC_CTX *mem_ctx,
2028 struct policy_handle *handle /* [in] [ref] */,
2029 enum svcctl_StatusLevel info_level /* [in] */,
2030 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
2031 uint32_t offered /* [in] [range(0,8192)] */,
2032 uint32_t *needed /* [out] [ref,range(0,8192)] */,
2033 WERROR *werror)
2035 struct svcctl_QueryServiceStatusEx r;
2036 NTSTATUS status;
2038 /* In parameters */
2039 r.in.handle = handle;
2040 r.in.info_level = info_level;
2041 r.in.offered = offered;
2043 if (DEBUGLEVEL >= 10) {
2044 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, &r);
2047 status = cli->dispatch(cli,
2048 mem_ctx,
2049 &ndr_table_svcctl,
2050 NDR_SVCCTL_QUERYSERVICESTATUSEX,
2051 &r);
2053 if (!NT_STATUS_IS_OK(status)) {
2054 return status;
2057 if (DEBUGLEVEL >= 10) {
2058 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &r);
2061 if (NT_STATUS_IS_ERR(status)) {
2062 return status;
2065 /* Return variables */
2066 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
2067 *needed = *r.out.needed;
2069 /* Return result */
2070 if (werror) {
2071 *werror = r.out.result;
2074 return werror_to_ntstatus(r.out.result);
2077 NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli,
2078 TALLOC_CTX *mem_ctx,
2079 struct policy_handle *scmanager /* [in] [ref] */,
2080 uint32_t info_level /* [in] */,
2081 uint32_t type /* [in] */,
2082 enum svcctl_ServiceState state /* [in] */,
2083 uint8_t *services /* [out] */,
2084 uint32_t offered /* [in] */,
2085 uint32_t *needed /* [out] [ref] */,
2086 uint32_t *service_returned /* [out] [ref] */,
2087 uint32_t *resume_handle /* [in,out] [unique] */,
2088 const char **group_name /* [out] [ref,charset(UTF16)] */,
2089 WERROR *werror)
2091 struct EnumServicesStatusExA r;
2092 NTSTATUS status;
2094 /* In parameters */
2095 r.in.scmanager = scmanager;
2096 r.in.info_level = info_level;
2097 r.in.type = type;
2098 r.in.state = state;
2099 r.in.offered = offered;
2100 r.in.resume_handle = resume_handle;
2102 if (DEBUGLEVEL >= 10) {
2103 NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, &r);
2106 status = cli->dispatch(cli,
2107 mem_ctx,
2108 &ndr_table_svcctl,
2109 NDR_ENUMSERVICESSTATUSEXA,
2110 &r);
2112 if (!NT_STATUS_IS_OK(status)) {
2113 return status;
2116 if (DEBUGLEVEL >= 10) {
2117 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &r);
2120 if (NT_STATUS_IS_ERR(status)) {
2121 return status;
2124 /* Return variables */
2125 memcpy(services, r.out.services, r.in.offered * sizeof(*services));
2126 *needed = *r.out.needed;
2127 *service_returned = *r.out.service_returned;
2128 if (resume_handle && r.out.resume_handle) {
2129 *resume_handle = *r.out.resume_handle;
2131 *group_name = *r.out.group_name;
2133 /* Return result */
2134 if (werror) {
2135 *werror = r.out.result;
2138 return werror_to_ntstatus(r.out.result);
2141 NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli,
2142 TALLOC_CTX *mem_ctx,
2143 struct policy_handle *scmanager /* [in] [ref] */,
2144 uint32_t info_level /* [in] */,
2145 uint32_t type /* [in] */,
2146 enum svcctl_ServiceState state /* [in] */,
2147 uint8_t *services /* [out] [ref,size_is(offered)] */,
2148 uint32_t offered /* [in] [range(0,0x40000)] */,
2149 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
2150 uint32_t *service_returned /* [out] [ref,range(0,0x40000)] */,
2151 uint32_t *resume_handle /* [in,out] [unique,range(0,0x40000)] */,
2152 const char *group_name /* [in] [unique,charset(UTF16)] */,
2153 WERROR *werror)
2155 struct EnumServicesStatusExW r;
2156 NTSTATUS status;
2158 /* In parameters */
2159 r.in.scmanager = scmanager;
2160 r.in.info_level = info_level;
2161 r.in.type = type;
2162 r.in.state = state;
2163 r.in.offered = offered;
2164 r.in.resume_handle = resume_handle;
2165 r.in.group_name = group_name;
2167 if (DEBUGLEVEL >= 10) {
2168 NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, &r);
2171 status = cli->dispatch(cli,
2172 mem_ctx,
2173 &ndr_table_svcctl,
2174 NDR_ENUMSERVICESSTATUSEXW,
2175 &r);
2177 if (!NT_STATUS_IS_OK(status)) {
2178 return status;
2181 if (DEBUGLEVEL >= 10) {
2182 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &r);
2185 if (NT_STATUS_IS_ERR(status)) {
2186 return status;
2189 /* Return variables */
2190 memcpy(services, r.out.services, r.in.offered * sizeof(*services));
2191 *needed = *r.out.needed;
2192 *service_returned = *r.out.service_returned;
2193 if (resume_handle && r.out.resume_handle) {
2194 *resume_handle = *r.out.resume_handle;
2197 /* Return result */
2198 if (werror) {
2199 *werror = r.out.result;
2202 return werror_to_ntstatus(r.out.result);
2205 NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli,
2206 TALLOC_CTX *mem_ctx,
2207 WERROR *werror)
2209 struct svcctl_SCSendTSMessage r;
2210 NTSTATUS status;
2212 /* In parameters */
2214 if (DEBUGLEVEL >= 10) {
2215 NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, &r);
2218 status = cli->dispatch(cli,
2219 mem_ctx,
2220 &ndr_table_svcctl,
2221 NDR_SVCCTL_SCSENDTSMESSAGE,
2222 &r);
2224 if (!NT_STATUS_IS_OK(status)) {
2225 return status;
2228 if (DEBUGLEVEL >= 10) {
2229 NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &r);
2232 if (NT_STATUS_IS_ERR(status)) {
2233 return status;
2236 /* Return variables */
2238 /* Return result */
2239 if (werror) {
2240 *werror = r.out.result;
2243 return werror_to_ntstatus(r.out.result);