예제 #1
0
        public static bool ContainsVolumes()
        {
            var vols = vFS.GetVolumes();

            foreach (var vol in vols)
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
        public static bool CheckVolumes()
        {
            var volumes = vFS.GetVolumes();

            foreach (var vol in volumes)
            {
                return(true);
            }
            return(false);
        }
 public static bool ContainsVolumes()
 {
     if (vFS.GetVolumes().Count == 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
예제 #4
0
 // get volumes
 public static List <Sys.FileSystem.Listing.DirectoryEntry> GetVolumes()
 {
     return(Driver.GetVolumes());
 }
예제 #5
0
        protected override void BeforeRun()
        {
            //Init the file system
            var fs = new CosmosVFS();

            VFSManager.RegisterVFS(fs);
            Console.Clear();

            //Find the location where we booted from
            string boot  = "";
            bool   frame = false;

            foreach (var item in fs.GetVolumes())
            {
                Console.WriteLine("Found volume: " + item.mFullPath);
                foreach (var d in Directory.GetDirectories(item.mFullPath))
                {
                    Console.WriteLine("dir: " + d);
                }
                foreach (var d in Directory.GetFiles(item.mFullPath))
                {
                    Console.WriteLine("file: " + d);
                }
                if (File.Exists(item.mFullPath + "TESTAPP.DLL") | File.Exists(item.mFullPath + "dotnetparser.exe"))
                {
                    Console.WriteLine("Found boot volume: " + item.mFullPath);
                    boot = item.mFullPath;
                }
                if (Directory.Exists(item.mFullPath + "framework"))
                {
                    frame = true;
                }
                else if (Directory.Exists(item.mFullPath + "FRAMEW"))
                {
                    frame = false;
                }
            }
            if (boot == "")
            {
                Console.WriteLine("Cannot find the media that we booted from.");
                return;
            }
            try
            {
                byte[] fi = TestApp.file;
                if (File.Exists(boot + @"TESTAPP.DLL"))
                {
                    fi = File.ReadAllBytes(boot + @"TESTAPP.DLL");
                }
                else if (File.Exists(boot + @"DotNetparserTester.exe"))
                {
                    fi = File.ReadAllBytes(boot + @"DotNetparserTester.exe");
                }
                var fl  = new DotNetFile(fi);
                var clr = new DotNetClr(fl, frame ? boot + @"framework" : boot + @"FRAMEW");

                //Register our internal methods
                clr.RegisterCustomInternalMethod("TestsComplete", TestsComplete);
                clr.RegisterCustomInternalMethod("TestSuccess", TestSuccess);
                clr.RegisterCustomInternalMethod("TestFail", TestFail);

                clr.Start();
                Console.WriteLine("Program exec complete.");
            }
            catch (Exception x)
            {
                Console.WriteLine("Caught error: " + x.Message);
            }
        }