2 Unix SMB/CIFS implementation.
5 Copyright (C) Andrew Tridgell 1992-1998,
6 Largely rewritten by Jeremy Allison (C) 2005.
7 Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 /* Shutdown a server */
28 NTSTATUS rpccli_shutdown_init(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
29 const char *msg, uint32 timeout, BOOL do_reboot,
36 WERROR result = WERR_GENERAL_FAILURE;
39 return NT_STATUS_INVALID_PARAMETER;
44 /* Marshall data and send request */
46 init_shutdown_q_init(&q, msg, timeout, do_reboot, force);
48 CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT,
53 NT_STATUS_UNSUCCESSFUL);
56 return werror_to_ntstatus(result);
59 /* Shutdown a server */
61 NTSTATUS rpccli_shutdown_init_ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
62 const char *msg, uint32 timeout, BOOL do_reboot,
63 BOOL force, uint32 reason)
69 WERROR result = WERR_GENERAL_FAILURE;
72 return NT_STATUS_INVALID_PARAMETER;
77 /* Marshall data and send request */
79 init_shutdown_q_init_ex(&q, msg, timeout, do_reboot, force, reason);
81 CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT_EX,
84 shutdown_io_q_init_ex,
85 shutdown_io_r_init_ex,
86 NT_STATUS_UNSUCCESSFUL);
89 return werror_to_ntstatus(result);
93 /* Abort a server shutdown */
95 NTSTATUS rpccli_shutdown_abort(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
101 WERROR result = WERR_GENERAL_FAILURE;
106 /* Marshall data and send request */
108 init_shutdown_q_abort(&q);
110 CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_ABORT,
115 NT_STATUS_UNSUCCESSFUL);
118 return werror_to_ntstatus(result);