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