0334f10b1d0d0fcb954324c373b5f523522daed3
[reactos.git] / win32ss / user / ntuser / csr.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Interface to csrss
5 * FILE: subsys/win32k/ntuser/csr.c
6 * PROGRAMER: Ge van Geldorp (ge@gse.nl)
7 */
8
9 #include <win32k.h>
10 DBG_DEFAULT_CHANNEL(UserMisc);
11
12 static HANDLE WindowsApiPort = NULL;
13 PEPROCESS CsrProcess = NULL;
14
15 NTSTATUS FASTCALL
16 CsrInit(void)
17 {
18 NTSTATUS Status;
19 UNICODE_STRING PortName;
20 ULONG ConnectInfoLength;
21 SECURITY_QUALITY_OF_SERVICE Qos;
22
23 ERR("CsrInit\n");
24
25 RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
26 ConnectInfoLength = 0;
27 Qos.Length = sizeof(Qos);
28 Qos.ImpersonationLevel = SecurityDelegation;
29 Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING;
30 Qos.EffectiveOnly = FALSE;
31
32 CsrProcess = PsGetCurrentProcess();
33 ERR("CsrInit - CsrProcess = 0x%p\n", CsrProcess);
34
35 Status = ZwConnectPort(&WindowsApiPort,
36 &PortName,
37 &Qos,
38 NULL,
39 NULL,
40 NULL,
41 NULL,
42 &ConnectInfoLength);
43 if (!NT_SUCCESS(Status))
44 {
45 ERR("CsrInit - Status = 0x%p\n", Status);
46 return Status;
47 }
48
49 return STATUS_SUCCESS;
50 }
51
52 /* EOF */