This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / source3 / rpc_server / srv_wkssvc.c
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.
12  *  
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.
17  *  
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.
21  */
22
23 /* This is the interface to the wks pipe. */
24
25 #include "includes.h"
26
27 /*******************************************************************
28  api_wks_query_info
29  ********************************************************************/
30
31 static BOOL api_wks_query_info(pipes_struct *p)
32 {
33         WKS_Q_QUERY_INFO q_u;
34         WKS_R_QUERY_INFO r_u;
35         prs_struct *data = &p->in_data.data;
36         prs_struct *rdata = &p->out_data.rdata;
37
38         ZERO_STRUCT(q_u);
39         ZERO_STRUCT(r_u);
40
41         /* grab the net share enum */
42         if(!wks_io_q_query_info("", &q_u, data, 0))
43                 return False;
44
45         r_u.status = _wks_query_info(p, &q_u, &r_u);
46
47         /* store the response in the SMB stream */
48         if(!wks_io_r_query_info("", &r_u, rdata, 0))
49                 return False;
50
51         return True;
52 }
53
54
55 /*******************************************************************
56  \PIPE\wkssvc commands
57  ********************************************************************/
58 struct api_struct api_wks_cmds[] =
59 {
60         { "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info },
61         { NULL             , 0            , NULL }
62 };
63
64 /*******************************************************************
65  receives a wkssvc pipe and responds.
66  ********************************************************************/
67 BOOL api_wkssvc_rpc(pipes_struct *p)
68 {
69         return api_rpcTNP(p, "api_wkssvc_rpc", api_wks_cmds);
70 }