i2007-01-13 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Sat, 13 Jan 2007 07:05:49 +0000 (07:05 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 13 Jan 2007 07:05:49 +0000 (07:05 -0000)
* Add a few more missing helper classes.

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

mcs/class/corlib/Microsoft.Win32.SafeHandles/ChangeLog
mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs [new file with mode: 0644]
mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs [new file with mode: 0644]
mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs [new file with mode: 0644]
mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs
mcs/class/corlib/corlib.dll.sources

index 9434c0527ce09788737e9692f69621827111b553..be5fb1f5802afefefa803b1231e8b91f613f45a3 100644 (file)
@@ -1,3 +1,7 @@
+2007-01-13  Miguel de Icaza  <miguel@novell.com>
+
+       * Add a few more missing helper classes.
+
 2006-12-11  Miguel de Icaza  <miguel@novell.com>
 
        * SafeWaitHandle.cs: Add new.
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs
new file mode 100644 (file)
index 0000000..401fc75
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// Microsoft.Win32.SafeHandles.CriticalHandleMinusOneIsInvalid
+//
+// Author
+//      Zoltan Varga (vargaz@gmail.com)
+//       Miguel de Icaza (miguel@novell.com)
+//
+// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32.SafeHandles {
+
+       public abstract class CriticalHandleMinusOneIsInvalid : CriticalHandle, IDisposable {
+               protected CriticalHandleMinusOneIsInvalid () : base ((IntPtr) (-1)) {
+               }
+
+               public override bool IsInvalid {
+                       get {
+                               return handle == (IntPtr)(-1);
+                       }
+               }
+       }
+}
+
+#endif
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs
new file mode 100644 (file)
index 0000000..f572fd3
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// Microsoft.Win32.SafeHandles.CriticalHandleZeroOrMinusOneIsInvalid
+//
+// Author
+//      Zoltan Varga (vargaz@gmail.com)
+//       Miguel de Icaza (miguel@novell.com)
+//
+// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32.SafeHandles {
+
+       public abstract class CriticalHandleZeroOrMinusOneIsInvalid : CriticalHandle, IDisposable {
+               protected CriticalHandleZeroOrMinusOneIsInvalid () : base ((IntPtr) (-1)) {
+               }
+
+               public override bool IsInvalid {
+                       get {
+                               return handle == (IntPtr)(-1) || handle == IntPtr.Zero;
+                       }
+               }
+       }
+}
+
+#endif
diff --git a/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs b/mcs/class/corlib/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs
new file mode 100644 (file)
index 0000000..8db7225
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// Microsoft.Win32.SafeHandles.SafeHandleMinusOneIsInvalid
+//
+// Author
+//      Zoltan Varga (vargaz@gmail.com)
+//       Miguel de Icaza (miguel@novell.com)
+//
+// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32.SafeHandles {
+
+       public abstract class SafeHandleMinusOneIsInvalid : SafeHandle, IDisposable {
+               protected SafeHandleMinusOneIsInvalid (bool ownsHandle) : base ((IntPtr) 0, ownsHandle) {
+               }
+
+               public override bool IsInvalid {
+                       get {
+                               return handle == (IntPtr)(-1);
+                       }
+               }
+       }
+}
+
+#endif
index d2da68db46a19a0879f178c7ec915b2ba1e84d25..a22dbf1b6cf28a649baf80bd391484ceb002bf4c 100644 (file)
@@ -33,7 +33,6 @@ using System.Runtime.InteropServices;
 
 namespace Microsoft.Win32.SafeHandles {
 
-       [MonoTODO ("Not implemented on Mono")]
        public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle, IDisposable {
                protected SafeHandleZeroOrMinusOneIsInvalid (bool ownsHandle) : base ((IntPtr) 0, ownsHandle) {
                }
index b776842bafeda09194319577c80c6dc9f38ef3a7..14268c1560876fae6ef5c8eb49e596c50e521210 100644 (file)
@@ -10,7 +10,10 @@ Microsoft.Win32/RegistryValueOptions.cs
 Microsoft.Win32/UnixRegistryApi.cs
 Microsoft.Win32/Win32RegistryApi.cs
 Microsoft.Win32/Win32ResultCode.cs
+Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs
+Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs
 Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs
+Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs
 Microsoft.Win32.SafeHandles/SafeFileHandle.cs
 Microsoft.Win32.SafeHandles/SafeWaitHandle.cs
 Mono.Globalization.Unicode/CodePointIndexer.cs