ReactOS  0.4.14-dev-815-ge410a12
api.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * FILE: subsystems/win32/csrsrv/api.h
5  * PURPOSE: CSRSS Internal API
6  */
7 
8 #pragma once
9 
11 
12 #define CsrAcquireProcessLock() \
13  RtlEnterCriticalSection(&CsrProcessLock);
14 
15 #define CsrReleaseProcessLock() \
16  RtlLeaveCriticalSection(&CsrProcessLock);
17 
18 #define ProcessStructureListLocked() \
19  (CsrProcessLock.OwningThread == NtCurrentTeb()->ClientId.UniqueThread)
20 
21 #define CsrAcquireWaitLock() \
22  RtlEnterCriticalSection(&CsrWaitListsLock);
23 
24 #define CsrReleaseWaitLock() \
25  RtlLeaveCriticalSection(&CsrWaitListsLock);
26 
27 #define CsrAcquireNtSessionLock() \
28  RtlEnterCriticalSection(&CsrNtSessionLock);
29 
30 #define CsrReleaseNtSessionLock() \
31  RtlLeaveCriticalSection(&CsrNtSessionLock);
32 
33 
34 #define CSR_SERVER_DLL_MAX 4
35 
36 
37 // Debug Flag
38 extern ULONG CsrDebug;
39 
40 extern HANDLE hBootstrapOk;
41 extern HANDLE CsrApiPort;
42 extern HANDLE CsrSmApiPort;
43 extern HANDLE CsrSbApiPort;
44 #define NUMBER_THREAD_HASH_BUCKETS 257
50 extern HANDLE CsrHeap;
56 
57 /****************************************************/
63 /****************************************************/
64 
65 
66 
67 CSR_API(CsrSrvClientConnect);
68 CSR_API(CsrSrvUnusedFunction);
69 CSR_API(CsrSrvIdentifyAlertableThread);
70 CSR_API(CsrSrvSetPriorityClass);
71 
72 
74 NTAPI
76 
77 
78 BOOLEAN
79 NTAPI
81  IN PCSR_API_MESSAGE ApiMessage);
82 
83 VOID
84 NTAPI
86 
88 NTAPI
89 CsrLoadServerDll(IN PCHAR DllString,
90  IN PCHAR EntryPoint OPTIONAL,
91  IN ULONG ServerId);
92 
93 
95 NTAPI
97 
99 NTAPI
101 
102 VOID
103 NTAPI
105 
106 VOID
107 NTAPI
110 
111 VOID
112 NTAPI
114 
115 NTSTATUS
116 NTAPI
118 
119 VOID
120 NTAPI
122 
123 NTSTATUS
124 NTAPI
126 
127 BOOLEAN
128 NTAPI
129 ProtectHandle(IN HANDLE ObjectHandle);
130 
131 BOOLEAN
132 NTAPI
133 UnProtectHandle(IN HANDLE ObjectHandle);
134 
135 NTSTATUS
136 NTAPI
139 
140 VOID
141 NTAPI
143 
144 VOID
145 NTAPI
147 
148 VOID
149 NTAPI
151 
152 NTSTATUS
153 NTAPI
155 
157 NTAPI
159  IN PCLIENT_ID Cid);
161 NTAPI
164 
165 NTSTATUS
166 NTAPI
168 
169 NTSTATUS
170 NTAPI
172  OUT PCSR_API_CONNECTINFO ConnectInfo);
173 
174 NTSTATUS
175 NTAPI
177 
178 VOID
179 NTAPI
181 
182 VOID
183 NTAPI
185 
186 BOOLEAN
187 NTAPI
189  IN PLIST_ENTRY WaitList,
190  IN PVOID WaitArgument1,
191  IN PVOID WaitArgument2,
192  IN ULONG WaitFlags,
193  IN BOOLEAN DereferenceThread);
194 
195 VOID
196 NTAPI
198 
199 VOID
200 NTAPI
203 
204 /******************************************************************************
205  ******************************************************************************/
206 
207 NTSTATUS
208 NTAPI
210 
211 NTSTATUS
212 NTAPI
213 CsrCreateObjectDirectory(IN PCHAR ObjectDirectory);
214 
215 NTSTATUS
216 NTAPI
218 
219 BOOLEAN
220 NTAPI
221 CsrSbCreateSession(IN PSB_API_MSG ApiMessage);
222 
223 BOOLEAN
224 NTAPI
226 
227 BOOLEAN
228 NTAPI
230 
231 BOOLEAN
232 NTAPI
233 CsrSbCreateProcess(IN PSB_API_MSG ApiMessage);
234 
235 NTSTATUS
236 NTAPI
238 
239 NTSTATUS
240 NTAPI
242 
250 NTSTATUS
251 NTAPI
253 
254 NTSTATUS
255 NTAPI
256 CsrSetDirectorySecurity(IN HANDLE ObjectDirectory);
257 
258 /* EOF */
VOID NTAPI CsrLockedReferenceThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:154
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:38
PCSR_PROCESS NTAPI CsrAllocateProcess(VOID)
Definition: procsup.c:188
HANDLE CsrApiPort
Definition: connect.c:21
NTSTATUS NTAPI CsrInitializeProcessStructure(VOID)
Definition: procsup.c:254
BOOLEAN NTAPI CsrNotifyWaitBlock(IN PCSR_WAIT_BLOCK WaitBlock, IN PLIST_ENTRY WaitList, IN PVOID WaitArgument1, IN PVOID WaitArgument2, IN ULONG WaitFlags, IN BOOLEAN DereferenceThread)
Definition: wait.c:120
PCSR_THREAD NTAPI CsrAllocateThread(IN PCSR_PROCESS CsrProcess)
Definition: thredsup.c:119
BOOLEAN NTAPI UnProtectHandle(IN HANDLE ObjectHandle)
Definition: thredsup.c:78
VOID NTAPI CsrReleaseCapturedArguments(IN PCSR_API_MESSAGE ApiMessage)
Definition: api.c:1235
HANDLE CsrInitializationEvent
NTSTATUS NTAPI CsrSbApiHandleConnectionRequest(IN PSB_API_MSG Message)
Definition: session.c:434
ULONG SessionId
Definition: dllmain.c:28
LONG NTSTATUS
Definition: precomp.h:26
ULONG CsrDebug
Definition: init.c:23
BOOLEAN NTAPI CsrSbForeignSessionComplete(IN PSB_API_MSG ApiMessage)
Definition: session.c:365
RTL_CRITICAL_SECTION CsrProcessLock
Definition: api.h:60
ULONG CsrTotalPerProcessDataLength
Definition: init.c:35
PKPROCESS CsrProcess
Definition: videoprt.c:37
VOID NTAPI CsrSbApiRequestThread(IN PVOID Parameter)
Definition: session.c:484
_In_ PVOID Parameter
Definition: ldrtypes.h:241
UNICODE_STRING CsrApiPortName
Definition: api.c:22
#define CSR_SERVER_DLL_MAX
Definition: api.h:34
LIST_ENTRY CsrThreadHashTable[NUMBER_THREAD_HASH_BUCKETS]
Definition: thredsup.c:21
BOOLEAN NTAPI CsrSbCreateProcess(IN PSB_API_MSG ApiMessage)
Definition: session.c:410
PCSR_PROCESS CsrRootProcess
Definition: procsup.c:22
HANDLE CsrObjectDirectory
Definition: init.c:26
BOOLEAN NTAPI CsrSbCreateSession(IN PSB_API_MSG ApiMessage)
Definition: session.c:208
NTSTATUS NTAPI CsrServerDllInitialization(IN PCSR_SERVER_DLL LoadedServerDll)
NTSTATUS NTAPI CsrCreateSessionObjectDirectory(IN ULONG SessionId)
Definition: init.c:414
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI CsrDeallocateThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:345
VOID NTAPI CsrDereferenceNtSession(IN PCSR_NT_SESSION Session, IN NTSTATUS ExitStatus)
Definition: session.c:156
VOID NTAPI CsrLockedDereferenceThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:467
PVOID * CsrSrvSharedStaticServerData
Definition: server.c:23
unsigned char BOOLEAN
UNICODE_STRING CsrSbApiPortName
Definition: init.c:28
NTSTATUS NTAPI CsrSrvCreateSharedSection(IN PCHAR ParameterValue)
Definition: server.c:335
NTSTATUS NTAPI CsrInsertThread(IN PCSR_PROCESS Process, IN PCSR_THREAD Thread)
Definition: thredsup.c:297
NTSTATUS NTAPI CsrApiPortInitialize(VOID)
Definition: api.c:882
NTSTATUS NTAPI CsrSbApiPortInitialize(VOID)
Definition: init.c:869
NTSTATUS NTAPI CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL, OUT PCSR_API_CONNECTINFO ConnectInfo)
Definition: server.c:456
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1176
NTSTATUS NTAPI CsrCreateObjectDirectory(IN PCHAR ObjectDirectory)
BOOLEAN NTAPI ProtectHandle(IN HANDLE ObjectHandle)
Definition: thredsup.c:39
VOID NTAPI CsrDeallocateProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:296
NTSTATUS NTAPI CsrCreateLocalSystemSD(OUT PSECURITY_DESCRIPTOR *LocalSystemSd)
Definition: init.c:801
NTSTATUS NTAPI CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
Definition: api.c:140
VOID NTAPI CsrRemoveProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:319
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
SYSTEM_BASIC_INFORMATION CsrNtSysInfo
Definition: init.c:40
CHAR Message[80]
Definition: alive.c:5
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
Definition: classpnp.h:1209
Definition: typedefs.h:117
UNICODE_STRING CsrDirectoryName
Definition: init.c:27
VOID NTAPI CsrReferenceNtSession(IN PCSR_NT_SESSION Session)
Definition: session.c:118
PCSR_THREAD NTAPI CsrLocateThreadByClientId(OUT PCSR_PROCESS *Process OPTIONAL, IN PCLIENT_ID ClientId)
Definition: thredsup.c:182
BOOLEAN NTAPI CsrCaptureArguments(IN PCSR_THREAD CsrThread, IN PCSR_API_MESSAGE ApiMessage)
Definition: api.c:1104
PCSR_THREAD NTAPI CsrLocateThreadInProcess(IN PCSR_PROCESS CsrProcess OPTIONAL, IN PCLIENT_ID Cid)
Definition: thredsup.c:248
RTL_CRITICAL_SECTION CsrWaitListsLock
Definition: api.h:61
#define NUMBER_THREAD_HASH_BUCKETS
Definition: api.h:44
_In_ NTSTATUS ExitStatus
Definition: psfuncs.h:859
ULONG CsrMaxApiRequestThreads
Definition: init.c:34
PVOID CsrSrvSharedSectionHeap
Definition: server.c:21
CSR_API(BaseSrvCheckApplicationCompatibility)
Definition: appcompat.c:56
NTSTATUS NTAPI CsrSetDirectorySecurity(IN HANDLE ObjectDirectory)
Definition: init.c:176
NTSTATUS NTAPI CsrLoadServerDll(IN PCHAR DllString, IN PCHAR EntryPoint OPTIONAL, IN ULONG ServerId)
Definition: server.c:116
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
#define OUT
Definition: typedefs.h:39
HANDLE CsrSmApiPort
Definition: init.c:31
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI CsrApiRequestThread(IN PVOID Parameter)
Definition: api.c:331
BOOLEAN NTAPI CsrSbTerminateSession(IN PSB_API_MSG ApiMessage)
Definition: session.c:388
NTSTATUS NTAPI CsrInitializeNtSessionList(VOID)
Definition: session.c:53
VOID NTAPI CsrInsertProcess(IN PCSR_PROCESS ParentProcess OPTIONAL, IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:365
VOID NTAPI CsrLockedReferenceProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:232
HANDLE hBootstrapOk
HANDLE CsrHeap
Definition: init.c:25
VOID NTAPI CsrLockedDereferenceProcess(PCSR_PROCESS CsrProcess)
Definition: procsup.c:159
HANDLE CsrSbApiPort
Definition: init.c:29
PCSR_SERVER_DLL CsrLoadedServerDll[CSR_SERVER_DLL_MAX]
Definition: server.c:20
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68