rob at codeweavers.com
Wed Jan 26 08:47:35 CST 2005
Oliver Stieber wrote:
>I've had to generate some GUIDs for wined3d is there a
>wine policy on internal GUIDs or should the ones I've
>generated be ok.
How did you generate them?
>secondly, nothing to do with GUIDS, what's the 'best'
>thread safe IUnknown enumerate to use for storing a
>heap of unique elements that will be searched for by
>the IUnknown pointer as well as emerated.
>It would be usefull if the enumerate didn't reference
>count because I may also need to use a call back or
>sorts so that when the ref count of the IUnknown gets
>to zero it's release can tell the enumerate to remove
>it from the list.
Ok, it sounds like you need random removal of objects, so using the list
implementation in include/wine/list.h would probably be best.
Put any code accessing the list in a critical section and it will be
safe. If you want the objects to remove themselves from the list when
they are destroyed, then you will have to add a reference to them so
that you can use them outside the critical section. Also, you will have
to put the adding/releasing references code in a critical section to
ensure that there is no race between the refcount going to 0 and the
object being removed from the list. Mike and I had to implement
something similar to this for the stub manager in
dlls/ole32/stubmanager.c so it may be worth having a look at it.
More information about the wine-devel