Commit 76e7f030 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

oleaut32: Allocate a full pointer when unmarshalling byref arrays.

Instead of the 4 bytes array wire size returned by get_type_size, which will truncate the pointer on 64-bit. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54562
parent 3e82dc30
...@@ -1514,7 +1514,6 @@ static void test_marshal_VARIANT(void) ...@@ -1514,7 +1514,6 @@ static void test_marshal_VARIANT(void)
SafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); SafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2);
ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); ok(vt == vt2, "array vts differ %x %x\n", vt, vt2);
size = IMalloc_GetSize(allocator, V_BYREF(&v2)); size = IMalloc_GetSize(allocator, V_BYREF(&v2));
todo_wine_if(sizeof(void *) == 8)
ok(size == sizeof(V_ARRAY(&v2)), "got size %#Ix\n", size); ok(size == sizeof(V_ARRAY(&v2)), "got size %#Ix\n", size);
VARIANT_UserFree(&umcb.Flags, &v2); VARIANT_UserFree(&umcb.Flags, &v2);
HeapFree(GetProcessHeap(), 0, oldbuffer); HeapFree(GetProcessHeap(), 0, oldbuffer);
......
...@@ -506,7 +506,10 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffe ...@@ -506,7 +506,10 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffe
ULONG mem_size; ULONG mem_size;
Pos += 4; Pos += 4;
switch (header->vt & ~VT_BYREF) /* byref array needs to allocate a SAFEARRAY pointer */
if (header->vt & VT_ARRAY)
mem_size = sizeof(void *);
else switch (header->vt & ~VT_BYREF)
{ {
/* these types have a different memory size compared to wire size */ /* these types have a different memory size compared to wire size */
case VT_UNKNOWN: case VT_UNKNOWN:
......
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