Author: hbelusca
Date: Mon Dec 15 23:35:32 2014
New Revision: 65682
URL:
http://svn.reactos.org/svn/reactos?rev=65682&view=rev
Log:
[CSR]
- Cleanup a bit csrmsg.h (by me), the ObjectDirectory member of the CSR_API_CONNECTINFO
structure becomes unused starting Windows 2k3 (add an informative comment about that
fact).
- Remove now unneeded ObjectDirectory duplication code (by Timo).
- Fix some whitespace.
CORE-7505 #comment ObjectDirectory duplication code removed in r65682.
Modified:
trunk/reactos/include/reactos/subsys/csr/csrmsg.h
trunk/reactos/subsystems/win32/csrsrv/api.c
trunk/reactos/subsystems/win32/csrsrv/api.h
trunk/reactos/subsystems/win32/csrsrv/status.h
trunk/reactos/subsystems/win32/csrsrv/wait.c
Modified: trunk/reactos/include/reactos/subsys/csr/csrmsg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
==============================================================================
--- trunk/reactos/include/reactos/subsys/csr/csrmsg.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/csr/csrmsg.h [iso-8859-1] Mon Dec 15 23:35:32
2014
@@ -46,18 +46,20 @@
typedef struct _CSR_API_CONNECTINFO
{
- HANDLE ObjectDirectory;
- PVOID SharedSectionBase;
- PVOID SharedStaticServerData;
- PVOID SharedSectionHeap;
- ULONG DebugFlags;
- ULONG SizeOfPebData;
- ULONG SizeOfTebData;
- ULONG NumberOfServerDllNames;
+ HANDLE ObjectDirectory; // Unused on Windows >= 2k3
+ PVOID SharedSectionBase;
+ PVOID SharedStaticServerData;
+ PVOID SharedSectionHeap;
+ ULONG DebugFlags;
+ ULONG SizeOfPebData;
+ ULONG SizeOfTebData;
+ ULONG NumberOfServerDllNames;
HANDLE ServerProcessId;
} CSR_API_CONNECTINFO, *PCSR_API_CONNECTINFO;
-#define CSRSRV_VERSION 0x10000
+#if defined(_M_IX86)
+C_ASSERT(sizeof(CSR_API_CONNECTINFO) == 0x24);
+#endif
// We must have a size at most equal to the maximum acceptable LPC data size.
C_ASSERT(sizeof(CSR_API_CONNECTINFO) <= LPC_MAX_DATA_LENGTH);
Modified: trunk/reactos/subsystems/win32/csrsrv/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/ap…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/api.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/api.c [iso-8859-1] Mon Dec 15 23:35:32 2014
@@ -3,7 +3,7 @@
* PROJECT: ReactOS Client/Server Runtime SubSystem
* FILE: subsystems/win32/csrsrv/api.c
* PURPOSE: CSR Server DLL API LPC Implementation
- * "\windows\ApiPort" port process management functions
+ * "\Windows\ApiPort" port process management functions
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
*/
@@ -156,52 +156,28 @@
/* Check if we have a thread */
if (CsrThread)
{
- /* Get the Process */
+ /* Get the Process and make sure we have it as well */
CsrProcess = CsrThread->Process;
-
- /* Make sure we have a Process as well */
if (CsrProcess)
{
/* Reference the Process */
CsrLockedReferenceProcess(CsrProcess);
- /* Release the lock */
- CsrReleaseProcessLock();
-
- /* Duplicate the Object Directory */
- Status = NtDuplicateObject(NtCurrentProcess(),
- CsrObjectDirectory,
- CsrProcess->ProcessHandle,
- &ConnectInfo->ObjectDirectory,
- 0,
- 0,
- DUPLICATE_SAME_ACCESS |
- DUPLICATE_SAME_ATTRIBUTES);
-
- /* Acquire the lock */
- CsrAcquireProcessLock();
-
- /* Check for success */
+ /* Attach the Shared Section */
+ Status = CsrSrvAttachSharedSection(CsrProcess, ConnectInfo);
if (NT_SUCCESS(Status))
{
- /* Attach the Shared Section */
- Status = CsrSrvAttachSharedSection(CsrProcess, ConnectInfo);
-
- /* Check how this went */
- if (NT_SUCCESS(Status))
- {
- /* Allow the connection, and return debugging flag */
- ConnectInfo->DebugFlags = CsrDebug;
- AllowConnection = TRUE;
- }
- }
-
- /* Dereference the project */
+ /* Allow the connection and return debugging flag */
+ ConnectInfo->DebugFlags = CsrDebug;
+ AllowConnection = TRUE;
+ }
+
+ /* Dereference the Process */
CsrLockedDereferenceProcess(CsrProcess);
}
}
- /* Release the lock */
+ /* Release the Process Lock */
CsrReleaseProcessLock();
/* Setup the Port View Structure */
@@ -1067,7 +1043,7 @@
{
Connected = FALSE;
} _SEH2_END;
-
+
if (!Connected)
{
DPRINT1("CSRSS: CsrConnectToUser failed\n");
Modified: trunk/reactos/subsystems/win32/csrsrv/api.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/ap…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/api.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/api.h [iso-8859-1] Mon Dec 15 23:35:32 2014
@@ -191,7 +191,7 @@
IN PVOID WaitArgument2,
IN ULONG WaitFlags,
IN BOOLEAN DereferenceThread);
-
+
VOID
NTAPI
CsrReferenceNtSession(IN PCSR_NT_SESSION Session);
Modified: trunk/reactos/subsystems/win32/csrsrv/status.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/st…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/status.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/status.h [iso-8859-1] Mon Dec 15 23:35:32 2014
@@ -1,5 +1,5 @@
/*
- * CSRSRV Status
+ * CSRSRV Status
*/
/* Organization
@@ -14,7 +14,7 @@
* up the DosDevices Object Directory, and initializing each component.
*
* procsup.c - Handles all internal functions dealing with the CSR Process Object,
- * including de/allocation, de/referencing, un/locking, prority, and
+ * including de/allocation, de/referencing, un/locking, prority, and
* lookups. Also handles all external APIs which touch the CSR Process
Object.
*
* server.c - Handles all internal functions related to loading and managing Server
Modified: trunk/reactos/subsystems/win32/csrsrv/wait.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/wa…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/wait.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/wait.c [iso-8859-1] Mon Dec 15 23:35:32 2014
@@ -419,7 +419,7 @@
WaitArgument2,
0,
FALSE);
-
+
/*
* We've already done a wait, so leave unless
* we want to notify all the waits...