2 * Unix SMB/Netbios implementation.
4 * RPC Pipe client / server routines
5 * Copyright (C) Andrew Tridgell 1992-1999,
6 * Copyright (C) Luke Kenneth Casson Leighton 1996-1999,
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.
24 #include "rpc_parse.h"
25 #include "rpc_client.h"
27 extern int DEBUGLEVEL
;
29 /****************************************************************************
31 ****************************************************************************/
32 BOOL
brs_query_info(const char *srv_name
, uint32 switch_value
, void *id
)
37 BOOL valid_info
= False
;
39 struct cli_connection
*con
= NULL
;
41 if (!cli_connection_init(srv_name
, PIPE_BROWSER
, &con
))
46 if (id
== NULL
) return False
;
48 prs_init(&buf
, 0, 4, False
);
49 prs_init(&rbuf
, 0, 4, True
);
51 /* create and send a MSRPC command with api BRS_QUERY_INFO */
53 DEBUG(4,("BRS Query Info\n"));
55 /* store the parameters */
56 make_brs_q_query_info(&q_o
, srv_name
, switch_value
);
58 /* turn parameters into data stream */
59 if (brs_io_q_query_info("", &q_o
, &buf
, 0) &&
60 rpc_con_pipe_req(con
, BRS_QUERY_INFO
, &buf
, &rbuf
))
67 brs_io_r_query_info("", &r_o
, &rbuf
, 0);
70 if (p
&& r_o
.status
!= 0)
72 /* report error code */
73 DEBUG(0,("BRS_R_QUERY_INFO: %s\n", get_nt_error_msg(r_o
.status
)));
86 cli_connection_unlink(con
);