adding svcctl 0x1b function
[tprouty/samba.git] / source / include / rpc_svcctl.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1997
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7    Copyright (C) Paul Ashton 1997
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef _RPC_SVCCTL_H /* _RPC_SVCCTL_H */
25 #define _RPC_SVCCTL_H 
26
27
28 /* svcctl pipe */
29 #define SVC_OPEN_SC_MAN      0x0f
30 #define SVC_ENUM_SVCS_STATUS 0x0e
31 #define SVC_QUERY_SVC_CONFIG 0x11
32 #define SVC_QUERY_DISP_NAME  0x14
33 #define SVC_OPEN_SERVICE     0x10
34 #define SVC_START_SERVICE    0x13
35 #define SVC_STOP_SERVICE     0x01
36 #define SVC_UNKNOWN_1B       0x1b
37 #define SVC_CLOSE            0x00
38
39
40 /* SVC_Q_OPEN_SC_MAN */
41 typedef struct q_svc_open_sc_man_info
42 {
43         uint32 ptr_srv_name;         /* pointer (to server name?) */
44         UNISTR2 uni_srv_name;        /* unicode server name starting with '\\' */
45
46         uint32 ptr_db_name;         /* pointer (to database name?) */
47         UNISTR2 uni_db_name;        /* unicode database name */
48
49         uint32 des_access;            /* 0x80000004 - SC_MANAGER_xxxx */
50
51 } SVC_Q_OPEN_SC_MAN;
52
53 /* SVC_R_OPEN_SC_MAN */
54 typedef struct r_svc_open_sc_man_info
55 {
56         POLICY_HND pol;
57         uint32 status;             /* return status */
58
59 } SVC_R_OPEN_SC_MAN;
60
61 /* SVC_Q_OPEN_SERVICE */
62 typedef struct q_svc_open_service_info
63 {
64         POLICY_HND scman_pol;
65         UNISTR2 uni_svc_name;        /* unicode service name */
66         uint32 des_access;            /* 0x8000 0001 */
67
68 } SVC_Q_OPEN_SERVICE;
69
70 /* SVC_R_OPEN_SERVICE */
71 typedef struct r_svc_open_service_info
72 {
73         POLICY_HND pol;
74         uint32 status;             /* return status */
75
76 } SVC_R_OPEN_SERVICE;
77
78 #define MAX_SVC_ARGS 10
79
80 /* SVC_Q_STOP_SERVICE */
81 typedef struct q_svc_stop_service_info
82 {
83         POLICY_HND pol;
84
85         uint32 unknown;
86
87 } SVC_Q_STOP_SERVICE;
88
89 /* SVC_R_STOP_SERVICE */
90 typedef struct r_svc_stop_service_info
91 {
92         uint32 unknown0; /* 0x00000020 */
93         uint32 unknown1; /* 0x00000001 */
94         uint32 unknown2; /* 0x00000001 */
95         uint32 unknown3; /* 0x00000000 */
96         uint32 unknown4; /* 0x00000000 */
97         uint32 unknown5; /* 0x00000000 */
98         uint32 unknown6; /* 0x00000000 */
99         uint32 status;
100
101 } SVC_R_STOP_SERVICE;
102
103 /* SVC_Q_START_SERVICE */
104 typedef struct q_svc_start_service_info
105 {
106         POLICY_HND pol;
107
108         uint32 argc;
109         uint32 ptr_args;
110         uint32 argc2;
111         uint32 ptr_argv[MAX_SVC_ARGS];
112         UNISTR2 argv[MAX_SVC_ARGS];
113
114 } SVC_Q_START_SERVICE;
115
116 /* SVC_R_START_SERVICE */
117 typedef struct r_svc_start_service_info
118 {
119         uint32 status;
120
121 } SVC_R_START_SERVICE;
122
123
124 /* QUERY_SERVICE_CONFIG */
125 typedef struct query_service_config_info
126 {
127         uint32 service_type;
128         uint32 start_type;
129         uint32 error_control;
130         uint32 ptr_bin_path_name; 
131         uint32 ptr_load_order_grp; 
132         uint32 tag_id;
133         uint32 ptr_dependencies;
134         uint32 ptr_service_start_name;
135         uint32 ptr_display_name;
136
137         UNISTR2 uni_bin_path_name;
138         UNISTR2 uni_load_order_grp;
139         UNISTR2 uni_dependencies;
140         UNISTR2 uni_service_start_name;
141         UNISTR2 uni_display_name;
142
143 } QUERY_SERVICE_CONFIG;
144
145 /* SVC_STATUS */
146 typedef struct svc_status_info
147 {
148         uint32 svc_type;
149         uint32 current_state;
150         uint32 controls_accepted;
151         uint32 win32_exit_code;
152         uint32 svc_specific_exit_code;
153         uint32 check_point;
154         uint32 wait_hint;
155
156 } SVC_STATUS;
157
158 /* ENUM_SRVC_STATUS */
159 typedef struct enum_svc_status_info
160 {
161         UNISTR uni_srvc_name;
162         UNISTR uni_disp_name;
163         SVC_STATUS status;
164
165 } ENUM_SRVC_STATUS;
166
167 /* SVC_Q_ENUM_SVCS_STATUS */
168 typedef struct q_svc_enum_svcs_status_info
169 {
170         POLICY_HND pol;
171         uint32 service_type; /* 0x00000030 - win32 | 0x0000000b - driver */
172         uint32 service_state; /* 0x00000003 - state_all */
173         uint32 buf_size; /* max service buffer size */
174         ENUM_HND resume_hnd; /* resume handle */
175
176 } SVC_Q_ENUM_SVCS_STATUS;
177
178 /* SVC_R_ENUM_SVCS_STATUS */
179 typedef struct r_svc_enum_svcs_status_info
180 {
181         uint32 buf_size; /* service buffer size */
182         ENUM_SRVC_STATUS *svcs;
183         uint32 more_buf_size;
184         uint32 num_svcs;
185         ENUM_HND resume_hnd; /* resume handle */
186         uint32 dos_status; /* return status, DOS error code (wow!) */
187
188 } SVC_R_ENUM_SVCS_STATUS;
189
190
191 /* SVC_Q_QUERY_SVC_CONFIG */
192 typedef struct q_svc_query_svc_cfg_info
193 {
194         POLICY_HND pol;
195         uint32 buf_size;
196
197 } SVC_Q_QUERY_SVC_CONFIG;
198
199
200 /* SVC_R_QUERY_SVC_CONFIG */
201 typedef struct r_svc_query_svc_cfg_info
202 {
203         QUERY_SERVICE_CONFIG *cfg;
204         uint32 buf_size;
205         uint32 status;             /* return status */
206
207 } SVC_R_QUERY_SVC_CONFIG;
208
209
210 /* SVC_Q_QUERY_DISP_NAME */
211 typedef struct q_svc_query_disp_name_info
212 {
213         POLICY_HND scman_pol;
214         UNISTR2 uni_svc_name;
215         uint32 buf_size;
216
217 } SVC_Q_QUERY_DISP_NAME;
218
219
220 /* SVC_R_QUERY_DISP_NAME */
221 typedef struct r_svc_query_disp_name_info
222 {
223         UNISTR2 uni_disp_name;
224         uint32 buf_size;
225         uint32 status;
226
227 } SVC_R_QUERY_DISP_NAME;
228
229
230 /* SVC_Q_CLOSE */
231 typedef struct q_svc_close_info
232 {
233         POLICY_HND pol;
234
235 } SVC_Q_CLOSE;
236
237
238
239 /* SVC_R_CLOSE */
240 typedef struct r_svc_close_info
241 {
242         POLICY_HND pol;
243         uint32 status;             /* return status */
244
245 } SVC_R_CLOSE;
246
247 /* SVC_Q_UNKNOWN_1B */
248 typedef struct q_svc_unk_1b_info
249 {
250         POLICY_HND pol; /* service policy handle */
251         uint32 switch_value;    /* 0x01 */
252         uint32 unknown_1;       /* 0x0000 0228 */
253
254 } SVC_Q_UNKNOWN_1B;
255
256 /* SVC_R_UNKNOWN_1B */
257 typedef struct r_svc_unk_1b_info
258 {
259         uint32 switch_value1;   /* 0x01 */
260         uint32 ptr;
261         uint32 switch_value2;   /* 0x01 */
262         uint32 unknown_1;       /* 0x0000 0228 */
263         uint32 num_items1;
264         uint32 *ptr_items;
265         uint32 num_items2;
266         uint32 **items;
267
268         uint32 status;
269
270 } SVC_R_UNKNOWN_1B;
271
272 #endif /* _RPC_SVCCTL_H */
273