gdi32: Return the full DIB height in GetImage instead of clipping to the visible...
[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 typedef struct _SERVICE_PRESHUTDOWN_INFO {
118     DWORD dwPreshutdownTimeout;
119 } SERVICE_PRESHUTDOWN_INFO,*LPSERVICE_PRESHUTDOWN_INFO;
120
121 #define SERVICE_CONFIG_DESCRIPTION              1
122 #define SERVICE_CONFIG_FAILURE_ACTIONS          2
123 #define SERVICE_CONFIG_DELAYED_AUTO_START_INFO  3
124 #define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG     4
125 #define SERVICE_CONFIG_SERVICE_SID_INFO         5
126 #define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO 6
127 #define SERVICE_CONFIG_PRESHUTDOWN_INFO         7
128
129 typedef struct _ENUM_SERVICE_STATUSW {
130     LPWSTR          lpServiceName;
131     LPWSTR          lpDisplayName;
132     SERVICE_STATUS  ServiceStatus;
133 } ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW;
134
135 cpp_quote("#endif")
136
137 typedef [switch_type(DWORD)] union
138 {
139   [case (SERVICE_CONFIG_DESCRIPTION)] SERVICE_DESCRIPTIONW descr;
140   [case (SERVICE_CONFIG_FAILURE_ACTIONS)] SERVICE_FAILURE_ACTIONSW actions;
141   [case (SERVICE_CONFIG_PRESHUTDOWN_INFO)] SERVICE_PRESHUTDOWN_INFO preshutdown;
142 } SERVICE_CONFIG2W;
143
144     /* Compatible with Windows function 0x00 */
145     DWORD svcctl_CloseServiceHandle(
146         [in,out] SC_RPC_HANDLE *handle
147     );
148
149     /* Compatible with Windows function 0x01 */
150     DWORD svcctl_ControlService(
151         [in] SC_RPC_HANDLE hService,
152         [in] DWORD dwControl,
153         [out] SERVICE_STATUS *lpServiceStatus
154     );
155
156     /* Compatible with Windows function 0x02 */
157     DWORD svcctl_DeleteService(
158         [in] SC_RPC_HANDLE hService
159     );
160
161     /* Compatible with Windows function 0x03 */
162     DWORD svcctl_LockServiceDatabase(
163         [in] SC_RPC_HANDLE hSCManager,
164         [out] SC_RPC_LOCK *phLock
165     );
166
167     /* Not compatible with Windows function 0x04 */
168     DWORD svcctl_QueryServiceObjectSecurity(/* FIXME */);
169
170     /* Not compatible with Windows function 0x05 */
171     DWORD svcctl_SetServiceObjectSecurity(/* FIXME */);
172
173     /* Not compatible with Windows function 0x06 */
174     DWORD svcctl_QueryServiceStatus(/* FIXME */);
175
176     /* Compatible with Windows function 0x07 */
177     DWORD svcctl_SetServiceStatus(
178         [in] SC_RPC_HANDLE hServiceStatus,
179         [in] LPSERVICE_STATUS lpServiceStatus
180     );
181
182     /* Compatible with Windows function 0x08 */
183     DWORD svcctl_UnlockServiceDatabase(
184         [in,out] SC_RPC_LOCK *phLock
185     );
186
187     /* Not compatible with Windows function 0x09 */
188     DWORD svcctl_NotifyBootConfigStatus(/* FIXME */);
189
190     /* Not compatible with Windows function 0x0a */
191     DWORD svcctl_SCSetServiceBitsW(/* FIXME */);
192
193     /* Compatible with Windows function 0x0b */
194     DWORD svcctl_ChangeServiceConfigW(
195         [in] SC_RPC_HANDLE hService,
196         [in] DWORD dwServiceType,
197         [in] DWORD dwStartType,
198         [in] DWORD dwErrorControl,
199         [in,unique] LPCWSTR lpBinaryPathName,
200         [in,unique] LPCWSTR lpLoadOrderGroupKey,
201         [in,out,unique] DWORD *lpdwTagId,
202         [in,unique,size_is(dwDependenciesSize)] const BYTE *lpDependencies,
203         [in] DWORD dwDependenciesSize,
204         [in,unique] LPCWSTR lpServiceStartName,
205         [in,unique,size_is(dwPasswordSize)] const BYTE *lpPassword,
206         [in] DWORD dwPasswordSize,
207         [in,unique] LPCWSTR lpDisplayName
208     );
209
210     /* Compatible with Windows function 0x0c */
211     DWORD svcctl_CreateServiceW(
212         [in] SC_RPC_HANDLE hSCManager,
213         [in] LPCWSTR lpServiceName,
214         [in,unique] LPCWSTR lpDisplayName,
215         [in] DWORD dwDesiredAccess,
216         [in] DWORD dwServiceType,
217         [in] DWORD dwStartType,
218         [in] DWORD dwErrorControl,
219         [in] LPCWSTR lpBinaryPathName,
220         [in,unique] LPCWSTR lpLoadOrderGroup,
221         [in,out,unique] DWORD *lpdwTagId,
222         [in,unique,size_is(dwDependenciesSize)] const BYTE *lpDependencies,
223         [in] DWORD dwDependenciesSize,
224         [in,unique] LPCWSTR lpServiceStartName,
225         [in,unique,size_is(dwPasswordSize)] const BYTE *lpPassword,
226         [in] DWORD dwPasswordSize,
227         [out] SC_RPC_HANDLE *phService
228     );
229
230     /* Not compatible with Windows function 0x0d */
231     DWORD svcctl_EnumDependentServicesW(/* FIXME */);
232
233     /* Not compatible with Windows function 0x0e */
234     DWORD svcctl_EnumServicesStatusW(
235         [in] SC_RPC_HANDLE hmngr,
236         [in] DWORD type,
237         [in] DWORD state,
238         [out,size_is(size)] BYTE *buffer,
239         [in] DWORD size,
240         [out] LPDWORD needed,
241         [out] LPDWORD returned
242     );
243
244     /* Compatible with Windows function 0x0f */
245     DWORD svcctl_OpenSCManagerW(
246         [in,unique] MACHINE_HANDLEW MachineName,
247         [in,unique] LPCWSTR DatabaseName,
248         [in] DWORD dwAccessMask,
249         [out] SC_RPC_HANDLE *handle
250     );
251
252     /* Compatible with Windows function 0x10 */
253     DWORD svcctl_OpenServiceW(
254         [in] SC_RPC_HANDLE hSCManager,
255         [in] LPCWSTR lpServiceName,
256         [in] DWORD dwDesiredAccess,
257         [out] SC_RPC_HANDLE *phService
258     );
259
260     /* Windows function 0x11 must be using a different prototype - not compatible */
261     DWORD svcctl_QueryServiceConfigW(
262         [in] SC_RPC_HANDLE hService,
263         [out] QUERY_SERVICE_CONFIGW *config);
264
265     /* Not compatible with Windows function 0x12 */
266     DWORD svcctl_QueryServiceLockStatusW(/* FIXME */);
267
268     /* Untested with Windows function 0x13 */
269     DWORD svcctl_StartServiceW(
270         [in] SC_RPC_HANDLE hService,
271         [in] DWORD dwNumServiceArgs,
272         [in,unique,size_is(dwNumServiceArgs)] LPCWSTR *lpServiceArgVectors
273     );
274
275     /* Compatible with Windows function 0x14 */
276     DWORD svcctl_GetServiceDisplayNameW(
277         [in] SC_RPC_HANDLE hSCManager,
278         [in] LPCWSTR lpServiceName,
279         [out,string,size_is(*cchBufSize+1)] WCHAR lpBuffer[],
280         [in,out] DWORD *cchBufSize);
281
282     /* Compatible with Windows function 0x15 */
283     DWORD svcctl_GetServiceKeyNameW(
284         [in] SC_RPC_HANDLE hSCManager,
285         [in] LPCWSTR lpServiceDisplayName,
286         [out,string,size_is(*cchBufSize+1)] WCHAR lpBuffer[],
287         [in,out] DWORD *cchBufSize);
288
289     /* Not compatible with Windows function 0x16 */
290     DWORD svcctl_SCSetServiceBitsA(/* FIXME */);
291
292     /* Not compatible with Windows function 0x17 */
293     DWORD svcctl_ChangeServiceConfigA(/* FIXME */);
294
295     /* Not compatible with Windows function 0x18 */
296     DWORD svcctl_CreateServiceA(/* FIXME */);
297
298     /* Not compatible with Windows function 0x19 */
299     DWORD svcctl_EnumDependentServicesA(/* FIXME */);
300
301     /* Not compatible with Windows function 0x1a */
302     DWORD svcctl_EnumServicesStatusA(/* FIXME */);
303
304     /* Not compatible with Windows function 0x1b */
305     DWORD svcctl_OpenSCManagerA(/* FIXME */);
306
307     /* Not compatible with Windows function 0x1c */
308     DWORD svcctl_OpenServiceA(/* FIXME */);
309
310     /* Not compatible with Windows function 0x1d */
311     DWORD svcctl_QueryServiceConfigA(/* FIXME */);
312
313     /* Not compatible with Windows function 0x1e */
314     DWORD svcctl_QueryServiceLockStatusA(/* FIXME */);
315
316     /* Not compatible with Windows function 0x1f */
317     DWORD svcctl_StartServiceA(/* FIXME */);
318
319     /* Not compatible with Windows function 0x20 */
320     DWORD svcctl_GetServiceDisplayNameA(/* FIXME */);
321
322     /* Not compatible with Windows function 0x21 */
323     DWORD svcctl_GetServiceKeyNameA(/* FIXME */);
324
325     /* Not compatible with Windows function 0x22 */
326     DWORD svcctl_GetCurrentGroupStateW(/* FIXME */);
327
328     /* Not compatible with Windows function 0x23 */
329     DWORD svcctl_EnumServiceGroupW(/* FIXME */);
330
331     /* Not compatible with Windows function 0x24 */
332     DWORD svcctl_ChangeServiceConfig2A(/* FIXME */);
333
334     /* Untested with Windows function 0x25 */
335     DWORD svcctl_ChangeServiceConfig2W(
336         [in] SC_RPC_HANDLE hService,
337         [in] DWORD InfoLevel,
338         [in,switch_is(InfoLevel)] SERVICE_CONFIG2W *config );
339
340     /* Not compatible with Windows function 0x26 */
341     DWORD svcctl_QueryServiceConfig2A(/* FIXME */);
342
343     /* Untested with Windows function 0x27 */
344     DWORD svcctl_QueryServiceConfig2W(
345         [in] SC_RPC_HANDLE hService,
346         [in] DWORD InfoLevel,
347         [out,size_is(cbBufSize)] BYTE lpBuffer[],
348         [in] DWORD cbBufSize,
349         [out] LPDWORD pcbBytesNeeded
350     );
351
352     /* Untested with Windows function 0x28 */
353     DWORD svcctl_QueryServiceStatusEx(
354         [in] SC_RPC_HANDLE hService,
355         [in] SC_STATUS_TYPE InfoLevel,
356         [out,size_is(cbBufSize)] BYTE *lpBuffer,
357         [in] DWORD cbBufSize,
358         [out] LPDWORD pcbBytesNeeded
359     );
360
361     DWORD svcctl_EnumServicesStatusExW(
362         [in] SC_RPC_HANDLE hmngr,
363         [in] DWORD type,
364         [in] DWORD state,
365         [out,size_is(size)] BYTE *buffer,
366         [in] DWORD size,
367         [out] LPDWORD needed,
368         [out] LPDWORD returned,
369         [in,unique] LPCWSTR group
370     );
371 }