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
#include <debug.h>
/* GLOBALS ********************************************************************/
#include <debug.h>
/* GLOBALS ********************************************************************/
extern HANDLE CsrApiPort;
/* FUNCTIONS ******************************************************************/
extern HANDLE CsrApiPort;
/* FUNCTIONS ******************************************************************/
#include <debug.h>
/* GLOBALS ********************************************************************/
#include <debug.h>
/* GLOBALS ********************************************************************/
extern HANDLE CsrPortHeap;
/* FUNCTIONS ******************************************************************/
extern HANDLE CsrPortHeap;
/* FUNCTIONS ******************************************************************/
PCSR_CLIENT_CONNECT ClientConnect = &ApiMessage.Data.CsrClientConnect;
PCSR_CAPTURE_BUFFER CaptureBuffer;
PCSR_CLIENT_CONNECT ClientConnect = &ApiMessage.Data.CsrClientConnect;
PCSR_CAPTURE_BUFFER CaptureBuffer;
- /* Validate the Connection Info */
DPRINT("CsrClientConnectToServer: %lx %p\n", ServerId, ConnectionInfo);
DPRINT("CsrClientConnectToServer: %lx %p\n", ServerId, ConnectionInfo);
+
+ /* Validate the Connection Info */
if (ConnectionInfo && (!ConnectionInfoSize || !*ConnectionInfoSize))
{
DPRINT1("Connection info given, but no length\n");
if (ConnectionInfo && (!ConnectionInfoSize || !*ConnectionInfoSize))
{
DPRINT1("Connection info given, but no length\n");
CaptureBuffer,
CSR_CREATE_API_NUMBER(CSRSRV_SERVERDLL_INDEX, CsrpClientConnect),
sizeof(CSR_CLIENT_CONNECT));
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);
/* 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;
/* 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;