svcctl: add SERVICE_TYPE_INTERACTIVE_PROCESS define.
[metze/samba/wip.git] / librpc / idl / svcctl.idl
1 #include "idl_types.h"
2
3 /*
4   svcctl interface definitions
5 */
6
7 import "misc.idl", "security.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 [v1_enum] enum {
22                 SVCCTL_STATE_UNKNOWN            = 0x00000000,   /* only used internally to smbd */
23                 SVCCTL_STOPPED                  = 0x00000001,
24                 SVCCTL_START_PENDING            = 0x00000002,
25                 SVCCTL_STOP_PENDING             = 0x00000003,
26                 SVCCTL_RUNNING                  = 0x00000004,
27                 SVCCTL_CONTINUE_PENDING         = 0x00000005,
28                 SVCCTL_PAUSE_PENDING            = 0x00000006,
29                 SVCCTL_PAUSED                   = 0x00000007
30         } svcctl_ServiceStatus;
31
32         typedef [bitmap32bit] bitmap {
33                 SVCCTL_ACCEPT_NONE                      = 0x00000000,
34                 SVCCTL_ACCEPT_STOP                      = 0x00000001,
35                 SVCCTL_ACCEPT_PAUSE_CONTINUE            = 0x00000002,
36                 SVCCTL_ACCEPT_SHUTDOWN                  = 0x00000004,
37                 SVCCTL_ACCEPT_PARAMCHANGE               = 0x00000008,
38                 SVCCTL_ACCEPT_NETBINDCHANGE             = 0x00000010,
39                 SVCCTL_ACCEPT_HARDWAREPROFILECHANGE     = 0x00000020,
40                 SVCCTL_ACCEPT_POWEREVENT                = 0x00000040
41         } svcctl_ControlsAccepted;
42
43         typedef struct {
44                 uint32 type;
45                 svcctl_ServiceStatus state;
46                 svcctl_ControlsAccepted controls_accepted;
47                 WERROR win32_exit_code;
48                 uint32 service_exit_code;
49                 uint32 check_point;
50                 uint32 wait_hint;
51         } SERVICE_STATUS;
52
53         typedef [public] struct {
54                 SERVICE_STATUS status;
55                 uint32 process_id;
56                 uint32 service_flags;
57         } SERVICE_STATUS_PROCESS;
58
59         typedef [public,gensize] struct {
60                 [relative] nstring *service_name;
61                 [relative] nstring *display_name;
62                 SERVICE_STATUS status;
63         } ENUM_SERVICE_STATUSW;
64
65         typedef [public,gensize] struct {
66                 [relative] astring *service_name;
67                 [relative] astring *display_name;
68                 SERVICE_STATUS status;
69         } ENUM_SERVICE_STATUSA;
70
71         const int SERVICE_TYPE_KERNEL_DRIVER       = 0x01;
72         const int SERVICE_TYPE_FS_DRIVER           = 0x02;
73         const int SERVICE_TYPE_ADAPTER             = 0x04;
74         const int SERVICE_TYPE_RECOGNIZER_DRIVER   = 0x08;
75         const int SERVICE_TYPE_DRIVER=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER;
76         const int SERVICE_TYPE_WIN32_OWN_PROCESS   = 0x10;
77         const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
78         const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
79         const int SERVICE_TYPE_INTERACTIVE_PROCESS = 0x100;
80
81         typedef [public,bitmap32bit] bitmap {
82                 SV_TYPE_WORKSTATION       = 0x00000001,
83                 SV_TYPE_SERVER            = 0x00000002,
84                 SV_TYPE_SQLSERVER         = 0x00000004,
85                 SV_TYPE_DOMAIN_CTRL       = 0x00000008,
86                 SV_TYPE_DOMAIN_BAKCTRL    = 0x00000010,
87                 SV_TYPE_TIME_SOURCE       = 0x00000020,
88                 SV_TYPE_AFP               = 0x00000040,
89                 SV_TYPE_NOVELL            = 0x00000080,
90
91                 SV_TYPE_DOMAIN_MEMBER     = 0x00000100,
92                 SV_TYPE_PRINTQ_SERVER     = 0x00000200,
93                 SV_TYPE_DIALIN_SERVER     = 0x00000400,
94                 SV_TYPE_SERVER_UNIX       = 0x00000800,
95                 SV_TYPE_NT                = 0x00001000,
96                 SV_TYPE_WFW               = 0x00002000,
97                 SV_TYPE_SERVER_MFPN       = 0x00004000,
98                 SV_TYPE_SERVER_NT         = 0x00008000,
99                 SV_TYPE_POTENTIAL_BROWSER = 0x00010000,
100                 SV_TYPE_BACKUP_BROWSER    = 0x00020000,
101                 SV_TYPE_MASTER_BROWSER    = 0x00040000,
102                 SV_TYPE_DOMAIN_MASTER     = 0x00080000,
103                 SV_TYPE_SERVER_OSF        = 0x00100000,
104                 SV_TYPE_SERVER_VMS        = 0x00200000,
105                 SV_TYPE_WIN95_PLUS        = 0x00400000,
106                 SV_TYPE_DFS_SERVER        = 0x00800000,
107                 SV_TYPE_ALTERNATE_XPORT   = 0x20000000,
108                 SV_TYPE_LOCAL_LIST_ONLY   = 0x40000000,
109                 SV_TYPE_DOMAIN_ENUM       = 0x80000000
110         } svcctl_ServerType;
111
112         const uint32 SV_TYPE_ALL        = 0xFFFFFFFF;
113
114         /*****************/
115         /* Function 0x00 */
116         WERROR svcctl_CloseServiceHandle(
117                 [in,out,ref] policy_handle *handle
118         );
119
120         /*****************/
121         /* Function 0x01 */
122
123         /* Service Controls */
124
125         typedef [v1_enum] enum {
126                 SVCCTL_CONTROL_STOP             = 0x00000001,
127                 SVCCTL_CONTROL_PAUSE            = 0x00000002,
128                 SVCCTL_CONTROL_CONTINUE         = 0x00000003,
129                 SVCCTL_CONTROL_INTERROGATE      = 0x00000004,
130                 SVCCTL_CONTROL_SHUTDOWN         = 0x00000005
131         } SERVICE_CONTROL;
132
133         WERROR svcctl_ControlService(
134                 [in,ref] policy_handle *handle,
135                 [in] SERVICE_CONTROL control,
136                 [out,ref] SERVICE_STATUS *service_status
137         );
138
139         /*****************/
140         /* Function 0x02 */
141         WERROR svcctl_DeleteService(
142                 [in,ref] policy_handle *handle
143         );
144
145         /*****************/
146         /* Function 0x03 */
147
148         WERROR svcctl_LockServiceDatabase(
149                 [in,ref] policy_handle *handle,
150                 [out,ref] policy_handle *lock
151         );
152
153         /*****************/
154         /* Function 0x04 */
155         WERROR svcctl_QueryServiceObjectSecurity(
156                 [in] policy_handle *handle,
157                 [in] uint32 security_flags,
158                 [out,ref,size_is(buffer_size)] uint8 *buffer,
159                 [in,range(0,0x40000)] uint32 buffer_size,
160                 [out,ref,range(0,0x40000)] uint32 *needed
161         );
162
163         /*****************/
164         /* Function 0x05 */
165         WERROR svcctl_SetServiceObjectSecurity(
166                 [in] policy_handle *handle,
167                 [in] uint32 security_flags,
168                 [in,ref,size_is(buffer_size)] uint8 *buffer,
169                 [in] uint32 buffer_size
170         );
171
172         /*****************/
173         /* Function 0x06 */
174         WERROR svcctl_QueryServiceStatus(
175                 [in,ref] policy_handle *handle,
176                 [out,ref] SERVICE_STATUS *service_status
177         );
178
179         /*****************/
180         /* Function 0x07 */
181         [todo] WERROR svcctl_SetServiceStatus(
182         );
183
184         /*****************/
185         /* Function 0x08 */
186         WERROR svcctl_UnlockServiceDatabase(
187                 [in,out,ref] policy_handle *lock
188         );
189
190         /*****************/
191         /* Function 0x09 */
192         [todo] WERROR svcctl_NotifyBootConfigStatus(
193         );
194
195         /*****************/
196         /* Function 0x0a */
197         WERROR svcctl_SCSetServiceBitsW(
198                 [in,ref] policy_handle *handle,
199                 [in] uint32 bits,
200                 [in] boolean32 bitson,
201                 [in] boolean32 immediate
202         );
203
204         /*****************/
205         /* Function 0x0b */
206
207         typedef [v1_enum] enum {
208                 SVCCTL_SVC_ERROR_IGNORE         = 0x00000000,
209                 SVCCTL_SVC_ERROR_NORMAL         = 0x00000001,
210                 SVCCTL_SVC_ERROR_CRITICAL       = 0x00000002,
211                 SVCCTL_SVC_ERROR_SEVERE         = 0x00000003
212         } svcctl_ErrorControl;
213
214         typedef [v1_enum] enum {
215                 SVCCTL_BOOT_START               = 0x00000000,
216                 SVCCTL_SYSTEM_START             = 0x00000001,
217                 SVCCTL_AUTO_START               = 0x00000002,
218                 SVCCTL_DEMAND_START             = 0x00000003,
219                 SVCCTL_DISABLED                 = 0x00000004
220         } svcctl_StartType;
221
222         WERROR svcctl_ChangeServiceConfigW(
223                 [in,ref] policy_handle *handle,
224                 [in] uint32 type,
225                 [in] svcctl_StartType start_type,
226                 [in] svcctl_ErrorControl error_control,
227                 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
228                 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
229                 [out,ref] uint32 *tag_id,
230                 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
231                 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
232                 [in,unique] [string,charset(UTF16)] uint16 *password,
233                 [in,unique] [string,charset(UTF16)] uint16 *display_name
234         );
235
236         /*****************/
237         /* Function 0x0c */
238         WERROR svcctl_CreateServiceW(
239                 [in,ref] policy_handle *scmanager_handle,
240                 [in] [string,charset(UTF16)] uint16 ServiceName[],
241                 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
242                 [in] uint32 desired_access,
243                 [in] uint32 type,
244                 [in] svcctl_StartType start_type,
245                 [in] svcctl_ErrorControl error_control,
246                 [in] [string,charset(UTF16)] uint16 binary_path[],
247                 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
248                 [in,out,unique] uint32 *TagId,
249                 [in,unique,size_is(dependencies_size)] uint8 *dependencies,
250                 [in] uint32 dependencies_size,
251                 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
252                 [in,unique,size_is(password_size)] uint8 *password,
253                 [in] uint32 password_size,
254                 [out,ref] policy_handle *handle
255         );
256
257         /*****************/
258         /* Function 0x0d */
259         WERROR svcctl_EnumDependentServicesW(
260                 [in,ref] policy_handle *service,
261                 [in] uint32 state,
262                 [out,ref,size_is(buf_size)] uint8 *service_status,
263                 [in,range(0,0x40000)] uint32 buf_size,
264                 [out,ref,range(0,0x40000)] uint32 *bytes_needed,
265                 [out,ref,range(0,0x40000)] uint32 *services_returned
266         );
267
268         /*****************/
269         /* Function 0x0e */
270
271         typedef [v1_enum] enum {
272                 SERVICE_STATE_ACTIVE    = 0x00000001,
273                 SERVICE_STATE_INACTIVE  = 0x00000002,
274                 SERVICE_STATE_ALL       = ( SERVICE_STATE_ACTIVE | SERVICE_STATE_INACTIVE )
275         } svcctl_ServiceState;
276
277         WERROR svcctl_EnumServicesStatusW(
278                 [in,ref] policy_handle *handle,
279                 [in] uint32 type,
280                 [in] svcctl_ServiceState state,
281                 [out,ref,size_is(buf_size)] uint8 *service,
282                 [in] [range(0,0x40000)] uint32 buf_size,
283                 [out,ref] [range(0,0x40000)] uint32 *bytes_needed,
284                 [out,ref] [range(0,0x40000)] uint32 *services_returned,
285                 [in,out,unique] uint32 *resume_handle
286         );
287
288         /*****************/
289         /* Function 0x0f */
290
291         /* Service Control Manager Bits */
292
293         typedef [bitmap32bit] bitmap {
294                 SC_RIGHT_MGR_CONNECT            = 0x0001,
295                 SC_RIGHT_MGR_CREATE_SERVICE     = 0x0002,
296                 SC_RIGHT_MGR_ENUMERATE_SERVICE  = 0x0004,
297                 SC_RIGHT_MGR_LOCK               = 0x0008,
298                 SC_RIGHT_MGR_QUERY_LOCK_STATUS  = 0x0010,
299                 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG = 0x0020
300         } svcctl_MgrAccessMask;
301
302         const int SC_MANAGER_READ_ACCESS =
303                 (SEC_STD_READ_CONTROL                   |
304                  SC_RIGHT_MGR_CONNECT                   |
305                  SC_RIGHT_MGR_ENUMERATE_SERVICE         |
306                  SC_RIGHT_MGR_QUERY_LOCK_STATUS);
307
308         const int SC_MANAGER_EXECUTE_ACCESS = SC_MANAGER_READ_ACCESS;
309
310         const int SC_MANAGER_WRITE_ACCESS =
311                 (SEC_STD_REQUIRED                       |
312                  SC_MANAGER_READ_ACCESS                 |
313                  SC_RIGHT_MGR_CREATE_SERVICE            |
314                  SC_RIGHT_MGR_LOCK                      |
315                  SC_RIGHT_MGR_MODIFY_BOOT_CONFIG);
316
317         const int SC_MANAGER_ALL_ACCESS = SC_MANAGER_WRITE_ACCESS;
318
319         WERROR svcctl_OpenSCManagerW(
320                 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
321                 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
322                 [in] svcctl_MgrAccessMask access_mask,
323                 [out,ref] policy_handle *handle
324         );
325
326         /*****************/
327         /* Function 0x10 */
328
329         /* Service Object Bits */
330
331         typedef [bitmap32bit] bitmap {
332                 SC_RIGHT_SVC_QUERY_CONFIG               = 0x0001,
333                 SC_RIGHT_SVC_CHANGE_CONFIG              = 0x0002,
334                 SC_RIGHT_SVC_QUERY_STATUS               = 0x0004,
335                 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS       = 0x0008,
336                 SC_RIGHT_SVC_START                      = 0x0010,
337                 SC_RIGHT_SVC_STOP                       = 0x0020,
338                 SC_RIGHT_SVC_PAUSE_CONTINUE             = 0x0040,
339                 SC_RIGHT_SVC_INTERROGATE                = 0x0080,
340                 SC_RIGHT_SVC_USER_DEFINED_CONTROL       = 0x0100
341         } svcctl_ServiceAccessMask;
342
343         const int SERVICE_READ_ACCESS =
344                 (SEC_STD_READ_CONTROL                   |
345                  SC_RIGHT_SVC_ENUMERATE_DEPENDENTS      |
346                  SC_RIGHT_SVC_INTERROGATE               |
347                  SC_RIGHT_SVC_QUERY_CONFIG              |
348                  SC_RIGHT_SVC_QUERY_STATUS              |
349                  SC_RIGHT_SVC_USER_DEFINED_CONTROL);
350
351         const int SERVICE_EXECUTE_ACCESS =
352                 (SERVICE_READ_ACCESS                    |
353                  SC_RIGHT_SVC_START                     |
354                  SC_RIGHT_SVC_STOP                      |
355                  SC_RIGHT_SVC_PAUSE_CONTINUE);
356
357         const int SERVICE_WRITE_ACCESS =
358                 (SEC_STD_REQUIRED                       |
359                  SERVICE_READ_ACCESS                    |
360                  SERVICE_EXECUTE_ACCESS                 |
361                  SC_RIGHT_SVC_CHANGE_CONFIG);
362
363         const int SERVICE_ALL_ACCESS = SERVICE_WRITE_ACCESS;
364
365         WERROR svcctl_OpenServiceW(
366                 [in,ref] policy_handle *scmanager_handle,
367                 [in] [string,charset(UTF16)] uint16 ServiceName[],
368                 [in] svcctl_ServiceAccessMask access_mask,
369                 [out,ref] policy_handle *handle
370         );
371
372         /*****************/
373         /* Function 0x11 */
374
375         typedef [public,gensize] struct {
376                 uint32 service_type;
377                 svcctl_StartType start_type;
378                 svcctl_ErrorControl error_control;
379                 [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
380                 [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
381                 uint32 tag_id;
382                 [string,charset(UTF16)] [range(0,8192)] uint16 *dependencies;
383                 [string,charset(UTF16)] [range(0,8192)] uint16 *startname;
384                 [string,charset(UTF16)] [range(0,8192)] uint16 *displayname;
385         } QUERY_SERVICE_CONFIG;
386
387         WERROR svcctl_QueryServiceConfigW(
388                 [in,ref] policy_handle *handle,
389                 [out] QUERY_SERVICE_CONFIG *query,
390                 [in] [range(0,8192)] uint32 buf_size,
391                 [out,ref] [range(0,8192)] uint32 *bytes_needed
392         );
393
394         /*****************/
395         /* Function 0x12 */
396         WERROR svcctl_QueryServiceLockStatusW(
397                 [in,ref] policy_handle *handle,
398                 [in] uint32 buf_size,
399                 [out,ref] SERVICE_LOCK_STATUS *lock_status,
400                 [out,ref] uint32 *required_buf_size
401         );
402
403         /*****************/
404         /* Function 0x13 */
405         WERROR svcctl_StartServiceW(
406                 [in,ref] policy_handle *handle,
407                 [in] uint32 NumArgs,
408                 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
409         );
410
411         /*****************/
412         /* Function 0x14 */
413         WERROR svcctl_GetServiceDisplayNameW(
414                 [in,ref] policy_handle *handle,
415                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
416                 [out,ref] [string,charset(UTF16)] uint16 **display_name,
417                 [in,out,unique] uint32 *display_name_length
418         );
419
420         /*****************/
421         /* Function 0x15 */
422         WERROR svcctl_GetServiceKeyNameW(
423                 [in,ref] policy_handle *handle,
424                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
425                 [out,ref] [string,charset(UTF16)] uint16 **key_name,
426                 [in,out,unique] uint32 *display_name_length
427         );
428
429         /*****************/
430         /* Function 0x16 */
431         WERROR svcctl_SCSetServiceBitsA(
432                 [in,ref] policy_handle *handle,
433                 [in] uint32 bits,
434                 [in] boolean32 bitson,
435                 [in] boolean32 immediate
436         );
437
438         /*****************/
439         /* Function 0x17 */
440         WERROR svcctl_ChangeServiceConfigA(
441                 [in,ref] policy_handle *handle,
442                 [in] uint32 type,
443                 [in] svcctl_StartType start_type,
444                 [in] svcctl_ErrorControl error_control,
445                 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
446                 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
447                 [out,ref] uint32 *tag_id,
448                 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
449                 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
450                 [in,unique] [string,charset(UTF16)] uint16 *password,
451                 [in,unique] [string,charset(UTF16)] uint16 *display_name
452         );
453
454         /*****************/
455         /* Function 0x18 */
456         WERROR svcctl_CreateServiceA(
457                 [in,ref] policy_handle *handle,
458                 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
459                 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
460                 [in] uint32 desired_access,
461                 [in] uint32 type,
462                 [in] svcctl_StartType start_type,
463                 [in] svcctl_ErrorControl error_control,
464                 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
465                 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
466                 [out,unique] uint32 *TagId,
467                 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
468                 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
469                 [in,unique] [string,charset(UTF16)] uint16 *password
470         );
471
472         /*****************/
473         /* Function 0x19 */
474         WERROR svcctl_EnumDependentServicesA(
475                 [in,ref] policy_handle *service,
476                 [in] uint32 state,
477                 [out,unique] ENUM_SERVICE_STATUSA *service_status,
478                 [in] uint32 buf_size,
479                 [out,ref] uint32 *bytes_needed,
480                 [out,ref] uint32 *services_returned
481         );
482
483         /*****************/
484         /* Function 0x1a */
485         WERROR svcctl_EnumServicesStatusA(
486                 [in,ref] policy_handle *handle,
487                 [in] uint32 type,
488                 [in] svcctl_ServiceState state,
489                 [in] uint32 buf_size,
490                 [out,size_is(buf_size)] uint8 service[*],
491                 [out,ref] uint32 *bytes_needed,
492                 [out,ref] uint32 *services_returned,
493                 [in,out,unique] uint32 *resume_handle
494         );
495
496         /*****************/
497         /* Function 0x1b */
498         WERROR svcctl_OpenSCManagerA(
499                 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
500                 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
501                 [in] uint32 access_mask,
502                 [out,ref] policy_handle *handle
503         );
504
505         /*****************/
506         /* Function 0x1c */
507         WERROR svcctl_OpenServiceA(
508                 [in,ref] policy_handle *scmanager_handle,
509                 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
510                 [in] uint32 access_mask
511         );
512
513         /*****************/
514         /* Function 0x1d */
515         WERROR svcctl_QueryServiceConfigA(
516                 [in,ref] policy_handle *handle,
517                 [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
518                 [in] uint32 buf_size,
519                 [out,ref] uint32 *bytes_needed
520         );
521
522         /*****************/
523         /* Function 0x1e */
524         WERROR svcctl_QueryServiceLockStatusA(
525                 [in,ref] policy_handle *handle,
526                 [in] uint32 buf_size,
527                 [out,ref] SERVICE_LOCK_STATUS *lock_status,
528                 [out,ref] uint32 *required_buf_size
529         );
530
531         /*****************/
532         /* Function 0x1f */
533         WERROR svcctl_StartServiceA(
534                 [in,ref] policy_handle *handle,
535                 [in] uint32 NumArgs,
536                 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
537         );
538
539         /*****************/
540         /* Function 0x20 */
541         WERROR svcctl_GetServiceDisplayNameA(
542                 [in,ref] policy_handle *handle,
543                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
544                 [out,ref] [string,charset(UTF16)] uint16 **display_name,
545                 [in,out,unique] uint32 *display_name_length
546         );
547
548         /*****************/
549         /* Function 0x21 */
550         WERROR svcctl_GetServiceKeyNameA(
551                 [in,ref] policy_handle *handle,
552                 [in,unique] [string,charset(UTF16)] uint16 *service_name,
553                 [out,ref] [string,charset(UTF16)] uint16 **key_name,
554                 [in,out,unique] uint32 *display_name_length
555         );
556
557         /*****************/
558         /* Function 0x22 */
559         [todo] WERROR svcctl_GetCurrentGroupeStateW(
560         );
561
562         /*****************/
563         /* Function 0x23 */
564         [todo] WERROR svcctl_EnumServiceGroupW(
565         );
566
567         /*****************/
568         /* Function 0x24 */
569         WERROR svcctl_ChangeServiceConfig2A(
570                 [in,ref] policy_handle *handle,
571                 [in] uint32 info_level,
572                 [in,unique] uint8 *info
573         );
574
575         /*****************/
576         /* Function 0x25 */
577         WERROR svcctl_ChangeServiceConfig2W(
578                 [in,ref] policy_handle *handle,
579                 [in] uint32 info_level,
580                 [in,unique] uint8 *info
581         );
582
583         /*****************/
584         /* Function 0x26 */
585
586         typedef [v1_enum] enum {
587                 SERVICE_CONFIG_DESCRIPTION      = 0x00000001,
588                 SERVICE_CONFIG_FAILURE_ACTIONS  = 0x00000002
589         } svcctl_ConfigLevel;
590
591         typedef [gensize,public] struct {
592                 [relative] nstring *description;
593         } SERVICE_DESCRIPTION;
594
595         typedef [v1_enum] enum {
596                 SC_ACTION_NONE          = 0,
597                 SC_ACTION_RESTART       = 1,
598                 SC_ACTION_REBOOT        = 2,
599                 SC_ACTION_RUN_COMMAND   = 3
600         } SC_ACTION_TYPE;
601
602         typedef struct {
603                 SC_ACTION_TYPE type;
604                 uint32 delay;
605         } SC_ACTION;
606
607         typedef [public,gensize] struct {
608                 uint32 reset_period;
609                 [relative] nstring *rebootmsg;
610                 [relative] nstring *command;
611                 [range(0,1024)] uint32 num_actions;
612                 [relative] [size_is(num_actions)] SC_ACTION *actions;
613         } SERVICE_FAILURE_ACTIONS;
614
615         WERROR svcctl_QueryServiceConfig2A(
616                 [in,ref] policy_handle *handle,
617                 [in] svcctl_ConfigLevel info_level,
618                 [out] uint8 buffer[buf_size],
619                 [in] uint32 buf_size,
620                 [out,ref] uint32 *bytes_needed
621         );
622
623         /*****************/
624         /* Function 0x27 */
625         WERROR svcctl_QueryServiceConfig2W(
626                 [in,ref] policy_handle *handle,
627                 [in] svcctl_ConfigLevel info_level,
628                 [out,ref,size_is(buf_size)] uint8 *buffer,
629                 [in] [range(0,8192)] uint32 buf_size,
630                 [out,ref] [range(0,8192)] uint32 *bytes_needed
631         );
632
633         /*****************/
634         /* Function 0x28 */
635
636         typedef [v1_enum] enum {
637                 SVC_STATUS_PROCESS_INFO         = 0x00000000
638         } svcctl_StatusLevel;
639
640         WERROR svcctl_QueryServiceStatusEx(
641                 [in,ref] policy_handle *handle,
642                 [in] svcctl_StatusLevel info_level,
643                 [out,ref,size_is(buf_size)] uint8 *buffer,
644                 [in] [range(0,8192)] uint32 buf_size,
645                 [out,ref] [range(0,8192)] uint32 *bytes_needed
646         );
647
648         /*****************/
649         /* Function 0x29 */
650         WERROR EnumServicesStatusExA(
651                 [in,ref] policy_handle *scmanager,
652                 [in] uint32 info_level,
653                 [in] uint32 type,
654                 [in] svcctl_ServiceState state,
655                 [out] uint8 services[buf_size],
656                 [in] uint32 buf_size,
657                 [out,ref] uint32 *bytes_needed,
658                 [out,ref] uint32 *service_returned,
659                 [in,out,unique] uint32 *resume_handle,
660                 [out,ref] [string,charset(UTF16)] uint16 **group_name
661         );
662
663         /*****************/
664         /* Function 0x2a */
665         WERROR EnumServicesStatusExW(
666                 [in,ref] policy_handle *scmanager,
667                 [in] uint32 info_level,
668                 [in] uint32 type,
669                 [in] svcctl_ServiceState state,
670                 [out,ref,size_is(buf_size)] uint8 *services,
671                 [in] [range(0,0x40000)] uint32 buf_size,
672                 [out,ref] [range(0,0x40000)] uint32 *bytes_needed,
673                 [out,ref] [range(0,0x40000)] uint32 *service_returned,
674                 [in,out,unique] [range(0,0x40000)] uint32 *resume_handle,
675                 [in,unique] [string,charset(UTF16)] uint16 *group_name
676         );
677
678         /*****************/
679         /* Function 0x2b */
680         [todo] WERROR svcctl_SCSendTSMessage(
681         );
682 }