Ove Kaaven ovehk at
Sat Nov 16 15:46:03 CST 2002

On Sat, 16 Nov 2002, Jürgen Schmied wrote:

> Can you send a trace with -debugmsg +ole?

Is that necessary? I think this is a known problem.

> juergen
> On 13 Nov 2002 at 14:39, steve.lustbader at wrote:
> > One of the threads in my app calls CoInitialize, expecting it
> > to return S_OK (in fact, it's followed by an assert statement
> > requiring that it returns S_OK).  When I run it in Wine, however,
> > CoInitialize returns S_FALSE, implying that this thread has
> > already initialized the COM library.  Other threads call
> > CoInitialize, but this is the first time that this thread calls it.
> > Does Wine initialize COM differently from Windows?  Are the other
> > threads' calls to CoInitialize screwing up this thread's call?

Sort of, the problem is that Wine doesn't support apartments yet, so it
doesn't try to keep track of the threads that has called CoInitialize.

Code to support apartments was part of a large code drop (sent to
rewind-patches) a long time ago, along with a pile of rpcrt4 code, however
this apartment code was never merged into Wine, and the rpcrt4 pieces was
only merged recently when Greg Turner took an interest in it. And I don't
really expect that COM apartment code to get merged in before proper
interface marshalling (which is largely rpcrt4's job) is working either,
though I suppose the pieces that keep track of them (so that CoInitialize
gives the right return value) could be merged if someone wanted to.

More information about the wine-devel mailing list