copied mono-api-diff.cs from mono-2-2 branch so new patch can be applied and history...
[mono.git] / mcs / class / corlib / System.IO / DirectoryInfo.cs
index f9f318356c9b766bc6e42f4af0fc2beb5c03487e..0e214a0486f59126ce27d8531cabea5803ed07ac 100644 (file)
@@ -35,6 +35,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
+using System.Security;
 using System.Text;
 #if !MOONLIGHT
 using System.Security.AccessControl;
@@ -62,6 +63,8 @@ namespace System.IO {
                {
                        CheckPath (path);
 
+                       SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
+
                        FullPath = Path.GetFullPath (path);
                        if (simpleOriginalPath)
                                OriginalPath = Path.GetFileName (path);
@@ -437,7 +440,7 @@ namespace System.IO {
                        FileAttributes rattr;
                        bool subdirs = searchOption == SearchOption.AllDirectories;
 
-                       Directory.ValidatePath (full); // required for Moonlight, nop-op otherwise
+                       Path.Validate (full);
                        
                        string s = MonoIO.FindFirst (full, path_with_pattern, out rattr, out error, out handle);
                        if (s == null)