http://bugs.winehq.org/show_bug.cgi?id=33749
Bug #: 33749 Summary: fix for "called from wrong apartment" bug in ClientRpcChannelBuffer_SendReceive Product: Wine Version: 1.6-rc1 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: ole32 AssignedTo: wine-bugs@winehq.org ReportedBy: rosen.diankov@gmail.com Classification: Unclassified
There are cases where the "called from wrong apartment" gets called in ole32/rpc.c:ClientRpcChannelBuffer_SendReceive and there is no COM apartment set.
Actually the thread should be using the implicit multithreaded apartment created from a previous thread's CoInitializeEx call
http://blogs.msdn.com/b/oldnewthing/archive/2013/04/19/10412399.aspx
Therefore the fix is really simple, add this check right in the beginning of ClientRpcChannelBuffer_SendReceive
if( !COM_CurrentApt() ) { apartment_joinmta(); }
Note that in Windows 7 and beyond, there's a new flag that controls the implicit MTA behavior called APTTYPEQUALIFIER.
http://msdn.microsoft.com/library/dd542638
Wine should support this for Windows 7 and beyond.