2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
7 #include "librpc/gen_ndr/cli_svcctl.h"
9 NTSTATUS
rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client
*cli
,
11 struct policy_handle
*handle
,
14 struct svcctl_CloseServiceHandle r
;
20 if (DEBUGLEVEL
>= 10) {
21 NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle
, &r
);
24 status
= cli_do_rpc_ndr(cli
,
28 NDR_SVCCTL_CLOSESERVICEHANDLE
,
31 if (!NT_STATUS_IS_OK(status
)) {
35 if (DEBUGLEVEL
>= 10) {
36 NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle
, &r
);
39 if (NT_STATUS_IS_ERR(status
)) {
43 /* Return variables */
44 *handle
= *r
.out
.handle
;
48 *werror
= r
.out
.result
;
51 return werror_to_ntstatus(r
.out
.result
);
54 NTSTATUS
rpccli_svcctl_ControlService(struct rpc_pipe_client
*cli
,
56 struct policy_handle
*handle
,
58 struct SERVICE_STATUS
*service_status
,
61 struct svcctl_ControlService r
;
66 r
.in
.control
= control
;
68 if (DEBUGLEVEL
>= 10) {
69 NDR_PRINT_IN_DEBUG(svcctl_ControlService
, &r
);
72 status
= cli_do_rpc_ndr(cli
,
76 NDR_SVCCTL_CONTROLSERVICE
,
79 if (!NT_STATUS_IS_OK(status
)) {
83 if (DEBUGLEVEL
>= 10) {
84 NDR_PRINT_OUT_DEBUG(svcctl_ControlService
, &r
);
87 if (NT_STATUS_IS_ERR(status
)) {
91 /* Return variables */
92 *service_status
= *r
.out
.service_status
;
96 *werror
= r
.out
.result
;
99 return werror_to_ntstatus(r
.out
.result
);
102 NTSTATUS
rpccli_svcctl_DeleteService(struct rpc_pipe_client
*cli
,
104 struct policy_handle
*handle
,
107 struct svcctl_DeleteService r
;
111 r
.in
.handle
= handle
;
113 if (DEBUGLEVEL
>= 10) {
114 NDR_PRINT_IN_DEBUG(svcctl_DeleteService
, &r
);
117 status
= cli_do_rpc_ndr(cli
,
121 NDR_SVCCTL_DELETESERVICE
,
124 if (!NT_STATUS_IS_OK(status
)) {
128 if (DEBUGLEVEL
>= 10) {
129 NDR_PRINT_OUT_DEBUG(svcctl_DeleteService
, &r
);
132 if (NT_STATUS_IS_ERR(status
)) {
136 /* Return variables */
140 *werror
= r
.out
.result
;
143 return werror_to_ntstatus(r
.out
.result
);
146 NTSTATUS
rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client
*cli
,
148 struct policy_handle
*handle
,
149 struct policy_handle
*lock
,
152 struct svcctl_LockServiceDatabase r
;
156 r
.in
.handle
= handle
;
158 if (DEBUGLEVEL
>= 10) {
159 NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase
, &r
);
162 status
= cli_do_rpc_ndr(cli
,
166 NDR_SVCCTL_LOCKSERVICEDATABASE
,
169 if (!NT_STATUS_IS_OK(status
)) {
173 if (DEBUGLEVEL
>= 10) {
174 NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase
, &r
);
177 if (NT_STATUS_IS_ERR(status
)) {
181 /* Return variables */
186 *werror
= r
.out
.result
;
189 return werror_to_ntstatus(r
.out
.result
);
192 NTSTATUS
rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client
*cli
,
194 struct policy_handle
*handle
,
195 uint32_t security_flags
,
197 uint32_t buffer_size
,
201 struct svcctl_QueryServiceObjectSecurity r
;
205 r
.in
.handle
= handle
;
206 r
.in
.security_flags
= security_flags
;
207 r
.in
.buffer_size
= buffer_size
;
209 if (DEBUGLEVEL
>= 10) {
210 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity
, &r
);
213 status
= cli_do_rpc_ndr(cli
,
217 NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY
,
220 if (!NT_STATUS_IS_OK(status
)) {
224 if (DEBUGLEVEL
>= 10) {
225 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity
, &r
);
228 if (NT_STATUS_IS_ERR(status
)) {
232 /* Return variables */
233 memcpy(buffer
, r
.out
.buffer
, r
.in
.buffer_size
);
234 *needed
= *r
.out
.needed
;
238 *werror
= r
.out
.result
;
241 return werror_to_ntstatus(r
.out
.result
);
244 NTSTATUS
rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client
*cli
,
246 struct policy_handle
*handle
,
247 uint32_t security_flags
,
249 uint32_t buffer_size
,
252 struct svcctl_SetServiceObjectSecurity r
;
256 r
.in
.handle
= handle
;
257 r
.in
.security_flags
= security_flags
;
258 r
.in
.buffer
= buffer
;
259 r
.in
.buffer_size
= buffer_size
;
261 if (DEBUGLEVEL
>= 10) {
262 NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity
, &r
);
265 status
= cli_do_rpc_ndr(cli
,
269 NDR_SVCCTL_SETSERVICEOBJECTSECURITY
,
272 if (!NT_STATUS_IS_OK(status
)) {
276 if (DEBUGLEVEL
>= 10) {
277 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity
, &r
);
280 if (NT_STATUS_IS_ERR(status
)) {
284 /* Return variables */
288 *werror
= r
.out
.result
;
291 return werror_to_ntstatus(r
.out
.result
);
294 NTSTATUS
rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client
*cli
,
296 struct policy_handle
*handle
,
297 struct SERVICE_STATUS
*service_status
,
300 struct svcctl_QueryServiceStatus r
;
304 r
.in
.handle
= handle
;
306 if (DEBUGLEVEL
>= 10) {
307 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus
, &r
);
310 status
= cli_do_rpc_ndr(cli
,
314 NDR_SVCCTL_QUERYSERVICESTATUS
,
317 if (!NT_STATUS_IS_OK(status
)) {
321 if (DEBUGLEVEL
>= 10) {
322 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus
, &r
);
325 if (NT_STATUS_IS_ERR(status
)) {
329 /* Return variables */
330 *service_status
= *r
.out
.service_status
;
334 *werror
= r
.out
.result
;
337 return werror_to_ntstatus(r
.out
.result
);
340 NTSTATUS
rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client
*cli
,
344 struct svcctl_SetServiceStatus r
;
349 if (DEBUGLEVEL
>= 10) {
350 NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus
, &r
);
353 status
= cli_do_rpc_ndr(cli
,
357 NDR_SVCCTL_SETSERVICESTATUS
,
360 if (!NT_STATUS_IS_OK(status
)) {
364 if (DEBUGLEVEL
>= 10) {
365 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus
, &r
);
368 if (NT_STATUS_IS_ERR(status
)) {
372 /* Return variables */
376 *werror
= r
.out
.result
;
379 return werror_to_ntstatus(r
.out
.result
);
382 NTSTATUS
rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client
*cli
,
384 struct policy_handle
*lock
,
387 struct svcctl_UnlockServiceDatabase r
;
393 if (DEBUGLEVEL
>= 10) {
394 NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase
, &r
);
397 status
= cli_do_rpc_ndr(cli
,
401 NDR_SVCCTL_UNLOCKSERVICEDATABASE
,
404 if (!NT_STATUS_IS_OK(status
)) {
408 if (DEBUGLEVEL
>= 10) {
409 NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase
, &r
);
412 if (NT_STATUS_IS_ERR(status
)) {
416 /* Return variables */
421 *werror
= r
.out
.result
;
424 return werror_to_ntstatus(r
.out
.result
);
427 NTSTATUS
rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client
*cli
,
431 struct svcctl_NotifyBootConfigStatus r
;
436 if (DEBUGLEVEL
>= 10) {
437 NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus
, &r
);
440 status
= cli_do_rpc_ndr(cli
,
444 NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS
,
447 if (!NT_STATUS_IS_OK(status
)) {
451 if (DEBUGLEVEL
>= 10) {
452 NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus
, &r
);
455 if (NT_STATUS_IS_ERR(status
)) {
459 /* Return variables */
463 *werror
= r
.out
.result
;
466 return werror_to_ntstatus(r
.out
.result
);
469 NTSTATUS
rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client
*cli
,
471 struct policy_handle
*handle
,
477 struct svcctl_SCSetServiceBitsW r
;
481 r
.in
.handle
= handle
;
483 r
.in
.bitson
= bitson
;
484 r
.in
.immediate
= immediate
;
486 if (DEBUGLEVEL
>= 10) {
487 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW
, &r
);
490 status
= cli_do_rpc_ndr(cli
,
494 NDR_SVCCTL_SCSETSERVICEBITSW
,
497 if (!NT_STATUS_IS_OK(status
)) {
501 if (DEBUGLEVEL
>= 10) {
502 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW
, &r
);
505 if (NT_STATUS_IS_ERR(status
)) {
509 /* Return variables */
513 *werror
= r
.out
.result
;
516 return werror_to_ntstatus(r
.out
.result
);
519 NTSTATUS
rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client
*cli
,
521 struct policy_handle
*handle
,
525 const char *binary_path
,
526 const char *load_order_group
,
528 const char *dependencies
,
529 const char *service_start_name
,
530 const char *password
,
531 const char *display_name
,
534 struct svcctl_ChangeServiceConfigW r
;
538 r
.in
.handle
= handle
;
542 r
.in
.binary_path
= binary_path
;
543 r
.in
.load_order_group
= load_order_group
;
544 r
.in
.dependencies
= dependencies
;
545 r
.in
.service_start_name
= service_start_name
;
546 r
.in
.password
= password
;
547 r
.in
.display_name
= display_name
;
549 if (DEBUGLEVEL
>= 10) {
550 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW
, &r
);
553 status
= cli_do_rpc_ndr(cli
,
557 NDR_SVCCTL_CHANGESERVICECONFIGW
,
560 if (!NT_STATUS_IS_OK(status
)) {
564 if (DEBUGLEVEL
>= 10) {
565 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW
, &r
);
568 if (NT_STATUS_IS_ERR(status
)) {
572 /* Return variables */
573 *tag_id
= *r
.out
.tag_id
;
577 *werror
= r
.out
.result
;
580 return werror_to_ntstatus(r
.out
.result
);
583 NTSTATUS
rpccli_svcctl_CreateServiceW(struct rpc_pipe_client
*cli
,
585 struct policy_handle
*scmanager_handle
,
586 const char *ServiceName
,
587 const char *DisplayName
,
588 uint32_t desired_access
,
591 uint32_t error_control
,
592 const char *binary_path
,
593 const char *LoadOrderGroupKey
,
595 uint8_t *dependencies
,
596 uint32_t dependencies_size
,
597 const char *service_start_name
,
599 uint32_t password_size
,
600 struct policy_handle
*handle
,
603 struct svcctl_CreateServiceW r
;
607 r
.in
.scmanager_handle
= scmanager_handle
;
608 r
.in
.ServiceName
= ServiceName
;
609 r
.in
.DisplayName
= DisplayName
;
610 r
.in
.desired_access
= desired_access
;
612 r
.in
.start_type
= start_type
;
613 r
.in
.error_control
= error_control
;
614 r
.in
.binary_path
= binary_path
;
615 r
.in
.LoadOrderGroupKey
= LoadOrderGroupKey
;
617 r
.in
.dependencies
= dependencies
;
618 r
.in
.dependencies_size
= dependencies_size
;
619 r
.in
.service_start_name
= service_start_name
;
620 r
.in
.password
= password
;
621 r
.in
.password_size
= password_size
;
623 if (DEBUGLEVEL
>= 10) {
624 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW
, &r
);
627 status
= cli_do_rpc_ndr(cli
,
631 NDR_SVCCTL_CREATESERVICEW
,
634 if (!NT_STATUS_IS_OK(status
)) {
638 if (DEBUGLEVEL
>= 10) {
639 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW
, &r
);
642 if (NT_STATUS_IS_ERR(status
)) {
646 /* Return variables */
647 if (TagId
&& r
.out
.TagId
) {
648 *TagId
= *r
.out
.TagId
;
650 *handle
= *r
.out
.handle
;
654 *werror
= r
.out
.result
;
657 return werror_to_ntstatus(r
.out
.result
);
660 NTSTATUS
rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client
*cli
,
662 struct policy_handle
*service
,
664 uint8_t *service_status
,
666 uint32_t *bytes_needed
,
667 uint32_t *services_returned
,
670 struct svcctl_EnumDependentServicesW r
;
674 r
.in
.service
= service
;
676 r
.in
.buf_size
= buf_size
;
678 if (DEBUGLEVEL
>= 10) {
679 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW
, &r
);
682 status
= cli_do_rpc_ndr(cli
,
686 NDR_SVCCTL_ENUMDEPENDENTSERVICESW
,
689 if (!NT_STATUS_IS_OK(status
)) {
693 if (DEBUGLEVEL
>= 10) {
694 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW
, &r
);
697 if (NT_STATUS_IS_ERR(status
)) {
701 /* Return variables */
702 memcpy(service_status
, r
.out
.service_status
, r
.in
.buf_size
);
703 *bytes_needed
= *r
.out
.bytes_needed
;
704 *services_returned
= *r
.out
.services_returned
;
708 *werror
= r
.out
.result
;
711 return werror_to_ntstatus(r
.out
.result
);
714 NTSTATUS
rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client
*cli
,
716 struct policy_handle
*handle
,
721 uint32_t *bytes_needed
,
722 uint32_t *services_returned
,
723 uint32_t *resume_handle
,
726 struct svcctl_EnumServicesStatusW r
;
730 r
.in
.handle
= handle
;
733 r
.in
.buf_size
= buf_size
;
734 r
.in
.resume_handle
= resume_handle
;
736 if (DEBUGLEVEL
>= 10) {
737 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW
, &r
);
740 status
= cli_do_rpc_ndr(cli
,
744 NDR_SVCCTL_ENUMSERVICESSTATUSW
,
747 if (!NT_STATUS_IS_OK(status
)) {
751 if (DEBUGLEVEL
>= 10) {
752 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW
, &r
);
755 if (NT_STATUS_IS_ERR(status
)) {
759 /* Return variables */
760 memcpy(service
, r
.out
.service
, r
.in
.buf_size
);
761 *bytes_needed
= *r
.out
.bytes_needed
;
762 *services_returned
= *r
.out
.services_returned
;
763 if (resume_handle
&& r
.out
.resume_handle
) {
764 *resume_handle
= *r
.out
.resume_handle
;
769 *werror
= r
.out
.result
;
772 return werror_to_ntstatus(r
.out
.result
);
775 NTSTATUS
rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client
*cli
,
777 const char *MachineName
,
778 const char *DatabaseName
,
779 uint32_t access_mask
,
780 struct policy_handle
*handle
,
783 struct svcctl_OpenSCManagerW r
;
787 r
.in
.MachineName
= MachineName
;
788 r
.in
.DatabaseName
= DatabaseName
;
789 r
.in
.access_mask
= access_mask
;
791 if (DEBUGLEVEL
>= 10) {
792 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW
, &r
);
795 status
= cli_do_rpc_ndr(cli
,
799 NDR_SVCCTL_OPENSCMANAGERW
,
802 if (!NT_STATUS_IS_OK(status
)) {
806 if (DEBUGLEVEL
>= 10) {
807 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW
, &r
);
810 if (NT_STATUS_IS_ERR(status
)) {
814 /* Return variables */
815 *handle
= *r
.out
.handle
;
819 *werror
= r
.out
.result
;
822 return werror_to_ntstatus(r
.out
.result
);
825 NTSTATUS
rpccli_svcctl_OpenServiceW(struct rpc_pipe_client
*cli
,
827 struct policy_handle
*scmanager_handle
,
828 const char *ServiceName
,
829 uint32_t access_mask
,
830 struct policy_handle
*handle
,
833 struct svcctl_OpenServiceW r
;
837 r
.in
.scmanager_handle
= scmanager_handle
;
838 r
.in
.ServiceName
= ServiceName
;
839 r
.in
.access_mask
= access_mask
;
841 if (DEBUGLEVEL
>= 10) {
842 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW
, &r
);
845 status
= cli_do_rpc_ndr(cli
,
849 NDR_SVCCTL_OPENSERVICEW
,
852 if (!NT_STATUS_IS_OK(status
)) {
856 if (DEBUGLEVEL
>= 10) {
857 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW
, &r
);
860 if (NT_STATUS_IS_ERR(status
)) {
864 /* Return variables */
865 *handle
= *r
.out
.handle
;
869 *werror
= r
.out
.result
;
872 return werror_to_ntstatus(r
.out
.result
);
875 NTSTATUS
rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client
*cli
,
877 struct policy_handle
*handle
,
880 uint32_t *bytes_needed
,
883 struct svcctl_QueryServiceConfigW r
;
887 r
.in
.handle
= handle
;
888 r
.in
.buf_size
= buf_size
;
890 if (DEBUGLEVEL
>= 10) {
891 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW
, &r
);
894 status
= cli_do_rpc_ndr(cli
,
898 NDR_SVCCTL_QUERYSERVICECONFIGW
,
901 if (!NT_STATUS_IS_OK(status
)) {
905 if (DEBUGLEVEL
>= 10) {
906 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW
, &r
);
909 if (NT_STATUS_IS_ERR(status
)) {
913 /* Return variables */
914 memcpy(query
, r
.out
.query
, r
.in
.buf_size
);
915 *bytes_needed
= *r
.out
.bytes_needed
;
919 *werror
= r
.out
.result
;
922 return werror_to_ntstatus(r
.out
.result
);
925 NTSTATUS
rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client
*cli
,
927 struct policy_handle
*handle
,
929 struct SERVICE_LOCK_STATUS
*lock_status
,
930 uint32_t *required_buf_size
,
933 struct svcctl_QueryServiceLockStatusW r
;
937 r
.in
.handle
= handle
;
938 r
.in
.buf_size
= buf_size
;
940 if (DEBUGLEVEL
>= 10) {
941 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW
, &r
);
944 status
= cli_do_rpc_ndr(cli
,
948 NDR_SVCCTL_QUERYSERVICELOCKSTATUSW
,
951 if (!NT_STATUS_IS_OK(status
)) {
955 if (DEBUGLEVEL
>= 10) {
956 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW
, &r
);
959 if (NT_STATUS_IS_ERR(status
)) {
963 /* Return variables */
964 *lock_status
= *r
.out
.lock_status
;
965 *required_buf_size
= *r
.out
.required_buf_size
;
969 *werror
= r
.out
.result
;
972 return werror_to_ntstatus(r
.out
.result
);
975 NTSTATUS
rpccli_svcctl_StartServiceW(struct rpc_pipe_client
*cli
,
977 struct policy_handle
*handle
,
979 const char *Arguments
,
982 struct svcctl_StartServiceW r
;
986 r
.in
.handle
= handle
;
987 r
.in
.NumArgs
= NumArgs
;
988 r
.in
.Arguments
= Arguments
;
990 if (DEBUGLEVEL
>= 10) {
991 NDR_PRINT_IN_DEBUG(svcctl_StartServiceW
, &r
);
994 status
= cli_do_rpc_ndr(cli
,
998 NDR_SVCCTL_STARTSERVICEW
,
1001 if (!NT_STATUS_IS_OK(status
)) {
1005 if (DEBUGLEVEL
>= 10) {
1006 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW
, &r
);
1009 if (NT_STATUS_IS_ERR(status
)) {
1013 /* Return variables */
1017 *werror
= r
.out
.result
;
1020 return werror_to_ntstatus(r
.out
.result
);
1023 NTSTATUS
rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client
*cli
,
1024 TALLOC_CTX
*mem_ctx
,
1025 struct policy_handle
*handle
,
1026 const char *service_name
,
1027 const char **display_name
,
1028 uint32_t *display_name_length
,
1031 struct svcctl_GetServiceDisplayNameW r
;
1035 r
.in
.handle
= handle
;
1036 r
.in
.service_name
= service_name
;
1037 r
.in
.display_name_length
= display_name_length
;
1039 if (DEBUGLEVEL
>= 10) {
1040 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW
, &r
);
1043 status
= cli_do_rpc_ndr(cli
,
1047 NDR_SVCCTL_GETSERVICEDISPLAYNAMEW
,
1050 if (!NT_STATUS_IS_OK(status
)) {
1054 if (DEBUGLEVEL
>= 10) {
1055 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW
, &r
);
1058 if (NT_STATUS_IS_ERR(status
)) {
1062 /* Return variables */
1063 *display_name
= *r
.out
.display_name
;
1064 if (display_name_length
&& r
.out
.display_name_length
) {
1065 *display_name_length
= *r
.out
.display_name_length
;
1070 *werror
= r
.out
.result
;
1073 return werror_to_ntstatus(r
.out
.result
);
1076 NTSTATUS
rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client
*cli
,
1077 TALLOC_CTX
*mem_ctx
,
1078 struct policy_handle
*handle
,
1079 const char *service_name
,
1080 const char **key_name
,
1081 uint32_t *display_name_length
,
1084 struct svcctl_GetServiceKeyNameW r
;
1088 r
.in
.handle
= handle
;
1089 r
.in
.service_name
= service_name
;
1090 r
.in
.display_name_length
= display_name_length
;
1092 if (DEBUGLEVEL
>= 10) {
1093 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW
, &r
);
1096 status
= cli_do_rpc_ndr(cli
,
1100 NDR_SVCCTL_GETSERVICEKEYNAMEW
,
1103 if (!NT_STATUS_IS_OK(status
)) {
1107 if (DEBUGLEVEL
>= 10) {
1108 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW
, &r
);
1111 if (NT_STATUS_IS_ERR(status
)) {
1115 /* Return variables */
1116 *key_name
= *r
.out
.key_name
;
1117 if (display_name_length
&& r
.out
.display_name_length
) {
1118 *display_name_length
= *r
.out
.display_name_length
;
1123 *werror
= r
.out
.result
;
1126 return werror_to_ntstatus(r
.out
.result
);
1129 NTSTATUS
rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client
*cli
,
1130 TALLOC_CTX
*mem_ctx
,
1131 struct policy_handle
*handle
,
1137 struct svcctl_SCSetServiceBitsA r
;
1141 r
.in
.handle
= handle
;
1143 r
.in
.bitson
= bitson
;
1144 r
.in
.immediate
= immediate
;
1146 if (DEBUGLEVEL
>= 10) {
1147 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA
, &r
);
1150 status
= cli_do_rpc_ndr(cli
,
1154 NDR_SVCCTL_SCSETSERVICEBITSA
,
1157 if (!NT_STATUS_IS_OK(status
)) {
1161 if (DEBUGLEVEL
>= 10) {
1162 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA
, &r
);
1165 if (NT_STATUS_IS_ERR(status
)) {
1169 /* Return variables */
1173 *werror
= r
.out
.result
;
1176 return werror_to_ntstatus(r
.out
.result
);
1179 NTSTATUS
rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client
*cli
,
1180 TALLOC_CTX
*mem_ctx
,
1181 struct policy_handle
*handle
,
1185 const char *binary_path
,
1186 const char *load_order_group
,
1188 const char *dependencies
,
1189 const char *service_start_name
,
1190 const char *password
,
1191 const char *display_name
,
1194 struct svcctl_ChangeServiceConfigA r
;
1198 r
.in
.handle
= handle
;
1202 r
.in
.binary_path
= binary_path
;
1203 r
.in
.load_order_group
= load_order_group
;
1204 r
.in
.dependencies
= dependencies
;
1205 r
.in
.service_start_name
= service_start_name
;
1206 r
.in
.password
= password
;
1207 r
.in
.display_name
= display_name
;
1209 if (DEBUGLEVEL
>= 10) {
1210 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA
, &r
);
1213 status
= cli_do_rpc_ndr(cli
,
1217 NDR_SVCCTL_CHANGESERVICECONFIGA
,
1220 if (!NT_STATUS_IS_OK(status
)) {
1224 if (DEBUGLEVEL
>= 10) {
1225 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA
, &r
);
1228 if (NT_STATUS_IS_ERR(status
)) {
1232 /* Return variables */
1233 *tag_id
= *r
.out
.tag_id
;
1237 *werror
= r
.out
.result
;
1240 return werror_to_ntstatus(r
.out
.result
);
1243 NTSTATUS
rpccli_svcctl_CreateServiceA(struct rpc_pipe_client
*cli
,
1244 TALLOC_CTX
*mem_ctx
,
1245 struct policy_handle
*handle
,
1246 const char *ServiceName
,
1247 const char *DisplayName
,
1248 uint32_t desired_access
,
1250 uint32_t start_type
,
1251 uint32_t error_control
,
1252 const char *binary_path
,
1253 const char *LoadOrderGroupKey
,
1255 const char *dependencies
,
1256 const char *service_start_name
,
1257 const char *password
,
1260 struct svcctl_CreateServiceA r
;
1264 r
.in
.handle
= handle
;
1265 r
.in
.ServiceName
= ServiceName
;
1266 r
.in
.DisplayName
= DisplayName
;
1267 r
.in
.desired_access
= desired_access
;
1269 r
.in
.start_type
= start_type
;
1270 r
.in
.error_control
= error_control
;
1271 r
.in
.binary_path
= binary_path
;
1272 r
.in
.LoadOrderGroupKey
= LoadOrderGroupKey
;
1273 r
.in
.dependencies
= dependencies
;
1274 r
.in
.service_start_name
= service_start_name
;
1275 r
.in
.password
= password
;
1277 if (DEBUGLEVEL
>= 10) {
1278 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA
, &r
);
1281 status
= cli_do_rpc_ndr(cli
,
1285 NDR_SVCCTL_CREATESERVICEA
,
1288 if (!NT_STATUS_IS_OK(status
)) {
1292 if (DEBUGLEVEL
>= 10) {
1293 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA
, &r
);
1296 if (NT_STATUS_IS_ERR(status
)) {
1300 /* Return variables */
1301 if (TagId
&& r
.out
.TagId
) {
1302 *TagId
= *r
.out
.TagId
;
1307 *werror
= r
.out
.result
;
1310 return werror_to_ntstatus(r
.out
.result
);
1313 NTSTATUS
rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client
*cli
,
1314 TALLOC_CTX
*mem_ctx
,
1315 struct policy_handle
*service
,
1317 struct ENUM_SERVICE_STATUS
*service_status
,
1319 uint32_t *bytes_needed
,
1320 uint32_t *services_returned
,
1323 struct svcctl_EnumDependentServicesA r
;
1327 r
.in
.service
= service
;
1329 r
.in
.buf_size
= buf_size
;
1331 if (DEBUGLEVEL
>= 10) {
1332 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA
, &r
);
1335 status
= cli_do_rpc_ndr(cli
,
1339 NDR_SVCCTL_ENUMDEPENDENTSERVICESA
,
1342 if (!NT_STATUS_IS_OK(status
)) {
1346 if (DEBUGLEVEL
>= 10) {
1347 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA
, &r
);
1350 if (NT_STATUS_IS_ERR(status
)) {
1354 /* Return variables */
1355 if (service_status
&& r
.out
.service_status
) {
1356 *service_status
= *r
.out
.service_status
;
1358 *bytes_needed
= *r
.out
.bytes_needed
;
1359 *services_returned
= *r
.out
.services_returned
;
1363 *werror
= r
.out
.result
;
1366 return werror_to_ntstatus(r
.out
.result
);
1369 NTSTATUS
rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client
*cli
,
1370 TALLOC_CTX
*mem_ctx
,
1371 struct policy_handle
*handle
,
1376 uint32_t *bytes_needed
,
1377 uint32_t *services_returned
,
1378 uint32_t *resume_handle
,
1381 struct svcctl_EnumServicesStatusA r
;
1385 r
.in
.handle
= handle
;
1388 r
.in
.buf_size
= buf_size
;
1389 r
.in
.resume_handle
= resume_handle
;
1391 if (DEBUGLEVEL
>= 10) {
1392 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA
, &r
);
1395 status
= cli_do_rpc_ndr(cli
,
1399 NDR_SVCCTL_ENUMSERVICESSTATUSA
,
1402 if (!NT_STATUS_IS_OK(status
)) {
1406 if (DEBUGLEVEL
>= 10) {
1407 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA
, &r
);
1410 if (NT_STATUS_IS_ERR(status
)) {
1414 /* Return variables */
1415 memcpy(service
, r
.out
.service
, r
.in
.buf_size
);
1416 *bytes_needed
= *r
.out
.bytes_needed
;
1417 *services_returned
= *r
.out
.services_returned
;
1418 if (resume_handle
&& r
.out
.resume_handle
) {
1419 *resume_handle
= *r
.out
.resume_handle
;
1424 *werror
= r
.out
.result
;
1427 return werror_to_ntstatus(r
.out
.result
);
1430 NTSTATUS
rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client
*cli
,
1431 TALLOC_CTX
*mem_ctx
,
1432 const char *MachineName
,
1433 const char *DatabaseName
,
1434 uint32_t access_mask
,
1435 struct policy_handle
*handle
,
1438 struct svcctl_OpenSCManagerA r
;
1442 r
.in
.MachineName
= MachineName
;
1443 r
.in
.DatabaseName
= DatabaseName
;
1444 r
.in
.access_mask
= access_mask
;
1446 if (DEBUGLEVEL
>= 10) {
1447 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA
, &r
);
1450 status
= cli_do_rpc_ndr(cli
,
1454 NDR_SVCCTL_OPENSCMANAGERA
,
1457 if (!NT_STATUS_IS_OK(status
)) {
1461 if (DEBUGLEVEL
>= 10) {
1462 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA
, &r
);
1465 if (NT_STATUS_IS_ERR(status
)) {
1469 /* Return variables */
1470 *handle
= *r
.out
.handle
;
1474 *werror
= r
.out
.result
;
1477 return werror_to_ntstatus(r
.out
.result
);
1480 NTSTATUS
rpccli_svcctl_OpenServiceA(struct rpc_pipe_client
*cli
,
1481 TALLOC_CTX
*mem_ctx
,
1482 struct policy_handle
*scmanager_handle
,
1483 const char *ServiceName
,
1484 uint32_t access_mask
,
1487 struct svcctl_OpenServiceA r
;
1491 r
.in
.scmanager_handle
= scmanager_handle
;
1492 r
.in
.ServiceName
= ServiceName
;
1493 r
.in
.access_mask
= access_mask
;
1495 if (DEBUGLEVEL
>= 10) {
1496 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA
, &r
);
1499 status
= cli_do_rpc_ndr(cli
,
1503 NDR_SVCCTL_OPENSERVICEA
,
1506 if (!NT_STATUS_IS_OK(status
)) {
1510 if (DEBUGLEVEL
>= 10) {
1511 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA
, &r
);
1514 if (NT_STATUS_IS_ERR(status
)) {
1518 /* Return variables */
1522 *werror
= r
.out
.result
;
1525 return werror_to_ntstatus(r
.out
.result
);
1528 NTSTATUS
rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client
*cli
,
1529 TALLOC_CTX
*mem_ctx
,
1530 struct policy_handle
*handle
,
1533 uint32_t *bytes_needed
,
1536 struct svcctl_QueryServiceConfigA r
;
1540 r
.in
.handle
= handle
;
1541 r
.in
.buf_size
= buf_size
;
1543 if (DEBUGLEVEL
>= 10) {
1544 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA
, &r
);
1547 status
= cli_do_rpc_ndr(cli
,
1551 NDR_SVCCTL_QUERYSERVICECONFIGA
,
1554 if (!NT_STATUS_IS_OK(status
)) {
1558 if (DEBUGLEVEL
>= 10) {
1559 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA
, &r
);
1562 if (NT_STATUS_IS_ERR(status
)) {
1566 /* Return variables */
1567 memcpy(query
, r
.out
.query
, r
.in
.buf_size
);
1568 *bytes_needed
= *r
.out
.bytes_needed
;
1572 *werror
= r
.out
.result
;
1575 return werror_to_ntstatus(r
.out
.result
);
1578 NTSTATUS
rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client
*cli
,
1579 TALLOC_CTX
*mem_ctx
,
1580 struct policy_handle
*handle
,
1582 struct SERVICE_LOCK_STATUS
*lock_status
,
1583 uint32_t *required_buf_size
,
1586 struct svcctl_QueryServiceLockStatusA r
;
1590 r
.in
.handle
= handle
;
1591 r
.in
.buf_size
= buf_size
;
1593 if (DEBUGLEVEL
>= 10) {
1594 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA
, &r
);
1597 status
= cli_do_rpc_ndr(cli
,
1601 NDR_SVCCTL_QUERYSERVICELOCKSTATUSA
,
1604 if (!NT_STATUS_IS_OK(status
)) {
1608 if (DEBUGLEVEL
>= 10) {
1609 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA
, &r
);
1612 if (NT_STATUS_IS_ERR(status
)) {
1616 /* Return variables */
1617 *lock_status
= *r
.out
.lock_status
;
1618 *required_buf_size
= *r
.out
.required_buf_size
;
1622 *werror
= r
.out
.result
;
1625 return werror_to_ntstatus(r
.out
.result
);
1628 NTSTATUS
rpccli_svcctl_StartServiceA(struct rpc_pipe_client
*cli
,
1629 TALLOC_CTX
*mem_ctx
,
1630 struct policy_handle
*handle
,
1632 const char *Arguments
,
1635 struct svcctl_StartServiceA r
;
1639 r
.in
.handle
= handle
;
1640 r
.in
.NumArgs
= NumArgs
;
1641 r
.in
.Arguments
= Arguments
;
1643 if (DEBUGLEVEL
>= 10) {
1644 NDR_PRINT_IN_DEBUG(svcctl_StartServiceA
, &r
);
1647 status
= cli_do_rpc_ndr(cli
,
1651 NDR_SVCCTL_STARTSERVICEA
,
1654 if (!NT_STATUS_IS_OK(status
)) {
1658 if (DEBUGLEVEL
>= 10) {
1659 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA
, &r
);
1662 if (NT_STATUS_IS_ERR(status
)) {
1666 /* Return variables */
1670 *werror
= r
.out
.result
;
1673 return werror_to_ntstatus(r
.out
.result
);
1676 NTSTATUS
rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client
*cli
,
1677 TALLOC_CTX
*mem_ctx
,
1678 struct policy_handle
*handle
,
1679 const char *service_name
,
1680 const char **display_name
,
1681 uint32_t *display_name_length
,
1684 struct svcctl_GetServiceDisplayNameA r
;
1688 r
.in
.handle
= handle
;
1689 r
.in
.service_name
= service_name
;
1690 r
.in
.display_name_length
= display_name_length
;
1692 if (DEBUGLEVEL
>= 10) {
1693 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA
, &r
);
1696 status
= cli_do_rpc_ndr(cli
,
1700 NDR_SVCCTL_GETSERVICEDISPLAYNAMEA
,
1703 if (!NT_STATUS_IS_OK(status
)) {
1707 if (DEBUGLEVEL
>= 10) {
1708 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA
, &r
);
1711 if (NT_STATUS_IS_ERR(status
)) {
1715 /* Return variables */
1716 *display_name
= *r
.out
.display_name
;
1717 if (display_name_length
&& r
.out
.display_name_length
) {
1718 *display_name_length
= *r
.out
.display_name_length
;
1723 *werror
= r
.out
.result
;
1726 return werror_to_ntstatus(r
.out
.result
);
1729 NTSTATUS
rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client
*cli
,
1730 TALLOC_CTX
*mem_ctx
,
1731 struct policy_handle
*handle
,
1732 const char *service_name
,
1733 const char **key_name
,
1734 uint32_t *display_name_length
,
1737 struct svcctl_GetServiceKeyNameA r
;
1741 r
.in
.handle
= handle
;
1742 r
.in
.service_name
= service_name
;
1743 r
.in
.display_name_length
= display_name_length
;
1745 if (DEBUGLEVEL
>= 10) {
1746 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA
, &r
);
1749 status
= cli_do_rpc_ndr(cli
,
1753 NDR_SVCCTL_GETSERVICEKEYNAMEA
,
1756 if (!NT_STATUS_IS_OK(status
)) {
1760 if (DEBUGLEVEL
>= 10) {
1761 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA
, &r
);
1764 if (NT_STATUS_IS_ERR(status
)) {
1768 /* Return variables */
1769 *key_name
= *r
.out
.key_name
;
1770 if (display_name_length
&& r
.out
.display_name_length
) {
1771 *display_name_length
= *r
.out
.display_name_length
;
1776 *werror
= r
.out
.result
;
1779 return werror_to_ntstatus(r
.out
.result
);
1782 NTSTATUS
rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client
*cli
,
1783 TALLOC_CTX
*mem_ctx
,
1786 struct svcctl_GetCurrentGroupeStateW r
;
1791 if (DEBUGLEVEL
>= 10) {
1792 NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW
, &r
);
1795 status
= cli_do_rpc_ndr(cli
,
1799 NDR_SVCCTL_GETCURRENTGROUPESTATEW
,
1802 if (!NT_STATUS_IS_OK(status
)) {
1806 if (DEBUGLEVEL
>= 10) {
1807 NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW
, &r
);
1810 if (NT_STATUS_IS_ERR(status
)) {
1814 /* Return variables */
1818 *werror
= r
.out
.result
;
1821 return werror_to_ntstatus(r
.out
.result
);
1824 NTSTATUS
rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client
*cli
,
1825 TALLOC_CTX
*mem_ctx
,
1828 struct svcctl_EnumServiceGroupW r
;
1833 if (DEBUGLEVEL
>= 10) {
1834 NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW
, &r
);
1837 status
= cli_do_rpc_ndr(cli
,
1841 NDR_SVCCTL_ENUMSERVICEGROUPW
,
1844 if (!NT_STATUS_IS_OK(status
)) {
1848 if (DEBUGLEVEL
>= 10) {
1849 NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW
, &r
);
1852 if (NT_STATUS_IS_ERR(status
)) {
1856 /* Return variables */
1860 *werror
= r
.out
.result
;
1863 return werror_to_ntstatus(r
.out
.result
);
1866 NTSTATUS
rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client
*cli
,
1867 TALLOC_CTX
*mem_ctx
,
1868 struct policy_handle
*handle
,
1869 uint32_t info_level
,
1873 struct svcctl_ChangeServiceConfig2A r
;
1877 r
.in
.handle
= handle
;
1878 r
.in
.info_level
= info_level
;
1881 if (DEBUGLEVEL
>= 10) {
1882 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A
, &r
);
1885 status
= cli_do_rpc_ndr(cli
,
1889 NDR_SVCCTL_CHANGESERVICECONFIG2A
,
1892 if (!NT_STATUS_IS_OK(status
)) {
1896 if (DEBUGLEVEL
>= 10) {
1897 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A
, &r
);
1900 if (NT_STATUS_IS_ERR(status
)) {
1904 /* Return variables */
1908 *werror
= r
.out
.result
;
1911 return werror_to_ntstatus(r
.out
.result
);
1914 NTSTATUS
rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client
*cli
,
1915 TALLOC_CTX
*mem_ctx
,
1916 struct policy_handle
*handle
,
1917 uint32_t info_level
,
1921 struct svcctl_ChangeServiceConfig2W r
;
1925 r
.in
.handle
= handle
;
1926 r
.in
.info_level
= info_level
;
1929 if (DEBUGLEVEL
>= 10) {
1930 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W
, &r
);
1933 status
= cli_do_rpc_ndr(cli
,
1937 NDR_SVCCTL_CHANGESERVICECONFIG2W
,
1940 if (!NT_STATUS_IS_OK(status
)) {
1944 if (DEBUGLEVEL
>= 10) {
1945 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W
, &r
);
1948 if (NT_STATUS_IS_ERR(status
)) {
1952 /* Return variables */
1956 *werror
= r
.out
.result
;
1959 return werror_to_ntstatus(r
.out
.result
);
1962 NTSTATUS
rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client
*cli
,
1963 TALLOC_CTX
*mem_ctx
,
1964 struct policy_handle
*handle
,
1965 uint32_t info_level
,
1968 uint32_t *bytes_needed
,
1971 struct svcctl_QueryServiceConfig2A r
;
1975 r
.in
.handle
= handle
;
1976 r
.in
.info_level
= info_level
;
1977 r
.in
.buf_size
= buf_size
;
1979 if (DEBUGLEVEL
>= 10) {
1980 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A
, &r
);
1983 status
= cli_do_rpc_ndr(cli
,
1987 NDR_SVCCTL_QUERYSERVICECONFIG2A
,
1990 if (!NT_STATUS_IS_OK(status
)) {
1994 if (DEBUGLEVEL
>= 10) {
1995 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A
, &r
);
1998 if (NT_STATUS_IS_ERR(status
)) {
2002 /* Return variables */
2003 memcpy(buffer
, r
.out
.buffer
, r
.in
.buf_size
);
2004 *bytes_needed
= *r
.out
.bytes_needed
;
2008 *werror
= r
.out
.result
;
2011 return werror_to_ntstatus(r
.out
.result
);
2014 NTSTATUS
rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client
*cli
,
2015 TALLOC_CTX
*mem_ctx
,
2016 struct policy_handle
*handle
,
2017 uint32_t info_level
,
2020 uint32_t *bytes_needed
,
2023 struct svcctl_QueryServiceConfig2W r
;
2027 r
.in
.handle
= handle
;
2028 r
.in
.info_level
= info_level
;
2029 r
.in
.buf_size
= buf_size
;
2031 if (DEBUGLEVEL
>= 10) {
2032 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W
, &r
);
2035 status
= cli_do_rpc_ndr(cli
,
2039 NDR_SVCCTL_QUERYSERVICECONFIG2W
,
2042 if (!NT_STATUS_IS_OK(status
)) {
2046 if (DEBUGLEVEL
>= 10) {
2047 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W
, &r
);
2050 if (NT_STATUS_IS_ERR(status
)) {
2054 /* Return variables */
2055 memcpy(buffer
, r
.out
.buffer
, r
.in
.buf_size
);
2056 *bytes_needed
= *r
.out
.bytes_needed
;
2060 *werror
= r
.out
.result
;
2063 return werror_to_ntstatus(r
.out
.result
);
2066 NTSTATUS
rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client
*cli
,
2067 TALLOC_CTX
*mem_ctx
,
2068 struct policy_handle
*handle
,
2069 uint32_t info_level
,
2072 uint32_t *bytes_needed
,
2075 struct svcctl_QueryServiceStatusEx r
;
2079 r
.in
.handle
= handle
;
2080 r
.in
.info_level
= info_level
;
2081 r
.in
.buf_size
= buf_size
;
2083 if (DEBUGLEVEL
>= 10) {
2084 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx
, &r
);
2087 status
= cli_do_rpc_ndr(cli
,
2091 NDR_SVCCTL_QUERYSERVICESTATUSEX
,
2094 if (!NT_STATUS_IS_OK(status
)) {
2098 if (DEBUGLEVEL
>= 10) {
2099 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx
, &r
);
2102 if (NT_STATUS_IS_ERR(status
)) {
2106 /* Return variables */
2107 memcpy(buffer
, r
.out
.buffer
, r
.in
.buf_size
);
2108 *bytes_needed
= *r
.out
.bytes_needed
;
2112 *werror
= r
.out
.result
;
2115 return werror_to_ntstatus(r
.out
.result
);
2118 NTSTATUS
rpccli_EnumServicesStatusExA(struct rpc_pipe_client
*cli
,
2119 TALLOC_CTX
*mem_ctx
,
2120 struct policy_handle
*scmanager
,
2121 uint32_t info_level
,
2126 uint32_t *bytes_needed
,
2127 uint32_t *service_returned
,
2128 uint32_t *resume_handle
,
2129 const char **group_name
,
2132 struct EnumServicesStatusExA r
;
2136 r
.in
.scmanager
= scmanager
;
2137 r
.in
.info_level
= info_level
;
2140 r
.in
.buf_size
= buf_size
;
2141 r
.in
.resume_handle
= resume_handle
;
2143 if (DEBUGLEVEL
>= 10) {
2144 NDR_PRINT_IN_DEBUG(EnumServicesStatusExA
, &r
);
2147 status
= cli_do_rpc_ndr(cli
,
2151 NDR_ENUMSERVICESSTATUSEXA
,
2154 if (!NT_STATUS_IS_OK(status
)) {
2158 if (DEBUGLEVEL
>= 10) {
2159 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA
, &r
);
2162 if (NT_STATUS_IS_ERR(status
)) {
2166 /* Return variables */
2167 memcpy(services
, r
.out
.services
, r
.in
.buf_size
);
2168 *bytes_needed
= *r
.out
.bytes_needed
;
2169 *service_returned
= *r
.out
.service_returned
;
2170 if (resume_handle
&& r
.out
.resume_handle
) {
2171 *resume_handle
= *r
.out
.resume_handle
;
2173 *group_name
= *r
.out
.group_name
;
2177 *werror
= r
.out
.result
;
2180 return werror_to_ntstatus(r
.out
.result
);
2183 NTSTATUS
rpccli_EnumServicesStatusExW(struct rpc_pipe_client
*cli
,
2184 TALLOC_CTX
*mem_ctx
,
2185 struct policy_handle
*scmanager
,
2186 uint32_t info_level
,
2191 uint32_t *bytes_needed
,
2192 uint32_t *service_returned
,
2193 uint32_t *resume_handle
,
2194 const char **group_name
,
2197 struct EnumServicesStatusExW r
;
2201 r
.in
.scmanager
= scmanager
;
2202 r
.in
.info_level
= info_level
;
2205 r
.in
.buf_size
= buf_size
;
2206 r
.in
.resume_handle
= resume_handle
;
2208 if (DEBUGLEVEL
>= 10) {
2209 NDR_PRINT_IN_DEBUG(EnumServicesStatusExW
, &r
);
2212 status
= cli_do_rpc_ndr(cli
,
2216 NDR_ENUMSERVICESSTATUSEXW
,
2219 if (!NT_STATUS_IS_OK(status
)) {
2223 if (DEBUGLEVEL
>= 10) {
2224 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW
, &r
);
2227 if (NT_STATUS_IS_ERR(status
)) {
2231 /* Return variables */
2232 memcpy(services
, r
.out
.services
, r
.in
.buf_size
);
2233 *bytes_needed
= *r
.out
.bytes_needed
;
2234 *service_returned
= *r
.out
.service_returned
;
2235 if (resume_handle
&& r
.out
.resume_handle
) {
2236 *resume_handle
= *r
.out
.resume_handle
;
2238 *group_name
= *r
.out
.group_name
;
2242 *werror
= r
.out
.result
;
2245 return werror_to_ntstatus(r
.out
.result
);
2248 NTSTATUS
rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client
*cli
,
2249 TALLOC_CTX
*mem_ctx
,
2252 struct svcctl_SCSendTSMessage r
;
2257 if (DEBUGLEVEL
>= 10) {
2258 NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage
, &r
);
2261 status
= cli_do_rpc_ndr(cli
,
2265 NDR_SVCCTL_SCSENDTSMESSAGE
,
2268 if (!NT_STATUS_IS_OK(status
)) {
2272 if (DEBUGLEVEL
>= 10) {
2273 NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage
, &r
);
2276 if (NT_STATUS_IS_ERR(status
)) {
2280 /* Return variables */
2284 *werror
= r
.out
.result
;
2287 return werror_to_ntstatus(r
.out
.result
);