4 svcctl interface definitions
7 [ uuid("367abb81-9844-35f1-ad32-98f038001003"),
9 pointer_default(unique),
10 endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"),
11 helpstring("Service Control")
16 [string,charset
(UTF16
)] uint16
*lock_owner
;
18 } SERVICE_LOCK_STATUS
;
23 uint32 controls_accepted
;
24 WERROR win32_exit_code
;
25 uint32 service_exit_code
;
31 [relative
] astring
*service_name
;
32 [relative
] astring
*display_name
;
33 SERVICE_STATUS status
;
34 } ENUM_SERVICE_STATUS
;
36 const int SERVICE_TYPE_KERNEL_DRIVER
= 0x01;
37 const int SERVICE_TYPE_FS_DRIVER
= 0x02;
38 const int SERVICE_TYPE_ADAPTER
= 0x04;
39 const int SERVICE_TYPE_RECOGNIZER_DRIVER
= 0x08;
40 const int SERVICE_TYPE_DRIVER
=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER
;
41 const int SERVICE_TYPE_WIN32_OWN_PROCESS
= 0x10;
42 const int SERVICE_TYPE_WIN32_SHARE_PROCESS
= 0x20;
43 const int SERVICE_TYPE_WIN32
=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS
;
45 const int SERVICE_STATE_ACTIVE
= 0x01;
46 const int SERVICE_STATE_INACTIVE
= 0x02;
47 const int SERVICE_STATE_ALL
= 0x03;
49 typedef [public,bitmap32bit
] bitmap
{
50 SV_TYPE_WORKSTATION
= 0x00000001,
51 SV_TYPE_SERVER
= 0x00000002,
52 SV_TYPE_SQLSERVER
= 0x00000004,
53 SV_TYPE_DOMAIN_CTRL
= 0x00000008,
54 SV_TYPE_DOMAIN_BAKCTRL
= 0x00000010,
55 SV_TYPE_TIME_SOURCE
= 0x00000020,
56 SV_TYPE_AFP
= 0x00000040,
57 SV_TYPE_NOVELL
= 0x00000080,
59 SV_TYPE_DOMAIN_MEMBER
= 0x00000100,
60 SV_TYPE_PRINTQ_SERVER
= 0x00000200,
61 SV_TYPE_DIALIN_SERVER
= 0x00000400,
62 SV_TYPE_SERVER_UNIX
= 0x00000800,
63 SV_TYPE_NT
= 0x00001000,
64 SV_TYPE_WFW
= 0x00002000,
65 SV_TYPE_SERVER_MFPN
= 0x00004000,
66 SV_TYPE_SERVER_NT
= 0x00008000,
67 SV_TYPE_POTENTIAL_BROWSER
= 0x00010000,
68 SV_TYPE_BACKUP_BROWSER
= 0x00020000,
69 SV_TYPE_MASTER_BROWSER
= 0x00040000,
70 SV_TYPE_DOMAIN_MASTER
= 0x00080000,
71 SV_TYPE_SERVER_OSF
= 0x00100000,
72 SV_TYPE_SERVER_VMS
= 0x00200000,
73 SV_TYPE_WIN95_PLUS
= 0x00400000,
74 SV_TYPE_DFS_SERVER
= 0x00800000,
75 SV_TYPE_ALTERNATE_XPORT
= 0x20000000,
76 SV_TYPE_LOCAL_LIST_ONLY
= 0x40000000,
77 SV_TYPE_DOMAIN_ENUM
= 0x80000000
80 const uint32 SV_TYPE_ALL
= 0xFFFFFFFF;
84 WERROR svcctl_CloseServiceHandle
(
85 [in,out,ref] policy_handle
*handle
95 WERROR svcctl_ControlService
(
96 [in,ref] policy_handle
*handle,
98 [out,ref] SERVICE_STATUS
*service_status
103 WERROR svcctl_DeleteService
(
104 [in,ref] policy_handle
*handle
110 WERROR svcctl_LockServiceDatabase
(
111 [in,ref] policy_handle
*handle,
112 [out,ref] policy_handle
*lock
117 WERROR svcctl_QueryServiceObjectSecurity
(
118 [in] policy_handle
*handle,
119 [in] uint32 security_flags
,
120 [out,ref,size_is(buffer_size
)] uint8
*buffer
,
121 [in,range(0,0x40000)] uint32 buffer_size
,
122 [out,ref,range(0,0x40000)] uint32
*needed
127 WERROR svcctl_SetServiceObjectSecurity
(
128 [in] policy_handle
*handle,
129 [in] uint32 security_flags
,
130 [in,ref,size_is(buffer_size
)] uint8
*buffer
,
131 [in] uint32 buffer_size
136 WERROR svcctl_QueryServiceStatus
(
137 [in,ref] policy_handle
*handle,
138 [out,ref] SERVICE_STATUS
*service_status
143 WERROR svcctl_SetServiceStatus
(
148 WERROR svcctl_UnlockServiceDatabase
(
149 [in,out,ref] policy_handle
*lock
154 WERROR svcctl_NotifyBootConfigStatus
(
159 WERROR svcctl_SCSetServiceBitsW
(
160 [in,ref] policy_handle
*handle,
162 [in] boolean32 bitson
,
163 [in] boolean32 immediate
168 WERROR svcctl_ChangeServiceConfigW
(
169 [in,ref] policy_handle
*handle,
173 [in,unique] [string,charset
(UTF16
)] uint16
*binary_path
,
174 [in,unique] [string,charset
(UTF16
)] uint16
*load_order_group
,
175 [out,ref] uint32
*tag_id
,
176 [in,unique] [string,charset
(UTF16
)] uint16
*dependencies
,
177 [in,unique] [string,charset
(UTF16
)] uint16
*service_start_name
,
178 [in,unique] [string,charset
(UTF16
)] uint16
*password
,
179 [in,unique] [string,charset
(UTF16
)] uint16
*display_name
184 WERROR svcctl_CreateServiceW
(
185 [in,ref] policy_handle
*scmanager_handle
,
186 [in] [string,charset
(UTF16
)] uint16 ServiceName
[],
187 [in,unique] [string,charset
(UTF16
)] uint16
*DisplayName
,
188 [in] uint32 desired_access
,
190 [in] uint32 start_type
,
191 [in] uint32 error_control
,
192 [in] [string,charset
(UTF16
)] uint16 binary_path
[],
193 [in,unique] [string,charset
(UTF16
)] uint16
*LoadOrderGroupKey
,
194 [in,out,unique] uint32
*TagId
,
195 [in,unique,size_is(dependencies_size
)] uint8
*dependencies
,
196 [in] uint32 dependencies_size
,
197 [in,unique] [string,charset
(UTF16
)] uint16
*service_start_name
,
198 [in,unique,size_is(password_size
)] uint8
*password
,
199 [in] uint32 password_size
,
200 [out,ref] policy_handle
*handle
205 WERROR svcctl_EnumDependentServicesW
(
206 [in,ref] policy_handle
*service
,
208 [out,ref,size_is(buf_size
)] uint8
*service_status
,
209 [in,range(0,0x40000)] uint32 buf_size
,
210 [out,ref,range(0,0x40000)] uint32
*bytes_needed
,
211 [out,ref,range(0,0x40000)] uint32
*services_returned
216 WERROR svcctl_EnumServicesStatusW
(
217 [in,ref] policy_handle
*handle,
220 [in] uint32 buf_size
,
221 [out,size_is(buf_size
)] uint8 service
[*],
222 [out,ref] uint32
*bytes_needed
,
223 [out,ref] uint32
*services_returned
,
224 [in,out,unique] uint32
*resume_handle
229 typedef [bitmap32bit
] bitmap
{
230 SC_RIGHT_MGR_CONNECT
= 0x0001,
231 SC_RIGHT_MGR_CREATE_SERVICE
= 0x0002,
232 SC_RIGHT_MGR_ENUMERATE_SERVICE
= 0x0004,
233 SC_RIGHT_MGR_LOCK
= 0x0008,
234 SC_RIGHT_MGR_QUERY_LOCK_STATUS
= 0x0010,
235 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG
= 0x0020
236 } svcctl_MgrAccessMask
;
238 WERROR svcctl_OpenSCManagerW
(
239 [in,unique] [string,charset
(UTF16
)] uint16
*MachineName
,
240 [in,unique] [string,charset
(UTF16
)] uint16
*DatabaseName
,
241 [in] svcctl_MgrAccessMask access_mask
,
242 [out,ref] policy_handle
*handle
247 typedef [bitmap32bit
] bitmap
{
248 SC_RIGHT_SVC_QUERY_CONFIG
= 0x0001,
249 SC_RIGHT_SVC_CHANGE_CONFIG
= 0x0002,
250 SC_RIGHT_SVC_QUERY_STATUS
= 0x0004,
251 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS
= 0x0008,
252 SC_RIGHT_SVC_START
= 0x0010,
253 SC_RIGHT_SVC_STOP
= 0x0020,
254 SC_RIGHT_SVC_PAUSE_CONTINUE
= 0x0040,
255 SC_RIGHT_SVC_INTERROGATE
= 0x0080,
256 SC_RIGHT_SVC_USER_DEFINED_CONTROL
= 0x0100
257 } svcctl_ServiceAccessMask
;
259 WERROR svcctl_OpenServiceW
(
260 [in,ref] policy_handle
*scmanager_handle
,
261 [in] [string,charset
(UTF16
)] uint16 ServiceName
[],
262 [in] svcctl_ServiceAccessMask access_mask
,
263 [out,ref] policy_handle
*handle
269 typedef [public,gensize
] struct {
272 uint32 error_control
;
273 [string,charset
(UTF16
)] [range(0,8192)] uint16
*executablepath
;
274 [string,charset
(UTF16
)] [range(0,8192)] uint16
*loadordergroup
;
276 [string,charset
(UTF16
)] [range(0,8192)] uint16
*dependencies
;
277 [string,charset
(UTF16
)] [range(0,8192)] uint16
*startname
;
278 [string,charset
(UTF16
)] [range(0,8192)] uint16
*displayname
;
279 } QUERY_SERVICE_CONFIG
;
281 WERROR svcctl_QueryServiceConfigW
(
282 [in,ref] policy_handle
*handle,
283 [out] QUERY_SERVICE_CONFIG
*query
,
284 [in] [range(0,8192)] uint32 buf_size
,
285 [out,ref] [range(0,8192)] uint32
*bytes_needed
290 WERROR svcctl_QueryServiceLockStatusW
(
291 [in,ref] policy_handle
*handle,
292 [in] uint32 buf_size
,
293 [out,ref] SERVICE_LOCK_STATUS
*lock_status
,
294 [out,ref] uint32
*required_buf_size
299 WERROR svcctl_StartServiceW
(
300 [in,ref] policy_handle
*handle,
302 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset
(UTF16
)] uint16
*Arguments
307 WERROR svcctl_GetServiceDisplayNameW
(
308 [in,ref] policy_handle
*handle,
309 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
310 [out,ref] [string,charset
(UTF16
)] uint16
**display_name
,
311 [in,out,unique] uint32
*display_name_length
316 WERROR svcctl_GetServiceKeyNameW
(
317 [in,ref] policy_handle
*handle,
318 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
319 [out,ref] [string,charset
(UTF16
)] uint16
**key_name
,
320 [in,out,unique] uint32
*display_name_length
325 WERROR svcctl_SCSetServiceBitsA
(
326 [in,ref] policy_handle
*handle,
328 [in] boolean32 bitson
,
329 [in] boolean32 immediate
334 WERROR svcctl_ChangeServiceConfigA
(
335 [in,ref] policy_handle
*handle,
339 [in,unique] [string,charset
(UTF16
)] uint16
*binary_path
,
340 [in,unique] [string,charset
(UTF16
)] uint16
*load_order_group
,
341 [out,ref] uint32
*tag_id
,
342 [in,unique] [string,charset
(UTF16
)] uint16
*dependencies
,
343 [in,unique] [string,charset
(UTF16
)] uint16
*service_start_name
,
344 [in,unique] [string,charset
(UTF16
)] uint16
*password
,
345 [in,unique] [string,charset
(UTF16
)] uint16
*display_name
350 WERROR svcctl_CreateServiceA
(
351 [in,ref] policy_handle
*handle,
352 [in,unique] [string,charset
(UTF16
)] uint16
*ServiceName
,
353 [in,unique] [string,charset
(UTF16
)] uint16
*DisplayName
,
354 [in] uint32 desired_access
,
356 [in] uint32 start_type
,
357 [in] uint32 error_control
,
358 [in,unique] [string,charset
(UTF16
)] uint16
*binary_path
,
359 [in,unique] [string,charset
(UTF16
)] uint16
*LoadOrderGroupKey
,
360 [out,unique] uint32
*TagId
,
361 [in,unique] [string,charset
(UTF16
)] uint16
*dependencies
,
362 [in,unique] [string,charset
(UTF16
)] uint16
*service_start_name
,
363 [in,unique] [string,charset
(UTF16
)] uint16
*password
368 WERROR svcctl_EnumDependentServicesA
(
369 [in,ref] policy_handle
*service
,
371 [out,unique] ENUM_SERVICE_STATUS
*service_status
,
372 [in] uint32 buf_size
,
373 [out,ref] uint32
*bytes_needed
,
374 [out,ref] uint32
*services_returned
379 WERROR svcctl_EnumServicesStatusA
(
380 [in,ref] policy_handle
*handle,
383 [in] uint32 buf_size
,
384 [out,size_is(buf_size
)] uint8 service
[*],
385 [out,ref] uint32
*bytes_needed
,
386 [out,ref] uint32
*services_returned
,
387 [in,out,unique] uint32
*resume_handle
392 WERROR svcctl_OpenSCManagerA
(
393 [in,unique] [string,charset
(UTF16
)] uint16
*MachineName
,
394 [in,unique] [string,charset
(UTF16
)] uint16
*DatabaseName
,
395 [in] uint32 access_mask
,
396 [out,ref] policy_handle
*handle
401 WERROR svcctl_OpenServiceA
(
402 [in,ref] policy_handle
*scmanager_handle
,
403 [in,unique] [string,charset
(UTF16
)] uint16
*ServiceName
,
404 [in] uint32 access_mask
409 WERROR svcctl_QueryServiceConfigA
(
410 [in,ref] policy_handle
*handle,
411 [out] uint8 query
[buf_size
], /*QUERYU_SERVICE_CONFIG */
412 [in] uint32 buf_size
,
413 [out,ref] uint32
*bytes_needed
418 WERROR svcctl_QueryServiceLockStatusA
(
419 [in,ref] policy_handle
*handle,
420 [in] uint32 buf_size
,
421 [out,ref] SERVICE_LOCK_STATUS
*lock_status
,
422 [out,ref] uint32
*required_buf_size
427 WERROR svcctl_StartServiceA
(
428 [in,ref] policy_handle
*handle,
430 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset
(UTF16
)] uint16
*Arguments
435 WERROR svcctl_GetServiceDisplayNameA
(
436 [in,ref] policy_handle
*handle,
437 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
438 [out,ref] [string,charset
(UTF16
)] uint16
**display_name
,
439 [in,out,unique] uint32
*display_name_length
444 WERROR svcctl_GetServiceKeyNameA
(
445 [in,ref] policy_handle
*handle,
446 [in,unique] [string,charset
(UTF16
)] uint16
*service_name
,
447 [out,ref] [string,charset
(UTF16
)] uint16
**key_name
,
448 [in,out,unique] uint32
*display_name_length
453 WERROR svcctl_GetCurrentGroupeStateW
(
458 WERROR svcctl_EnumServiceGroupW
(
463 WERROR svcctl_ChangeServiceConfig2A
(
464 [in,ref] policy_handle
*handle,
465 [in] uint32 info_level
,
466 [in,unique] uint8
*info
471 WERROR svcctl_ChangeServiceConfig2W
(
472 [in,ref] policy_handle
*handle,
473 [in] uint32 info_level
,
474 [in,unique] uint8
*info
479 WERROR svcctl_QueryServiceConfig2A
(
480 [in,ref] policy_handle
*handle,
481 [in] uint32 info_level
,
482 [out] uint8 buffer
[buf_size
],
483 [in] uint32 buf_size
,
484 [out,ref] uint32
*bytes_needed
489 WERROR svcctl_QueryServiceConfig2W
(
490 [in,ref] policy_handle
*handle,
491 [in] uint32 info_level
,
492 [out] uint8 buffer
[buf_size
],
493 [in] uint32 buf_size
,
494 [out,ref] uint32
*bytes_needed
499 WERROR svcctl_QueryServiceStatusEx
(
500 [in,ref] policy_handle
*handle,
501 [in] uint32 info_level
,
502 [out] uint8 buffer
[buf_size
],
503 [in] uint32 buf_size
,
504 [out,ref] uint32
*bytes_needed
509 WERROR EnumServicesStatusExA
(
510 [in,ref] policy_handle
*scmanager
,
511 [in] uint32 info_level
,
514 [out] uint8 services
[buf_size
],
515 [in] uint32 buf_size
,
516 [out,ref] uint32
*bytes_needed
,
517 [out,ref] uint32
*service_returned
,
518 [in,out,unique] uint32
*resume_handle
,
519 [out,ref] [string,charset
(UTF16
)] uint16
**group_name
524 WERROR EnumServicesStatusExW
(
525 [in,ref] policy_handle
*scmanager
,
526 [in] uint32 info_level
,
529 [out] uint8 services
[buf_size
],
530 [in] uint32 buf_size
,
531 [out,ref] uint32
*bytes_needed
,
532 [out,ref] uint32
*service_returned
,
533 [in,out,unique] uint32
*resume_handle
,
534 [out,ref] [string,charset
(UTF16
)] uint16
**group_name
539 WERROR svcctl_SCSendTSMessage
(