Ove Kaaven ovek at
Mon Mar 3 18:37:09 CST 2003

man, 2003-03-03 kl. 10:59 skrev Mike Hearn:
> > It is not implemented yet.
> > 
> > Should not be hard though. It belongs to OLE32 I guess.
> Yeah, it's in OLE32. To a COM newbie however, it looks positively scary
> - switching interfaces between threading contexts? Huh?

Yes, it might be a bit scary. The GIT is a pretty much a band-aid
solution for shortcomings in the other marshalling modes.

> Anyway, I've just been reading up on the whole
> apartment/threading/marshalling business. Just before I start though I'd
> like to check that this isn't part of the work TransGaming are doing on
> marshalling interfaces between threads as part of cleaning up
> InstallShield... can anybody comment on that? 

No, we haven't implemented this interface, though once the apartment
stuff is in, I can see two approaches to implementing this interface.
Note that the GIT object is a process-wide singleton (any instantiation
requests should return the same object every time).

- the GIT object could live in a particular apartment (e.g.
ThreadingModel=Free, so it lives in the MTA). Every instantiation
request would then marshal the interface to the requestor's thread. Then
the marshalling code for the GIT interface will also automatically take
care of the marshalling of the interface pointers to be registered and
retrieved. (This might need Wine's CoCreateInstance/CoGetClassObject to
check the threadingmodels, and I haven't implemented that myself.)

- the GIT object could be apartment-independent (use the Free-Threaded
Marshaler). Then RegisterInterface would manually use CoMarshalInterface
to table-marshal the interface, and GetInterface would manually
unmarshal it.

This won't make a difference before apartments are properly implemented
in Wine, though. The code I have now still does not work exactly like it
should (I implement IRemUnknown improperly, I still use midl instead of
widl to generate the marshalling code), it still crashes a lot, and I'm
too busy to clean it up for submission to Wine just yet (but in case
that worries people into thinking that it won't get into wine, people
hereby have my permission to lift my OLE stuff from winex if they want,
I just won't submit it all myself before working on it some more and).

More information about the wine-devel mailing list