4 svcctl interface definitions
6 The below was initially obtained from MS-SCMR which is
7 Copyright © 2022 Microsoft Corporation as permitted
8 by the Open Specifications terms reproduced in IDL_LICENCE.txt
11 import
"misc.idl", "security.idl";
12 [ uuid("367abb81-9844-35f1-ad32-98f038001003"),
14 pointer_default(unique),
16 endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"),
17 helper
("../librpc/ndr/ndr_svcctl.h"),
18 helpstring("Service Control")
21 const int MAX_SERVICE_NAME_LENGTH
= 256;
22 const short SC_MAX_DEPEND_SIZE
= 4 * 1024;
23 const short SC_MAX_NAME_LENGTH
= MAX_SERVICE_NAME_LENGTH
+ 1;
24 const short SC_MAX_PATH_LENGTH
= 32 * 1024;
25 const short SC_MAX_PWD_SIZE
= 514;
26 const short SC_MAX_COMPUTER_NAME_LENGTH
= 1024;
27 const short SC_MAX_ACCOUNT_NAME_LENGTH
= 2 * 1024;
28 const short SC_MAX_COMMENT_LENGTH
= 128;
29 const short SC_MAX_ARGUMENT_LENGTH
= 1024;
30 const short SC_MAX_ARGUMENTS
= 1024;
32 #define BOUNDED_DWORD_4K
[range(0, 1024 * 4)] uint32
33 #define BOUNDED_DWORD_8K
[range(0, 1024 * 8)] uint32
34 #define BOUNDED_DWORD_256K
[range(0, 1024 * 256)] uint32
38 * pidl does not yet have a real [context_handle] implementation, so we
39 * just use some defines here.
42 typedef [context_handle] void *SC_RPC_HANDLE
;
43 typedef [context_handle] void *SC_NOTIFY_RPC_HANDLE
;
45 #define SC_RPC_HANDLE policy_handle
46 #define SC_NOTIFY_RPC_HANDLE policy_handle
47 #define
handle_t policy_handle
51 [string,charset
(UTF16
)] uint16
*lock_owner
;
53 } SERVICE_LOCK_STATUS
;
55 typedef [v1_enum] enum {
56 SVCCTL_STATE_UNKNOWN
= 0x00000000, /* only used internally to smbd */
57 SVCCTL_STOPPED
= 0x00000001,
58 SVCCTL_START_PENDING
= 0x00000002,
59 SVCCTL_STOP_PENDING
= 0x00000003,
60 SVCCTL_RUNNING
= 0x00000004,
61 SVCCTL_CONTINUE_PENDING
= 0x00000005,
62 SVCCTL_PAUSE_PENDING
= 0x00000006,
63 SVCCTL_PAUSED
= 0x00000007
64 } svcctl_ServiceStatus
;
66 const int SVCCTL_ACCEPT_NONE
= 0x00000000;
68 typedef [bitmap32bit
] bitmap
{
69 SVCCTL_ACCEPT_STOP
= 0x00000001,
70 SVCCTL_ACCEPT_PAUSE_CONTINUE
= 0x00000002,
71 SVCCTL_ACCEPT_SHUTDOWN
= 0x00000004,
72 SVCCTL_ACCEPT_PARAMCHANGE
= 0x00000008,
73 SVCCTL_ACCEPT_NETBINDCHANGE
= 0x00000010,
74 SVCCTL_ACCEPT_HARDWAREPROFILECHANGE
= 0x00000020,
75 SVCCTL_ACCEPT_POWEREVENT
= 0x00000040
76 } svcctl_ControlsAccepted
;
80 svcctl_ServiceStatus state
;
81 svcctl_ControlsAccepted controls_accepted
;
82 WERROR win32_exit_code
;
83 uint32 service_exit_code
;
88 typedef [public] struct {
89 SERVICE_STATUS status
;
92 } SERVICE_STATUS_PROCESS
;
94 typedef [public,gensize
] struct {
95 [relative
] nstring
*service_name
;
96 [relative
] nstring
*display_name
;
97 SERVICE_STATUS status
;
98 } ENUM_SERVICE_STATUSW
;
100 typedef [public,gensize
] struct {
101 [relative
] astring
*service_name
;
102 [relative
] astring
*display_name
;
103 SERVICE_STATUS status
;
104 } ENUM_SERVICE_STATUSA
;
106 const int SERVICE_TYPE_KERNEL_DRIVER
= 0x01;
107 const int SERVICE_TYPE_FS_DRIVER
= 0x02;
108 const int SERVICE_TYPE_ADAPTER
= 0x04;
109 const int SERVICE_TYPE_RECOGNIZER_DRIVER
= 0x08;
110 const int SERVICE_TYPE_DRIVER
=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER
;
111 const int SERVICE_TYPE_WIN32_OWN_PROCESS
= 0x10;
112 const int SERVICE_TYPE_WIN32_SHARE_PROCESS
= 0x20;
113 const int SERVICE_TYPE_WIN32
=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS
;
114 const int SERVICE_TYPE_INTERACTIVE_PROCESS
= 0x100;
118 WERROR svcctl_CloseServiceHandle
(
119 [in,out,ref] policy_handle
*handle
125 /* Service Controls */
127 typedef [v1_enum] enum {
128 SVCCTL_CONTROL_STOP
= 0x00000001,
129 SVCCTL_CONTROL_PAUSE
= 0x00000002,
130 SVCCTL_CONTROL_CONTINUE
= 0x00000003,
131 SVCCTL_CONTROL_INTERROGATE
= 0x00000004,
132 SVCCTL_CONTROL_SHUTDOWN
= 0x00000005,
133 SVCCTL_CONTROL_PARAMCHANGE
= 0x00000006,
134 SVCCTL_CONTROL_NETBINDADD
= 0x00000007,
135 SVCCTL_CONTROL_NETBINDREMOVE
= 0x00000008,
136 SVCCTL_CONTROL_NETBINDENABLE
= 0x00000009,
137 SVCCTL_CONTROL_NETBINDDISABLE
= 0x0000000A
140 WERROR svcctl_ControlService
(
141 [in,ref] policy_handle
*handle,
142 [in] SERVICE_CONTROL
control,
143 [out,ref] SERVICE_STATUS
*service_status
148 WERROR svcctl_DeleteService
(
149 [in,ref] policy_handle
*handle
155 WERROR svcctl_LockServiceDatabase
(
156 [in,ref] policy_handle
*handle,
157 [out,ref] policy_handle
*lock
162 WERROR svcctl_QueryServiceObjectSecurity
(
163 [in] policy_handle
*handle,
164 [in] security_secinfo security_flags
,
165 [out,ref,size_is(offered
)] uint8
*buffer
,
166 [in,range(0,0x40000)] uint32 offered
,
167 [out,ref,range(0,0x40000)] uint32
*needed
172 WERROR svcctl_SetServiceObjectSecurity
(
173 [in] policy_handle
*handle,
174 [in] security_secinfo security_flags
,
175 [in,ref,size_is(offered
)] uint8
*buffer
,
181 WERROR svcctl_QueryServiceStatus
(
182 [in,ref] policy_handle
*handle,
183 [out,ref] SERVICE_STATUS
*service_status
188 [todo
] WERROR svcctl_SetServiceStatus
(
193 WERROR svcctl_UnlockServiceDatabase
(
194 [in,out,ref] policy_handle
*lock
199 [todo
] WERROR svcctl_NotifyBootConfigStatus
(
204 WERROR svcctl_SCSetServiceBitsW
(
205 [in,ref] policy_handle
*handle,
207 [in] boolean32 bitson
,
208 [in] boolean32 immediate
214 typedef [v1_enum] enum {
215 SVCCTL_SVC_ERROR_IGNORE
= 0x00000000,
216 SVCCTL_SVC_ERROR_NORMAL
= 0x00000001,
217 SVCCTL_SVC_ERROR_CRITICAL
= 0x00000002,
218 SVCCTL_SVC_ERROR_SEVERE
= 0x00000003
219 } svcctl_ErrorControl
;
221 typedef [v1_enum] enum {
222 SVCCTL_BOOT_START
= 0x00000000,
223 SVCCTL_SYSTEM_START
= 0x00000001,
224 SVCCTL_AUTO_START
= 0x00000002,
225 SVCCTL_DEMAND_START
= 0x00000003,
226 SVCCTL_DISABLED
= 0x00000004
229 [public] WERROR svcctl_ChangeServiceConfigW
(
230 [in,ref] policy_handle
*handle,
232 [in] svcctl_StartType start_type
,
233 [in] svcctl_ErrorControl error_control
,
234 [in,unique] [string,charset
(UTF16
)] uint16
*binary_path
,
235 [in,unique] [string,charset
(UTF16
)] uint16
*load_order_group
,
236 [in,out,unique] uint32
*tag_id
,
237 [in,unique,size_is(dwDependSize
)] [string,charset
(UTF16
)] uint16
*dependencies
,
238 [in,range(0, SC_MAX_DEPEND_SIZE
)] uint32 dwDependSize
,
239 [in,unique,range(0, SC_MAX_ACCOUNT_NAME_LENGTH
)] [string,charset
(UTF16
)] uint16
*service_start_name
,
240 [in,unique,size_is(dwPwSize
)] [string,charset
(UTF16
)] uint16
*password
,
241 [in,range(0, SC_MAX_PWD_SIZE
)] uint32 dwPwSize
,
242 [in,unique,range(0, SC_MAX_NAME_LENGTH
)] [string,charset
(UTF16
)] uint16
*display_name
247 WERROR svcctl_CreateServiceW
(
248 [in,ref] policy_handle
*scmanager_handle
,
249 [in] [string,charset
(UTF16
)] uint16 ServiceName
[],
250 [in,unique] [string,charset
(UTF16
)] uint16
*DisplayName
,
251 [in] uint32 desired_access
,
253 [in] svcctl_StartType start_type
,
254 [in] svcctl_ErrorControl error_control
,
255 [in] [string,charset
(UTF16
)] uint16 binary_path
[],
256 [in,unique] [string,charset
(UTF16
)] uint16
*LoadOrderGroupKey
,
257 [in,out,unique] uint32
*TagId
,
258 [in,unique,size_is(dependencies_size
)] uint8
*dependencies
,
259 [in] uint32 dependencies_size
,
260 [in,unique] [string,charset
(UTF16
)] uint16
*service_start_name
,
261 [in,unique,size_is(password_size
)] uint8
*password
,
262 [in] uint32 password_size
,
263 [out,ref] policy_handle
*handle
268 WERROR svcctl_EnumDependentServicesW
(
269 [in,ref] policy_handle
*service
,
270 [in] svcctl_ServiceState state
,
271 [out,ref,size_is(offered
)] uint8
*service_status
,
272 [in,range(0,0x40000)] uint32 offered
,
273 [out,ref,range(0,0x40000)] uint32
*needed
,
274 [out,ref,range(0,0x40000)] uint32
*services_returned
280 typedef [v1_enum] enum {
281 SERVICE_STATE_ACTIVE
= 0x00000001,
282 SERVICE_STATE_INACTIVE
= 0x00000002,
283 SERVICE_STATE_ALL
= ( SERVICE_STATE_ACTIVE | SERVICE_STATE_INACTIVE
)
284 } svcctl_ServiceState
;
286 WERROR svcctl_EnumServicesStatusW
(
287 [in,ref] policy_handle
*handle,
289 [in] svcctl_ServiceState state
,
290 [out,ref,size_is(offered
)] uint8
*service
,
291 [in] [range(0,0x40000)] uint32 offered
,
292 [out,ref] [range(0,0x40000)] uint32
*needed
,
293 [out,ref] [range(0,0x40000)] uint32
*services_returned
,
294 [in,out,unique] uint32
*resume_handle
300 /* Service Control Manager Bits */
302 typedef [bitmap32bit
] bitmap
{
303 SC_RIGHT_MGR_CONNECT
= 0x0001,
304 SC_RIGHT_MGR_CREATE_SERVICE
= 0x0002,
305 SC_RIGHT_MGR_ENUMERATE_SERVICE
= 0x0004,
306 SC_RIGHT_MGR_LOCK
= 0x0008,
307 SC_RIGHT_MGR_QUERY_LOCK_STATUS
= 0x0010,
308 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG
= 0x0020
309 } svcctl_MgrAccessMask
;
311 const int SC_MANAGER_READ_ACCESS
=
312 (SEC_STD_READ_CONTROL |
313 SC_RIGHT_MGR_CONNECT |
314 SC_RIGHT_MGR_ENUMERATE_SERVICE |
315 SC_RIGHT_MGR_QUERY_LOCK_STATUS
);
317 const int SC_MANAGER_EXECUTE_ACCESS
= SC_MANAGER_READ_ACCESS
;
319 const int SC_MANAGER_WRITE_ACCESS
=
321 SC_MANAGER_READ_ACCESS |
322 SC_RIGHT_MGR_CREATE_SERVICE |
324 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG
);
326 const int SC_MANAGER_ALL_ACCESS
= SC_MANAGER_WRITE_ACCESS
;
328 WERROR svcctl_OpenSCManagerW
(
329 [in,unique] [string,charset
(UTF16
)] uint16
*MachineName
,
330 [in,unique] [string,charset
(UTF16
)] uint16
*DatabaseName
,
331 [in] svcctl_MgrAccessMask access_mask
,
332 [out,ref] policy_handle
*handle
338 /* Service Object Bits */
340 typedef [bitmap32bit
] bitmap
{
341 SC_RIGHT_SVC_QUERY_CONFIG
= 0x0001,
342 SC_RIGHT_SVC_CHANGE_CONFIG
= 0x0002,
343 SC_RIGHT_SVC_QUERY_STATUS
= 0x0004,
344 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS
= 0x0008,
345 SC_RIGHT_SVC_START
= 0x0010,
346 SC_RIGHT_SVC_STOP
= 0x0020,
347 SC_RIGHT_SVC_PAUSE_CONTINUE
= 0x0040,
348 SC_RIGHT_SVC_INTERROGATE
= 0x0080,
349 SC_RIGHT_SVC_USER_DEFINED_CONTROL
= 0x0100
350 } svcctl_ServiceAccessMask
;
352 const int SERVICE_READ_ACCESS
=
353 (SEC_STD_READ_CONTROL |
354 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS |
355 SC_RIGHT_SVC_INTERROGATE |
356 SC_RIGHT_SVC_QUERY_CONFIG |
357 SC_RIGHT_SVC_QUERY_STATUS |
358 SC_RIGHT_SVC_USER_DEFINED_CONTROL
);
360 const int SERVICE_EXECUTE_ACCESS
=
361 (SERVICE_READ_ACCESS |
364 SC_RIGHT_SVC_PAUSE_CONTINUE
);
366 const int SERVICE_WRITE_ACCESS
=
368 SERVICE_READ_ACCESS |
369 SERVICE_EXECUTE_ACCESS |
370 SC_RIGHT_SVC_CHANGE_CONFIG
);
372 const int SERVICE_ALL_ACCESS
= SERVICE_WRITE_ACCESS
;
374 WERROR svcctl_OpenServiceW
(
375 [in,ref] policy_handle
*scmanager_handle
,
376 [in] [string,charset
(UTF16
)] uint16 ServiceName
[],
377 [in] svcctl_ServiceAccessMask access_mask
,
378 [out,ref] policy_handle
*handle
384 typedef [public,gensize
] struct {
386 svcctl_StartType start_type
;
387 svcctl_ErrorControl error_control
;
388 [string,charset
(UTF16
)] [range(0,8192)] uint16
*executablepath
;
389 [string,charset
(UTF16
)] [range(0,8192)] uint16
*loadordergroup
;
391 [string,charset
(UTF16
)] [range(0,8192)] uint16
*dependencies
;
392 [string,charset
(UTF16
)] [range(0,8192)] uint16
*startname
;
393 [string,charset
(UTF16
)] [range(0,8192)] uint16
*displayname
;
394 } QUERY_SERVICE_CONFIG
;
396 WERROR svcctl_QueryServiceConfigW
(
397 [in,ref] policy_handle
*handle,
398 [out] QUERY_SERVICE_CONFIG
*query
,
399 [in] [range(0,8192)] uint32 offered
,
400 [out,ref] [range(0,8192)] uint32
*needed
405 WERROR svcctl_QueryServiceLockStatusW
(
406 [in,ref] policy_handle
*handle,
408 [out,ref] SERVICE_LOCK_STATUS
*lock_status
,
409 [out,ref] uint32
*needed
415 const int SC_MAX_ARGUMENT_LENGTH
= 1024;
416 const int SC_MAX_ARGUMENTS
= 1024;
419 [string,charset
(UTF16
),range(0,SC_MAX_ARGUMENT_LENGTH
)] uint16
*string;
420 } svcctl_ArgumentString
;
422 WERROR svcctl_StartServiceW
(
423 [in,ref] policy_handle
*handle,
424 [in,range(0,SC_MAX_ARGUMENTS
)] uint32 NumArgs
,
425 [in,unique,size_is(NumArgs
)] svcctl_ArgumentString
*Arguments
430 WERROR svcctl_GetServiceDisplayNameW
(
431 [in,ref] policy_handle
*handle,
432 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
433 [out,ref] [string,charset
(UTF16
)] uint16
**display_name
,
434 [in,out,unique] uint32
*display_name_length
439 WERROR svcctl_GetServiceKeyNameW
(
440 [in,ref] policy_handle
*handle,
441 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
442 [out,ref] [string,charset
(UTF16
)] uint16
**key_name
,
443 [in,out,unique] uint32
*display_name_length
448 WERROR svcctl_SCSetServiceBitsA
(
449 [in,ref] policy_handle
*handle,
451 [in] boolean32 bitson
,
452 [in] boolean32 immediate
457 WERROR svcctl_ChangeServiceConfigA
(
458 [in,ref] policy_handle
*handle,
460 [in] svcctl_StartType start_type
,
461 [in] svcctl_ErrorControl error_control
,
462 [in,unique] [string,charset
(UTF16
)] uint16
*binary_path
,
463 [in,unique] [string,charset
(UTF16
)] uint16
*load_order_group
,
464 [out,ref] uint32
*tag_id
,
465 [in,unique] [string,charset
(UTF16
)] uint16
*dependencies
,
466 [in,unique] [string,charset
(UTF16
)] uint16
*service_start_name
,
467 [in,unique] [string,charset
(UTF16
)] uint16
*password
,
468 [in,unique] [string,charset
(UTF16
)] uint16
*display_name
473 WERROR svcctl_CreateServiceA
(
474 [in,ref] policy_handle
*handle,
475 [in,unique] [string,charset
(UTF16
)] uint16
*ServiceName
,
476 [in,unique] [string,charset
(UTF16
)] uint16
*DisplayName
,
477 [in] uint32 desired_access
,
479 [in] svcctl_StartType start_type
,
480 [in] svcctl_ErrorControl error_control
,
481 [in,unique] [string,charset
(UTF16
)] uint16
*binary_path
,
482 [in,unique] [string,charset
(UTF16
)] uint16
*LoadOrderGroupKey
,
483 [out,unique] uint32
*TagId
,
484 [in,unique] [string,charset
(UTF16
)] uint16
*dependencies
,
485 [in,unique] [string,charset
(UTF16
)] uint16
*service_start_name
,
486 [in,unique] [string,charset
(UTF16
)] uint16
*password
491 WERROR svcctl_EnumDependentServicesA
(
492 [in,ref] policy_handle
*service
,
493 [in] svcctl_ServiceState state
,
494 [out,unique] ENUM_SERVICE_STATUSA
*service_status
,
496 [out,ref] uint32
*needed
,
497 [out,ref] uint32
*services_returned
502 WERROR svcctl_EnumServicesStatusA
(
503 [in,ref] policy_handle
*handle,
505 [in] svcctl_ServiceState state
,
507 [out,size_is(offered
)] uint8 service
[*],
508 [out,ref] uint32
*needed
,
509 [out,ref] uint32
*services_returned
,
510 [in,out,unique] uint32
*resume_handle
515 WERROR svcctl_OpenSCManagerA
(
516 [in,unique] [string,charset
(UTF16
)] uint16
*MachineName
,
517 [in,unique] [string,charset
(UTF16
)] uint16
*DatabaseName
,
518 [in] uint32 access_mask
,
519 [out,ref] policy_handle
*handle
524 WERROR svcctl_OpenServiceA
(
525 [in,ref] policy_handle
*scmanager_handle
,
526 [in,unique] [string,charset
(UTF16
)] uint16
*ServiceName
,
527 [in] uint32 access_mask
,
528 [out,ref] policy_handle
*handle
533 WERROR svcctl_QueryServiceConfigA
(
534 [in,ref] policy_handle
*handle,
535 [out] uint8 query
[offered
], /*QUERYU_SERVICE_CONFIG */
537 [out,ref] uint32
*needed
542 WERROR svcctl_QueryServiceLockStatusA
(
543 [in,ref] policy_handle
*handle,
545 [out,ref] SERVICE_LOCK_STATUS
*lock_status
,
546 [out,ref] uint32
*needed
551 WERROR svcctl_StartServiceA
(
552 [in,ref] policy_handle
*handle,
554 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset
(UTF16
)] uint16
*Arguments
559 WERROR svcctl_GetServiceDisplayNameA
(
560 [in,ref] policy_handle
*handle,
561 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
562 [out,ref] [string,charset
(UTF16
)] uint16
**display_name
,
563 [in,out,unique] uint32
*display_name_length
568 WERROR svcctl_GetServiceKeyNameA
(
569 [in,ref] policy_handle
*handle,
570 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
571 [out,ref] [string,charset
(UTF16
)] uint16
**key_name
,
572 [in,out,unique] uint32
*display_name_length
577 [todo
] WERROR svcctl_GetCurrentGroupeStateW
(
582 [todo
] WERROR svcctl_EnumServiceGroupW
(
587 WERROR svcctl_ChangeServiceConfig2A
(
588 [in,ref] policy_handle
*handle,
589 [in] uint32 info_level
,
590 [in,unique] uint8
*info
595 WERROR svcctl_ChangeServiceConfig2W
(
596 [in,ref] policy_handle
*handle,
597 [in] uint32 info_level
,
598 [in,unique] uint8
*info
604 typedef [v1_enum] enum {
605 SERVICE_CONFIG_DESCRIPTION
= 0x00000001,
606 SERVICE_CONFIG_FAILURE_ACTIONS
= 0x00000002
607 } svcctl_ConfigLevel
;
609 typedef [gensize
,public] struct {
610 [relative
] nstring
*description
;
611 } SERVICE_DESCRIPTION
;
613 typedef [v1_enum] enum {
615 SC_ACTION_RESTART
= 1,
616 SC_ACTION_REBOOT
= 2,
617 SC_ACTION_RUN_COMMAND
= 3
625 typedef [public,gensize
] struct {
627 [relative
] nstring
*rebootmsg
;
628 [relative
] nstring
*command
;
629 [range(0,1024)] uint32 num_actions
;
630 [relative
] [size_is(num_actions
)] SC_ACTION
*actions
;
631 } SERVICE_FAILURE_ACTIONSW
;
633 WERROR svcctl_QueryServiceConfig2A
(
634 [in,ref] policy_handle
*handle,
635 [in] svcctl_ConfigLevel info_level
,
636 [out] uint8 buffer
[offered
],
638 [out,ref] uint32
*needed
643 WERROR svcctl_QueryServiceConfig2W
(
644 [in,ref] policy_handle
*handle,
645 [in] svcctl_ConfigLevel info_level
,
646 [out,ref,size_is(offered
)] uint8
*buffer
,
647 [in] [range(0,8192)] uint32 offered
,
648 [out,ref] [range(0,8192)] uint32
*needed
654 typedef [v1_enum] enum {
655 SVC_STATUS_PROCESS_INFO
= 0x00000000
656 } svcctl_StatusLevel
;
658 WERROR svcctl_QueryServiceStatusEx
(
659 [in,ref] policy_handle
*handle,
660 [in] svcctl_StatusLevel info_level
,
661 [out,ref,size_is(offered
)] uint8
*buffer
,
662 [in] [range(0,8192)] uint32 offered
,
663 [out,ref] [range(0,8192)] uint32
*needed
668 WERROR svcctl_EnumServicesStatusExA
(
669 [in,ref] policy_handle
*scmanager
,
670 [in] uint32 info_level
,
672 [in] svcctl_ServiceState state
,
673 [out] uint8 services
[offered
],
675 [out,ref] uint32
*needed
,
676 [out,ref] uint32
*service_returned
,
677 [in,out,unique] uint32
*resume_handle
,
678 [out,ref] [string,charset
(UTF16
)] uint16
**group_name
683 WERROR svcctl_EnumServicesStatusExW
(
684 [in,ref] policy_handle
*scmanager
,
685 [in] uint32 info_level
,
687 [in] svcctl_ServiceState state
,
688 [out,ref,size_is(offered
)] uint8
*services
,
689 [in] [range(0,0x40000)] uint32 offered
,
690 [out,ref] [range(0,0x40000)] uint32
*needed
,
691 [out,ref] [range(0,0x40000)] uint32
*service_returned
,
692 [in,out,unique] [range(0,0x40000)] uint32
*resume_handle
,
693 [in,unique] [string,charset
(UTF16
)] uint16
*group_name
698 [todo
] WERROR svcctl_SCSendTSMessage
(
703 WERROR svcctl_CreateServiceWOW64A
(
704 [in] SC_RPC_HANDLE hSCManager
,
705 [in,string,range(0, SC_MAX_NAME_LENGTH
),charset
(DOS
)] char *lpServiceName
,
706 [in,string,unique,range(0, SC_MAX_NAME_LENGTH
),charset
(DOS
)] char *lpDisplayName
,
707 [in] uint32 dwDesiredAccess
,
708 [in] uint32 dwServiceType
,
709 [in] uint32 dwStartType
,
710 [in] uint32 dwErrorControl
,
711 [in,string, range(0, SC_MAX_PATH_LENGTH
),charset
(DOS
)] char *lpBinaryPathName
,
712 [in,string,unique,range(0, SC_MAX_NAME_LENGTH
),charset
(DOS
)] char *lpLoadOrderGroup
,
713 [in,out,unique] uint32
*lpdwTagId
,
714 [in,unique,size_is(dwDependSize
)] uint8
*lpDependencies
,
715 [in, range (0, SC_MAX_DEPEND_SIZE
)] uint32 dwDependSize
,
716 [in,string,unique,range(0, SC_MAX_ACCOUNT_NAME_LENGTH
),charset
(DOS
)] char *lpServiceStartName
,
717 [in,unique,size_is(dwPwSize
)] uint8
*lpPassword
,
718 [in, range(0, SC_MAX_PWD_SIZE
)] uint32 dwPwSize
,
719 [out] SC_RPC_HANDLE
*lpServiceHandle
724 WERROR svcctl_CreateServiceWOW64W
(
725 [in] SC_RPC_HANDLE hSCManager
,
726 [in,string,range(0, SC_MAX_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpServiceName
,
727 [in,string,unique,range(0, SC_MAX_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpDisplayName
,
728 [in] uint32 dwDesiredAccess
,
729 [in] uint32 dwServiceType
,
730 [in] uint32 dwStartType
,
731 [in] uint32 dwErrorControl
,
732 [in,string,range(0, SC_MAX_PATH_LENGTH
),charset
(UTF16
)] uint16
*lpBinaryPathName
,
733 [in,string,unique,range(0, SC_MAX_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpLoadOrderGroup
,
734 [in,out,unique] uint32
*lpdwTagId
,
735 [in,unique,size_is(dwDependSize
)] uint8
*lpDependencies
,
736 [in, range (0, SC_MAX_DEPEND_SIZE
)] uint32 dwDependSize
,
737 [in,string,unique,range(0, SC_MAX_ACCOUNT_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpServiceStartName
,
738 [in,unique,size_is(dwPwSize
)] uint8
*lpPassword
,
739 [in, range(0, SC_MAX_PWD_SIZE
)] uint32 dwPwSize
,
740 [out] SC_RPC_HANDLE
*lpServiceHandle
745 void Opnum46NotUsedOnWire
(void);
753 char CallbackAddressArray
[16];
754 char CallbackParamAddressArray
[16];
755 SERVICE_STATUS_PROCESS ServiceStatus
;
756 uint32 dwNotificationStatus
;
758 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
;
763 char CallbackAddressArray
[16];
764 char CallbackParamAddressArray
[16];
765 SERVICE_STATUS_PROCESS ServiceStatus
;
766 uint32 dwNotificationStatus
;
768 uint32 dwNotificationTriggered
;
769 [string, range(0, 64*1024), charset
(UTF16
)] uint16
*pszServiceNames
;
770 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
;
772 typedef SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
773 SERVICE_NOTIFY_STATUS_CHANGE_PARAMS
;
775 typedef [switch_type(uint32
)] union {
776 [case(1)] SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
*pStatusChangeParam1
;
777 [case(2)] SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
*pStatusChangeParams
;
778 } SC_RPC_NOTIFY_PARAMS_u
;
782 [switch_is(dwInfoLevel
)] SC_RPC_NOTIFY_PARAMS_u u
;
783 } SC_RPC_NOTIFY_PARAMS
;
786 BOUNDED_DWORD_4K cElements
;
787 [size_is(cElements
)] SC_RPC_NOTIFY_PARAMS NotifyParamsArray
[*];
788 } SC_RPC_NOTIFY_PARAMS_LIST
;
790 WERROR svcctl_NotifyServiceStatusChange
(
791 [in] SC_RPC_HANDLE hService
,
792 [in] SC_RPC_NOTIFY_PARAMS NotifyParams
,
793 [in] GUID
*pClientProcessGuid
,
794 [out] GUID
*pSCMProcessGuid
,
795 [out] boolean32
*pfCreateRemoteQueue
,
796 [out] SC_NOTIFY_RPC_HANDLE
*phNotify
801 WERROR svcctl_GetNotifyResults
(
802 [in] SC_NOTIFY_RPC_HANDLE hNotify
,
803 [out,ref] SC_RPC_NOTIFY_PARAMS_LIST
*ppNotifyParams
808 WERROR svcctl_CloseNotifyHandle
(
809 [in, out] SC_NOTIFY_RPC_HANDLE
*phNotify
,
810 [out] boolean32
*pfApcFired
816 typedef [v1_enum] enum {
817 SERVICE_STOP_UNPLANNED
= 0x10000000,
818 SERVICE_STOP_CUSTOM
= 0x20000000,
819 SERVICE_STOP_PLANNED
= 0x40000000
820 } svcctl_ServiceStopReasonMain
;
822 typedef [v1_enum] enum {
823 SERVICE_STOP_REASON_MAJOR_OTHER
= 0x00010000,
824 SERVICE_STOP_REASON_MAJOR_HARDWARE
= 0x00020000,
825 SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM
= 0x00030000,
826 SERVICE_STOP_REASON_MAJOR_SOFTWARE
= 0x00040000,
827 SERVICE_STOP_REASON_MAJOR_APPLICATION
= 0x00050000,
828 SERVICE_STOP_REASON_MAJOR_NONE
= 0x00060000
829 } svcctl_ServiceStopReasonMajor
;
831 typedef [v1_enum] enum {
832 SERVICE_STOP_REASON_MINOR_OTHER
= 0x00000001,
833 SERVICE_STOP_REASON_MINOR_MAINTENANCE
= 0x00000002,
834 SERVICE_STOP_REASON_MINOR_INSTALLATION
= 0x00000003,
835 SERVICE_STOP_REASON_MINOR_UPGRADE
= 0x00000004,
836 SERVICE_STOP_REASON_MINOR_RECONFIG
= 0x00000005,
837 SERVICE_STOP_REASON_MINOR_HUNG
= 0x00000006,
838 SERVICE_STOP_REASON_MINOR_UNSTABLE
= 0x00000007,
839 SERVICE_STOP_REASON_MINOR_DISK
= 0x00000008,
840 SERVICE_STOP_REASON_MINOR_NETWORKCARD
= 0x00000009,
841 SERVICE_STOP_REASON_MINOR_ENVIRONMENT
= 0x0000000a,
842 SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER
= 0x0000000b,
843 SERVICE_STOP_REASON_MINOR_OTHERDRIVER
= 0x0000000c,
844 SERVICE_STOP_REASON_MINOR_SERVICEPACK
= 0x0000000d,
845 SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE
= 0x0000000e,
846 SERVICE_STOP_REASON_MINOR_SECURITYFIX
= 0x0000000f,
847 SERVICE_STOP_REASON_MINOR_SECURITY
= 0x00000010,
848 SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY
= 0x00000011,
849 SERVICE_STOP_REASON_MINOR_WMI
= 0x00000012,
850 SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL
= 0x00000013,
851 SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL
= 0x00000014,
852 SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL
= 0x00000015,
853 SERVICE_STOP_REASON_MINOR_MMC
= 0x00000016,
854 SERVICE_STOP_REASON_MINOR_NONE
= 0x00000017
855 } svcctl_ServiceStopReasonMinor
;
859 [string,range(0, SC_MAX_COMMENT_LENGTH
),charset
(DOS
)] char *szComment
;
860 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
;
863 SERVICE_STATUS_PROCESS ServiceStatus
;
864 } SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
;
866 typedef [switch_type(uint32
)] union {
867 [case(1)] SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
*psrInParams
;
868 } SC_RPC_SERVICE_CONTROL_IN_PARAMSA
;
870 typedef [switch_type(uint32
)] union {
871 [case(1)] SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
*psrOutParams
;
872 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
;
874 WERROR svcctl_ControlServiceExA
(
875 [in] SC_RPC_HANDLE hService
,
876 [in] SERVICE_CONTROL dwControl
,
877 [in] uint32 dwInfoLevel
,
878 [in, switch_is(dwInfoLevel
)] SC_RPC_SERVICE_CONTROL_IN_PARAMSA
*pControlInParams
,
879 [out, switch_is(dwInfoLevel
)] SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
*pControlOutParams
887 [string,range(0, SC_MAX_COMMENT_LENGTH
),charset
(UTF16
)] uint16
*pszComment
;
888 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
;
890 typedef [switch_type(uint32
)] union {
891 [case(1)] SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
*psrInParams
;
892 } SC_RPC_SERVICE_CONTROL_IN_PARAMSW
;
894 typedef [switch_type(uint32
)] union {
895 [case(1)] SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
*psrOutParams
;
896 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
;
898 WERROR svcctl_ControlServiceExW
(
899 [in] SC_RPC_HANDLE hService
,
900 [in] SERVICE_CONTROL dwControl
,
901 [in] uint32 dwInfoLevel
,
902 [in, ref, switch_is(dwInfoLevel
)] SC_RPC_SERVICE_CONTROL_IN_PARAMSW
*pControlInParams
,
903 [out,ref, switch_is(dwInfoLevel
)] SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
*pControlOutParams
908 void Opnum52NotUsedOnWire
(void);
912 void Opnum53NotUsedOnWire
(void);
916 void Opnum54NotUsedOnWire
(void);
920 void Opnum55NotUsedOnWire
(void);
926 [string,range(0, 8 * 1024), charset
(UTF16
)] uint16
*lpDescription
;
927 } SERVICE_DESCRIPTIONW
;
930 boolean32 fDelayedAutostart
;
931 } SERVICE_DELAYED_AUTO_START_INFO
;
934 boolean32 fFailureActionsOnNonCrashFailures
;
935 } SERVICE_FAILURE_ACTIONS_FLAG
;
938 uint32 dwServiceSidType
;
942 [range(0, 1024 * 4)] uint32 cbRequiredPrivileges
;
943 [size_is(cbRequiredPrivileges
)] uint8
*pRequiredPrivileges
;
944 } SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
;
947 uint32 dwPreshutdownTimeout
;
948 } SERVICE_PRESHUTDOWN_INFO
;
952 [range(0, 1024)] uint32 cbData
;
953 [size_is(cbData
)] uint8
*pData
;
954 } SERVICE_TRIGGER_SPECIFIC_DATA_ITEM
;
957 uint32 dwTriggerType
;
959 GUID
*pTriggerSubtype
;
960 [range(0, 64)] uint32 cDataItems
;
961 [size_is(cDataItems
)] SERVICE_TRIGGER_SPECIFIC_DATA_ITEM
*pDataItems
;
965 [range(0, 64)] uint32 cTriggers
;
966 [size_is(cTriggers
)] SERVICE_TRIGGER
*pTriggers
;
968 } SERVICE_TRIGGER_INFO
;
971 uint16 usPreferredNode
;
973 } SERVICE_PREFERRED_NODE_INFO
;
975 typedef [switch_type(uint32
)] union {
976 [case(1)] SERVICE_DESCRIPTIONW
*psd
;
977 [case(2)] SERVICE_FAILURE_ACTIONSW
*psfa
;
978 [case(3)] SERVICE_DELAYED_AUTO_START_INFO
*psda
;
979 [case(4)] SERVICE_FAILURE_ACTIONS_FLAG
*psfaf
;
980 [case(5)] SERVICE_SID_INFO
*pssid
;
981 [case(6)] SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
*psrp
;
982 [case(7)] SERVICE_PRESHUTDOWN_INFO
*psps
;
983 [case(8)] SERVICE_TRIGGER_INFO
*psti
;
984 [case(9)] SERVICE_PREFERRED_NODE_INFO
*pspn
;
985 } SC_RPC_CONFIG_INFOW_u
;
989 [switch_is(dwInfoLevel
)] SC_RPC_CONFIG_INFOW_u u
;
990 } SC_RPC_CONFIG_INFOW
;
992 WERROR svcctl_QueryServiceConfigEx
(
993 [in] SC_RPC_HANDLE hService
,
994 [in] uint32 dwInfoLevel
,
995 [out,ref] SC_RPC_CONFIG_INFOW
*pInfo
1000 void Opnum57NotUsedOnWire
(void);
1004 void Opnum58NotUsedOnWire
(void);
1008 void Opnum59NotUsedOnWire
(void);
1012 WERROR svcctl_CreateWowService
(
1013 [in] SC_RPC_HANDLE hSCManager
,
1014 [in,string,range(0, SC_MAX_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpServiceName
,
1015 [in,string,unique,range(0, SC_MAX_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpDisplayName
,
1016 [in] uint32 dwDesiredAccess
,
1017 [in] uint32 dwServiceType
,
1018 [in] uint32 dwStartType
,
1019 [in] uint32 dwErrorControl
,
1020 [in,string,range(0, SC_MAX_PATH_LENGTH
),charset
(UTF16
)] uint16
*lpBinaryPathName
,
1021 [in,string,unique,range(0, SC_MAX_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpLoadOrderGroup
,
1022 [in,out,unique] uint32
*lpdwTagId
,
1023 [in,unique,size_is(dwDependSize
)] uint8
*lpDependencies
,
1024 [in, range (0, SC_MAX_DEPEND_SIZE
)] uint32 dwDependSize
,
1025 [in,string,unique,range(0, SC_MAX_ACCOUNT_NAME_LENGTH
),charset
(UTF16
)] uint16
*lpServiceStartName
,
1026 [in,unique,size_is(dwPwSize
)] uint8
*lpPassword
,
1027 [in, range(0, SC_MAX_PWD_SIZE
)] uint32 dwPwSize
,
1028 [in] uint16 dwServiceWowType
,
1029 [out,ref] SC_RPC_HANDLE
*lpServiceHandle
1034 WERROR svcctl_OpenSCManager2
(
1035 [in] handle_t BindingHandle
,
1036 [in,string,unique,range(0, SC_MAX_NAME_LENGTH
),charset
(UTF16
)] uint16
*DatabaseName
,
1037 [in] uint32 DesiredAccess
,
1038 [out,ref] SC_RPC_HANDLE
*ScmHandle