Rob Shearman : rpcrt4: Implement NdrConformantStructFree.
Alexandre Julliard
julliard at winehq.org
Fri Dec 7 11:02:12 CST 2007
Module: wine
Branch: master
Commit: ba6aec70ca1d2e9c158dd23fc2fd738a1be5e6fb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ba6aec70ca1d2e9c158dd23fc2fd738a1be5e6fb
Author: Rob Shearman <rob at codeweavers.com>
Date: Thu Dec 6 14:06:02 2007 +0000
rpcrt4: Implement NdrConformantStructFree.
---
dlls/rpcrt4/ndr_marshall.c | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index d7da092..be18de8 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -3559,7 +3559,40 @@ void WINAPI NdrConformantStructFree(PMIDL_STUB_MESSAGE pStubMsg,
unsigned char *pMemory,
PFORMAT_STRING pFormat)
{
- FIXME("stub\n");
+ const NDR_CSTRUCT_FORMAT *pCStructFormat = (const NDR_CSTRUCT_FORMAT *)pFormat;
+ PFORMAT_STRING pCArrayFormat;
+ ULONG esize;
+
+ TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
+
+ pFormat += sizeof(NDR_CSTRUCT_FORMAT);
+ if ((pCStructFormat->type != RPC_FC_CPSTRUCT) && (pCStructFormat->type != RPC_FC_CSTRUCT))
+ {
+ ERR("invalid format type %x\n", pCStructFormat->type);
+ RpcRaiseException(RPC_S_INTERNAL_ERROR);
+ return;
+ }
+
+ pCArrayFormat = (const unsigned char *)&pCStructFormat->offset_to_array_description +
+ pCStructFormat->offset_to_array_description;
+ if (*pCArrayFormat != RPC_FC_CARRAY)
+ {
+ ERR("invalid array format type %x\n", pCStructFormat->type);
+ RpcRaiseException(RPC_S_INTERNAL_ERROR);
+ return;
+ }
+ esize = *(const WORD*)(pCArrayFormat+2);
+
+ ComputeConformance(pStubMsg, pMemory + pCStructFormat->memory_size,
+ pCArrayFormat + 4, 0);
+
+ TRACE("memory_size = %d\n", pCStructFormat->memory_size);
+
+ /* copy constant sized part of struct */
+ pStubMsg->BufferMark = pStubMsg->Buffer;
+
+ if (pCStructFormat->type == RPC_FC_CPSTRUCT)
+ EmbeddedPointerFree(pStubMsg, pMemory, pFormat);
}
/***********************************************************************
More information about the wine-cvs
mailing list