mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
rpcrt4: Remove the BUFFER_PARANOIA overestimates for string memory sizes.
This commit is contained in:
parent
4c0b0e0069
commit
c27db4cde6
@ -43,8 +43,6 @@
|
|||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||||
|
|
||||||
#define BUFFER_PARANOIA 20
|
|
||||||
|
|
||||||
#if defined(__i386__)
|
#if defined(__i386__)
|
||||||
# define LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32) \
|
# define LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32) \
|
||||||
(*((UINT32 *)(pchar)) = (uint32))
|
(*((UINT32 *)(pchar)) = (uint32))
|
||||||
@ -581,12 +579,12 @@ void WINAPI NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
|
|||||||
if (*pFormat == RPC_FC_C_CSTRING) {
|
if (*pFormat == RPC_FC_C_CSTRING) {
|
||||||
/* we need + 1 octet for '\0' */
|
/* we need + 1 octet for '\0' */
|
||||||
TRACE("string=%s\n", debugstr_a((char*)pMemory));
|
TRACE("string=%s\n", debugstr_a((char*)pMemory));
|
||||||
pStubMsg->BufferLength += strlen((char*)pMemory) + 1 + BUFFER_PARANOIA;
|
pStubMsg->BufferLength += strlen((char*)pMemory) + 1;
|
||||||
}
|
}
|
||||||
else if (*pFormat == RPC_FC_C_WSTRING) {
|
else if (*pFormat == RPC_FC_C_WSTRING) {
|
||||||
/* we need + 2 octets for L'\0' */
|
/* we need + 2 octets for L'\0' */
|
||||||
TRACE("string=%s\n", debugstr_w((LPWSTR)pMemory));
|
TRACE("string=%s\n", debugstr_w((LPWSTR)pMemory));
|
||||||
pStubMsg->BufferLength += strlenW((LPWSTR)pMemory)*2 + 2 + BUFFER_PARANOIA;
|
pStubMsg->BufferLength += strlenW((LPWSTR)pMemory)*2 + 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ERR("Unhandled string type: %#x\n", *pFormat);
|
ERR("Unhandled string type: %#x\n", *pFormat);
|
||||||
@ -652,7 +650,7 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
|
|||||||
len = pStubMsg->ActualCount;
|
len = pStubMsg->ActualCount;
|
||||||
|
|
||||||
if (fMustAlloc || !*ppMemory)
|
if (fMustAlloc || !*ppMemory)
|
||||||
*ppMemory = NdrAllocate(pStubMsg, len*esize + BUFFER_PARANOIA);
|
*ppMemory = NdrAllocate(pStubMsg, len*esize);
|
||||||
|
|
||||||
memcpy(*ppMemory, pStubMsg->Buffer, len*esize);
|
memcpy(*ppMemory, pStubMsg->Buffer, len*esize);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user