[PATCH 1/2] oleaut32: Convert ITypeInfo implementation to use standard linked list

Andrew Eikum aeikum at codeweavers.com
Mon Dec 13 10:21:56 CST 2010


On 12/13/2010 10:03 AM, Alexandre Julliard wrote:
> Andrew Eikum<aeikum at codeweavers.com>  writes:
>>  An array would work, especially for the static structures that are
>>  used now, but these cleanup patches were made with the goal of merging
>>  the typelib-reading and typelib-creation interfaces in mind.
>>  Specifically, implementing the typelib-creation interfaces using the
>>  current data structures in typelib.c.  Given the function
>>  ICreateTypeLib::CreateTypeInfo(), a list seems more appropriate to me.
>
> If a list is really more appropriate for creation, then they shouldn't
> share the structure. The reading API is clearly index-based, a list
> isn't appropriate for that.

Typelib objects on Windows support both the reading and the creation 
interfaces.  I find it unlikely that they maintain two different 
structures depending on which interface is being used, as Wine currently 
(sort of) does.  I think the question is whether the structures should 
assist reading or creation.

Would you prefer using arrays in the structures?  This would obviously 
require reallocating space for the arrays and maintaining counts in the 
implementation of the creation interfaces.  This seems more error-prone 
to me, but you have a valid point about the API being built around indexes.



More information about the wine-devel mailing list