+2006-01-05 Kornél Pál <kornelpal@hotmail.com>
+
+ * corlib.dll.sources: Added DriveNotFoundException.cs in System.IO.
+
2005-12-23 Dick Porter <dick@ximian.com>
* corlib.dll.sources: Added System.Security.AccessControl.MutexRights
* corlib.dll.sources: Added
System.Runtime.Serialization.Formatter.Binary.CodeGenerator.cs
-2004-02-10 Carlos Guzmán Álvarez <carlosga@telefonica.net>
+2004-02-10 Carlos Guzmán Álvarez <carlosga@telefonica.net>
* Mono.Security.Cryptography/PKCS1.cs:
* corlib_test.dll.sources: Added unit tests PaddingMode and X509
using CryptoAPI.
-2003-12-14 Pedro Martú\8bez Juli\81E <yoros@wanadoo.es>
+2003-12-14 Pedro Martínez Juliá <yoros@wanadoo.es>
* DateTime.cs: Be sure that the array access is not out of range
when looking for ArgumentOutOfRangeException in the year value.
* corlib.dll.sources: Added classes for Authenticode support.
* corlib_test.dll.sources: Added unit test for SPC certificates.
-2003-09-26 Pedro Martú\8bez Jul\81E <yoros@wanadoo.es>
+2003-09-26 Pedro Martínez Juliá <yoros@wanadoo.es>
* corlib_test.dll.sources: Remove tests that generate compile
errors. The tests are still there but its name is rmoved here.
* unix.args: Added System.Runtime.Remoting.Activation/AppDomainLevelActivator.cs
-2003-03-16 Pedro Martú\8bez Juli\81E <yoros@wanadoo.es>
+2003-03-16 Pedro Martínez Juliá <yoros@wanadoo.es>
* unix.args: Added "System.FloatingPointFormatter.cs".
* unix.args: Added
System.Runtime.InteropServices/HandleRef.cs
-2003-03-04 Pedro Martú\8bez Juli\81E <yoros@wanadoo.es>
+2003-03-04 Pedro Martínez Juliá <yoros@wanadoo.es>
* unix.args: Added "DoubleFormatter.cs" and "SingleFormatter.cs"
+2006-01-05 Kornél Pál <kornelpal@hotmail.com>
+
+ * DriveNotFoundException.cs: Added.
+ * MonoIO.cs: Added ERROR_INVALID_DRIVE handling. Pass HResult to
+ IOException constructors.
+ * MonoIOError.cs: Expose ERROR_INVALID_DRIVE.
+
2006-01-02 Sebastien Pouliot <sebastien@ximian.com>
* UnexceptionalStreamReader.cs: Re-implemented the Read method to fix
the new line handling when reading from the Console (bug #77108).
-2005-12-24 Kornél Pál <kornelpal@hotmail.com>
+2005-12-24 Kornél Pál <kornelpal@hotmail.com>
* FileStream.cs: Set buf_start to actual initial position when creating
FileStreams from handles.
--- /dev/null
+//
+// System.IO.DriveNotFoundException.cs
+//
+// Author:
+// Kornél Pál <http://www.kornelpal.hu/>
+//
+// Copyright (C) 2006 Kornél Pál
+//
+
+//
+// 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.Runtime.InteropServices;
+using System.Runtime.Serialization;
+
+namespace System.IO
+{
+ [Serializable]
+ [ComVisible (true)]
+ public class DriveNotFoundException : IOException
+ {
+ private const int ErrorCode = unchecked((int)0x80070003);
+
+ // Constructors
+ public DriveNotFoundException ()
+ : base ("Attempted to access a drive that is not available.")
+ {
+ this.HResult = ErrorCode;
+ }
+
+ public DriveNotFoundException (string message)
+ : base (message)
+ {
+ this.HResult = ErrorCode;
+ }
+
+ public DriveNotFoundException (string message, Exception inner)
+ : base (message, inner)
+ {
+ this.HResult = ErrorCode;
+ }
+
+ protected DriveNotFoundException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ }
+ }
+}
+#endif
path);
case MonoIOError.ERROR_TOO_MANY_OPEN_FILES:
- return new IOException ("Too many open files");
+ return new IOException ("Too many open files", unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_PATH_NOT_FOUND:
message = String.Format ("Could not find a part of the path \"{0}\"", path);
case MonoIOError.ERROR_INVALID_HANDLE:
message = String.Format ("Invalid handle to path \"{0}\"", path);
- return new IOException (message);
-
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
+ case MonoIOError.ERROR_INVALID_DRIVE:
+ message = String.Format ("Could not find the drive '{0}'. The drive might not be ready or might not be mapped.", path);
+#if NET_2_0
+ return new DriveNotFoundException (message);
+#else
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
+#endif
case MonoIOError.ERROR_FILE_EXISTS:
message = String.Format ("Could not create file \"{0}\". File already exists.", path);
- return new IOException (message);
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_FILENAME_EXCED_RANGE:
message = String.Format ("Path is too long. Path: {0}", path);
case MonoIOError.ERROR_INVALID_PARAMETER:
message = String.Format ("Invalid parameter");
- return new IOException (message);
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_WRITE_FAULT:
message = String.Format ("Write fault on path {0}", path);
- return new IOException (message);
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_SHARING_VIOLATION:
message = String.Format ("Sharing violation on path {0}", path);
- return new IOException (message);
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_LOCK_VIOLATION:
message = String.Format ("Lock violation on path {0}", path);
- return new IOException (message);
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_DIR_NOT_EMPTY:
message = String.Format ("Directory {0} is not empty", path);
- return new IOException (message);
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
default:
message = String.Format ("Win32 IO returned {0}. Path: {1}", error, path);
- return new IOException (message);
+ return new IOException (message, unchecked((int)0x80070000) | (int)error);
}
}
ERROR_INVALID_ACCESS = 12,\r
ERROR_INVALID_DATA = 13,\r
ERROR_OUTOFMEMORY = 14,\r
- ERROR_INVALID_DRIVE = 15,\r
- ERROR_CURRENT_DIRECTORY = 16,\r
+ */ ERROR_INVALID_DRIVE = 15,\r
+ /* ERROR_CURRENT_DIRECTORY = 16,\r
ERROR_NOT_SAME_DEVICE = 17,\r
*/ ERROR_NO_MORE_FILES = 18,\r
/* ERROR_WRITE_PROTECT = 19,\r
System.IO/Directory.cs
System.IO/DirectoryInfo.cs
System.IO/DirectoryNotFoundException.cs
+System.IO/DriveNotFoundException.cs
System.IO/EndOfStreamException.cs
System.IO/File.cs
System.IO/FileAccess.cs