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