72e2796c264e3c609844d2d7d1a15f1b117d4c68
[reactos.git] / reactos / include / reactos / idl / svcctl.idl
1 /*
2 * Service Control Manager (SCM) interface definition
3 */
4
5 #include "include/reactos/idl/wtypes.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 unsigned long SECURITY_INFORMATION;
19 typedef [handle] LPSTR SVCCTL_HANDLEA;
20 typedef [handle] LPWSTR SVCCTL_HANDLEW;
21 typedef [context_handle] unsigned long 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] 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_4K* LPBOUNDED_DWORD_8K;
31 typedef [range(0, 1024 * 256)] DWORD BOUNDED_DWORD_256K;
32 typedef BOUNDED_DWORD_4K* 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, 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;
63
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;
69
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;
75
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;
81
82 typedef struct _QUERY_SERVICE_CONFIGA {
83 DWORD dwServiceType;
84 DWORD dwStartType;
85 DWORD dwErrorControl;
86 [string, range(0, 8 * 1024)] LPSTR lpBinaryPathName;
87 [string, range(0, 8 * 1024)] LPSTR lpLoadOrderGroup;
88 DWORD dwTagId;
89 [string, range(0, 8 * 1024)] LPSTR lpDependencies;
90 [string, range(0, 8 * 1024)] 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, range(0, 8 * 1024)] LPWSTR lpBinaryPathName;
99 [string, range(0, 8 * 1024)] LPWSTR lpLoadOrderGroup;
100 DWORD dwTagId;
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;
105
106 typedef struct _QUERY_SERVICE_LOCK_STATUSA {
107 DWORD fIsLocked;
108 [string, range(0, 8 * 1024)] 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, range(0, 8 * 1024)] 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, range(0, 8 * 1024)] LPSTR lpDescription;
136 } SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA;
137
138 typedef struct _SERVICE_DESCRIPTIONW {
139 [string, range(0, 8 * 1024)] LPWSTR lpDescription;
140 } SERVICE_DESCRIPTIONW, *LPSERVICE_DESCRIPTIONW;
141
142 typedef struct _SERVICE_FAILURE_ACTIONSA {
143 DWORD dwResetPeriod;
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;
149
150 typedef struct _SERVICE_FAILURE_ACTIONSW {
151 DWORD dwResetPeriod;
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;
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 };
192 } SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA;
193
194 typedef struct _SC_RPC_CONFIG_INFOW {
195 DWORD dwInfoLevel;
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;
204 };
205 } SC_RPC_CONFIG_INFOW, *LPSC_RPC_CONFIG_INFOW;
206
207 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1 {
208 ULONGLONG ullThreadId;
209 DWORD dwNotifyMask;
210 UCHAR CallbackAddressArray[16];
211 UCHAR CallbackParamAddressArray[16];
212 SERVICE_STATUS_PROCESS ServiceStatus;
213 DWORD dwNotificationStatus;
214 DWORD dwSequence;
215 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_1;
216
217 typedef struct _SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 {
218 ULONGLONG ullThreadId;
219 DWORD dwNotifyMask;
220 UCHAR CallbackAddressArray[16];
221 UCHAR CallbackParamAddressArray[16];
222 SERVICE_STATUS_PROCESS ServiceStatus;
223 DWORD dwNotificationStatus;
224 DWORD dwSequence;
225 DWORD dwNotificationTriggered;
226 [string, range(0, 64 * 1024)] PWSTR pszServiceNames;
227 } SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2, *PSERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2;
228
229 typedef struct _SC_RPC_NOTIFY_PARAMS {
230 DWORD dwInfoLevel;
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;
234 };
235 } SC_RPC_NOTIFY_PARAMS, *LPSC_RPC_NOTIFY_PARAMS;
236
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;
241
242 cpp_quote("#if 0");
243
244 #if 0
245 typedef
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;
249
250 typedef
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;
254
255 typedef
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;
259
260 typedef
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;
264 #endif
265
266 typedef [v1_enum] enum _SC_STATUS_TYPE {
267 SC_STATUS_PROCESS_INFO = 0,
268 } SC_STATUS_TYPE;
269
270 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA {
271 DWORD dwReason;
272 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPSTR pszComment;
273 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA;
274
275 typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW {
276 DWORD dwReason;
277 [string, range(0, SC_MAX_COMMENT_LENGTH)] LPWSTR pszComment;
278 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW, *LPSERVICE_CONTROL_STATUS_REASON_IN_PARAMSW;
279
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;
283
284 typedef SERVICE_NOTIFY_STATUS_CHANGE_PARAMS_2 SERVICE_NOTIFY_STATUS_CHANGE_PARAMS, *LPSERVICE_NOTIFY_STATUS_CHANGE_PARAMS;
285
286 cpp_quote("#endif")
287
288 typedef struct _STRING_PTRSA {
289 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPSTR StringPtr;
290 } STRING_PTRSA, *PSTRING_PTRSA, *LPSTRING_PTRSA;
291
292 typedef struct _STRING_PTRSW {
293 [string, range(0, SC_MAX_ARGUMENT_LENGTH)] LPWSTR StringPtr;
294 } STRING_PTRSW, *PSTRING_PTRSW, *LPSTRING_PTRSW;
295
296 [
297 uuid(367abb81-9844-35f1-ad32-98f038001003),
298 version(2.0),
299 pointer_default(unique),
300 explicit_handle
301 ]
302 interface svcctl
303 {
304 /* Function 0 */
305 DWORD RCloseServiceHandle(
306 [in] handle_t BindingHandle,
307 [in, out] LPSC_RPC_HANDLE hSCObject);
308
309 /* Function 1 */
310 DWORD RControlService(
311 [in] handle_t BindingHandle,
312 [in] SC_RPC_HANDLE hService,
313 [in] DWORD dwControl,
314 [out] LPSERVICE_STATUS lpServiceStatus);
315
316 /* Function 2 */
317 DWORD RDeleteService(
318 [in] handle_t BindingHandle,
319 [in] SC_RPC_HANDLE hService);
320
321 /* Function 3 */
322 DWORD RLockServiceDatabase(
323 [in] handle_t BindingHandle,
324 [in] SC_RPC_HANDLE hSCManager,
325 [out] LPSC_RPC_LOCK lpLock);
326
327 /* Function 4 */
328 DWORD RQueryServiceObjectSecurity(
329 [in] handle_t BindingHandle,
330 [in] SC_RPC_HANDLE hService,
331 [in] SECURITY_INFORMATION dwSecurityInformation,
332 [out, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor,
333 [in, range(0, 1024 * 256)] DWORD cbBufSize,
334 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded);
335
336 /* Function 5 */
337 DWORD RSetServiceObjectSecurity(
338 [in] handle_t BindingHandle,
339 [in] SC_RPC_HANDLE hService,
340 [in] DWORD dwSecurityInformation,
341 [in, size_is(dwSecuityDescriptorSize)] LPBYTE lpSecurityDescriptor,
342 [in] DWORD dwSecuityDescriptorSize);
343
344 /* Function 6 */
345 DWORD RQueryServiceStatus(
346 [in] handle_t BindingHandle,
347 [in] SC_RPC_HANDLE hService,
348 [out] LPSERVICE_STATUS lpServiceStatus);
349
350 /* Function 7 */
351 DWORD RSetServiceStatus(
352 [in] handle_t BindingHandle,
353 [in] SC_RPC_HANDLE hServiceStatus,
354 [in] LPSERVICE_STATUS lpServiceStatus);
355
356 /* Function 8 */
357 DWORD RUnlockServiceDatabase(
358 [in] handle_t BindingHandle,
359 [in, out] LPSC_RPC_LOCK Lock);
360
361 /* Function 9 */
362 DWORD RNotifyBootConfigStatus(
363 [in] handle_t BindingHandle,
364 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName,
365 [in] DWORD BootAcceptable);
366
367 /* Function 10 */
368 DWORD RSetServiceBitsW(
369 [in] handle_t BindingHandle,
370 [in] SC_RPC_HANDLE hServiceStatus,
371 [in] DWORD dwServiceBits,
372 [in] BOOL bSetBitsOn,
373 [in] BOOL bUpdateImmediately,
374 [in, string, unique] LPWSTR lpString);
375
376 /* Function 11 */
377 DWORD RChangeServiceConfigW(
378 [in] handle_t BindingHandle,
379 [in] SC_RPC_HANDLE hService,
380 [in] DWORD dwServiceType,
381 [in] DWORD dwStartType,
382 [in] DWORD dwErrorControl,
383 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
384 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpLoadOrderGroup,
385 [in, out, unique] LPDWORD lpdwTagId,
386 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
387 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
388 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
389 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
390 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
391 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName);
392
393 /* Function 12 */
394 DWORD RCreateServiceW(
395 [in] handle_t BindingHandle,
396 [in] SC_RPC_HANDLE hSCManager,
397 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
398 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
399 [in] DWORD dwDesiredAccess,
400 [in] DWORD dwServiceType,
401 [in] DWORD dwStartType,
402 [in] DWORD dwErrorControl,
403 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
404 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
405 [in, out, unique] LPDWORD lpdwTagId,
406 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
407 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
408 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
409 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
410 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
411 [out] LPSC_RPC_HANDLE lpServiceHandle);
412
413 /* Function 13 */
414 DWORD REnumDependentServicesW(
415 [in] handle_t BindingHandle,
416 [in] SC_RPC_HANDLE hService,
417 [in] DWORD dwServiceState,
418 [out, size_is(cbBufSize)] LPBYTE lpServices,
419 [in, range(0, 1024*256)] DWORD cbBufSize,
420 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
421 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
422
423 /* Function 14 */
424 DWORD REnumServicesStatusW(
425 [in] handle_t BindingHandle,
426 [in] SC_RPC_HANDLE hSCManager,
427 [in] DWORD dwServiceType,
428 [in] DWORD dwServiceState,
429 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
430 [in, range(0, 1024*256)] DWORD dwBufSize,
431 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
432 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
433 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
434
435 /* Function 15 */
436 DWORD ROpenSCManagerW(
437 [in] handle_t BindingHandle,
438 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] LPWSTR lpMachineName,
439 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDatabaseName,
440 [in] DWORD dwDesiredAccess,
441 [out] LPSC_RPC_HANDLE lpScHandle);
442
443 /* Function 16 */
444 DWORD ROpenServiceW(
445 [in] handle_t BindingHandle,
446 [in] SC_RPC_HANDLE hSCManager,
447 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
448 [in] DWORD dwDesiredAccess,
449 [out] LPSC_RPC_HANDLE lpServiceHandle);
450
451 /* Function 17 */
452 DWORD RQueryServiceConfigW(
453 [in] handle_t BindingHandle,
454 [in] SC_RPC_HANDLE hService,
455 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
456 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGW lpServiceConfig, */
457 [in, range(0, 1024*8)] DWORD cbBufSize,
458 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
459
460 /* Function 18 */
461 DWORD RQueryServiceLockStatusW(
462 [in] handle_t BindingHandle,
463 [in] SC_RPC_HANDLE hSCManager,
464 [out] LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
465 [in, range(0, 1024*4)] DWORD cbBufSize,
466 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
467
468 /* Function 19 */
469 DWORD RStartServiceW(
470 [in] handle_t BindingHandle,
471 [in] SC_RPC_HANDLE hService,
472 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
473 [in, unique, size_is(argc)] LPSTRING_PTRSW argv);
474
475 /* Function 20 */
476 DWORD RGetServiceDisplayNameW(
477 [in] handle_t BindingHandle,
478 [in] SC_RPC_HANDLE hSCManager,
479 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
480 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpDisplayName,
481 [in, out] DWORD* lpcchBuffer);
482
483 /* Function 21 */
484 DWORD RGetServiceKeyNameW(
485 [in] handle_t BindingHandle,
486 [in] SC_RPC_HANDLE hSCManager,
487 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
488 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpServiceName,
489 [in, out] DWORD* lpcchBuffer);
490
491 /* Function 22 */
492 DWORD RSetServiceBitsA(
493 [in] handle_t BindingHandle,
494 [in] SC_RPC_HANDLE hServiceStatus,
495 [in] DWORD dwServiceBits,
496 [in] BOOL bSetBitsOn,
497 [in] BOOL bUpdateImmediately,
498 [in, string, unique] LPSTR lpString);
499
500 /* Function 23 */
501 DWORD RChangeServiceConfigA(
502 [in] handle_t BindingHandle,
503 [in] SC_RPC_HANDLE hService,
504 [in] DWORD dwServiceType,
505 [in] DWORD dwStartType,
506 [in] DWORD dwErrorControl,
507 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
508 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
509 [in, out, unique] LPDWORD lpdwTagId,
510 [in, unique, size_is(dwDependSize)] LPSTR lpDependencies,
511 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
512 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
513 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
514 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
515 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName);
516
517 /* Function 24 */
518 DWORD RCreateServiceA(
519 [in] handle_t BindingHandle,
520 [in] SC_RPC_HANDLE hSCManager,
521 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
522 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
523 [in] DWORD dwDesiredAccess,
524 [in] DWORD dwServiceType,
525 [in] DWORD dwStartType,
526 [in] DWORD dwErrorControl,
527 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
528 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
529 [in, out, unique] LPDWORD lpdwTagId,
530 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
531 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
532 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
533 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
534 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
535 [out] LPSC_RPC_HANDLE lpServiceHandle);
536
537 /* Function 25 */
538 DWORD REnumDependentServicesA(
539 [in] handle_t BindingHandle,
540 [in] SC_RPC_HANDLE hService,
541 [in] DWORD dwServiceState,
542 [out, size_is(cbBufSize)] LPBYTE lpServices,
543 [in, range(0, 1024*256)] DWORD cbBufSize,
544 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
545 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
546
547 /* Function 26 */
548 DWORD REnumServicesStatusA(
549 [in] handle_t BindingHandle,
550 [in] SC_RPC_HANDLE hSCManager,
551 [in] DWORD dwServiceType,
552 [in] DWORD dwServiceState,
553 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
554 [in, range(0, 1024*256)] DWORD dwBufSize,
555 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
556 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
557 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
558
559 /* Function 27 */
560 DWORD ROpenSCManagerA(
561 [in] handle_t BindingHandle,
562 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] LPSTR lpMachineName,
563 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDatabaseName,
564 [in] DWORD dwDesiredAccess,
565 [out] LPSC_RPC_HANDLE lpScHandle);
566
567 /* Function 28 */
568 DWORD ROpenServiceA(
569 [in] handle_t BindingHandle,
570 [in] SC_RPC_HANDLE hSCManager,
571 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
572 [in] DWORD dwDesiredAccess,
573 [out] LPSC_RPC_HANDLE lpServiceHandle);
574
575 /* Function 29 */
576 DWORD RQueryServiceConfigA(
577 [in] handle_t BindingHandle,
578 [in] SC_RPC_HANDLE hService,
579 [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig,
580 [in, range(0, 1024*8)] DWORD cbBufSize,
581 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
582
583 /* Function 30 */
584 DWORD RQueryServiceLockStatusA(
585 [in] handle_t BindingHandle,
586 [in] SC_RPC_HANDLE hSCManager,
587 [out] LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus,
588 [in, range(0, 1024*4)] DWORD cbBufSize,
589 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
590
591 /* Function 31 */
592 DWORD RStartServiceA(
593 [in] handle_t BindingHandle,
594 [in] SC_RPC_HANDLE hService,
595 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
596 [in, unique, size_is(argc)] LPSTRING_PTRSA argv);
597
598 /* Function 32 */
599 DWORD RGetServiceDisplayNameA(
600 [in] handle_t BindingHandle,
601 [in] SC_RPC_HANDLE hSCManager,
602 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
603 [out, string, size_is(*lpcchBuffer)] LPSTR lpDisplayName,
604 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
605
606 /* Function 33 */
607 DWORD RGetServiceKeyNameA(
608 [in] handle_t BindingHandle,
609 [in] SC_RPC_HANDLE hSCManager,
610 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
611 [out, string, size_is(*lpcchBuffer)] LPSTR lpKeyName,
612 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
613
614 /* Function 34 */
615 DWORD RGetCurrentGroupStateW(
616 [in] handle_t BindingHandle); /* FIXME */
617
618 /* Function 35 */
619 DWORD REnumServiceGroupW(
620 [in] handle_t BindingHandle,
621 [in] SC_RPC_HANDLE hSCManager,
622 [in] DWORD dwServiceType,
623 [in] DWORD dwServiceState,
624 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
625 [in, range(0, 1024*256)] DWORD cbBufSize,
626 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
627 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
628 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
629 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
630
631 /* Function 36 */
632 DWORD RChangeServiceConfig2A(
633 [in] handle_t BindingHandle,
634 [in] SC_RPC_HANDLE hService,
635 [in] SC_RPC_CONFIG_INFOA Info);
636
637 /* Function 37 */
638 DWORD RChangeServiceConfig2W(
639 [in] handle_t BindingHandle,
640 [in] SC_RPC_HANDLE hService,
641 [in] SC_RPC_CONFIG_INFOW Info);
642
643 /* Function 38 */
644 DWORD RQueryServiceConfig2A(
645 [in] handle_t BindingHandle,
646 [in] SC_RPC_HANDLE hService,
647 [in] DWORD dwInfoLevel,
648 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
649 [in, range(0, 1024*8)] DWORD cbBufSize,
650 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
651
652 /* Function 39 */
653 DWORD RQueryServiceConfig2W(
654 [in] handle_t BindingHandle,
655 [in] SC_RPC_HANDLE hService,
656 [in] DWORD dwInfoLevel,
657 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
658 [in, range(0, 1024*8)] DWORD cbBufSize,
659 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
660
661 /* Function 40 */
662 DWORD RQueryServiceStatusEx(
663 [in] handle_t BindingHandle,
664 [in] SC_RPC_HANDLE hService,
665 [in] SC_STATUS_TYPE InfoLevel,
666 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
667 [in, range(0, 1024*8)] DWORD cbBufSize,
668 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
669
670 /* Function 41 */
671 DWORD REnumServicesStatusExA(
672 [in] handle_t BindingHandle,
673 [in] SC_RPC_HANDLE hSCManager,
674 [in] SC_ENUM_TYPE InfoLevel,
675 [in] DWORD dwServiceType,
676 [in] DWORD dwServiceState,
677 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
678 [in, range(0, 1024 * 256)] DWORD cbBufSize,
679 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
680 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
681 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
682 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCSTR pszGroupName);
683
684 /* Function 42 */
685 DWORD REnumServicesStatusExW(
686 [in] handle_t BindingHandle,
687 [in] SC_RPC_HANDLE hSCManager,
688 [in] SC_ENUM_TYPE InfoLevel,
689 [in] DWORD dwServiceType,
690 [in] DWORD dwServiceState,
691 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
692 [in, range(0, 1024 * 256)] DWORD cbBufSize,
693 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
694 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
695 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
696 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
697
698 /* Function 43 */
699 DWORD RSendTSMessage(
700 [in] handle_t BindingHandle); /* FIXME */
701
702 /* Function 44 */
703 DWORD RCreateServiceWOW64A(
704 [in] handle_t BindingHandle,
705 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
706 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
707 [in] DWORD dwDesiredAccess,
708 [in] DWORD dwServiceType,
709 [in] DWORD dwStartType,
710 [in] DWORD dwErrorControl,
711 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
712 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
713 [in, out, unique] LPDWORD lpdwTagId,
714 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
715 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
716 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
717 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
718 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
719 [out] LPSC_RPC_HANDLE lpServiceHandle);
720
721 /* Function 45 */
722 DWORD RCreateServiceWOW64W(
723 [in] handle_t BindingHandle,
724 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
725 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
726 [in] DWORD dwDesiredAccess,
727 [in] DWORD dwServiceType,
728 [in] DWORD dwStartType,
729 [in] DWORD dwErrorControl,
730 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
731 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
732 [in, out, unique] LPDWORD lpdwTagId,
733 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
734 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
735 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
736 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
737 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
738 [out] LPSC_RPC_HANDLE lpServiceHandle);
739
740 /* Function 46 */
741 DWORD RQueryServiceTagInfo(
742 [in] handle_t BindingHandle); /* FIXME */
743
744 /* Function 47 */
745 DWORD RNotifyServiceStatusChange(
746 [in] handle_t BindingHandle,
747 [in] SC_RPC_HANDLE hService,
748 [in] SC_RPC_NOTIFY_PARAMS NotifyParams,
749 [in] GUID* pClientProcessGuid,
750 [out] GUID* pSCMProcessGuid,
751 [out] PBOOL pfCreateRemoteQueue,
752 [out] LPSC_NOTIFY_RPC_HANDLE phNotify);
753
754 /* Function 48 */
755 DWORD RGetNotifyResults(
756 [in] handle_t BindingHandle,
757 [in] SC_NOTIFY_RPC_HANDLE hNotify,
758 [out] PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams);
759
760 /* Function 49 */
761 DWORD RCloseNotifyHandle(
762 [in] handle_t BindingHandle,
763 [in, out] LPSC_NOTIFY_RPC_HANDLE phNotify,
764 [out] PBOOL pfApcFired);
765
766 /* Function 50 */
767 DWORD RControlServiceExA(
768 [in] handle_t BindingHandle,
769 [in] SC_RPC_HANDLE hService,
770 [in] DWORD dwControl,
771 [in] DWORD dwInfoLevel/*,
772 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlInParams,
773 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlOutParams*/);
774
775 /* Function 51 */
776 DWORD RControlServiceExW(
777 [in] handle_t BindingHandle,
778 [in] SC_RPC_HANDLE hService,
779 [in] DWORD dwControl,
780 [in] DWORD dwInfoLevel/*,
781 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlInParams,
782 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlOutParams*/);
783
784 /* Function 52 */
785 DWORD RSendPnPMessage(
786 [in] handle_t BindingHandle); /* FIXME */
787
788 /* Function 53 */
789 DWORD RValidatePnPService(
790 [in] handle_t BindingHandle); /* FIXME */
791
792 /* Function 54 */
793 DWORD ROpenServiceStatusHandle(
794 [in] handle_t BindingHandle); /* FIXME */
795
796 /* Function 55 */
797 DWORD RFunction55(
798 [in] handle_t BindingHandle); /* FIXME */
799 }