[w32file] Move MonoIO.Find{First,Next,Close} to managed
[mono.git] / mcs / class / corlib / System.IO / MonoIO.cs
index 7297e18d7a2b308ba5b500b812e3a6ca1d79a2c3..38c8cf3de735623fa52e6cd144ae626ceaed1fe7 100644 (file)
@@ -155,6 +155,10 @@ namespace System.IO
                        case MonoIOError.ERROR_NOT_SAME_DEVICE:
                                message = "Source and destination are not on the same device";
                                return new IOException (message, unchecked((int)0x80070000) | (int)error);
+
+                       case MonoIOError.ERROR_DIRECTORY:
+                               message = "The directory name is invalid";
+                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
                                
                        default:
                                message = String.Format ("Win32 IO returned {0}. Path: {1}", error, path);
@@ -170,9 +174,6 @@ namespace System.IO
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static bool RemoveDirectory (string path, out MonoIOError error);
 
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static string [] GetFileSystemEntries (string path, string path_with_pattern, int attrs, int mask, out MonoIOError error);
-
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static string GetCurrentDirectory (out MonoIOError error);
 
@@ -225,15 +226,16 @@ namespace System.IO
                //
                // Find file methods
                //
+
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static string FindFirst (string path, string pattern, out FileAttributes result_attr, out MonoIOError error, out IntPtr handle);
-               
+               public extern static IntPtr FindFirstFile (string path_with_pattern, out string fileName, out int fileAttr, out int error);
+
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static string FindNext (IntPtr handle, out FileAttributes result_attr, out MonoIOError error);
-               
+               public extern static bool FindNextFile (IntPtr hnd, out string fileName, out int fileAttr, out int error);
+
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static int FindClose (IntPtr handle);
-               
+               public extern static bool FindCloseFile (IntPtr hnd);
+
                public static bool Exists (string path, out MonoIOError error)
                {
                        FileAttributes attrs = GetFileAttributes (path,