pszGroupName in EnumServicesStatusEx() can be NULL
[reactos.git] / reactos / include / idl / svcctl.idl
1 /*
2 * Service Control Manager (SCM) interface definition
3 */
4
5 //#include <windef.h>
6 //#include <winsvc.h>
7
8 #define BYTE unsigned char
9 #define DWORD unsigned long
10 #define BOOL unsigned long
11 #define SC_HANDLE unsigned int
12 #define SC_LOCK unsigned int
13 #define SERVICE_STATUS_HANDLE unsigned long
14 #define SC_STATUS_TYPE unsigned long
15 #define SC_ENUM_TYPE unsigned long
16 #define LPSTR char*
17 #define LPCSTR char*
18 #define LPWSTR wchar_t*
19 #define LPCWSTR wchar_t*
20 #define LPBYTE unsigned char*
21 #define LPDWORD unsigned long*
22
23 [
24 uuid(367abb81-9844-35f1-ad32-98f038001003),
25 version(2.0),
26 pointer_default(unique),
27 explicit_handle
28 ]
29 interface svcctl
30 {
31 cpp_quote("#if 0")
32 typedef struct _SERVICE_STATUS
33 {
34 DWORD dwServiceType;
35 DWORD dwCurrentState;
36 DWORD dwControlsAccepted;
37 DWORD dwWin32ExitCode;
38 DWORD dwServiceSpecificExitCode;
39 DWORD dwCheckPoint;
40 DWORD dwWaitHint;
41 } SERVICE_STATUS, *LPSERVICE_STATUS;
42 cpp_quote("#endif")
43
44 /* Function 0 */
45 DWORD ScmrCloseServiceHandle([in] handle_t BindingHandle,
46 [in] SC_HANDLE hSCObject);
47
48 /* Function 1 */
49 BOOL ScmrControlService([in] handle_t BindingHandle,
50 [in] SC_HANDLE hService,
51 [in] DWORD dwControl,
52 [out] LPSERVICE_STATUS lpServiceStatus);
53
54 /* Function 2 */
55 DWORD ScmrDeleteService([in] handle_t BindingHandle,
56 [in] SC_HANDLE hService);
57
58 /* Function 3 */
59 DWORD ScmrLockServiceDatabase([in] handle_t BindingHandle,
60 [in] SC_HANDLE hSCManager,
61 [out] SC_LOCK *hLock);
62
63 /* Function 4 */
64 DWORD ScmrQueryServiceObjectSecurity([in] handle_t BindingHandle,
65 [in] SC_HANDLE hService,
66 [in] DWORD dwSecurityInformation,
67 [out, size_is(dwSecuityDescriptorSize)] unsigned char *lpSecurityDescriptor,
68 [in] DWORD dwSecuityDescriptorSize,
69 [out] LPDWORD pcbBytesNeeded);
70
71 /* Function 5 */
72 DWORD ScmrSetServiceObjectSecurity([in] handle_t BindingHandle,
73 [in] SC_HANDLE hService,
74 [in] DWORD dwSecurityInformation,
75 [in, size_is(dwSecuityDescriptorSize)] unsigned char *lpSecurityDescriptor,
76 [in] DWORD dwSecuityDescriptorSize);
77
78 /* Function 6 */
79 DWORD ScmrQueryServiceStatus([in] handle_t BindingHandle,
80 [in] SC_HANDLE hSCManager,
81 [out] LPSERVICE_STATUS lpServiceStatus);
82
83 /* Function 7 */
84 DWORD ScmrSetServiceStatus([in] handle_t BindingHandle,
85 [in] SERVICE_STATUS_HANDLE hServiceStatus); /* FIXME */
86
87 /* Function 8 */
88 DWORD ScmrUnlockServiceDatabase([in] handle_t BindingHandle,
89 [in] SC_LOCK hLock);
90
91 /* Function 9 */
92 DWORD ScmrNotifyBootConfigStatus([in] handle_t BindingHandle,
93 [in] BOOL BootAcceptable);
94
95 /* Function 10 */
96 DWORD ScmrSetServiceBitsW([in] handle_t BindingHandle,
97 [in] SERVICE_STATUS_HANDLE hServiceStatus,
98 [in] DWORD dwServiceBits,
99 [in] BOOL bSetBitsOn,
100 [in] BOOL bUpdateImmediately,
101 [in, string, unique] LPWSTR lpString);
102
103 /* Function 11 */
104 DWORD ScmrChangeServiceConfigW([in] handle_t BindingHandle,
105 [in] SC_HANDLE hSCManager,
106 [in] DWORD dwServiceType,
107 [in] DWORD dwStartType,
108 [in] DWORD dwErrorControl,
109 [in, string, unique] LPCWSTR lpBinaryPathName,
110 [in, string, unique] LPCWSTR lpLoadOrderGroup,
111 [in, out, unique] LPDWORD lpdwTagId,
112 [in, size_is(dwDependenciesLength), unique] LPCWSTR lpDependencies,
113 [in] DWORD dwDependenciesLength,
114 [in, string, unique] LPCWSTR lpServiceStartName,
115 [in, size_is(dwPasswordLength), unique] LPCWSTR lpPassword,
116 [in] DWORD dwPasswordLength,
117 [in, string, unique] LPCWSTR lpDisplayName);
118
119 /* Function 12 */
120 DWORD ScmrCreateServiceW([in] handle_t BindingHandle,
121 [in] SC_HANDLE hSCManager,
122 [in, string, ref] LPCWSTR lpServiceName,
123 [in, string, unique] LPCWSTR lpDisplayName,
124 [in] DWORD dwDesiredAccess,
125 [in] DWORD dwServiceType,
126 [in] DWORD dwStartType,
127 [in] DWORD dwErrorControl,
128 [in, string, ref] LPCWSTR lpBinaryPathName,
129 [in, string, unique] LPCWSTR lpLoadOrderGroup,
130 [in, out, unique] LPDWORD lpdwTagId,
131 [in, size_is(dwDependenciesLength), unique] LPCWSTR lpDependencies,
132 [in] DWORD dwDependenciesLength,
133 [in, string, unique] LPCWSTR lpServiceStartName,
134 [in, size_is(dwPasswordLength), unique] LPCWSTR lpPassword,
135 [in] DWORD dwPasswordLength,
136 [out] SC_HANDLE *hService);
137
138 /* Function 13 */
139 DWORD ScmrEnumDependentServicesW([in] handle_t BindingHandle,
140 [in] SC_HANDLE hService,
141 [in] DWORD dwServiceState,
142 [out, unique, size_is(cbBufSize)] LPBYTE lpServices,
143 [in] DWORD cbBufSize,
144 [out] LPDWORD pcbBytesNeeded,
145 [out] LPDWORD lpServicesReturned);
146
147 /* Function 14 */
148 DWORD ScmrEnumServicesStatusW([in] handle_t BindingHandle,
149 [in] SC_HANDLE hSCManager,
150 [in] DWORD dwServiceType,
151 [in] DWORD dwServiceState,
152 [out, unique, size_is(dwBufSize)] LPBYTE lpServices,
153 [in] DWORD dwBufSize,
154 [out] LPDWORD pcbBytesNeeded,
155 [out] LPDWORD lpServicesReturned,
156 [in, out, unique] LPDWORD lpResumeHandle);
157
158 /* Function 15 */
159 DWORD ScmrOpenSCManagerW([in] handle_t BindingHandle,
160 [in, string, unique] LPCWSTR lpMachineName,
161 [in, string, unique] LPCWSTR lpDatabaseName,
162 [in] DWORD dwDesiredAccess,
163 [out] SC_HANDLE *hScm);
164
165 /* Function 16 */
166 SC_HANDLE ScmrOpenServiceW([in] handle_t BindingHandle,
167 [in] SC_HANDLE hSCManager,
168 [in, string] LPCWSTR lpServiceName,
169 [in] DWORD dwDesiredAccess,
170 [out] SC_HANDLE *hScm);
171
172 /* Function 17 */
173 DWORD ScmrQueryServiceConfigW([in] handle_t BindingHandle,
174 [in] SC_HANDLE hService,
175 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
176 [in] DWORD cbBufSize,
177 [out] LPDWORD pcbBytesNeeded);
178
179 /* Function 18 */
180 DWORD ScmrQueryServiceLockStatusW([in] handle_t BindingHandle,
181 [in] SC_HANDLE hSCManager,
182 [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus,
183 [in] DWORD cbBufSize,
184 [out] LPDWORD pcbBytesNeeded);
185
186 /* Function 19 */
187 DWORD ScmrStartServiceW([in] handle_t BindingHandle,
188 [in] SC_HANDLE hService,
189 [in] DWORD dwNumServiceArgs,
190 [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer,
191 [in] DWORD cbBufSize);
192
193 /* FIXME: This is the correct interface but WIDL doesn't support it yet! */
194 // DWORD ScmrStartServiceW([in] handle_t BindingHandle,
195 // [in] SC_HANDLE hService,
196 // [in] DWORD dwNumServiceArgs,
197 // [in, string, size_is(dwNumServiceArgs, ), unique] LPWSTR *lpServiceArgVectors);
198
199 /* Function 20 */
200 DWORD ScmrGetServiceDisplayNameW([in] handle_t BindingHandle,
201 [in] SC_HANDLE hSCManager,
202 [in, string, ref] LPCWSTR lpServiceName,
203 [out, size_is(*lpcchBuffer), unique] LPWSTR lpDisplayName,
204 [in, out, ref] LPDWORD lpcchBuffer);
205
206 /* Function 21 */
207 DWORD ScmrGetServiceKeyNameW([in] handle_t BindingHandle,
208 [in] SC_HANDLE hSCManager,
209 [in, string, ref] LPCWSTR lpDisplayName,
210 [out, size_is(*lpcchBuffer), unique] LPWSTR lpServiceName,
211 [in, out, ref] LPDWORD lpcchBuffer);
212
213 /* Function 22 */
214 DWORD ScmrSetServiceBitsA([in] handle_t BindingHandle,
215 [in] SERVICE_STATUS_HANDLE hServiceStatus,
216 [in] DWORD dwServiceBits,
217 [in] BOOL bSetBitsOn,
218 [in] BOOL bUpdateImmediately,
219 [in, string, unique] LPSTR lpString);
220
221 /* Function 23 */
222 DWORD ScmrChangeServiceConfigA([in] handle_t BindingHandle,
223 [in] SC_HANDLE hSCManager,
224 [in] DWORD dwServiceType,
225 [in] DWORD dwStartType,
226 [in] DWORD dwErrorControl,
227 [in, string, unique] LPCSTR lpBinaryPathName,
228 [in, string, unique] LPCSTR lpLoadOrderGroup,
229 [in, out, unique] LPDWORD lpdwTagId,
230 [in, size_is(dwDependenciesLength), unique] LPCSTR lpDependencies,
231 [in] DWORD dwDependenciesLength,
232 [in, string, unique] LPCSTR lpServiceStartName,
233 [in, size_is(dwPasswordLength), unique] LPCSTR lpPassword,
234 [in] DWORD dwPasswordLength,
235 [in, string, unique] LPCSTR lpDisplayName);
236
237 /* Function 24 */
238 DWORD ScmrCreateServiceA([in] handle_t BindingHandle,
239 [in] SC_HANDLE hSCManager,
240 [in, string, ref] LPCSTR lpServiceName,
241 [in, string, unique] LPCSTR lpDisplayName,
242 [in] DWORD dwDesiredAccess,
243 [in] DWORD dwServiceType,
244 [in] DWORD dwStartType,
245 [in] DWORD dwErrorControl,
246 [in, string, ref] LPCSTR lpBinaryPathName,
247 [in, string, unique] LPCSTR lpLoadOrderGroup,
248 [in, out, unique] LPDWORD lpdwTagId,
249 [in, size_is(dwDependenciesLength), unique] LPCSTR lpDependencies,
250 [in] DWORD dwDependenciesLength,
251 [in, string, unique] LPCSTR lpServiceStartName,
252 [in, size_is(dwPasswordLength), unique] LPCSTR lpPassword,
253 [in] DWORD dwPasswordLength,
254 [out] SC_HANDLE *hService);
255
256 /* Function 25 */
257 DWORD ScmrEnumDependentServicesA([in] handle_t BindingHandle,
258 [in] SC_HANDLE hService,
259 [in] DWORD dwServiceState,
260 [out, unique, size_is(cbBufSize)] LPBYTE lpServices,
261 [in] DWORD cbBufSize,
262 [out] LPDWORD pcbBytesNeeded,
263 [out] LPDWORD lpServicesReturned);
264
265 /* Function 26 */
266 DWORD ScmrEnumServicesStatusA([in] handle_t BindingHandle,
267 [in] SC_HANDLE hSCManager,
268 [in] DWORD dwServiceType,
269 [in] DWORD dwServiceState,
270 [out, unique, size_is(dwBufSize)] LPBYTE lpServices,
271 [in] DWORD dwBufSize,
272 [out] LPDWORD pcbBytesNeeded,
273 [out] LPDWORD lpServicesReturned,
274 [in, out, unique] LPDWORD lpResumeHandle);
275
276 /* Function 27 */
277 DWORD ScmrOpenSCManagerA([in] handle_t BindingHandle,
278 [in, string, unique] LPCSTR lpMachineName,
279 [in, string, unique] LPCSTR lpDatabaseName,
280 [in] DWORD dwDesiredAccess,
281 [out] SC_HANDLE *hScm);
282
283 /* Function 28 */
284 SC_HANDLE ScmrOpenServiceA([in] handle_t BindingHandle,
285 [in] SC_HANDLE hSCManager,
286 [in, string] LPCSTR lpServiceName,
287 [in] DWORD dwDesiredAccess,
288 [out] SC_HANDLE *hScm);
289
290 /* Function 29 */
291 DWORD ScmrQueryServiceConfigA([in] handle_t BindingHandle,
292 [in] SC_HANDLE hService,
293 [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig,
294 [in] DWORD cbBufSize,
295 [out] LPDWORD pcbBytesNeeded);
296
297 /* Function 30 */
298 DWORD ScmrQueryServiceLockStatusA([in] handle_t BindingHandle,
299 [in] SC_HANDLE hSCManager,
300 [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus,
301 [in] DWORD cbBufSize,
302 [out] LPDWORD pcbBytesNeeded);
303
304 /* Function 31 */
305 DWORD ScmrStartServiceA([in] handle_t BindingHandle,
306 [in] SC_HANDLE hService,
307 [in] DWORD dwNumServiceArgs,
308 [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer,
309 [in] DWORD cbBufSize);
310
311 /* FIXME: This is the correct interface but WIDL doesn't support it yet! */
312 // DWORD ScmrStartServiceA([in] handle_t BindingHandle,
313 // [in] SC_HANDLE hService,
314 // [in] DWORD dwNumServiceArgs,
315 // [in, unique, string, size_is(dwNumServiceArgs, )] LPSTR *lpServiceArgVectors);
316
317 /* Function 32 */
318 DWORD ScmrGetServiceDisplayNameA([in] handle_t BindingHandle,
319 [in] SC_HANDLE hSCManager,
320 [in, string, ref] LPCSTR lpServiceName,
321 [out, unique, size_is(*lpcchBuffer)] LPSTR lpDisplayName,
322 [in, out, ref] LPDWORD lpcchBuffer);
323
324 /* Function 33 */
325 DWORD ScmrGetServiceKeyNameA([in] handle_t BindingHandle,
326 [in] SC_HANDLE hSCManager,
327 [in, string, ref] LPCSTR lpDisplayName,
328 [out, unique, size_is(*lpcchBuffer)] LPSTR lpServiceName,
329 [in, out, ref] LPDWORD lpcchBuffer);
330
331 /* Function 34 */
332 DWORD ScmrGetCurrentGroupStateW([in] handle_t BindingHandle); /* FIXME */
333
334 /* Function 35 */
335 DWORD ScmrEnumServiceGroupW([in] handle_t BindingHandle); /* FIXME */
336
337 /* Function 36 */
338 DWORD ScmrChangeServiceConfig2A([in] handle_t BindingHandle,
339 [in] SC_HANDLE hService,
340 [in] DWORD dwInfoLevel,
341 [in, size_is(dwInfoSize)] LPBYTE lpInfo,
342 [in] DWORD dwInfoSize);
343
344 /* Function 37 */
345 DWORD ScmrChangeServiceConfig2W([in] handle_t BindingHandle,
346 [in] SC_HANDLE hService,
347 [in] DWORD dwInfoLevel,
348 [in, size_is(dwInfoSize)] LPBYTE lpInfo,
349 [in] DWORD dwInfoSize);
350
351 /* Function 38 */
352 DWORD ScmrQueryServiceConfig2A([in] handle_t BindingHandle,
353 [in] SC_HANDLE hService,
354 [in] DWORD dwInfoLevel,
355 [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer,
356 [in] DWORD cbBufSize,
357 [out] LPDWORD pcbBytesNeeded);
358
359 /* Function 39 */
360 DWORD ScmrQueryServiceConfig2W([in] handle_t BindingHandle,
361 [in] SC_HANDLE hService,
362 [in] DWORD dwInfoLevel,
363 [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer,
364 [in] DWORD cbBufSize,
365 [out] LPDWORD pcbBytesNeeded);
366
367 /* Function 40 */
368 DWORD ScmrQueryServiceStatusEx([in] handle_t BindingHandle,
369 [in] SC_HANDLE hService,
370 [in] SC_STATUS_TYPE InfoLevel,
371 [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer,
372 [in] DWORD cbBufSize,
373 [out] LPDWORD pcbBytesNeeded);
374
375 /* Function 41 */
376 DWORD ScmrEnumServicesStatusExA([in] handle_t BindingHandle,
377 [in] SC_HANDLE hService,
378 [in] SC_ENUM_TYPE InfoLevel,
379 [in] DWORD dwServiceType,
380 [in] DWORD dwServiceState,
381 [out, unique, size_is(cbBufSize)] LPBYTE lpServices,
382 [in] DWORD cbBufSize,
383 [out] LPDWORD pcbBytesNeeded,
384 [out] LPDWORD lpServicesReturned,
385 [in, out, unique] LPDWORD lpResumeHandle,
386 [in, string, unique] LPCSTR pszGroupName);
387
388 /* Function 42 */
389 DWORD ScmrEnumServicesStatusExW([in] handle_t BindingHandle,
390 [in] SC_HANDLE hService,
391 [in] SC_ENUM_TYPE InfoLevel,
392 [in] DWORD dwServiceType,
393 [in] DWORD dwServiceState,
394 [out, unique, size_is(cbBufSize)] LPBYTE lpServices,
395 [in] DWORD cbBufSize,
396 [out] LPDWORD pcbBytesNeeded,
397 [out] LPDWORD lpServicesReturned,
398 [in, out, unique] LPDWORD lpResumeHandle,
399 [in, string, unique] LPCWSTR pszGroupName);
400
401 /* Function 43 */
402 /* ScmrSendTSMessage */
403 }