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}")
36 uuid(367abb81-9844-35f1-ad32-98f038001003),
38 pointer_default(unique),
39 endpoint("ncacn_np:[\\pipe\\svcctl]")
44 typedef [handle] LPCWSTR MACHINE_HANDLEW;
45 typedef [context_handle] void *SC_RPC_HANDLE;
47 cpp_quote("#if 0 /* already defined in winsvc.h */")
48 typedef struct _QUERY_SERVICE_CONFIGW {
52 [unique] LPWSTR lpBinaryPathName;
53 [unique] LPWSTR lpLoadOrderGroup;
55 [unique] LPWSTR lpDependencies;
56 [unique] LPWSTR lpServiceStartName;
57 [unique] LPWSTR lpDisplayName;
58 } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
62 /* Compatible with Windows function 0x00 */
63 DWORD svcctl_CloseServiceHandle(
64 [in,out] SC_RPC_HANDLE *handle
67 /* Compatible with Windows function 0x02 */
68 DWORD svcctl_DeleteService(
69 [in] SC_RPC_HANDLE hService
72 /* Compatible with Windows function 0x0c */
73 DWORD svcctl_CreateServiceW(
74 [in] SC_RPC_HANDLE hSCManager,
75 [in] LPCWSTR lpServiceName,
76 [in,unique] LPCWSTR lpDisplayName,
77 [in] DWORD dwDesiredAccess,
78 [in] DWORD dwServiceType,
79 [in] DWORD dwStartType,
80 [in] DWORD dwErrorControl,
81 [in] LPCWSTR lpBinaryPathName,
82 [in,unique] LPCWSTR lpLoadOrderGroup,
83 [in,out,unique] DWORD *lpdwTagId,
84 [in,unique,size_is(dwDependenciesSize)] const BYTE *lpDependencies,
85 [in] DWORD dwDependenciesSize,
86 [in,unique] LPCWSTR lpServiceStartName,
87 [in,unique,size_is(dwPasswordSize)] const BYTE *lpPassword,
88 [in] DWORD dwPasswordSize,
89 [out] SC_RPC_HANDLE *phService
92 /* Compatible with Windows function 0x0f */
93 DWORD svcctl_OpenSCManagerW(
94 [in,unique] MACHINE_HANDLEW MachineName,
95 [in,unique] LPCWSTR DatabaseName,
96 [in] DWORD dwAccessMask,
97 [out] SC_RPC_HANDLE *handle
100 /* Compatible with Windows function 0x10 */
101 DWORD svcctl_OpenServiceW(
102 [in] SC_RPC_HANDLE hSCManager,
103 [in] LPCWSTR lpServiceName,
104 [in] DWORD dwDesiredAccess,
105 [out] SC_RPC_HANDLE *phService
108 /* Windows function 0x11 must be using a different prototype - not compatible */
109 DWORD svcctl_QueryServiceConfigW(
110 [in] SC_RPC_HANDLE hService,
111 [out] QUERY_SERVICE_CONFIGW *config);