Fairly large change to printing code.
[Samba.git] / source / rpc_server / srv_wkssvc.c
blobc783becbbeba38ea41ce810ead017f63ff3e76a1
1 /*
2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Andrew Tridgell 1992-1997,
5 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
6 * Copyright (C) Paul Ashton 1997.
7 *
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.
23 /* This is the interface to the wks pipe. */
25 #include "includes.h"
27 #undef DBGC_CLASS
28 #define DBGC_CLASS DBGC_RPC_SRV
30 /*******************************************************************
31 api_wks_query_info
32 ********************************************************************/
34 static BOOL api_wks_query_info(pipes_struct *p)
36 WKS_Q_QUERY_INFO q_u;
37 WKS_R_QUERY_INFO r_u;
38 prs_struct *data = &p->in_data.data;
39 prs_struct *rdata = &p->out_data.rdata;
41 ZERO_STRUCT(q_u);
42 ZERO_STRUCT(r_u);
44 /* grab the net share enum */
45 if(!wks_io_q_query_info("", &q_u, data, 0))
46 return False;
48 r_u.status = _wks_query_info(p, &q_u, &r_u);
50 /* store the response in the SMB stream */
51 if(!wks_io_r_query_info("", &r_u, rdata, 0))
52 return False;
54 return True;
58 /*******************************************************************
59 \PIPE\wkssvc commands
60 ********************************************************************/
61 static struct api_struct api_wks_cmds[] =
63 { "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info },
64 { NULL , 0 , NULL }
67 /*******************************************************************
68 receives a wkssvc pipe and responds.
69 ********************************************************************/
70 BOOL api_wkssvc_rpc(pipes_struct *p)
72 return api_rpcTNP(p, "api_wkssvc_rpc", api_wks_cmds);