106e262d32dedfc66d5700af8244dcc91a5ae63d
[samba.git] / source / librpc / idl / svcctl.idl
1 #include "idl_types.h"
2
3 /*
4   svcctl interface definitions
5 */
6
7 [ uuid("367abb81-9844-35f1-ad32-98f038001003"),
8   version(2.0),
9   pointer_default(unique),
10   endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"),
11   helpstring("Service Control")
12 ] interface svcctl
13 {
14         typedef struct {
15                 uint32 is_locked;
16                 unistr *lock_owner;
17                 uint32 lock_duration;
18         } SERVICE_LOCK_STATUS;
19
20         typedef struct {
21                 uint32 type;
22                 uint32 state;
23                 uint32 controls_accepted;
24                 uint32 win32_exit_code;
25                 uint32 service_exit_code;
26                 uint32 check_point;
27                 uint32 wait_hint;
28         } SERVICE_STATUS;
29
30         typedef struct {
31                 [relative] astring *service_name;
32                 [relative] astring *display_name;
33                 SERVICE_STATUS status;
34         } ENUM_SERVICE_STATUS;
35
36         const int SERVICE_TYPE_KERNEL_DRIVER       = 0x01;
37         const int SERVICE_TYPE_FS_DRIVER           = 0x02;
38         const int SERVICE_TYPE_ADAPTER             = 0x04;
39         const int SERVICE_TYPE_RECOGNIZER_DRIVER   = 0x08;
40         const int SERVICE_TYPE_DRIVER=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER;
41         const int SERVICE_TYPE_WIN32_OWN_PROCESS   = 0x10;
42         const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
43         const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
44
45         const int SERVICE_STATE_ACTIVE   = 0x01;
46         const int SERVICE_STATE_INACTIVE = 0x02;
47         const int SERVICE_STATE_ALL      = 0x00;
48
49         typedef [public,bitmap32bit] bitmap {
50                 SV_TYPE_WORKSTATION       = 0x00000001,
51                 SV_TYPE_SERVER            = 0x00000002,
52                 SV_TYPE_SQLSERVER         = 0x00000004,
53                 SV_TYPE_DOMAIN_CTRL       = 0x00000008,
54                 SV_TYPE_DOMAIN_BAKCTRL    = 0x00000010,
55                 SV_TYPE_TIME_SOURCE       = 0x00000020,
56                 SV_TYPE_AFP               = 0x00000040,
57                 SV_TYPE_NOVELL            = 0x00000080,
58
59                 SV_TYPE_DOMAIN_MEMBER     = 0x00000100,
60                 SV_TYPE_PRINTQ_SERVER     = 0x00000200,
61                 SV_TYPE_DIALIN_SERVER     = 0x00000400,
62                 SV_TYPE_SERVER_UNIX       = 0x00000800,
63                 SV_TYPE_NT                = 0x00001000,
64                 SV_TYPE_WFW               = 0x00002000,
65                 SV_TYPE_SERVER_MFPN       = 0x00004000,
66                 SV_TYPE_SERVER_NT         = 0x00008000,
67                 SV_TYPE_POTENTIAL_BROWSER = 0x00010000,
68                 SV_TYPE_BACKUP_BROWSER    = 0x00020000,
69                 SV_TYPE_MASTER_BROWSER    = 0x00040000,
70                 SV_TYPE_DOMAIN_MASTER     = 0x00080000,
71                 SV_TYPE_SERVER_OSF        = 0x00100000,
72                 SV_TYPE_SERVER_VMS        = 0x00200000,
73                 SV_TYPE_WIN95_PLUS        = 0x00400000,
74                 SV_TYPE_DFS_SERVER        = 0x00800000,
75                 SV_TYPE_ALTERNATE_XPORT   = 0x20000000,
76                 SV_TYPE_LOCAL_LIST_ONLY   = 0x40000000,
77                 SV_TYPE_DOMAIN_ENUM       = 0x80000000
78         } svcctl_ServerType;
79
80         const uint32 SV_TYPE_ALL        = 0xFFFFFFFF;
81
82         /*****************/
83         /* Function 0x00 */
84         uint32 svcctl_CloseServiceHandle(
85                                                 [in,out,ref] policy_handle *handle
86                                                 );
87
88         /*****************/
89         /* Function 0x01 */
90
91         typedef enum {
92                 FIXME=1
93         } SERVICE_CONTROL;
94         
95         WERROR svcctl_ControlService(
96                                                                  [in,ref] policy_handle *handle,
97                                                                  [in] uint32 control,
98                                                                  [out] SERVICE_STATUS status
99                                                                  );
100
101         /*****************/
102         /* Function 0x02 */
103         WERROR svcctl_DeleteService([in,ref] policy_handle *handle);
104
105         /*****************/
106         /* Function 0x03 */
107
108         WERROR svcctl_LockServiceDatabase(
109                                                          [in,ref] policy_handle *handle,
110                                                          [out] policy_handle lock
111                                                         );
112
113         /*****************/
114         /* Function 0x04 */
115         WERROR svcctl_QueryServiceObjectSecurity();
116
117         /*****************/
118         /* Function 0x05 */
119         WERROR svcctl_SetServiceObjectSecurity();
120
121         /*****************/
122         /* Function 0x06 */
123         WERROR svcctl_QueryServiceStatus(
124                                                           [in,ref] policy_handle *handle,
125                                                           [out,ref] SERVICE_STATUS *status);
126
127         /*****************/
128         /* Function 0x07 */
129         WERROR svcctl_SetServiceStatus();
130
131         /*****************/
132         /* Function 0x08 */
133         WERROR svcctl_UnlockServiceDatabase(
134                                                            [in,out,ref] policy_handle *lock
135                                                           );
136
137         /*****************/
138         /* Function 0x09 */
139         WERROR svcctl_NotifyBootConfigStatus();
140
141         /*****************/
142         /* Function 0x0a */
143         WERROR svcctl_SCSetServiceBitsW(
144                                                                    [in,ref] policy_handle *handle,
145                                                                    [in] uint32 bits,
146                                                                    [in] boolean32 bitson,
147                                                                    [in] boolean32 immediate);
148
149         /*****************/
150         /* Function 0x0b */
151         WERROR svcctl_ChangeServiceConfigW([in,ref] policy_handle *handle,
152                                                                           [in] uint32 type,
153                                                                           [in] uint32 start,
154                                                                           [in] uint32 error,
155                                                                           [in] unistr *binary_path,
156                                                                           [in] unistr *load_order_group,
157                                                                           [out] uint32 tag_id,
158                                                                           [in] unistr *dependencies,
159                                                                           [in] unistr *service_start_name,
160                                                                           [in] unistr *password,
161                                                                           [in] unistr *display_name);
162
163         /*****************/
164         /* Function 0x0c */
165         WERROR svcctl_CreateServiceW([in,ref] policy_handle *handle,
166                                                                 [in] unistr *ServiceName,
167                                                                 [in] unistr *DisplayName,
168                                                                 [in] uint32 desired_access,
169                                                                 [in] uint32 type,
170                                                                 [in] uint32 start_type,
171                                                                 [in] uint32 error_control,
172                                                                 [in] unistr *binary_path,
173                                                                 [in] unistr *LoadOrderGroupKey,
174                                                                 [out] uint32 *TagId,
175                                                                 [in] unistr *dependencies,
176                                                                 [in] unistr *service_start_name,
177                                                                 [in] unistr *password);
178
179         /*****************/
180         /* Function 0x0d */
181         WERROR svcctl_EnumDependentServicesW([in,ref] policy_handle *service,
182                                                                                 [in] uint32 state,
183                                                                                 [out] ENUM_SERVICE_STATUS *status,
184                                                                                 [in] uint32 buf_size,
185                                                                                 [out] uint32 bytes_needed,
186                                                                                 [out] uint32 services_returned);
187
188         /*****************/
189         /* Function 0x0e */
190         WERROR svcctl_EnumServicesStatusW(
191                                                         [in,ref] policy_handle *handle,
192                                                         [in] uint32 type,
193                                                         [in] uint32 state,
194                                                         [in] uint32 buf_size,
195                                                         [out,size_is(buf_size)] uint8 service[*],
196                                                         [out] uint32 bytes_needed,
197                                                         [out] uint32 services_returned,
198                                                         [in,out] uint32 *resume_handle
199                                                    );
200         /*****************/
201         /* Function 0x0f */
202         WERROR svcctl_OpenSCManagerW(
203                                            [in] unistr *MachineName,
204                                            [in] unistr *DatabaseName,
205                                            [in] uint32 access_mask,
206                                            [out,ref] policy_handle *handle);
207
208         /*****************/
209         /* Function 0x10 */
210         WERROR svcctl_OpenServiceW([in,ref] policy_handle *scmanager_handle,
211                                                           [in] unistr *ServiceName,
212                                                           [in] uint32 access_mask);
213
214         /*****************/
215         /* Function 0x11 */
216         WERROR svcctl_QueryServiceConfigW([in,ref] policy_handle *handle,
217                                                                          [out] uint8 query[buf_size], /*QUERY_SERVICE_CONFIG */
218                                                                          [in] uint32 buf_size,
219                                                                          [out] uint32 bytes_needed
220                                                                          );
221
222         /*****************/
223         /* Function 0x12 */
224         WERROR svcctl_QueryServiceLockStatusW(
225                 [in,ref] policy_handle *handle,
226                 [in] uint32 buf_size,
227                 [out,ref] SERVICE_LOCK_STATUS *status,
228                 [out,ref] uint32 *required_buf_size
229                 );
230
231         /*****************/
232         /* Function 0x13 */
233         WERROR svcctl_StartServiceW(
234                                                            [in,ref] policy_handle *handle,
235                                                            [in] uint32 NumArgs,
236                                                            [in,length_of(NumArgs)] unistr *Arguments);
237
238         /*****************/
239         /* Function 0x14 */
240         WERROR svcctl_GetServiceDisplayNameW([in,ref] policy_handle *handle,
241                                                                                 [in] unistr *service_name,
242                                                                                 [out] unistr *display_name,
243                                                                                 [in,out] uint32 *display_name_length); 
244         /*****************/
245         /* Function 0x15 */
246         WERROR svcctl_GetServiceKeyNameW([in,ref] policy_handle *handle,
247                                                                                 [in] unistr *service_name,
248                                                                                 [out] unistr *key_name,
249                                                                                 [in,out] uint32 *display_name_length);                                                                  
250         /*****************/
251         /* Function 0x16 */
252         WERROR svcctl_SCSetServiceBitsA(
253                                                                    [in,ref] policy_handle *handle,
254                                                                    [in] uint32 bits,
255                                                                    [in] boolean32 bitson,
256                                                                    [in] boolean32 immediate);
257
258         /*****************/
259         /* Function 0x17 */
260         WERROR svcctl_ChangeServiceConfigA([in,ref] policy_handle *handle,
261                                                                           [in] uint32 type,
262                                                                           [in] uint32 start,
263                                                                           [in] uint32 error,
264                                                                           [in] unistr *binary_path,
265                                                                           [in] unistr *load_order_group,
266                                                                           [out] uint32 tag_id,
267                                                                           [in] unistr *dependencies,
268                                                                           [in] unistr *service_start_name,
269                                                                           [in] unistr *password,
270                                                                           [in] unistr *display_name);
271
272         /*****************/
273         /* Function 0x18 */
274         WERROR svcctl_CreateServiceA([in,ref] policy_handle *handle,
275                                                                 [in] unistr *ServiceName,
276                                                                 [in] unistr *DisplayName,
277                                                                 [in] uint32 desired_access,
278                                                                 [in] uint32 type,
279                                                                 [in] uint32 start_type,
280                                                                 [in] uint32 error_control,
281                                                                 [in] unistr *binary_path,
282                                                                 [in] unistr *LoadOrderGroupKey,
283                                                                 [out] uint32 *TagId,
284                                                                 [in] unistr *dependencies,
285                                                                 [in] unistr *service_start_name,
286                                                                 [in] unistr *password);
287
288         /*****************/
289         /* Function 0x19 */
290         WERROR svcctl_EnumDependentServicesA([in,ref] policy_handle *service,
291                                                                                 [in] uint32 state,
292                                                                                 [out] ENUM_SERVICE_STATUS *status,
293                                                                                 [in] uint32 buf_size,
294                                                                                 [out] uint32 bytes_needed,
295                                                                                 [out] uint32 services_returned);
296
297         /*****************/
298         /* Function 0x1a */
299         WERROR svcctl_EnumServicesStatusA(
300                                                         [in,ref] policy_handle *handle,
301                                                         [in] uint32 type,
302                                                         [in] uint32 state,
303                                                         [in] uint32 buf_size,
304                                                         [out,size_is(buf_size)] uint8 service[*],
305                                                         [out] uint32 bytes_needed,
306                                                         [out] uint32 services_returned,
307                                                         [in,out] uint32 *resume_handle
308                                                    );
309         
310         /*****************/
311         /* Function 0x1b */
312         WERROR svcctl_OpenSCManagerA(
313                                            [in] unistr *MachineName,
314                                            [in] unistr *DatabaseName,
315                                            [in] uint32 access_mask,
316                                            [out,ref] policy_handle *handle);
317
318         /*****************/
319         /* Function 0x1c */
320         WERROR svcctl_OpenServiceA([in,ref] policy_handle *scmanager_handle,
321                                                           [in] unistr *ServiceName,
322                                                           [in] uint32 access_mask);
323
324         /*****************/
325         /* Function 0x1d */
326         WERROR svcctl_QueryServiceConfigA([in,ref] policy_handle *handle,
327                                                                          [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
328                                                                          [in] uint32 buf_size,
329                                                                          [out] uint32 bytes_needed
330                                                                          );
331
332         /*****************/
333         /* Function 0x1e */
334         WERROR svcctl_QueryServiceLockStatusA(
335                 [in,ref] policy_handle *handle,
336                 [in] uint32 buf_size,
337                 [out,ref] SERVICE_LOCK_STATUS *status,
338                 [out,ref] uint32 *required_buf_size
339                 );
340
341         /*****************/
342         /* Function 0x1f */
343         WERROR svcctl_StartServiceA(
344                                                            [in,ref] policy_handle *handle,
345                                                            [in] uint32 NumArgs,
346                                                            [in,length_of(NumArgs)] unistr *Arguments);
347
348         /*****************/
349         /* Function 0x20 */
350         WERROR svcctl_GetServiceDisplayNameA([in,ref] policy_handle *handle,
351                                                                                 [in] unistr *service_name,
352                                                                                 [out] unistr *display_name,
353                                                                                 [in,out] uint32 *display_name_length); 
354         /*****************/
355         /* Function 0x21 */
356         WERROR svcctl_GetServiceKeyNameA([in,ref] policy_handle *handle,
357                                                                                 [in] unistr *service_name,
358                                                                                 [out] unistr *key_name,
359                                                                                 [in,out] uint32 *display_name_length);                                                                  
360
361         /*****************/
362         /* Function 0x22 */
363         WERROR svcctl_GetCurrentGroupeStateW();
364
365         /*****************/
366         /* Function 0x23 */
367         WERROR svcctl_EnumServiceGroupW();
368
369         /*****************/
370         /* Function 0x24 */
371         WERROR svcctl_ChangeServiceConfig2A([in,ref] policy_handle *handle,
372                                                                                 [in] uint32 info_level,
373                                                                                 [in] uint8 *info
374                                                                                 );
375
376         /*****************/
377         /* Function 0x25 */
378         WERROR svcctl_ChangeServiceConfig2W([in,ref] policy_handle *handle,
379                                                                                 [in] uint32 info_level,
380                                                                                 [in] uint8 *info);
381
382         /*****************/
383         /* Function 0x26 */
384         WERROR svcctl_QueryServiceConfig2A(
385                                                                           [in,ref] policy_handle *handle,
386                                                                           [in] uint32 info_level,
387                                                                           [out] uint8 buffer[buf_size],
388                                                                           [in] uint32 buf_size,
389                                                                           [out] uint32 bytes_needed);
390
391         /*****************/
392         /* Function 0x27 */
393         WERROR svcctl_QueryServiceConfig2W(
394                                                                           [in,ref] policy_handle *handle,
395                                                                           [in] uint32 info_level,
396                                                                           [out] uint8 buffer[buf_size],
397                                                                           [in] uint32 buf_size,
398                                                                           [out] uint32 bytes_needed);
399
400         /*****************/
401         /* Function 0x28 */
402         WERROR svcctl_QueryServiceStatusEx(
403                                                                            [in,ref] policy_handle *handle,
404                                                                            [in] uint32 info_level,
405                                                                            [out] uint8 buffer[buf_size],
406                                                                            [in] uint32 buf_size,
407                                                                            [out] uint32 bytes_needed);
408
409         /*****************/
410         /* Function 0x29 */
411         WERROR EnumServicesStatusExA(
412                                                                  [in,ref] policy_handle *scmanager,
413                                                                  [in] uint32 info_level,
414                                                                  [in] uint32 type,
415                                                                  [in] uint32 state,
416                                                                  [out] uint8 services[buf_size],
417                                                                  [in] uint32 buf_size,
418                                                                  [out] uint32 bytes_needed,
419                                                                  [out] uint32 service_returned,
420                                                                  [in,out] uint32 *resume_handle, 
421                                                                  [out] unistr *group_name);
422
423         /*****************/
424         /* Function 0x2a */
425         WERROR EnumServicesStatusExW(
426                                                                  [in,ref] policy_handle *scmanager,
427                                                                  [in] uint32 info_level,
428                                                                  [in] uint32 type,
429                                                                  [in] uint32 state,
430                                                                  [out] uint8 services[buf_size],
431                                                                  [in] uint32 buf_size,
432                                                                  [out] uint32 bytes_needed,
433                                                                  [out] uint32 service_returned,
434                                                                  [in,out] uint32 *resume_handle, 
435                                                                  [out] unistr *group_name);
436
437         /*****************/
438         /* Function 0x2b */
439         WERROR svcctl_SCSendTSMessage();
440 }