gdi32: Add driver entry points for GetImage and PutImage.
[wine] / include / wine / svcctl.idl
1 /*
2  * svcctl interface definitions - exported by services.exe to access the
3  * services database
4  *
5  * Copyright 2007 Google (Mikolaj Zalewski)
6  *
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.
11  *
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.
16  *
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
20  */
21
22 import "wtypes.idl";
23
24 /*
25  * some defined for the C code
26  */
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}")
30
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}")
33
34 /* Service startup protocol over control pipe - not compatible with Windows */
35 enum service_pipe_command
36 {
37     WINESERV_STARTINFO = 1,
38     WINESERV_SENDCONTROL = 2
39 };
40
41 typedef struct service_start_info_t
42 {
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;
49
50 [
51     uuid(367abb81-9844-35f1-ad32-98f038001003),
52     version(2.0),
53     pointer_default(unique),
54     endpoint("ncacn_np:[\\pipe\\svcctl]")
55 ]
56 interface svcctl
57 {
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;
62
63     /* undocumented access rights */
64     cpp_quote("#define SERVICE_SET_STATUS   0x8000")
65
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;
78
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;
88
89 typedef enum _SC_STATUS_TYPE {
90   SC_STATUS_PROCESS_INFO      = 0
91 } SC_STATUS_TYPE;
92
93 typedef struct _SERVICE_DESCRIPTIONW {
94    LPWSTR lpDescription;
95 } SERVICE_DESCRIPTIONW,*LPSERVICE_DESCRIPTIONW;
96
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;
103
104 typedef struct _SC_ACTION {
105     SC_ACTION_TYPE  Type;
106     DWORD       Delay;
107 } SC_ACTION,*LPSC_ACTION;
108
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;
116
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
124
125 typedef struct _ENUM_SERVICE_STATUSW {
126     LPWSTR          lpServiceName;
127     LPWSTR          lpDisplayName;
128     SERVICE_STATUS  ServiceStatus;
129 } ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW;
130
131 cpp_quote("#endif")
132
133 typedef [switch_type(DWORD)] union
134 {
135   [case (SERVICE_CONFIG_DESCRIPTION)] SERVICE_DESCRIPTIONW descr;
136   [case (SERVICE_CONFIG_FAILURE_ACTIONS)] SERVICE_FAILURE_ACTIONSW actions;
137 } SERVICE_CONFIG2W;
138
139     /* Compatible with Windows function 0x00 */
140     DWORD svcctl_CloseServiceHandle(
141         [in,out] SC_RPC_HANDLE *handle
142     );
143
144     /* Compatible with Windows function 0x01 */
145     DWORD svcctl_ControlService(
146         [in] SC_RPC_HANDLE hService,
147         [in] DWORD dwControl,
148         [out] SERVICE_STATUS *lpServiceStatus
149     );
150
151     /* Compatible with Windows function 0x02 */
152     DWORD svcctl_DeleteService(
153         [in] SC_RPC_HANDLE hService
154     );
155
156     /* Compatible with Windows function 0x03 */
157     DWORD svcctl_LockServiceDatabase(
158         [in] SC_RPC_HANDLE hSCManager,
159         [out] SC_RPC_LOCK *phLock
160     );
161
162     /* Not compatible with Windows function 0x04 */
163     DWORD svcctl_QueryServiceObjectSecurity(/* FIXME */);
164
165     /* Not compatible with Windows function 0x05 */
166     DWORD svcctl_SetServiceObjectSecurity(/* FIXME */);
167
168     /* Not compatible with Windows function 0x06 */
169     DWORD svcctl_QueryServiceStatus(/* FIXME */);
170
171     /* Compatible with Windows function 0x07 */
172     DWORD svcctl_SetServiceStatus(
173         [in] SC_RPC_HANDLE hServiceStatus,
174         [in] LPSERVICE_STATUS lpServiceStatus
175     );
176
177     /* Compatible with Windows function 0x08 */
178     DWORD svcctl_UnlockServiceDatabase(
179         [in,out] SC_RPC_LOCK *phLock
180     );
181
182     /* Not compatible with Windows function 0x09 */
183     DWORD svcctl_NotifyBootConfigStatus(/* FIXME */);
184
185     /* Not compatible with Windows function 0x0a */
186     DWORD svcctl_SCSetServiceBitsW(/* FIXME */);
187
188     /* Compatible with Windows function 0x0b */
189     DWORD svcctl_ChangeServiceConfigW(
190         [in] SC_RPC_HANDLE hService,
191         [in] DWORD dwServiceType,
192         [in] DWORD dwStartType,
193         [in] DWORD dwErrorControl,
194         [in,unique] LPCWSTR lpBinaryPathName,
195         [in,unique] LPCWSTR lpLoadOrderGroupKey,
196         [in,out,unique] DWORD *lpdwTagId,
197         [in,unique,size_is(dwDependenciesSize)] const BYTE *lpDependencies,
198         [in] DWORD dwDependenciesSize,
199         [in,unique] LPCWSTR lpServiceStartName,
200         [in,unique,size_is(dwPasswordSize)] const BYTE *lpPassword,
201         [in] DWORD dwPasswordSize,
202         [in,unique] LPCWSTR lpDisplayName
203     );
204
205     /* Compatible with Windows function 0x0c */
206     DWORD svcctl_CreateServiceW(
207         [in] SC_RPC_HANDLE hSCManager,
208         [in] LPCWSTR lpServiceName,
209         [in,unique] LPCWSTR lpDisplayName,
210         [in] DWORD dwDesiredAccess,
211         [in] DWORD dwServiceType,
212         [in] DWORD dwStartType,
213         [in] DWORD dwErrorControl,
214         [in] LPCWSTR lpBinaryPathName,
215         [in,unique] LPCWSTR lpLoadOrderGroup,
216         [in,out,unique] DWORD *lpdwTagId,
217         [in,unique,size_is(dwDependenciesSize)] const BYTE *lpDependencies,
218         [in] DWORD dwDependenciesSize,
219         [in,unique] LPCWSTR lpServiceStartName,
220         [in,unique,size_is(dwPasswordSize)] const BYTE *lpPassword,
221         [in] DWORD dwPasswordSize,
222         [out] SC_RPC_HANDLE *phService
223     );
224
225     /* Not compatible with Windows function 0x0d */
226     DWORD svcctl_EnumDependentServicesW(/* FIXME */);
227
228     /* Not compatible with Windows function 0x0e */
229     DWORD svcctl_EnumServicesStatusW(
230         [in] SC_RPC_HANDLE hmngr,
231         [in] DWORD type,
232         [in] DWORD state,
233         [out,size_is(size)] BYTE *buffer,
234         [in] DWORD size,
235         [out] LPDWORD needed,
236         [out] LPDWORD returned
237     );
238
239     /* Compatible with Windows function 0x0f */
240     DWORD svcctl_OpenSCManagerW(
241         [in,unique] MACHINE_HANDLEW MachineName,
242         [in,unique] LPCWSTR DatabaseName,
243         [in] DWORD dwAccessMask,
244         [out] SC_RPC_HANDLE *handle
245     );
246
247     /* Compatible with Windows function 0x10 */
248     DWORD svcctl_OpenServiceW(
249         [in] SC_RPC_HANDLE hSCManager,
250         [in] LPCWSTR lpServiceName,
251         [in] DWORD dwDesiredAccess,
252         [out] SC_RPC_HANDLE *phService
253     );
254
255     /* Windows function 0x11 must be using a different prototype - not compatible */
256     DWORD svcctl_QueryServiceConfigW(
257         [in] SC_RPC_HANDLE hService,
258         [out] QUERY_SERVICE_CONFIGW *config);
259
260     /* Not compatible with Windows function 0x12 */
261     DWORD svcctl_QueryServiceLockStatusW(/* FIXME */);
262
263     /* Untested with Windows function 0x13 */
264     DWORD svcctl_StartServiceW(
265         [in] SC_RPC_HANDLE hService,
266         [in] DWORD dwNumServiceArgs,
267         [in,unique,size_is(dwNumServiceArgs)] LPCWSTR *lpServiceArgVectors
268     );
269
270     /* Compatible with Windows function 0x14 */
271     DWORD svcctl_GetServiceDisplayNameW(
272         [in] SC_RPC_HANDLE hSCManager,
273         [in] LPCWSTR lpServiceName,
274         [out,string,size_is(*cchBufSize+1)] WCHAR lpBuffer[],
275         [in,out] DWORD *cchBufSize);
276
277     /* Compatible with Windows function 0x15 */
278     DWORD svcctl_GetServiceKeyNameW(
279         [in] SC_RPC_HANDLE hSCManager,
280         [in] LPCWSTR lpServiceDisplayName,
281         [out,string,size_is(*cchBufSize+1)] WCHAR lpBuffer[],
282         [in,out] DWORD *cchBufSize);
283
284     /* Not compatible with Windows function 0x16 */
285     DWORD svcctl_SCSetServiceBitsA(/* FIXME */);
286
287     /* Not compatible with Windows function 0x17 */
288     DWORD svcctl_ChangeServiceConfigA(/* FIXME */);
289
290     /* Not compatible with Windows function 0x18 */
291     DWORD svcctl_CreateServiceA(/* FIXME */);
292
293     /* Not compatible with Windows function 0x19 */
294     DWORD svcctl_EnumDependentServicesA(/* FIXME */);
295
296     /* Not compatible with Windows function 0x1a */
297     DWORD svcctl_EnumServicesStatusA(/* FIXME */);
298
299     /* Not compatible with Windows function 0x1b */
300     DWORD svcctl_OpenSCManagerA(/* FIXME */);
301
302     /* Not compatible with Windows function 0x1c */
303     DWORD svcctl_OpenServiceA(/* FIXME */);
304
305     /* Not compatible with Windows function 0x1d */
306     DWORD svcctl_QueryServiceConfigA(/* FIXME */);
307
308     /* Not compatible with Windows function 0x1e */
309     DWORD svcctl_QueryServiceLockStatusA(/* FIXME */);
310
311     /* Not compatible with Windows function 0x1f */
312     DWORD svcctl_StartServiceA(/* FIXME */);
313
314     /* Not compatible with Windows function 0x20 */
315     DWORD svcctl_GetServiceDisplayNameA(/* FIXME */);
316
317     /* Not compatible with Windows function 0x21 */
318     DWORD svcctl_GetServiceKeyNameA(/* FIXME */);
319
320     /* Not compatible with Windows function 0x22 */
321     DWORD svcctl_GetCurrentGroupStateW(/* FIXME */);
322
323     /* Not compatible with Windows function 0x23 */
324     DWORD svcctl_EnumServiceGroupW(/* FIXME */);
325
326     /* Not compatible with Windows function 0x24 */
327     DWORD svcctl_ChangeServiceConfig2A(/* FIXME */);
328
329     /* Untested with Windows function 0x25 */
330     DWORD svcctl_ChangeServiceConfig2W(
331         [in] SC_RPC_HANDLE hService,
332         [in] DWORD InfoLevel,
333         [in,switch_is(InfoLevel)] SERVICE_CONFIG2W *config );
334
335     /* Not compatible with Windows function 0x26 */
336     DWORD svcctl_QueryServiceConfig2A(/* FIXME */);
337
338     /* Untested with Windows function 0x27 */
339     DWORD svcctl_QueryServiceConfig2W(
340         [in] SC_RPC_HANDLE hService,
341         [in] DWORD InfoLevel,
342         [out,size_is(cbBufSize)] BYTE lpBuffer[],
343         [in] DWORD cbBufSize,
344         [out] LPDWORD pcbBytesNeeded
345     );
346
347     /* Untested with Windows function 0x28 */
348     DWORD svcctl_QueryServiceStatusEx(
349         [in] SC_RPC_HANDLE hService,
350         [in] SC_STATUS_TYPE InfoLevel,
351         [out,size_is(cbBufSize)] BYTE *lpBuffer,
352         [in] DWORD cbBufSize,
353         [out] LPDWORD pcbBytesNeeded
354     );
355
356     DWORD svcctl_EnumServicesStatusExW(
357         [in] SC_RPC_HANDLE hmngr,
358         [in] DWORD type,
359         [in] DWORD state,
360         [out,size_is(size)] BYTE *buffer,
361         [in] DWORD size,
362         [out] LPDWORD needed,
363         [out] LPDWORD returned,
364         [in,unique] LPCWSTR group
365     );
366 }