2 * svcctl interface definitions - exported by services.exe to access the
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
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 */
51 uuid(367abb81
-9844-35f1
-ad32
-98f038001003
),
53 pointer_default(unique),
54 endpoint("ncacn_np:[\\pipe\\svcctl]")
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 /* undocumented access rights */
67 cpp_quote
("#define SERVICE_SET_STATUS 0x8000")
69 cpp_quote
("#if 0 /* already defined in winsvc.h */")
70 typedef struct _QUERY_SERVICE_CONFIGW
{
74 [unique] LPWSTR lpBinaryPathName
;
75 [unique] LPWSTR lpLoadOrderGroup
;
77 [unique] LPWSTR lpDependencies
;
78 [unique] LPWSTR lpServiceStartName
;
79 [unique] LPWSTR lpDisplayName
;
80 } QUERY_SERVICE_CONFIGW
, *LPQUERY_SERVICE_CONFIGW
;
82 typedef struct _SERVICE_STATUS
{
85 DWORD dwControlsAccepted
;
86 DWORD dwWin32ExitCode
;
87 DWORD dwServiceSpecificExitCode
;
90 } SERVICE_STATUS
, *LPSERVICE_STATUS
;
92 typedef enum _SC_STATUS_TYPE
{
93 SC_STATUS_PROCESS_INFO
= 0
98 /* Compatible with Windows function 0x00 */
99 DWORD svcctl_CloseServiceHandle
(
100 [in,out] SC_RPC_HANDLE
*handle
103 /* Compatible with Windows function 0x01 */
104 DWORD svcctl_ControlService
(
105 [in] SC_RPC_HANDLE hService
,
106 [in] DWORD dwControl
,
107 [out] SERVICE_STATUS
*lpServiceStatus
110 /* Compatible with Windows function 0x02 */
111 DWORD svcctl_DeleteService
(
112 [in] SC_RPC_HANDLE hService
115 /* Compatible with Windows function 0x03 */
116 DWORD svcctl_LockServiceDatabase
(
117 [in] SC_RPC_HANDLE hSCManager
,
118 [out] SC_RPC_LOCK
*phLock
121 /* Not compatible with Windows function 0x04 */
122 DWORD svcctl_QueryServiceObjectSecurity
(/* FIXME */);
124 /* Not compatible with Windows function 0x05 */
125 DWORD svcctl_SetServiceObjectSecurity
(/* FIXME */);
127 /* Not compatible with Windows function 0x06 */
128 DWORD svcctl_QueryServiceStatus
(/* FIXME */);
130 /* Compatible with Windows function 0x07 */
131 DWORD svcctl_SetServiceStatus
(
132 [in] SC_RPC_HANDLE hServiceStatus
,
133 [in] LPSERVICE_STATUS lpServiceStatus
136 /* Compatible with Windows function 0x08 */
137 DWORD svcctl_UnlockServiceDatabase
(
138 [in,out] SC_RPC_LOCK
*phLock
141 /* Not compatible with Windows function 0x09 */
142 DWORD svcctl_NotifyBootConfigStatus
(/* FIXME */);
144 /* Not compatible with Windows function 0x0a */
145 DWORD svcctl_SCSetServiceBitsW
(/* FIXME */);
147 /* Compatible with Windows function 0x0b */
148 DWORD svcctl_ChangeServiceConfigW
(
149 [in] SC_RPC_HANDLE hService
,
150 [in] DWORD dwServiceType
,
151 [in] DWORD dwStartType
,
152 [in] DWORD dwErrorControl
,
153 [in,unique] LPCWSTR lpBinaryPathName
,
154 [in,unique] LPCWSTR lpLoadOrderGroupKey
,
155 [in,out,unique] DWORD
*lpdwTagId
,
156 [in,unique,size_is(dwDependenciesSize
)] const BYTE *lpDependencies
,
157 [in] DWORD dwDependenciesSize
,
158 [in,unique] LPCWSTR lpServiceStartName
,
159 [in,unique,size_is(dwPasswordSize
)] const BYTE *lpPassword
,
160 [in] DWORD dwPasswordSize
,
161 [in,unique] LPCWSTR lpDisplayName
164 /* Compatible with Windows function 0x0c */
165 DWORD svcctl_CreateServiceW
(
166 [in] SC_RPC_HANDLE hSCManager
,
167 [in] LPCWSTR lpServiceName
,
168 [in,unique] LPCWSTR lpDisplayName
,
169 [in] DWORD dwDesiredAccess
,
170 [in] DWORD dwServiceType
,
171 [in] DWORD dwStartType
,
172 [in] DWORD dwErrorControl
,
173 [in] LPCWSTR lpBinaryPathName
,
174 [in,unique] LPCWSTR lpLoadOrderGroup
,
175 [in,out,unique] DWORD
*lpdwTagId
,
176 [in,unique,size_is(dwDependenciesSize
)] const BYTE *lpDependencies
,
177 [in] DWORD dwDependenciesSize
,
178 [in,unique] LPCWSTR lpServiceStartName
,
179 [in,unique,size_is(dwPasswordSize
)] const BYTE *lpPassword
,
180 [in] DWORD dwPasswordSize
,
181 [out] SC_RPC_HANDLE
*phService
184 /* Not compatible with Windows function 0x0d */
185 DWORD svcctl_EnumDependentServicesW
(/* FIXME */);
187 /* Not compatible with Windows function 0x0e */
188 DWORD svcctl_EnumServicesStatusW
(/* FIXME */);
190 /* Compatible with Windows function 0x0f */
191 DWORD svcctl_OpenSCManagerW
(
192 [in,unique] MACHINE_HANDLEW MachineName
,
193 [in,unique] LPCWSTR DatabaseName
,
194 [in] DWORD dwAccessMask
,
195 [out] SC_RPC_HANDLE
*handle
198 /* Compatible with Windows function 0x10 */
199 DWORD svcctl_OpenServiceW
(
200 [in] SC_RPC_HANDLE hSCManager
,
201 [in] LPCWSTR lpServiceName
,
202 [in] DWORD dwDesiredAccess
,
203 [out] SC_RPC_HANDLE
*phService
206 /* Windows function 0x11 must be using a different prototype - not compatible */
207 DWORD svcctl_QueryServiceConfigW
(
208 [in] SC_RPC_HANDLE hService
,
209 [out] QUERY_SERVICE_CONFIGW
*config
);
211 /* Not compatible with Windows function 0x12 */
212 DWORD svcctl_QueryServiceLockStatusW
(/* FIXME */);
214 /* Untested with Windows function 0x13 */
215 DWORD svcctl_StartServiceW
(
216 [in] SC_RPC_HANDLE hService
,
217 [in] DWORD dwNumServiceArgs
,
218 [in,unique,size_is(dwNumServiceArgs
)] LPCWSTR
*lpServiceArgVectors
221 /* Compatible with Windows function 0x14 */
222 DWORD svcctl_GetServiceDisplayNameW
(
223 [in] SC_RPC_HANDLE hSCManager
,
224 [in] LPCWSTR lpServiceName
,
225 [out,size_is(cchBufSize
)] WCHAR lpBuffer
[],
226 [in] DWORD cchBufSize
,
227 [out] DWORD
*cchLength
);
229 /* Compatible with Windows function 0x15 */
230 DWORD svcctl_GetServiceKeyNameW
(
231 [in] SC_RPC_HANDLE hSCManager
,
232 [in] LPCWSTR lpServiceDisplayName
,
233 [out,size_is(cchBufSize
)] WCHAR lpBuffer
[],
234 [in] DWORD cchBufSize
,
235 [out] DWORD
*cchLength
);
237 /* Not compatible with Windows function 0x16 */
238 DWORD svcctl_SCSetServiceBitsA
(/* FIXME */);
240 /* Not compatible with Windows function 0x17 */
241 DWORD svcctl_ChangeServiceConfigA
(/* FIXME */);
243 /* Not compatible with Windows function 0x18 */
244 DWORD svcctl_CreateServiceA
(/* FIXME */);
246 /* Not compatible with Windows function 0x19 */
247 DWORD svcctl_EnumDependentServicesA
(/* FIXME */);
249 /* Not compatible with Windows function 0x1a */
250 DWORD svcctl_EnumServicesStatusA
(/* FIXME */);
252 /* Not compatible with Windows function 0x1b */
253 DWORD svcctl_OpenSCManagerA
(/* FIXME */);
255 /* Not compatible with Windows function 0x1c */
256 DWORD svcctl_OpenServiceA
(/* FIXME */);
258 /* Not compatible with Windows function 0x1d */
259 DWORD svcctl_QueryServiceConfigA
(/* FIXME */);
261 /* Not compatible with Windows function 0x1e */
262 DWORD svcctl_QueryServiceLockStatusA
(/* FIXME */);
264 /* Not compatible with Windows function 0x1f */
265 DWORD svcctl_StartServiceA
(/* FIXME */);
267 /* Not compatible with Windows function 0x20 */
268 DWORD svcctl_GetServiceDisplayNameA
(/* FIXME */);
270 /* Not compatible with Windows function 0x21 */
271 DWORD svcctl_GetServiceKeyNameA
(/* FIXME */);
273 /* Not compatible with Windows function 0x22 */
274 DWORD svcctl_GetCurrentGroupStateW
(/* FIXME */);
276 /* Not compatible with Windows function 0x23 */
277 DWORD svcctl_EnumServiceGroupW
(/* FIXME */);
279 /* Not compatible with Windows function 0x24 */
280 DWORD svcctl_ChangeServiceConfig2A
(/* FIXME */);
282 /* Not compatible with Windows function 0x25 */
283 DWORD svcctl_ChangeServiceConfig2W
(/* FIXME */);
285 /* Not compatible with Windows function 0x26 */
286 DWORD svcctl_QueryServiceConfig2A
(/* FIXME */);
288 /* Not compatible with Windows function 0x27 */
289 DWORD svcctl_QueryServiceConfig2W
(/* FIXME */);
291 /* Untested with Windows function 0x28 */
292 DWORD svcctl_QueryServiceStatusEx
(
293 [in] SC_RPC_HANDLE hService
,
294 [in] SC_STATUS_TYPE InfoLevel
,
295 [out,size_is(cbBufSize
)] BYTE *lpBuffer
,
296 [in] DWORD cbBufSize
,
297 [out] LPDWORD pcbBytesNeeded