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