Module: wine Branch: master Commit: 825a1b759579ed282148b2b3039e1376a53d688c URL: http://source.winehq.org/git/wine.git/?a=commit;h=825a1b759579ed282148b2b303...
Author: Huw Davies huw@codeweavers.com Date: Thu May 21 11:27:41 2009 +0100
ole32/tests: Use the current stream position to determine the marshal data size.
---
dlls/ole32/tests/usrmarshal.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/ole32/tests/usrmarshal.c b/dlls/ole32/tests/usrmarshal.c index ed18ac5..2b7103c 100644 --- a/dlls/ole32/tests/usrmarshal.c +++ b/dlls/ole32/tests/usrmarshal.c @@ -564,7 +564,8 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx) HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, 0); IStream *stm; void *marshal_data; - LARGE_INTEGER pos; + LARGE_INTEGER zero; + ULARGE_INTEGER pos; DWORD marshal_size;
/* shows that the WdtpInterfacePointer functions don't marshal anything for @@ -587,8 +588,11 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx)
CreateStreamOnHGlobal(h, TRUE, &stm); CoMarshalInterface(stm, &IID_IUnknown, unk, LOWORD(ctx), NULL, MSHLFLAGS_NORMAL); - marshal_size = GlobalSize(h); + zero.QuadPart = 0; + IStream_Seek(stm, zero, STREAM_SEEK_CUR, &pos); + marshal_size = pos.u.LowPart; marshal_data = GlobalLock(h); + trace("marshal_size %x\n", marshal_size);
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, umcb_ctx); size = WdtpInterfacePointer_UserSize(&umcb.Flags, ctx, 0, unk, &IID_IUnknown); @@ -608,8 +612,8 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx)
ok(!memcmp(marshal_data, wireip, marshal_size), "buffer mismatch\n"); GlobalUnlock(h); - pos.QuadPart = 0; - IStream_Seek(stm, pos, STREAM_SEEK_SET, NULL); + zero.QuadPart = 0; + IStream_Seek(stm, zero, STREAM_SEEK_SET, NULL); CoReleaseMarshalData(stm); IStream_Release(stm);