A little more work of CorCompare work:
authorMiguel de Icaza <miguel@gnome.org>
Fri, 22 Dec 2006 01:05:58 +0000 (01:05 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 22 Dec 2006 01:05:58 +0000 (01:05 -0000)
2006-12-21  Miguel de Icaza  <miguel@novell.com>

* CriticalHandle.cs: Add Dispose(bool disposing) method, and
refactor.

svn path=/trunk/mcs/; revision=69920

mcs/class/corlib/System.Runtime.InteropServices/ArrayWithOffset.cs
mcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs
mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs
mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs

index 590e9ad00d76e7d5c6d9fc4b3457d307bc33d004..9e052bc7749d0401c7cc1ad8fd6fd28bbcabfe83 100644 (file)
@@ -54,6 +54,11 @@ namespace System.Runtime.InteropServices {
                        return (other.array == array && other.offset == offset);
                }
 
+               public bool Equals (ArrayWithOffset obj)
+               {
+                       return obj.array == array && obj.offset == offset;
+               }
+
                public override int GetHashCode ()
                {
                        return offset;
index 2572ca2a4402cc00c4968ffc5ee6e50e336814e0..6d333dc9dc313a7b9177ea46ff13b0fc4e3a1507 100644 (file)
@@ -33,7 +33,9 @@
 namespace System.Runtime.InteropServices
 {
        [Flags]
-       [Serializable]
+#if NET_2_0
+       [ComVisible(true)]
+#endif
        public enum AssemblyRegistrationFlags {
                None = 0,
                SetCodeBase,
index 4284d12e25eb1859b2406130f1a6119361a236c7..6aae6b190065cf138f36669386b6ed61132685c0 100644 (file)
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-
+using System;
 
 namespace System.Runtime.InteropServices {
 
-
-       /// <summary>
-       /// </summary>
+#if NET_2_0
+       [Serializable]
+#endif
        public enum CallingConvention {
-
-               /// <summary>
-               /// </summary>
                Winapi = 1,
-
-               /// <summary>
-               /// </summary>
                Cdecl = 2,
-
-               /// <summary>
-               /// </summary>
                StdCall = 3,
-
-               /// <summary>
-               /// </summary>
                ThisCall = 4,
-
-               /// <summary>
-               /// </summary>
                FastCall = 5,
-       } // CallingConvention
+       } 
 
 } // System.Runtime.InteropServices
index 8ec4421313db36eba0d4156d857bc49fa577958e..52558bc59621f66bf9118c3477f471b3f4b425c0 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-21  Miguel de Icaza  <miguel@novell.com>
+
+       * CriticalHandle.cs: Add Dispose(bool disposing) method, and
+       refactor. 
+
 2006-12-15  Gert Driesen  <drieseng@users.sourceforge.net>
 
        * Marshal.cs: Use SystemDefaultCharSize to determine whether to
index f88cc8cba3e8a8556e225d53306a56a6f64ea2cf..5a50f5f98c27208950b6697047c71291178f1604 100644 (file)
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-
+using System;
 
 namespace System.Runtime.InteropServices {
 
-
-       /// <summary>
-       /// </summary>
+#if NET_2_0
+       [Serializable]
+#endif
        public enum CharSet {
-
                None = 1,
-
-               /// <summary>
-               /// </summary>
                Ansi = 2,
-
-               /// <summary>
-               /// </summary>
                Unicode = 3,
-
-               /// <summary>
-               /// </summary>
                Auto = 4,
-       } // CharSet
+       } 
 
 } // System.Runtime.InteropServices
index 2f2574b3ae321057f4190fd732bc41c651038c5f..540fc3f96364e5c3cbf27e6dca74207d5412ed1c 100644 (file)
@@ -26,17 +26,22 @@ namespace System.Runtime.InteropServices
                [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
                ~CriticalHandle ()
                {
-                       Dispose ();
+                       Dispose (false);
                }
 
                [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
                public void Close ()
                {
-                       Dispose ();
+                       Dispose (true);
                }
 
                [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
                public void Dispose ()
+               {
+                       Dispose (true);
+               }
+
+               public void Dispose (bool disposing)
                {
                        if (_disposed)
                                return;
@@ -45,10 +50,12 @@ namespace System.Runtime.InteropServices
                        if (IsInvalid)
                                return;
 
-                       if (ReleaseHandle ()) {
-                               GC.SuppressFinalize (this);
-                       } else {
-                               // Failed in release...
+                       if (disposing == true){
+                               if (ReleaseHandle ()) {
+                                       GC.SuppressFinalize (this);
+                               } else {
+                                       // Failed in release...
+                               }
                        }
                }