00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "includes.h"
00025
00026
00027
00028 NTSTATUS rpccli_shutdown_init(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00029 const char *msg, uint32 timeout, BOOL do_reboot,
00030 BOOL force)
00031 {
00032 prs_struct qbuf;
00033 prs_struct rbuf;
00034 SHUTDOWN_Q_INIT q;
00035 SHUTDOWN_R_INIT r;
00036 WERROR result = WERR_GENERAL_FAILURE;
00037
00038 if (msg == NULL)
00039 return NT_STATUS_INVALID_PARAMETER;
00040
00041 ZERO_STRUCT (q);
00042 ZERO_STRUCT (r);
00043
00044
00045
00046 init_shutdown_q_init(&q, msg, timeout, do_reboot, force);
00047
00048 CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT,
00049 q, r,
00050 qbuf, rbuf,
00051 shutdown_io_q_init,
00052 shutdown_io_r_init,
00053 NT_STATUS_UNSUCCESSFUL);
00054
00055 result = r.status;
00056 return werror_to_ntstatus(result);
00057 }
00058
00059
00060
00061 NTSTATUS rpccli_shutdown_init_ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00062 const char *msg, uint32 timeout, BOOL do_reboot,
00063 BOOL force, uint32 reason)
00064 {
00065 prs_struct qbuf;
00066 prs_struct rbuf;
00067 SHUTDOWN_Q_INIT_EX q;
00068 SHUTDOWN_R_INIT_EX r;
00069 WERROR result = WERR_GENERAL_FAILURE;
00070
00071 if (msg == NULL)
00072 return NT_STATUS_INVALID_PARAMETER;
00073
00074 ZERO_STRUCT (q);
00075 ZERO_STRUCT (r);
00076
00077
00078
00079 init_shutdown_q_init_ex(&q, msg, timeout, do_reboot, force, reason);
00080
00081 CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT_EX,
00082 q, r,
00083 qbuf, rbuf,
00084 shutdown_io_q_init_ex,
00085 shutdown_io_r_init_ex,
00086 NT_STATUS_UNSUCCESSFUL);
00087
00088 result = r.status;
00089 return werror_to_ntstatus(result);
00090 }
00091
00092
00093
00094
00095 NTSTATUS rpccli_shutdown_abort(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
00096 {
00097 prs_struct rbuf;
00098 prs_struct qbuf;
00099 SHUTDOWN_Q_ABORT q;
00100 SHUTDOWN_R_ABORT r;
00101 WERROR result = WERR_GENERAL_FAILURE;
00102
00103 ZERO_STRUCT (q);
00104 ZERO_STRUCT (r);
00105
00106
00107
00108 init_shutdown_q_abort(&q);
00109
00110 CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_ABORT,
00111 q, r,
00112 qbuf, rbuf,
00113 shutdown_io_q_abort,
00114 shutdown_io_r_abort,
00115 NT_STATUS_UNSUCCESSFUL);
00116
00117 result = r.status;
00118 return werror_to_ntstatus(result);
00119 }