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;
31 typedef [public] struct {
32 SERVICE_STATUS status;
35 } SERVICE_STATUS_PROCESS;
38 [relative] astring *service_name;
39 [relative] astring *display_name;
40 SERVICE_STATUS status;
41 } ENUM_SERVICE_STATUS;
43 const int SERVICE_TYPE_KERNEL_DRIVER = 0x01;
44 const int SERVICE_TYPE_FS_DRIVER = 0x02;
45 const int SERVICE_TYPE_ADAPTER = 0x04;
46 const int SERVICE_TYPE_RECOGNIZER_DRIVER = 0x08;
47 const int SERVICE_TYPE_DRIVER=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER;
48 const int SERVICE_TYPE_WIN32_OWN_PROCESS = 0x10;
49 const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
50 const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
52 const int SERVICE_STATE_ACTIVE = 0x01;
53 const int SERVICE_STATE_INACTIVE = 0x02;
54 const int SERVICE_STATE_ALL = 0x03;
56 typedef [public,bitmap32bit] bitmap {
57 SV_TYPE_WORKSTATION = 0x00000001,
58 SV_TYPE_SERVER = 0x00000002,
59 SV_TYPE_SQLSERVER = 0x00000004,
60 SV_TYPE_DOMAIN_CTRL = 0x00000008,
61 SV_TYPE_DOMAIN_BAKCTRL = 0x00000010,
62 SV_TYPE_TIME_SOURCE = 0x00000020,
63 SV_TYPE_AFP = 0x00000040,
64 SV_TYPE_NOVELL = 0x00000080,
66 SV_TYPE_DOMAIN_MEMBER = 0x00000100,
67 SV_TYPE_PRINTQ_SERVER = 0x00000200,
68 SV_TYPE_DIALIN_SERVER = 0x00000400,
69 SV_TYPE_SERVER_UNIX = 0x00000800,
70 SV_TYPE_NT = 0x00001000,
71 SV_TYPE_WFW = 0x00002000,
72 SV_TYPE_SERVER_MFPN = 0x00004000,
73 SV_TYPE_SERVER_NT = 0x00008000,
74 SV_TYPE_POTENTIAL_BROWSER = 0x00010000,
75 SV_TYPE_BACKUP_BROWSER = 0x00020000,
76 SV_TYPE_MASTER_BROWSER = 0x00040000,
77 SV_TYPE_DOMAIN_MASTER = 0x00080000,
78 SV_TYPE_SERVER_OSF = 0x00100000,
79 SV_TYPE_SERVER_VMS = 0x00200000,
80 SV_TYPE_WIN95_PLUS = 0x00400000,
81 SV_TYPE_DFS_SERVER = 0x00800000,
82 SV_TYPE_ALTERNATE_XPORT = 0x20000000,
83 SV_TYPE_LOCAL_LIST_ONLY = 0x40000000,
84 SV_TYPE_DOMAIN_ENUM = 0x80000000
87 const uint32 SV_TYPE_ALL = 0xFFFFFFFF;
91 WERROR svcctl_CloseServiceHandle(
92 [in,out,ref] policy_handle *handle
98 /* Service Controls */
100 typedef [v1_enum] enum {
101 SVCCTL_CONTROL_STOP = 0x00000001,
102 SVCCTL_CONTROL_PAUSE = 0x00000002,
103 SVCCTL_CONTROL_CONTINUE = 0x00000003,
104 SVCCTL_CONTROL_INTERROGATE = 0x00000004,
105 SVCCTL_CONTROL_SHUTDOWN = 0x00000005
108 WERROR svcctl_ControlService(
109 [in,ref] policy_handle *handle,
110 [in] SERVICE_CONTROL control,
111 [out,ref] SERVICE_STATUS *service_status
116 WERROR svcctl_DeleteService(
117 [in,ref] policy_handle *handle
123 WERROR svcctl_LockServiceDatabase(
124 [in,ref] policy_handle *handle,
125 [out,ref] policy_handle *lock
130 WERROR svcctl_QueryServiceObjectSecurity(
131 [in] policy_handle *handle,
132 [in] uint32 security_flags,
133 [out,ref,size_is(buffer_size)] uint8 *buffer,
134 [in,range(0,0x40000)] uint32 buffer_size,
135 [out,ref,range(0,0x40000)] uint32 *needed
140 WERROR svcctl_SetServiceObjectSecurity(
141 [in] policy_handle *handle,
142 [in] uint32 security_flags,
143 [in,ref,size_is(buffer_size)] uint8 *buffer,
144 [in] uint32 buffer_size
149 WERROR svcctl_QueryServiceStatus(
150 [in,ref] policy_handle *handle,
151 [out,ref] SERVICE_STATUS *service_status
156 [todo] WERROR svcctl_SetServiceStatus(
161 WERROR svcctl_UnlockServiceDatabase(
162 [in,out,ref] policy_handle *lock
167 [todo] WERROR svcctl_NotifyBootConfigStatus(
172 WERROR svcctl_SCSetServiceBitsW(
173 [in,ref] policy_handle *handle,
175 [in] boolean32 bitson,
176 [in] boolean32 immediate
182 typedef [v1_enum] enum {
183 SVCCTL_SVC_ERROR_IGNORE = 0x00000000,
184 SVCCTL_SVC_ERROR_NORMAL = 0x00000001,
185 SVCCTL_SVC_ERROR_CRITICAL = 0x00000002,
186 SVCCTL_SVC_ERROR_SEVERE = 0x00000003
187 } svcctl_ErrorControl;
189 typedef [v1_enum] enum {
190 SVCCTL_BOOT_START = 0x00000000,
191 SVCCTL_SYSTEM_START = 0x00000001,
192 SVCCTL_AUTO_START = 0x00000002,
193 SVCCTL_DEMAND_START = 0x00000003,
194 SVCCTL_DISABLED = 0x00000004
197 WERROR svcctl_ChangeServiceConfigW(
198 [in,ref] policy_handle *handle,
200 [in] svcctl_StartType start_type,
201 [in] svcctl_ErrorControl error_control,
202 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
203 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
204 [out,ref] uint32 *tag_id,
205 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
206 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
207 [in,unique] [string,charset(UTF16)] uint16 *password,
208 [in,unique] [string,charset(UTF16)] uint16 *display_name
213 WERROR svcctl_CreateServiceW(
214 [in,ref] policy_handle *scmanager_handle,
215 [in] [string,charset(UTF16)] uint16 ServiceName[],
216 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
217 [in] uint32 desired_access,
219 [in] svcctl_StartType start_type,
220 [in] svcctl_ErrorControl error_control,
221 [in] [string,charset(UTF16)] uint16 binary_path[],
222 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
223 [in,out,unique] uint32 *TagId,
224 [in,unique,size_is(dependencies_size)] uint8 *dependencies,
225 [in] uint32 dependencies_size,
226 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
227 [in,unique,size_is(password_size)] uint8 *password,
228 [in] uint32 password_size,
229 [out,ref] policy_handle *handle
234 WERROR svcctl_EnumDependentServicesW(
235 [in,ref] policy_handle *service,
237 [out,ref,size_is(buf_size)] uint8 *service_status,
238 [in,range(0,0x40000)] uint32 buf_size,
239 [out,ref,range(0,0x40000)] uint32 *bytes_needed,
240 [out,ref,range(0,0x40000)] uint32 *services_returned
245 WERROR svcctl_EnumServicesStatusW(
246 [in,ref] policy_handle *handle,
249 [out,ref,size_is(buf_size)] uint8 *service,
250 [in] [range(0,262144)] uint32 buf_size,
251 [out,ref] [range(0,262144)] uint32 *bytes_needed,
252 [out,ref] [range(0,262144)] uint32 *services_returned,
253 [in,out,unique] uint32 *resume_handle
259 /* Service Control Manager Bits */
261 typedef [bitmap32bit] bitmap {
262 SC_RIGHT_MGR_CONNECT = 0x0001,
263 SC_RIGHT_MGR_CREATE_SERVICE = 0x0002,
264 SC_RIGHT_MGR_ENUMERATE_SERVICE = 0x0004,
265 SC_RIGHT_MGR_LOCK = 0x0008,
266 SC_RIGHT_MGR_QUERY_LOCK_STATUS = 0x0010,
267 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG = 0x0020
268 } svcctl_MgrAccessMask;
270 const int SC_MANAGER_READ_ACCESS =
271 (SEC_STD_READ_CONTROL |
272 SC_RIGHT_MGR_CONNECT |
273 SC_RIGHT_MGR_ENUMERATE_SERVICE |
274 SC_RIGHT_MGR_QUERY_LOCK_STATUS);
276 const int SC_MANAGER_EXECUTE_ACCESS = SC_MANAGER_READ_ACCESS;
278 const int SC_MANAGER_WRITE_ACCESS =
280 SC_MANAGER_READ_ACCESS |
281 SC_RIGHT_MGR_CREATE_SERVICE |
283 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG);
285 const int SC_MANAGER_ALL_ACCESS = SC_MANAGER_WRITE_ACCESS;
287 WERROR svcctl_OpenSCManagerW(
288 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
289 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
290 [in] svcctl_MgrAccessMask access_mask,
291 [out,ref] policy_handle *handle
297 /* Service Object Bits */
299 typedef [bitmap32bit] bitmap {
300 SC_RIGHT_SVC_QUERY_CONFIG = 0x0001,
301 SC_RIGHT_SVC_CHANGE_CONFIG = 0x0002,
302 SC_RIGHT_SVC_QUERY_STATUS = 0x0004,
303 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS = 0x0008,
304 SC_RIGHT_SVC_START = 0x0010,
305 SC_RIGHT_SVC_STOP = 0x0020,
306 SC_RIGHT_SVC_PAUSE_CONTINUE = 0x0040,
307 SC_RIGHT_SVC_INTERROGATE = 0x0080,
308 SC_RIGHT_SVC_USER_DEFINED_CONTROL = 0x0100
309 } svcctl_ServiceAccessMask;
311 const int SERVICE_READ_ACCESS =
312 (SEC_STD_READ_CONTROL |
313 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS |
314 SC_RIGHT_SVC_INTERROGATE |
315 SC_RIGHT_SVC_QUERY_CONFIG |
316 SC_RIGHT_SVC_QUERY_STATUS |
317 SC_RIGHT_SVC_USER_DEFINED_CONTROL);
319 const int SERVICE_EXECUTE_ACCESS =
320 (SERVICE_READ_ACCESS |
323 SC_RIGHT_SVC_PAUSE_CONTINUE);
325 const int SERVICE_WRITE_ACCESS =
327 SERVICE_READ_ACCESS |
328 SERVICE_EXECUTE_ACCESS |
329 SC_RIGHT_SVC_CHANGE_CONFIG);
331 const int SERVICE_ALL_ACCESS = SERVICE_WRITE_ACCESS;
333 WERROR svcctl_OpenServiceW(
334 [in,ref] policy_handle *scmanager_handle,
335 [in] [string,charset(UTF16)] uint16 ServiceName[],
336 [in] svcctl_ServiceAccessMask access_mask,
337 [out,ref] policy_handle *handle
343 typedef [public,gensize] struct {
345 svcctl_StartType start_type;
346 svcctl_ErrorControl error_control;
347 [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
348 [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
350 [string,charset(UTF16)] [range(0,8192)] uint16 *dependencies;
351 [string,charset(UTF16)] [range(0,8192)] uint16 *startname;
352 [string,charset(UTF16)] [range(0,8192)] uint16 *displayname;
353 } QUERY_SERVICE_CONFIG;
355 WERROR svcctl_QueryServiceConfigW(
356 [in,ref] policy_handle *handle,
357 [out] QUERY_SERVICE_CONFIG *query,
358 [in] [range(0,8192)] uint32 buf_size,
359 [out,ref] [range(0,8192)] uint32 *bytes_needed
364 WERROR svcctl_QueryServiceLockStatusW(
365 [in,ref] policy_handle *handle,
366 [in] uint32 buf_size,
367 [out,ref] SERVICE_LOCK_STATUS *lock_status,
368 [out,ref] uint32 *required_buf_size
373 WERROR svcctl_StartServiceW(
374 [in,ref] policy_handle *handle,
376 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
381 WERROR svcctl_GetServiceDisplayNameW(
382 [in,ref] policy_handle *handle,
383 [in,unique] [string,charset(UTF16)] uint16 *service_name,
384 [out,ref] [string,charset(UTF16)] uint16 **display_name,
385 [in,out,unique] uint32 *display_name_length
390 WERROR svcctl_GetServiceKeyNameW(
391 [in,ref] policy_handle *handle,
392 [in,unique] [string,charset(UTF16)] uint16 *service_name,
393 [out,ref] [string,charset(UTF16)] uint16 **key_name,
394 [in,out,unique] uint32 *display_name_length
399 WERROR svcctl_SCSetServiceBitsA(
400 [in,ref] policy_handle *handle,
402 [in] boolean32 bitson,
403 [in] boolean32 immediate
408 WERROR svcctl_ChangeServiceConfigA(
409 [in,ref] policy_handle *handle,
411 [in] svcctl_StartType start_type,
412 [in] svcctl_ErrorControl error_control,
413 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
414 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
415 [out,ref] uint32 *tag_id,
416 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
417 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
418 [in,unique] [string,charset(UTF16)] uint16 *password,
419 [in,unique] [string,charset(UTF16)] uint16 *display_name
424 WERROR svcctl_CreateServiceA(
425 [in,ref] policy_handle *handle,
426 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
427 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
428 [in] uint32 desired_access,
430 [in] svcctl_StartType start_type,
431 [in] svcctl_ErrorControl error_control,
432 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
433 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
434 [out,unique] uint32 *TagId,
435 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
436 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
437 [in,unique] [string,charset(UTF16)] uint16 *password
442 WERROR svcctl_EnumDependentServicesA(
443 [in,ref] policy_handle *service,
445 [out,unique] ENUM_SERVICE_STATUS *service_status,
446 [in] uint32 buf_size,
447 [out,ref] uint32 *bytes_needed,
448 [out,ref] uint32 *services_returned
453 WERROR svcctl_EnumServicesStatusA(
454 [in,ref] policy_handle *handle,
457 [in] uint32 buf_size,
458 [out,size_is(buf_size)] uint8 service[*],
459 [out,ref] uint32 *bytes_needed,
460 [out,ref] uint32 *services_returned,
461 [in,out,unique] uint32 *resume_handle
466 WERROR svcctl_OpenSCManagerA(
467 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
468 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
469 [in] uint32 access_mask,
470 [out,ref] policy_handle *handle
475 WERROR svcctl_OpenServiceA(
476 [in,ref] policy_handle *scmanager_handle,
477 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
478 [in] uint32 access_mask
483 WERROR svcctl_QueryServiceConfigA(
484 [in,ref] policy_handle *handle,
485 [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
486 [in] uint32 buf_size,
487 [out,ref] uint32 *bytes_needed
492 WERROR svcctl_QueryServiceLockStatusA(
493 [in,ref] policy_handle *handle,
494 [in] uint32 buf_size,
495 [out,ref] SERVICE_LOCK_STATUS *lock_status,
496 [out,ref] uint32 *required_buf_size
501 WERROR svcctl_StartServiceA(
502 [in,ref] policy_handle *handle,
504 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
509 WERROR svcctl_GetServiceDisplayNameA(
510 [in,ref] policy_handle *handle,
511 [in,unique] [string,charset(UTF16)] uint16 *service_name,
512 [out,ref] [string,charset(UTF16)] uint16 **display_name,
513 [in,out,unique] uint32 *display_name_length
518 WERROR svcctl_GetServiceKeyNameA(
519 [in,ref] policy_handle *handle,
520 [in,unique] [string,charset(UTF16)] uint16 *service_name,
521 [out,ref] [string,charset(UTF16)] uint16 **key_name,
522 [in,out,unique] uint32 *display_name_length
527 [todo] WERROR svcctl_GetCurrentGroupeStateW(
532 [todo] WERROR svcctl_EnumServiceGroupW(
537 WERROR svcctl_ChangeServiceConfig2A(
538 [in,ref] policy_handle *handle,
539 [in] uint32 info_level,
540 [in,unique] uint8 *info
545 WERROR svcctl_ChangeServiceConfig2W(
546 [in,ref] policy_handle *handle,
547 [in] uint32 info_level,
548 [in,unique] uint8 *info
554 typedef [v1_enum] enum {
555 SERVICE_CONFIG_DESCRIPTION = 0x00000001,
556 SERVICE_CONFIG_FAILURE_ACTIONS = 0x00000002
557 } svcctl_ConfigLevel;
559 WERROR svcctl_QueryServiceConfig2A(
560 [in,ref] policy_handle *handle,
561 [in] svcctl_ConfigLevel info_level,
562 [out] uint8 buffer[buf_size],
563 [in] uint32 buf_size,
564 [out,ref] uint32 *bytes_needed
569 WERROR svcctl_QueryServiceConfig2W(
570 [in,ref] policy_handle *handle,
571 [in] svcctl_ConfigLevel info_level,
572 [out,ref,size_is(buf_size)] uint8 *buffer,
573 [in] [range(0,8192)] uint32 buf_size,
574 [out,ref] [range(0,8192)] uint32 *bytes_needed
580 typedef [v1_enum] enum {
581 SVC_STATUS_PROCESS_INFO = 0x00000000
582 } svcctl_StatusLevel;
584 WERROR svcctl_QueryServiceStatusEx(
585 [in,ref] policy_handle *handle,
586 [in] svcctl_StatusLevel info_level,
587 [out,ref,size_is(buf_size)] uint8 *buffer,
588 [in] [range(0,8192)] uint32 buf_size,
589 [out,ref] [range(0,8192)] uint32 *bytes_needed
594 WERROR EnumServicesStatusExA(
595 [in,ref] policy_handle *scmanager,
596 [in] uint32 info_level,
599 [out] uint8 services[buf_size],
600 [in] uint32 buf_size,
601 [out,ref] uint32 *bytes_needed,
602 [out,ref] uint32 *service_returned,
603 [in,out,unique] uint32 *resume_handle,
604 [out,ref] [string,charset(UTF16)] uint16 **group_name
609 WERROR EnumServicesStatusExW(
610 [in,ref] policy_handle *scmanager,
611 [in] uint32 info_level,
614 [out,ref,size_is(buf_size)] uint8 *services,
615 [in] [range(0,262144)] uint32 buf_size,
616 [out,ref] [range(0,262144)] uint32 *bytes_needed,
617 [out,ref] [range(0,262144)] uint32 *service_returned,
618 [in,out,unique] [range(0,262144)] uint32 *resume_handle,
619 [in,unique] [string,charset(UTF16)] uint16 *group_name
624 [todo] WERROR svcctl_SCSendTSMessage(