[PATCH v2 3/5] d2d1: Implement property parsing for RegisterEffectFromStream().

Nikolay Sivov nsivov at codeweavers.com
Mon Jun 13 02:40:30 CDT 2022



On 6/13/22 09:55, Ziqing Hui wrote:
>
> On 6/12/22 4:34 PM, Nikolay Sivov wrote:
>>
>> On 6/12/22 08:31, Ziqing Hui wrote:
>>> +    if (!wcscmp(name, L"DisplayName")
>>> +        || !wcscmp(name, L"Author")
>>> +        || !wcscmp(name, L"Category")
>>> +        || !wcscmp(name, L"Description"))
>>> +    {
>>> +        if (type != D2D1_PROPERTY_TYPE_STRING)
>>> +            return E_INVALIDARG;
>>> +        ++reg->system_property_count;
>>> +    }
>> That's not going to work for nested properties, that likely can have same names as system ones.
>>
> Does "nested properties" means sub properties? If it does, I think it's OK because sub properties is ignored. My plan is to ignore sub properties unless we really need them in effect implementation.
>
> So at least for now add_property() will only be called for top level properties.

I understand that, and it's fine to ignore them. But alternative way to 
test for required properties is simply to check if they were added once 
you parsed everything, instead of counting them. By checking I mean to 
look them up by names in registration structure after xml document was 
processed.

>
>
>>> +        if (j > entry->property_count)
>>> +        {
>>> +            hr = D2DERR_INVALID_PROPERTY;
>>> +            goto done;
>>> +        }
>> Should it be j == entry->property_count ?
>>




More information about the wine-devel mailing list