Author: hbelusca
Date: Tue Dec 16 21:58:18 2014
New Revision: 65691
URL:
http://svn.reactos.org/svn/reactos?rev=65691&view=rev
Log:
[WIN32SS]: Push back csr code into win32k (not compiled yet). The thing is that win32k
uses a LPC port to communicate with winsrv.dll . But it's winsrv.dll that gives a
handle of the CSR port to win32k via a call to NtUserSetInformationThread with the
UserThreadCsrApiPort information class. See part of Timo's patch in CORE-7505 that
will be submitted later on. Also I need to somewhat stub the UserThreadCsrApiPort info
class in NtUserSetInformationThread :)
Added:
trunk/reactos/win32ss/user/ntuser/csr.c
- copied unchanged from r65683, trunk/reactos/deprecated/csr.c
trunk/reactos/win32ss/user/ntuser/csr.h
- copied unchanged from r65683, trunk/reactos/deprecated/csr.h
Removed:
trunk/reactos/deprecated/csr.c
trunk/reactos/deprecated/csr.h
Removed: trunk/reactos/deprecated/csr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/deprecated/csr.c?rev=65690
==============================================================================
--- trunk/reactos/deprecated/csr.c [iso-8859-1] (original)
+++ trunk/reactos/deprecated/csr.c (removed)
@@ -1,91 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Interface to csrss
- * FILE: subsys/win32k/ntuser/csr.c
- * PROGRAMER: Ge van Geldorp (ge(a)gse.nl)
- */
-
-#include <win32k.h>
-
-static HANDLE WindowsApiPort = NULL;
-PEPROCESS CsrProcess = NULL;
-
-NTSTATUS FASTCALL
-CsrInit(void)
-{
- NTSTATUS Status;
- UNICODE_STRING PortName;
- ULONG ConnectInfoLength;
- SECURITY_QUALITY_OF_SERVICE Qos;
-
- RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
- ConnectInfoLength = 0;
- Qos.Length = sizeof(Qos);
- Qos.ImpersonationLevel = SecurityDelegation;
- Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING;
- Qos.EffectiveOnly = FALSE;
-
- Status = ZwConnectPort(&WindowsApiPort,
- &PortName,
- &Qos,
- NULL,
- NULL,
- NULL,
- NULL,
- &ConnectInfoLength);
- if (! NT_SUCCESS(Status))
- {
- return Status;
- }
-
- CsrProcess = PsGetCurrentProcess();
-
- return STATUS_SUCCESS;
-}
-
-
-NTSTATUS FASTCALL
-co_CsrNotify(PCSR_API_MESSAGE Request)
-{
- NTSTATUS Status;
- PEPROCESS OldProcess;
-
- if (NULL == CsrProcess)
- {
- return STATUS_INVALID_PORT_HANDLE;
- }
-
- Request->Header.u2.ZeroInit = 0;
- Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
- Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
-
- /* Switch to the process in which the WindowsApiPort handle is valid */
- OldProcess = PsGetCurrentProcess();
- if (CsrProcess != OldProcess)
- {
- KeAttachProcess(&CsrProcess->Pcb);
- }
-
- UserLeaveCo();
-
- Status = ZwRequestWaitReplyPort(WindowsApiPort,
- &Request->Header,
- &Request->Header);
-
- UserEnterCo();
-
- if (CsrProcess != OldProcess)
- {
- KeDetachProcess();
- }
-
- if (NT_SUCCESS(Status))
- {
- Status = Request->Status;
- }
-
- return Status;
-}
-
-/* EOF */
Removed: trunk/reactos/deprecated/csr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/deprecated/csr.h?rev=65690
==============================================================================
--- trunk/reactos/deprecated/csr.h [iso-8859-1] (original)
+++ trunk/reactos/deprecated/csr.h (removed)
@@ -1,20 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Interface to csrss
- * FILE: subsys/win32k/include/csr.h
- * PROGRAMER: Ge van Geldorp (ge(a)gse.nl)
- */
-
-#pragma once
-
-extern PEPROCESS CsrProcess;
-
-NTSTATUS FASTCALL CsrInit(void);
-NTSTATUS FASTCALL co_CsrNotify(PCSR_API_MESSAGE Request);
-NTSTATUS FASTCALL CsrCloseHandle(HANDLE Handle);
-NTSTATUS WINAPI CsrInsertObject(HANDLE ObjectHandle,
- ACCESS_MASK DesiredAccess,
- PHANDLE Handle);
-
-/* EOF */