//
// Microsoft.Win32.SafeHandles.SafeFileHandle
//
-// Author
+// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
+// Miguel de Icaza <miguel@novell.com>
//
-// Copyright (C) 2005 Novell, Inc (http://www.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
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
-
using System;
+using System.IO;
namespace Microsoft.Win32.SafeHandles {
- [MonoTODO]
public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid {
-
public SafeFileHandle (IntPtr preexistingHandle, bool ownsHandle) : base (ownsHandle)
{
SetHandle (preexistingHandle);
}
- [MonoTODO]
- public override bool IsInvalid {
- get {
- throw new NotImplementedException ();
- }
+ // This is just for marshalling
+ internal SafeFileHandle () : base (true)
+ {
}
- [MonoTODO]
protected override bool ReleaseHandle ()
{
- throw new NotImplementedException ();
+ MonoIOError error;
+
+ MonoIO.Close (handle, out error);
+
+ return error == MonoIOError.ERROR_SUCCESS;
}
}
}
-#endif