From d7bac86452f91b210657c72debfbec86a51ce930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 20 Nov 2012 22:48:11 +0000 Subject: [PATCH] [NTDLL] When calling CsrClientConnectToServer with a valid connection info user buffer, after capturing the buffer and calling CsrClientCallServer, do not forget to copy back to the user buffer the updated connection info and to free the capture buffer ! svn path=/branches/ros-csrss/; revision=57743 --- dll/ntdll/csr/api.c | 1 + dll/ntdll/csr/capture.c | 1 + dll/ntdll/csr/connect.c | 12 +++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dll/ntdll/csr/api.c b/dll/ntdll/csr/api.c index 76de9c7b657..37a7b665c8b 100644 --- a/dll/ntdll/csr/api.c +++ b/dll/ntdll/csr/api.c @@ -13,6 +13,7 @@ #include /* GLOBALS ********************************************************************/ + extern HANDLE CsrApiPort; /* FUNCTIONS ******************************************************************/ diff --git a/dll/ntdll/csr/capture.c b/dll/ntdll/csr/capture.c index 71fa4414bf3..70a2b180279 100644 --- a/dll/ntdll/csr/capture.c +++ b/dll/ntdll/csr/capture.c @@ -13,6 +13,7 @@ #include /* GLOBALS ********************************************************************/ + extern HANDLE CsrPortHeap; /* FUNCTIONS ******************************************************************/ diff --git a/dll/ntdll/csr/connect.c b/dll/ntdll/csr/connect.c index b142e16f3f8..8a12194ce00 100644 --- a/dll/ntdll/csr/connect.c +++ b/dll/ntdll/csr/connect.c @@ -331,8 +331,9 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory, PCSR_CLIENT_CONNECT ClientConnect = &ApiMessage.Data.CsrClientConnect; PCSR_CAPTURE_BUFFER CaptureBuffer; - /* Validate the Connection Info */ DPRINT("CsrClientConnectToServer: %lx %p\n", ServerId, ConnectionInfo); + + /* Validate the Connection Info */ if (ConnectionInfo && (!ConnectionInfoSize || !*ConnectionInfoSize)) { DPRINT1("Connection info given, but no length\n"); @@ -428,6 +429,14 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory, CaptureBuffer, CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX, CsrpClientConnect), sizeof(CSR_CLIENT_CONNECT)); + + /* Copy the updated connection info data back into the user buffer */ + RtlMoveMemory(ConnectionInfo, + ClientConnect->ConnectionInfo, + *ConnectionInfoSize); + + /* Free the capture buffer */ + CsrFreeCaptureBuffer(CaptureBuffer); } else { @@ -438,6 +447,7 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory, /* Let the caller know if this was server to server */ DPRINT("Status was: 0x%lx. Are we in server: 0x%x\n", Status, InsideCsrProcess); if (ServerToServerCall) *ServerToServerCall = InsideCsrProcess; + return Status; }