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.

svn path=/trunk/; revision=59038
This commit is contained in:
Eric Kohl 2013-05-18 19:19:27 +00:00
parent 6a814d763b
commit bbf97892df
2 changed files with 20 additions and 2 deletions

View file

@ -1210,7 +1210,7 @@ static unsigned char * EmbeddedPointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
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 @@ static void EmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
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;
}

View file

@ -15,6 +15,24 @@ Index: ndr_marshall.c
===================================================================
--- 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: