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