ReactOS  0.4.15-dev-4853-g3a72a52
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 #if (NTDDI_VERSION < NTDDI_WS03)
70 CSR_API(CsrSrvIdentifyAlertableThread);
71 CSR_API(CsrSrvSetPriorityClass);
72 #endif
73 
74 
76 NTAPI
78 
79 
80 BOOLEAN
81 NTAPI
83  IN PCSR_API_MESSAGE ApiMessage);
84 
85 VOID
86 NTAPI
88 
90 NTAPI
91 CsrLoadServerDll(IN PCHAR DllString,
92  IN PCHAR EntryPoint OPTIONAL,
93  IN ULONG ServerId);
94 
95 
97 NTAPI
99 
101 NTAPI
103 
104 VOID
105 NTAPI
107 
108 VOID
109 NTAPI
112 
113 VOID
114 NTAPI
116 
117 NTSTATUS
118 NTAPI
120 
121 VOID
122 NTAPI
124 
125 NTSTATUS
126 NTAPI
128 
129 BOOLEAN
130 NTAPI
131 ProtectHandle(IN HANDLE ObjectHandle);
132 
133 BOOLEAN
134 NTAPI
135 UnProtectHandle(IN HANDLE ObjectHandle);
136 
137 NTSTATUS
138 NTAPI
141 
142 VOID
143 NTAPI
145 
146 VOID
147 NTAPI
149 
150 VOID
151 NTAPI
153 
154 NTSTATUS
155 NTAPI
157 
159 NTAPI
161  IN PCLIENT_ID Cid);
163 NTAPI
166 
167 NTSTATUS
168 NTAPI
170 
171 NTSTATUS
172 NTAPI
174  OUT PCSR_API_CONNECTINFO ConnectInfo);
175 
176 NTSTATUS
177 NTAPI
179 
180 VOID
181 NTAPI
183 
184 VOID
185 NTAPI
187 
188 BOOLEAN
189 NTAPI
191  IN PLIST_ENTRY WaitList,
192  IN PVOID WaitArgument1,
193  IN PVOID WaitArgument2,
194  IN ULONG WaitFlags,
195  IN BOOLEAN DereferenceThread);
196 
197 VOID
198 NTAPI
200 
201 VOID
202 NTAPI
205 
206 /******************************************************************************
207  ******************************************************************************/
208 
209 NTSTATUS
210 NTAPI
212 
213 NTSTATUS
214 NTAPI
215 CsrCreateObjectDirectory(IN PCHAR ObjectDirectory);
216 
217 NTSTATUS
218 NTAPI
220 
221 BOOLEAN
222 NTAPI
223 CsrSbCreateSession(IN PSB_API_MSG ApiMessage);
224 
225 BOOLEAN
226 NTAPI
228 
229 BOOLEAN
230 NTAPI
232 
233 BOOLEAN
234 NTAPI
235 CsrSbCreateProcess(IN PSB_API_MSG ApiMessage);
236 
237 NTSTATUS
238 NTAPI
240 
241 NTSTATUS
242 NTAPI
244 
252 NTSTATUS
253 NTAPI
255 
256 NTSTATUS
257 NTAPI
258 CsrSetDirectorySecurity(IN HANDLE ObjectDirectory);
259 
260 /* EOF */
VOID NTAPI CsrLockedReferenceThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:154
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:39
PCSR_PROCESS NTAPI CsrAllocateProcess(VOID)
Definition: procsup.c:189
HANDLE CsrApiPort
Definition: connect.c:21
NTSTATUS NTAPI CsrInitializeProcessStructure(VOID)
Definition: procsup.c:255
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:1337
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:39
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:420
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:361
NTSTATUS NTAPI CsrInsertThread(IN PCSR_PROCESS Process, IN PCSR_THREAD Thread)
Definition: thredsup.c:297
NTSTATUS NTAPI CsrApiPortInitialize(VOID)
Definition: api.c:900
NTSTATUS NTAPI CsrSbApiPortInitialize(VOID)
Definition: init.c:875
NTSTATUS NTAPI CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL, OUT PCSR_API_CONNECTINFO ConnectInfo)
Definition: server.c:482
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1165
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:297
NTSTATUS NTAPI CsrCreateLocalSystemSD(OUT PSECURITY_DESCRIPTOR *LocalSystemSd)
Definition: init.c:807
NTSTATUS NTAPI CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
Definition: api.c:144
VOID NTAPI CsrRemoveProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:320
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2652
SYSTEM_BASIC_INFORMATION CsrNtSysInfo
Definition: init.c:40
CHAR Message[80]
Definition: alive.c:5
Definition: typedefs.h:119
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:1123
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
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
Definition: cdrom.h:960
CSR_API(BaseSrvCheckApplicationCompatibility)
Definition: appcompat.c:56
NTSTATUS NTAPI CsrSetDirectorySecurity(IN HANDLE ObjectDirectory)
Definition: init.c:182
NTSTATUS NTAPI CsrLoadServerDll(IN PCHAR DllString, IN PCHAR EntryPoint OPTIONAL, IN ULONG ServerId)
Definition: server.c:126
_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:40
HANDLE CsrSmApiPort
Definition: init.c:31
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI CsrApiRequestThread(IN PVOID Parameter)
Definition: api.c:336
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:366
VOID NTAPI CsrLockedReferenceProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:233
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