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
This commit is contained in:
Rémi Bernon 2023-02-23 15:01:21 +01:00 committed by Alexandre Julliard
parent 3e82dc30e2
commit 76e7f030fe
2 changed files with 4 additions and 2 deletions

View file

@ -1514,7 +1514,6 @@ static void test_marshal_VARIANT(void)
SafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2);
ok(vt == vt2, "array vts differ %x %x\n", vt, vt2);
size = IMalloc_GetSize(allocator, V_BYREF(&v2));
todo_wine_if(sizeof(void *) == 8)
ok(size == sizeof(V_ARRAY(&v2)), "got size %#Ix\n", size);
VARIANT_UserFree(&umcb.Flags, &v2);
HeapFree(GetProcessHeap(), 0, oldbuffer);

View file

@ -506,7 +506,10 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffe
ULONG mem_size;
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 */
case VT_UNKNOWN: