Service Manager:
[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, 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 #ifndef __midl
301 ,explicit_handle
302 #endif
303 ]
304 interface svcctl
305 {
306 /* Function 0 */
307 DWORD RCloseServiceHandle(
308 [in, out] LPSC_RPC_HANDLE hSCObject);
309
310 /* Function 1 */
311 DWORD RControlService(
312 [in] SC_RPC_HANDLE hService,
313 [in] DWORD dwControl,
314 [out] LPSERVICE_STATUS lpServiceStatus);
315
316 /* Function 2 */
317 DWORD RDeleteService(
318 [in] SC_RPC_HANDLE hService);
319
320 /* Function 3 */
321 DWORD RLockServiceDatabase(
322 [in] SC_RPC_HANDLE hSCManager,
323 [out] LPSC_RPC_LOCK lpLock);
324
325 /* Function 4 */
326 DWORD RQueryServiceObjectSecurity(
327 [in] SC_RPC_HANDLE hService,
328 [in] SECURITY_INFORMATION dwSecurityInformation,
329 [out, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor,
330 [in, range(0, 1024 * 256)] DWORD cbBufSize,
331 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded);
332
333 /* Function 5 */
334 DWORD RSetServiceObjectSecurity(
335 [in] SC_RPC_HANDLE hService,
336 [in] DWORD dwSecurityInformation,
337 [in, size_is(dwSecuityDescriptorSize)] LPBYTE lpSecurityDescriptor,
338 [in] DWORD dwSecuityDescriptorSize);
339
340 /* Function 6 */
341 DWORD RQueryServiceStatus(
342 [in] SC_RPC_HANDLE hService,
343 [out] LPSERVICE_STATUS lpServiceStatus);
344
345 /* Function 7 */
346 DWORD RSetServiceStatus(
347 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
348 [in] LPSERVICE_STATUS lpServiceStatus);
349
350 /* Function 8 */
351 DWORD RUnlockServiceDatabase(
352 [in, out] LPSC_RPC_LOCK Lock);
353
354 /* Function 9 */
355 DWORD RNotifyBootConfigStatus(
356 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName,
357 [in] DWORD BootAcceptable);
358
359 /* Function 10 */
360 DWORD RI_ScSetServiceBitsW(
361 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
362 [in] DWORD dwServiceBits,
363 [in] BOOL bSetBitsOn,
364 [in] BOOL bUpdateImmediately,
365 [in, string, unique] LPWSTR lpString);
366
367 /* Function 11 */
368 DWORD RChangeServiceConfigW(
369 [in] SC_RPC_HANDLE hService,
370 [in] DWORD dwServiceType,
371 [in] DWORD dwStartType,
372 [in] DWORD dwErrorControl,
373 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
374 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpLoadOrderGroup,
375 [in, out, unique] LPDWORD lpdwTagId,
376 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
377 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
378 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
379 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
380 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
381 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName);
382
383 /* Function 12 */
384 DWORD RCreateServiceW(
385 [in] SC_RPC_HANDLE hSCManager,
386 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
387 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
388 [in] DWORD dwDesiredAccess,
389 [in] DWORD dwServiceType,
390 [in] DWORD dwStartType,
391 [in] DWORD dwErrorControl,
392 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
393 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
394 [in, out, unique] LPDWORD lpdwTagId,
395 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
396 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
397 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
398 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
399 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
400 [out] LPSC_RPC_HANDLE lpServiceHandle);
401
402 /* Function 13 */
403 DWORD REnumDependentServicesW(
404 [in] SC_RPC_HANDLE hService,
405 [in] DWORD dwServiceState,
406 [out, size_is(cbBufSize)] LPBYTE lpServices,
407 [in, range(0, 1024*256)] DWORD cbBufSize,
408 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
409 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
410
411 /* Function 14 */
412 DWORD REnumServicesStatusW(
413 [in] SC_RPC_HANDLE hSCManager,
414 [in] DWORD dwServiceType,
415 [in] DWORD dwServiceState,
416 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
417 [in, range(0, 1024*256)] DWORD dwBufSize,
418 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
419 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
420 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
421
422 /* Function 15 */
423 DWORD ROpenSCManagerW(
424 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName,
425 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDatabaseName,
426 [in] DWORD dwDesiredAccess,
427 [out] LPSC_RPC_HANDLE lpScHandle);
428
429 /* Function 16 */
430 DWORD ROpenServiceW(
431 [in] SC_RPC_HANDLE hSCManager,
432 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
433 [in] DWORD dwDesiredAccess,
434 [out] LPSC_RPC_HANDLE lpServiceHandle);
435
436 /* Function 17 */
437 DWORD RQueryServiceConfigW(
438 [in] SC_RPC_HANDLE hService,
439 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
440 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGW lpServiceConfig, */
441 [in, range(0, 1024*8)] DWORD cbBufSize,
442 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
443
444 /* Function 18 */
445 DWORD RQueryServiceLockStatusW(
446 [in] SC_RPC_HANDLE hSCManager,
447 [out] LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
448 [in, range(0, 1024*4)] DWORD cbBufSize,
449 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
450
451 /* Function 19 */
452 DWORD RStartServiceW(
453 [in] SC_RPC_HANDLE hService,
454 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
455 [in, unique, size_is(argc)] LPSTRING_PTRSW argv);
456
457 /* Function 20 */
458 DWORD RGetServiceDisplayNameW(
459 [in] SC_RPC_HANDLE hSCManager,
460 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
461 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpDisplayName,
462 [in, out] DWORD* lpcchBuffer);
463
464 /* Function 21 */
465 DWORD RGetServiceKeyNameW(
466 [in] SC_RPC_HANDLE hSCManager,
467 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
468 [out, string, range(1, 4*1024+1), size_is(*lpcchBuffer + 1)] LPWSTR lpServiceName,
469 [in, out] DWORD* lpcchBuffer);
470
471 /* Function 22 */
472 DWORD RI_ScSetServiceBitsA(
473 [in] RPC_SERVICE_STATUS_HANDLE hServiceStatus,
474 [in] DWORD dwServiceBits,
475 [in] BOOL bSetBitsOn,
476 [in] BOOL bUpdateImmediately,
477 [in, string, unique] LPSTR lpString);
478
479 /* Function 23 */
480 DWORD RChangeServiceConfigA(
481 [in] SC_RPC_HANDLE hService,
482 [in] DWORD dwServiceType,
483 [in] DWORD dwStartType,
484 [in] DWORD dwErrorControl,
485 [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
486 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
487 [in, out, unique] LPDWORD lpdwTagId,
488 [in, unique, size_is(dwDependSize)] LPSTR lpDependencies,
489 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
490 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
491 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
492 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
493 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName);
494
495 /* Function 24 */
496 DWORD RCreateServiceA(
497 [in] SC_RPC_HANDLE hSCManager,
498 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
499 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
500 [in] DWORD dwDesiredAccess,
501 [in] DWORD dwServiceType,
502 [in] DWORD dwStartType,
503 [in] DWORD dwErrorControl,
504 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
505 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
506 [in, out, unique] LPDWORD lpdwTagId,
507 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
508 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
509 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
510 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
511 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
512 [out] LPSC_RPC_HANDLE lpServiceHandle);
513
514 /* Function 25 */
515 DWORD REnumDependentServicesA(
516 [in] SC_RPC_HANDLE hService,
517 [in] DWORD dwServiceState,
518 [out, size_is(cbBufSize)] LPBYTE lpServices,
519 [in, range(0, 1024*256)] DWORD cbBufSize,
520 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
521 [out] LPBOUNDED_DWORD_256K lpServicesReturned);
522
523 /* Function 26 */
524 DWORD REnumServicesStatusA(
525 [in] SC_RPC_HANDLE hSCManager,
526 [in] DWORD dwServiceType,
527 [in] DWORD dwServiceState,
528 [out, size_is(dwBufSize)] LPBYTE lpBuffer,
529 [in, range(0, 1024*256)] DWORD dwBufSize,
530 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
531 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
532 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeHandle);
533
534 /* Function 27 */
535 DWORD ROpenSCManagerA(
536 [in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEA lpMachineName,
537 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDatabaseName,
538 [in] DWORD dwDesiredAccess,
539 [out] LPSC_RPC_HANDLE lpScHandle);
540
541 /* Function 28 */
542 DWORD ROpenServiceA(
543 [in] SC_RPC_HANDLE hSCManager,
544 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
545 [in] DWORD dwDesiredAccess,
546 [out] LPSC_RPC_HANDLE lpServiceHandle);
547
548 /* Function 29 */
549 DWORD RQueryServiceConfigA(
550 [in] SC_RPC_HANDLE hService,
551 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
552 /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig, */
553 [in, range(0, 1024*8)] DWORD cbBufSize,
554 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
555
556 /* Function 30 */
557 DWORD RQueryServiceLockStatusA(
558 [in] SC_RPC_HANDLE hSCManager,
559 [out] LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus,
560 [in, range(0, 1024*4)] DWORD cbBufSize,
561 [out] LPBOUNDED_DWORD_4K pcbBytesNeeded);
562
563 /* Function 31 */
564 DWORD RStartServiceA(
565 [in] SC_RPC_HANDLE hService,
566 [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc,
567 [in, unique, size_is(argc)] LPSTRING_PTRSA argv);
568
569 /* Function 32 */
570 DWORD RGetServiceDisplayNameA(
571 [in] SC_RPC_HANDLE hSCManager,
572 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
573 [out, string, size_is(*lpcchBuffer)] LPSTR lpDisplayName,
574 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
575
576 /* Function 33 */
577 DWORD RGetServiceKeyNameA(
578 [in] SC_RPC_HANDLE hSCManager,
579 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
580 [out, string, size_is(*lpcchBuffer)] LPSTR lpKeyName,
581 [in, out] LPBOUNDED_DWORD_4K lpcchBuffer);
582
583 /* Function 34 */
584 DWORD RI_ScGetCurrentGroupStateW(
585 [in] SC_RPC_HANDLE hSCManager,
586 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
587 [out] LPDWORD lpState);
588
589 /* Function 35 */
590 DWORD REnumServiceGroupW(
591 [in] SC_RPC_HANDLE hSCManager,
592 [in] DWORD dwServiceType,
593 [in] DWORD dwServiceState,
594 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
595 [in, range(0, 1024*256)] DWORD cbBufSize,
596 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
597 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
598 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
599 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
600
601 /* Function 36 */
602 DWORD RChangeServiceConfig2A(
603 [in] SC_RPC_HANDLE hService,
604 [in] SC_RPC_CONFIG_INFOA Info);
605
606 /* Function 37 */
607 DWORD RChangeServiceConfig2W(
608 [in] SC_RPC_HANDLE hService,
609 [in] SC_RPC_CONFIG_INFOW Info);
610
611 /* Function 38 */
612 DWORD RQueryServiceConfig2A(
613 [in] SC_RPC_HANDLE hService,
614 [in] DWORD dwInfoLevel,
615 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
616 [in, range(0, 1024*8)] DWORD cbBufSize,
617 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
618
619 /* Function 39 */
620 DWORD RQueryServiceConfig2W(
621 [in] SC_RPC_HANDLE hService,
622 [in] DWORD dwInfoLevel,
623 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
624 [in, range(0, 1024*8)] DWORD cbBufSize,
625 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
626
627 /* Function 40 */
628 DWORD RQueryServiceStatusEx(
629 [in] SC_RPC_HANDLE hService,
630 [in] SC_STATUS_TYPE InfoLevel,
631 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
632 [in, range(0, 1024*8)] DWORD cbBufSize,
633 [out] LPBOUNDED_DWORD_8K pcbBytesNeeded);
634
635 /* Function 41 */
636 DWORD REnumServicesStatusExA(
637 [in] SC_RPC_HANDLE hSCManager,
638 [in] SC_ENUM_TYPE InfoLevel,
639 [in] DWORD dwServiceType,
640 [in] DWORD dwServiceState,
641 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
642 [in, range(0, 1024 * 256)] DWORD cbBufSize,
643 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
644 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
645 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
646 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCSTR pszGroupName);
647
648 /* Function 42 */
649 DWORD REnumServicesStatusExW(
650 [in] SC_RPC_HANDLE hSCManager,
651 [in] SC_ENUM_TYPE InfoLevel,
652 [in] DWORD dwServiceType,
653 [in] DWORD dwServiceState,
654 [out, size_is(cbBufSize)] LPBYTE lpBuffer,
655 [in, range(0, 1024 * 256)] DWORD cbBufSize,
656 [out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
657 [out] LPBOUNDED_DWORD_256K lpServicesReturned,
658 [in, out, unique] LPBOUNDED_DWORD_256K lpResumeIndex,
659 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPCWSTR pszGroupName);
660
661 /* Function 43 */
662 DWORD RSendTSMessage(
663 [in] handle_t BindingHandle); /* FIXME */
664
665 /* Function 44 */
666 DWORD RCreateServiceWOW64A(
667 [in] handle_t BindingHandle,
668 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpServiceName,
669 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpDisplayName,
670 [in] DWORD dwDesiredAccess,
671 [in] DWORD dwServiceType,
672 [in] DWORD dwStartType,
673 [in] DWORD dwErrorControl,
674 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPSTR lpBinaryPathName,
675 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPSTR lpLoadOrderGroup,
676 [in, out, unique] LPDWORD lpdwTagId,
677 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
678 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
679 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPSTR lpServiceStartName,
680 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
681 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
682 [out] LPSC_RPC_HANDLE lpServiceHandle);
683
684 /* Function 45 */
685 DWORD RCreateServiceWOW64W(
686 [in] handle_t BindingHandle,
687 [in, string, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpServiceName,
688 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpDisplayName,
689 [in] DWORD dwDesiredAccess,
690 [in] DWORD dwServiceType,
691 [in] DWORD dwStartType,
692 [in] DWORD dwErrorControl,
693 [in, string, range(0, SC_MAX_PATH_LENGTH)] LPWSTR lpBinaryPathName,
694 [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] LPWSTR lpLoadOrderGroup,
695 [in, out, unique] LPDWORD lpdwTagId,
696 [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
697 [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
698 [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] LPWSTR lpServiceStartName,
699 [in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
700 [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
701 [out] LPSC_RPC_HANDLE lpServiceHandle);
702
703 /* Function 46 */
704 DWORD RQueryServiceTagInfo(
705 [in] handle_t BindingHandle); /* FIXME */
706
707 /* Function 47 */
708 DWORD RNotifyServiceStatusChange(
709 [in] SC_RPC_HANDLE hService,
710 [in] SC_RPC_NOTIFY_PARAMS NotifyParams,
711 [in] GUID* pClientProcessGuid,
712 [out] GUID* pSCMProcessGuid,
713 [out] PBOOL pfCreateRemoteQueue,
714 [out] LPSC_NOTIFY_RPC_HANDLE phNotify);
715
716 /* Function 48 */
717 DWORD RGetNotifyResults(
718 [in] SC_NOTIFY_RPC_HANDLE hNotify,
719 [out] PSC_RPC_NOTIFY_PARAMS_LIST *ppNotifyParams);
720
721 /* Function 49 */
722 DWORD RCloseNotifyHandle(
723 [in, out] LPSC_NOTIFY_RPC_HANDLE phNotify,
724 [out] PBOOL pfApcFired);
725
726 /* Function 50 */
727 DWORD RControlServiceExA(
728 [in] SC_RPC_HANDLE hService,
729 [in] DWORD dwControl,
730 [in] DWORD dwInfoLevel/*,
731 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlInParams,
732 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSA pControlOutParams*/);
733
734 /* Function 51 */
735 DWORD RControlServiceExW(
736 [in] SC_RPC_HANDLE hService,
737 [in] DWORD dwControl,
738 [in] DWORD dwInfoLevel/*,
739 [in, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlInParams,
740 [out, switch_is(dwInfoLevel)] PSC_RPC_SERVICE_CONTROL_IN_PARAMSW pControlOutParams*/);
741
742 /* Function 52 */
743 DWORD RSendPnPMessage(
744 [in] handle_t BindingHandle); /* FIXME */
745
746 /* Function 53 */
747 DWORD RValidatePnPService(
748 [in] handle_t BindingHandle); /* FIXME */
749
750 /* Function 54 */
751 DWORD ROpenServiceStatusHandle(
752 [in] handle_t BindingHandle); /* FIXME */
753
754 /* Function 55 */
755 DWORD RFunction55(
756 [in] handle_t BindingHandle); /* FIXME */
757 }