Browse Source

commit: wtf i do ing?

HOME 3 years ago
parent
commit
451f992e9c

+ 33 - 0
SvdCli/Cli2Program.cs

@@ -0,0 +1,33 @@
+using System;
+
+namespace SvdCli
+{
+    internal static class Cli2Program
+    {
+        private static void Main(string[] args)
+        {
+            if (args.Length < 2)
+            {
+                Console.WriteLine(@"Usage: svd <key:value>[,...]");
+                Console.WriteLine(@" * Create Raw Disk Image          svd OP:Create TYPE:Raw SIZE:50GB PATH:C:\Path\To\Your\Image.img");
+                Console.WriteLine(@" * Create Standalone Bdd Image    svd OP:Create TYPE:Bdd SIZE:10GB STRIP:64KB PATH:C:\Path\To\Your\Image.bdd");
+                Console.WriteLine(@" * Create Snapshot Bdd Image      svd OP:Create TYPE:Bdd STRIP:64KB PATH:C:\Path\To\Your\Image.bdd BASE:C:\Path\To\Your\Image.img");
+                Console.WriteLine(@" * Mount Local RamDisk            svd OP:Mount TYPE:RamDisk SIZE:10GB [FS:NTFS] [TEMP:YES] [LETTER:Z]");
+                Console.WriteLine(@" * Mount Image                    svd OP:Mount TYPE:Image PATH:C:\Path\To\Your\Image.bdd");
+                Console.WriteLine(@" * Optimization Image             svc OP:Compact PATH:C:\Path\To\Your\Bdd.bdd");
+                Console.WriteLine(@"                                  svd OP:Mount TYPE:Image PATH:C:\Path\To\Your\Image.img");
+                Console.WriteLine(@"                                  svd OP:Mount TYPE:Net SERVER:192.168.233.233:23333 [LETTER:Z]");
+                Console.WriteLine(@" * Server                         svd OP:Server LISTEN:0.0.0.0:23333 TYPE:<Image|RamDisk>");
+                Console.WriteLine(@"                                  svd OP:Server LISTEN:0.0.0.0:23333 TYPE:DispatchBdd STRIP:64KB PATH:C:\Path\To\Your\Image.img BDD:C:\Path\To\Your\Dir\");
+                Console.WriteLine(@"                                  svd OP:Server LISTEN:0.0.0.0:23333 TYPE:DispatchRamDisk SIZE:10GB [FS:NTFS] [TEMP:YES]");
+                Console.WriteLine(@" * Windows Service                svd SVC:Install SVC.NAME:TheServiceName ...");
+                Console.WriteLine(@"                                  svd SVC:Uninstall SVC.NAME:TheServiceName");
+                Console.WriteLine(@"                                  svd SVC:Run ...");
+                Console.WriteLine(@" ** Fork sub process              svd OP:ForkBdd SOCKET:HandleHex PATH:C:\Path\To\Your\MAC.bdd");
+                return;
+            }
+
+            
+        }
+    }
+}

+ 1 - 1
SvdCli/CliProgram.cs

@@ -219,7 +219,7 @@ namespace SvdCli
                         if (op == "tempntfsramdisk") FsMaker.MakeNtfs(storage, "RamDisk", n => n.CreateDirectory("Temp"));
                         if (op == "ztempntfsramdisk")
                         {
-                            var guid = Guid.NewGuid().ToString("N");
+                            var guid = storage.Guid.ToString("N");
                             FsMaker.MakeNtfs(storage, guid, n => n.CreateDirectory("Temp"));
                             storage.Mounted += delegate
                             {

+ 1 - 1
SvdCli/DriverAdapt/VirtualDrive.cs

@@ -29,7 +29,7 @@ namespace SvdCli.DriverAdapt
                 MaxTransferLength = storage.MaxTransferLength,
                 CacheSupported = true,
                 EjectDisabled = false,
-                Guid = Guid.NewGuid(),
+                Guid = storage.Guid,
             };
 
             Size = storage.BlockSize * storage.BlockSize;

+ 3 - 1
SvdCli/Storage/ISvdStorage.cs

@@ -14,6 +14,8 @@ namespace SvdCli.Storage
         bool SupportTrim { get; }
         bool WriteProtect { get; }
 
+        Guid Guid { get; }
+
         void Init();
 
         void Exit();
@@ -29,7 +31,7 @@ namespace SvdCli.Storage
         void Flush();
 
         void Trim(params TrimDescriptor[] descriptors);
-        
+
         event EventHandler Mounted;
         void FireMountedEvent();
     }

+ 1 - 0
SvdCli/Storage/Implements/RamStorage.cs

@@ -14,6 +14,7 @@ namespace SvdCli.Storage.Implements
         public uint MaxTransferLength { get; } = 64 * CapacityUnits.KiloByte;
         public bool SupportTrim { get; } = false;
         public bool WriteProtect { get; set; }
+        public Guid Guid { get; } = Guid.NewGuid();
 
         public event EventHandler Mounted;
 

+ 1 - 0
SvdCli/Storage/Implements/RawImageStorage.cs

@@ -11,6 +11,7 @@ namespace SvdCli.Storage.Implements
 
         public string ProductId { get; } = "Svd RawImage Disk";
         public string ProductVersion { get; } = "1.0";
+        public Guid Guid { get; } = Guid.NewGuid();
         public uint BlockSize { get; } = 512;
         public uint MaxTransferLength { get; } = 64 * CapacityUnits.KiloByte;
         public bool SupportTrim { get; }

+ 1 - 1
SvdCli/Storage/Implements/StandaloneBddImageStorage.cs

@@ -6,8 +6,8 @@ namespace SvdCli.Storage.Implements
     {
         // TODO: StandaloneBddImageStorage
         public string ProductId { get; } = "Svd BddImage";
-
         public string ProductVersion { get; } = "1.0";
+        public Guid Guid { get; } = Guid.NewGuid();
         public uint BlockSize { get; } = 512;
         public ulong BlockCount { get; }
         public uint MaxTransferLength { get; }

+ 1 - 0
SvdCli/SvdCli.csproj

@@ -148,6 +148,7 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Cli2Program.cs" />
     <Compile Include="CliProgram.cs" />
     <Compile Include="ImageUtils\BlockDifferencingDiskImage\BddImage.cs" />
     <Compile Include="ImageUtils\FsMaker.cs" />