rpcrt4: Implement computing of conformance from a correlation descriptor for conformant strings.
This commit is contained in:
parent
124acc9b67
commit
4c0b0e0069
|
@ -530,19 +530,18 @@ finish_conf:
|
||||||
unsigned char *WINAPI NdrConformantStringMarshall(MIDL_STUB_MESSAGE *pStubMsg,
|
unsigned char *WINAPI NdrConformantStringMarshall(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
unsigned char *pszMessage, PFORMAT_STRING pFormat)
|
unsigned char *pszMessage, PFORMAT_STRING pFormat)
|
||||||
{
|
{
|
||||||
unsigned long len, esize;
|
unsigned long esize;
|
||||||
|
|
||||||
TRACE("(pStubMsg == ^%p, pszMessage == ^%p, pFormat == ^%p)\n", pStubMsg, pszMessage, pFormat);
|
TRACE("(pStubMsg == ^%p, pszMessage == ^%p, pFormat == ^%p)\n", pStubMsg, pszMessage, pFormat);
|
||||||
|
|
||||||
assert(pFormat);
|
|
||||||
if (*pFormat == RPC_FC_C_CSTRING) {
|
if (*pFormat == RPC_FC_C_CSTRING) {
|
||||||
TRACE("string=%s\n", debugstr_a((char*)pszMessage));
|
TRACE("string=%s\n", debugstr_a((char*)pszMessage));
|
||||||
len = strlen((char*)pszMessage)+1;
|
pStubMsg->ActualCount = strlen((char*)pszMessage)+1;
|
||||||
esize = 1;
|
esize = 1;
|
||||||
}
|
}
|
||||||
else if (*pFormat == RPC_FC_C_WSTRING) {
|
else if (*pFormat == RPC_FC_C_WSTRING) {
|
||||||
TRACE("string=%s\n", debugstr_w((LPWSTR)pszMessage));
|
TRACE("string=%s\n", debugstr_w((LPWSTR)pszMessage));
|
||||||
len = strlenW((LPWSTR)pszMessage)+1;
|
pStubMsg->ActualCount = strlenW((LPWSTR)pszMessage)+1;
|
||||||
esize = 2;
|
esize = 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -551,19 +550,16 @@ unsigned char *WINAPI NdrConformantStringMarshall(MIDL_STUB_MESSAGE *pStubMsg,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pFormat[1] != RPC_FC_PAD) {
|
if (pFormat[1] == RPC_FC_STRING_SIZED)
|
||||||
FIXME("sized string format=%d\n", pFormat[1]);
|
pFormat = ComputeConformance(pStubMsg, pszMessage, pFormat + 2, 0);
|
||||||
}
|
else
|
||||||
|
pStubMsg->MaxCount = pStubMsg->ActualCount;
|
||||||
assert( (pStubMsg->BufferLength >= (len*esize + 13)) && (pStubMsg->Buffer != NULL) );
|
|
||||||
|
|
||||||
pStubMsg->MaxCount = pStubMsg->ActualCount = len;
|
|
||||||
pStubMsg->Offset = 0;
|
pStubMsg->Offset = 0;
|
||||||
WriteConformance(pStubMsg);
|
WriteConformance(pStubMsg);
|
||||||
WriteVariance(pStubMsg);
|
WriteVariance(pStubMsg);
|
||||||
|
|
||||||
memcpy(pStubMsg->Buffer, pszMessage, len*esize); /* the string itself */
|
memcpy(pStubMsg->Buffer, pszMessage, pStubMsg->ActualCount*esize); /* the string itself */
|
||||||
pStubMsg->Buffer += len*esize;
|
pStubMsg->Buffer += pStubMsg->ActualCount*esize;
|
||||||
|
|
||||||
STD_OVERFLOW_CHECK(pStubMsg);
|
STD_OVERFLOW_CHECK(pStubMsg);
|
||||||
|
|
||||||
|
@ -582,7 +578,6 @@ void WINAPI NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
SizeConformance(pStubMsg);
|
SizeConformance(pStubMsg);
|
||||||
SizeVariance(pStubMsg);
|
SizeVariance(pStubMsg);
|
||||||
|
|
||||||
assert(pFormat);
|
|
||||||
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));
|
||||||
|
@ -597,10 +592,6 @@ void WINAPI NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
ERR("Unhandled string type: %#x\n", *pFormat);
|
ERR("Unhandled string type: %#x\n", *pFormat);
|
||||||
/* FIXME: raise an exception */
|
/* FIXME: raise an exception */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pFormat[1] != RPC_FC_PAD) {
|
|
||||||
FIXME("sized string format=%d\n", pFormat[1]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -658,10 +649,6 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
|
||||||
esize = 0;
|
esize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pFormat[1] != RPC_FC_PAD) {
|
|
||||||
FIXME("sized string format=%d\n", pFormat[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
len = pStubMsg->ActualCount;
|
len = pStubMsg->ActualCount;
|
||||||
|
|
||||||
if (fMustAlloc || !*ppMemory)
|
if (fMustAlloc || !*ppMemory)
|
||||||
|
|
Loading…
Reference in New Issue