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 [handle] ULONG_PTR RPC_SERVICE_STATUS_HANDLE;
21 typedef /*[context_handle]*/ unsigned long SC_RPC_HANDLE;
22 typedef SC_RPC_HANDLE* LPSC_RPC_HANDLE;
23 typedef /*[context_handle]*/ unsigned long SC_RPC_LOCK;
24 typedef SC_RPC_LOCK* LPSC_RPC_LOCK;
25 typedef /*[context_handle]*/ unsigned long SC_NOTIFY_RPC_HANDLE;
26 typedef SC_NOTIFY_RPC_HANDLE* LPSC_NOTIFY_RPC_HANDLE;
27 typedef [range(0, 1024 * 4)] DWORD BOUNDED_DWORD_4K;
28 typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_4K;
29 typedef [range(0, 1024 * 8)] DWORD BOUNDED_DWORD_8K;
30 typedef BOUNDED_DWORD_8K* LPBOUNDED_DWORD_8K;
31 typedef [range(0, 1024 * 256)] DWORD BOUNDED_DWORD_256K;
32 typedef BOUNDED_DWORD_256K* LPBOUNDED_DWORD_256K;
36 typedef struct _SERVICE_STATUS {
39 DWORD dwControlsAccepted;
40 DWORD dwWin32ExitCode;
41 DWORD dwServiceSpecificExitCode;
44 } SERVICE_STATUS, *LPSERVICE_STATUS;
46 typedef struct _SERVICE_STATUS_PROCESS {
49 DWORD dwControlsAccepted;
50 DWORD dwWin32ExitCode;
51 DWORD dwServiceSpecificExitCode;
56 } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;
58 typedef struct _ENUM_SERVICE_STATUSA {
59 [string, range(0, 8 * 1024)] LPSTR lpServiceName;
60 [string, range(0, 8 * 1024)] LPSTR lpDisplayName;
61 SERVICE_STATUS ServiceStatus;
62 } ENUM_SERVICE_STATUSA, *LPENUM_SERVICE_STATUSA;
64 typedef struct _ENUM_SERVICE_STATUSW {
65 [string, range(0, 8 * 1024)] LPWSTR lpServiceName;
66 [string, range(0, 8 * 1024)] LPWSTR lpDisplayName;
67 SERVICE_STATUS ServiceStatus;
68 } ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW;
70 typedef struct _ENUM_SERVICE_STATUS_PROCESSA {
71 [string, range(0, 8 * 1024)] LPSTR lpServiceName;
72 [string, range(0, 8 * 1024)] LPSTR lpDisplayName;
73 SERVICE_STATUS_PROCESS ServiceStatusProcess;
74 } ENUM_SERVICE_STATUS_PROCESSA, *LPENUM_SERVICE_STATUS_PROCESSA;
76 typedef struct _ENUM_SERVICE_STATUS_PROCESSW {
77 [string, range(0, 8 * 1024)] LPWSTR lpServiceName;
78 [string, range(0, 8 * 1024)] LPWSTR lpDisplayName;
79 SERVICE_STATUS_PROCESS ServiceStatusProcess;
80 } ENUM_SERVICE_STATUS_PROCESSW, *LPENUM_SERVICE_STATUS_PROCESSW;
82 typedef struct _QUERY_SERVICE_CONFIGA {
86 [string, range(0, 8 * 1024)] LPSTR lpBinaryPathName;
87 [string, range(0, 8 * 1024)] LPSTR lpLoadOrderGroup;
89 [string, range(0, 8 * 1024)] LPSTR lpDependencies;
90 [string, range(0, 8 * 1024)] LPSTR lpServiceStartName;
92 } QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA;
94 typedef struct _QUERY_SERVICE_CONFIGW {
98 [string, range(0, 8 * 1024)] LPWSTR lpBinaryPathName;
99 [string, range(0, 8 * 1024)] LPWSTR lpLoadOrderGroup;
101 [string, range(0, 8 * 1024)] LPWSTR lpDependencies;
102 [string, range(0, 8 * 1024)] LPWSTR lpServiceStartName;
103 LPWSTR lpDisplayName;
104 } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
106 typedef struct _QUERY_SERVICE_LOCK_STATUSA {
108 [string, range(0, 8 * 1024)] LPSTR lpLockOwner;
109 DWORD dwLockDuration;
110 } QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA;
112 typedef struct _QUERY_SERVICE_LOCK_STATUSW {
114 [string, range(0, 8 * 1024)] LPWSTR lpLockOwner;
115 DWORD dwLockDuration;
116 } QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW;
118 typedef [v1_enum] enum _SC_ACTION_TYPE {
120 SC_ACTION_RESTART = 1,
121 SC_ACTION_REBOOT = 2,
122 SC_ACTION_RUN_COMMAND = 3,
125 typedef struct _SC_ACTION {
128 } SC_ACTION, *LPSC_ACTION;
130 typedef [v1_enum] enum _SC_ENUM_TYPE {
131 SC_ENUM_PROCESS_INFO = 0,
134 typedef struct _SERVICE_DESCRIPTIONA {
135 [string, range(0, 8 * 1024)] LPSTR lpDescription;
136 } SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA;
138 typedef struct _SERVICE_DESCRIPTIONW {
139 [string, range(0, 8 * 1024)] LPWSTR lpDescription;
140 } SERVICE_DESCRIPTIONW, *LPSERVICE_DESCRIPTIONW;
142 typedef struct _SERVICE_FAILURE_ACTIONSA {
144 [string, range(0, 8 * 1024)] LPSTR lpRebootMsg;
145 [string, range(0, 8 * 1024)] LPSTR lpCommand;
146 [range(0, 1024)] DWORD cActions;
147 [size_is(cActions)] SC_ACTION* lpsaActions;
148 } SERVICE_FAILURE_ACTIONSA, *LPSERVICE_FAILURE_ACTIONSA;
150 typedef struct _SERVICE_FAILURE_ACTIONSW {
152 [string, range(0, 8 * 1024)] LPWSTR lpRebootMsg;
153 [string, range(0, 8 * 1024)] LPWSTR lpCommand;
154 [range(0, 1024)] DWORD cActions;
155 [size_is(cActions)] SC_ACTION* lpsaActions;
156 } SERVICE_FAILURE_ACTIONSW, *LPSERVICE_FAILURE_ACTIONSW;
160 typedef struct _SERVICE_DELAYED_AUTO_START_INFO {
161 BOOL fDelayedAutoStart;
162 } SERVICE_DELAYED_AUTO_START_INFO, *LPSERVICE_DELAYED_AUTO_START_INFO;
164 typedef struct _SERVICE_FAILURE_ACTIONS_FLAG {
165 BOOL fFailureActionsOnNonCrashFailures;
166 } SERVICE_FAILURE_ACTIONS_FLAG, *LPSERVICE_FAILURE_ACTIONS_FLAG;
168 typedef struct _SERVICE_SID_INFO {
169 DWORD dwServicesSidType;
170 } SERVICE_SID_INFO, *LPSERVICE_SID_INFO;
172 typedef struct _SERVICE_RPC_REQUIRED_PRIVILEGES_INFO {
173 [range(0, 1024 * 4)] DWORD cbRequiredPrivileges;
174 [size_is(cbRequiredPrivileges)] PBYTE pRequiredPrivileges;
175 } SERVICE_RPC_REQUIRED_PRIVILEGES_INFO, *LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO;
177 typedef struct _SERVICE_PRESHUTDOWN_INFO {
178 DWORD dwPreshutdownTimeout;
179 } SERVICE_PRESHUTDOWN_INFO, *LPSERVICE_PRESHUTDOWN_INFO;
181 typedef struct _SC_RPC_CONFIG_INFOA {
183 [switch_is(dwInfoLevel)] union {
184 [case(1)] LPSERVICE_DESCRIPTIONA psd;
185 [case(2)] LPSERVICE_FAILURE_ACTIONSA psfa;
186 [case(3)] LPSERVICE_DELAYED_AUTO_START_INFO psda;
187 [case(4)] LPSERVICE_FAILURE_ACTIONS_FLAG psfaf;
188 [case(5)] LPSERVICE_SID_INFO pssid;
189 [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
190 [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
192 } SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA;
194 typedef struct _SC_RPC_CONFIG_INFOW {
196 [switch_is(dwInfoLevel)] union {
197 [case(1)] LPSERVICE_DESCRIPTIONW psd;
198 [case(2)] LPSERVICE_FAILURE_ACTIONSW psfa;
199 [case(3)] LPSERVICE_DELAYED_AUTO_START_INFO psda;
200 [case(4)] LPSERVICE_FAILURE_ACTIONS_FLAG psfaf;
201 [case(5)] LPSERVICE_SID_INFO pssid;
202 [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
203 [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
205 } SC_RPC_CONFIG_INFOW, *LPSC_RPC_CONFIG_INFOW;
207 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 {
208 ULONGLONG ullThreadId;
210 UCHAR CallbackAddressArray[16];
211 UCHAR CallbackParamAddressArray[16];
212 SERVICE_STATUS_PROCESS ServiceStatus;
213 DWORD dwNotificationStatus;
215 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1;
217 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 {
218 ULONGLONG ullThreadId;
220 UCHAR CallbackAddressArray[16];
221 UCHAR CallbackParamAddressArray[16];
222 SERVICE_STATUS_PROCESS ServiceStatus;
223 DWORD dwNotificationStatus;
225 DWORD dwNotificationTriggered;
226 [string, range(0, 64 * 1024)] PWSTR pszServiceNames;
227 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2;
229 typedef struct _SC_RPC_NOTIFY_PARAMS {
231 [switch_is(dwInfoLevel)] union {
232 [case(1)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 pStatusChangeParam1;
233 [case(2)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 pStatusChangeParam2;
235 } SC_RPC_NOTIFY_PARAMS, *LPSC_RPC_NOTIFY_PARAMS;
237 typedef struct _SC_RPC_NOTIFY_PARAMS_LIST {
238 BOUNDED_DWORD_4K cElements;
239 [size_is(cElements)] SC_RPC_NOTIFY_PARAMS NotifyParamsArray[];
240 } SC_RPC_NOTIFY_PARAMS_LIST, *PSC_RPC_NOTIFY_PARAMS_LIST;
246 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSA {
247 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA psrInParams;
248 } SC_RPC_SERVICE_CONTROL_IN_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSA;
251 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSW {
252 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW psrInParams;
253 } SC_RPC_SERVICE_CONTROL_IN_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSW;
256 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSA {
257 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams;
258 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSA;
261 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSW {
262 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams;
263 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSW;
266 typedef [v1_enum] enum _SC_STATUS_TYPE {
267 SC_STATUS_PROCESS_INFO = 0,
270 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA {
272 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPSTR pszComment;
273 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA;
275 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW {
277 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPWSTR pszComment;
278 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW;
280 typedef struct _SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS {
281 SERVICE_STATUS_PROCESS ServiceStatus;
282 } SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS, *LPSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS;
284 typedef SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 SERVICE_NOTIFY_STATUS_CHANGE_PARAMS, *LPSERVICE_NOTIFY_STATUS_CHANGE_PARAMS;
288 typedef struct _STRING_PTRSA {
289 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPSTR StringPtr;
290 } STRING_PTRSA, *PSTRING_PTRSA, *LPSTRING_PTRSA;
292 typedef struct _STRING_PTRSW {
293 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPWSTR StringPtr;
294 } STRING_PTRSW, *PSTRING_PTRSW, *LPSTRING_PTRSW;
297 uuid(367abb81-9844-35f1-ad32-98f038001003),
299 pointer_default(unique),
307 DWORD RCloseServiceHandle(
308 [in] handle_t BindingHandle,
309 [in, out] LPSC_RPC_HANDLE hSCObject);
312 DWORD RControlService(
313 [in] handle_t BindingHandle,
314 [in] SC_RPC_HANDLE hService,
315 [in] DWORD dwControl,
316 [out] LPSERVICE_STATUS lpServiceStatus);
319 DWORD RDeleteService(
320 [in] handle_t BindingHandle,
321 [in] SC_RPC_HANDLE hService);
324 DWORD RLockServiceDatabase(
325 [in] handle_t BindingHandle,
326 [in] SC_RPC_HANDLE hSCManager,
327 [out] LPSC_RPC_LOCK lpLock);
330 DWORD RQueryServiceObjectSecurity(
331 [in] handle_t BindingHandle,
332 [in] SC_RPC_HANDLE hService,
333 [in] SECURITY_INFORMATION dwSecurityInformation,
334 [out, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor,
335 [in, range(0, 1024 * 256)] DWORD cbBufSize,
336 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded);
339 DWORD RSetServiceObjectSecurity(
340 [in] handle_t BindingHandle,
341 [in] SC_RPC_HANDLE hService,
342 [in] DWORD dwSecurityInformation,
343 [in, size_is(dwSecuityDescriptorSize)] LPBYTE lpSecurityDescriptor,
344 [in] DWORD dwSecuityDescriptorSize);
347 DWORD RQueryServiceStatus(
348 [in] handle_t BindingHandle,
349 [in] SC_RPC_HANDLE hService,
350 [out] LPSERVICE_STATUS lpServiceStatus);
353 DWORD RSetServiceStatus(
354 // [in] handle_t BindingHandle,
355 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
356 [in] LPSERVICE_STATUS lpServiceStatus);
359 DWORD RUnlockServiceDatabase(
360 [in] handle_t BindingHandle,
361 [in, out] LPSC_RPC_LOCK Lock);
364 DWORD RNotifyBootConfigStatus(
365 [in] handle_t BindingHandle,
366 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName,
367 [in] DWORD BootAcceptable);
370 DWORD RI_ScSetServiceBitsW(
371 // [in] handle_t BindingHandle,
372 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
373 [in] DWORD dwServiceBits,
374 [in] BOOL bSetBitsOn,
375 [in] BOOL bUpdateImmediately,
376 [in, string, unique] LPWSTR lpString);
379 DWORD RChangeServiceConfigW(
380 [in] handle_t BindingHandle,
381 [in] SC_RPC_HANDLE hService,
382 [in] DWORD dwServiceType,
383 [in] DWORD dwStartType,
384 [in] DWORD dwErrorControl,
385 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
386 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpLoadOrderGroup,
387 [in, out, unique] LPDWORD lpdwTagId,
388 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
389 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
390 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
391 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
392 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
393 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName);
396 DWORD RCreateServiceW(
397 [in] handle_t BindingHandle,
398 [in] SC_RPC_HANDLE hSCManager,
399 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
400 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
401 [in] DWORD dwDesiredAccess,
402 [in] DWORD dwServiceType,
403 [in] DWORD dwStartType,
404 [in] DWORD dwErrorControl,
405 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
406 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
407 [in, out, unique] LPDWORD lpdwTagId,
408 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
409 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
410 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
411 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
412 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
413 [out] LPSC_RPC_HANDLE lpServiceHandle);
416 DWORD REnumDependentServicesW(
417 [in] handle_t BindingHandle,
418 [in] SC_RPC_HANDLE hService,
419 [in] DWORD dwServiceState,
420 [out, size_is(cbBufSize)] LPBYTE lpServices,
421 [in, range(0, 1024*256)] DWORD cbBufSize,
422 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
423 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
426 DWORD REnumServicesStatusW(
427 [in] handle_t BindingHandle,
428 [in] SC_RPC_HANDLE hSCManager,
429 [in] DWORD dwServiceType,
430 [in] DWORD dwServiceState,
431 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
432 [in, range(0, 1024*256)] DWORD dwBufSize,
433 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
434 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
435 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
438 DWORD ROpenSCManagerW(
439 // [in] handle_t BindingHandle,
440 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName,
441 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDatabaseName,
442 [in] DWORD dwDesiredAccess,
443 [out] LPSC_RPC_HANDLE lpScHandle);
447 [in] handle_t BindingHandle,
448 [in] SC_RPC_HANDLE hSCManager,
449 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
450 [in] DWORD dwDesiredAccess,
451 [out] LPSC_RPC_HANDLE lpServiceHandle);
454 DWORD RQueryServiceConfigW(
455 [in] handle_t BindingHandle,
456 [in] SC_RPC_HANDLE hService,
457 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
458 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGW lpServiceConfig, */
459 [in, range(0, 1024*8)] DWORD cbBufSize,
460 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
463 DWORD RQueryServiceLockStatusW(
464 [in] handle_t BindingHandle,
465 [in] SC_RPC_HANDLE hSCManager,
466 [out] LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
467 [in, range(0, 1024*4)] DWORD cbBufSize,
468 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
471 DWORD RStartServiceW(
472 [in] handle_t BindingHandle,
473 [in] SC_RPC_HANDLE hService,
474 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
475 [in, unique, size_is(argc)] LPSTRING_PTRSW argv);
478 DWORD RGetServiceDisplayNameW(
479 [in] handle_t BindingHandle,
480 [in] SC_RPC_HANDLE hSCManager,
481 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
482 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpDisplayName,
483 [in, out] DWORD* lpcchBuffer);
486 DWORD RGetServiceKeyNameW(
487 [in] handle_t BindingHandle,
488 [in] SC_RPC_HANDLE hSCManager,
489 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
490 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpServiceName,
491 [in, out] DWORD* lpcchBuffer);
494 DWORD RI_ScSetServiceBitsA(
495 // [in] handle_t BindingHandle,
496 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
497 [in] DWORD dwServiceBits,
498 [in] BOOL bSetBitsOn,
499 [in] BOOL bUpdateImmediately,
500 [in, string, unique] LPSTR lpString);
503 DWORD RChangeServiceConfigA(
504 [in] handle_t BindingHandle,
505 [in] SC_RPC_HANDLE hService,
506 [in] DWORD dwServiceType,
507 [in] DWORD dwStartType,
508 [in] DWORD dwErrorControl,
509 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
510 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
511 [in, out, unique] LPDWORD lpdwTagId,
512 [in, unique, size_is(dwDependSize)] LPSTR lpDependencies,
513 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
514 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
515 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
516 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
517 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName);
520 DWORD RCreateServiceA(
521 [in] handle_t BindingHandle,
522 [in] SC_RPC_HANDLE hSCManager,
523 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
524 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
525 [in] DWORD dwDesiredAccess,
526 [in] DWORD dwServiceType,
527 [in] DWORD dwStartType,
528 [in] DWORD dwErrorControl,
529 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
530 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
531 [in, out, unique] LPDWORD lpdwTagId,
532 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
533 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
534 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
535 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
536 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
537 [out] LPSC_RPC_HANDLE lpServiceHandle);
540 DWORD REnumDependentServicesA(
541 [in] handle_t BindingHandle,
542 [in] SC_RPC_HANDLE hService,
543 [in] DWORD dwServiceState,
544 [out, size_is(cbBufSize)] LPBYTE lpServices,
545 [in, range(0, 1024*256)] DWORD cbBufSize,
546 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
547 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
550 DWORD REnumServicesStatusA(
551 [in] handle_t BindingHandle,
552 [in] SC_RPC_HANDLE hSCManager,
553 [in] DWORD dwServiceType,
554 [in] DWORD dwServiceState,
555 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
556 [in, range(0, 1024*256)] DWORD dwBufSize,
557 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
558 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
559 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
562 DWORD ROpenSCManagerA(
563 // [in] handle_t BindingHandle,
564 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEA lpMachineName,
565 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDatabaseName,
566 [in] DWORD dwDesiredAccess,
567 [out] LPSC_RPC_HANDLE lpScHandle);
571 [in] handle_t BindingHandle,
572 [in] SC_RPC_HANDLE hSCManager,
573 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
574 [in] DWORD dwDesiredAccess,
575 [out] LPSC_RPC_HANDLE lpServiceHandle);
578 DWORD RQueryServiceConfigA(
579 [in] handle_t BindingHandle,
580 [in] SC_RPC_HANDLE hService,
581 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
582 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig, */
583 [in, range(0, 1024*8)] DWORD cbBufSize,
584 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
587 DWORD RQueryServiceLockStatusA(
588 [in] handle_t BindingHandle,
589 [in] SC_RPC_HANDLE hSCManager,
590 [out] LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus,
591 [in, range(0, 1024*4)] DWORD cbBufSize,
592 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
595 DWORD RStartServiceA(
596 [in] handle_t BindingHandle,
597 [in] SC_RPC_HANDLE hService,
598 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
599 [in, unique, size_is(argc)] LPSTRING_PTRSA argv);
602 DWORD RGetServiceDisplayNameA(
603 [in] handle_t BindingHandle,
604 [in] SC_RPC_HANDLE hSCManager,
605 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
606 [out, string, size_is(*lpcchBuffer)] LPSTR lpDisplayName,
607 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
610 DWORD RGetServiceKeyNameA(
611 [in] handle_t BindingHandle,
612 [in] SC_RPC_HANDLE hSCManager,
613 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
614 [out, string, size_is(*lpcchBuffer)] LPSTR lpKeyName,
615 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
618 DWORD RI_ScGetCurrentGroupStateW(
619 [in] handle_t BindingHandle,
620 [in] SC_RPC_HANDLE hSCManager,
621 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
622 [out] LPDWORD lpState);
625 DWORD REnumServiceGroupW(
626 [in] handle_t BindingHandle,
627 [in] SC_RPC_HANDLE hSCManager,
628 [in] DWORD dwServiceType,
629 [in] DWORD dwServiceState,
630 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
631 [in, range(0, 1024*256)] DWORD cbBufSize,
632 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
633 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
634 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
635 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
638 DWORD RChangeServiceConfig2A(
639 [in] handle_t BindingHandle,
640 [in] SC_RPC_HANDLE hService,
641 [in] SC_RPC_CONFIG_INFOA Info);
644 DWORD RChangeServiceConfig2W(
645 [in] handle_t BindingHandle,
646 [in] SC_RPC_HANDLE hService,
647 [in] SC_RPC_CONFIG_INFOW Info);
650 DWORD RQueryServiceConfig2A(
651 [in] handle_t BindingHandle,
652 [in] SC_RPC_HANDLE hService,
653 [in] DWORD dwInfoLevel,
654 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
655 [in, range(0, 1024*8)] DWORD cbBufSize,
656 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
659 DWORD RQueryServiceConfig2W(
660 [in] handle_t BindingHandle,
661 [in] SC_RPC_HANDLE hService,
662 [in] DWORD dwInfoLevel,
663 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
664 [in, range(0, 1024*8)] DWORD cbBufSize,
665 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
668 DWORD RQueryServiceStatusEx(
669 [in] handle_t BindingHandle,
670 [in] SC_RPC_HANDLE hService,
671 [in] SC_STATUS_TYPE InfoLevel,
672 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
673 [in, range(0, 1024*8)] DWORD cbBufSize,
674 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
677 DWORD REnumServicesStatusExA(
678 [in] handle_t BindingHandle,
679 [in] SC_RPC_HANDLE hSCManager,
680 [in] SC_ENUM_TYPE InfoLevel,
681 [in] DWORD dwServiceType,
682 [in] DWORD dwServiceState,
683 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
684 [in, range(0, 1024 * 256)] DWORD cbBufSize,
685 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
686 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
687 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
688 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCSTR pszGroupName);
691 DWORD REnumServicesStatusExW(
692 [in] handle_t BindingHandle,
693 [in] SC_RPC_HANDLE hSCManager,
694 [in] SC_ENUM_TYPE InfoLevel,
695 [in] DWORD dwServiceType,
696 [in] DWORD dwServiceState,
697 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
698 [in, range(0, 1024 * 256)] DWORD cbBufSize,
699 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
700 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
701 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
702 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
705 DWORD RSendTSMessage(
706 [in] handle_t BindingHandle); /* FIXME */
709 DWORD RCreateServiceWOW64A(
710 [in] handle_t BindingHandle,
711 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
712 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
713 [in] DWORD dwDesiredAccess,
714 [in] DWORD dwServiceType,
715 [in] DWORD dwStartType,
716 [in] DWORD dwErrorControl,
717 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
718 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
719 [in, out, unique] LPDWORD lpdwTagId,
720 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
721 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
722 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
723 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
724 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
725 [out] LPSC_RPC_HANDLE lpServiceHandle);
728 DWORD RCreateServiceWOW64W(
729 [in] handle_t BindingHandle,
730 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
731 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
732 [in] DWORD dwDesiredAccess,
733 [in] DWORD dwServiceType,
734 [in] DWORD dwStartType,
735 [in] DWORD dwErrorControl,
736 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
737 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
738 [in, out, unique] LPDWORD lpdwTagId,
739 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
740 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
741 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
742 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
743 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
744 [out] LPSC_RPC_HANDLE lpServiceHandle);
747 DWORD RQueryServiceTagInfo(
748 [in] handle_t BindingHandle); /* FIXME */
751 DWORD RNotifyServiceStatusChange(
752 [in] handle_t BindingHandle,
753 [in] SC_RPC_HANDLE hService,
754 [in] SC_RPC_NOTIFY_PARAMS NotifyParams,
755 [in] GUID* pClientProcessGuid,
756 [out] GUID* pSCMProcessGuid,
757 [out] PBOOL pfCreateRemoteQueue,
758 [out] LPSC_NOTIFY_RPC_HANDLE phNotify);
761 DWORD RGetNotifyResults(
762 [in] handle_t BindingHandle,
763 [in] SC_NOTIFY_RPC_HANDLE hNotify,
764 [out] PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams);
767 DWORD RCloseNotifyHandle(
768 [in] handle_t BindingHandle,
769 [in, out] LPSC_NOTIFY_RPC_HANDLE phNotify,
770 [out] PBOOL pfApcFired);
773 DWORD RControlServiceExA(
774 [in] handle_t BindingHandle,
775 [in] SC_RPC_HANDLE hService,
776 [in] DWORD dwControl,
777 [in] DWORD dwInfoLevel/*,
778 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlInParams,
779 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlOutParams*/);
782 DWORD RControlServiceExW(
783 [in] handle_t BindingHandle,
784 [in] SC_RPC_HANDLE hService,
785 [in] DWORD dwControl,
786 [in] DWORD dwInfoLevel/*,
787 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlInParams,
788 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlOutParams*/);
791 DWORD RSendPnPMessage(
792 [in] handle_t BindingHandle); /* FIXME */
795 DWORD RValidatePnPService(
796 [in] handle_t BindingHandle); /* FIXME */
799 DWORD ROpenServiceStatusHandle(
800 [in] handle_t BindingHandle); /* FIXME */
804 [in] handle_t BindingHandle); /* FIXME */