ReactOS  0.4.15-dev-1201-gb2cf5a4
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 #include <dpfilter.h>
19 
20 #include <svc.h>
21 
22 //
23 // This prints out a SVCHOST-specific debug print, with the PID/TID
24 //
25 #define SvchostDbgPrint(lev, fmt, ...) \
26  DbgPrintEx(DPFLTR_SVCHOST_ID, \
27  DPFLTR_MASK | lev, \
28  "[SVCHOST] %lx.%lx: " fmt, \
29  GetCurrentProcessId(), \
30  GetCurrentThreadId(), \
31  __VA_ARGS__);
32 
33 #define DBG_ERR(fmt, ...) SvchostDbgPrint(1, fmt, __VA_ARGS__)
34 #define DBG_TRACE(fmt, ...) SvchostDbgPrint(4, fmt, __VA_ARGS__)
35 
36 //
37 // This is the callback for them to receive it
38 //
39 typedef VOID
42 );
43 //
44 // Initialization Stages
45 //
46 #define SVCHOST_RPC_INIT_COMPLETE 1
47 #define SVCHOST_NBT_INIT_COMPLETE 2
48 #define SVCHOST_SID_INIT_COMPLETE 4
49 
50 //
51 // Domain Alias SID Structure
52 //
53 typedef struct _DOMAIN_SID_DATA
54 {
58 
59 //
60 // Well-known SID Structure
61 //
62 typedef struct _SID_DATA
63 {
67 } SID_DATA;
68 
69 //
70 // This contains all the settings (from the registry) for a hosted service
71 //
72 typedef struct _SVCHOST_OPTIONS
73 {
85 
86 //
87 // This represents the DLL used to hold a hosted service
88 //
89 typedef struct _SVCHOST_DLL
90 {
98 
99 //
100 // This represents an actual hosted service
101 //
102 typedef struct _SVCHOST_SERVICE
103 {
110 
111 //
112 // This is the context that a hosted service with a stop callback has
113 //
115 {
119 
120 NTSTATUS
121 NTAPI
123  VOID
124 );
125 
126 NTSTATUS
127 NTAPI
129  _In_ RPC_IF_HANDLE IfSpec
130 );
131 
132 NTSTATUS
133 NTAPI
135  _In_ RPC_IF_HANDLE IfSpec
136 );
137 
138 NTSTATUS
139 NTAPI
141  _In_ LPCWSTR IfName,
142  _In_ RPC_IF_HANDLE IfSpec
143 );
144 
145 VOID
146 WINAPI
148  VOID
149 );
150 
151 VOID
152 WINAPI
154  _In_ LPCWSTR lpSrcStr
155 );
156 
157 NTSTATUS
158 NTAPI
160  VOID
161 );
162 
163 VOID
164 WINAPI
165 MemInit (
166  _In_ HANDLE Heap
167 );
168 
169 BOOL
170 WINAPI
171 MemFree (
172  _In_ LPVOID lpMem
173 );
174 
175 PVOID
176 WINAPI
177 MemAlloc (
179  _In_ DWORD dwBytes
180 );
181 
182 VOID
183 WINAPI
185  VOID
186 );
187 
188 VOID
189 WINAPI
191 VOID
192 );
193 
194 VOID
195 WINAPI
197  VOID
198 );
199 
200 DWORD
201 WINAPI
203  _In_ UCHAR LanaNum
204 );
205 
206 BOOL
207 WINAPI
209  _In_ DWORD dwParam,
210  _In_ DWORD dwAuthnLevel,
211  _In_ DWORD dwImpLevel,
212  _In_ DWORD dwCapabilities
213 );
214 
215 
216 DWORD
217 WINAPI
219  _In_ HKEY hKey,
220  _In_ LPCWSTR pszValueName,
221  _Out_ PDWORD pdwValue
222 );
223 
224 DWORD
225 WINAPI
227  _In_ HKEY hKey,
228  _In_ LPCWSTR pszValueName,
229  _In_ DWORD dwExpectedType,
230  _Out_ PBYTE* ppbData
231 );
232 
233 DWORD
234 WINAPI
236  _In_ HKEY hKey,
237  _In_ LPCWSTR pszValueName,
238  _In_ DWORD dwExpectedType,
239  _Out_ LPCSTR* ppszData
240 );
241 
242 DWORD
243 WINAPI
245  _In_ PHANDLE phNewWaitObject,
247  _In_ HANDLE hObject,
248  _In_ PSVCHOST_STOP_CALLBACK pfnStopCallback,
249  _In_ PVOID pContext,
251 );
252 
254 
255 #endif /* _SVCHOST_PCH_ */
LONG cServiceActiveThreadCount
Definition: svchost.h:106
struct _SVCHOST_CALLBACK_CONTEXT SVCHOST_CALLBACK_CONTEXT
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
NTSTATUS NTAPI RpcpStartRpcServer(_In_ LPCWSTR IfName, _In_ RPC_IF_HANDLE IfSpec)
Definition: rpcsrv.c:131
DWORD WINAPI RegQueryDword(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _Out_ PDWORD pdwValue)
Definition: registry.c:78
PSVCHOST_DLL pDll
Definition: svchost.h:107
struct _SVCHOST_SERVICE SVCHOST_SERVICE
BOOLEAN SystemCritical
Definition: svchost.h:83
DWORD AuthenticationLevel
Definition: svchost.h:79
PSVCHOST_SERVICE pService
Definition: svchost.h:117
struct _SVCHOST_CALLBACK_CONTEXT * PSVCHOST_CALLBACK_CONTEXT
LONG NTSTATUS
Definition: precomp.h:26
HANDLE hActCtx
Definition: svchost.h:95
DWORD SubAuthority
Definition: svchost.h:66
uint16_t * PWCHAR
Definition: typedefs.h:56
VOID WINAPI SvcNetBiosInit(VOID)
Definition: netbios.c:84
PSVCHOST_STOP_CALLBACK pfnStopCallback
Definition: svchost.h:108
LPCWSTR pszServiceName
Definition: svchost.h:104
PSID * Sid
Definition: svchost.h:64
NTSTATUS NTAPI RpcpStopRpcServerEx(_In_ RPC_IF_HANDLE IfSpec)
Definition: rpcsrv.c:58
VOID WINAPI SvchostBuildSharedGlobals(VOID)
Definition: globals.c:89
struct _SVCHOST_DLL SVCHOST_DLL
SID_IDENTIFIER_AUTHORITY Authority
Definition: svchost.h:65
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
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:91
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
PSVCHOST_GLOBALS g_pSvchostSharedGlobals
Definition: globals.c:50
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
HINSTANCE hModule
Definition: svchost.h:92
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: svchost.h:80
PWCHAR CmdLineBuffer
Definition: svchost.h:74
struct _SVCHOST_DLL * PSVCHOST_DLL
unsigned char BOOLEAN
LPCSTR pszServiceMain
Definition: svchost.h:105
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
VOID WINAPI MemInit(_In_ HANDLE Heap)
Definition: globals.c:58
struct _SVCHOST_SERVICE * PSVCHOST_SERVICE
LPTSTR ServiceName
Definition: ServiceMain.c:15
DWORD AuthenticationCapabilities
Definition: svchost.h:81
struct _SVCHOST_SERVICE * pService
Definition: svchost.h:96
struct _SID_DATA SID_DATA
struct _SVCHOST_OPTIONS SVCHOST_OPTIONS
#define WINAPI
Definition: msvc.h:6
DWORD SubAuthority
Definition: svchost.h:56
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI SvcNetBiosReset(_In_ UCHAR LanaNum)
Definition: netbios.c:124
PWCHAR CmdLine
Definition: svchost.h:75
VOID WINAPI SvcNetBiosOpen(VOID)
Definition: netbios.c:112
NTSTATUS NTAPI RpcpInitRpcServer(VOID)
Definition: rpcsrv.c:22
unsigned char UCHAR
Definition: xmlstorage.h:181
DWORD WINAPI SvcRegisterStopCallback(_In_ PHANDLE phNewWaitObject, _In_ LPCWSTR ServiceName, _In_ HANDLE hObject, _In_ PSVCHOST_STOP_CALLBACK pfnStopCallback, _In_ PVOID pContext, _In_ ULONG dwFlags)
Definition: svchost.c:518
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
#define VOID
Definition: acefi.h:82
LPCWSTR pszManifestPath
Definition: svchost.h:94
Definition: typedefs.h:119
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
DWORD WINAPI RegQueryStringA(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ LPCSTR *ppszData)
Definition: registry.c:128
VOID(CALLBACK * PSVCHOST_STOP_CALLBACK)(_In_ PVOID lpParameter, _In_ BOOLEAN TimerOrWaitFired)
Definition: svc.h:17
NTSTATUS NTAPI RpcpStopRpcServer(_In_ RPC_IF_HANDLE IfSpec)
Definition: rpcsrv.c:33
PVOID WINAPI MemAlloc(_In_ DWORD dwFlags, _In_ DWORD dwBytes)
Definition: globals.c:78
LPCWSTR pszDllPath
Definition: svchost.h:93
DWORD * PDWORD
Definition: pedump.c:68
VOID(WINAPI * PSVCHOST_INIT_GLOBALS)(_In_ PSVCHOST_GLOBALS Globals)
Definition: svchost.h:40
DWORD DefaultRpcStackSize
Definition: svchost.h:82
PSID * Sid
Definition: svchost.h:55
VOID WINAPI SvcNetBiosClose(VOID)
Definition: netbios.c:96
DWORD CoInitializeSecurityParam
Definition: svchost.h:78
LPWSTR ServiceGroupName
Definition: svchost.h:77
unsigned int ULONG
Definition: retypes.h:1
BOOL WINAPI MemFree(_In_ LPVOID lpMem)
Definition: globals.c:68
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL HasServiceGroup
Definition: svchost.h:76
DWORD WINAPI RegQueryString(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ PBYTE *ppbData)
Definition: registry.c:107
BYTE * PBYTE
Definition: pedump.c:66
struct _SVCHOST_OPTIONS * PSVCHOST_OPTIONS