Implemented marshalling of pointers, simple and complex structures,

conformant and complex arrays, and user-marshalled types.
Improved marshalling of conformant strings and interface pointers a
bit.
This commit is contained in:
Ove Kaaven 2003-02-01 00:44:51 +00:00 committed by Alexandre Julliard
parent d11efe88b9
commit 0e85f48f9d
4 changed files with 1825 additions and 92 deletions

File diff suppressed because it is too large Load Diff

View File

@ -32,4 +32,19 @@ LONG_PTR RPCRT4_NdrClientCall2(PMIDL_STUB_DESC pStubDesc,
HRESULT RPCRT4_GetPSFactory(REFIID riid, struct IPSFactoryBuffer **ppPS);
PFORMAT_STRING ComputeConformance(MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pMemory,
PFORMAT_STRING pFormat, ULONG_PTR def);
typedef unsigned char* (WINAPI *NDR_MARSHALL) (PMIDL_STUB_MESSAGE, unsigned char*, PFORMAT_STRING);
typedef unsigned char* (WINAPI *NDR_UNMARSHALL)(PMIDL_STUB_MESSAGE, unsigned char**,PFORMAT_STRING, unsigned char);
typedef void (WINAPI *NDR_BUFFERSIZE)(PMIDL_STUB_MESSAGE, unsigned char*, PFORMAT_STRING);
typedef unsigned long (WINAPI *NDR_MEMORYSIZE)(PMIDL_STUB_MESSAGE, PFORMAT_STRING);
typedef void (WINAPI *NDR_FREE) (PMIDL_STUB_MESSAGE, unsigned char*, PFORMAT_STRING);
extern NDR_MARSHALL NdrMarshaller[];
extern NDR_UNMARSHALL NdrUnmarshaller[];
extern NDR_BUFFERSIZE NdrBufferSizer[];
extern NDR_MEMORYSIZE NdrMemorySizer[];
extern NDR_FREE NdrFreer[];
#endif /* __WINE_NDR_MISC_H */

View File

@ -36,7 +36,9 @@
#include "objbase.h"
#include "ndr_misc.h"
#include "rpcndr.h"
#include "wine/rpcfc.h"
#include "wine/debug.h"
@ -212,6 +214,21 @@ static LPSTREAM RpcStream_Create(PMIDL_STUB_MESSAGE pStubMsg, BOOL init)
return (LPSTREAM)This;
}
const IID* get_ip_iid(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
{
const IID *riid;
if (!pFormat) return &IID_IUnknown;
TRACE("format=%02x %02x\n", pFormat[0], pFormat[1]);
if (pFormat[0] != RPC_FC_IP) FIXME("format=%d\n", pFormat[0]);
if (pFormat[1] == RPC_FC_CONSTANT_IID)
return (const IID*)&pFormat[2];
ComputeConformance(pStubMsg, pMemory, pFormat+2, 0);
riid = (const IID *)pStubMsg->MaxCount;
if (!riid) riid = &IID_IUnknown;
return riid;
}
/***********************************************************************
* NdrInterfacePointerMarshall [RPCRT4.@]
*/
@ -219,12 +236,11 @@ unsigned char * WINAPI NdrInterfacePointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
unsigned char *pMemory,
PFORMAT_STRING pFormat)
{
const IID *riid = (const IID *)pStubMsg->MaxCount;
const IID *riid = get_ip_iid(pStubMsg, pMemory, pFormat);
LPSTREAM stream;
HRESULT hr;
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
if (!riid) riid = &IID_IUnknown;
pStubMsg->MaxCount = 0;
if (!LoadCOM()) return NULL;
stream = RpcStream_Create(pStubMsg, TRUE);
@ -262,12 +278,11 @@ void WINAPI NdrInterfacePointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned char *pMemory,
PFORMAT_STRING pFormat)
{
const IID *riid = (const IID *)pStubMsg->MaxCount;
const IID *riid = get_ip_iid(pStubMsg, pMemory, pFormat);
ULONG size = 0;
HRESULT hr;
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
if (!riid) riid = &IID_IUnknown;
if (!LoadCOM()) return;
hr = COM_GetMarshalSizeMax(&size, riid, (LPUNKNOWN)pMemory,
pStubMsg->dwDestContext, pStubMsg->pvDestContext,

View File

@ -222,7 +222,7 @@
@ stdcall NdrDllRegisterProxy(long ptr ptr) NdrDllRegisterProxy
@ stdcall NdrDllUnregisterProxy(long ptr ptr) NdrDllUnregisterProxy
@ stub NdrAllocate
@ stdcall NdrAllocate(ptr long) NdrAllocate
@ stub NdrAsyncClientCall
@ stub NdrAsyncServerCall
@ stub NdrClearOutParameters
@ -330,21 +330,21 @@
@ stub NdrByteCountPointerUnmarshall
@ stub NdrClientContextMarshall
@ stub NdrClientContextUnmarshall
@ stub NdrComplexArrayBufferSize
@ stub NdrComplexArrayFree
@ stub NdrComplexArrayMarshall
@ stub NdrComplexArrayMemorySize
@ stub NdrComplexArrayUnmarshall
@ stub NdrComplexStructBufferSize
@ stub NdrComplexStructFree
@ stub NdrComplexStructMarshall
@ stub NdrComplexStructMemorySize
@ stub NdrComplexStructUnmarshall
@ stub NdrConformantArrayBufferSize
@ stub NdrConformantArrayFree
@ stub NdrConformantArrayMarshall
@ stub NdrConformantArrayMemorySize
@ stub NdrConformantArrayUnmarshall
@ stdcall NdrComplexArrayBufferSize(ptr ptr ptr) NdrComplexArrayBufferSize
@ stdcall NdrComplexArrayFree(ptr ptr ptr) NdrComplexArrayFree
@ stdcall NdrComplexArrayMarshall(ptr ptr ptr) NdrComplexArrayMarshall
@ stdcall NdrComplexArrayMemorySize(ptr ptr) NdrComplexArrayMemorySize
@ stdcall NdrComplexArrayUnmarshall(ptr ptr ptr long) NdrComplexArrayUnmarshall
@ stdcall NdrComplexStructBufferSize(ptr ptr ptr) NdrComplexStructBufferSize
@ stdcall NdrComplexStructFree(ptr ptr ptr) NdrComplexStructFree
@ stdcall NdrComplexStructMarshall(ptr ptr ptr) NdrComplexStructMarshall
@ stdcall NdrComplexStructMemorySize(ptr ptr) NdrComplexStructMemorySize
@ stdcall NdrComplexStructUnmarshall(ptr ptr ptr long) NdrComplexStructUnmarshall
@ stdcall NdrConformantArrayBufferSize(ptr ptr ptr) NdrConformantArrayBufferSize
@ stdcall NdrConformantArrayFree(ptr ptr ptr) NdrConformantArrayFree
@ stdcall NdrConformantArrayMarshall(ptr ptr ptr) NdrConformantArrayMarshall
@ stdcall NdrConformantArrayMemorySize(ptr ptr) NdrConformantArrayMemorySize
@ stdcall NdrConformantArrayUnmarshall(ptr ptr ptr long) NdrConformantArrayUnmarshall
@ stdcall NdrConformantStringBufferSize(ptr ptr ptr) NdrConformantStringBufferSize
@ stdcall NdrConformantStringMarshall(ptr ptr ptr) NdrConformantStringMarshall
@ stdcall NdrConformantStringMemorySize(ptr ptr) NdrConformantStringMemorySize
@ -388,11 +388,11 @@
@ stub NdrNonEncapsulatedUnionMarshall
@ stub NdrNonEncapsulatedUnionMemorySize
@ stub NdrNonEncapsulatedUnionUnmarshall
@ stub NdrPointerBufferSize
@ stub NdrPointerFree
@ stub NdrPointerMarshall
@ stub NdrPointerMemorySize
@ stub NdrPointerUnmarshall
@ stdcall NdrPointerBufferSize(ptr ptr ptr) NdrPointerBufferSize
@ stdcall NdrPointerFree(ptr ptr ptr) NdrPointerFree
@ stdcall NdrPointerMarshall(ptr ptr ptr) NdrPointerMarshall
@ stdcall NdrPointerMemorySize(ptr ptr) NdrPointerMemorySize
@ stdcall NdrPointerUnmarshall(ptr ptr ptr long) NdrPointerUnmarshall
@ stub NdrServerContextMarshall
@ stub NdrServerContextUnmarshall
@ stub NdrServerContextNewMarshall # wxp
@ -404,19 +404,19 @@
@ stub NdrServerInitializeUnmarshall
@ stub NdrServerMarshall
@ stub NdrServerUnmarshall
@ stub NdrSimpleStructBufferSize
@ stub NdrSimpleStructFree
@ stub NdrSimpleStructMarshall
@ stub NdrSimpleStructMemorySize
@ stub NdrSimpleStructUnmarshall
@ stdcall NdrSimpleStructBufferSize(ptr ptr ptr) NdrSimpleStructBufferSize
@ stdcall NdrSimpleStructFree(ptr ptr ptr) NdrSimpleStructFree
@ stdcall NdrSimpleStructMarshall(ptr ptr ptr) NdrSimpleStructMarshall
@ stdcall NdrSimpleStructMemorySize(ptr ptr) NdrSimpleStructMemorySize
@ stdcall NdrSimpleStructUnmarshall(ptr ptr ptr long) NdrSimpleStructUnmarshall
@ stub NdrSimpleTypeMarshall
@ stub NdrSimpleTypeUnmarshall
@ stub NdrUserMarshalBufferSize
@ stub NdrUserMarshalFree
@ stub NdrUserMarshalMarshall
@ stub NdrUserMarshalMemorySize
@ stdcall NdrUserMarshalBufferSize(ptr ptr ptr) NdrUserMarshalBufferSize
@ stdcall NdrUserMarshalFree(ptr ptr ptr) NdrUserMarshalFree
@ stdcall NdrUserMarshalMarshall(ptr ptr ptr) NdrUserMarshalMarshall
@ stdcall NdrUserMarshalMemorySize(ptr ptr) NdrUserMarshalMemorySize
@ stub NdrUserMarshalSimpleTypeConvert
@ stub NdrUserMarshalUnmarshall
@ stdcall NdrUserMarshalUnmarshall(ptr ptr ptr long) NdrUserMarshalUnmarshall
@ stub NdrVaryingArrayBufferSize
@ stub NdrVaryingArrayFree
@ stub NdrVaryingArrayMarshall