rpcrt4: Make NdrConformantStringUnmarshall use the new Read{Variance,Conformance}

functions and adapt them to be callable without having a correlation
descriptor.
This commit is contained in:
Robert Shearman 2006-05-13 16:58:31 +01:00 committed by Alexandre Julliard
parent a33a63712f
commit 4d65110b90
1 changed files with 6 additions and 7 deletions

View File

@ -320,7 +320,7 @@ PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pForm
static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
{
if (!IsConformanceOrVariancePresent(pFormat))
if (pFormat && !IsConformanceOrVariancePresent(pFormat))
{
pStubMsg->Offset = 0;
pStubMsg->ActualCount = pStubMsg->MaxCount;
@ -626,18 +626,15 @@ unsigned long WINAPI NdrConformantStringMemorySize( PMIDL_STUB_MESSAGE pStubMsg,
unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg,
unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc )
{
unsigned long len, esize, ofs;
unsigned long len, esize;
TRACE("(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)\n",
pStubMsg, *ppMemory, pFormat, fMustAlloc);
assert(pFormat && ppMemory && pStubMsg);
pStubMsg->Buffer += 4;
ofs = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
pStubMsg->Buffer += 4;
len = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
pStubMsg->Buffer += 4;
ReadConformance(pStubMsg, NULL);
ReadVariance(pStubMsg, NULL);
if (*pFormat == RPC_FC_C_CSTRING) esize = 1;
else if (*pFormat == RPC_FC_C_WSTRING) esize = 2;
@ -651,6 +648,8 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
FIXME("sized string format=%d\n", pFormat[1]);
}
len = pStubMsg->ActualCount;
if (fMustAlloc || !*ppMemory)
*ppMemory = NdrAllocate(pStubMsg, len*esize + BUFFER_PARANOIA);