Author: joncham
Date: 2007-05-11 16:43:30 -0400 (Fri, 11 May 2007)
New Revision: 77260

Modified:
   trunk/mcs/class/corlib/System/ChangeLog
   trunk/mcs/class/corlib/System/__ComObject.cs
Log:
2007-05-11  Jonathan Chambers  <[EMAIL PROTECTED]>

        * __ComObject.cs: No need to call CoInitialize anymore since
        Thread.ApartmentState was implemented.



Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog     2007-05-11 20:41:38 UTC (rev 
77259)
+++ trunk/mcs/class/corlib/System/ChangeLog     2007-05-11 20:43:30 UTC (rev 
77260)
@@ -1,3 +1,8 @@
+2007-05-11  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * __ComObject.cs: No need to call CoInitialize anymore since
+       Thread.ApartmentState was implemented.
+
 2007-05-11  Jeffrey Stedfast  <[EMAIL PROTECTED]>
 
        Fixes bug #81540

Modified: trunk/mcs/class/corlib/System/__ComObject.cs
===================================================================
--- trunk/mcs/class/corlib/System/__ComObject.cs        2007-05-11 20:41:38 UTC 
(rev 77259)
+++ trunk/mcs/class/corlib/System/__ComObject.cs        2007-05-11 20:43:30 UTC 
(rev 77260)
@@ -57,9 +57,6 @@
                IntPtr hash_table;
                #endregion
 
-               [ThreadStatic]
-               static bool coinitialized;
-
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                internal static extern __ComObject CreateRCW (Type t);
 
@@ -79,12 +76,6 @@
 
                public __ComObject ()
                {
-                       // call CoInitialize once per thread
-                       if (!coinitialized) {
-                               CoInitialize (IntPtr.Zero);
-                               coinitialized = true;
-                       }
-
                        Type t = GetType ();
                        int hr = CoCreateInstance (GetCLSID (t), IntPtr.Zero, 
0x1 | 0x4 | 0x10, IID_IUnknown, out iunknown);
                        Marshal.ThrowExceptionForHR (hr);
@@ -92,12 +83,6 @@
 
                internal __ComObject (Type t)
                {
-                       // call CoInitialize once per thread
-                       if (!coinitialized) {
-                               CoInitialize (IntPtr.Zero);
-                               coinitialized = true;
-                       }
-
                        int hr = CoCreateInstance (GetCLSID (t), IntPtr.Zero, 
0x1 | 0x4 | 0x10, IID_IUnknown, out iunknown);
                        Marshal.ThrowExceptionForHR (hr);
                }
@@ -203,9 +188,6 @@
                        return iunknown.ToInt32 ();
                }
 
-               [DllImport ("ole32.dll", CallingConvention = 
CallingConvention.StdCall)]
-               static extern int CoInitialize (IntPtr pvReserved);
-
                [DllImport ("ole32.dll", CallingConvention = 
CallingConvention.StdCall, ExactSpelling = true, PreserveSig = true)]
                static extern int CoCreateInstance (
                   [In, MarshalAs (UnmanagedType.LPStruct)] Guid rclsid,

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to