diff options
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_svcctl.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_svcctl.c b/source3/rpc_client/cli_svcctl.c index 1e1fe884ff..e09cd4ec12 100644 --- a/source3/rpc_client/cli_svcctl.c +++ b/source3/rpc_client/cli_svcctl.c @@ -230,6 +230,64 @@ BOOL svc_enum_svcs(struct cli_state *cli, uint16 fnum, /**************************************************************************** +do a SVC Stop Service +****************************************************************************/ +BOOL svc_stop_service(struct cli_state *cli, uint16 fnum, + POLICY_HND *hnd, + uint32 unknown) +{ + prs_struct rbuf; + prs_struct buf; + SVC_Q_STOP_SERVICE q_c; + BOOL valid_cfg = False; + + if (hnd == NULL) return False; + + /* create and send a MSRPC command with api SVC_STOP_SERVICE */ + + prs_init(&buf , 1024, 4, SAFETY_MARGIN, False); + prs_init(&rbuf, 0 , 4, SAFETY_MARGIN, True ); + + DEBUG(4,("SVC Stop Service\n")); + + /* store the parameters */ + make_svc_q_stop_service(&q_c, hnd, unknown); + + /* turn parameters into data stream */ + svc_io_q_stop_service("", &q_c, &buf, 0); + + /* send the data on \PIPE\ */ + if (rpc_api_pipe_req(cli, fnum, SVC_STOP_SERVICE, &buf, &rbuf)) + { + SVC_R_STOP_SERVICE r_c; + BOOL p; + + ZERO_STRUCT (r_c); + + svc_io_r_stop_service("", &r_c, &rbuf, 0); + p = rbuf.offset != 0; + + if (p && r_c.status != 0) + { + /* report error code */ + DEBUG(1,("SVC_START_SERVICE: %s\n", get_nt_error_msg(r_c.status))); + p = False; + } + + if (p) + { + valid_cfg = True; + } + } + + prs_mem_free(&rbuf); + prs_mem_free(&buf ); + + return valid_cfg; +} + + +/**************************************************************************** do a SVC Start Service ****************************************************************************/ BOOL svc_start_service(struct cli_state *cli, uint16 fnum, |