push 378fe7a60681a28e8b22f62dcfe122d585b92570
[wine/hacks.git] / include / wine / svcctl.idl
blob1e9aae25e58c2b1813a89c295fdbfca1d4c6b36c
1 /*
2 * svcctl interface definitions - exported by services.exe to access the
3 * services database
5 * Copyright 2007 Google (Mikolaj Zalewski)
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 import "wtypes.idl";
25 * some defined for the C code
27 cpp_quote("#include \"winsvc.h\"")
28 cpp_quote("#define SVCCTL_TRANSPORT {'n','c','a','c','n','_','n','p',0}")
29 cpp_quote("#define SVCCTL_ENDPOINT {'\\\\','p','i','p','e','\\\\','s','v','c','c','t','l',0}")
31 /* Not the Windows event name - if needed the true one can be found in Inside Windows */
32 cpp_quote("#define SVCCTL_STARTED_EVENT {'_','_','w','i','n','e','_','S','v','c','c','t','l','S','t','a','r','t','e','d',0}")
34 /* Service startup protocol over control pipe - not compatible with Windows */
35 enum service_pipe_command
37 WINESERV_STARTINFO = 1,
38 WINESERV_SENDCONTROL = 2
41 typedef struct service_start_info_t
43 enum service_pipe_command cmd; /* request code */
44 DWORD total_size; /* total request size */
45 DWORD name_size; /* size of name in data buffer */
46 DWORD control; /* control code */
47 WCHAR data[1];
48 } service_start_info;
51 uuid(367abb81-9844-35f1-ad32-98f038001003),
52 version(2.0),
53 pointer_default(unique),
54 endpoint("ncacn_np:[\\pipe\\svcctl]")
56 interface svcctl
58 /* handle types */
59 typedef [handle] LPCWSTR MACHINE_HANDLEW;
60 typedef [context_handle] void *SC_RPC_HANDLE;
61 typedef [context_handle] void *SC_RPC_LOCK;
63 /* undocumented access rights */
64 cpp_quote("#define SERVICE_SET_STATUS 0x8000")
66 cpp_quote("#if 0 /* already defined in winsvc.h */")
67 typedef struct _QUERY_SERVICE_CONFIGW {
68 DWORD dwServiceType;
69 DWORD dwStartType;
70 DWORD dwErrorControl;
71 [unique] LPWSTR lpBinaryPathName;
72 [unique] LPWSTR lpLoadOrderGroup;
73 DWORD dwTagId;
74 [unique] LPWSTR lpDependencies;
75 [unique] LPWSTR lpServiceStartName;
76 [unique] LPWSTR lpDisplayName;
77 } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
79 typedef struct _SERVICE_STATUS {
80 DWORD dwServiceType;
81 DWORD dwCurrentState;
82 DWORD dwControlsAccepted;
83 DWORD dwWin32ExitCode;
84 DWORD dwServiceSpecificExitCode;
85 DWORD dwCheckPoint;
86 DWORD dwWaitHint;
87 } SERVICE_STATUS, *LPSERVICE_STATUS;
89 typedef enum _SC_STATUS_TYPE {
90 SC_STATUS_PROCESS_INFO = 0
91 } SC_STATUS_TYPE;
93 typedef struct _SERVICE_DESCRIPTIONW {
94 LPWSTR lpDescription;
95 } SERVICE_DESCRIPTIONW,*LPSERVICE_DESCRIPTIONW;
97 typedef enum _SC_ACTION_TYPE {
98 SC_ACTION_NONE = 0,
99 SC_ACTION_RESTART = 1,
100 SC_ACTION_REBOOT = 2,
101 SC_ACTION_RUN_COMMAND = 3
102 } SC_ACTION_TYPE;
104 typedef struct _SC_ACTION {
105 SC_ACTION_TYPE Type;
106 DWORD Delay;
107 } SC_ACTION,*LPSC_ACTION;
109 typedef struct _SERVICE_FAILURE_ACTIONSW {
110 DWORD dwResetPeriod;
111 [unique] LPWSTR lpRebootMsg;
112 [unique] LPWSTR lpCommand;
113 DWORD cActions;
114 [size_is(cActions)] SC_ACTION *lpsaActions;
115 } SERVICE_FAILURE_ACTIONSW,*LPSERVICE_FAILURE_ACTIONSW;
117 #define SERVICE_CONFIG_DESCRIPTION 1
118 #define SERVICE_CONFIG_FAILURE_ACTIONS 2
119 #define SERVICE_CONFIG_DELAYED_AUTO_START_INFO 3
120 #define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG 4
121 #define SERVICE_CONFIG_SERVICE_SID_INFO 5
122 #define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO 6
123 #define SERVICE_CONFIG_PRESHUTDOWN_INFO 7
125 cpp_quote("#endif")
127 typedef [switch_type(DWORD)] union
129 [case (SERVICE_CONFIG_DESCRIPTION)] SERVICE_DESCRIPTIONW descr;
130 [case (SERVICE_CONFIG_FAILURE_ACTIONS)] SERVICE_FAILURE_ACTIONSW actions;
131 } SERVICE_CONFIG2W;
133 /* Compatible with Windows function 0x00 */
134 DWORD svcctl_CloseServiceHandle(
135 [in,out] SC_RPC_HANDLE *handle
138 /* Compatible with Windows function 0x01 */
139 DWORD svcctl_ControlService(
140 [in] SC_RPC_HANDLE hService,
141 [in] DWORD dwControl,
142 [out] SERVICE_STATUS *lpServiceStatus
145 /* Compatible with Windows function 0x02 */
146 DWORD svcctl_DeleteService(
147 [in] SC_RPC_HANDLE hService
150 /* Compatible with Windows function 0x03 */
151 DWORD svcctl_LockServiceDatabase(
152 [in] SC_RPC_HANDLE hSCManager,
153 [out] SC_RPC_LOCK *phLock
156 /* Not compatible with Windows function 0x04 */
157 DWORD svcctl_QueryServiceObjectSecurity(/* FIXME */);
159 /* Not compatible with Windows function 0x05 */
160 DWORD svcctl_SetServiceObjectSecurity(/* FIXME */);
162 /* Not compatible with Windows function 0x06 */
163 DWORD svcctl_QueryServiceStatus(/* FIXME */);
165 /* Compatible with Windows function 0x07 */
166 DWORD svcctl_SetServiceStatus(
167 [in] SC_RPC_HANDLE hServiceStatus,
168 [in] LPSERVICE_STATUS lpServiceStatus
171 /* Compatible with Windows function 0x08 */
172 DWORD svcctl_UnlockServiceDatabase(
173 [in,out] SC_RPC_LOCK *phLock
176 /* Not compatible with Windows function 0x09 */
177 DWORD svcctl_NotifyBootConfigStatus(/* FIXME */);
179 /* Not compatible with Windows function 0x0a */
180 DWORD svcctl_SCSetServiceBitsW(/* FIXME */);
182 /* Compatible with Windows function 0x0b */
183 DWORD svcctl_ChangeServiceConfigW(
184 [in] SC_RPC_HANDLE hService,
185 [in] DWORD dwServiceType,
186 [in] DWORD dwStartType,
187 [in] DWORD dwErrorControl,
188 [in,unique] LPCWSTR lpBinaryPathName,
189 [in,unique] LPCWSTR lpLoadOrderGroupKey,
190 [in,out,unique] DWORD *lpdwTagId,
191 [in,unique,size_is(dwDependenciesSize)] const BYTE *lpDependencies,
192 [in] DWORD dwDependenciesSize,
193 [in,unique] LPCWSTR lpServiceStartName,
194 [in,unique,size_is(dwPasswordSize)] const BYTE *lpPassword,
195 [in] DWORD dwPasswordSize,
196 [in,unique] LPCWSTR lpDisplayName
199 /* Compatible with Windows function 0x0c */
200 DWORD svcctl_CreateServiceW(
201 [in] SC_RPC_HANDLE hSCManager,
202 [in] LPCWSTR lpServiceName,
203 [in,unique] LPCWSTR lpDisplayName,
204 [in] DWORD dwDesiredAccess,
205 [in] DWORD dwServiceType,
206 [in] DWORD dwStartType,
207 [in] DWORD dwErrorControl,
208 [in] LPCWSTR lpBinaryPathName,
209 [in,unique] LPCWSTR lpLoadOrderGroup,
210 [in,out,unique] DWORD *lpdwTagId,
211 [in,unique,size_is(dwDependenciesSize)] const BYTE *lpDependencies,
212 [in] DWORD dwDependenciesSize,
213 [in,unique] LPCWSTR lpServiceStartName,
214 [in,unique,size_is(dwPasswordSize)] const BYTE *lpPassword,
215 [in] DWORD dwPasswordSize,
216 [out] SC_RPC_HANDLE *phService
219 /* Not compatible with Windows function 0x0d */
220 DWORD svcctl_EnumDependentServicesW(/* FIXME */);
222 /* Not compatible with Windows function 0x0e */
223 DWORD svcctl_EnumServicesStatusW(/* FIXME */);
225 /* Compatible with Windows function 0x0f */
226 DWORD svcctl_OpenSCManagerW(
227 [in,unique] MACHINE_HANDLEW MachineName,
228 [in,unique] LPCWSTR DatabaseName,
229 [in] DWORD dwAccessMask,
230 [out] SC_RPC_HANDLE *handle
233 /* Compatible with Windows function 0x10 */
234 DWORD svcctl_OpenServiceW(
235 [in] SC_RPC_HANDLE hSCManager,
236 [in] LPCWSTR lpServiceName,
237 [in] DWORD dwDesiredAccess,
238 [out] SC_RPC_HANDLE *phService
241 /* Windows function 0x11 must be using a different prototype - not compatible */
242 DWORD svcctl_QueryServiceConfigW(
243 [in] SC_RPC_HANDLE hService,
244 [out] QUERY_SERVICE_CONFIGW *config);
246 /* Not compatible with Windows function 0x12 */
247 DWORD svcctl_QueryServiceLockStatusW(/* FIXME */);
249 /* Untested with Windows function 0x13 */
250 DWORD svcctl_StartServiceW(
251 [in] SC_RPC_HANDLE hService,
252 [in] DWORD dwNumServiceArgs,
253 [in,unique,size_is(dwNumServiceArgs)] LPCWSTR *lpServiceArgVectors
256 /* Compatible with Windows function 0x14 */
257 DWORD svcctl_GetServiceDisplayNameW(
258 [in] SC_RPC_HANDLE hSCManager,
259 [in] LPCWSTR lpServiceName,
260 [out,size_is(cchBufSize)] WCHAR lpBuffer[],
261 [in] DWORD cchBufSize,
262 [in,out] DWORD *cchLength);
264 /* Compatible with Windows function 0x15 */
265 DWORD svcctl_GetServiceKeyNameW(
266 [in] SC_RPC_HANDLE hSCManager,
267 [in] LPCWSTR lpServiceDisplayName,
268 [out,size_is(cchBufSize)] WCHAR lpBuffer[],
269 [in] DWORD cchBufSize,
270 [in,out] DWORD *cchLength);
272 /* Not compatible with Windows function 0x16 */
273 DWORD svcctl_SCSetServiceBitsA(/* FIXME */);
275 /* Not compatible with Windows function 0x17 */
276 DWORD svcctl_ChangeServiceConfigA(/* FIXME */);
278 /* Not compatible with Windows function 0x18 */
279 DWORD svcctl_CreateServiceA(/* FIXME */);
281 /* Not compatible with Windows function 0x19 */
282 DWORD svcctl_EnumDependentServicesA(/* FIXME */);
284 /* Not compatible with Windows function 0x1a */
285 DWORD svcctl_EnumServicesStatusA(/* FIXME */);
287 /* Not compatible with Windows function 0x1b */
288 DWORD svcctl_OpenSCManagerA(/* FIXME */);
290 /* Not compatible with Windows function 0x1c */
291 DWORD svcctl_OpenServiceA(/* FIXME */);
293 /* Not compatible with Windows function 0x1d */
294 DWORD svcctl_QueryServiceConfigA(/* FIXME */);
296 /* Not compatible with Windows function 0x1e */
297 DWORD svcctl_QueryServiceLockStatusA(/* FIXME */);
299 /* Not compatible with Windows function 0x1f */
300 DWORD svcctl_StartServiceA(/* FIXME */);
302 /* Not compatible with Windows function 0x20 */
303 DWORD svcctl_GetServiceDisplayNameA(/* FIXME */);
305 /* Not compatible with Windows function 0x21 */
306 DWORD svcctl_GetServiceKeyNameA(/* FIXME */);
308 /* Not compatible with Windows function 0x22 */
309 DWORD svcctl_GetCurrentGroupStateW(/* FIXME */);
311 /* Not compatible with Windows function 0x23 */
312 DWORD svcctl_EnumServiceGroupW(/* FIXME */);
314 /* Not compatible with Windows function 0x24 */
315 DWORD svcctl_ChangeServiceConfig2A(/* FIXME */);
317 /* Untested with Windows function 0x25 */
318 DWORD svcctl_ChangeServiceConfig2W(
319 [in] SC_RPC_HANDLE hService,
320 [in] DWORD InfoLevel,
321 [in,switch_is(InfoLevel)] SERVICE_CONFIG2W *config );
323 /* Not compatible with Windows function 0x26 */
324 DWORD svcctl_QueryServiceConfig2A(/* FIXME */);
326 /* Untested with Windows function 0x27 */
327 DWORD svcctl_QueryServiceConfig2W(
328 [in] SC_RPC_HANDLE hService,
329 [in] DWORD InfoLevel,
330 [out,size_is(cbBufSize)] BYTE lpBuffer[],
331 [in] DWORD cbBufSize,
332 [out] LPDWORD pcbBytesNeeded
335 /* Untested with Windows function 0x28 */
336 DWORD svcctl_QueryServiceStatusEx(
337 [in] SC_RPC_HANDLE hService,
338 [in] SC_STATUS_TYPE InfoLevel,
339 [out,size_is(cbBufSize)] BYTE *lpBuffer,
340 [in] DWORD cbBufSize,
341 [out] LPDWORD pcbBytesNeeded