Author: ekohl
Date: Sat May 18 19:19:27 2013
New Revision: 59038
URL:
http://svn.reactos.org/svn/reactos?rev=59038&view=rev
Log:
[RPCRT4]
Fix a bug that corrupted in-parameters when a remote function is called. If the
in-parameter is an array of UNICODE_STRINGS, the bug terminates all strings at the length
of the first string. For example, when LsaLookupNames is called in order to retrieve the
SIDs of the "Guest" and "Administrator" users, the remote function
received the strings "Guest" and "Admin".
The patch will be sent to the WINE project after a similar bug for out-parameters has been
fixed too.
Modified:
trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c
trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff
Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsh…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] Sat May 18 19:19:27 2013
@@ -1210,7 +1210,7 @@
unsigned char *bufptr = bufbase + *(const SHORT*)&info[2];
unsigned char *saved_memory = pStubMsg->Memory;
- pStubMsg->Memory = pMemory;
+ pStubMsg->Memory = membase;
PointerMarshall(pStubMsg, bufptr, *(unsigned char**)memptr, info+4);
pStubMsg->Memory = saved_memory;
}
@@ -1362,7 +1362,7 @@
unsigned char *memptr = membase + *(const SHORT*)&info[0];
unsigned char *saved_memory = pStubMsg->Memory;
- pStubMsg->Memory = pMemory;
+ pStubMsg->Memory = membase;
PointerBufferSize(pStubMsg, *(unsigned char**)memptr, info+4);
pStubMsg->Memory = saved_memory;
}
Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4_ro…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpcrt4_ros.diff [iso-8859-1] Sat May 18 19:19:27 2013
@@ -15,6 +15,24 @@
===================================================================
--- ndr_marshall.c (working copy)
+++ ndr_marshall.c (working copy)
+@@ -1210,7 +1210,7 @@
+ unsigned char *bufptr = bufbase + *(const SHORT*)&info[2];
+ unsigned char *saved_memory = pStubMsg->Memory;
+
+- pStubMsg->Memory = pMemory;
++ pStubMsg->Memory = membase;
+ PointerMarshall(pStubMsg, bufptr, *(unsigned char**)memptr, info+4);
+ pStubMsg->Memory = saved_memory;
+ }
+@@ -1362,7 +1362,7 @@
+ unsigned char *memptr = membase + *(const SHORT*)&info[0];
+ unsigned char *saved_memory = pStubMsg->Memory;
+
+- pStubMsg->Memory = pMemory;
++ pStubMsg->Memory = membase;
+ PointerBufferSize(pStubMsg, *(unsigned char**)memptr, info+4);
+ pStubMsg->Memory = saved_memory;
+ }
@@ -6159,6 +6159,7 @@ static LONG unmarshall_discriminant(PMID
case RPC_FC_WCHAR:
case RPC_FC_SHORT: