2 * svcctl interface definitions - exported by services.exe to access the
5 * Copyright 2007 Google (Mikolaj Zalewski)
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 * some defined for the C code
27 cpp_quote
("#include \"winsvc.h\"")
28 cpp_quote
("#define SVCCTL_TRANSPORT {'n','c','a','c','n','_','n','p',0}")
29 cpp_quote
("#define SVCCTL_TRANSPORTA \"ncacn_np\"")
30 cpp_quote
("#define SVCCTL_ENDPOINT {'\\\\','p','i','p','e','\\\\','s','v','c','c','t','l',0}")
31 cpp_quote
("#define SVCCTL_ENDPOINTA \"\\\\pipe\\\\svcctl\"")
33 /* Not the Windows event name - if needed the true one can be found in Inside Windows */
34 cpp_quote
("#define SVCCTL_STARTED_EVENT {'_','_','w','i','n','e','_','S','v','c','c','t','l','S','t','a','r','t','e','d',0}")
36 /* Service startup protocol over control pipe - not compatible with Windows */
37 cpp_quote
("#define SERVICE_PROTOCOL_MAGIC 0x57494e45")
38 cpp_quote
("#define SERVICE_CONTROL_START 0")
39 cpp_quote
("#define SERVICE_CONTROL_FORWARD_FLAG 0x80000000")
41 typedef struct service_start_info_t
43 DWORD magic
; /* protocol magic */
44 DWORD total_size
; /* total request size */
45 DWORD name_size
; /* size of name in data buffer */
46 DWORD
control; /* control code */
51 uuid(367abb81
-9844-35f1
-ad32
-98f038001003
),
53 pointer_default(unique),
54 endpoint("ncacn_np:[\\pipe\\svcctl]")
59 typedef [handle] LPCWSTR MACHINE_HANDLEW
;
60 typedef [handle] LPCSTR MACHINE_HANDLEA
;
61 typedef [handle] LPCWSTR SVCCTL_HANDLEW
;
62 typedef [context_handle] void *SC_RPC_HANDLE
;
63 typedef [context_handle] void *SC_RPC_LOCK
;
64 typedef [context_handle] void *SC_NOTIFY_RPC_HANDLE
;
66 /* undocumented access rights */
67 cpp_quote
("#define SERVICE_SET_STATUS 0x8000")
69 cpp_quote
("#if 0 /* already defined in winsvc.h / winnt.h */")
71 typedef DWORD SECURITY_INFORMATION
;
73 typedef struct _QUERY_SERVICE_CONFIGA
{
77 LPSTR lpBinaryPathName
;
78 LPSTR lpLoadOrderGroup
;
81 LPSTR lpServiceStartName
;
83 } QUERY_SERVICE_CONFIGA
, *LPQUERY_SERVICE_CONFIGA
;
85 typedef struct _QUERY_SERVICE_CONFIGW
{
89 [unique] LPWSTR lpBinaryPathName
;
90 [unique] LPWSTR lpLoadOrderGroup
;
92 [unique] LPWSTR lpDependencies
;
93 [unique] LPWSTR lpServiceStartName
;
94 [unique] LPWSTR lpDisplayName
;
95 } QUERY_SERVICE_CONFIGW
, *LPQUERY_SERVICE_CONFIGW
;
97 typedef struct _SERVICE_STATUS
{
100 DWORD dwControlsAccepted
;
101 DWORD dwWin32ExitCode
;
102 DWORD dwServiceSpecificExitCode
;
105 } SERVICE_STATUS
, *LPSERVICE_STATUS
;
107 typedef enum _SC_STATUS_TYPE
{
108 SC_STATUS_PROCESS_INFO
= 0
111 typedef struct _SERVICE_DESCRIPTIONA
{
113 } SERVICE_DESCRIPTIONA
,*LPSERVICE_DESCRIPTIONA
;
115 typedef struct _SERVICE_DESCRIPTIONW
{
116 LPWSTR lpDescription
;
117 } SERVICE_DESCRIPTIONW
,*LPSERVICE_DESCRIPTIONW
;
119 typedef enum _SC_ACTION_TYPE
{
121 SC_ACTION_RESTART
= 1,
122 SC_ACTION_REBOOT
= 2,
123 SC_ACTION_RUN_COMMAND
= 3
126 typedef struct _SC_ACTION
{
129 } SC_ACTION
,*LPSC_ACTION
;
131 typedef struct _SERVICE_FAILURE_ACTIONSA
{
133 [unique] LPSTR lpRebootMsg
;
134 [unique] LPSTR lpCommand
;
136 [size_is(cActions
)] SC_ACTION
*lpsaActions
;
137 } SERVICE_FAILURE_ACTIONSA
,*LPSERVICE_FAILURE_ACTIONSA
;
139 typedef struct _SERVICE_FAILURE_ACTIONSW
{
141 [unique] LPWSTR lpRebootMsg
;
142 [unique] LPWSTR lpCommand
;
144 [size_is(cActions
)] SC_ACTION
*lpsaActions
;
145 } SERVICE_FAILURE_ACTIONSW
,*LPSERVICE_FAILURE_ACTIONSW
;
147 typedef struct _SERVICE_DELAYED_AUTO_START_INFO
{
148 BOOL fDelayedAutostart
;
149 } SERVICE_DELAYED_AUTO_START_INFO
;
151 typedef struct _SERVICE_FAILURE_ACTIONS_FLAG
{
152 BOOL fFailureActionsOnNonCrashFailures
;
153 } SERVICE_FAILURE_ACTIONS_FLAG
;
155 typedef struct _SERVICE_SID_INFO
{
156 DWORD dwServiceSidType
;
159 typedef struct _SERVICE_PRESHUTDOWN_INFO
{
160 DWORD dwPreshutdownTimeout
;
161 } SERVICE_PRESHUTDOWN_INFO
,*LPSERVICE_PRESHUTDOWN_INFO
;
163 #define SERVICE_CONFIG_DESCRIPTION
1
164 #define SERVICE_CONFIG_FAILURE_ACTIONS
2
165 #define SERVICE_CONFIG_DELAYED_AUTO_START_INFO
3
166 #define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
4
167 #define SERVICE_CONFIG_SERVICE_SID_INFO
5
168 #define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
6
169 #define SERVICE_CONFIG_PRESHUTDOWN_INFO
7
171 #define SERVICE_NOTIFY_STATUS_CHANGE_1
1
172 #define SERVICE_NOTIFY_STATUS_CHANGE_2
2
174 typedef struct _ENUM_SERVICE_STATUSW
{
175 LPWSTR lpServiceName
;
176 LPWSTR lpDisplayName
;
177 SERVICE_STATUS ServiceStatus
;
178 } ENUM_SERVICE_STATUSW
, *LPENUM_SERVICE_STATUSW
;
180 typedef struct _QUERY_SERVICE_LOCK_STATUSA
184 DWORD dwLockDuration
;
185 } QUERY_SERVICE_LOCK_STATUSA
, *LPQUERY_SERVICE_LOCK_STATUSA
;
187 typedef struct _QUERY_SERVICE_LOCK_STATUSW
191 DWORD dwLockDuration
;
192 } QUERY_SERVICE_LOCK_STATUSW
, *LPQUERY_SERVICE_LOCK_STATUSW
;
194 typedef struct _SERVICE_STATUS_PROCESS
197 DWORD dwCurrentState
;
198 DWORD dwControlsAccepted
;
199 DWORD dwWin32ExitCode
;
200 DWORD dwServiceSpecificExitCode
;
204 DWORD dwServiceFlags
;
205 } SERVICE_STATUS_PROCESS
, *LPSERVICE_STATUS_PROCESS
;
207 typedef enum _SC_ENUM_TYPE
{
208 SC_ENUM_PROCESS_INFO
= 0
213 typedef struct _SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
{
214 DWORD cbRequiredPrivileges
;
215 [size_is(cbRequiredPrivileges
)] BYTE *pRequiredPrivileges
;
216 } SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
;
218 typedef struct _SC_RPC_CONFIG_INFOW
{
220 [switch_is(dwInfoLevel
)] union {
221 [case(SERVICE_CONFIG_DESCRIPTION
)] SERVICE_DESCRIPTIONW
*descr
;
222 [case(SERVICE_CONFIG_FAILURE_ACTIONS
)] SERVICE_FAILURE_ACTIONSW
*actions
;
223 [case(SERVICE_CONFIG_DELAYED_AUTO_START_INFO
)] SERVICE_DELAYED_AUTO_START_INFO
*delayedstart
;
224 [case(SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
)] SERVICE_FAILURE_ACTIONS_FLAG
*actionsflag
;
225 [case(SERVICE_CONFIG_SERVICE_SID_INFO
)] SERVICE_SID_INFO
*sid
;
226 [case(SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
)] SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
*privinfo
;
227 [case(SERVICE_CONFIG_PRESHUTDOWN_INFO
)] SERVICE_PRESHUTDOWN_INFO
*preshutdown
;
229 } SC_RPC_CONFIG_INFOW
;
231 typedef struct _SC_RPC_CONFIG_INFOA
{
233 [switch_is(dwInfoLevel
)] union {
234 [case(SERVICE_CONFIG_DESCRIPTION
)] SERVICE_DESCRIPTIONA
*descr
;
235 [case(SERVICE_CONFIG_FAILURE_ACTIONS
)] SERVICE_FAILURE_ACTIONSA
*actions
;
236 [case(SERVICE_CONFIG_DELAYED_AUTO_START_INFO
)] SERVICE_DELAYED_AUTO_START_INFO
*delayedstart
;
237 [case(SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
)] SERVICE_FAILURE_ACTIONS_FLAG
*actionsflag
;
238 [case(SERVICE_CONFIG_SERVICE_SID_INFO
)] SERVICE_SID_INFO
*sid
;
239 [case(SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
)] SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
*privinfo
;
240 [case(SERVICE_CONFIG_PRESHUTDOWN_INFO
)] SERVICE_PRESHUTDOWN_INFO
*preshutdown
;
242 } SC_RPC_CONFIG_INFOA
;
244 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
{
245 ULONGLONG ullThreadId
;
247 UCHAR CallbackAddressArray
[16];
248 UCHAR CallbackParamAddressArray
[16];
249 SERVICE_STATUS_PROCESS ServiceStatus
;
250 DWORD dwNotificationStatus
;
252 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
;
254 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
{
255 ULONGLONG ullThreadId
;
257 UCHAR CallbackAddressArray
[16];
258 UCHAR CallbackParamAddressArray
[16];
259 SERVICE_STATUS_PROCESS ServiceStatus
;
260 DWORD dwNotificationStatus
;
262 DWORD dwNotificationTriggered
;
263 [string] LPWSTR pszServiceNames
;
264 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
;
266 typedef struct _SC_RPC_NOTIFY_PARAMS
{
268 [switch_is(dwInfoLevel
)] union {
269 [case(SERVICE_NOTIFY_STATUS_CHANGE_1
)] SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
*params1
;
270 [case(SERVICE_NOTIFY_STATUS_CHANGE_2
)] SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
*params
;
272 } SC_RPC_NOTIFY_PARAMS
;
274 typedef struct _SC_RPC_NOTIFY_PARAMS_LIST
{
276 [size_is(cElements
)] SC_RPC_NOTIFY_PARAMS NotifyParamsArray
[];
277 } SC_RPC_NOTIFY_PARAMS_LIST
, *PSC_RPC_NOTIFY_PARAMS_LIST
;
279 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
{
281 [string] LPSTR pszComment
;
282 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
, *PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
;
284 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
{
286 [string] LPWSTR pszComment
;
287 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
, *PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
;
289 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSA
{
290 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA psrInParams
;
291 } SC_RPC_SERVICE_CONTROL_IN_PARAMSA
, *PSC_RPC_SERVICE_CONTROL_IN_PARAMSA
;
293 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSW
{
294 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW psrInParams
;
295 } SC_RPC_SERVICE_CONTROL_IN_PARAMSW
, *PSC_RPC_SERVICE_CONTROL_IN_PARAMSW
;
297 typedef struct _SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
{
298 SERVICE_STATUS_PROCESS ServiceStatus
;
299 } SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
, *PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
;
301 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
{
302 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams
;
303 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
, *PSC_RPC_SERVICE_CONTROL_OUT_PARAMSA
;
305 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
{
306 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams
;
307 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
, *PSC_RPC_SERVICE_CONTROL_OUT_PARAMSW
;
310 DWORD svcctl_CloseServiceHandle
(
311 [in,out] SC_RPC_HANDLE
*handle
315 DWORD svcctl_ControlService
(
316 [in] SC_RPC_HANDLE hService
,
317 [in] DWORD dwControl
,
318 [out] SERVICE_STATUS
*lpServiceStatus
322 DWORD svcctl_DeleteService
(
323 [in] SC_RPC_HANDLE hService
327 DWORD svcctl_LockServiceDatabase
(
328 [in] SC_RPC_HANDLE hSCManager
,
329 [out] SC_RPC_LOCK
*phLock
333 DWORD svcctl_QueryServiceObjectSecurity
(
334 [in] SC_RPC_HANDLE service
,
335 [in] SECURITY_INFORMATION info
,
336 [out, size_is(buf_size
)] BYTE *descriptor
,
338 [out] DWORD
*needed_size
342 DWORD svcctl_SetServiceObjectSecurity
(
343 [in] SC_RPC_HANDLE service
,
344 [in] SECURITY_INFORMATION info
,
345 [in, size_is(buf_size
)] BYTE *descriptor
,
350 DWORD svcctl_QueryServiceStatus
(
351 [in] SC_RPC_HANDLE service
,
352 [out] SERVICE_STATUS
*status
356 DWORD svcctl_SetServiceStatus
(
357 [in] SC_RPC_HANDLE hServiceStatus
,
358 [in] LPSERVICE_STATUS lpServiceStatus
362 DWORD svcctl_UnlockServiceDatabase
(
363 [in,out] SC_RPC_LOCK
*phLock
367 DWORD svcctl_NotifyBootConfigStatus
(
368 [in, string, unique] SVCCTL_HANDLEW machinename
,
369 [in] DWORD boot_acceptable
372 /* Not compatible with Windows function 10 */
373 DWORD svcctl_SCSetServiceBitsW
(/* FIXME */);
376 DWORD svcctl_ChangeServiceConfigW
(
377 [in] SC_RPC_HANDLE hService
,
378 [in] DWORD dwServiceType
,
379 [in] DWORD dwStartType
,
380 [in] DWORD dwErrorControl
,
381 [in,unique] LPCWSTR lpBinaryPathName
,
382 [in,unique] LPCWSTR lpLoadOrderGroupKey
,
383 [in,out,unique] DWORD
*lpdwTagId
,
384 [in,unique,size_is(dwDependenciesSize
)] const BYTE *lpDependencies
,
385 [in] DWORD dwDependenciesSize
,
386 [in,unique] LPCWSTR lpServiceStartName
,
387 [in,unique,size_is(dwPasswordSize
)] const BYTE *lpPassword
,
388 [in] DWORD dwPasswordSize
,
389 [in,unique] LPCWSTR lpDisplayName
393 DWORD svcctl_CreateServiceW
(
394 [in] SC_RPC_HANDLE hSCManager
,
395 [in] LPCWSTR lpServiceName
,
396 [in,unique] LPCWSTR lpDisplayName
,
397 [in] DWORD dwDesiredAccess
,
398 [in] DWORD dwServiceType
,
399 [in] DWORD dwStartType
,
400 [in] DWORD dwErrorControl
,
401 [in] LPCWSTR lpBinaryPathName
,
402 [in,unique] LPCWSTR lpLoadOrderGroup
,
403 [in,out,unique] DWORD
*lpdwTagId
,
404 [in,unique,size_is(dwDependenciesSize
)] const BYTE *lpDependencies
,
405 [in] DWORD dwDependenciesSize
,
406 [in,unique] LPCWSTR lpServiceStartName
,
407 [in,unique,size_is(dwPasswordSize
)] const BYTE *lpPassword
,
408 [in] DWORD dwPasswordSize
,
409 [out] SC_RPC_HANDLE
*phService
413 DWORD svcctl_EnumDependentServicesW
(
414 [in] SC_RPC_HANDLE service
,
416 [out, size_is(buf_size
)] BYTE *services
,
418 [out] DWORD
*needed_size
,
419 [out] DWORD
*services_ret
423 DWORD svcctl_EnumServicesStatusW
(
424 [in] SC_RPC_HANDLE hmngr
,
427 [out,size_is(size
)] BYTE *buffer
,
429 [out] LPDWORD needed
,
430 [out] LPDWORD returned
,
431 [in,out,unique] LPDWORD resume
435 DWORD svcctl_OpenSCManagerW
(
436 [in,unique] MACHINE_HANDLEW MachineName
,
437 [in,unique] LPCWSTR DatabaseName
,
438 [in] DWORD dwAccessMask
,
439 [out] SC_RPC_HANDLE
*handle
443 DWORD svcctl_OpenServiceW
(
444 [in] SC_RPC_HANDLE hSCManager
,
445 [in] LPCWSTR lpServiceName
,
446 [in] DWORD dwDesiredAccess
,
447 [out] SC_RPC_HANDLE
*phService
451 DWORD svcctl_QueryServiceConfigW
(
452 [in] SC_RPC_HANDLE hService
,
453 [out] QUERY_SERVICE_CONFIGW
*config
,
455 [out] DWORD
*needed_size
);
458 DWORD svcctl_QueryServiceLockStatusW
(
459 [in] SC_RPC_HANDLE scmanager
,
460 [out] QUERY_SERVICE_LOCK_STATUSW
*status
,
462 [out] DWORD
*needed_size
466 DWORD svcctl_StartServiceW
(
467 [in] SC_RPC_HANDLE hService
,
468 [in] DWORD dwNumServiceArgs
,
469 [in,unique,size_is(dwNumServiceArgs
)] LPCWSTR
*lpServiceArgVectors
473 DWORD svcctl_GetServiceDisplayNameW
(
474 [in] SC_RPC_HANDLE hSCManager
,
475 [in] LPCWSTR lpServiceName
,
476 [out,string,size_is(*cchBufSize
+1)] WCHAR lpBuffer
[],
477 [in,out] DWORD
*cchBufSize
);
480 DWORD svcctl_GetServiceKeyNameW
(
481 [in] SC_RPC_HANDLE hSCManager
,
482 [in] LPCWSTR lpServiceDisplayName
,
483 [out,string,size_is(*cchBufSize
+1)] WCHAR lpBuffer
[],
484 [in,out] DWORD
*cchBufSize
);
486 /* Not compatible with Windows function 22 */
487 DWORD svcctl_SCSetServiceBitsA
(/* FIXME */);
490 DWORD svcctl_ChangeServiceConfigA
(
491 [in] SC_RPC_HANDLE service
,
492 [in] DWORD service_type
,
493 [in] DWORD start_type
,
494 [in] DWORD error_control
,
495 [in, string, unique] LPSTR binarypath
,
496 [in, string, unique] LPSTR loadordergroup
,
497 [in, out, unique] DWORD
*tagid
,
498 [in, unique, size_is(depend_size
)] BYTE *dependencies
,
499 [in] DWORD depend_size
,
500 [in, string, unique] LPSTR startname
,
501 [in, unique, size_is(password_size
)] BYTE *password
,
502 [in] DWORD password_size
,
503 [in, string, unique] LPSTR displayname
507 DWORD svcctl_CreateServiceA
(
508 [in] SC_RPC_HANDLE scmanager
,
509 [in] LPCSTR servicename
,
510 [in, unique] LPCSTR displayname
,
511 [in] DWORD desiredaccess
,
512 [in] DWORD service_type
,
513 [in] DWORD start_type
,
514 [in] DWORD error_control
,
515 [in] LPCSTR binarypath
,
516 [in, unique] LPCSTR loadordergroup
,
517 [in, out, unique] DWORD
*tagid
,
518 [in, unique, size_is(depend_size
)] const BYTE *dependencies
,
519 [in] DWORD depend_size
,
520 [in, unique] LPCSTR startname
,
521 [in, unique, size_is(password_size
)] const BYTE *password
,
522 [in] DWORD password_size
,
523 [out] SC_RPC_HANDLE
*service
527 DWORD svcctl_EnumDependentServicesA
(
528 [in] SC_RPC_HANDLE service
,
530 [out, size_is(buf_size
)] BYTE *services
,
532 [out] DWORD
*needed_size
,
533 [out] DWORD
*services_ret
537 DWORD svcctl_EnumServicesStatusA
(
538 [in] SC_RPC_HANDLE hmngr
,
541 [out, size_is(size
)] BYTE *buffer
,
544 [out] DWORD
*returned
,
545 [in,out,unique] DWORD
*resume
549 DWORD svcctl_OpenSCManagerA
(
550 [in,unique] MACHINE_HANDLEA MachineName
,
551 [in,unique] LPCSTR DatabaseName
,
552 [in] DWORD dwAccessMask
,
553 [out] SC_RPC_HANDLE
*handle
557 DWORD svcctl_OpenServiceA
(
558 [in] SC_RPC_HANDLE hSCManager
,
559 [in] LPCSTR lpServiceName
,
560 [in] DWORD dwDesiredAccess
,
561 [out] SC_RPC_HANDLE
*phService
565 DWORD svcctl_QueryServiceConfigA
(
566 [in] SC_RPC_HANDLE hService
,
567 [out] QUERY_SERVICE_CONFIGA
*config
,
569 [out] DWORD
*needed_size
);
572 DWORD svcctl_QueryServiceLockStatusA
(
573 [in] SC_RPC_HANDLE scmanager
,
574 [out] QUERY_SERVICE_LOCK_STATUSA
*status
,
576 [out] DWORD
*needed_size
580 DWORD svcctl_StartServiceA
(
581 [in] SC_RPC_HANDLE service
,
583 [in, unique, size_is(argc
)] LPCSTR
*args
587 DWORD svcctl_GetServiceDisplayNameA
(
588 [in] SC_RPC_HANDLE hSCManager
,
589 [in] LPCSTR servicename
,
590 [out, string, size_is(*buf_size
+1)] CHAR buffer
[],
591 [in, out] DWORD
*buf_size
);
594 DWORD svcctl_GetServiceKeyNameA
(
595 [in] SC_RPC_HANDLE hSCManager
,
596 [in] LPCSTR servicename
,
597 [out, string, size_is(*buf_size
+1)] CHAR buffer
[],
598 [in, out] DWORD
*buf_size
);
600 /* Not compatible with Windows function 34 */
601 DWORD svcctl_GetCurrentGroupStateW
(/* FIXME */);
604 DWORD svcctl_EnumServiceGroupW
(
605 [in] SC_RPC_HANDLE scmanager
,
606 [in] DWORD service_type
,
607 [in] DWORD service_state
,
608 [out, size_is(buf_size
)] BYTE *buffer
,
610 [out] DWORD
*needed_size
,
611 [out] DWORD
*returned_size
,
612 [in, out, unique] DWORD
*resume_index
,
613 [in, string, unique] LPCWSTR groupname
617 DWORD svcctl_ChangeServiceConfig2A
(
618 [in] SC_RPC_HANDLE service
,
619 [in] SC_RPC_CONFIG_INFOA info
623 DWORD svcctl_ChangeServiceConfig2W
(
624 [in] SC_RPC_HANDLE service
,
625 [in] SC_RPC_CONFIG_INFOW info
629 DWORD svcctl_QueryServiceConfig2A
(
630 [in] SC_RPC_HANDLE service
,
631 [in] DWORD info_level
,
632 [out, size_is(buf_size
)] BYTE *buffer
,
634 [out] DWORD
*needed_size
638 DWORD svcctl_QueryServiceConfig2W
(
639 [in] SC_RPC_HANDLE hService
,
640 [in] DWORD InfoLevel
,
641 [out,size_is(cbBufSize
)] BYTE lpBuffer
[],
642 [in] DWORD cbBufSize
,
643 [out] LPDWORD pcbBytesNeeded
647 DWORD svcctl_QueryServiceStatusEx
(
648 [in] SC_RPC_HANDLE hService
,
649 [in] SC_STATUS_TYPE InfoLevel
,
650 [out,size_is(cbBufSize
)] BYTE *lpBuffer
,
651 [in] DWORD cbBufSize
,
652 [out] LPDWORD pcbBytesNeeded
656 DWORD svcctl_EnumServicesStatusExA
(
657 [in] SC_RPC_HANDLE scmanager
,
658 [in] SC_ENUM_TYPE info_level
,
659 [in] DWORD service_type
,
660 [in] DWORD service_state
,
661 [out, size_is(buf_size
)] BYTE *buffer
,
663 [out] DWORD
*needed_size
,
664 [out] DWORD
*services_count
,
665 [in, out, unique] DWORD
*resume_index
,
666 [in, string, unique] LPCSTR groupname
670 DWORD svcctl_EnumServicesStatusExW
(
671 [in] SC_RPC_HANDLE scmanager
,
672 [in] SC_ENUM_TYPE info_level
,
673 [in] DWORD service_type
,
674 [in] DWORD service_state
,
675 [out, size_is(buf_size
)] BYTE *buffer
,
677 [out] DWORD
*needed_size
,
678 [out] DWORD
*services_count
,
679 [in, out, unique] DWORD
*resume_index
,
680 [in, string, unique] LPCWSTR groupname
683 /* Not compatible with Windows function 43 */
684 DWORD svcctl_unknown43
(/*FIXME*/);
687 DWORD svcctl_CreateServiceWOW64A
(
688 [in] SC_RPC_HANDLE scmanager
,
689 [in, string] LPCSTR servicename
,
690 [in, string, unique] LPCSTR displayname
,
691 [in] DWORD accessmask
,
692 [in] DWORD service_type
,
693 [in] DWORD start_type
,
694 [in] DWORD error_control
,
695 [in, string] LPCSTR imagepath
,
696 [in, string, unique] LPCSTR loadordergroup
,
697 [in, out, unique] DWORD
*tagid
,
698 [in, unique, size_is(depend_size
)] const BYTE *dependencies
,
699 [in] DWORD depend_size
,
700 [in, string, unique] LPCSTR start_name
,
701 [in, unique, size_is(password_size
)] const BYTE *password
,
702 [in] DWORD password_size
,
703 [out] SC_RPC_HANDLE
*service
707 DWORD svcctl_CreateServiceWOW64W
(
708 [in] SC_RPC_HANDLE scmanager
,
709 [in, string] LPCWSTR servicename
,
710 [in, string, unique] LPCWSTR displayname
,
711 [in] DWORD accessmask
,
712 [in] DWORD service_type
,
713 [in] DWORD start_type
,
714 [in] DWORD error_control
,
715 [in, string] LPCWSTR imagepath
,
716 [in, string, unique] LPCWSTR loadordergroup
,
717 [in, out, unique] DWORD
*tagid
,
718 [in, unique, size_is(depend_size
)] const BYTE *dependencies
,
719 [in] DWORD depend_size
,
720 [in, string, unique] LPCWSTR start_name
,
721 [in, unique, size_is(password_size
)] const BYTE *password
,
722 [in] DWORD password_size
,
723 [out] SC_RPC_HANDLE
*service
726 /* Not compatible with Windows function 46 */
727 DWORD svcctl_unknown46
(/*FIXME*/);
730 DWORD svcctl_NotifyServiceStatusChange
(
731 [in] SC_RPC_HANDLE service
,
732 [in] SC_RPC_NOTIFY_PARAMS params
,
733 [in] GUID
*clientprocessguid
,
734 [out] GUID
*scmprocessguid
,
735 [out] BOOL
*createremotequeue
,
736 [out] SC_NOTIFY_RPC_HANDLE
*notify
740 DWORD svcctl_GetNotifyResults
(
741 [in] SC_NOTIFY_RPC_HANDLE notify
,
742 [out] SC_RPC_NOTIFY_PARAMS_LIST
**params
746 DWORD svcctl_CloseNotifyHandle
(
747 [in, out] SC_NOTIFY_RPC_HANDLE
*notify
,
748 [out] BOOL
*apc_fired
752 DWORD svcctl_ControlServiceExA
(
753 [in] SC_RPC_HANDLE service
,
755 [in] DWORD info_level
,
756 [in, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_IN_PARAMSA
*in_params
,
757 [out, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
*out_params
761 DWORD svcctl_ControlServiceExW
(
762 [in] SC_RPC_HANDLE service
,
764 [in] DWORD info_level
,
765 [in, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_IN_PARAMSW
*in_params
,
766 [out, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
*out_params
769 /* Not compatible with Windows function 52 */
770 DWORD svcctl_unknown52
();
772 /* Not compatible with Windows function 53 */
773 DWORD svcctl_unknown53
();
775 /* Not compatible with Windows function 54 */
776 DWORD svcctl_unknown54
();
778 /* Not compatible with Windows function 55 */
779 DWORD svcctl_unknown55
();
782 DWORD svcctl_QueryServiceConfigEx
(
783 [in] SC_RPC_HANDLE service
,
784 [in] DWORD info_level
,
785 [out] SC_RPC_CONFIG_INFOW
*info