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
23 #pragma makedep header install
29 * some defined for the C code
31 cpp_quote
("#include \"winsvc.h\"")
32 cpp_quote
("#define SVCCTL_TRANSPORT {'n','c','a','c','n','_','n','p',0}")
33 cpp_quote
("#define SVCCTL_TRANSPORTA \"ncacn_np\"")
34 cpp_quote
("#define SVCCTL_ENDPOINT {'\\\\','p','i','p','e','\\\\','s','v','c','c','t','l',0}")
35 cpp_quote
("#define SVCCTL_ENDPOINTA \"\\\\pipe\\\\svcctl\"")
37 /* Not the Windows event name - if needed the true one can be found in Inside Windows */
38 cpp_quote
("#define SVCCTL_STARTED_EVENT {'_','_','w','i','n','e','_','S','v','c','c','t','l','S','t','a','r','t','e','d',0}")
40 /* Service startup protocol over control pipe - not compatible with Windows */
41 cpp_quote
("#define SERVICE_PROTOCOL_MAGIC 0x57494e45")
42 cpp_quote
("#define SERVICE_CONTROL_START 0")
43 cpp_quote
("#define SERVICE_CONTROL_FORWARD_FLAG 0x80000000")
45 typedef struct service_start_info_t
47 DWORD magic
; /* protocol magic */
48 DWORD total_size
; /* total request size */
49 DWORD name_size
; /* size of name in data buffer */
50 DWORD
control; /* control code */
55 uuid(367abb81
-9844-35f1
-ad32
-98f038001003
),
57 pointer_default(unique),
58 endpoint("ncacn_np:[\\pipe\\svcctl]")
63 typedef [handle] LPCWSTR MACHINE_HANDLEW
;
64 typedef [handle] LPCSTR MACHINE_HANDLEA
;
65 typedef [handle] LPCWSTR SVCCTL_HANDLEW
;
66 typedef [context_handle] void *SC_RPC_HANDLE
;
67 typedef [context_handle] void *SC_RPC_LOCK
;
68 typedef [context_handle] void *SC_NOTIFY_RPC_HANDLE
;
70 /* undocumented access rights */
71 cpp_quote
("#define SERVICE_SET_STATUS 0x8000")
73 cpp_quote
("#if 0 /* already defined in winsvc.h / winnt.h */")
75 typedef DWORD SECURITY_INFORMATION
;
77 typedef struct _QUERY_SERVICE_CONFIGA
{
81 LPSTR lpBinaryPathName
;
82 LPSTR lpLoadOrderGroup
;
85 LPSTR lpServiceStartName
;
87 } QUERY_SERVICE_CONFIGA
, *LPQUERY_SERVICE_CONFIGA
;
89 typedef struct _QUERY_SERVICE_CONFIGW
{
93 [unique] LPWSTR lpBinaryPathName
;
94 [unique] LPWSTR lpLoadOrderGroup
;
96 [unique] LPWSTR lpDependencies
;
97 [unique] LPWSTR lpServiceStartName
;
98 [unique] LPWSTR lpDisplayName
;
99 } QUERY_SERVICE_CONFIGW
, *LPQUERY_SERVICE_CONFIGW
;
101 typedef struct _SERVICE_STATUS
{
103 DWORD dwCurrentState
;
104 DWORD dwControlsAccepted
;
105 DWORD dwWin32ExitCode
;
106 DWORD dwServiceSpecificExitCode
;
109 } SERVICE_STATUS
, *LPSERVICE_STATUS
;
111 typedef enum _SC_STATUS_TYPE
{
112 SC_STATUS_PROCESS_INFO
= 0
115 typedef struct _SERVICE_DESCRIPTIONA
{
117 } SERVICE_DESCRIPTIONA
,*LPSERVICE_DESCRIPTIONA
;
119 typedef struct _SERVICE_DESCRIPTIONW
{
120 LPWSTR lpDescription
;
121 } SERVICE_DESCRIPTIONW
,*LPSERVICE_DESCRIPTIONW
;
123 typedef enum _SC_ACTION_TYPE
{
125 SC_ACTION_RESTART
= 1,
126 SC_ACTION_REBOOT
= 2,
127 SC_ACTION_RUN_COMMAND
= 3
130 typedef struct _SC_ACTION
{
133 } SC_ACTION
,*LPSC_ACTION
;
135 typedef struct _SERVICE_FAILURE_ACTIONSA
{
137 [unique] LPSTR lpRebootMsg
;
138 [unique] LPSTR lpCommand
;
140 [size_is(cActions
)] SC_ACTION
*lpsaActions
;
141 } SERVICE_FAILURE_ACTIONSA
,*LPSERVICE_FAILURE_ACTIONSA
;
143 typedef struct _SERVICE_FAILURE_ACTIONSW
{
145 [unique] LPWSTR lpRebootMsg
;
146 [unique] LPWSTR lpCommand
;
148 [size_is(cActions
)] SC_ACTION
*lpsaActions
;
149 } SERVICE_FAILURE_ACTIONSW
,*LPSERVICE_FAILURE_ACTIONSW
;
151 typedef struct _SERVICE_DELAYED_AUTO_START_INFO
{
152 BOOL fDelayedAutostart
;
153 } SERVICE_DELAYED_AUTO_START_INFO
;
155 typedef struct _SERVICE_FAILURE_ACTIONS_FLAG
{
156 BOOL fFailureActionsOnNonCrashFailures
;
157 } SERVICE_FAILURE_ACTIONS_FLAG
;
159 typedef struct _SERVICE_SID_INFO
{
160 DWORD dwServiceSidType
;
163 typedef struct _SERVICE_PRESHUTDOWN_INFO
{
164 DWORD dwPreshutdownTimeout
;
165 } SERVICE_PRESHUTDOWN_INFO
,*LPSERVICE_PRESHUTDOWN_INFO
;
167 #define SERVICE_CONFIG_DESCRIPTION
1
168 #define SERVICE_CONFIG_FAILURE_ACTIONS
2
169 #define SERVICE_CONFIG_DELAYED_AUTO_START_INFO
3
170 #define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
4
171 #define SERVICE_CONFIG_SERVICE_SID_INFO
5
172 #define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
6
173 #define SERVICE_CONFIG_PRESHUTDOWN_INFO
7
175 #define SERVICE_NOTIFY_STATUS_CHANGE_1
1
176 #define SERVICE_NOTIFY_STATUS_CHANGE_2
2
178 typedef struct _ENUM_SERVICE_STATUSW
{
179 LPWSTR lpServiceName
;
180 LPWSTR lpDisplayName
;
181 SERVICE_STATUS ServiceStatus
;
182 } ENUM_SERVICE_STATUSW
, *LPENUM_SERVICE_STATUSW
;
184 typedef struct _QUERY_SERVICE_LOCK_STATUSA
188 DWORD dwLockDuration
;
189 } QUERY_SERVICE_LOCK_STATUSA
, *LPQUERY_SERVICE_LOCK_STATUSA
;
191 typedef struct _QUERY_SERVICE_LOCK_STATUSW
195 DWORD dwLockDuration
;
196 } QUERY_SERVICE_LOCK_STATUSW
, *LPQUERY_SERVICE_LOCK_STATUSW
;
198 typedef struct _SERVICE_STATUS_PROCESS
201 DWORD dwCurrentState
;
202 DWORD dwControlsAccepted
;
203 DWORD dwWin32ExitCode
;
204 DWORD dwServiceSpecificExitCode
;
208 DWORD dwServiceFlags
;
209 } SERVICE_STATUS_PROCESS
, *LPSERVICE_STATUS_PROCESS
;
211 typedef enum _SC_ENUM_TYPE
{
212 SC_ENUM_PROCESS_INFO
= 0
217 /* internal version of ENUM_SERVICE_STATUSA/W that doesn't depend on pointer size */
218 struct enum_service_status
222 SERVICE_STATUS service_status
;
225 struct enum_service_status_process
229 SERVICE_STATUS_PROCESS service_status_process
;
232 struct service_description
235 WCHAR description
[1];
238 typedef struct _SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
{
239 DWORD cbRequiredPrivileges
;
240 [size_is(cbRequiredPrivileges
)] BYTE *pRequiredPrivileges
;
241 } SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
;
243 typedef struct _SC_RPC_CONFIG_INFOW
{
245 [switch_is(dwInfoLevel
)] union {
246 [case(SERVICE_CONFIG_DESCRIPTION
)] SERVICE_DESCRIPTIONW
*descr
;
247 [case(SERVICE_CONFIG_FAILURE_ACTIONS
)] SERVICE_FAILURE_ACTIONSW
*actions
;
248 [case(SERVICE_CONFIG_DELAYED_AUTO_START_INFO
)] SERVICE_DELAYED_AUTO_START_INFO
*delayedstart
;
249 [case(SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
)] SERVICE_FAILURE_ACTIONS_FLAG
*actionsflag
;
250 [case(SERVICE_CONFIG_SERVICE_SID_INFO
)] SERVICE_SID_INFO
*sid
;
251 [case(SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
)] SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
*privinfo
;
252 [case(SERVICE_CONFIG_PRESHUTDOWN_INFO
)] SERVICE_PRESHUTDOWN_INFO
*preshutdown
;
254 } SC_RPC_CONFIG_INFOW
;
256 typedef struct _SC_RPC_CONFIG_INFOA
{
258 [switch_is(dwInfoLevel
)] union {
259 [case(SERVICE_CONFIG_DESCRIPTION
)] SERVICE_DESCRIPTIONA
*descr
;
260 [case(SERVICE_CONFIG_FAILURE_ACTIONS
)] SERVICE_FAILURE_ACTIONSA
*actions
;
261 [case(SERVICE_CONFIG_DELAYED_AUTO_START_INFO
)] SERVICE_DELAYED_AUTO_START_INFO
*delayedstart
;
262 [case(SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
)] SERVICE_FAILURE_ACTIONS_FLAG
*actionsflag
;
263 [case(SERVICE_CONFIG_SERVICE_SID_INFO
)] SERVICE_SID_INFO
*sid
;
264 [case(SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
)] SERVICE_RPC_REQUIRED_PRIVILEGES_INFO
*privinfo
;
265 [case(SERVICE_CONFIG_PRESHUTDOWN_INFO
)] SERVICE_PRESHUTDOWN_INFO
*preshutdown
;
267 } SC_RPC_CONFIG_INFOA
;
269 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
{
270 ULONGLONG ullThreadId
;
272 UCHAR CallbackAddressArray
[16];
273 UCHAR CallbackParamAddressArray
[16];
274 SERVICE_STATUS_PROCESS ServiceStatus
;
275 DWORD dwNotificationStatus
;
277 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
;
279 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
{
280 ULONGLONG ullThreadId
;
282 UCHAR CallbackAddressArray
[16];
283 UCHAR CallbackParamAddressArray
[16];
284 SERVICE_STATUS_PROCESS ServiceStatus
;
285 DWORD dwNotificationStatus
;
287 DWORD dwNotificationTriggered
;
288 [string] LPWSTR pszServiceNames
;
289 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
;
291 typedef struct _SC_RPC_NOTIFY_PARAMS
{
293 [switch_is(dwInfoLevel
)] union {
294 [case(SERVICE_NOTIFY_STATUS_CHANGE_1
)] SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1
*params1
;
295 [case(SERVICE_NOTIFY_STATUS_CHANGE_2
)] SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2
*params
;
297 } SC_RPC_NOTIFY_PARAMS
;
299 typedef struct _SC_RPC_NOTIFY_PARAMS_LIST
{
301 [size_is(cElements
)] SC_RPC_NOTIFY_PARAMS NotifyParamsArray
[];
302 } SC_RPC_NOTIFY_PARAMS_LIST
, *PSC_RPC_NOTIFY_PARAMS_LIST
;
304 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
{
306 [string] LPSTR pszComment
;
307 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
, *PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA
;
309 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
{
311 [string] LPWSTR pszComment
;
312 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
, *PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW
;
314 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSA
{
315 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA psrInParams
;
316 } SC_RPC_SERVICE_CONTROL_IN_PARAMSA
, *PSC_RPC_SERVICE_CONTROL_IN_PARAMSA
;
318 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSW
{
319 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW psrInParams
;
320 } SC_RPC_SERVICE_CONTROL_IN_PARAMSW
, *PSC_RPC_SERVICE_CONTROL_IN_PARAMSW
;
322 typedef struct _SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
{
323 SERVICE_STATUS_PROCESS ServiceStatus
;
324 } SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
, *PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS
;
326 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
{
327 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams
;
328 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
, *PSC_RPC_SERVICE_CONTROL_OUT_PARAMSA
;
330 typedef [switch_type(DWORD
)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
{
331 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams
;
332 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
, *PSC_RPC_SERVICE_CONTROL_OUT_PARAMSW
;
335 DWORD svcctl_CloseServiceHandle
(
336 [in,out] SC_RPC_HANDLE
*handle
340 DWORD svcctl_ControlService
(
341 [in] SC_RPC_HANDLE hService
,
342 [in] DWORD dwControl
,
343 [out] SERVICE_STATUS
*lpServiceStatus
347 DWORD svcctl_DeleteService
(
348 [in] SC_RPC_HANDLE hService
352 DWORD svcctl_LockServiceDatabase
(
353 [in] SC_RPC_HANDLE hSCManager
,
354 [out] SC_RPC_LOCK
*phLock
358 DWORD svcctl_QueryServiceObjectSecurity
(
359 [in] SC_RPC_HANDLE service
,
360 [in] SECURITY_INFORMATION info
,
361 [out, size_is(buf_size
)] BYTE *descriptor
,
363 [out] DWORD
*needed_size
367 DWORD svcctl_SetServiceObjectSecurity
(
368 [in] SC_RPC_HANDLE service
,
369 [in] SECURITY_INFORMATION info
,
370 [in, size_is(buf_size
)] BYTE *descriptor
,
375 DWORD svcctl_QueryServiceStatus
(
376 [in] SC_RPC_HANDLE service
,
377 [out] SERVICE_STATUS
*status
381 DWORD svcctl_SetServiceStatus
(
382 [in] SC_RPC_HANDLE hServiceStatus
,
383 [in] LPSERVICE_STATUS lpServiceStatus
387 DWORD svcctl_UnlockServiceDatabase
(
388 [in,out] SC_RPC_LOCK
*phLock
392 DWORD svcctl_NotifyBootConfigStatus
(
393 [in, string, unique] SVCCTL_HANDLEW machinename
,
394 [in] DWORD boot_acceptable
397 /* Not compatible with Windows function 10 */
398 DWORD svcctl_SCSetServiceBitsW
(/* FIXME */);
401 DWORD svcctl_ChangeServiceConfigW
(
402 [in] SC_RPC_HANDLE hService
,
403 [in] DWORD dwServiceType
,
404 [in] DWORD dwStartType
,
405 [in] DWORD dwErrorControl
,
406 [in,unique] LPCWSTR lpBinaryPathName
,
407 [in,unique] LPCWSTR lpLoadOrderGroupKey
,
408 [in,out,unique] DWORD
*lpdwTagId
,
409 [in,unique,size_is(dwDependenciesSize
)] const BYTE *lpDependencies
,
410 [in] DWORD dwDependenciesSize
,
411 [in,unique] LPCWSTR lpServiceStartName
,
412 [in,unique,size_is(dwPasswordSize
)] const BYTE *lpPassword
,
413 [in] DWORD dwPasswordSize
,
414 [in,unique] LPCWSTR lpDisplayName
418 DWORD svcctl_CreateServiceW
(
419 [in] SC_RPC_HANDLE hSCManager
,
420 [in] LPCWSTR lpServiceName
,
421 [in,unique] LPCWSTR lpDisplayName
,
422 [in] DWORD dwDesiredAccess
,
423 [in] DWORD dwServiceType
,
424 [in] DWORD dwStartType
,
425 [in] DWORD dwErrorControl
,
426 [in] LPCWSTR lpBinaryPathName
,
427 [in,unique] LPCWSTR lpLoadOrderGroup
,
428 [in,out,unique] DWORD
*lpdwTagId
,
429 [in,unique,size_is(dwDependenciesSize
)] const BYTE *lpDependencies
,
430 [in] DWORD dwDependenciesSize
,
431 [in,unique] LPCWSTR lpServiceStartName
,
432 [in,unique,size_is(dwPasswordSize
)] const BYTE *lpPassword
,
433 [in] DWORD dwPasswordSize
,
434 [out] SC_RPC_HANDLE
*phService
438 DWORD svcctl_EnumDependentServicesW
(
439 [in] SC_RPC_HANDLE service
,
441 [out, size_is(buf_size
)] BYTE *services
,
443 [out] DWORD
*needed_size
,
444 [out] DWORD
*services_ret
448 DWORD svcctl_EnumServicesStatusW
(
449 [in] SC_RPC_HANDLE hmngr
,
452 [out,size_is(size
)] BYTE *buffer
,
454 [out] LPDWORD needed
,
455 [out] LPDWORD returned
,
456 [in,out,unique] LPDWORD resume
460 DWORD svcctl_OpenSCManagerW
(
461 [in,unique] MACHINE_HANDLEW MachineName
,
462 [in,unique] LPCWSTR DatabaseName
,
463 [in] DWORD dwAccessMask
,
464 [out] SC_RPC_HANDLE
*handle
468 DWORD svcctl_OpenServiceW
(
469 [in] SC_RPC_HANDLE hSCManager
,
470 [in] LPCWSTR lpServiceName
,
471 [in] DWORD dwDesiredAccess
,
472 [out] SC_RPC_HANDLE
*phService
476 DWORD svcctl_QueryServiceConfigW
(
477 [in] SC_RPC_HANDLE hService
,
478 [out] QUERY_SERVICE_CONFIGW
*config
,
480 [out] DWORD
*needed_size
);
483 DWORD svcctl_QueryServiceLockStatusW
(
484 [in] SC_RPC_HANDLE scmanager
,
485 [out] QUERY_SERVICE_LOCK_STATUSW
*status
,
487 [out] DWORD
*needed_size
491 DWORD svcctl_StartServiceW
(
492 [in] SC_RPC_HANDLE hService
,
493 [in] DWORD dwNumServiceArgs
,
494 [in,unique,size_is(dwNumServiceArgs
)] LPCWSTR
*lpServiceArgVectors
498 DWORD svcctl_GetServiceDisplayNameW
(
499 [in] SC_RPC_HANDLE hSCManager
,
500 [in] LPCWSTR lpServiceName
,
501 [out,string,size_is(*cchBufSize
+1)] WCHAR lpBuffer
[],
502 [in,out] DWORD
*cchBufSize
);
505 DWORD svcctl_GetServiceKeyNameW
(
506 [in] SC_RPC_HANDLE hSCManager
,
507 [in] LPCWSTR lpServiceDisplayName
,
508 [out,string,size_is(*cchBufSize
+1)] WCHAR lpBuffer
[],
509 [in,out] DWORD
*cchBufSize
);
511 /* Not compatible with Windows function 22 */
512 DWORD svcctl_SCSetServiceBitsA
(/* FIXME */);
515 DWORD svcctl_ChangeServiceConfigA
(
516 [in] SC_RPC_HANDLE service
,
517 [in] DWORD service_type
,
518 [in] DWORD start_type
,
519 [in] DWORD error_control
,
520 [in, string, unique] LPSTR binarypath
,
521 [in, string, unique] LPSTR loadordergroup
,
522 [in, out, unique] DWORD
*tagid
,
523 [in, unique, size_is(depend_size
)] BYTE *dependencies
,
524 [in] DWORD depend_size
,
525 [in, string, unique] LPSTR startname
,
526 [in, unique, size_is(password_size
)] BYTE *password
,
527 [in] DWORD password_size
,
528 [in, string, unique] LPSTR displayname
532 DWORD svcctl_CreateServiceA
(
533 [in] SC_RPC_HANDLE scmanager
,
534 [in] LPCSTR servicename
,
535 [in, unique] LPCSTR displayname
,
536 [in] DWORD desiredaccess
,
537 [in] DWORD service_type
,
538 [in] DWORD start_type
,
539 [in] DWORD error_control
,
540 [in] LPCSTR binarypath
,
541 [in, unique] LPCSTR loadordergroup
,
542 [in, out, unique] DWORD
*tagid
,
543 [in, unique, size_is(depend_size
)] const BYTE *dependencies
,
544 [in] DWORD depend_size
,
545 [in, unique] LPCSTR startname
,
546 [in, unique, size_is(password_size
)] const BYTE *password
,
547 [in] DWORD password_size
,
548 [out] SC_RPC_HANDLE
*service
552 DWORD svcctl_EnumDependentServicesA
(
553 [in] SC_RPC_HANDLE service
,
555 [out, size_is(buf_size
)] BYTE *services
,
557 [out] DWORD
*needed_size
,
558 [out] DWORD
*services_ret
562 DWORD svcctl_EnumServicesStatusA
(
563 [in] SC_RPC_HANDLE hmngr
,
566 [out, size_is(size
)] BYTE *buffer
,
569 [out] DWORD
*returned
,
570 [in,out,unique] DWORD
*resume
574 DWORD svcctl_OpenSCManagerA
(
575 [in,unique] MACHINE_HANDLEA MachineName
,
576 [in,unique] LPCSTR DatabaseName
,
577 [in] DWORD dwAccessMask
,
578 [out] SC_RPC_HANDLE
*handle
582 DWORD svcctl_OpenServiceA
(
583 [in] SC_RPC_HANDLE hSCManager
,
584 [in] LPCSTR lpServiceName
,
585 [in] DWORD dwDesiredAccess
,
586 [out] SC_RPC_HANDLE
*phService
590 DWORD svcctl_QueryServiceConfigA
(
591 [in] SC_RPC_HANDLE hService
,
592 [out] QUERY_SERVICE_CONFIGA
*config
,
594 [out] DWORD
*needed_size
);
597 DWORD svcctl_QueryServiceLockStatusA
(
598 [in] SC_RPC_HANDLE scmanager
,
599 [out] QUERY_SERVICE_LOCK_STATUSA
*status
,
601 [out] DWORD
*needed_size
605 DWORD svcctl_StartServiceA
(
606 [in] SC_RPC_HANDLE service
,
608 [in, unique, size_is(argc
)] LPCSTR
*args
612 DWORD svcctl_GetServiceDisplayNameA
(
613 [in] SC_RPC_HANDLE hSCManager
,
614 [in] LPCSTR servicename
,
615 [out, string, size_is(*buf_size
+1)] CHAR buffer
[],
616 [in, out] DWORD
*buf_size
);
619 DWORD svcctl_GetServiceKeyNameA
(
620 [in] SC_RPC_HANDLE hSCManager
,
621 [in] LPCSTR servicename
,
622 [out, string, size_is(*buf_size
+1)] CHAR buffer
[],
623 [in, out] DWORD
*buf_size
);
625 /* Not compatible with Windows function 34 */
626 DWORD svcctl_GetCurrentGroupStateW
(/* FIXME */);
629 DWORD svcctl_EnumServiceGroupW
(
630 [in] SC_RPC_HANDLE scmanager
,
631 [in] DWORD service_type
,
632 [in] DWORD service_state
,
633 [out, size_is(buf_size
)] BYTE *buffer
,
635 [out] DWORD
*needed_size
,
636 [out] DWORD
*returned_size
,
637 [in, out, unique] DWORD
*resume_index
,
638 [in, string, unique] LPCWSTR groupname
642 DWORD svcctl_ChangeServiceConfig2A
(
643 [in] SC_RPC_HANDLE service
,
644 [in] SC_RPC_CONFIG_INFOA info
648 DWORD svcctl_ChangeServiceConfig2W
(
649 [in] SC_RPC_HANDLE service
,
650 [in] SC_RPC_CONFIG_INFOW info
654 DWORD svcctl_QueryServiceConfig2A
(
655 [in] SC_RPC_HANDLE service
,
656 [in] DWORD info_level
,
657 [out, size_is(buf_size
)] BYTE *buffer
,
659 [out] DWORD
*needed_size
663 DWORD svcctl_QueryServiceConfig2W
(
664 [in] SC_RPC_HANDLE hService
,
665 [in] DWORD InfoLevel
,
666 [out,size_is(cbBufSize
)] BYTE lpBuffer
[],
667 [in] DWORD cbBufSize
,
668 [out] LPDWORD pcbBytesNeeded
672 DWORD svcctl_QueryServiceStatusEx
(
673 [in] SC_RPC_HANDLE hService
,
674 [in] SC_STATUS_TYPE InfoLevel
,
675 [out,size_is(cbBufSize
)] BYTE *lpBuffer
,
676 [in] DWORD cbBufSize
,
677 [out] LPDWORD pcbBytesNeeded
681 DWORD svcctl_EnumServicesStatusExA
(
682 [in] SC_RPC_HANDLE scmanager
,
683 [in] SC_ENUM_TYPE info_level
,
684 [in] DWORD service_type
,
685 [in] DWORD service_state
,
686 [out, size_is(buf_size
)] BYTE *buffer
,
688 [out] DWORD
*needed_size
,
689 [out] DWORD
*services_count
,
690 [in, out, unique] DWORD
*resume_index
,
691 [in, string, unique] LPCSTR groupname
695 DWORD svcctl_EnumServicesStatusExW
(
696 [in] SC_RPC_HANDLE scmanager
,
697 [in] SC_ENUM_TYPE info_level
,
698 [in] DWORD service_type
,
699 [in] DWORD service_state
,
700 [out, size_is(buf_size
)] BYTE *buffer
,
702 [out] DWORD
*needed_size
,
703 [out] DWORD
*services_count
,
704 [in, out, unique] DWORD
*resume_index
,
705 [in, string, unique] LPCWSTR groupname
708 /* Not compatible with Windows function 43 */
709 DWORD svcctl_unknown43
(/*FIXME*/);
712 DWORD svcctl_CreateServiceWOW64A
(
713 [in] SC_RPC_HANDLE scmanager
,
714 [in, string] LPCSTR servicename
,
715 [in, string, unique] LPCSTR displayname
,
716 [in] DWORD accessmask
,
717 [in] DWORD service_type
,
718 [in] DWORD start_type
,
719 [in] DWORD error_control
,
720 [in, string] LPCSTR imagepath
,
721 [in, string, unique] LPCSTR loadordergroup
,
722 [in, out, unique] DWORD
*tagid
,
723 [in, unique, size_is(depend_size
)] const BYTE *dependencies
,
724 [in] DWORD depend_size
,
725 [in, string, unique] LPCSTR start_name
,
726 [in, unique, size_is(password_size
)] const BYTE *password
,
727 [in] DWORD password_size
,
728 [out] SC_RPC_HANDLE
*service
732 DWORD svcctl_CreateServiceWOW64W
(
733 [in] SC_RPC_HANDLE scmanager
,
734 [in, string] LPCWSTR servicename
,
735 [in, string, unique] LPCWSTR displayname
,
736 [in] DWORD accessmask
,
737 [in] DWORD service_type
,
738 [in] DWORD start_type
,
739 [in] DWORD error_control
,
740 [in, string] LPCWSTR imagepath
,
741 [in, string, unique] LPCWSTR loadordergroup
,
742 [in, out, unique] DWORD
*tagid
,
743 [in, unique, size_is(depend_size
)] const BYTE *dependencies
,
744 [in] DWORD depend_size
,
745 [in, string, unique] LPCWSTR start_name
,
746 [in, unique, size_is(password_size
)] const BYTE *password
,
747 [in] DWORD password_size
,
748 [out] SC_RPC_HANDLE
*service
751 /* Not compatible with Windows function 46 */
752 DWORD svcctl_unknown46
(/*FIXME*/);
755 DWORD svcctl_NotifyServiceStatusChange
(
756 [in] SC_RPC_HANDLE service
,
757 [in] SC_RPC_NOTIFY_PARAMS params
,
758 [in] GUID
*clientprocessguid
,
759 [out] GUID
*scmprocessguid
,
760 [out] BOOL
*createremotequeue
,
761 [out] SC_NOTIFY_RPC_HANDLE
*notify
765 DWORD svcctl_GetNotifyResults
(
766 [in] SC_NOTIFY_RPC_HANDLE notify
,
767 [out] SC_RPC_NOTIFY_PARAMS_LIST
**params
771 DWORD svcctl_CloseNotifyHandle
(
772 [in, out] SC_NOTIFY_RPC_HANDLE
*notify
,
773 [out] BOOL
*apc_fired
777 DWORD svcctl_ControlServiceExA
(
778 [in] SC_RPC_HANDLE service
,
780 [in] DWORD info_level
,
781 [in, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_IN_PARAMSA
*in_params
,
782 [out, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_OUT_PARAMSA
*out_params
786 DWORD svcctl_ControlServiceExW
(
787 [in] SC_RPC_HANDLE service
,
789 [in] DWORD info_level
,
790 [in, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_IN_PARAMSW
*in_params
,
791 [out, switch_is(info_level
)] SC_RPC_SERVICE_CONTROL_OUT_PARAMSW
*out_params
794 /* Not compatible with Windows function 52 */
795 DWORD svcctl_unknown52
();
797 /* Not compatible with Windows function 53 */
798 DWORD svcctl_unknown53
();
800 /* Not compatible with Windows function 54 */
801 DWORD svcctl_unknown54
();
803 /* Not compatible with Windows function 55 */
804 DWORD svcctl_unknown55
();
807 DWORD svcctl_QueryServiceConfigEx
(
808 [in] SC_RPC_HANDLE service
,
809 [in] DWORD info_level
,
810 [out] SC_RPC_CONFIG_INFOW
*info