merge -r 58060:58217
[mono.git] / mcs / class / corlib / System.IO / MonoIO.cs
index cc62d6957e64d98fd88f38ebcb7f042b1bd8c386..0c46d07821839baafd4671948006d0c7948e39c6 100644 (file)
@@ -63,7 +63,7 @@ namespace System.IO
                                                                  path);
 
                        case MonoIOError.ERROR_TOO_MANY_OPEN_FILES:
-                               return new IOException ("Too many open files", unchecked((int)0x80070000) | (int)error);
+                               return new IOException ("Too many open files");
                                
                        case MonoIOError.ERROR_PATH_NOT_FOUND:
                                message = String.Format ("Could not find a part of the path \"{0}\"", path);
@@ -75,17 +75,11 @@ namespace System.IO
 
                        case MonoIOError.ERROR_INVALID_HANDLE:
                                message = String.Format ("Invalid handle to path \"{0}\"", path);
-                               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
+                               return new IOException (message);
+                               
                        case MonoIOError.ERROR_FILE_EXISTS:
                                message = String.Format ("Could not create file \"{0}\". File already exists.", path);
-                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
+                               return new IOException (message);
 
                        case MonoIOError.ERROR_FILENAME_EXCED_RANGE:
                                message = String.Format ("Path is too long. Path: {0}", path); 
@@ -93,27 +87,27 @@ namespace System.IO
 
                        case MonoIOError.ERROR_INVALID_PARAMETER:
                                message = String.Format ("Invalid parameter");
-                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
+                               return new IOException (message);
 
                        case MonoIOError.ERROR_WRITE_FAULT:
                                message = String.Format ("Write fault on path {0}", path);
-                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
+                               return new IOException (message);
 
                        case MonoIOError.ERROR_SHARING_VIOLATION:
                                message = String.Format ("Sharing violation on path {0}", path);
-                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
+                               return new IOException (message);
                                
                        case MonoIOError.ERROR_LOCK_VIOLATION:
                                message = String.Format ("Lock violation on path {0}", path);
-                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
+                               return new IOException (message);
 
                        case MonoIOError.ERROR_DIR_NOT_EMPTY:
                                message = String.Format ("Directory {0} is not empty", path);
-                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
+                               return new IOException (message);
                                
                        default:
                                message = String.Format ("Win32 IO returned {0}. Path: {1}", error, path);
-                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
+                               return new IOException (message);
                        }
                }
 
@@ -384,6 +378,11 @@ namespace System.IO
                        get;
                }
 
+               public extern static char [] InvalidPathChars {
+                       [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                       get;
+               }
+
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static int GetTempPath(out string path);
        }