[IDL]
[reactos.git] / reactos / include / reactos / idl / svcctl.idl
1 /*
2 * Service Control Manager (SCM) interface definition
3 */
4
5 #include <ms-dtyp.idl>
6
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;
17
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] PVOID SC_RPC_HANDLE;
22 typedef SC_RPC_HANDLE* LPSC_RPC_HANDLE;
23 typedef [context_handle] PVOID SC_RPC_LOCK;
24 typedef SC_RPC_LOCK* LPSC_RPC_LOCK;
25 typedef [context_handle] PVOID 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;
33
34 cpp_quote("#if 0")
35
36 typedef struct _SERVICE_STATUS {
37 DWORD dwServiceType;
38 DWORD dwCurrentState;
39 DWORD dwControlsAccepted;
40 DWORD dwWin32ExitCode;
41 DWORD dwServiceSpecificExitCode;
42 DWORD dwCheckPoint;
43 DWORD dwWaitHint;
44 } SERVICE_STATUS, *LPSERVICE_STATUS;
45
46 typedef struct _SERVICE_STATUS_PROCESS {
47 DWORD dwServiceType;
48 DWORD dwCurrentState;
49 DWORD dwControlsAccepted;
50 DWORD dwWin32ExitCode;
51 DWORD dwServiceSpecificExitCode;
52 DWORD dwCheckPoint;
53 DWORD dwWaitHint;
54 DWORD dwProcessId;
55 DWORD dwServiceFlags;
56 } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;
57
58 typedef struct _ENUM_SERVICE_STATUSA {
59 [string] LPSTR lpServiceName;
60 [string] LPSTR lpDisplayName;
61 SERVICE_STATUS ServiceStatus;
62 } ENUM_SERVICE_STATUSA, *LPENUM_SERVICE_STATUSA;
63
64 typedef struct _ENUM_SERVICE_STATUSW {
65 [string] LPWSTR lpServiceName;
66 [string] LPWSTR lpDisplayName;
67 SERVICE_STATUS ServiceStatus;
68 } ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW;
69
70 typedef struct _ENUM_SERVICE_STATUS_PROCESSA {
71 [string] LPSTR lpServiceName;
72 [string] LPSTR lpDisplayName;
73 SERVICE_STATUS_PROCESS ServiceStatusProcess;
74 } ENUM_SERVICE_STATUS_PROCESSA, *LPENUM_SERVICE_STATUS_PROCESSA;
75
76 typedef struct _ENUM_SERVICE_STATUS_PROCESSW {
77 [string] LPWSTR lpServiceName;
78 [string] LPWSTR lpDisplayName;
79 SERVICE_STATUS_PROCESS ServiceStatusProcess;
80 } ENUM_SERVICE_STATUS_PROCESSW, *LPENUM_SERVICE_STATUS_PROCESSW;
81
82 typedef struct _QUERY_SERVICE_CONFIGA {
83 DWORD dwServiceType;
84 DWORD dwStartType;
85 DWORD dwErrorControl;
86 [string] LPSTR lpBinaryPathName;
87 [string] LPSTR lpLoadOrderGroup;
88 DWORD dwTagId;
89 [string] LPSTR lpDependencies;
90 [string] LPSTR lpServiceStartName;
91 LPSTR lpDisplayName;
92 } QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA;
93
94 typedef struct _QUERY_SERVICE_CONFIGW {
95 DWORD dwServiceType;
96 DWORD dwStartType;
97 DWORD dwErrorControl;
98 [string] LPWSTR lpBinaryPathName;
99 [string] LPWSTR lpLoadOrderGroup;
100 DWORD dwTagId;
101 [string] LPWSTR lpDependencies;
102 [string] LPWSTR lpServiceStartName;
103 LPWSTR lpDisplayName;
104 } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
105
106 typedef struct _QUERY_SERVICE_LOCK_STATUSA {
107 DWORD fIsLocked;
108 [string] LPSTR lpLockOwner;
109 DWORD dwLockDuration;
110 } QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA;
111
112 typedef struct _QUERY_SERVICE_LOCK_STATUSW {
113 DWORD fIsLocked;
114 [string] LPWSTR lpLockOwner;
115 DWORD dwLockDuration;
116 } QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW;
117
118 typedef [v1_enum] enum _SC_ACTION_TYPE {
119 SC_ACTION_NONE = 0,
120 SC_ACTION_RESTART = 1,
121 SC_ACTION_REBOOT = 2,
122 SC_ACTION_RUN_COMMAND = 3,
123 } SC_ACTION_TYPE;
124
125 typedef struct _SC_ACTION {
126 SC_ACTION_TYPE Type;
127 DWORD Delay;
128 } SC_ACTION, *LPSC_ACTION;
129
130 typedef [v1_enum] enum _SC_ENUM_TYPE {
131 SC_ENUM_PROCESS_INFO = 0,
132 } SC_ENUM_TYPE;
133
134 typedef struct _SERVICE_DESCRIPTIONA {
135 [string] LPSTR lpDescription;
136 } SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA;
137
138 typedef struct _SERVICE_DESCRIPTIONW {
139 [string] LPWSTR lpDescription;
140 } SERVICE_DESCRIPTIONW, *LPSERVICE_DESCRIPTIONW;
141
142 typedef struct _SERVICE_FAILURE_ACTIONSA {
143 DWORD dwResetPeriod;
144 [string] LPSTR lpRebootMsg;
145 [string] LPSTR lpCommand;
146 [range(0, 1024)] DWORD cActions;
147 [size_is(cActions)] SC_ACTION* lpsaActions;
148 } SERVICE_FAILURE_ACTIONSA, *LPSERVICE_FAILURE_ACTIONSA;
149
150 typedef struct _SERVICE_FAILURE_ACTIONSW {
151 DWORD dwResetPeriod;
152 [string] LPWSTR lpRebootMsg;
153 [string] LPWSTR lpCommand;
154 [range(0, 1024)] DWORD cActions;
155 [size_is(cActions)] SC_ACTION* lpsaActions;
156 } SERVICE_FAILURE_ACTIONSW, *LPSERVICE_FAILURE_ACTIONSW;
157
158 cpp_quote("#endif")
159
160 typedef struct _SERVICE_DELAYED_AUTO_START_INFO {
161 BOOL fDelayedAutoStart;
162 } SERVICE_DELAYED_AUTO_START_INFO, *LPSERVICE_DELAYED_AUTO_START_INFO;
163
164 typedef struct _SERVICE_FAILURE_ACTIONS_FLAG {
165 BOOL fFailureActionsOnNonCrashFailures;
166 } SERVICE_FAILURE_ACTIONS_FLAG, *LPSERVICE_FAILURE_ACTIONS_FLAG;
167
168 typedef struct _SERVICE_SID_INFO {
169 DWORD dwServicesSidType;
170 } SERVICE_SID_INFO, *LPSERVICE_SID_INFO;
171
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;
176
177 typedef struct _SERVICE_PRESHUTDOWN_INFO {
178 DWORD dwPreshutdownTimeout;
179 } SERVICE_PRESHUTDOWN_INFO, *LPSERVICE_PRESHUTDOWN_INFO;
180
181 typedef struct _SC_RPC_CONFIG_INFOA {
182 DWORD dwInfoLevel;
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;
191 } DUMMYUNIONNAME;
192 [string] LPSTR lpDescription; //FIXME
193 } SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA;
194
195 typedef struct _SC_RPC_CONFIG_INFOW {
196 DWORD dwInfoLevel;
197 [switch_is(dwInfoLevel)] union {
198 [case(1)] LPSERVICE_DESCRIPTIONW psd;
199 [case(2)] LPSERVICE_FAILURE_ACTIONSW psfa;
200 [case(3)] LPSERVICE_DELAYED_AUTO_START_INFO psda;
201 [case(4)] LPSERVICE_FAILURE_ACTIONS_FLAG psfaf;
202 [case(5)] LPSERVICE_SID_INFO pssid;
203 [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
204 [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
205 } DUMMYUNIONNAME;
206 } SC_RPC_CONFIG_INFOW, *LPSC_RPC_CONFIG_INFOW;
207
208 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 {
209 ULONGLONG ullThreadId;
210 DWORD dwNotifyMask;
211 UCHAR CallbackAddressArray[16];
212 UCHAR CallbackParamAddressArray[16];
213 SERVICE_STATUS_PROCESS ServiceStatus;
214 DWORD dwNotificationStatus;
215 DWORD dwSequence;
216 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1;
217
218 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 {
219 ULONGLONG ullThreadId;
220 DWORD dwNotifyMask;
221 UCHAR CallbackAddressArray[16];
222 UCHAR CallbackParamAddressArray[16];
223 SERVICE_STATUS_PROCESS ServiceStatus;
224 DWORD dwNotificationStatus;
225 DWORD dwSequence;
226 DWORD dwNotificationTriggered;
227 [string] PWSTR pszServiceNames;
228 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2;
229
230 typedef struct _SC_RPC_NOTIFY_PARAMS {
231 DWORD dwInfoLevel;
232 [switch_is(dwInfoLevel)] union {
233 [case(1)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 pStatusChangeParam1;
234 [case(2)] PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 pStatusChangeParam2;
235 };
236 } SC_RPC_NOTIFY_PARAMS, *LPSC_RPC_NOTIFY_PARAMS;
237
238 typedef struct _SC_RPC_NOTIFY_PARAMS_LIST {
239 BOUNDED_DWORD_4K cElements;
240 [size_is(cElements)] SC_RPC_NOTIFY_PARAMS NotifyParamsArray[];
241 } SC_RPC_NOTIFY_PARAMS_LIST, *PSC_RPC_NOTIFY_PARAMS_LIST;
242
243 cpp_quote("#if 0")
244
245 #if 0
246 typedef
247 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSA {
248 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA psrInParams;
249 } SC_RPC_SERVICE_CONTROL_IN_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSA;
250
251 typedef
252 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_IN_PARAMSW {
253 [case(1)] PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW psrInParams;
254 } SC_RPC_SERVICE_CONTROL_IN_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_IN_PARAMSW;
255
256 typedef
257 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSA {
258 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams;
259 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSA, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSA;
260
261 typedef
262 [switch_type(DWORD)] union _SC_RPC_SERVICE_CONTROL_OUT_PARAMSW {
263 [case(1)] PSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS psrOutParams;
264 } SC_RPC_SERVICE_CONTROL_OUT_PARAMSW, *LPSC_RPC_SERVICE_CONTROL_OUT_PARAMSW;
265 #endif
266
267 typedef [v1_enum] enum _SC_STATUS_TYPE {
268 SC_STATUS_PROCESS_INFO = 0,
269 } SC_STATUS_TYPE;
270
271 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA {
272 DWORD dwReason;
273 [string] LPSTR pszComment;
274 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA;
275
276 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW {
277 DWORD dwReason;
278 [string] LPWSTR pszComment;
279 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW;
280
281 typedef struct _SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS {
282 SERVICE_STATUS_PROCESS ServiceStatus;
283 } SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS, *LPSERVICE_CONTROL_STATUS_REASON_OUT_PARAMS;
284
285 typedef SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 SERVICE_NOTIFY_STATUS_CHANGE_PARAMS, *LPSERVICE_NOTIFY_STATUS_CHANGE_PARAMS;
286
287 cpp_quote("#endif")
288
289 typedef struct _STRING_PTRSA {
290 [string] LPSTR StringPtr;
291 } STRING_PTRSA, *PSTRING_PTRSA, *LPSTRING_PTRSA;
292
293 typedef struct _STRING_PTRSW {
294 [string] LPWSTR StringPtr;
295 } STRING_PTRSW, *PSTRING_PTRSW, *LPSTRING_PTRSW;
296
297 [
298 uuid(367abb81-9844-35f1-ad32-98f038001003),
299 version(2.0),
300 pointer_default(unique)
301 ]
302 interface svcctl
303 {
304 /* Function 0 */
305 DWORD RCloseServiceHandle(
306 [in, out] LPSC_RPC_HANDLE hSCObject);
307
308 /* Function 1 */
309 DWORD RControlService(
310 [in] SC_RPC_HANDLE hService,
311 [in] DWORD dwControl,
312 [out] LPSERVICE_STATUS lpServiceStatus);
313
314 /* Function 2 */
315 DWORD RDeleteService(
316 [in] SC_RPC_HANDLE hService);
317
318 /* Function 3 */
319 DWORD RLockServiceDatabase(
320 [in] SC_RPC_HANDLE hSCManager,
321 [out] LPSC_RPC_LOCK lpLock);
322
323 /* Function 4 */
324 DWORD RQueryServiceObjectSecurity(
325 [in] SC_RPC_HANDLE hService,
326 [in] SECURITY_INFORMATION dwSecurityInformation,
327 [out, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor,
328 [in, range(0, 1024 * 256)] DWORD cbBufSize,
329 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded);
330
331 /* Function 5 */
332 DWORD RSetServiceObjectSecurity(
333 [in] SC_RPC_HANDLE hService,
334 [in] DWORD dwSecurityInformation,
335 [in, size_is(dwSecuityDescriptorSize)] LPBYTE lpSecurityDescriptor,
336 [in] DWORD dwSecuityDescriptorSize);
337
338 /* Function 6 */
339 DWORD RQueryServiceStatus(
340 [in] SC_RPC_HANDLE hService,
341 [out] LPSERVICE_STATUS lpServiceStatus);
342
343 /* Function 7 */
344 DWORD RSetServiceStatus(
345 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
346 [in] LPSERVICE_STATUS lpServiceStatus);
347
348 /* Function 8 */
349 DWORD RUnlockServiceDatabase(
350 [in, out] LPSC_RPC_LOCK Lock);
351
352 /* Function 9 */
353 DWORD RNotifyBootConfigStatus(
354 [in, string, unique] SVCCTL_HANDLEW lpMachineName,
355 [in] DWORD BootAcceptable);
356
357 /* Function 10 */
358 DWORD RI_ScSetServiceBitsW(
359 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
360 [in] DWORD dwServiceBits,
361 [in] BOOL bSetBitsOn,
362 [in] BOOL bUpdateImmediately,
363 [in, string, unique] LPWSTR lpString);
364
365 /* Function 11 */
366 DWORD RChangeServiceConfigW(
367 [in] SC_RPC_HANDLE hService,
368 [in] DWORD dwServiceType,
369 [in] DWORD dwStartType,
370 [in] DWORD dwErrorControl,
371 [in, string, unique] LPWSTR lpBinaryPathName,
372 [in, string, unique] LPWSTR lpLoadOrderGroup,
373 [in, out, unique] LPDWORD lpdwTagId,
374 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
375 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
376 [in, string, unique] LPWSTR lpServiceStartName,
377 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
378 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
379 [in, string, unique] LPWSTR lpDisplayName);
380
381 /* Function 12 */
382 DWORD RCreateServiceW(
383 [in] SC_RPC_HANDLE hSCManager,
384 [in, string] LPCWSTR lpServiceName,
385 [in, string, unique] LPCWSTR lpDisplayName,
386 [in] DWORD dwDesiredAccess,
387 [in] DWORD dwServiceType,
388 [in] DWORD dwStartType,
389 [in] DWORD dwErrorControl,
390 [in, string] LPCWSTR lpBinaryPathName,
391 [in, string, unique] LPCWSTR lpLoadOrderGroup,
392 [in, out, unique] LPDWORD lpdwTagId,
393 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
394 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
395 [in, string, unique] LPCWSTR lpServiceStartName,
396 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
397 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
398 [out] LPSC_RPC_HANDLE lpServiceHandle);
399
400 /* Function 13 */
401 DWORD REnumDependentServicesW(
402 [in] SC_RPC_HANDLE hService,
403 [in] DWORD dwServiceState,
404 [out, size_is(cbBufSize)] LPBYTE lpServices,
405 [in, range(0, 1024*256)] DWORD cbBufSize,
406 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
407 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
408
409 /* Function 14 */
410 DWORD REnumServicesStatusW(
411 [in] SC_RPC_HANDLE hSCManager,
412 [in] DWORD dwServiceType,
413 [in] DWORD dwServiceState,
414 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
415 [in, range(0, 1024*256)] DWORD dwBufSize,
416 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
417 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
418 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
419
420 /* Function 15 */
421 DWORD ROpenSCManagerW(
422 [in, string, unique] SVCCTL_HANDLEW lpMachineName,
423 [in, string, unique] LPWSTR lpDatabaseName,
424 [in] DWORD dwDesiredAccess,
425 [out] LPSC_RPC_HANDLE lpScHandle);
426
427 /* Function 16 */
428 DWORD ROpenServiceW(
429 [in] SC_RPC_HANDLE hSCManager,
430 [in, string] LPWSTR lpServiceName,
431 [in] DWORD dwDesiredAccess,
432 [out] LPSC_RPC_HANDLE lpServiceHandle);
433
434 /* Function 17 */
435 DWORD RQueryServiceConfigW(
436 [in] SC_RPC_HANDLE hService,
437 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
438 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGW lpServiceConfig, */
439 [in, range(0, 1024*8)] DWORD cbBufSize,
440 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
441
442 /* Function 18 */
443 DWORD RQueryServiceLockStatusW(
444 [in] SC_RPC_HANDLE hSCManager,
445 [out] LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
446 [in, range(0, 1024*4)] DWORD cbBufSize,
447 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
448
449 /* Function 19 */
450 DWORD RStartServiceW(
451 [in] SC_RPC_HANDLE hService,
452 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
453 [in, unique, size_is(argc)] LPSTRING_PTRSW argv);
454
455 /* Function 20 */
456 DWORD RGetServiceDisplayNameW(
457 [in] SC_RPC_HANDLE hSCManager,
458 [in, string] LPCWSTR lpServiceName,
459 [out, string, size_is(*lpcchBuffer + 1)] LPWSTR lpDisplayName,
460 [in, out] DWORD* lpcchBuffer);
461
462 /* Function 21 */
463 DWORD RGetServiceKeyNameW(
464 [in] SC_RPC_HANDLE hSCManager,
465 [in, string] LPCWSTR lpDisplayName,
466 [out, string, size_is(*lpcchBuffer + 1)] LPWSTR lpServiceName,
467 [in, out] DWORD* lpcchBuffer);
468
469 /* Function 22 */
470 DWORD RI_ScSetServiceBitsA(
471 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
472 [in] DWORD dwServiceBits,
473 [in] BOOL bSetBitsOn,
474 [in] BOOL bUpdateImmediately,
475 [in, string, unique] LPSTR lpString);
476
477 /* Function 23 */
478 DWORD RChangeServiceConfigA(
479 [in] SC_RPC_HANDLE hService,
480 [in] DWORD dwServiceType,
481 [in] DWORD dwStartType,
482 [in] DWORD dwErrorControl,
483 [in, string, unique] LPSTR lpBinaryPathName,
484 [in, string, unique] LPSTR lpLoadOrderGroup,
485 [in, out, unique] LPDWORD lpdwTagId,
486 [in, unique, size_is(dwDependSize)] LPSTR lpDependencies,
487 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
488 [in, string, unique] LPSTR lpServiceStartName,
489 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
490 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
491 [in, string, unique] LPSTR lpDisplayName);
492
493 /* Function 24 */
494 DWORD RCreateServiceA(
495 [in] SC_RPC_HANDLE hSCManager,
496 [in, string] LPSTR lpServiceName,
497 [in, string, unique] LPSTR lpDisplayName,
498 [in] DWORD dwDesiredAccess,
499 [in] DWORD dwServiceType,
500 [in] DWORD dwStartType,
501 [in] DWORD dwErrorControl,
502 [in, string] LPSTR lpBinaryPathName,
503 [in, string, unique] LPSTR lpLoadOrderGroup,
504 [in, out, unique] LPDWORD lpdwTagId,
505 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
506 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
507 [in, string, unique] LPSTR lpServiceStartName,
508 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
509 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
510 [out] LPSC_RPC_HANDLE lpServiceHandle);
511
512 /* Function 25 */
513 DWORD REnumDependentServicesA(
514 [in] SC_RPC_HANDLE hService,
515 [in] DWORD dwServiceState,
516 [out, size_is(cbBufSize)] LPBYTE lpServices,
517 [in, range(0, 1024*256)] DWORD cbBufSize,
518 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
519 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
520
521 /* Function 26 */
522 DWORD REnumServicesStatusA(
523 [in] SC_RPC_HANDLE hSCManager,
524 [in] DWORD dwServiceType,
525 [in] DWORD dwServiceState,
526 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
527 [in, range(0, 1024*256)] DWORD dwBufSize,
528 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
529 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
530 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
531
532 /* Function 27 */
533 DWORD ROpenSCManagerA(
534 [in, string, unique] SVCCTL_HANDLEA lpMachineName,
535 [in, string, unique] LPSTR lpDatabaseName,
536 [in] DWORD dwDesiredAccess,
537 [out] LPSC_RPC_HANDLE lpScHandle);
538
539 /* Function 28 */
540 DWORD ROpenServiceA(
541 [in] SC_RPC_HANDLE hSCManager,
542 [in, string] LPSTR lpServiceName,
543 [in] DWORD dwDesiredAccess,
544 [out] LPSC_RPC_HANDLE lpServiceHandle);
545
546 /* Function 29 */
547 DWORD RQueryServiceConfigA(
548 [in] SC_RPC_HANDLE hService,
549 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
550 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig, */
551 [in, range(0, 1024*8)] DWORD cbBufSize,
552 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
553
554 /* Function 30 */
555 DWORD RQueryServiceLockStatusA(
556 [in] SC_RPC_HANDLE hSCManager,
557 [out] LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus,
558 [in, range(0, 1024*4)] DWORD cbBufSize,
559 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
560
561 /* Function 31 */
562 DWORD RStartServiceA(
563 [in] SC_RPC_HANDLE hService,
564 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
565 [in, unique, size_is(argc)] LPSTRING_PTRSA argv);
566
567 /* Function 32 */
568 DWORD RGetServiceDisplayNameA(
569 [in] SC_RPC_HANDLE hSCManager,
570 [in, string] LPCSTR lpServiceName,
571 [out, string, size_is(*lpcchBuffer)] LPSTR lpDisplayName,
572 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
573
574 /* Function 33 */
575 DWORD RGetServiceKeyNameA(
576 [in] SC_RPC_HANDLE hSCManager,
577 [in, string] LPCSTR lpDisplayName,
578 [out, string, size_is(*lpcchBuffer)] LPSTR lpKeyName,
579 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
580
581 /* Function 34 */
582 DWORD RI_ScGetCurrentGroupStateW(
583 [in] SC_RPC_HANDLE hSCManager,
584 [in, string, unique] LPWSTR lpLoadOrderGroup,
585 [out] LPDWORD lpState);
586
587 /* Function 35 */
588 DWORD REnumServiceGroupW(
589 [in] SC_RPC_HANDLE hSCManager,
590 [in] DWORD dwServiceType,
591 [in] DWORD dwServiceState,
592 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
593 [in, range(0, 1024*256)] DWORD cbBufSize,
594 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
595 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
596 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
597 [in, string, unique] LPCWSTR pszGroupName);
598
599 /* Function 36 */
600 DWORD RChangeServiceConfig2A(
601 [in] SC_RPC_HANDLE hService,
602 [in] SC_RPC_CONFIG_INFOA Info);
603
604 /* Function 37 */
605 DWORD RChangeServiceConfig2W(
606 [in] SC_RPC_HANDLE hService,
607 [in] SC_RPC_CONFIG_INFOW Info);
608
609 /* Function 38 */
610 DWORD RQueryServiceConfig2A(
611 [in] SC_RPC_HANDLE hService,
612 [in] DWORD dwInfoLevel,
613 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
614 [in, range(0, 1024*8)] DWORD cbBufSize,
615 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
616
617 /* Function 39 */
618 DWORD RQueryServiceConfig2W(
619 [in] SC_RPC_HANDLE hService,
620 [in] DWORD dwInfoLevel,
621 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
622 [in, range(0, 1024*8)] DWORD cbBufSize,
623 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
624
625 /* Function 40 */
626 DWORD RQueryServiceStatusEx(
627 [in] SC_RPC_HANDLE hService,
628 [in] SC_STATUS_TYPE InfoLevel,
629 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
630 [in, range(0, 1024*8)] DWORD cbBufSize,
631 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
632
633 /* Function 41 */
634 DWORD REnumServicesStatusExA(
635 [in] SC_RPC_HANDLE hSCManager,
636 [in] SC_ENUM_TYPE InfoLevel,
637 [in] DWORD dwServiceType,
638 [in] DWORD dwServiceState,
639 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
640 [in, range(0, 1024 * 256)] DWORD cbBufSize,
641 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
642 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
643 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
644 [in, string, unique] LPCSTR pszGroupName);
645
646 /* Function 42 */
647 DWORD REnumServicesStatusExW(
648 [in] SC_RPC_HANDLE hSCManager,
649 [in] SC_ENUM_TYPE InfoLevel,
650 [in] DWORD dwServiceType,
651 [in] DWORD dwServiceState,
652 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
653 [in, range(0, 1024 * 256)] DWORD cbBufSize,
654 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
655 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
656 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
657 [in, string, unique] LPCWSTR pszGroupName);
658
659 /* Function 43 */
660 DWORD RSendTSMessage(
661 [in] handle_t BindingHandle); /* FIXME */
662
663 /* Function 44 */
664 DWORD RCreateServiceWOW64A(
665 [in] handle_t BindingHandle,
666 [in, string] LPSTR lpServiceName,
667 [in, string, unique] LPSTR lpDisplayName,
668 [in] DWORD dwDesiredAccess,
669 [in] DWORD dwServiceType,
670 [in] DWORD dwStartType,
671 [in] DWORD dwErrorControl,
672 [in, string] LPSTR lpBinaryPathName,
673 [in, string, unique] LPSTR lpLoadOrderGroup,
674 [in, out, unique] LPDWORD lpdwTagId,
675 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
676 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
677 [in, string, unique] LPSTR lpServiceStartName,
678 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
679 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
680 [out] LPSC_RPC_HANDLE lpServiceHandle);
681
682 /* Function 45 */
683 DWORD RCreateServiceWOW64W(
684 [in] handle_t BindingHandle,
685 [in, string] LPWSTR lpServiceName,
686 [in, string, unique] LPWSTR lpDisplayName,
687 [in] DWORD dwDesiredAccess,
688 [in] DWORD dwServiceType,
689 [in] DWORD dwStartType,
690 [in] DWORD dwErrorControl,
691 [in, string] LPWSTR lpBinaryPathName,
692 [in, string, unique] LPWSTR lpLoadOrderGroup,
693 [in, out, unique] LPDWORD lpdwTagId,
694 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
695 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
696 [in, string, unique] LPWSTR lpServiceStartName,
697 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
698 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
699 [out] LPSC_RPC_HANDLE lpServiceHandle);
700
701 /* Function 46 */
702 DWORD RQueryServiceTagInfo(
703 [in] handle_t BindingHandle); /* FIXME */
704
705 /* Function 47 */
706 DWORD RNotifyServiceStatusChange(
707 [in] SC_RPC_HANDLE hService,
708 [in] SC_RPC_NOTIFY_PARAMS NotifyParams,
709 [in] GUID* pClientProcessGuid,
710 [out] GUID* pSCMProcessGuid,
711 [out] PBOOL pfCreateRemoteQueue,
712 [out] LPSC_NOTIFY_RPC_HANDLE phNotify);
713
714 /* Function 48 */
715 DWORD RGetNotifyResults(
716 [in] SC_NOTIFY_RPC_HANDLE hNotify,
717 [out] PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams);
718
719 /* Function 49 */
720 DWORD RCloseNotifyHandle(
721 [in, out] LPSC_NOTIFY_RPC_HANDLE phNotify,
722 [out] PBOOL pfApcFired);
723
724 /* Function 50 */
725 DWORD RControlServiceExA(
726 [in] SC_RPC_HANDLE hService,
727 [in] DWORD dwControl,
728 [in] DWORD dwInfoLevel/*,
729 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlInParams,
730 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlOutParams*/);
731
732 /* Function 51 */
733 DWORD RControlServiceExW(
734 [in] SC_RPC_HANDLE hService,
735 [in] DWORD dwControl,
736 [in] DWORD dwInfoLevel/*,
737 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlInParams,
738 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlOutParams*/);
739
740 /* Function 52 */
741 DWORD RSendPnPMessage(
742 [in] handle_t BindingHandle); /* FIXME */
743
744 /* Function 53 */
745 DWORD RValidatePnPService(
746 [in] handle_t BindingHandle); /* FIXME */
747
748 /* Function 54 */
749 DWORD ROpenServiceStatusHandle(
750 [in] handle_t BindingHandle); /* FIXME */
751
752 /* Function 55 */
753 DWORD RFunction55(
754 [in] handle_t BindingHandle); /* FIXME */
755 }