2 Unix SMB/Netbios implementation.
6 Copyright (C) Andrew Tridgell 1992-1998,
7 Copyright (C) Luke Kenneth Casson Leighton 1996-1998,
8 Copyright (C) Paul Ashton 1997-1998.
9 Copyright (C) Jeremy Allison 1999.
10 Copyright (C) Simo Sorce 2001
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 /* Opens a SMB connection to the WINREG pipe */
31 struct cli_state *cli_winreg_initialise(struct cli_state *cli,
33 struct ntuser_creds *creds)
35 return cli_pipe_initialise(cli, system_name, PIPE_WINREG, creds);
38 /* Shutdown a server */
40 NTSTATUS cli_reg_shutdown(struct cli_state * cli, TALLOC_CTX *mem_ctx,
41 const char *msg, uint32 timeout, uint16 flags)
47 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
49 if (msg == NULL) return NT_STATUS_INVALID_PARAMETER;
54 prs_init(&qbuf , MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
55 prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
57 /* Marshall data and send request */
59 init_reg_q_shutdown(&q_s, msg, timeout, flags);
61 if (!reg_io_q_shutdown("", &q_s, &qbuf, 0) ||
62 !rpc_api_pipe_req(cli, REG_SHUTDOWN, &qbuf, &rbuf))
65 /* Unmarshall response */
67 if(reg_io_r_shutdown("", &r_s, &rbuf, 0))
78 /* Abort a server shutdown */
80 NTSTATUS cli_reg_abort_shutdown(struct cli_state * cli, TALLOC_CTX *mem_ctx)
84 REG_Q_ABORT_SHUTDOWN q_s;
85 REG_R_ABORT_SHUTDOWN r_s;
86 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
91 prs_init(&qbuf , MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
92 prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
94 /* Marshall data and send request */
96 init_reg_q_abort_shutdown(&q_s);
98 if (!reg_io_q_abort_shutdown("", &q_s, &qbuf, 0) ||
99 !rpc_api_pipe_req(cli, REG_ABORT_SHUTDOWN, &qbuf, &rbuf))
102 /* Unmarshall response */
104 if (reg_io_r_abort_shutdown("", &r_s, &rbuf, 0))
109 prs_mem_free(&qbuf );