Commit 47ae95cc authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

oleaut32: Fix the SAFEARRAY marshalling on 64-bit platforms.

The pointers should be written as NDR 4-byte fields instead of a platform-dependent size.
parent ce747f3f
......@@ -146,8 +146,8 @@ static void check_safearray(void *buffer, LPSAFEARRAY lpsa)
wiresa += sizeof(DWORD);
ok(*(DWORD *)wiresa == cell_count, "wiresa + 0x1c should be %u instead of %u\n", cell_count, *(DWORD *)wiresa);
wiresa += sizeof(DWORD);
ok(*(DWORD_PTR *)wiresa == (DWORD_PTR)lpsa->pvData, "wiresa + 0x20 should be lpsa->pvData instead of 0x%08lx\n", *(DWORD_PTR *)wiresa);
wiresa += sizeof(DWORD_PTR);
ok(*(DWORD *)wiresa, "wiresa + 0x20 should be non-zero instead of 0x%08x\n", *(DWORD *)wiresa);
wiresa += sizeof(DWORD);
if(sftype == SF_HAVEIID)
{
GUID guid;
......
......@@ -755,7 +755,7 @@ ULONG WINAPI LPSAFEARRAY_UserSize(ULONG *pFlags, ULONG StartingSize, LPSAFEARRAY
TRACE("("); dump_user_flags(pFlags); TRACE(", %d, %p\n", StartingSize, *ppsa);
ALIGN_LENGTH(size, 3);
size += sizeof(ULONG_PTR);
size += sizeof(ULONG);
if (*ppsa)
{
SAFEARRAY *psa = *ppsa;
......@@ -770,7 +770,7 @@ ULONG WINAPI LPSAFEARRAY_UserSize(ULONG *pFlags, ULONG StartingSize, LPSAFEARRAY
size += sizeof(ULONG);
size += sizeof(ULONG);
size += sizeof(ULONG_PTR);
size += sizeof(ULONG);
if (sftype == SF_HAVEIID)
size += sizeof(IID);
......@@ -843,8 +843,8 @@ unsigned char * WINAPI LPSAFEARRAY_UserMarshal(ULONG *pFlags, unsigned char *Buf
TRACE("("); dump_user_flags(pFlags); TRACE(", %p, &%p\n", Buffer, *ppsa);
ALIGN_POINTER(Buffer, 3);
*(ULONG_PTR *)Buffer = *ppsa ? TRUE : FALSE;
Buffer += sizeof(ULONG_PTR);
*(ULONG *)Buffer = *ppsa ? 0x1 : 0x0;
Buffer += sizeof(ULONG);
if (*ppsa)
{
VARTYPE vt;
......@@ -874,8 +874,8 @@ unsigned char * WINAPI LPSAFEARRAY_UserMarshal(ULONG *pFlags, unsigned char *Buf
*(ULONG *)Buffer = ulCellCount;
Buffer += sizeof(ULONG);
*(ULONG_PTR *)Buffer = (ULONG_PTR)psa->pvData;
Buffer += sizeof(ULONG_PTR);
*(ULONG *)Buffer = psa->pvData ? 0x2 : 0x0;
Buffer += sizeof(ULONG);
if (sftype == SF_HAVEIID)
{
SafeArrayGetIID(psa, &guid);
......@@ -958,7 +958,7 @@ unsigned char * WINAPI LPSAFEARRAY_UserMarshal(ULONG *pFlags, unsigned char *Buf
unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *Buffer, LPSAFEARRAY *ppsa)
{
ULONG_PTR ptr;
ULONG ptr;
wireSAFEARRAY wiresa;
ULONG cDims;
HRESULT hr;
......@@ -971,8 +971,8 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B
TRACE("("); dump_user_flags(pFlags); TRACE(", %p, %p\n", Buffer, ppsa);
ALIGN_POINTER(Buffer, 3);
ptr = *(ULONG_PTR *)Buffer;
Buffer += sizeof(ULONG_PTR);
ptr = *(ULONG *)Buffer;
Buffer += sizeof(ULONG);
if (!ptr)
{
......@@ -1001,8 +1001,8 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B
cell_count = *(ULONG *)Buffer;
Buffer += sizeof(ULONG);
ptr = *(ULONG_PTR *)Buffer;
Buffer += sizeof(ULONG_PTR);
ptr = *(ULONG *)Buffer;
Buffer += sizeof(ULONG);
if (sftype == SF_HAVEIID)
{
memcpy(&guid, Buffer, sizeof(guid));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment