Commit e1d10572 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

rpcrt4: Use a helper to skip conformance.

parent 66c05a45
...@@ -440,6 +440,11 @@ static inline BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat) ...@@ -440,6 +440,11 @@ static inline BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
return (*(const ULONG *)pFormat != -1); return (*(const ULONG *)pFormat != -1);
} }
static inline PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
{
return pStubMsg->fHasNewCorrDesc ? pFormat + 6 : pFormat + 4;
}
static PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) static PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
{ {
align_pointer(&pStubMsg->Buffer, 4); align_pointer(&pStubMsg->Buffer, 4);
...@@ -448,10 +453,7 @@ static PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRIN ...@@ -448,10 +453,7 @@ static PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRIN
pStubMsg->MaxCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer); pStubMsg->MaxCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
pStubMsg->Buffer += 4; pStubMsg->Buffer += 4;
TRACE("unmarshalled conformance is %ld\n", pStubMsg->MaxCount); TRACE("unmarshalled conformance is %ld\n", pStubMsg->MaxCount);
if (pStubMsg->fHasNewCorrDesc) return SkipConformance(pStubMsg, pFormat);
return pFormat+6;
else
return pFormat+4;
} }
static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, ULONG MaxValue) static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, ULONG MaxValue)
...@@ -483,10 +485,7 @@ static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_S ...@@ -483,10 +485,7 @@ static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_S
} }
done: done:
if (pStubMsg->fHasNewCorrDesc) return SkipConformance(pStubMsg, pFormat);
return pFormat+6;
else
return pFormat+4;
} }
/* writes the conformance value to the buffer */ /* writes the conformance value to the buffer */
...@@ -664,20 +663,8 @@ done_conf_grab: ...@@ -664,20 +663,8 @@ done_conf_grab:
finish_conf: finish_conf:
TRACE("resulting conformance is %ld\n", *pCount); TRACE("resulting conformance is %ld\n", *pCount);
if (pStubMsg->fHasNewCorrDesc)
return pFormat+6;
else
return pFormat+4;
}
static inline PFORMAT_STRING SkipConformance(PMIDL_STUB_MESSAGE pStubMsg, return SkipConformance(pStubMsg, pFormat);
PFORMAT_STRING pFormat)
{
if (pStubMsg->fHasNewCorrDesc)
pFormat += 6;
else
pFormat += 4;
return pFormat;
} }
static inline PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) static inline PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
...@@ -2785,11 +2772,7 @@ static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg, ...@@ -2785,11 +2772,7 @@ static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg,
} }
case RPC_FC_NON_ENCAPSULATED_UNION: case RPC_FC_NON_ENCAPSULATED_UNION:
pFormat += 2; pFormat += 2;
if (pStubMsg->fHasNewCorrDesc) pFormat = SkipConformance(pStubMsg, pFormat);
pFormat += 6;
else
pFormat += 4;
pFormat += *(const SHORT*)pFormat; pFormat += *(const SHORT*)pFormat;
return *(const SHORT*)pFormat; return *(const SHORT*)pFormat;
case RPC_FC_IP: case RPC_FC_IP:
...@@ -6186,10 +6169,7 @@ static LONG unmarshall_discriminant(PMIDL_STUB_MESSAGE pStubMsg, ...@@ -6186,10 +6169,7 @@ static LONG unmarshall_discriminant(PMIDL_STUB_MESSAGE pStubMsg,
} }
(*ppFormat)++; (*ppFormat)++;
if (pStubMsg->fHasNewCorrDesc) *ppFormat = SkipConformance(pStubMsg, *ppFormat);
*ppFormat += 6;
else
*ppFormat += 4;
return discriminant; return discriminant;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment