#include "includes.h"
NTSTATUS rpccli_shutdown_init(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
const char *msg, uint32 timeout, BOOL do_reboot,
BOOL force)
{
prs_struct qbuf;
prs_struct rbuf;
SHUTDOWN_Q_INIT q;
SHUTDOWN_R_INIT r;
WERROR result = WERR_GENERAL_FAILURE;
if (msg == NULL)
return NT_STATUS_INVALID_PARAMETER;
ZERO_STRUCT (q);
ZERO_STRUCT (r);
init_shutdown_q_init(&q, msg, timeout, do_reboot, force);
CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT,
q, r,
qbuf, rbuf,
shutdown_io_q_init,
shutdown_io_r_init,
NT_STATUS_UNSUCCESSFUL);
result = r.status;
return werror_to_ntstatus(result);
}
NTSTATUS rpccli_shutdown_init_ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
const char *msg, uint32 timeout, BOOL do_reboot,
BOOL force, uint32 reason)
{
prs_struct qbuf;
prs_struct rbuf;
SHUTDOWN_Q_INIT_EX q;
SHUTDOWN_R_INIT_EX r;
WERROR result = WERR_GENERAL_FAILURE;
if (msg == NULL)
return NT_STATUS_INVALID_PARAMETER;
ZERO_STRUCT (q);
ZERO_STRUCT (r);
init_shutdown_q_init_ex(&q, msg, timeout, do_reboot, force, reason);
CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT_EX,
q, r,
qbuf, rbuf,
shutdown_io_q_init_ex,
shutdown_io_r_init_ex,
NT_STATUS_UNSUCCESSFUL);
result = r.status;
return werror_to_ntstatus(result);
}
NTSTATUS rpccli_shutdown_abort(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
{
prs_struct rbuf;
prs_struct qbuf;
SHUTDOWN_Q_ABORT q;
SHUTDOWN_R_ABORT r;
WERROR result = WERR_GENERAL_FAILURE;
ZERO_STRUCT (q);
ZERO_STRUCT (r);
init_shutdown_q_abort(&q);
CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_ABORT,
q, r,
qbuf, rbuf,
shutdown_io_q_abort,
shutdown_io_r_abort,
NT_STATUS_UNSUCCESSFUL);
result = r.status;
return werror_to_ntstatus(result);
}