4 svcctl interface definitions
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
230 typedef [bitmap32bit] bitmap {
231 SC_RIGHT_MGR_CONNECT = 0x0001,
232 SC_RIGHT_MGR_CREATE_SERVICE = 0x0002,
233 SC_RIGHT_MGR_ENUMERATE_SERVICE = 0x0004,
234 SC_RIGHT_MGR_LOCK = 0x0008,
235 SC_RIGHT_MGR_QUERY_LOCK_STATUS = 0x0010,
236 SC_RIGHT_MGR_MODIFY_BOOT_CONFIG = 0x0020
237 } svcctl_MgrAccessMask;
239 WERROR svcctl_OpenSCManagerW(
240 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
241 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
242 [in] svcctl_MgrAccessMask access_mask,
243 [out,ref] policy_handle *handle
248 typedef [bitmap32bit] bitmap {
249 SC_RIGHT_SVC_QUERY_CONFIG = 0x0001,
250 SC_RIGHT_SVC_CHANGE_CONFIG = 0x0002,
251 SC_RIGHT_SVC_QUERY_STATUS = 0x0004,
252 SC_RIGHT_SVC_ENUMERATE_DEPENDENTS = 0x0008,
253 SC_RIGHT_SVC_START = 0x0010,
254 SC_RIGHT_SVC_STOP = 0x0020,
255 SC_RIGHT_SVC_PAUSE_CONTINUE = 0x0040,
256 SC_RIGHT_SVC_INTERROGATE = 0x0080,
257 SC_RIGHT_SVC_USER_DEFINED_CONTROL = 0x0100
258 } svcctl_ServiceAccessMask;
260 WERROR svcctl_OpenServiceW(
261 [in,ref] policy_handle *scmanager_handle,
262 [in] [string,charset(UTF16)] uint16 ServiceName[],
263 [in] svcctl_ServiceAccessMask access_mask,
264 [out,ref] policy_handle *handle
270 typedef [public,gensize] struct {
273 uint32 error_control;
274 [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
275 [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
277 [string,charset(UTF16)] [range(0,8192)] uint16 *dependencies;
278 [string,charset(UTF16)] [range(0,8192)] uint16 *startname;
279 [string,charset(UTF16)] [range(0,8192)] uint16 *displayname;
280 } QUERY_SERVICE_CONFIG;
282 WERROR svcctl_QueryServiceConfigW(
283 [in,ref] policy_handle *handle,
284 [out] QUERY_SERVICE_CONFIG *query,
285 [in] [range(0,8192)] uint32 buf_size,
286 [out,ref] [range(0,8192)] uint32 *bytes_needed
291 WERROR svcctl_QueryServiceLockStatusW(
292 [in,ref] policy_handle *handle,
293 [in] uint32 buf_size,
294 [out,ref] SERVICE_LOCK_STATUS *lock_status,
295 [out,ref] uint32 *required_buf_size
300 WERROR svcctl_StartServiceW(
301 [in,ref] policy_handle *handle,
303 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
308 WERROR svcctl_GetServiceDisplayNameW(
309 [in,ref] policy_handle *handle,
310 [in,unique] [string,charset(UTF16)] uint16 *service_name,
311 [out,ref] [string,charset(UTF16)] uint16 **display_name,
312 [in,out,unique] uint32 *display_name_length
317 WERROR svcctl_GetServiceKeyNameW(
318 [in,ref] policy_handle *handle,
319 [in,unique] [string,charset(UTF16)] uint16 *service_name,
320 [out,ref] [string,charset(UTF16)] uint16 **key_name,
321 [in,out,unique] uint32 *display_name_length
326 WERROR svcctl_SCSetServiceBitsA(
327 [in,ref] policy_handle *handle,
329 [in] boolean32 bitson,
330 [in] boolean32 immediate
335 WERROR svcctl_ChangeServiceConfigA(
336 [in,ref] policy_handle *handle,
340 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
341 [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
342 [out,ref] uint32 *tag_id,
343 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
344 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
345 [in,unique] [string,charset(UTF16)] uint16 *password,
346 [in,unique] [string,charset(UTF16)] uint16 *display_name
351 WERROR svcctl_CreateServiceA(
352 [in,ref] policy_handle *handle,
353 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
354 [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
355 [in] uint32 desired_access,
357 [in] uint32 start_type,
358 [in] uint32 error_control,
359 [in,unique] [string,charset(UTF16)] uint16 *binary_path,
360 [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
361 [out,unique] uint32 *TagId,
362 [in,unique] [string,charset(UTF16)] uint16 *dependencies,
363 [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
364 [in,unique] [string,charset(UTF16)] uint16 *password
369 WERROR svcctl_EnumDependentServicesA(
370 [in,ref] policy_handle *service,
372 [out,unique] ENUM_SERVICE_STATUS *service_status,
373 [in] uint32 buf_size,
374 [out,ref] uint32 *bytes_needed,
375 [out,ref] uint32 *services_returned
380 WERROR svcctl_EnumServicesStatusA(
381 [in,ref] policy_handle *handle,
384 [in] uint32 buf_size,
385 [out,size_is(buf_size)] uint8 service[*],
386 [out,ref] uint32 *bytes_needed,
387 [out,ref] uint32 *services_returned,
388 [in,out,unique] uint32 *resume_handle
393 WERROR svcctl_OpenSCManagerA(
394 [in,unique] [string,charset(UTF16)] uint16 *MachineName,
395 [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
396 [in] uint32 access_mask,
397 [out,ref] policy_handle *handle
402 WERROR svcctl_OpenServiceA(
403 [in,ref] policy_handle *scmanager_handle,
404 [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
405 [in] uint32 access_mask
410 WERROR svcctl_QueryServiceConfigA(
411 [in,ref] policy_handle *handle,
412 [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
413 [in] uint32 buf_size,
414 [out,ref] uint32 *bytes_needed
419 WERROR svcctl_QueryServiceLockStatusA(
420 [in,ref] policy_handle *handle,
421 [in] uint32 buf_size,
422 [out,ref] SERVICE_LOCK_STATUS *lock_status,
423 [out,ref] uint32 *required_buf_size
428 WERROR svcctl_StartServiceA(
429 [in,ref] policy_handle *handle,
431 [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
436 WERROR svcctl_GetServiceDisplayNameA(
437 [in,ref] policy_handle *handle,
438 [in,unique] [string,charset(UTF16)] uint16 *service_name,
439 [out,ref] [string,charset(UTF16)] uint16 **display_name,
440 [in,out,unique] uint32 *display_name_length
445 WERROR svcctl_GetServiceKeyNameA(
446 [in,ref] policy_handle *handle,
447 [in,unique] [string,charset(UTF16)] uint16 *service_name,
448 [out,ref] [string,charset(UTF16)] uint16 **key_name,
449 [in,out,unique] uint32 *display_name_length
454 [todo] WERROR svcctl_GetCurrentGroupeStateW(
459 [todo] WERROR svcctl_EnumServiceGroupW(
464 WERROR svcctl_ChangeServiceConfig2A(
465 [in,ref] policy_handle *handle,
466 [in] uint32 info_level,
467 [in,unique] uint8 *info
472 WERROR svcctl_ChangeServiceConfig2W(
473 [in,ref] policy_handle *handle,
474 [in] uint32 info_level,
475 [in,unique] uint8 *info
480 WERROR svcctl_QueryServiceConfig2A(
481 [in,ref] policy_handle *handle,
482 [in] uint32 info_level,
483 [out] uint8 buffer[buf_size],
484 [in] uint32 buf_size,
485 [out,ref] uint32 *bytes_needed
490 WERROR svcctl_QueryServiceConfig2W(
491 [in,ref] policy_handle *handle,
492 [in] uint32 info_level,
493 [out] uint8 buffer[buf_size],
494 [in] uint32 buf_size,
495 [out,ref] uint32 *bytes_needed
500 WERROR svcctl_QueryServiceStatusEx(
501 [in,ref] policy_handle *handle,
502 [in] uint32 info_level,
503 [out] uint8 buffer[buf_size],
504 [in] uint32 buf_size,
505 [out,ref] uint32 *bytes_needed
510 WERROR EnumServicesStatusExA(
511 [in,ref] policy_handle *scmanager,
512 [in] uint32 info_level,
515 [out] uint8 services[buf_size],
516 [in] uint32 buf_size,
517 [out,ref] uint32 *bytes_needed,
518 [out,ref] uint32 *service_returned,
519 [in,out,unique] uint32 *resume_handle,
520 [out,ref] [string,charset(UTF16)] uint16 **group_name
525 WERROR EnumServicesStatusExW(
526 [in,ref] policy_handle *scmanager,
527 [in] uint32 info_level,
530 [out] uint8 services[buf_size],
531 [in] uint32 buf_size,
532 [out,ref] uint32 *bytes_needed,
533 [out,ref] uint32 *service_returned,
534 [in,out,unique] uint32 *resume_handle,
535 [out,ref] [string,charset(UTF16)] uint16 **group_name
540 [todo] WERROR svcctl_SCSendTSMessage(