2 * Service Control Manager (SCM) interface definition
7 const unsigned int MAX_SERVICE_NAME_LENGTH = 255;
8 const unsigned short SC_MAX_DEPEND_SIZE = 4 * 1024;
9 const unsigned short SC_MAX_NAME_LENGTH = MAX_SERVICE_NAME_LENGTH + 1;
10 const unsigned short SC_MAX_PATH_LENGTH = 32 * 1024;
11 const unsigned short SC_MAX_PWD_SIZE = 514;
12 const unsigned short SC_MAX_COMPUTER_NAME_LENGTH = 1024;
13 const unsigned short SC_MAX_ACCOUNT_NAME_LENGTH = 2 * 1024;
14 const unsigned short SC_MAX_COMMENT_LENGTH = 128;
15 const unsigned short SC_MAX_ARGUMENT_LENGTH = 1024;
16 const unsigned short SC_MAX_ARGUMENTS = 1024;
18 typedef [handle] LPSTR SVCCTL_HANDLEA;
19 typedef [handle] LPWSTR SVCCTL_HANDLEW;
20 typedef [context_handle] unsigned long SC_RPC_HANDLE;
21 typedef SC_RPC_HANDLE* LPSC_RPC_HANDLE;
22 typedef [context_handle] PVOID SC_RPC_LOCK;
23 typedef SC_RPC_LOCK* LPSC_RPC_LOCK;
24 typedef [context_handle] unsigned long SC_NOTIFY_RPC_HANDLE;
25 typedef SC_NOTIFY_RPC_HANDLE* LPSC_NOTIFY_RPC_HANDLE;
26 typedef [range(0, 1024 * 4)] DWORD BOUNDED_DWORD_4K;
27 typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_4K;
28 typedef [range(0, 1024 * 8)] DWORD BOUNDED_DWORD_8K;
29 typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_8K;
30 typedef [range(0, 1024 * 256)] DWORD BOUNDED_DWORD_256K;
31 typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_256K;
35 typedef struct _SERVICE_STATUS {
38 DWORD dwControlsAccepted;
39 DWORD dwWin32ExitCode;
40 DWORD dwServiceSpecificExitCode;
43 } SERVICE_STATUS, *LPSERVICE_STATUS;
45 typedef struct _SERVICE_STATUS_PROCESS {
48 DWORD dwControlsAccepted;
49 DWORD dwWin32ExitCode;
50 DWORD dwServiceSpecificExitCode;
55 } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;
57 typedef struct _ENUM_SERVICE_STATUSA {
58 [string, range(0, 8 * 1024)] LPSTR lpServiceName;
59 [string, range(0, 8 * 1024)] LPSTR lpDisplayName;
60 SERVICE_STATUS ServiceStatus;
61 } ENUM_SERVICE_STATUSA, *LPENUM_SERVICE_STATUSA;
63 typedef struct _ENUM_SERVICE_STATUSW {
64 [string, range(0, 8 * 1024)] LPWSTR lpServiceName;
65 [string, range(0, 8 * 1024)] LPWSTR lpDisplayName;
66 SERVICE_STATUS ServiceStatus;
67 } ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW;
69 typedef struct _ENUM_SERVICE_STATUS_PROCESSA {
70 [string, range(0, 8 * 1024)] LPSTR lpServiceName;
71 [string, range(0, 8 * 1024)] LPSTR lpDisplayName;
72 SERVICE_STATUS_PROCESS ServiceStatusProcess;
73 } ENUM_SERVICE_STATUS_PROCESSA, *LPENUM_SERVICE_STATUS_PROCESSA;
75 typedef struct _ENUM_SERVICE_STATUS_PROCESSW {
76 [string, range(0, 8 * 1024)] LPWSTR lpServiceName;
77 [string, range(0, 8 * 1024)] LPWSTR lpDisplayName;
78 SERVICE_STATUS_PROCESS ServiceStatusProcess;
79 } ENUM_SERVICE_STATUS_PROCESSW, *LPENUM_SERVICE_STATUS_PROCESSW;
81 typedef struct _QUERY_SERVICE_CONFIGA {
85 [string, range(0, 8 * 1024)] LPSTR lpBinaryPathName;
86 [string, range(0, 8 * 1024)] LPSTR lpLoadOrderGroup;
88 [string, range(0, 8 * 1024)] LPSTR lpDependencies;
89 [string, range(0, 8 * 1024)] LPSTR lpServiceStartName;
91 } QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA;
93 typedef struct _QUERY_SERVICE_CONFIGW {
97 [string, range(0, 8 * 1024)] LPWSTR lpBinaryPathName;
98 [string, range(0, 8 * 1024)] LPWSTR lpLoadOrderGroup;
100 [string, range(0, 8 * 1024)] LPWSTR lpDependencies;
101 [string, range(0, 8 * 1024)] LPWSTR lpServiceStartName;
102 LPWSTR lpDisplayName;
103 } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
105 typedef struct _QUERY_SERVICE_LOCK_STATUSA {
107 [string, range(0, 8 * 1024)] LPSTR lpLockOwner;
108 DWORD dwLockDuration;
109 } QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA;
111 typedef struct _QUERY_SERVICE_LOCK_STATUSW {
113 [string, range(0, 8 * 1024)] LPWSTR lpLockOwner;
114 DWORD dwLockDuration;
115 } QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW;
117 typedef [v1_enum] enum _SC_ACTION_TYPE {
119 SC_ACTION_RESTART = 1,
120 SC_ACTION_REBOOT = 2,
121 SC_ACTION_RUN_COMMAND = 3,
124 typedef struct _SC_ACTION {
127 } SC_ACTION, *LPSC_ACTION;
129 typedef [v1_enum] enum _SC_ENUM_TYPE {
130 SC_ENUM_PROCESS_INFO = 0,
133 typedef struct _SERVICE_DESCRIPTIONA {
134 [string, range(0, 8 * 1024)] LPSTR lpDescription;
135 } SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA;
137 typedef struct _SERVICE_DESCRIPTIONW {
138 [string, range(0, 8 * 1024)] LPWSTR lpDescription;
139 } SERVICE_DESCRIPTIONW, *LPSERVICE_DESCRIPTIONW;
141 typedef struct _SERVICE_FAILURE_ACTIONSA {
143 [string, range(0, 8 * 1024)] LPSTR lpRebootMsg;
144 [string, range(0, 8 * 1024)] LPSTR lpCommand;
145 [range(0, 1024)] DWORD cActions;
146 [size_is(cActions)] SC_ACTION* lpsaActions;
147 } SERVICE_FAILURE_ACTIONSA, *LPSERVICE_FAILURE_ACTIONSA;
149 typedef struct _SERVICE_FAILURE_ACTIONSW {
151 [string, range(0, 8 * 1024)] LPWSTR lpRebootMsg;
152 [string, range(0, 8 * 1024)] LPWSTR lpCommand;
153 [range(0, 1024)] DWORD cActions;
154 [size_is(cActions)] SC_ACTION* lpsaActions;
155 } SERVICE_FAILURE_ACTIONSW, *LPSERVICE_FAILURE_ACTIONSW;
159 typedef struct _SERVICE_DELAYED_AUTO_START_INFO {
160 BOOL fDelayedAutoStart;
161 } SERVICE_DELAYED_AUTO_START_INFO, *LPSERVICE_DELAYED_AUTO_START_INFO;
163 typedef struct _SERVICE_FAILURE_ACTIONS_FLAG {
164 BOOL fFailureActionsOnNonCrashFailures;
165 } SERVICE_FAILURE_ACTIONS_FLAG, *LPSERVICE_FAILURE_ACTIONS_FLAG;
167 typedef struct _SERVICE_SID_INFO {
168 DWORD dwServicesSidType;
169 } SERVICE_SID_INFO, *LPSERVICE_SID_INFO;
171 typedef struct _SERVICE_RPC_REQUIRED_PRIVILEGES_INFO {
172 [range(0, 1024 * 4)] DWORD cbRequiredPrivileges;
173 [size_is(cbRequiredPrivileges)] PBYTE pRequiredPrivileges;
174 } SERVICE_RPC_REQUIRED_PRIVILEGES_INFO, *LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO;
176 typedef struct _SERVICE_PRESHUTDOWN_INFO {
177 DWORD dwPreshutdownTimeout;
178 } SERVICE_PRESHUTDOWN_INFO, *LPSERVICE_PRESHUTDOWN_INFO;
180 typedef struct _SC_RPC_CONFIG_INFOA {
182 [switch_is(dwInfoLevel)] union {
183 [case(1)] LPSERVICE_DESCRIPTIONA psd;
184 [case(2)] LPSERVICE_FAILURE_ACTIONSA psfa;
185 [case(3)] LPSERVICE_DELAYED_AUTO_START_INFO psda;
186 [case(4)] LPSERVICE_FAILURE_ACTIONS_FLAG psfaf;
187 [case(5)] LPSERVICE_SID_INFO pssid;
188 [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
189 [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
191 } SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA;
193 typedef struct _SC_RPC_CONFIG_INFOW {
195 [switch_is(dwInfoLevel)] union {
196 [case(1)] LPSERVICE_DESCRIPTIONW psd;
197 [case(2)] LPSERVICE_FAILURE_ACTIONSW psfa;
198 [case(3)] LPSERVICE_DELAYED_AUTO_START_INFO psda;
199 [case(4)] LPSERVICE_FAILURE_ACTIONS_FLAG psfaf;
200 [case(5)] LPSERVICE_SID_INFO pssid;
201 [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
202 [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
204 } SC_RPC_CONFIG_INFOW, *LPSC_RPC_CONFIG_INFOW;
206 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 {
207 ULONGLONG ullThreadId;
209 UCHAR CallbackAddressArray[16];
210 UCHAR CallbackParamAddressArray[16];
211 SERVICE_STATUS_PROCESS ServiceStatus;
212 DWORD dwNotificationStatus;
214 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1;
216 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 {
217 ULONGLONG ullThreadId;
219 UCHAR CallbackAddressArray[16];
220 UCHAR CallbackParamAddressArray[16];
221 SERVICE_STATUS_PROCESS ServiceStatus;
222 DWORD dwNotificationStatus;
224 DWORD dwNotificationTriggered;
225 [string, range(0, 64 * 1024)] PWSTR pszServiceNames;
226 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2;
228 typedef struct _SC_RPC_NOTIFY_PARAMS {
230 [switch_is(dwInfoLevel)] union {
231 [case(1)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 pStatusChangeParam1;
232 [case(2)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 pStatusChangeParam2;
234 } SC_RPC_NOTIFY_PARAMS, *LPSC_RPC_NOTIFY_PARAMS;
236 typedef struct _SC_RPC_NOTIFY_PARAMS_LIST {
237 BOUNDED_DWORD_4K cElements;
238 [size_is(cElements)] SC_RPC_NOTIFY_PARAMS NotifyParamsArray[];
239 } SC_RPC_NOTIFY_PARAMS_LIST, *PSC_RPC_NOTIFY_PARAMS_LIST;
245 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSA {
246 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA psrInParams;
247 } SC_RPC_SERVICE_CONTROL_IN_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSA;
250 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSW {
251 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW psrInParams;
252 } SC_RPC_SERVICE_CONTROL_IN_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSW;
255 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSA {
256 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams;
257 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSA;
260 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSW {
261 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams;
262 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSW;
265 typedef [v1_enum] enum _SC_STATUS_TYPE {
266 SC_STATUS_PROCESS_INFO = 0,
269 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA {
271 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPSTR pszComment;
272 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA;
274 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW {
276 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPWSTR pszComment;
277 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW;
279 typedef struct _SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS {
280 SERVICE_STATUS_PROCESS ServiceStatus;
281 } SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS, *LPSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS;
283 typedef SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 SERVICE_NOTIFY_STATUS_CHANGE_PARAMS, *LPSERVICE_NOTIFY_STATUS_CHANGE_PARAMS;
287 typedef struct _STRING_PTRSA {
288 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPSTR StringPtr;
289 } STRING_PTRSA, *PSTRING_PTRSA, *LPSTRING_PTRSA;
291 typedef struct _STRING_PTRSW {
292 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPWSTR StringPtr;
293 } STRING_PTRSW, *PSTRING_PTRSW, *LPSTRING_PTRSW;
296 uuid(367abb81-9844-35f1-ad32-98f038001003),
298 pointer_default(unique),
306 DWORD RCloseServiceHandle(
307 [in] handle_t BindingHandle,
308 [in, out] LPSC_RPC_HANDLE hSCObject);
311 DWORD RControlService(
312 [in] handle_t BindingHandle,
313 [in] SC_RPC_HANDLE hService,
314 [in] DWORD dwControl,
315 [out] LPSERVICE_STATUS lpServiceStatus);
318 DWORD RDeleteService(
319 [in] handle_t BindingHandle,
320 [in] SC_RPC_HANDLE hService);
323 DWORD RLockServiceDatabase(
324 [in] handle_t BindingHandle,
325 [in] SC_RPC_HANDLE hSCManager,
326 [out] LPSC_RPC_LOCK lpLock);
329 DWORD RQueryServiceObjectSecurity(
330 [in] handle_t BindingHandle,
331 [in] SC_RPC_HANDLE hService,
332 [in] SECURITY_INFORMATION dwSecurityInformation,
333 [out, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor,
334 [in, range(0, 1024 * 256)] DWORD cbBufSize,
335 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded);
338 DWORD RSetServiceObjectSecurity(
339 [in] handle_t BindingHandle,
340 [in] SC_RPC_HANDLE hService,
341 [in] DWORD dwSecurityInformation,
342 [in, size_is(dwSecuityDescriptorSize)] LPBYTE lpSecurityDescriptor,
343 [in] DWORD dwSecuityDescriptorSize);
346 DWORD RQueryServiceStatus(
347 [in] handle_t BindingHandle,
348 [in] SC_RPC_HANDLE hService,
349 [out] LPSERVICE_STATUS lpServiceStatus);
352 DWORD RSetServiceStatus(
353 [in] handle_t BindingHandle,
354 [in] SC_RPC_HANDLE hServiceStatus,
355 [in] LPSERVICE_STATUS lpServiceStatus);
358 DWORD RUnlockServiceDatabase(
359 [in] handle_t BindingHandle,
360 [in, out] LPSC_RPC_LOCK Lock);
363 DWORD RNotifyBootConfigStatus(
364 [in] handle_t BindingHandle,
365 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName,
366 [in] DWORD BootAcceptable);
369 DWORD RI_ScSetServiceBitsW(
370 [in] handle_t BindingHandle,
371 [in] SC_RPC_HANDLE hServiceStatus,
372 [in] DWORD dwServiceBits,
373 [in] BOOL bSetBitsOn,
374 [in] BOOL bUpdateImmediately,
375 [in, string, unique] LPWSTR lpString);
378 DWORD RChangeServiceConfigW(
379 [in] handle_t BindingHandle,
380 [in] SC_RPC_HANDLE hService,
381 [in] DWORD dwServiceType,
382 [in] DWORD dwStartType,
383 [in] DWORD dwErrorControl,
384 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
385 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpLoadOrderGroup,
386 [in, out, unique] LPDWORD lpdwTagId,
387 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
388 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
389 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
390 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
391 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
392 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName);
395 DWORD RCreateServiceW(
396 [in] handle_t BindingHandle,
397 [in] SC_RPC_HANDLE hSCManager,
398 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
399 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
400 [in] DWORD dwDesiredAccess,
401 [in] DWORD dwServiceType,
402 [in] DWORD dwStartType,
403 [in] DWORD dwErrorControl,
404 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
405 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
406 [in, out, unique] LPDWORD lpdwTagId,
407 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
408 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
409 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
410 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
411 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
412 [out] LPSC_RPC_HANDLE lpServiceHandle);
415 DWORD REnumDependentServicesW(
416 [in] handle_t BindingHandle,
417 [in] SC_RPC_HANDLE hService,
418 [in] DWORD dwServiceState,
419 [out, size_is(cbBufSize)] LPBYTE lpServices,
420 [in, range(0, 1024*256)] DWORD cbBufSize,
421 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
422 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
425 DWORD REnumServicesStatusW(
426 [in] handle_t BindingHandle,
427 [in] SC_RPC_HANDLE hSCManager,
428 [in] DWORD dwServiceType,
429 [in] DWORD dwServiceState,
430 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
431 [in, range(0, 1024*256)] DWORD dwBufSize,
432 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
433 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
434 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
437 DWORD ROpenSCManagerW(
438 [in] handle_t BindingHandle,
439 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] LPWSTR lpMachineName,
440 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDatabaseName,
441 [in] DWORD dwDesiredAccess,
442 [out] LPSC_RPC_HANDLE lpScHandle);
446 [in] handle_t BindingHandle,
447 [in] SC_RPC_HANDLE hSCManager,
448 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
449 [in] DWORD dwDesiredAccess,
450 [out] LPSC_RPC_HANDLE lpServiceHandle);
453 DWORD RQueryServiceConfigW(
454 [in] handle_t BindingHandle,
455 [in] SC_RPC_HANDLE hService,
456 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
457 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGW lpServiceConfig, */
458 [in, range(0, 1024*8)] DWORD cbBufSize,
459 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
462 DWORD RQueryServiceLockStatusW(
463 [in] handle_t BindingHandle,
464 [in] SC_RPC_HANDLE hSCManager,
465 [out] LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
466 [in, range(0, 1024*4)] DWORD cbBufSize,
467 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
470 DWORD RStartServiceW(
471 [in] handle_t BindingHandle,
472 [in] SC_RPC_HANDLE hService,
473 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
474 [in, unique, size_is(argc)] LPSTRING_PTRSW argv);
477 DWORD RGetServiceDisplayNameW(
478 [in] handle_t BindingHandle,
479 [in] SC_RPC_HANDLE hSCManager,
480 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
481 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpDisplayName,
482 [in, out] DWORD* lpcchBuffer);
485 DWORD RGetServiceKeyNameW(
486 [in] handle_t BindingHandle,
487 [in] SC_RPC_HANDLE hSCManager,
488 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
489 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpServiceName,
490 [in, out] DWORD* lpcchBuffer);
493 DWORD RI_ScSetServiceBitsA(
494 [in] handle_t BindingHandle,
495 [in] SC_RPC_HANDLE hServiceStatus,
496 [in] DWORD dwServiceBits,
497 [in] BOOL bSetBitsOn,
498 [in] BOOL bUpdateImmediately,
499 [in, string, unique] LPSTR lpString);
502 DWORD RChangeServiceConfigA(
503 [in] handle_t BindingHandle,
504 [in] SC_RPC_HANDLE hService,
505 [in] DWORD dwServiceType,
506 [in] DWORD dwStartType,
507 [in] DWORD dwErrorControl,
508 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
509 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
510 [in, out, unique] LPDWORD lpdwTagId,
511 [in, unique, size_is(dwDependSize)] LPSTR lpDependencies,
512 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
513 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
514 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
515 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
516 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName);
519 DWORD RCreateServiceA(
520 [in] handle_t BindingHandle,
521 [in] SC_RPC_HANDLE hSCManager,
522 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
523 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
524 [in] DWORD dwDesiredAccess,
525 [in] DWORD dwServiceType,
526 [in] DWORD dwStartType,
527 [in] DWORD dwErrorControl,
528 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
529 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
530 [in, out, unique] LPDWORD lpdwTagId,
531 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
532 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
533 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
534 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
535 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
536 [out] LPSC_RPC_HANDLE lpServiceHandle);
539 DWORD REnumDependentServicesA(
540 [in] handle_t BindingHandle,
541 [in] SC_RPC_HANDLE hService,
542 [in] DWORD dwServiceState,
543 [out, size_is(cbBufSize)] LPBYTE lpServices,
544 [in, range(0, 1024*256)] DWORD cbBufSize,
545 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
546 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
549 DWORD REnumServicesStatusA(
550 [in] handle_t BindingHandle,
551 [in] SC_RPC_HANDLE hSCManager,
552 [in] DWORD dwServiceType,
553 [in] DWORD dwServiceState,
554 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
555 [in, range(0, 1024*256)] DWORD dwBufSize,
556 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
557 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
558 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
561 DWORD ROpenSCManagerA(
562 [in] handle_t BindingHandle,
563 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] LPSTR lpMachineName,
564 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDatabaseName,
565 [in] DWORD dwDesiredAccess,
566 [out] LPSC_RPC_HANDLE lpScHandle);
570 [in] handle_t BindingHandle,
571 [in] SC_RPC_HANDLE hSCManager,
572 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
573 [in] DWORD dwDesiredAccess,
574 [out] LPSC_RPC_HANDLE lpServiceHandle);
577 DWORD RQueryServiceConfigA(
578 [in] handle_t BindingHandle,
579 [in] SC_RPC_HANDLE hService,
580 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
581 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig, */
582 [in, range(0, 1024*8)] DWORD cbBufSize,
583 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
586 DWORD RQueryServiceLockStatusA(
587 [in] handle_t BindingHandle,
588 [in] SC_RPC_HANDLE hSCManager,
589 [out] LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus,
590 [in, range(0, 1024*4)] DWORD cbBufSize,
591 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
594 DWORD RStartServiceA(
595 [in] handle_t BindingHandle,
596 [in] SC_RPC_HANDLE hService,
597 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
598 [in, unique, size_is(argc)] LPSTRING_PTRSA argv);
601 DWORD RGetServiceDisplayNameA(
602 [in] handle_t BindingHandle,
603 [in] SC_RPC_HANDLE hSCManager,
604 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
605 [out, string, size_is(*lpcchBuffer)] LPSTR lpDisplayName,
606 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
609 DWORD RGetServiceKeyNameA(
610 [in] handle_t BindingHandle,
611 [in] SC_RPC_HANDLE hSCManager,
612 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
613 [out, string, size_is(*lpcchBuffer)] LPSTR lpKeyName,
614 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
617 DWORD RI_ScGetCurrentGroupStateW(
618 [in] handle_t BindingHandle,
619 [in] SC_RPC_HANDLE hSCManager,
620 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
621 [out] LPDWORD lpState);
624 DWORD REnumServiceGroupW(
625 [in] handle_t BindingHandle,
626 [in] SC_RPC_HANDLE hSCManager,
627 [in] DWORD dwServiceType,
628 [in] DWORD dwServiceState,
629 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
630 [in, range(0, 1024*256)] DWORD cbBufSize,
631 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
632 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
633 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
634 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
637 DWORD RChangeServiceConfig2A(
638 [in] handle_t BindingHandle,
639 [in] SC_RPC_HANDLE hService,
640 [in] SC_RPC_CONFIG_INFOA Info);
643 DWORD RChangeServiceConfig2W(
644 [in] handle_t BindingHandle,
645 [in] SC_RPC_HANDLE hService,
646 [in] SC_RPC_CONFIG_INFOW Info);
649 DWORD RQueryServiceConfig2A(
650 [in] handle_t BindingHandle,
651 [in] SC_RPC_HANDLE hService,
652 [in] DWORD dwInfoLevel,
653 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
654 [in, range(0, 1024*8)] DWORD cbBufSize,
655 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
658 DWORD RQueryServiceConfig2W(
659 [in] handle_t BindingHandle,
660 [in] SC_RPC_HANDLE hService,
661 [in] DWORD dwInfoLevel,
662 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
663 [in, range(0, 1024*8)] DWORD cbBufSize,
664 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
667 DWORD RQueryServiceStatusEx(
668 [in] handle_t BindingHandle,
669 [in] SC_RPC_HANDLE hService,
670 [in] SC_STATUS_TYPE InfoLevel,
671 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
672 [in, range(0, 1024*8)] DWORD cbBufSize,
673 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
676 DWORD REnumServicesStatusExA(
677 [in] handle_t BindingHandle,
678 [in] SC_RPC_HANDLE hSCManager,
679 [in] SC_ENUM_TYPE InfoLevel,
680 [in] DWORD dwServiceType,
681 [in] DWORD dwServiceState,
682 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
683 [in, range(0, 1024 * 256)] DWORD cbBufSize,
684 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
685 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
686 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
687 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCSTR pszGroupName);
690 DWORD REnumServicesStatusExW(
691 [in] handle_t BindingHandle,
692 [in] SC_RPC_HANDLE hSCManager,
693 [in] SC_ENUM_TYPE InfoLevel,
694 [in] DWORD dwServiceType,
695 [in] DWORD dwServiceState,
696 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
697 [in, range(0, 1024 * 256)] DWORD cbBufSize,
698 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
699 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
700 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
701 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
704 DWORD RSendTSMessage(
705 [in] handle_t BindingHandle); /* FIXME */
708 DWORD RCreateServiceWOW64A(
709 [in] handle_t BindingHandle,
710 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
711 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
712 [in] DWORD dwDesiredAccess,
713 [in] DWORD dwServiceType,
714 [in] DWORD dwStartType,
715 [in] DWORD dwErrorControl,
716 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
717 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
718 [in, out, unique] LPDWORD lpdwTagId,
719 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
720 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
721 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
722 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
723 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
724 [out] LPSC_RPC_HANDLE lpServiceHandle);
727 DWORD RCreateServiceWOW64W(
728 [in] handle_t BindingHandle,
729 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
730 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
731 [in] DWORD dwDesiredAccess,
732 [in] DWORD dwServiceType,
733 [in] DWORD dwStartType,
734 [in] DWORD dwErrorControl,
735 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
736 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
737 [in, out, unique] LPDWORD lpdwTagId,
738 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
739 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
740 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
741 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
742 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
743 [out] LPSC_RPC_HANDLE lpServiceHandle);
746 DWORD RQueryServiceTagInfo(
747 [in] handle_t BindingHandle); /* FIXME */
750 DWORD RNotifyServiceStatusChange(
751 [in] handle_t BindingHandle,
752 [in] SC_RPC_HANDLE hService,
753 [in] SC_RPC_NOTIFY_PARAMS NotifyParams,
754 [in] GUID* pClientProcessGuid,
755 [out] GUID* pSCMProcessGuid,
756 [out] PBOOL pfCreateRemoteQueue,
757 [out] LPSC_NOTIFY_RPC_HANDLE phNotify);
760 DWORD RGetNotifyResults(
761 [in] handle_t BindingHandle,
762 [in] SC_NOTIFY_RPC_HANDLE hNotify,
763 [out] PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams);
766 DWORD RCloseNotifyHandle(
767 [in] handle_t BindingHandle,
768 [in, out] LPSC_NOTIFY_RPC_HANDLE phNotify,
769 [out] PBOOL pfApcFired);
772 DWORD RControlServiceExA(
773 [in] handle_t BindingHandle,
774 [in] SC_RPC_HANDLE hService,
775 [in] DWORD dwControl,
776 [in] DWORD dwInfoLevel/*,
777 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlInParams,
778 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlOutParams*/);
781 DWORD RControlServiceExW(
782 [in] handle_t BindingHandle,
783 [in] SC_RPC_HANDLE hService,
784 [in] DWORD dwControl,
785 [in] DWORD dwInfoLevel/*,
786 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlInParams,
787 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlOutParams*/);
790 DWORD RSendPnPMessage(
791 [in] handle_t BindingHandle); /* FIXME */
794 DWORD RValidatePnPService(
795 [in] handle_t BindingHandle); /* FIXME */
798 DWORD ROpenServiceStatusHandle(
799 [in] handle_t BindingHandle); /* FIXME */
803 [in] handle_t BindingHandle); /* FIXME */