ReactOS 0.4.15-dev-8109-gd7be748
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//
40typedef 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//
55typedef struct _DOMAIN_SID_DATA
56{
60
61//
62// Well-known SID Structure
63//
64typedef struct _SID_DATA
65{
70
71//
72// This contains all the settings (from the registry) for a hosted service
73//
74typedef struct _SVCHOST_OPTIONS
75{
87
88//
89// This represents the DLL used to hold a hosted service
90//
91typedef struct _SVCHOST_DLL
92{
100
101//
102// This represents an actual hosted service
103//
104typedef struct _SVCHOST_SERVICE
105{
112
113//
114// This is the context that a hosted service with a stop callback has
115//
117{
121
123NTAPI
125 VOID
126);
127
129NTAPI
131 _In_ RPC_IF_HANDLE IfSpec
132);
133
135NTAPI
137 _In_ RPC_IF_HANDLE IfSpec
138);
139
141NTAPI
143 _In_ PCWSTR IfName,
144 _In_ RPC_IF_HANDLE IfSpec
145);
146
147VOID
148WINAPI
150 VOID
151);
152
153VOID
154WINAPI
156 _In_ LPCWSTR lpSrcStr
157);
158
160NTAPI
162 VOID
163);
164
165VOID
166WINAPI
167MemInit (
168 _In_ HANDLE Heap
169);
170
171BOOL
172WINAPI
173MemFree (
174 _In_ LPVOID lpMem
175);
176
177PVOID
178WINAPI
179MemAlloc (
181 _In_ DWORD dwBytes
182);
183
184VOID
185WINAPI
187 VOID
188);
189
190VOID
191WINAPI
193 VOID
194);
195
196VOID
197WINAPI
199 VOID
200);
201
202DWORD
203WINAPI
205 _In_ UCHAR LanaNum
206);
207
208BOOL
209WINAPI
211 _In_ DWORD dwParam,
212 _In_ DWORD dwAuthnLevel,
213 _In_ DWORD dwImpLevel,
214 _In_ DWORD dwCapabilities
215);
216
217
218DWORD
219WINAPI
221 _In_ HKEY hKey,
222 _In_ LPCWSTR pszValueName,
223 _Out_ PDWORD pdwValue
224);
225
226DWORD
227WINAPI
229 _In_ HKEY hKey,
230 _In_ LPCWSTR pszValueName,
231 _In_ DWORD dwExpectedType,
232 _Out_ PBYTE* ppbData
233);
234
235DWORD
236WINAPI
238 _In_ HKEY hKey,
239 _In_ LPCWSTR pszValueName,
240 _In_ DWORD dwExpectedType,
241 _Out_ LPCSTR* ppszData
242);
243
244DWORD
245WINAPI
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_ */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
static WCHAR ServiceName[]
Definition: browser.c:19
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
BYTE * PBYTE
Definition: pedump.c:66
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
WAITORTIMERCALLBACK PSVCHOST_STOP_CALLBACK
Definition: svc.h:75
PSID * Sid
Definition: svchost.h:57
DWORD SubAuthority
Definition: svchost.h:58
Definition: typedefs.h:120
DWORD SubAuthority
Definition: svchost.h:68
PSID * Sid
Definition: svchost.h:66
SID_IDENTIFIER_AUTHORITY Authority
Definition: svchost.h:67
PSVCHOST_SERVICE pService
Definition: svchost.h:119
LIST_ENTRY DllList
Definition: svchost.h:93
struct _SVCHOST_SERVICE * pService
Definition: svchost.h:98
HINSTANCE hModule
Definition: svchost.h:94
LPCWSTR pszDllPath
Definition: svchost.h:95
HANDLE hActCtx
Definition: svchost.h:97
LPCWSTR pszManifestPath
Definition: svchost.h:96
LPWSTR ServiceGroupName
Definition: svchost.h:79
DWORD DefaultRpcStackSize
Definition: svchost.h:84
BOOL HasServiceGroup
Definition: svchost.h:78
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: svchost.h:82
PWCHAR CmdLine
Definition: svchost.h:77
DWORD CoInitializeSecurityParam
Definition: svchost.h:80
DWORD AuthenticationCapabilities
Definition: svchost.h:83
PWCHAR CmdLineBuffer
Definition: svchost.h:76
DWORD AuthenticationLevel
Definition: svchost.h:81
BOOLEAN SystemCritical
Definition: svchost.h:85
LONG cServiceActiveThreadCount
Definition: svchost.h:108
LPCWSTR pszServiceName
Definition: svchost.h:106
PSVCHOST_STOP_CALLBACK pfnStopCallback
Definition: svchost.h:110
PSVCHOST_DLL pDll
Definition: svchost.h:109
LPCSTR pszServiceMain
Definition: svchost.h:107
struct _SVCHOST_DLL SVCHOST_DLL
struct _SID_DATA SID_DATA
NTSTATUS NTAPI RpcpStopRpcServer(_In_ RPC_IF_HANDLE IfSpec)
Definition: rpcsrv.c:33
DWORD WINAPI SvcNetBiosReset(_In_ UCHAR LanaNum)
Definition: netbios.c:124
VOID WINAPI MemInit(_In_ HANDLE Heap)
Definition: globals.c:58
VOID(WINAPI * PSVCHOST_INIT_GLOBALS)(_In_ PSVCHOST_GLOBAL_DATA Globals)
Definition: svchost.h:41
NTSTATUS NTAPI RpcpStartRpcServer(_In_ PCWSTR IfName, _In_ RPC_IF_HANDLE IfSpec)
Definition: rpcsrv.c:131
NTSTATUS NTAPI RpcpInitRpcServer(VOID)
Definition: rpcsrv.c:22
PSVCHOST_GLOBAL_DATA g_pSvchostSharedGlobals
Definition: globals.c:50
NTSTATUS NTAPI RpcpStopRpcServerEx(_In_ RPC_IF_HANDLE IfSpec)
Definition: rpcsrv.c:58
VOID WINAPI SvchostBuildSharedGlobals(VOID)
Definition: globals.c:89
VOID WINAPI SvcNetBiosClose(VOID)
Definition: netbios.c:96
VOID WINAPI SvcNetBiosOpen(VOID)
Definition: netbios.c:112
DWORD WINAPI RegQueryStringA(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ LPCSTR *ppszData)
Definition: registry.c:128
BOOL WINAPI MemFree(_In_ LPVOID lpMem)
Definition: globals.c:68
VOID WINAPI SvchostCharLowerW(_In_ LPCWSTR lpSrcStr)
Definition: globals.c:162
struct _SVCHOST_SERVICE SVCHOST_SERVICE
NTSTATUS NTAPI ScCreateWellKnownSids(VOID)
Definition: globals.c:266
struct _SVCHOST_OPTIONS * PSVCHOST_OPTIONS
struct _SVCHOST_CALLBACK_CONTEXT SVCHOST_CALLBACK_CONTEXT
struct _DOMAIN_SID_DATA DOMAIN_SID_DATA
DWORD WINAPI RegQueryString(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ PBYTE *ppbData)
Definition: registry.c:107
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
PVOID WINAPI MemAlloc(_In_ DWORD dwFlags, _In_ DWORD dwBytes)
Definition: globals.c:78
struct _SVCHOST_OPTIONS SVCHOST_OPTIONS
struct _SVCHOST_CALLBACK_CONTEXT * PSVCHOST_CALLBACK_CONTEXT
BOOL WINAPI InitializeSecurity(_In_ DWORD dwParam, _In_ DWORD dwAuthnLevel, _In_ DWORD dwImpLevel, _In_ DWORD dwCapabilities)
Definition: security.cxx:161
struct _SVCHOST_SERVICE * PSVCHOST_SERVICE
DWORD WINAPI RegQueryDword(_In_ HKEY hKey, _In_ LPCWSTR pszValueName, _Out_ PDWORD pdwValue)
Definition: registry.c:78
VOID WINAPI SvcNetBiosInit(VOID)
Definition: netbios.c:84
struct _SVCHOST_DLL * PSVCHOST_DLL
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned char UCHAR
Definition: xmlstorage.h:181
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185