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
96 WERROR svcctl_ControlService(
97 [in,ref] policy_handle *handle,
99 [out,ref] SERVICE_STATUS *service_status
104 WERROR svcctl_DeleteService(
105 [in,ref] policy_handle *handle
111 WERROR svcctl_LockServiceDatabase(
112 [in,ref] policy_handle *handle,
113 [out,ref] policy_handle *lock
118 WERROR svcctl_QueryServiceObjectSecurity(
119 [in] policy_handle *handle,
120 [in] uint32 security_flags,
121 [out,ref,size_is(buffer_size)] uint8 *buffer,
122 [in,range(0,0x40000)] uint32 buffer_size,
123 [out,ref,range(0,0x40000)] uint32 *needed
128 WERROR svcctl_SetServiceObjectSecurity(
129 [in] policy_handle *handle,
130 [in] uint32 security_flags,
131 [in,ref,size_is(buffer_size)] uint8 *buffer,
132 [in] uint32 buffer_size
137 WERROR svcctl_QueryServiceStatus(
138 [in,ref] policy_handle *handle,
139 [out,ref] SERVICE_STATUS *service_status
144 [todo] WERROR svcctl_SetServiceStatus(
149 WERROR svcctl_UnlockServiceDatabase(
150 [in,out,ref] policy_handle *lock
155 [todo] WERROR svcctl_NotifyBootConfigStatus(
160 WERROR svcctl_SCSetServiceBitsW(
161 [in,ref] policy_handle *handle,
163 [in] boolean32 bitson,
164 [in] boolean32 immediate
169 WERROR svcctl_ChangeServiceConfigW(
170 [in,ref] policy_handle *handle,
174 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
175 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
176 [out,ref] uint32 *tag_id,
177 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
178 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
179 [in,unique] [string,charset(UTF16)] uint16 *password,
180 [in,unique] [string,charset(UTF16)] uint16 *display_name
185 WERROR svcctl_CreateServiceW(
186 [in,ref] policy_handle *scmanager_handle,
187 [in] [string,charset(UTF16)] uint16 ServiceName[],
188 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
189 [in] uint32 desired_access,
191 [in] uint32 start_type,
192 [in] uint32 error_control,
193 [in] [string,charset(UTF16)] uint16 binary_path[],
194 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
195 [in,out,unique] uint32 *TagId,
196 [in,unique,size_is(dependencies_size)] uint8 *dependencies,
197 [in] uint32 dependencies_size,
198 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
199 [in,unique,size_is(password_size)] uint8 *password,
200 [in] uint32 password_size,
201 [out,ref] policy_handle *handle
206 WERROR svcctl_EnumDependentServicesW(
207 [in,ref] policy_handle *service,
209 [out,ref,size_is(buf_size)] uint8 *service_status,
210 [in,range(0,0x40000)] uint32 buf_size,
211 [out,ref,range(0,0x40000)] uint32 *bytes_needed,
212 [out,ref,range(0,0x40000)] uint32 *services_returned
217 WERROR svcctl_EnumServicesStatusW(
218 [in,ref] policy_handle *handle,
221 [in] uint32 buf_size,
222 [out,size_is(buf_size)] uint8 service[*],
223 [out,ref] uint32 *bytes_needed,
224 [out,ref] uint32 *services_returned,
225 [in,out,unique] uint32 *resume_handle
231 /* Service Control Manager Bits */
233 typedef [bitmap32bit] bitmap {
234 SC_RIGHT_MGR_CONNECT = 0x0001,
235 SC_RIGHT_MGR_CREATE_SERVICE = 0x0002,
236 SC_RIGHT_MGR_ENUMERATE_SERVICE = 0x0004,
237 SC_RIGHT_MGR_LOCK = 0x0008,
238 SC_RIGHT_MGR_QUERY_LOCK_STATUS = 0x0010,
239 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG = 0x0020
240 } svcctl_MgrAccessMask;
242 const int SC_MANAGER_READ_ACCESS =
243 (SEC_STD_READ_CONTROL |
244 SC_RIGHT_MGR_CONNECT |
245 SC_RIGHT_MGR_ENUMERATE_SERVICE |
246 SC_RIGHT_MGR_QUERY_LOCK_STATUS);
248 const int SC_MANAGER_EXECUTE_ACCESS = SC_MANAGER_READ_ACCESS;
250 const int SC_MANAGER_WRITE_ACCESS =
252 SC_MANAGER_READ_ACCESS |
253 SC_RIGHT_MGR_CREATE_SERVICE |
255 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG);
257 const int SC_MANAGER_ALL_ACCESS = SC_MANAGER_WRITE_ACCESS;
259 WERROR svcctl_OpenSCManagerW(
260 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
261 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
262 [in] svcctl_MgrAccessMask access_mask,
263 [out,ref] policy_handle *handle
269 /* Service Object Bits */
271 typedef [bitmap32bit] bitmap {
272 SC_RIGHT_SVC_QUERY_CONFIG = 0x0001,
273 SC_RIGHT_SVC_CHANGE_CONFIG = 0x0002,
274 SC_RIGHT_SVC_QUERY_STATUS = 0x0004,
275 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS = 0x0008,
276 SC_RIGHT_SVC_START = 0x0010,
277 SC_RIGHT_SVC_STOP = 0x0020,
278 SC_RIGHT_SVC_PAUSE_CONTINUE = 0x0040,
279 SC_RIGHT_SVC_INTERROGATE = 0x0080,
280 SC_RIGHT_SVC_USER_DEFINED_CONTROL = 0x0100
281 } svcctl_ServiceAccessMask;
283 const int SERVICE_READ_ACCESS =
284 (SEC_STD_READ_CONTROL |
285 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS |
286 SC_RIGHT_SVC_INTERROGATE |
287 SC_RIGHT_SVC_QUERY_CONFIG |
288 SC_RIGHT_SVC_QUERY_STATUS |
289 SC_RIGHT_SVC_USER_DEFINED_CONTROL);
291 const int SERVICE_EXECUTE_ACCESS =
292 (SERVICE_READ_ACCESS |
295 SC_RIGHT_SVC_PAUSE_CONTINUE);
297 const int SERVICE_WRITE_ACCESS =
299 SERVICE_READ_ACCESS |
300 SERVICE_EXECUTE_ACCESS |
301 SC_RIGHT_SVC_CHANGE_CONFIG);
303 const int SERVICE_ALL_ACCESS = SERVICE_WRITE_ACCESS;
305 WERROR svcctl_OpenServiceW(
306 [in,ref] policy_handle *scmanager_handle,
307 [in] [string,charset(UTF16)] uint16 ServiceName[],
308 [in] svcctl_ServiceAccessMask access_mask,
309 [out,ref] policy_handle *handle
315 typedef [public,gensize] struct {
318 uint32 error_control;
319 [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
320 [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
322 [string,charset(UTF16)] [range(0,8192)] uint16 *dependencies;
323 [string,charset(UTF16)] [range(0,8192)] uint16 *startname;
324 [string,charset(UTF16)] [range(0,8192)] uint16 *displayname;
325 } QUERY_SERVICE_CONFIG;
327 WERROR svcctl_QueryServiceConfigW(
328 [in,ref] policy_handle *handle,
329 [out] QUERY_SERVICE_CONFIG *query,
330 [in] [range(0,8192)] uint32 buf_size,
331 [out,ref] [range(0,8192)] uint32 *bytes_needed
336 WERROR svcctl_QueryServiceLockStatusW(
337 [in,ref] policy_handle *handle,
338 [in] uint32 buf_size,
339 [out,ref] SERVICE_LOCK_STATUS *lock_status,
340 [out,ref] uint32 *required_buf_size
345 WERROR svcctl_StartServiceW(
346 [in,ref] policy_handle *handle,
348 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
353 WERROR svcctl_GetServiceDisplayNameW(
354 [in,ref] policy_handle *handle,
355 [in,unique] [string,charset(UTF16)] uint16 *service_name,
356 [out,ref] [string,charset(UTF16)] uint16 **display_name,
357 [in,out,unique] uint32 *display_name_length
362 WERROR svcctl_GetServiceKeyNameW(
363 [in,ref] policy_handle *handle,
364 [in,unique] [string,charset(UTF16)] uint16 *service_name,
365 [out,ref] [string,charset(UTF16)] uint16 **key_name,
366 [in,out,unique] uint32 *display_name_length
371 WERROR svcctl_SCSetServiceBitsA(
372 [in,ref] policy_handle *handle,
374 [in] boolean32 bitson,
375 [in] boolean32 immediate
380 WERROR svcctl_ChangeServiceConfigA(
381 [in,ref] policy_handle *handle,
385 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
386 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
387 [out,ref] uint32 *tag_id,
388 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
389 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
390 [in,unique] [string,charset(UTF16)] uint16 *password,
391 [in,unique] [string,charset(UTF16)] uint16 *display_name
396 WERROR svcctl_CreateServiceA(
397 [in,ref] policy_handle *handle,
398 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
399 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
400 [in] uint32 desired_access,
402 [in] uint32 start_type,
403 [in] uint32 error_control,
404 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
405 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
406 [out,unique] uint32 *TagId,
407 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
408 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
409 [in,unique] [string,charset(UTF16)] uint16 *password
414 WERROR svcctl_EnumDependentServicesA(
415 [in,ref] policy_handle *service,
417 [out,unique] ENUM_SERVICE_STATUS *service_status,
418 [in] uint32 buf_size,
419 [out,ref] uint32 *bytes_needed,
420 [out,ref] uint32 *services_returned
425 WERROR svcctl_EnumServicesStatusA(
426 [in,ref] policy_handle *handle,
429 [in] uint32 buf_size,
430 [out,size_is(buf_size)] uint8 service[*],
431 [out,ref] uint32 *bytes_needed,
432 [out,ref] uint32 *services_returned,
433 [in,out,unique] uint32 *resume_handle
438 WERROR svcctl_OpenSCManagerA(
439 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
440 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
441 [in] uint32 access_mask,
442 [out,ref] policy_handle *handle
447 WERROR svcctl_OpenServiceA(
448 [in,ref] policy_handle *scmanager_handle,
449 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
450 [in] uint32 access_mask
455 WERROR svcctl_QueryServiceConfigA(
456 [in,ref] policy_handle *handle,
457 [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
458 [in] uint32 buf_size,
459 [out,ref] uint32 *bytes_needed
464 WERROR svcctl_QueryServiceLockStatusA(
465 [in,ref] policy_handle *handle,
466 [in] uint32 buf_size,
467 [out,ref] SERVICE_LOCK_STATUS *lock_status,
468 [out,ref] uint32 *required_buf_size
473 WERROR svcctl_StartServiceA(
474 [in,ref] policy_handle *handle,
476 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
481 WERROR svcctl_GetServiceDisplayNameA(
482 [in,ref] policy_handle *handle,
483 [in,unique] [string,charset(UTF16)] uint16 *service_name,
484 [out,ref] [string,charset(UTF16)] uint16 **display_name,
485 [in,out,unique] uint32 *display_name_length
490 WERROR svcctl_GetServiceKeyNameA(
491 [in,ref] policy_handle *handle,
492 [in,unique] [string,charset(UTF16)] uint16 *service_name,
493 [out,ref] [string,charset(UTF16)] uint16 **key_name,
494 [in,out,unique] uint32 *display_name_length
499 [todo] WERROR svcctl_GetCurrentGroupeStateW(
504 [todo] WERROR svcctl_EnumServiceGroupW(
509 WERROR svcctl_ChangeServiceConfig2A(
510 [in,ref] policy_handle *handle,
511 [in] uint32 info_level,
512 [in,unique] uint8 *info
517 WERROR svcctl_ChangeServiceConfig2W(
518 [in,ref] policy_handle *handle,
519 [in] uint32 info_level,
520 [in,unique] uint8 *info
525 WERROR svcctl_QueryServiceConfig2A(
526 [in,ref] policy_handle *handle,
527 [in] uint32 info_level,
528 [out] uint8 buffer[buf_size],
529 [in] uint32 buf_size,
530 [out,ref] uint32 *bytes_needed
535 WERROR svcctl_QueryServiceConfig2W(
536 [in,ref] policy_handle *handle,
537 [in] uint32 info_level,
538 [out] uint8 buffer[buf_size],
539 [in] uint32 buf_size,
540 [out,ref] uint32 *bytes_needed
545 WERROR svcctl_QueryServiceStatusEx(
546 [in,ref] policy_handle *handle,
547 [in] uint32 info_level,
548 [out] uint8 buffer[buf_size],
549 [in] uint32 buf_size,
550 [out,ref] uint32 *bytes_needed
555 WERROR EnumServicesStatusExA(
556 [in,ref] policy_handle *scmanager,
557 [in] uint32 info_level,
560 [out] uint8 services[buf_size],
561 [in] uint32 buf_size,
562 [out,ref] uint32 *bytes_needed,
563 [out,ref] uint32 *service_returned,
564 [in,out,unique] uint32 *resume_handle,
565 [out,ref] [string,charset(UTF16)] uint16 **group_name
570 WERROR EnumServicesStatusExW(
571 [in,ref] policy_handle *scmanager,
572 [in] uint32 info_level,
575 [out] uint8 services[buf_size],
576 [in] uint32 buf_size,
577 [out,ref] uint32 *bytes_needed,
578 [out,ref] uint32 *service_returned,
579 [in,out,unique] uint32 *resume_handle,
580 [out,ref] [string,charset(UTF16)] uint16 **group_name
585 [todo] WERROR svcctl_SCSendTSMessage(