ReactOS 0.4.17-dev-806-gffa4164
session.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Client/Server Runtime SubSystem
4 * FILE: subsystems/win32/csrsrv/session.c
5 * PURPOSE: CSR Server DLL Session Implementation
6 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include "srv.h"
12
13#define NDEBUG
14#include <debug.h>
15
16/* DATA ***********************************************************************/
17
20
22{
27};
28
29#if DBG
30const PCSTR CsrServerSbApiName[SbpMaxApiNumber - SbpCreateSession + 1] =
31{
32 "SbCreateSession",
33 "SbTerminateSession",
34 "SbForeignSessionComplete",
35 "SbCreateProcess",
36 "Unknown CSR Sb Api Number"
37};
38#endif
39
40/* PRIVATE FUNCTIONS **********************************************************/
41
42/*++
43 * @name CsrInitializeNtSessionList
44 *
45 * The CsrInitializeNtSessionList routine sets up support for CSR Sessions.
46 *
47 * @param None
48 *
49 * @return None
50 *
51 * @remarks None.
52 *
53 *--*/
57{
58 /* Initialize the Session List */
60
61 /* Initialize the Session Lock */
63}
64
65/*++
66 * @name CsrAllocateNtSession
67 *
68 * The CsrAllocateNtSession routine allocates a new CSR NT Session.
69 *
70 * @param SessionId
71 * Session ID of the CSR NT Session to allocate.
72 *
73 * @return Pointer to the newly allocated CSR NT Session.
74 *
75 * @remarks None.
76 *
77 *--*/
81{
82 PCSR_NT_SESSION NtSession;
83
84 /* Allocate an NT Session Object */
86 if (NtSession)
87 {
88 /* Setup the Session Object */
89 NtSession->SessionId = SessionId;
90 NtSession->ReferenceCount = 1;
91
92 /* Insert it into the Session List */
96 }
97 else
98 {
99 ASSERT(NtSession != NULL);
100 }
101
102 /* Return the Session (or NULL) */
103 return NtSession;
104}
105
106/*++
107 * @name CsrReferenceNtSession
108 *
109 * The CsrReferenceNtSession increases the reference count of a CSR NT Session.
110 *
111 * @param Session
112 * Pointer to the CSR NT Session to reference.
113 *
114 * @return None.
115 *
116 * @remarks None.
117 *
118 *--*/
119VOID
120NTAPI
122{
123 /* Acquire the lock */
125
126 /* Sanity checks */
127 ASSERT(!IsListEmpty(&Session->SessionLink));
128 ASSERT(Session->SessionId != 0);
129 ASSERT(Session->ReferenceCount != 0);
130
131 /* Increase the reference count */
132 Session->ReferenceCount++;
133
134 /* Release the lock */
136}
137
138/*++
139 * @name CsrDereferenceNtSession
140 *
141 * The CsrDereferenceNtSession decreases the reference count of a
142 * CSR NT Session.
143 *
144 * @param Session
145 * Pointer to the CSR NT Session to reference.
146 *
147 * @param ExitStatus
148 * If this is the last reference to the session, this argument
149 * specifies the exit status.
150 *
151 * @return None.
152 *
153 * @remarks CsrDereferenceNtSession will complete the session if
154 * the last reference to it has been closed.
155 *
156 *--*/
157VOID
158NTAPI
161{
162 /* Acquire the lock */
164
165 /* Sanity checks */
166 ASSERT(!IsListEmpty(&Session->SessionLink));
167 ASSERT(Session->SessionId != 0);
168 ASSERT(Session->ReferenceCount != 0);
169
170 /* Dereference the Session Object */
171 if ((--Session->ReferenceCount) == 0)
172 {
173 /* Remove it from the list */
174 RemoveEntryList(&Session->SessionLink);
175
176 /* Release the lock */
178
179 /* Tell SM that we're done here */
180 SmSessionComplete(CsrSmApiPort, Session->SessionId, ExitStatus);
181
182 /* Free the Session Object */
183 RtlFreeHeap(CsrHeap, 0, Session);
184 }
185 else
186 {
187 /* Release the lock, the Session is still active */
189 }
190}
191
192/* SESSION MANAGER FUNCTIONS **************************************************/
193
194/*++
195 * @name CsrSbCreateSession
196 *
197 * The CsrSbCreateSession API is called by the Session Manager whenever a new
198 * session is created.
199 *
200 * @param ApiMessage
201 * Pointer to the Session Manager API Message.
202 *
203 * @return TRUE in case of success, FALSE otherwise.
204 *
205 * @remarks The CsrSbCreateSession routine will initialize a new CSR NT
206 * Session and allocate a new CSR Process for the subsystem process.
207 *
208 *--*/
210NTAPI
212{
213 PSB_CREATE_SESSION_MSG CreateSession = &ApiMessage->u.CreateSession;
216 PCSR_THREAD CsrThread;
217 PCSR_SERVER_DLL ServerDll;
218 PVOID ProcessData;
220 KERNEL_USER_TIMES KernelTimes;
221 ULONG i;
222
223 /* Save the Process and Thread Handles */
224 hProcess = CreateSession->ProcessInfo.ProcessHandle;
225 hThread = CreateSession->ProcessInfo.ThreadHandle;
226
227 /* Lock the Processes */
229
230 /* Allocate a new process */
232 if (!CsrProcess)
233 {
234 /* Fail */
235 ApiMessage->ReturnValue = STATUS_NO_MEMORY;
237 return TRUE;
238 }
239
240 /* Set the Exception Port for us */
243 &CsrApiPort,
244 sizeof(CsrApiPort));
245
246 /* Check for success */
247 if (!NT_SUCCESS(Status))
248 {
249 /* Fail the request */
252
253 /* Strange as it seems, NTSTATUSes are actually returned */
255 }
256
257 /* Get the Create Time */
260 &KernelTimes,
261 sizeof(KernelTimes),
262 NULL);
263
264 /* Check for success */
265 if (!NT_SUCCESS(Status))
266 {
267 /* Fail the request */
270
271 /* Strange as it seems, NTSTATUSes are actually returned */
272 return (BOOLEAN)Status;
273 }
274
275 /* Allocate a new Thread */
276 CsrThread = CsrAllocateThread(CsrProcess);
277 if (!CsrThread)
278 {
279 /* Fail the request */
282
283 ApiMessage->ReturnValue = STATUS_NO_MEMORY;
284 return TRUE;
285 }
286
287 /* Setup the Thread Object */
288 CsrThread->CreateTime = KernelTimes.CreateTime;
289 CsrThread->ClientId = CreateSession->ProcessInfo.ClientId;
290 CsrThread->ThreadHandle = hThread;
292 CsrThread->Flags = 0;
293
294 /* Insert it into the Process List */
295 Status = CsrInsertThread(CsrProcess, CsrThread);
296 if (!NT_SUCCESS(Status))
297 {
298 /* Bail out */
300 CsrDeallocateThread(CsrThread);
302
303 /* Strange as it seems, NTSTATUSes are actually returned */
304 return (BOOLEAN)Status;
305 }
306
307 /* Setup Process Data */
308 CsrProcess->ClientId = CreateSession->ProcessInfo.ClientId;
309 CsrProcess->ProcessHandle = hProcess;
310 CsrProcess->NtSession = CsrAllocateNtSession(CreateSession->SessionId);
311
312 /* Set the Process Priority */
314
315 /* Get the first data location */
316 ProcessData = &CsrProcess->ServerData[CSR_SERVER_DLL_MAX];
317
318 /* Loop every DLL */
319 for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
320 {
321 /* Get the current Server */
322 ServerDll = CsrLoadedServerDll[i];
323
324 /* Check if the DLL is loaded and has Process Data */
325 if (ServerDll && ServerDll->SizeOfProcessData)
326 {
327 /* Write the pointer to the data */
328 CsrProcess->ServerData[i] = ProcessData;
329
330 /* Move to the next data location */
331 ProcessData = (PVOID)((ULONG_PTR)ProcessData +
332 ServerDll->SizeOfProcessData);
333 }
334 else
335 {
336 /* Nothing for this Process */
337 CsrProcess->ServerData[i] = NULL;
338 }
339 }
340
341 /* Insert the Process */
343
344 /* Activate the Thread */
345 ApiMessage->ReturnValue = NtResumeThread(hThread, NULL);
346
347 /* Release lock and return */
349 return TRUE;
350}
351
352/*++
353 * @name CsrSbForeignSessionComplete
354 *
355 * The CsrSbForeignSessionComplete API is called by the Session Manager
356 * whenever a foreign session is completed (ie: terminated).
357 *
358 * @param ApiMessage
359 * Pointer to the Session Manager API Message.
360 *
361 * @return TRUE in case of success, FALSE otherwise.
362 *
363 * @remarks The CsrSbForeignSessionComplete API is not yet implemented.
364 *
365 *--*/
367NTAPI
369{
370 /* Deprecated/Unimplemented in NT */
371 ApiMessage->ReturnValue = STATUS_NOT_IMPLEMENTED;
372 return TRUE;
373}
374
375/*++
376 * @name CsrSbTerminateSession
377 *
378 * The CsrSbTerminateSession API is called by the Session Manager
379 * whenever a foreign session should be destroyed.
380 *
381 * @param ApiMessage
382 * Pointer to the Session Manager API Message.
383 *
384 * @return TRUE in case of success, FALSE otherwise.
385 *
386 * @remarks The CsrSbTerminateSession API is not yet implemented.
387 *
388 *--*/
390NTAPI
392{
393 ApiMessage->ReturnValue = STATUS_NOT_IMPLEMENTED;
394 return TRUE;
395}
396
397/*++
398 * @name CsrSbCreateProcess
399 *
400 * The CsrSbCreateProcess API is called by the Session Manager
401 * whenever a foreign session is created and a new process should be started.
402 *
403 * @param ApiMessage
404 * Pointer to the Session Manager API Message.
405 *
406 * @return TRUE in case of success, FALSE otherwise.
407 *
408 * @remarks The CsrSbCreateProcess API is not yet implemented.
409 *
410 *--*/
412NTAPI
414{
415 ApiMessage->ReturnValue = STATUS_NOT_IMPLEMENTED;
416 return TRUE;
417}
418
419/*++
420 * @name CsrSbApiHandleConnectionRequest
421 *
422 * The CsrSbApiHandleConnectionRequest routine handles and accepts a new
423 * connection request to the SM API LPC Port.
424 *
425 * @param ApiMessage
426 * Pointer to the incoming CSR API Message which contains the
427 * connection request.
428 *
429 * @return STATUS_SUCCESS in case of success, or status code which caused
430 * the routine to error.
431 *
432 * @remarks None.
433 *
434 *--*/
436NTAPI
438{
440 REMOTE_PORT_VIEW RemotePortView;
441 HANDLE hPort;
442
443 /* Set the Port View Structure Length */
444 RemotePortView.Length = sizeof(REMOTE_PORT_VIEW);
445
446 /* Accept the connection */
448 NULL,
449 &Message->h,
450 TRUE,
451 NULL,
452 &RemotePortView);
453 if (!NT_SUCCESS(Status))
454 {
455 DPRINT1("CSRSS: Sb Accept Connection failed %lx\n", Status);
456 return Status;
457 }
458
459 /* Complete the Connection */
461 if (!NT_SUCCESS(Status))
462 {
463 DPRINT1("CSRSS: Sb Complete Connection failed %lx\n",Status);
464 }
465
466 /* Return status */
467 return Status;
468}
469
481ULONG
482NTAPI
485{
487 SB_API_MSG ReceiveMsg;
488 PSB_API_MSG ReplyMsg = NULL;
490 ULONG MessageType;
491
492 /* Start the loop */
493 while (TRUE)
494 {
495 /* Wait for a message to come in */
498 &ReplyMsg->h,
499 &ReceiveMsg.h);
500
501 /* Check if we didn't get success */
502 if (Status != STATUS_SUCCESS)
503 {
504 /* If we only got a warning, keep going */
505 if (NT_SUCCESS(Status)) continue;
506
507 /* We failed big time, so start out fresh */
508 ReplyMsg = NULL;
509 DPRINT1("CSRSS: ReceivePort failed - Status == %X\n", Status);
510 continue;
511 }
512
513 /* Save the message type */
514 MessageType = ReceiveMsg.h.u2.s2.Type;
515
516 /* Check if this is a connection request */
517 if (MessageType == LPC_CONNECTION_REQUEST)
518 {
519 /* Handle connection request */
521
522 /* Start over */
523 ReplyMsg = NULL;
524 continue;
525 }
526
527 /* Check if the port died */
528 if (MessageType == LPC_PORT_CLOSED)
529 {
530 /* Close the handle if we have one */
532
533 /* Client died, start over */
534 ReplyMsg = NULL;
535 continue;
536 }
537 else if (MessageType == LPC_CLIENT_DIED)
538 {
539 /* Client died, start over */
540 ReplyMsg = NULL;
541 continue;
542 }
543
544 /* This is an actual API message */
545#if DBG
546 DPRINT("CSRSS: %s Session Api Request received from %lx.%lx\n",
547 CsrServerSbApiName[min(ReceiveMsg.ApiNumber, SbpMaxApiNumber)],
548 ReceiveMsg.h.ClientId.UniqueProcess,
549 ReceiveMsg.h.ClientId.UniqueThread);
550#endif
551
552 /* Reuse the message */
553 ReplyMsg = &ReceiveMsg;
554
555 /* Make sure that the API is supported */
556 if (ReceiveMsg.ApiNumber < SbpMaxApiNumber)
557 {
558 /* Call the API */
559 if (!CsrServerSbApiDispatch[ReceiveMsg.ApiNumber](&ReceiveMsg))
560 {
561#if DBG
562 DPRINT1("CSRSS: %s Session Api called and failed\n",
563 CsrServerSbApiName[ReceiveMsg.ApiNumber]);
564#endif
565 /* It failed, so return nothing */
566 ReplyMsg = NULL;
567 }
568 }
569 else
570 {
571 /* This API number is not supported */
572 DPRINT1("CSRSS: Invalid Sb Api Number %lx\n", ReceiveMsg.ApiNumber);
573 /* The NT behaviour is to reset it to the Maximum API ID */
574 ReceiveMsg.ApiNumber = SbpMaxApiNumber;
576 }
577 }
578
580 return STATUS_UNSUCCESSFUL;
581}
582
583/* EOF */
unsigned char BOOLEAN
Definition: actypes.h:127
_In_ PVOID PortContext
Definition: ata_shared.h:375
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:616
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:634
NTSTATUS NTAPI NtAcceptConnectPort(OUT PHANDLE PortHandle, IN PVOID PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage, IN BOOLEAN AcceptConnection, IN OUT PPORT_VIEW ServerView OPTIONAL, OUT PREMOTE_PORT_VIEW ClientView OPTIONAL)
Definition: complete.c:40
NTSTATUS NTAPI NtCompleteConnectPort(IN HANDLE PortHandle)
Definition: complete.c:423
VOID NTAPI CsrSetBackgroundPriority(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:1107
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
@ ThreadTimes
Definition: compat.h:936
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
ULONG SessionId
Definition: dllmain.c:28
MMRESULT CreateSession(DeviceType device_type, UINT device_id, SessionInfo **session_info)
Definition: session.c:63
static const WCHAR Message[]
Definition: register.c:74
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
Status
Definition: gdiplustypes.h:24
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
#define ASSERT(a)
Definition: mode.c:44
#define LPC_CLIENT_DIED
Definition: port.c:98
#define LPC_CONNECTION_REQUEST
Definition: port.c:102
#define LPC_PORT_CLOSED
Definition: port.c:97
#define min(a, b)
Definition: monoChain.cc:55
_In_ NTSTATUS ExitStatus
Definition: psfuncs.h:890
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
HANDLE hThread
Definition: wizard.c:28
#define _In_
Definition: no_sal2.h:158
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3429
#define UNREACHABLE
struct _REMOTE_PORT_VIEW REMOTE_PORT_VIEW
NTSTATUS NTAPI NtReplyWaitReceivePort(IN HANDLE PortHandle, OUT PVOID *PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage OPTIONAL, OUT PPORT_MESSAGE ReceiveMessage)
Definition: reply.c:743
NTSTATUS NTAPI NtQueryInformationThread(_In_ HANDLE ThreadHandle, _In_ THREADINFOCLASS ThreadInformationClass, _Out_writes_bytes_to_opt_(ThreadInformationLength, *ReturnLength) PVOID ThreadInformation, _In_ ULONG ThreadInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:3017
NTSTATUS NTAPI NtSetInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _In_reads_bytes_(ProcessInformationLength) PVOID ProcessInformation, _In_ ULONG ProcessInformationLength)
Definition: query.c:1422
NTSTATUS NTAPI NtResumeThread(IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL)
Definition: state.c:290
#define STATUS_SUCCESS
Definition: shellext.h:65
NTSTATUS NTAPI SmSessionComplete(_In_ HANDLE SmApiPort, _In_ ULONG SessionId, _In_ NTSTATUS SessionStatus)
This function is called by an environment subsystem server to tell the SM it has terminated the sessi...
Definition: smclient.c:220
BOOLEAN(NTAPI * PSB_API_ROUTINE)(_In_ PSB_API_MSG SbApiMsg)
Definition: smmsg.h:265
@ SbpCreateSession
Definition: smmsg.h:146
@ SbpMaxApiNumber
Definition: smmsg.h:151
#define DPRINT
Definition: sndvol32.h:73
HANDLE UniqueThread
Definition: compat.h:826
HANDLE UniqueProcess
Definition: compat.h:825
ULONG SessionId
Definition: csrsrv.h:33
LIST_ENTRY SessionLink
Definition: csrsrv.h:32
ULONG ReferenceCount
Definition: csrsrv.h:31
ULONG SizeOfProcessData
Definition: csrsrv.h:234
ULONG Flags
Definition: csrsrv.h:72
LARGE_INTEGER CreateTime
Definition: csrsrv.h:65
HANDLE ThreadHandle
Definition: csrsrv.h:71
CLIENT_ID ClientId
Definition: csrsrv.h:68
LARGE_INTEGER CreateTime
Definition: winternl.h:2374
Definition: typedefs.h:120
CLIENT_ID ClientId
Definition: winternl.h:3337
NTSTATUS ReturnValue
Definition: smmsg.h:239
SB_API_NUMBER ApiNumber
Definition: smmsg.h:238
PORT_MESSAGE h
Definition: smmsg.h:232
HANDLE CsrApiPort
Definition: connect.c:27
PCSR_PROCESS NTAPI CsrAllocateProcess(VOID)
Definition: procsup.c:189
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 CsrInsertProcess(IN PCSR_PROCESS ParentProcess OPTIONAL, IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:366
HANDLE CsrSbApiPort
Definition: init.c:29
VOID NTAPI CsrDeallocateProcess(IN PCSR_PROCESS CsrProcess)
Definition: procsup.c:297
VOID NTAPI CsrDeallocateThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:345
HANDLE CsrSmApiPort
Definition: init.c:31
#define CSR_SERVER_DLL_MAX
Definition: api.h:34
PCSR_THREAD NTAPI CsrAllocateThread(IN PCSR_PROCESS CsrProcess)
Definition: thredsup.c:119
#define CsrAcquireProcessLock()
Definition: api.h:12
#define CsrAcquireNtSessionLock()
Definition: api.h:27
HANDLE CsrHeap
Definition: init.c:25
PCSR_SERVER_DLL CsrLoadedServerDll[CSR_SERVER_DLL_MAX]
Definition: server.c:20
#define CsrReleaseProcessLock()
Definition: api.h:15
#define CsrReleaseNtSessionLock()
Definition: api.h:30
BOOLEAN NTAPI CsrSbTerminateSession(IN PSB_API_MSG ApiMessage)
Definition: session.c:391
VOID NTAPI CsrReferenceNtSession(IN PCSR_NT_SESSION Session)
Definition: session.c:121
NTSTATUS NTAPI CsrSbApiHandleConnectionRequest(IN PSB_API_MSG Message)
Definition: session.c:437
NTSTATUS NTAPI CsrInitializeNtSessionList(VOID)
Definition: session.c:56
ULONG NTAPI CsrSbApiRequestThread(_In_ PVOID Parameter)
The CsrSbApiRequestThread routine handles incoming messages or connection requests on the SM API LPC ...
Definition: session.c:483
RTL_CRITICAL_SECTION CsrNtSessionLock
Definition: session.c:18
LIST_ENTRY CsrNtSessionList
Definition: session.c:19
BOOLEAN NTAPI CsrSbCreateProcess(IN PSB_API_MSG ApiMessage)
Definition: session.c:413
PCSR_NT_SESSION NTAPI CsrAllocateNtSession(IN ULONG SessionId)
Definition: session.c:80
BOOLEAN NTAPI CsrSbForeignSessionComplete(IN PSB_API_MSG ApiMessage)
Definition: session.c:368
const PSB_API_ROUTINE CsrServerSbApiDispatch[SbpMaxApiNumber - SbpCreateSession]
Definition: session.c:21
BOOLEAN NTAPI CsrSbCreateSession(IN PSB_API_MSG ApiMessage)
Definition: session.c:211
VOID NTAPI CsrDereferenceNtSession(IN PCSR_NT_SESSION Session, IN NTSTATUS ExitStatus)
Definition: session.c:159
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
PKPROCESS CsrProcess
Definition: videoprt.c:39
@ ProcessExceptionPort
Definition: winternl.h:1890
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336