[PATCH 1/4] oleaut32: Add tests for safearray unmarshaling into passed variant

Piotr Caban piotr at codeweavers.com
Wed Jan 13 02:54:48 CST 2016


On 01/13/16 08:19, Dmitry Timoshkov wrote:
> Piotr Caban <piotr at codeweavers.com> wrote:
>
>>>> @@ -1316,11 +1316,19 @@ static void test_marshal_VARIANT(void)
>>>>        ok(*wirev, "wv[6] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */
>>>>        wirev++;
>>>>        check_safearray(wirev, lpsa);
>>>> -    VariantInit(&v2);
>>>> +    mem = CoTaskMemAlloc(1024);
>>>> +    lpsa_copy = lpsa2 = SafeArrayCreate(VT_I8, 1, &sab);
>>>> +    CoTaskMemFree(mem);
>>>> +    mem = lpsa2->pvData;
>>>> +    V_VT(&v2) = VT_UI4 | VT_ARRAY | VT_BYREF;
>>>> +    V_ARRAYREF(&v2) = &lpsa2;
>>>
>>> Looks like the result of CoTaskMemAlloc/CoTaskMemFree is not used.
>> I've added it intentionally so there's a bigger chance a different
>> memory is allocated if safe array is reallocated (I'm trying to show
>> that memory is reused without freeing and allocating it again). Of
>> course there's no guarantee for that. I can remove it if it's preferable.
>
> I'd suggest to add a comment about this so that noone would try to remove
> "dead code".
I've sent a fixed version of the patch. I have added FADF_STATIC feature 
and removed no longer needed CoTaskMemAlloc call.

Thanks,
Piotr




More information about the wine-devel mailing list