2 Unix SMB/CIFS implementation.
3 NT Domain Authentication SMB / MSRPC client
4 Copyright (C) Andrew Tridgell 1994-2000
5 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
6 Copyright (C) Tim Potter 2001
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /* Opens a SMB connection to the svrsvc pipe */
27 struct cli_state
*cli_svrsvc_initialise(struct cli_state
*cli
,
29 struct ntuser_creds
*creds
)
31 return cli_pipe_initialise(cli
, system_name
, PIPE_SRVSVC
, creds
);
34 NTSTATUS
cli_srvsvc_net_srv_get_info(struct cli_state
*cli
,
36 uint32 switch_value
, SRV_INFO_CTR
*ctr
)
38 prs_struct qbuf
, rbuf
;
39 SRV_Q_NET_SRV_GET_INFO q
;
40 SRV_R_NET_SRV_GET_INFO r
;
46 /* Initialise parse structures */
48 prs_init(&qbuf
, MAX_PDU_FRAG_LEN
, mem_ctx
, MARSHALL
);
49 prs_init(&rbuf
, 0, mem_ctx
, UNMARSHALL
);
51 /* Initialise input parameters */
53 init_srv_q_net_srv_get_info(&q
, cli
->srv_name_slash
, switch_value
);
55 /* Marshall data and send request */
57 if (!srv_io_q_net_srv_get_info("", &q
, &qbuf
, 0) ||
58 !rpc_api_pipe_req(cli
, SRV_NET_SRV_GET_INFO
, &qbuf
, &rbuf
)) {
59 result
= NT_STATUS_UNSUCCESSFUL
;
63 /* Unmarshall response */
67 if (!srv_io_r_net_srv_get_info("", &r
, &rbuf
, 0)) {
68 result
= NT_STATUS_UNSUCCESSFUL
;
72 result
= werror_to_ntstatus(r
.status
);