Correction to COINIT_MULTITHREADED test

Bill Medland billmedland at mercuryspeed.com
Mon Jan 10 14:20:48 CST 2005


Bill Medland (billmedland at mercuryspeed.com)
Correct testing for multithreaded
(as spotted by Paul Vriens; fix suggested by Robert Shearman)

Index: wine/dlls/ole32/compobj.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/compobj.c,v
retrieving revision 1.121
diff -u -r1.121 compobj.c
--- wine/dlls/ole32/compobj.c	6 Jan 2005 19:39:07 -0000	1.121
+++ wine/dlls/ole32/compobj.c	10 Jan 2005 20:15:21 -0000
@@ -252,7 +252,8 @@
 
     if (!apt)
     {
-        if (model & COINIT_MULTITHREADED)
+        if ((model & (COINIT_MULTITHREADED|COINIT_APARTMENTTHREADED)) ==
+                COINIT_MULTITHREADED)
         {
             TRACE("thread 0x%lx is entering the multithreaded apartment\n", GetCurrentThreadId());
             COM_CurrentInfo()->apt = &MTA;
@@ -277,7 +278,8 @@
 
         /* we don't ref the apartment as CoInitializeEx will do it for us */
 
-        if (model & COINIT_APARTMENTTHREADED)
+        if ((model & (COINIT_MULTITHREADED|COINIT_APARTMENTTHREADED)) ==
+                COINIT_APARTMENTTHREADED)
         {
             /* FIXME: how does windoze create OXIDs? */
             apt->oxid = MTA.oxid | GetCurrentThreadId();
@@ -316,7 +318,7 @@
 
         MARSHAL_Disconnect_Proxies(apt);
 
-        if ((apt->model & COINIT_APARTMENTTHREADED) && apt->win) DestroyWindow(apt->win);
+        if (apt->win) DestroyWindow(apt->win);
 
         if (!list_empty(&apt->stubmgrs))
         {




More information about the wine-patches mailing list