ReactOS  0.4.15-dev-4582-g6dc1738
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 #define NTOS_MODE_USER
16 #include <ndk/rtlfuncs.h>
17 #include <ndk/kdtypes.h>
18 #include <dpfilter.h>
19 
20 #include <rpc.h>
21 #include <svc.h>
22 
23 //
24 // This prints out a SVCHOST-specific debug print, with the PID/TID
25 //
26 #define SvchostDbgPrint(lev, fmt, ...) \
27  DbgPrintEx(DPFLTR_SVCHOST_ID, \
28  DPFLTR_MASK | lev, \
29  "[SVCHOST] %lx.%lx: " fmt, \
30  GetCurrentProcessId(), \
31  GetCurrentThreadId(), \
32  __VA_ARGS__);
33 
34 #define DBG_ERR(fmt, ...) SvchostDbgPrint(1, fmt, __VA_ARGS__)
35 #define DBG_TRACE(fmt, ...) SvchostDbgPrint(4, fmt, __VA_ARGS__)
36 
37 //
38 // This is the callback for them to receive it
39 //
40 typedef VOID
43 );
44 
45 //
46 // Initialization Stages
47 //
48 #define SVCHOST_RPC_INIT_COMPLETE 1
49 #define SVCHOST_NBT_INIT_COMPLETE 2
50 #define SVCHOST_SID_INIT_COMPLETE 4
51 
52 //
53 // Domain Alias SID Structure
54 //
55 typedef struct _DOMAIN_SID_DATA
56 {
60 
61 //
62 // Well-known SID Structure
63 //
64 typedef struct _SID_DATA
65 {
69 } SID_DATA;
70 
71 //
72 // This contains all the settings (from the registry) for a hosted service
73 //
74 typedef struct _SVCHOST_OPTIONS
75 {
87 
88 //
89 // This represents the DLL used to hold a hosted service
90 //
91 typedef struct _SVCHOST_DLL
92 {
100 
101 //
102 // This represents an actual hosted service
103 //
104 typedef struct _SVCHOST_SERVICE
105 {
112 
113 //
114 // This is the context that a hosted service with a stop callback has
115 //
117 {
121 
122 NTSTATUS
123 NTAPI
125  VOID
126 );
127 
128 NTSTATUS
129 NTAPI
131  _In_ RPC_IF_HANDLE IfSpec
132 );
133 
134 NTSTATUS
135 NTAPI
137  _In_ RPC_IF_HANDLE IfSpec
138 );
139 
140 NTSTATUS
141 NTAPI
143  _In_ PCWSTR IfName,
144  _In_ RPC_IF_HANDLE IfSpec
145 );
146 
147 VOID
148 WINAPI
150  VOID
151 );
152 
153 VOID
154 WINAPI
156  _In_ LPCWSTR lpSrcStr
157 );
158 
159 NTSTATUS
160 NTAPI
162  VOID
163 );
164 
165 VOID
166 WINAPI
167 MemInit (
168  _In_ HANDLE Heap
169 );
170 
171 BOOL
172 WINAPI
173 MemFree (
174  _In_ LPVOID lpMem
175 );
176 
177 PVOID
178 WINAPI
179 MemAlloc (
181  _In_ DWORD dwBytes
182 );
183 
184 VOID
185 WINAPI
187  VOID
188 );
189 
190 VOID
191 WINAPI
193  VOID
194 );
195 
196 VOID
197 WINAPI
199  VOID
200 );
201 
202 DWORD
203 WINAPI
205  _In_ UCHAR LanaNum
206 );
207 
208 BOOL
209 WINAPI
211  _In_ DWORD dwParam,
212  _In_ DWORD dwAuthnLevel,
213  _In_ DWORD dwImpLevel,
214  _In_ DWORD dwCapabilities
215 );
216 
217 
218 DWORD
219 WINAPI
221  _In_ HKEY hKey,
222  _In_ LPCWSTR pszValueName,
223  _Out_ PDWORD pdwValue
224 );
225 
226 DWORD
227 WINAPI
229  _In_ HKEY hKey,
230  _In_ LPCWSTR pszValueName,
231  _In_ DWORD dwExpectedType,
232  _Out_ PBYTE* ppbData
233 );
234 
235 DWORD
236 WINAPI
238  _In_ HKEY hKey,
239  _In_ LPCWSTR pszValueName,
240  _In_ DWORD dwExpectedType,
241  _Out_ LPCSTR* ppszData
242 );
243 
244 DWORD
245 WINAPI
247  _Out_ PHANDLE phNewWaitObject,
249  _In_ HANDLE hObject,
250  _In_ PSVCHOST_STOP_CALLBACK pfnStopCallback,
251  _In_ PVOID pContext,
253 );
254 
256 
257 #endif /* _SVCHOST_PCH_ */
LONG cServiceActiveThreadCount
Definition: svchost.h:108
const uint16_t * PCWSTR
Definition: typedefs.h:57
struct _SVCHOST_CALLBACK_CONTEXT SVCHOST_CALLBACK_CONTEXT
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define _Out_
Definition: ms_sal.h:345
DWORD WINAPI RegQueryDword(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _Out_ PDWORD pdwValue)
Definition: registry.c:78
PSVCHOST_DLL pDll
Definition: svchost.h:109
struct _SVCHOST_SERVICE SVCHOST_SERVICE
BOOLEAN SystemCritical
Definition: svchost.h:85
DWORD AuthenticationLevel
Definition: svchost.h:81
PSVCHOST_SERVICE pService
Definition: svchost.h:119
struct _SVCHOST_CALLBACK_CONTEXT * PSVCHOST_CALLBACK_CONTEXT
LONG NTSTATUS
Definition: precomp.h:26
VOID(WINAPI * PSVCHOST_INIT_GLOBALS)(_In_ PSVCHOST_GLOBAL_DATA Globals)
Definition: svchost.h:41
HANDLE hActCtx
Definition: svchost.h:97
DWORD SubAuthority
Definition: svchost.h:68
uint16_t * PWCHAR
Definition: typedefs.h:56
VOID WINAPI SvcNetBiosInit(VOID)
Definition: netbios.c:84
PSVCHOST_STOP_CALLBACK pfnStopCallback
Definition: svchost.h:110
LPCWSTR pszServiceName
Definition: svchost.h:106
PSID * Sid
Definition: svchost.h:66
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:67
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:93
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
HINSTANCE hModule
Definition: svchost.h:94
PSVCHOST_GLOBAL_DATA g_pSvchostSharedGlobals
Definition: globals.c:50
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: svchost.h:82
PWCHAR CmdLineBuffer
Definition: svchost.h:76
struct _SVCHOST_DLL * PSVCHOST_DLL
unsigned char BOOLEAN
LPCSTR pszServiceMain
Definition: svchost.h:107
VOID WINAPI SvchostCharLowerW(_In_ LPCWSTR lpSrcStr)
Definition: globals.c:162
#define _In_
Definition: ms_sal.h:308
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:83
struct _SVCHOST_SERVICE * pService
Definition: svchost.h:98
struct _SID_DATA SID_DATA
struct _SVCHOST_OPTIONS SVCHOST_OPTIONS
#define WINAPI
Definition: msvc.h:6
DWORD SubAuthority
Definition: svchost.h:58
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI SvcNetBiosReset(_In_ UCHAR LanaNum)
Definition: netbios.c:124
PWCHAR CmdLine
Definition: svchost.h:77
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(_Out_ PHANDLE phNewWaitObject, _In_ PCWSTR 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:96
Definition: typedefs.h:119
BOOL WINAPI InitializeSecurity(_In_ DWORD dwParam, _In_ DWORD dwAuthnLevel, _In_ DWORD dwImpLevel, _In_ DWORD dwCapabilities)
Definition: security.cxx:161
DWORD WINAPI RegQueryStringA(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ LPCSTR *ppszData)
Definition: registry.c:128
FxAutoRegKey hKey
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
WAITORTIMERCALLBACK PSVCHOST_STOP_CALLBACK
Definition: svc.h:75
LPCWSTR pszDllPath
Definition: svchost.h:95
DWORD * PDWORD
Definition: pedump.c:68
DWORD DefaultRpcStackSize
Definition: svchost.h:84
PSID * Sid
Definition: svchost.h:57
VOID WINAPI SvcNetBiosClose(VOID)
Definition: netbios.c:96
DWORD CoInitializeSecurityParam
Definition: svchost.h:80
LPWSTR ServiceGroupName
Definition: svchost.h:79
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI RpcpStartRpcServer(_In_ PCWSTR IfName, _In_ RPC_IF_HANDLE IfSpec)
Definition: rpcsrv.c:131
BOOL WINAPI MemFree(_In_ LPVOID lpMem)
Definition: globals.c:68
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL HasServiceGroup
Definition: svchost.h:78
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