[NTDLL]: Fix CsrpConnectToServer to use the correct CSR_API_CONNECTINFO structure.
authorAlex Ionescu <aionescu@gmail.com>
Thu, 29 Aug 2013 00:02:15 +0000 (00:02 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Thu, 29 Aug 2013 00:02:15 +0000 (00:02 +0000)
[CSRSRV]: Fix definition of CSR_API_CONNECTINFO structure. It is now compatible with Server 2003. Also, set the DebugFlag.

svn path=/trunk/; revision=59864

reactos/dll/ntdll/csr/connect.c
reactos/include/reactos/subsys/csr/csrmsg.h
reactos/subsystems/win32/csrsrv/api.c
reactos/subsystems/win32/csrsrv/server.c

index bf89f90..da2227e 100644 (file)
@@ -107,7 +107,7 @@ CsrpConnectToServer(IN PWSTR ObjectDirectory)
     SecurityQos.EffectiveOnly = TRUE;
 
     /* Setup the connection info */
-    ConnectionInfo.Version = CSRSRV_VERSION;
+    ConnectionInfo.DebugFlags = 0;
 
     /* Create a SID for us */
     Status = RtlAllocateAndInitializeSid(&NtSidAuthority,
@@ -153,12 +153,12 @@ CsrpConnectToServer(IN PWSTR ObjectDirectory)
                          (ULONG_PTR)LpcWrite.ViewBase;
 
     /* Save the Process */
-    CsrProcessId = ConnectionInfo.ProcessId;
+    CsrProcessId = ConnectionInfo.ServerProcessId;
 
     /* Save CSR Section data */
     NtCurrentPeb()->ReadOnlySharedMemoryBase = ConnectionInfo.SharedSectionBase;
     NtCurrentPeb()->ReadOnlySharedMemoryHeap = ConnectionInfo.SharedSectionHeap;
-    NtCurrentPeb()->ReadOnlyStaticServerData = ConnectionInfo.SharedSectionData;
+    NtCurrentPeb()->ReadOnlyStaticServerData = ConnectionInfo.SharedStaticServerData;
 
     /* Create the port heap */
     CsrPortHeap = RtlCreateHeap(0,
index 4d0be5f..24e1e77 100644 (file)
@@ -46,15 +46,15 @@ typedef ULONG CSR_API_NUMBER;
 
 typedef struct _CSR_API_CONNECTINFO
 {
-    ULONG Version;
-    ULONG Unknown;
     HANDLE ObjectDirectory;
     PVOID SharedSectionBase;
+    PVOID SharedStaticServerData;
     PVOID SharedSectionHeap;
-    PVOID SharedSectionData;
     ULONG DebugFlags;
-    ULONG Unknown2[3];
-    HANDLE ProcessId;
+    ULONG SizeOfPebData;
+    ULONG SizeOfTebData;
+    ULONG NumberOfServerDllNames;
+    HANDLE ServerProcessId;
 } CSR_API_CONNECTINFO, *PCSR_API_CONNECTINFO;
 
 #define CSRSRV_VERSION 0x10000
index 123f302..0d7e385 100644 (file)
@@ -180,7 +180,12 @@ CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
                 Status = CsrSrvAttachSharedSection(CsrProcess, ConnectInfo);
 
                 /* Check how this went */
-                if (NT_SUCCESS(Status)) AllowConnection = TRUE;
+                if (NT_SUCCESS(Status))
+                {
+                    /* Allow the connection, and return debugging flag */
+                    ConnectInfo->DebugFlags = CsrDebug;
+                    AllowConnection = TRUE;
+                }
             }
 
             /* Dereference the project */
@@ -197,7 +202,7 @@ CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
     RemotePortView.ViewBase = NULL;
 
     /* Save the Process ID */
-    ConnectInfo->ProcessId = NtCurrentTeb()->ClientId.UniqueProcess;
+    ConnectInfo->ServerProcessId = NtCurrentTeb()->ClientId.UniqueProcess;
 
     /* Accept the Connection */
     Status = NtAcceptConnectPort(&ServerPort,
index 668a0f4..5943d2a 100644 (file)
@@ -469,7 +469,7 @@ CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL,
     /* Write the values in the Connection Info structure */
     ConnectInfo->SharedSectionBase = CsrSrvSharedSectionBase;
     ConnectInfo->SharedSectionHeap = CsrSrvSharedSectionHeap;
-    ConnectInfo->SharedSectionData = CsrSrvSharedStaticServerData;
+    ConnectInfo->SharedStaticServerData = CsrSrvSharedStaticServerData;
 
     /* Return success */
     return STATUS_SUCCESS;