- Disable some debug messages.
[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 [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;
32
33 cpp_quote("#if 0")
34
35 typedef struct _SERVICE_STATUS {
36 DWORD dwServiceType;
37 DWORD dwCurrentState;
38 DWORD dwControlsAccepted;
39 DWORD dwWin32ExitCode;
40 DWORD dwServiceSpecificExitCode;
41 DWORD dwCheckPoint;
42 DWORD dwWaitHint;
43 } SERVICE_STATUS, *LPSERVICE_STATUS;
44
45 typedef struct _SERVICE_STATUS_PROCESS {
46 DWORD dwServiceType;
47 DWORD dwCurrentState;
48 DWORD dwControlsAccepted;
49 DWORD dwWin32ExitCode;
50 DWORD dwServiceSpecificExitCode;
51 DWORD dwCheckPoint;
52 DWORD dwWaitHint;
53 DWORD dwProcessId;
54 DWORD dwServiceFlags;
55 } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;
56
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;
62
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;
68
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;
74
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;
80
81 typedef struct _QUERY_SERVICE_CONFIGA {
82 DWORD dwServiceType;
83 DWORD dwStartType;
84 DWORD dwErrorControl;
85 [string, range(0, 8 * 1024)] LPSTR lpBinaryPathName;
86 [string, range(0, 8 * 1024)] LPSTR lpLoadOrderGroup;
87 DWORD dwTagId;
88 [string, range(0, 8 * 1024)] LPSTR lpDependencies;
89 [string, range(0, 8 * 1024)] LPSTR lpServiceStartName;
90 LPSTR lpDisplayName;
91 } QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA;
92
93 typedef struct _QUERY_SERVICE_CONFIGW {
94 DWORD dwServiceType;
95 DWORD dwStartType;
96 DWORD dwErrorControl;
97 [string, range(0, 8 * 1024)] LPWSTR lpBinaryPathName;
98 [string, range(0, 8 * 1024)] LPWSTR lpLoadOrderGroup;
99 DWORD dwTagId;
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;
104
105 typedef struct _QUERY_SERVICE_LOCK_STATUSA {
106 DWORD fIsLocked;
107 [string, range(0, 8 * 1024)] LPSTR lpLockOwner;
108 DWORD dwLockDuration;
109 } QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA;
110
111 typedef struct _QUERY_SERVICE_LOCK_STATUSW {
112 DWORD fIsLocked;
113 [string, range(0, 8 * 1024)] LPWSTR lpLockOwner;
114 DWORD dwLockDuration;
115 } QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW;
116
117 typedef [v1_enum] enum _SC_ACTION_TYPE {
118 SC_ACTION_NONE = 0,
119 SC_ACTION_RESTART = 1,
120 SC_ACTION_REBOOT = 2,
121 SC_ACTION_RUN_COMMAND = 3,
122 } SC_ACTION_TYPE;
123
124 typedef struct _SC_ACTION {
125 SC_ACTION_TYPE Type;
126 DWORD Delay;
127 } SC_ACTION, *LPSC_ACTION;
128
129 typedef [v1_enum] enum _SC_ENUM_TYPE {
130 SC_ENUM_PROCESS_INFO = 0,
131 } SC_ENUM_TYPE;
132
133 typedef struct _SERVICE_DESCRIPTIONA {
134 [string, range(0, 8 * 1024)] LPSTR lpDescription;
135 } SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA;
136
137 typedef struct _SERVICE_DESCRIPTIONW {
138 [string, range(0, 8 * 1024)] LPWSTR lpDescription;
139 } SERVICE_DESCRIPTIONW, *LPSERVICE_DESCRIPTIONW;
140
141 typedef struct _SERVICE_FAILURE_ACTIONSA {
142 DWORD dwResetPeriod;
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;
148
149 typedef struct _SERVICE_FAILURE_ACTIONSW {
150 DWORD dwResetPeriod;
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;
156
157 cpp_quote("#endif")
158
159 typedef struct _SERVICE_DELAYED_AUTO_START_INFO {
160 BOOL fDelayedAutoStart;
161 } SERVICE_DELAYED_AUTO_START_INFO, *LPSERVICE_DELAYED_AUTO_START_INFO;
162
163 typedef struct _SERVICE_FAILURE_ACTIONS_FLAG {
164 BOOL fFailureActionsOnNonCrashFailures;
165 } SERVICE_FAILURE_ACTIONS_FLAG, *LPSERVICE_FAILURE_ACTIONS_FLAG;
166
167 typedef struct _SERVICE_SID_INFO {
168 DWORD dwServicesSidType;
169 } SERVICE_SID_INFO, *LPSERVICE_SID_INFO;
170
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;
175
176 typedef struct _SERVICE_PRESHUTDOWN_INFO {
177 DWORD dwPreshutdownTimeout;
178 } SERVICE_PRESHUTDOWN_INFO, *LPSERVICE_PRESHUTDOWN_INFO;
179
180 typedef struct _SC_RPC_CONFIG_INFOA {
181 DWORD dwInfoLevel;
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;
190 };
191 } SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA;
192
193 typedef struct _SC_RPC_CONFIG_INFOW {
194 DWORD dwInfoLevel;
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;
203 };
204 } SC_RPC_CONFIG_INFOW, *LPSC_RPC_CONFIG_INFOW;
205
206 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 {
207 ULONGLONG ullThreadId;
208 DWORD dwNotifyMask;
209 UCHAR CallbackAddressArray[16];
210 UCHAR CallbackParamAddressArray[16];
211 SERVICE_STATUS_PROCESS ServiceStatus;
212 DWORD dwNotificationStatus;
213 DWORD dwSequence;
214 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1;
215
216 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 {
217 ULONGLONG ullThreadId;
218 DWORD dwNotifyMask;
219 UCHAR CallbackAddressArray[16];
220 UCHAR CallbackParamAddressArray[16];
221 SERVICE_STATUS_PROCESS ServiceStatus;
222 DWORD dwNotificationStatus;
223 DWORD dwSequence;
224 DWORD dwNotificationTriggered;
225 [string, range(0, 64 * 1024)] PWSTR pszServiceNames;
226 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2;
227
228 typedef struct _SC_RPC_NOTIFY_PARAMS {
229 DWORD dwInfoLevel;
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;
233 };
234 } SC_RPC_NOTIFY_PARAMS, *LPSC_RPC_NOTIFY_PARAMS;
235
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;
240
241 cpp_quote("#if 0")
242
243 #if 0
244 typedef
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;
248
249 typedef
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;
253
254 typedef
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;
258
259 typedef
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;
263 #endif
264
265 typedef [v1_enum] enum _SC_STATUS_TYPE {
266 SC_STATUS_PROCESS_INFO = 0,
267 } SC_STATUS_TYPE;
268
269 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA {
270 DWORD dwReason;
271 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPSTR pszComment;
272 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA;
273
274 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW {
275 DWORD dwReason;
276 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPWSTR pszComment;
277 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW;
278
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;
282
283 typedef SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 SERVICE_NOTIFY_STATUS_CHANGE_PARAMS, *LPSERVICE_NOTIFY_STATUS_CHANGE_PARAMS;
284
285 cpp_quote("#endif")
286
287 typedef struct _STRING_PTRSA {
288 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPSTR StringPtr;
289 } STRING_PTRSA, *PSTRING_PTRSA, *LPSTRING_PTRSA;
290
291 typedef struct _STRING_PTRSW {
292 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPWSTR StringPtr;
293 } STRING_PTRSW, *PSTRING_PTRSW, *LPSTRING_PTRSW;
294
295 [
296 uuid(367abb81-9844-35f1-ad32-98f038001003),
297 version(2.0),
298 pointer_default(unique),
299 #ifndef __midl
300 ,explicit_handle
301 #endif
302 ]
303 interface svcctl
304 {
305 /* Function 0 */
306 DWORD RCloseServiceHandle(
307 [in] handle_t BindingHandle,
308 [in, out] LPSC_RPC_HANDLE hSCObject);
309
310 /* Function 1 */
311 DWORD RControlService(
312 [in] handle_t BindingHandle,
313 [in] SC_RPC_HANDLE hService,
314 [in] DWORD dwControl,
315 [out] LPSERVICE_STATUS lpServiceStatus);
316
317 /* Function 2 */
318 DWORD RDeleteService(
319 [in] handle_t BindingHandle,
320 [in] SC_RPC_HANDLE hService);
321
322 /* Function 3 */
323 DWORD RLockServiceDatabase(
324 [in] handle_t BindingHandle,
325 [in] SC_RPC_HANDLE hSCManager,
326 [out] LPSC_RPC_LOCK lpLock);
327
328 /* Function 4 */
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);
336
337 /* Function 5 */
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);
344
345 /* Function 6 */
346 DWORD RQueryServiceStatus(
347 [in] handle_t BindingHandle,
348 [in] SC_RPC_HANDLE hService,
349 [out] LPSERVICE_STATUS lpServiceStatus);
350
351 /* Function 7 */
352 DWORD RSetServiceStatus(
353 [in] handle_t BindingHandle,
354 [in] SC_RPC_HANDLE hServiceStatus,
355 [in] LPSERVICE_STATUS lpServiceStatus);
356
357 /* Function 8 */
358 DWORD RUnlockServiceDatabase(
359 [in] handle_t BindingHandle,
360 [in, out] LPSC_RPC_LOCK Lock);
361
362 /* Function 9 */
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);
367
368 /* Function 10 */
369 DWORD RSetServiceBitsW(
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);
376
377 /* Function 11 */
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);
393
394 /* Function 12 */
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);
413
414 /* Function 13 */
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);
423
424 /* Function 14 */
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);
435
436 /* Function 15 */
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);
443
444 /* Function 16 */
445 DWORD ROpenServiceW(
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);
451
452 /* Function 17 */
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);
460
461 /* Function 18 */
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);
468
469 /* Function 19 */
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);
475
476 /* Function 20 */
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);
483
484 /* Function 21 */
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);
491
492 /* Function 22 */
493 DWORD RSetServiceBitsA(
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);
500
501 /* Function 23 */
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);
517
518 /* Function 24 */
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);
537
538 /* Function 25 */
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);
547
548 /* Function 26 */
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);
559
560 /* Function 27 */
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);
567
568 /* Function 28 */
569 DWORD ROpenServiceA(
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);
575
576 /* Function 29 */
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);
584
585 /* Function 30 */
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);
592
593 /* Function 31 */
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);
599
600 /* Function 32 */
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);
607
608 /* Function 33 */
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);
615
616 /* Function 34 */
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);
622
623 /* Function 35 */
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);
635
636 /* Function 36 */
637 DWORD RChangeServiceConfig2A(
638 [in] handle_t BindingHandle,
639 [in] SC_RPC_HANDLE hService,
640 [in] SC_RPC_CONFIG_INFOA Info);
641
642 /* Function 37 */
643 DWORD RChangeServiceConfig2W(
644 [in] handle_t BindingHandle,
645 [in] SC_RPC_HANDLE hService,
646 [in] SC_RPC_CONFIG_INFOW Info);
647
648 /* Function 38 */
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);
656
657 /* Function 39 */
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);
665
666 /* Function 40 */
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);
674
675 /* Function 41 */
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);
688
689 /* Function 42 */
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);
702
703 /* Function 43 */
704 DWORD RSendTSMessage(
705 [in] handle_t BindingHandle); /* FIXME */
706
707 /* Function 44 */
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);
725
726 /* Function 45 */
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);
744
745 /* Function 46 */
746 DWORD RQueryServiceTagInfo(
747 [in] handle_t BindingHandle); /* FIXME */
748
749 /* Function 47 */
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);
758
759 /* Function 48 */
760 DWORD RGetNotifyResults(
761 [in] handle_t BindingHandle,
762 [in] SC_NOTIFY_RPC_HANDLE hNotify,
763 [out] PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams);
764
765 /* Function 49 */
766 DWORD RCloseNotifyHandle(
767 [in] handle_t BindingHandle,
768 [in, out] LPSC_NOTIFY_RPC_HANDLE phNotify,
769 [out] PBOOL pfApcFired);
770
771 /* Function 50 */
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*/);
779
780 /* Function 51 */
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*/);
788
789 /* Function 52 */
790 DWORD RSendPnPMessage(
791 [in] handle_t BindingHandle); /* FIXME */
792
793 /* Function 53 */
794 DWORD RValidatePnPService(
795 [in] handle_t BindingHandle); /* FIXME */
796
797 /* Function 54 */
798 DWORD ROpenServiceStatusHandle(
799 [in] handle_t BindingHandle); /* FIXME */
800
801 /* Function 55 */
802 DWORD RFunction55(
803 [in] handle_t BindingHandle); /* FIXME */
804 }