Merge branch 'selftest' of git://git.samba.org/jelmer/samba
[bbaumbach/samba-autobuild/.git] / 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
270         typedef [public,gensize] struct {
271                 uint32 service_type;
272                 uint32 start_type;
273                 uint32 error_control;
274                 [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
275                 [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
276                 uint32 tag_id;
277                 [string,charset(UTF16)] [range(0,8192)] uint16 *dependencies;
278                 [string,charset(UTF16)] [range(0,8192)] uint16 *startname;
279                 [string,charset(UTF16)] [range(0,8192)] uint16 *displayname;
280         } QUERY_SERVICE_CONFIG;
281
282         WERROR svcctl_QueryServiceConfigW(
283                 [in,ref] policy_handle *handle,
284                 [out] QUERY_SERVICE_CONFIG *query,
285                 [in] [range(0,8192)] uint32 buf_size,
286                 [out,ref] [range(0,8192)] uint32 *bytes_needed
287         );
288
289         /*****************/
290         /* Function 0x12 */
291         WERROR svcctl_QueryServiceLockStatusW(
292                 [in,ref] policy_handle *handle,
293                 [in] uint32 buf_size,
294                 [out,ref] SERVICE_LOCK_STATUS *lock_status,
295                 [out,ref] uint32 *required_buf_size
296         );
297
298         /*****************/
299         /* Function 0x13 */
300         WERROR svcctl_StartServiceW(
301                 [in,ref] policy_handle *handle,
302                 [in] uint32 NumArgs,
303                 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
304         );
305
306         /*****************/
307         /* Function 0x14 */
308         WERROR svcctl_GetServiceDisplayNameW(
309                 [in,ref] policy_handle *handle,
310                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
311                 [out,ref] [string,charset(UTF16)] uint16 **display_name,
312                 [in,out,unique] uint32 *display_name_length
313         );
314
315         /*****************/
316         /* Function 0x15 */
317         WERROR svcctl_GetServiceKeyNameW(
318                 [in,ref] policy_handle *handle,
319                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
320                 [out,ref] [string,charset(UTF16)] uint16 **key_name,
321                 [in,out,unique] uint32 *display_name_length
322         );
323
324         /*****************/
325         /* Function 0x16 */
326         WERROR svcctl_SCSetServiceBitsA(
327                 [in,ref] policy_handle *handle,
328                 [in] uint32 bits,
329                 [in] boolean32 bitson,
330                 [in] boolean32 immediate
331         );
332
333         /*****************/
334         /* Function 0x17 */
335         WERROR svcctl_ChangeServiceConfigA(
336                 [in,ref] policy_handle *handle,
337                 [in] uint32 type,
338                 [in] uint32 start,
339                 [in] uint32 error,
340                 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
341                 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
342                 [out,ref] uint32 *tag_id,
343                 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
344                 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
345                 [in,unique] [string,charset(UTF16)] uint16 *password,
346                 [in,unique] [string,charset(UTF16)] uint16 *display_name
347         );
348
349         /*****************/
350         /* Function 0x18 */
351         WERROR svcctl_CreateServiceA(
352                 [in,ref] policy_handle *handle,
353                 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
354                 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
355                 [in] uint32 desired_access,
356                 [in] uint32 type,
357                 [in] uint32 start_type,
358                 [in] uint32 error_control,
359                 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
360                 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
361                 [out,unique] uint32 *TagId,
362                 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
363                 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
364                 [in,unique] [string,charset(UTF16)] uint16 *password
365         );
366
367         /*****************/
368         /* Function 0x19 */
369         WERROR svcctl_EnumDependentServicesA(
370                 [in,ref] policy_handle *service,
371                 [in] uint32 state,
372                 [out,unique] ENUM_SERVICE_STATUS *service_status,
373                 [in] uint32 buf_size,
374                 [out,ref] uint32 *bytes_needed,
375                 [out,ref] uint32 *services_returned
376         );
377
378         /*****************/
379         /* Function 0x1a */
380         WERROR svcctl_EnumServicesStatusA(
381                 [in,ref] policy_handle *handle,
382                 [in] uint32 type,
383                 [in] uint32 state,
384                 [in] uint32 buf_size,
385                 [out,size_is(buf_size)] uint8 service[*],
386                 [out,ref] uint32 *bytes_needed,
387                 [out,ref] uint32 *services_returned,
388                 [in,out,unique] uint32 *resume_handle
389         );
390
391         /*****************/
392         /* Function 0x1b */
393         WERROR svcctl_OpenSCManagerA(
394                 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
395                 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
396                 [in] uint32 access_mask,
397                 [out,ref] policy_handle *handle
398         );
399
400         /*****************/
401         /* Function 0x1c */
402         WERROR svcctl_OpenServiceA(
403                 [in,ref] policy_handle *scmanager_handle,
404                 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
405                 [in] uint32 access_mask
406         );
407
408         /*****************/
409         /* Function 0x1d */
410         WERROR svcctl_QueryServiceConfigA(
411                 [in,ref] policy_handle *handle,
412                 [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
413                 [in] uint32 buf_size,
414                 [out,ref] uint32 *bytes_needed
415         );
416
417         /*****************/
418         /* Function 0x1e */
419         WERROR svcctl_QueryServiceLockStatusA(
420                 [in,ref] policy_handle *handle,
421                 [in] uint32 buf_size,
422                 [out,ref] SERVICE_LOCK_STATUS *lock_status,
423                 [out,ref] uint32 *required_buf_size
424         );
425
426         /*****************/
427         /* Function 0x1f */
428         WERROR svcctl_StartServiceA(
429                 [in,ref] policy_handle *handle,
430                 [in] uint32 NumArgs,
431                 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
432         );
433
434         /*****************/
435         /* Function 0x20 */
436         WERROR svcctl_GetServiceDisplayNameA(
437                 [in,ref] policy_handle *handle,
438                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
439                 [out,ref] [string,charset(UTF16)] uint16 **display_name,
440                 [in,out,unique] uint32 *display_name_length
441         );
442
443         /*****************/
444         /* Function 0x21 */
445         WERROR svcctl_GetServiceKeyNameA(
446                 [in,ref] policy_handle *handle,
447                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
448                 [out,ref] [string,charset(UTF16)] uint16 **key_name,
449                 [in,out,unique] uint32 *display_name_length
450         );
451
452         /*****************/
453         /* Function 0x22 */
454         [todo] WERROR svcctl_GetCurrentGroupeStateW(
455         );
456
457         /*****************/
458         /* Function 0x23 */
459         [todo] WERROR svcctl_EnumServiceGroupW(
460         );
461
462         /*****************/
463         /* Function 0x24 */
464         WERROR svcctl_ChangeServiceConfig2A(
465                 [in,ref] policy_handle *handle,
466                 [in] uint32 info_level,
467                 [in,unique] uint8 *info
468         );
469
470         /*****************/
471         /* Function 0x25 */
472         WERROR svcctl_ChangeServiceConfig2W(
473                 [in,ref] policy_handle *handle,
474                 [in] uint32 info_level,
475                 [in,unique] uint8 *info
476         );
477
478         /*****************/
479         /* Function 0x26 */
480         WERROR svcctl_QueryServiceConfig2A(
481                 [in,ref] policy_handle *handle,
482                 [in] uint32 info_level,
483                 [out] uint8 buffer[buf_size],
484                 [in] uint32 buf_size,
485                 [out,ref] uint32 *bytes_needed
486         );
487
488         /*****************/
489         /* Function 0x27 */
490         WERROR svcctl_QueryServiceConfig2W(
491                 [in,ref] policy_handle *handle,
492                 [in] uint32 info_level,
493                 [out] uint8 buffer[buf_size],
494                 [in] uint32 buf_size,
495                 [out,ref] uint32 *bytes_needed
496         );
497
498         /*****************/
499         /* Function 0x28 */
500         WERROR svcctl_QueryServiceStatusEx(
501                 [in,ref] policy_handle *handle,
502                 [in] uint32 info_level,
503                 [out] uint8 buffer[buf_size],
504                 [in] uint32 buf_size,
505                 [out,ref] uint32 *bytes_needed
506         );
507
508         /*****************/
509         /* Function 0x29 */
510         WERROR EnumServicesStatusExA(
511                 [in,ref] policy_handle *scmanager,
512                 [in] uint32 info_level,
513                 [in] uint32 type,
514                 [in] uint32 state,
515                 [out] uint8 services[buf_size],
516                 [in] uint32 buf_size,
517                 [out,ref] uint32 *bytes_needed,
518                 [out,ref] uint32 *service_returned,
519                 [in,out,unique] uint32 *resume_handle,
520                 [out,ref] [string,charset(UTF16)] uint16 **group_name
521         );
522
523         /*****************/
524         /* Function 0x2a */
525         WERROR EnumServicesStatusExW(
526                 [in,ref] policy_handle *scmanager,
527                 [in] uint32 info_level,
528                 [in] uint32 type,
529                 [in] uint32 state,
530                 [out] uint8 services[buf_size],
531                 [in] uint32 buf_size,
532                 [out,ref] uint32 *bytes_needed,
533                 [out,ref] uint32 *service_returned,
534                 [in,out,unique] uint32 *resume_handle,
535                 [out,ref] [string,charset(UTF16)] uint16 **group_name
536         );
537
538         /*****************/
539         /* Function 0x2b */
540         [todo] WERROR svcctl_SCSendTSMessage(
541         );
542 }