ReactOS 0.4.16-dev-297-gc569aee
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
38extern ULONG CsrDebug;
39
40extern HANDLE hBootstrapOk;
41extern HANDLE CsrApiPort;
42extern HANDLE CsrSmApiPort;
43extern HANDLE CsrSbApiPort;
44#define NUMBER_THREAD_HASH_BUCKETS 257
50extern HANDLE CsrHeap;
56
57/****************************************************/
63/****************************************************/
64
65
66
67CSR_API(CsrSrvClientConnect);
68CSR_API(CsrSrvUnusedFunction);
69#if (NTDDI_VERSION < NTDDI_WS03)
70CSR_API(CsrSrvIdentifyAlertableThread);
71CSR_API(CsrSrvSetPriorityClass);
72#endif
73
74
78
79
83 IN PCSR_API_MESSAGE ApiMessage);
84
85VOID
88
91CsrLoadServerDll(IN PCHAR DllString,
92 IN PCHAR EntryPoint OPTIONAL,
93 IN ULONG ServerId);
94
95
99
101NTAPI
103
104VOID
105NTAPI
107
108VOID
109NTAPI
112
113VOID
114NTAPI
116
118NTAPI
120
121VOID
122NTAPI
124
126NTAPI
128
130NTAPI
131ProtectHandle(IN HANDLE ObjectHandle);
132
134NTAPI
135UnProtectHandle(IN HANDLE ObjectHandle);
136
138NTAPI
141
142VOID
143NTAPI
145
146VOID
147NTAPI
149
150VOID
151NTAPI
153
155NTAPI
157
159NTAPI
161 IN PCLIENT_ID Cid);
163NTAPI
166
168NTAPI
170
172NTAPI
174 OUT PCSR_API_CONNECTINFO ConnectInfo);
175
177NTAPI
179
180VOID
181NTAPI
183
184VOID
185NTAPI
187
189NTAPI
191 IN PLIST_ENTRY WaitList,
192 IN PVOID WaitArgument1,
193 IN PVOID WaitArgument2,
194 IN ULONG WaitFlags,
195 IN BOOLEAN DereferenceThread);
196
197VOID
198NTAPI
200
201VOID
202NTAPI
205
206/******************************************************************************
207 ******************************************************************************/
208
210NTAPI
212
214NTAPI
216
218NTAPI
220
222NTAPI
224
226NTAPI
228
230NTAPI
232
234NTAPI
236
238NTAPI
240
242NTAPI
244
253NTAPI
255
257NTAPI
258CsrSetDirectorySecurity(IN HANDLE ObjectDirectory);
259
260/* EOF */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
Definition: cdrom.h:963
#define CSR_API(n)
Definition: csrsrv.h:176
ULONG SessionId
Definition: dllmain.c:28
static const WCHAR Message[]
Definition: register.c:74
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
_In_ NTSTATUS ExitStatus
Definition: psfuncs.h:867
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: typedefs.h:120
VOID NTAPI CsrLockedReferenceThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:154
VOID NTAPI CsrReleaseCapturedArguments(IN PCSR_API_MESSAGE ApiMessage)
Definition: api.c:1337
PCSR_PROCESS CsrRootProcess
Definition: procsup.c:22
BOOLEAN NTAPI CsrSbTerminateSession(IN PSB_API_MSG ApiMessage)
Definition: session.c:388
PCSR_PROCESS NTAPI CsrAllocateProcess(VOID)
Definition: procsup.c:189
UNICODE_STRING CsrApiPortName
Definition: api.c:22
NTSTATUS NTAPI CsrInsertThread(IN PCSR_PROCESS Process, IN PCSR_THREAD Thread)
Definition: thredsup.c:297
BOOLEAN NTAPI ProtectHandle(IN HANDLE ObjectHandle)
Definition: thredsup.c:39
VOID NTAPI CsrReferenceNtSession(IN PCSR_NT_SESSION Session)
Definition: session.c:118
NTSTATUS NTAPI CsrSbApiPortInitialize(VOID)
Definition: init.c:915
NTSTATUS NTAPI CsrSbApiHandleConnectionRequest(IN PSB_API_MSG Message)
Definition: session.c:434
VOID NTAPI CsrSbApiRequestThread(IN PVOID Parameter)
Definition: session.c:484
NTSTATUS NTAPI CsrCreateSessionObjectDirectory(IN ULONG SessionId)
Definition: init.c:424
NTSTATUS NTAPI CsrSrvCreateSharedSection(IN PCHAR ParameterValue)
Definition: server.c:361
NTSTATUS NTAPI CsrApiRequestThread(IN PVOID Parameter)
Definition: api.c:336
ULONG CsrTotalPerProcessDataLength
Definition: init.c:39
BOOLEAN NTAPI UnProtectHandle(IN HANDLE ObjectHandle)
Definition: thredsup.c:78
NTSTATUS NTAPI CsrInitializeNtSessionList(VOID)
Definition: session.c:53
VOID NTAPI CsrRemoveProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:320
VOID NTAPI CsrInsertProcess(IN PCSR_PROCESS ParentProcess OPTIONAL, IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:366
NTSTATUS NTAPI CsrLoadServerDll(IN PCHAR DllString, IN PCHAR EntryPoint OPTIONAL, IN ULONG ServerId)
Definition: server.c:126
VOID NTAPI CsrLockedDereferenceThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:467
RTL_CRITICAL_SECTION CsrWaitListsLock
Definition: api.h:10
UNICODE_STRING CsrDirectoryName
Definition: init.c:27
HANDLE CsrSbApiPort
Definition: init.c:29
NTSTATUS NTAPI CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
Definition: api.c:144
NTSTATUS NTAPI CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL, OUT PCSR_API_CONNECTINFO ConnectInfo)
Definition: server.c:482
VOID NTAPI CsrDeallocateProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:297
HANDLE CsrInitializationEvent
VOID NTAPI CsrDeallocateThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:345
BOOLEAN NTAPI CsrSbCreateProcess(IN PSB_API_MSG ApiMessage)
Definition: session.c:410
PCSR_THREAD NTAPI CsrLocateThreadInProcess(IN PCSR_PROCESS CsrProcess OPTIONAL, IN PCLIENT_ID Cid)
Definition: thredsup.c:248
HANDLE CsrSmApiPort
Definition: init.c:31
NTSTATUS NTAPI CsrServerDllInitialization(IN PCSR_SERVER_DLL LoadedServerDll)
NTSTATUS NTAPI CsrCreateObjectDirectory(IN PCHAR ObjectDirectory)
HANDLE CsrApiPort
Definition: connect.c:27
ULONG CsrDebug
Definition: init.c:23
#define CSR_SERVER_DLL_MAX
Definition: api.h:34
PCSR_THREAD NTAPI CsrLocateThreadByClientId(OUT PCSR_PROCESS *Process OPTIONAL, IN PCLIENT_ID ClientId)
Definition: thredsup.c:182
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
NTSTATUS NTAPI CsrInitializeProcessStructure(VOID)
Definition: procsup.c:255
PVOID CsrSrvSharedSectionHeap
Definition: server.c:21
PCSR_THREAD NTAPI CsrAllocateThread(IN PCSR_PROCESS CsrProcess)
Definition: thredsup.c:119
VOID NTAPI CsrLockedReferenceProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:233
NTSTATUS NTAPI CsrApiPortInitialize(VOID)
Definition: api.c:900
BOOLEAN NTAPI CsrSbForeignSessionComplete(IN PSB_API_MSG ApiMessage)
Definition: session.c:365
ULONG CsrMaxApiRequestThreads
Definition: init.c:38
PVOID * CsrSrvSharedStaticServerData
Definition: server.c:23
HANDLE hBootstrapOk
HANDLE CsrHeap
Definition: init.c:25
PCSR_SERVER_DLL CsrLoadedServerDll[CSR_SERVER_DLL_MAX]
Definition: server.c:20
HANDLE CsrObjectDirectory
Definition: init.c:26
NTSTATUS NTAPI CsrSetDirectorySecurity(IN HANDLE ObjectDirectory)
Definition: init.c:186
UNICODE_STRING CsrSbApiPortName
Definition: init.c:28
BOOLEAN NTAPI CsrSbCreateSession(IN PSB_API_MSG ApiMessage)
Definition: session.c:208
SYSTEM_BASIC_INFORMATION CsrNtSysInfo
Definition: init.c:44
NTSTATUS NTAPI CsrCreateLocalSystemSD(OUT PSECURITY_DESCRIPTOR *LocalSystemSd)
Definition: init.c:847
LIST_ENTRY CsrThreadHashTable[NUMBER_THREAD_HASH_BUCKETS]
Definition: thredsup.c:21
BOOLEAN NTAPI CsrCaptureArguments(IN PCSR_THREAD CsrThread, IN PCSR_API_MESSAGE ApiMessage)
Definition: api.c:1123
RTL_CRITICAL_SECTION CsrProcessLock
Definition: api.h:60
VOID NTAPI CsrDereferenceNtSession(IN PCSR_NT_SESSION Session, IN NTSTATUS ExitStatus)
Definition: session.c:156
VOID NTAPI CsrLockedDereferenceProcess(PCSR_PROCESS CsrProcess)
Definition: procsup.c:159
#define NUMBER_THREAD_HASH_BUCKETS
Definition: api.h:44
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
PKPROCESS CsrProcess
Definition: videoprt.c:39
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336