out-of-process COM design

Mike Hearn mh at codeweavers.com
Sat Dec 18 11:16:01 CST 2004


On Sat, 18 Dec 2004 08:45:46 -0800, Bill Medland wrote:
> 0018:trace:ole:CoMarshalInterface Using standard marshaling
> 0018:trace:ole:CoMarshalInterface Calling IMarshal::MarshalInterace
> 0018:trace:ole:StdMarshalImpl_MarshalInterface (...,{00000000-0000-0000-c000-000000000046},...)
> wine: Unhandled exception (thread 0018), starting debugger...
> Backtrace:
> =>1 0x40901a13 StdMarshalImpl_MarshalInterface+0xa3(iface=0x40247148, pStm=0x40247100, riid=0x42a84138, pv=0x42480180, dwDestContext=0x0, pvDestContext=0x0, mshlflags=0x0) [/home/cvswine/wine/dlls/ole32/compobj_private.h:180] in ole32 (0x42a83ff4)
>   2 0x40902b07 CoMarshalInterface+0x227(pStream=0x40247100, riid=0x42a84138, pUnk=0x42480180, dwDestContext=0x0, pvDestContext=0x0, mshlFlags=0x0) [/home/cvswine/wine/dlls/ole32/marshal.c:719] in ole32 (0x42a840a4)
>   3 0x40908cff CFStub_Invoke+0x2e3(iface=0x40246fe8, msg=0x42a84170, chanbuf=0x0) [/home/cvswine/wine/dlls/ole32/oleproxy.c:178] in ole32 (0x42a84154)
>   4 0x4090acf2 COM_InvokeAndRpcSend+0x92(req=0x40247088) [/home/cvswine/wine/dlls/ole32/rpc.c:346] in ole32 (0x42a841ac)
>   5 0x4090bc9f _StubReaderThread+0xab(param=0x40246e90) [/home/cvswine/wine/dlls/ole32/rpc.c:745] in ole32 (0x42a841c4)
>   6 0x40396593 THREAD_Start+0xef(ptr=0x40246f70) [/home/cvswine/wine/dlls/kernel/thread.c:107] in kernel32 (0x42a84298)

OK, the problem here is that the StubReaderThread is *also* not in an
 apartment. With my patch it does seem to be getting further though than
with the CoInitializeEx patch, it does actually connect and do an 
IClassFactory::CreateInstance. 

As a hack you can whack a CoInitializeEx at the start of _StubReaderThread
but it's wrong and will probably not work either.

I think we actually need to migrate the apt through the pipe registration
code so when PIPE_RegisterPipe starts the new thread, it can also join the
apartment which did the original registration. This is continuing the idea
of making all the implementation threads use the same apartment.

I'll talk with Rob about this, as we have some DCOM work still in mid-air.

thanks -mike




More information about the wine-devel mailing list