diff options
author | Gerald Carter <jerry@samba.org> | 2005-03-25 00:38:30 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-03-25 00:38:30 +0000 |
commit | c82cfaa3c5ef8dbcd16db8056b3670d0c55f592d (patch) | |
tree | 574276556c99b2b091c7048bd34b9ffd44b8bfb2 /source/rpc_client/cli_svcctl.c | |
parent | 9335ae41686faf867bc89c1e6a5d5716e13d66f9 (diff) | |
download | samba-c82cfaa3c5ef8dbcd16db8056b3670d0c55f592d.tar.gz samba-c82cfaa3c5ef8dbcd16db8056b3670d0c55f592d.tar.xz samba-c82cfaa3c5ef8dbcd16db8056b3670d0c55f592d.zip |
r6051: finish off
net rpc service stop
net rpc service start
net rpc service pause
net rpc service resume
Diffstat (limited to 'source/rpc_client/cli_svcctl.c')
-rw-r--r-- | source/rpc_client/cli_svcctl.c | 69 |
1 files changed, 56 insertions, 13 deletions
diff --git a/source/rpc_client/cli_svcctl.c b/source/rpc_client/cli_svcctl.c index c9fdc613790..19bf4199831 100644 --- a/source/rpc_client/cli_svcctl.c +++ b/source/rpc_client/cli_svcctl.c @@ -28,13 +28,13 @@ struct svc_state_msg { }; static struct svc_state_msg state_msg_table[] = { - { SVCCTL_STOPPED, "SVCCTL_STOPPED" }, - { SVCCTL_START_PENDING, "SVCCTL_START_PENDING" }, - { SVCCTL_STOP_PENDING, "SVCCTL_STOP_PENDING" }, - { SVCCTL_RUNNING, "SVCCTL_RUNNING" }, - { SVCCTL_CONTINUE_PENDING, "SVCCTL_CONTINUE_PENDING" }, - { SVCCTL_PAUSE_PENDING, "SVCCTL_PAUSE_PENDING" }, - { SVCCTL_PAUSED, "SVCCTL_PAUSED" }, + { SVCCTL_STOPPED, "stopped" }, + { SVCCTL_START_PENDING, "start pending" }, + { SVCCTL_STOP_PENDING, "stop pending" }, + { SVCCTL_RUNNING, "running" }, + { SVCCTL_CONTINUE_PENDING, "resume pending" }, + { SVCCTL_PAUSE_PENDING, "pause pending" }, + { SVCCTL_PAUSED, "paused" }, { 0, NULL } }; @@ -136,7 +136,7 @@ WERROR cli_svcctl_open_service( struct cli_state *cli, TALLOC_CTX *mem_ctx, /******************************************************************** ********************************************************************/ -WERROR close_service_handle( struct cli_state *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hService ) +WERROR cli_svcctl_close_service( struct cli_state *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hService ) { SVCCTL_Q_CLOSE_SERVICE in; SVCCTL_R_CLOSE_SERVICE out; @@ -310,19 +310,62 @@ WERROR cli_svcctl_query_config(struct cli_state *cli, TALLOC_CTX *mem_ctx, /******************************************************************* *******************************************************************/ -WERROR cli_svcctl_start_service(struct cli_state *cli, TALLOC_CTX *mem_ctx ) +WERROR cli_svcctl_start_service( struct cli_state *cli, TALLOC_CTX *mem_ctx, + POLICY_HND *hService, + const char **parm_array, uint32 parmcount ) { - - return WERR_OK; + SVCCTL_Q_START_SERVICE in; + SVCCTL_R_START_SERVICE out; + prs_struct qbuf, rbuf; + + ZERO_STRUCT(in); + ZERO_STRUCT(out); + + memcpy( &in.handle, hService, sizeof(POLICY_HND) ); + + in.parmcount = 0; + in.parameters.ref_id = 0x0; + + CLI_DO_RPC( cli, mem_ctx, PI_SVCCTL, SVCCTL_START_SERVICE_W, + in, out, + qbuf, rbuf, + svcctl_io_q_start_service, + svcctl_io_r_start_service, + WERR_GENERAL_FAILURE ); + + return out.status; } /******************************************************************* *******************************************************************/ -WERROR cli_svcctl_control_service(struct cli_state *cli, TALLOC_CTX *mem_ctx ) +WERROR cli_svcctl_control_service( struct cli_state *cli, TALLOC_CTX *mem_ctx, + POLICY_HND *hService, uint32 control, + SERVICE_STATUS *status ) { + SVCCTL_Q_CONTROL_SERVICE in; + SVCCTL_R_CONTROL_SERVICE out; + prs_struct qbuf, rbuf; + + ZERO_STRUCT(in); + ZERO_STRUCT(out); + + memcpy( &in.handle, hService, sizeof(POLICY_HND) ); + in.control = control; + + CLI_DO_RPC( cli, mem_ctx, PI_SVCCTL, SVCCTL_CONTROL_SERVICE, + in, out, + qbuf, rbuf, + svcctl_io_q_control_service, + svcctl_io_r_control_service, + WERR_GENERAL_FAILURE ); + + if ( !W_ERROR_IS_OK( out.status ) ) + return out.status; - return WERR_OK; + memcpy( status, &out.svc_status, sizeof(SERVICE_STATUS) ); + + return out.status; } |