Huw Davies : rpcrt4: Implement NdrSimpleType{Marshall,Unmarshall}.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jan 24 06:18:09 CST 2007
Module: wine
Branch: master
Commit: e3abd2b3ff140e4ec43fb6b3f95ce045643b6ea9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e3abd2b3ff140e4ec43fb6b3f95ce045643b6ea9
Author: Huw Davies <huw at codeweavers.com>
Date: Tue Jan 23 11:50:06 2007 +0000
rpcrt4: Implement NdrSimpleType{Marshall,Unmarshall}.
---
dlls/rpcrt4/ndr_marshall.c | 4 ++--
dlls/rpcrt4/tests/ndr_marshall.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index f5aee76..3dc5265 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -1524,7 +1524,7 @@ void WINAPI NdrPointerFree(PMIDL_STUB_ME
void WINAPI NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
unsigned char FormatChar )
{
- FIXME("stub\n");
+ NdrBaseTypeMarshall(pStubMsg, pMemory, &FormatChar);
}
/***********************************************************************
@@ -1533,7 +1533,7 @@ void WINAPI NdrSimpleTypeMarshall( PMIDL
void WINAPI NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
unsigned char FormatChar )
{
- FIXME("stub\n");
+ NdrBaseTypeUnmarshall(pStubMsg, &pMemory, &FormatChar, 0);
}
/***********************************************************************
diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index 4a5566f..a1d8f5e 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -73,6 +73,42 @@ static const MIDL_STUB_DESC Object_StubD
};
+static void test_ndr_simple_type(void)
+{
+ RPC_MESSAGE RpcMessage;
+ MIDL_STUB_MESSAGE StubMsg;
+ MIDL_STUB_DESC StubDesc;
+ long l, l2 = 0;
+
+ StubDesc = Object_StubDesc;
+ StubDesc.pFormatTypes = NULL;
+
+ NdrClientInitializeNew(
+ &RpcMessage,
+ &StubMsg,
+ &StubDesc,
+ 0);
+
+ StubMsg.BufferLength = 16;
+ StubMsg.RpcMsg->Buffer = StubMsg.BufferStart = StubMsg.Buffer = HeapAlloc(GetProcessHeap(), 0, StubMsg.BufferLength);
+ l = 0xcafebabe;
+ NdrSimpleTypeMarshall(&StubMsg, (unsigned char*)&l, 8 /* FC_LONG */);
+ ok(StubMsg.Buffer == StubMsg.BufferStart + 4, "%p %p\n", StubMsg.Buffer, StubMsg.BufferStart);
+ ok(*(long*)StubMsg.BufferStart == l, "%ld\n", *(long*)StubMsg.BufferStart);
+
+ StubMsg.Buffer = StubMsg.BufferStart + 1;
+ NdrSimpleTypeMarshall(&StubMsg, (unsigned char*)&l, 8 /* FC_LONG */);
+ ok(StubMsg.Buffer == StubMsg.BufferStart + 8, "%p %p\n", StubMsg.Buffer, StubMsg.BufferStart);
+ ok(*(long*)(StubMsg.BufferStart + 4) == l, "%ld\n", *(long*)StubMsg.BufferStart);
+
+ StubMsg.Buffer = StubMsg.BufferStart + 1;
+ NdrSimpleTypeUnmarshall(&StubMsg, (unsigned char*)&l2, 8 /* FC_LONG */);
+ ok(StubMsg.Buffer == StubMsg.BufferStart + 8, "%p %p\n", StubMsg.Buffer, StubMsg.BufferStart);
+ ok(l2 == l, "%ld\n", l2);
+
+ HeapFree(GetProcessHeap(), 0, StubMsg.BufferStart);
+}
+
static void test_pointer_marshal(const unsigned char *formattypes,
void *memsrc,
long srcsize,
@@ -950,6 +986,7 @@ todo_wine {
START_TEST( ndr_marshall )
{
+ test_ndr_simple_type();
test_simple_types();
test_simple_struct();
test_fullpointer_xlat();
More information about the wine-cvs
mailing list