ReactOS  0.4.12-dev-57-g7050ac4
svchost.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Service Host
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: base/services/svchost/svchost.h
5  * PURPOSE: Precompiled Header for Service Host
6  * PROGRAMMERS: ReactOS Portable Systems Group
7  */
8 
9 #ifndef _SVCHOST_PCH_
10 #define _SVCHOST_PCH_
11 
12 #define WIN32_NO_STATUS
13 #define WIN32_LEAN_AND_MEAN
14 
15 #include <rpc.h>
16 #include <ndk/rtlfuncs.h>
17 #include <ndk/kdtypes.h>
18 
19 //
20 // FIXME: Should go in public headers
21 //
22 #define DPFLTR_SVCHOST_ID 28
23 
24 //
25 // This prints out a SVCHOST-specific debug print, with the PID/TID
26 //
27 #define SvchostDbgPrint(lev, fmt, ...) \
28  DbgPrintEx(DPFLTR_SVCHOST_ID, \
29  DPFLTR_MASK | lev, \
30  "[SVCHOST] %lx.%lx: " fmt, \
31  GetCurrentProcessId(), \
32  GetCurrentThreadId(), \
33  __VA_ARGS__);
34 
35 #define DBG_ERR(fmt, ...) SvchostDbgPrint(1, fmt, __VA_ARGS__)
36 #define DBG_TRACE(fmt, ...) SvchostDbgPrint(4, fmt, __VA_ARGS__)
37 
38 //
39 // This is the callback that a hosted service can register for stop notification
40 // FIXME: GLOBAL HEADER
41 //
42 typedef VOID
45  _In_ BOOLEAN TimerOrWaitFired
46  );
47 
48 //
49 // Hosted Services and SvcHost Use this Structure
50 // FIXME: GLOBAL HEADER
51 //
52 typedef struct _SVCHOST_GLOBALS
53 {
80 
81 //
82 // This is the callback for them to receive it
83 //
84 typedef VOID
86  _In_ PSVCHOST_GLOBALS Globals
87 );
88 //
89 // Initialization Stages
90 //
91 #define SVCHOST_RPC_INIT_COMPLETE 1
92 #define SVCHOST_NBT_INIT_COMPLETE 2
93 #define SVCHOST_SID_INIT_COMPLETE 4
94 
95 //
96 // Domain Alias SID Structure
97 //
98 typedef struct _DOMAIN_SID_DATA
99 {
103 
104 //
105 // Well-known SID Structure
106 //
107 typedef struct _SID_DATA
108 {
112 } SID_DATA;
113 
114 //
115 // This contains all the settings (from the registry) for a hosted service
116 //
117 typedef struct _SVCHOST_OPTIONS
118 {
130 
131 //
132 // This represents the DLL used to hold a hosted service
133 //
134 typedef struct _SVCHOST_DLL
135 {
143 
144 //
145 // This represents an actual hosted service
146 //
147 typedef struct _SVCHOST_SERVICE
148 {
152  PSVCHOST_DLL pDll;
153  PSVCHOST_STOP_CALLBACK pfnStopCallback;
155 
156 //
157 // This is the context that a hosted service with a stop callback has
158 //
160 {
162  PSVCHOST_SERVICE pService;
164 
165 NTSTATUS
166 NTAPI
168  VOID
169 );
170 
171 NTSTATUS
172 NTAPI
174  _In_ RPC_IF_HANDLE IfSpec
175 );
176 
177 NTSTATUS
178 NTAPI
180  _In_ RPC_IF_HANDLE IfSpec
181 );
182 
183 NTSTATUS
184 NTAPI
186  _In_ LPCWSTR IfName,
187  _In_ RPC_IF_HANDLE IfSpec
188 );
189 
190 VOID
191 WINAPI
193  VOID
194 );
195 
196 VOID
197 WINAPI
199  _In_ LPCWSTR lpSrcStr
200 );
201 
202 NTSTATUS
203 NTAPI
205  VOID
206 );
207 
208 VOID
209 WINAPI
210 MemInit (
211  _In_ HANDLE Heap
212 );
213 
214 BOOL
215 WINAPI
216 MemFree (
217  _In_ LPVOID lpMem
218 );
219 
220 PVOID
221 WINAPI
222 MemAlloc (
224  _In_ DWORD dwBytes
225 );
226 
227 VOID
228 WINAPI
230  VOID
231 );
232 
233 VOID
234 WINAPI
236 VOID
237 );
238 
239 VOID
240 WINAPI
242  VOID
243 );
244 
245 DWORD
246 WINAPI
248  _In_ UCHAR LanaNum
249 );
250 
251 BOOL
252 WINAPI
254  _In_ DWORD dwParam,
255  _In_ DWORD dwAuthnLevel,
256  _In_ DWORD dwImpLevel,
257  _In_ DWORD dwCapabilities
258 );
259 
260 
261 DWORD
262 WINAPI
264  _In_ HKEY hKey,
265  _In_ LPCWSTR pszValueName,
266  _Out_ PDWORD pdwValue
267 );
268 
269 DWORD
270 WINAPI
272  _In_ HKEY hKey,
273  _In_ LPCWSTR pszValueName,
274  _In_ DWORD dwExpectedType,
275  _Out_ PBYTE* ppbData
276 );
277 
278 DWORD
279 WINAPI
281  _In_ HKEY hKey,
282  _In_ LPCWSTR pszValueName,
283  _In_ DWORD dwExpectedType,
284  _Out_ LPCSTR* ppszData
285 );
286 
287 DWORD
288 WINAPI
290  _In_ PHANDLE phNewWaitObject,
292  _In_ HANDLE hObject,
293  _In_ PSVCHOST_STOP_CALLBACK pfnStopCallback,
294  _In_ PVOID pContext,
296 );
297 
298 extern PSVCHOST_GLOBALS g_pSvchostSharedGlobals;
299 
300 #endif /* _SVCHOST_PCH_ */
LONG cServiceActiveThreadCount
Definition: svchost.h:151
PSID Sid
Definition: svchost.h:109
PVOID AnonymousLogonSid
Definition: svchost.h:63
struct _SVCHOST_CALLBACK_CONTEXT SVCHOST_CALLBACK_CONTEXT
PVOID LocalServiceSid
Definition: svchost.h:59
DWORD WINAPI RegQueryDword(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _Out_ PDWORD pdwValue)
Definition: registry.c:78
PSVCHOST_DLL pDll
Definition: svchost.h:152
struct _SVCHOST_SERVICE SVCHOST_SERVICE
BOOLEAN SystemCritical
Definition: svchost.h:128
DWORD AuthenticationLevel
Definition: svchost.h:124
PVOID AliasAdminsSid
Definition: svchost.h:64
PSVCHOST_SERVICE pService
Definition: svchost.h:162
struct _SVCHOST_CALLBACK_CONTEXT * PSVCHOST_CALLBACK_CONTEXT
struct _SVCHOST_GLOBALS SVCHOST_GLOBALS
PVOID AliasPrintOpsSid
Definition: svchost.h:70
LONG NTSTATUS
Definition: precomp.h:26
#define CALLBACK
Definition: compat.h:27
PVOID AuthenticatedUserSid
Definition: svchost.h:62
PVOID AliasPowerUsersSid
Definition: svchost.h:67
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HANDLE hActCtx
Definition: svchost.h:140
DWORD SubAuthority
Definition: svchost.h:111
uint16_t * PWCHAR
Definition: typedefs.h:54
VOID WINAPI SvcNetBiosInit(VOID)
Definition: netbios.c:84
PSVCHOST_STOP_CALLBACK pfnStopCallback
Definition: svchost.h:153
LPCWSTR pszServiceName
Definition: svchost.h:149
VOID WINAPI SvchostBuildSharedGlobals(VOID)
Definition: globals.c:89
struct _SVCHOST_DLL SVCHOST_DLL
SID_IDENTIFIER_AUTHORITY Authority
Definition: svchost.h:110
PVOID RpcpStopRpcServerEx
Definition: svchost.h:74
struct _SVCHOST_GLOBALS * PSVCHOST_GLOBALS
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
PVOID SvcNetBiosClose
Definition: svchost.h:76
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
struct _DOMAIN_SID_DATA DOMAIN_SID_DATA
LIST_ENTRY DllList
Definition: svchost.h:136
long LONG
Definition: pedump.c:60
PSVCHOST_GLOBALS g_pSvchostSharedGlobals
Definition: globals.c:50
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
PVOID RpcpStartRpcServer
Definition: svchost.h:72
HINSTANCE hModule
Definition: svchost.h:137
PVOID NetworkServiceSid
Definition: svchost.h:60
PVOID NetworkSid
Definition: svchost.h:57
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: svchost.h:125
PWCHAR CmdLineBuffer
Definition: svchost.h:119
struct _SVCHOST_DLL * PSVCHOST_DLL
unsigned char BOOLEAN
LPCSTR pszServiceMain
Definition: svchost.h:150
PVOID SvcNetBiosOpen
Definition: svchost.h:75
VOID WINAPI SvchostCharLowerW(_In_ LPCWSTR lpSrcStr)
Definition: globals.c:162
#define _Out_
Definition: no_sal2.h:323
NTSTATUS NTAPI ScCreateWellKnownSids(VOID)
Definition: globals.c:266
const char * LPCSTR
Definition: xmlstorage.h:183
PVOID NullSid
Definition: svchost.h:54
VOID WINAPI MemInit(_In_ HANDLE Heap)
Definition: globals.c:58
struct _SVCHOST_SERVICE * PSVCHOST_SERVICE
PVOID SvcRegisterStopCallback
Definition: svchost.h:78
unsigned int BOOL
Definition: ntddk_ex.h:94
LPTSTR ServiceName
Definition: ServiceMain.c:15
DWORD AuthenticationCapabilities
Definition: svchost.h:126
struct _SVCHOST_SERVICE * pService
Definition: svchost.h:141
struct _SID_DATA SID_DATA
struct _SVCHOST_OPTIONS SVCHOST_OPTIONS
DWORD SubAuthority
Definition: svchost.h:101
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID LocalSystemSid
Definition: svchost.h:58
PWCHAR CmdLine
Definition: svchost.h:120
PVOID AliasSystemOpsSid
Definition: svchost.h:69
NTSTATUS NTAPI RpcpInitRpcServer(VOID)
Definition: rpcsrv.c:22
unsigned char UCHAR
Definition: xmlstorage.h:181
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPVOID lpParameter
Definition: kernel32.h:232
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
#define VOID
Definition: acefi.h:82
LPCWSTR pszManifestPath
Definition: svchost.h:139
Definition: typedefs.h:117
#define WINAPI
Definition: msvc.h:20
PVOID SvcNetBiosReset
Definition: svchost.h:77
BOOL WINAPI InitializeSecurity(_In_ DWORD dwParam, _In_ DWORD dwAuthnLevel, _In_ DWORD dwImpLevel, _In_ DWORD dwCapabilities)
Definition: security.cxx:161
#define _In_
Definition: no_sal2.h:204
PVOID RpcpStopRpcServer
Definition: svchost.h:73
DWORD WINAPI RegQueryStringA(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ LPCSTR *ppszData)
Definition: registry.c:128
PVOID AliasGuestsSid
Definition: svchost.h:66
PVOID WINAPI MemAlloc(_In_ DWORD dwFlags, _In_ DWORD dwBytes)
Definition: globals.c:78
LPCWSTR pszDllPath
Definition: svchost.h:138
PVOID AliasUsersSid
Definition: svchost.h:65
DWORD * PDWORD
Definition: pedump.c:68
VOID(WINAPI * PSVCHOST_INIT_GLOBALS)(_In_ PSVCHOST_GLOBALS Globals)
Definition: svchost.h:85
DWORD DefaultRpcStackSize
Definition: svchost.h:127
DWORD CoInitializeSecurityParam
Definition: svchost.h:123
PVOID LocalSid
Definition: svchost.h:56
LPWSTR ServiceGroupName
Definition: svchost.h:122
unsigned int ULONG
Definition: retypes.h:1
BOOL WINAPI MemFree(_In_ LPVOID lpMem)
Definition: globals.c:68
PVOID WorldSid
Definition: svchost.h:55
WCHAR * LPWSTR
Definition: xmlstorage.h:184
PVOID AliasBackupOpsSid
Definition: svchost.h:71
PVOID BuiltinDomainSid
Definition: svchost.h:61
BOOL HasServiceGroup
Definition: svchost.h:121
VOID(CALLBACK * PSVCHOST_STOP_CALLBACK)(_In_ PVOID lpParameter, _In_ BOOLEAN TimerOrWaitFired)
Definition: svchost.h:43
DWORD WINAPI RegQueryString(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ PBYTE *ppbData)
Definition: registry.c:107
PVOID AliasAccountOpsSid
Definition: svchost.h:68
BYTE * PBYTE
Definition: pedump.c:66
struct _SVCHOST_OPTIONS * PSVCHOST_OPTIONS