4 svcctl interface definitions
7 import "misc.idl", "security.idl";
8 [ uuid("367abb81-9844-35f1-ad32-98f038001003"),
10 pointer_default(unique),
11 endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"),
12 helpstring("Service Control")
17 [string,charset(UTF16)] uint16 *lock_owner;
19 } SERVICE_LOCK_STATUS;
24 uint32 controls_accepted;
25 WERROR win32_exit_code;
26 uint32 service_exit_code;
32 [relative] astring *service_name;
33 [relative] astring *display_name;
34 SERVICE_STATUS status;
35 } ENUM_SERVICE_STATUS;
37 const int SERVICE_TYPE_KERNEL_DRIVER = 0x01;
38 const int SERVICE_TYPE_FS_DRIVER = 0x02;
39 const int SERVICE_TYPE_ADAPTER = 0x04;
40 const int SERVICE_TYPE_RECOGNIZER_DRIVER = 0x08;
41 const int SERVICE_TYPE_DRIVER=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER;
42 const int SERVICE_TYPE_WIN32_OWN_PROCESS = 0x10;
43 const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
44 const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
46 const int SERVICE_STATE_ACTIVE = 0x01;
47 const int SERVICE_STATE_INACTIVE = 0x02;
48 const int SERVICE_STATE_ALL = 0x03;
50 typedef [public,bitmap32bit] bitmap {
51 SV_TYPE_WORKSTATION = 0x00000001,
52 SV_TYPE_SERVER = 0x00000002,
53 SV_TYPE_SQLSERVER = 0x00000004,
54 SV_TYPE_DOMAIN_CTRL = 0x00000008,
55 SV_TYPE_DOMAIN_BAKCTRL = 0x00000010,
56 SV_TYPE_TIME_SOURCE = 0x00000020,
57 SV_TYPE_AFP = 0x00000040,
58 SV_TYPE_NOVELL = 0x00000080,
60 SV_TYPE_DOMAIN_MEMBER = 0x00000100,
61 SV_TYPE_PRINTQ_SERVER = 0x00000200,
62 SV_TYPE_DIALIN_SERVER = 0x00000400,
63 SV_TYPE_SERVER_UNIX = 0x00000800,
64 SV_TYPE_NT = 0x00001000,
65 SV_TYPE_WFW = 0x00002000,
66 SV_TYPE_SERVER_MFPN = 0x00004000,
67 SV_TYPE_SERVER_NT = 0x00008000,
68 SV_TYPE_POTENTIAL_BROWSER = 0x00010000,
69 SV_TYPE_BACKUP_BROWSER = 0x00020000,
70 SV_TYPE_MASTER_BROWSER = 0x00040000,
71 SV_TYPE_DOMAIN_MASTER = 0x00080000,
72 SV_TYPE_SERVER_OSF = 0x00100000,
73 SV_TYPE_SERVER_VMS = 0x00200000,
74 SV_TYPE_WIN95_PLUS = 0x00400000,
75 SV_TYPE_DFS_SERVER = 0x00800000,
76 SV_TYPE_ALTERNATE_XPORT = 0x20000000,
77 SV_TYPE_LOCAL_LIST_ONLY = 0x40000000,
78 SV_TYPE_DOMAIN_ENUM = 0x80000000
81 const uint32 SV_TYPE_ALL = 0xFFFFFFFF;
85 WERROR svcctl_CloseServiceHandle(
86 [in,out,ref] policy_handle *handle
92 /* Service Controls */
94 typedef [v1_enum] enum {
95 SVCCTL_CONTROL_STOP = 0x00000001,
96 SVCCTL_CONTROL_PAUSE = 0x00000002,
97 SVCCTL_CONTROL_CONTINUE = 0x00000003,
98 SVCCTL_CONTROL_INTERROGATE = 0x00000004,
99 SVCCTL_CONTROL_SHUTDOWN = 0x00000005
102 WERROR svcctl_ControlService(
103 [in,ref] policy_handle *handle,
104 [in] SERVICE_CONTROL control,
105 [out,ref] SERVICE_STATUS *service_status
110 WERROR svcctl_DeleteService(
111 [in,ref] policy_handle *handle
117 WERROR svcctl_LockServiceDatabase(
118 [in,ref] policy_handle *handle,
119 [out,ref] policy_handle *lock
124 WERROR svcctl_QueryServiceObjectSecurity(
125 [in] policy_handle *handle,
126 [in] uint32 security_flags,
127 [out,ref,size_is(buffer_size)] uint8 *buffer,
128 [in,range(0,0x40000)] uint32 buffer_size,
129 [out,ref,range(0,0x40000)] uint32 *needed
134 WERROR svcctl_SetServiceObjectSecurity(
135 [in] policy_handle *handle,
136 [in] uint32 security_flags,
137 [in,ref,size_is(buffer_size)] uint8 *buffer,
138 [in] uint32 buffer_size
143 WERROR svcctl_QueryServiceStatus(
144 [in,ref] policy_handle *handle,
145 [out,ref] SERVICE_STATUS *service_status
150 [todo] WERROR svcctl_SetServiceStatus(
155 WERROR svcctl_UnlockServiceDatabase(
156 [in,out,ref] policy_handle *lock
161 [todo] WERROR svcctl_NotifyBootConfigStatus(
166 WERROR svcctl_SCSetServiceBitsW(
167 [in,ref] policy_handle *handle,
169 [in] boolean32 bitson,
170 [in] boolean32 immediate
175 WERROR svcctl_ChangeServiceConfigW(
176 [in,ref] policy_handle *handle,
180 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
181 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
182 [out,ref] uint32 *tag_id,
183 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
184 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
185 [in,unique] [string,charset(UTF16)] uint16 *password,
186 [in,unique] [string,charset(UTF16)] uint16 *display_name
191 WERROR svcctl_CreateServiceW(
192 [in,ref] policy_handle *scmanager_handle,
193 [in] [string,charset(UTF16)] uint16 ServiceName[],
194 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
195 [in] uint32 desired_access,
197 [in] uint32 start_type,
198 [in] uint32 error_control,
199 [in] [string,charset(UTF16)] uint16 binary_path[],
200 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
201 [in,out,unique] uint32 *TagId,
202 [in,unique,size_is(dependencies_size)] uint8 *dependencies,
203 [in] uint32 dependencies_size,
204 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
205 [in,unique,size_is(password_size)] uint8 *password,
206 [in] uint32 password_size,
207 [out,ref] policy_handle *handle
212 WERROR svcctl_EnumDependentServicesW(
213 [in,ref] policy_handle *service,
215 [out,ref,size_is(buf_size)] uint8 *service_status,
216 [in,range(0,0x40000)] uint32 buf_size,
217 [out,ref,range(0,0x40000)] uint32 *bytes_needed,
218 [out,ref,range(0,0x40000)] uint32 *services_returned
223 WERROR svcctl_EnumServicesStatusW(
224 [in,ref] policy_handle *handle,
227 [out,ref,size_is(buf_size)] uint8 *service,
228 [in] [range(0,262144)] uint32 buf_size,
229 [out,ref] [range(0,262144)] uint32 *bytes_needed,
230 [out,ref] [range(0,262144)] uint32 *services_returned,
231 [in,out,unique] uint32 *resume_handle
237 /* Service Control Manager Bits */
239 typedef [bitmap32bit] bitmap {
240 SC_RIGHT_MGR_CONNECT = 0x0001,
241 SC_RIGHT_MGR_CREATE_SERVICE = 0x0002,
242 SC_RIGHT_MGR_ENUMERATE_SERVICE = 0x0004,
243 SC_RIGHT_MGR_LOCK = 0x0008,
244 SC_RIGHT_MGR_QUERY_LOCK_STATUS = 0x0010,
245 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG = 0x0020
246 } svcctl_MgrAccessMask;
248 const int SC_MANAGER_READ_ACCESS =
249 (SEC_STD_READ_CONTROL |
250 SC_RIGHT_MGR_CONNECT |
251 SC_RIGHT_MGR_ENUMERATE_SERVICE |
252 SC_RIGHT_MGR_QUERY_LOCK_STATUS);
254 const int SC_MANAGER_EXECUTE_ACCESS = SC_MANAGER_READ_ACCESS;
256 const int SC_MANAGER_WRITE_ACCESS =
258 SC_MANAGER_READ_ACCESS |
259 SC_RIGHT_MGR_CREATE_SERVICE |
261 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG);
263 const int SC_MANAGER_ALL_ACCESS = SC_MANAGER_WRITE_ACCESS;
265 WERROR svcctl_OpenSCManagerW(
266 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
267 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
268 [in] svcctl_MgrAccessMask access_mask,
269 [out,ref] policy_handle *handle
275 /* Service Object Bits */
277 typedef [bitmap32bit] bitmap {
278 SC_RIGHT_SVC_QUERY_CONFIG = 0x0001,
279 SC_RIGHT_SVC_CHANGE_CONFIG = 0x0002,
280 SC_RIGHT_SVC_QUERY_STATUS = 0x0004,
281 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS = 0x0008,
282 SC_RIGHT_SVC_START = 0x0010,
283 SC_RIGHT_SVC_STOP = 0x0020,
284 SC_RIGHT_SVC_PAUSE_CONTINUE = 0x0040,
285 SC_RIGHT_SVC_INTERROGATE = 0x0080,
286 SC_RIGHT_SVC_USER_DEFINED_CONTROL = 0x0100
287 } svcctl_ServiceAccessMask;
289 const int SERVICE_READ_ACCESS =
290 (SEC_STD_READ_CONTROL |
291 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS |
292 SC_RIGHT_SVC_INTERROGATE |
293 SC_RIGHT_SVC_QUERY_CONFIG |
294 SC_RIGHT_SVC_QUERY_STATUS |
295 SC_RIGHT_SVC_USER_DEFINED_CONTROL);
297 const int SERVICE_EXECUTE_ACCESS =
298 (SERVICE_READ_ACCESS |
301 SC_RIGHT_SVC_PAUSE_CONTINUE);
303 const int SERVICE_WRITE_ACCESS =
305 SERVICE_READ_ACCESS |
306 SERVICE_EXECUTE_ACCESS |
307 SC_RIGHT_SVC_CHANGE_CONFIG);
309 const int SERVICE_ALL_ACCESS = SERVICE_WRITE_ACCESS;
311 WERROR svcctl_OpenServiceW(
312 [in,ref] policy_handle *scmanager_handle,
313 [in] [string,charset(UTF16)] uint16 ServiceName[],
314 [in] svcctl_ServiceAccessMask access_mask,
315 [out,ref] policy_handle *handle
321 typedef [public,gensize] struct {
324 uint32 error_control;
325 [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
326 [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
328 [string,charset(UTF16)] [range(0,8192)] uint16 *dependencies;
329 [string,charset(UTF16)] [range(0,8192)] uint16 *startname;
330 [string,charset(UTF16)] [range(0,8192)] uint16 *displayname;
331 } QUERY_SERVICE_CONFIG;
333 WERROR svcctl_QueryServiceConfigW(
334 [in,ref] policy_handle *handle,
335 [out] QUERY_SERVICE_CONFIG *query,
336 [in] [range(0,8192)] uint32 buf_size,
337 [out,ref] [range(0,8192)] uint32 *bytes_needed
342 WERROR svcctl_QueryServiceLockStatusW(
343 [in,ref] policy_handle *handle,
344 [in] uint32 buf_size,
345 [out,ref] SERVICE_LOCK_STATUS *lock_status,
346 [out,ref] uint32 *required_buf_size
351 WERROR svcctl_StartServiceW(
352 [in,ref] policy_handle *handle,
354 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
359 WERROR svcctl_GetServiceDisplayNameW(
360 [in,ref] policy_handle *handle,
361 [in,unique] [string,charset(UTF16)] uint16 *service_name,
362 [out,ref] [string,charset(UTF16)] uint16 **display_name,
363 [in,out,unique] uint32 *display_name_length
368 WERROR svcctl_GetServiceKeyNameW(
369 [in,ref] policy_handle *handle,
370 [in,unique] [string,charset(UTF16)] uint16 *service_name,
371 [out,ref] [string,charset(UTF16)] uint16 **key_name,
372 [in,out,unique] uint32 *display_name_length
377 WERROR svcctl_SCSetServiceBitsA(
378 [in,ref] policy_handle *handle,
380 [in] boolean32 bitson,
381 [in] boolean32 immediate
386 WERROR svcctl_ChangeServiceConfigA(
387 [in,ref] policy_handle *handle,
391 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
392 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
393 [out,ref] uint32 *tag_id,
394 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
395 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
396 [in,unique] [string,charset(UTF16)] uint16 *password,
397 [in,unique] [string,charset(UTF16)] uint16 *display_name
402 WERROR svcctl_CreateServiceA(
403 [in,ref] policy_handle *handle,
404 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
405 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
406 [in] uint32 desired_access,
408 [in] uint32 start_type,
409 [in] uint32 error_control,
410 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
411 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
412 [out,unique] uint32 *TagId,
413 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
414 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
415 [in,unique] [string,charset(UTF16)] uint16 *password
420 WERROR svcctl_EnumDependentServicesA(
421 [in,ref] policy_handle *service,
423 [out,unique] ENUM_SERVICE_STATUS *service_status,
424 [in] uint32 buf_size,
425 [out,ref] uint32 *bytes_needed,
426 [out,ref] uint32 *services_returned
431 WERROR svcctl_EnumServicesStatusA(
432 [in,ref] policy_handle *handle,
435 [in] uint32 buf_size,
436 [out,size_is(buf_size)] uint8 service[*],
437 [out,ref] uint32 *bytes_needed,
438 [out,ref] uint32 *services_returned,
439 [in,out,unique] uint32 *resume_handle
444 WERROR svcctl_OpenSCManagerA(
445 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
446 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
447 [in] uint32 access_mask,
448 [out,ref] policy_handle *handle
453 WERROR svcctl_OpenServiceA(
454 [in,ref] policy_handle *scmanager_handle,
455 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
456 [in] uint32 access_mask
461 WERROR svcctl_QueryServiceConfigA(
462 [in,ref] policy_handle *handle,
463 [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
464 [in] uint32 buf_size,
465 [out,ref] uint32 *bytes_needed
470 WERROR svcctl_QueryServiceLockStatusA(
471 [in,ref] policy_handle *handle,
472 [in] uint32 buf_size,
473 [out,ref] SERVICE_LOCK_STATUS *lock_status,
474 [out,ref] uint32 *required_buf_size
479 WERROR svcctl_StartServiceA(
480 [in,ref] policy_handle *handle,
482 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
487 WERROR svcctl_GetServiceDisplayNameA(
488 [in,ref] policy_handle *handle,
489 [in,unique] [string,charset(UTF16)] uint16 *service_name,
490 [out,ref] [string,charset(UTF16)] uint16 **display_name,
491 [in,out,unique] uint32 *display_name_length
496 WERROR svcctl_GetServiceKeyNameA(
497 [in,ref] policy_handle *handle,
498 [in,unique] [string,charset(UTF16)] uint16 *service_name,
499 [out,ref] [string,charset(UTF16)] uint16 **key_name,
500 [in,out,unique] uint32 *display_name_length
505 [todo] WERROR svcctl_GetCurrentGroupeStateW(
510 [todo] WERROR svcctl_EnumServiceGroupW(
515 WERROR svcctl_ChangeServiceConfig2A(
516 [in,ref] policy_handle *handle,
517 [in] uint32 info_level,
518 [in,unique] uint8 *info
523 WERROR svcctl_ChangeServiceConfig2W(
524 [in,ref] policy_handle *handle,
525 [in] uint32 info_level,
526 [in,unique] uint8 *info
531 WERROR svcctl_QueryServiceConfig2A(
532 [in,ref] policy_handle *handle,
533 [in] uint32 info_level,
534 [out] uint8 buffer[buf_size],
535 [in] uint32 buf_size,
536 [out,ref] uint32 *bytes_needed
541 WERROR svcctl_QueryServiceConfig2W(
542 [in,ref] policy_handle *handle,
543 [in] uint32 info_level,
544 [out,ref,size_is(buf_size)] uint8 *buffer,
545 [in] [range(0,8192)] uint32 buf_size,
546 [out,ref] [range(0,8192)] uint32 *bytes_needed
552 typedef [v1_enum] enum {
553 SVC_STATUS_PROCESS_INFO = 0x00000000
554 } svcctl_StatusLevel;
556 WERROR svcctl_QueryServiceStatusEx(
557 [in,ref] policy_handle *handle,
558 [in] svcctl_StatusLevel info_level,
559 [out,ref,size_is(buf_size)] uint8 *buffer,
560 [in] [range(0,8192)] uint32 buf_size,
561 [out,ref] [range(0,8192)] uint32 *bytes_needed
566 WERROR EnumServicesStatusExA(
567 [in,ref] policy_handle *scmanager,
568 [in] uint32 info_level,
571 [out] uint8 services[buf_size],
572 [in] uint32 buf_size,
573 [out,ref] uint32 *bytes_needed,
574 [out,ref] uint32 *service_returned,
575 [in,out,unique] uint32 *resume_handle,
576 [out,ref] [string,charset(UTF16)] uint16 **group_name
581 WERROR EnumServicesStatusExW(
582 [in,ref] policy_handle *scmanager,
583 [in] uint32 info_level,
586 [out,ref,size_is(buf_size)] uint8 *services,
587 [in] [range(0,262144)] uint32 buf_size,
588 [out,ref] [range(0,262144)] uint32 *bytes_needed,
589 [out,ref] [range(0,262144)] uint32 *service_returned,
590 [in,out,unique] [range(0,262144)] uint32 *resume_handle,
591 [in,unique] [string,charset(UTF16)] uint16 *group_name
596 [todo] WERROR svcctl_SCSendTSMessage(