public void Invoke() { Options options = Options.None; if (doNotVerifyHashes) { options |= Options.DoNotVerifyClusterHashes; } if (doNotVerifySignatures) { options |= Options.DoNotVerifyClusterSignatures; } Configuration.Options = options; CngKey encryptionKey = CryptoSettingsOptions.GetEncryptionKey(); CngKey decryptionKey = CryptoSettingsOptions.GetDecryptionKey(); CngKey signingKey = CryptoSettingsOptions.GetSigningKey(); Configuration.CryptoSettings = new CryptoSettings(decryptionKey, signingKey, encryptionKey); using (var pio = new PartitionIO(PartitionOptions.GetPartition())) using (var fs = FileSystem.Mount(pio)) { SRFSDokan d = new SRFSDokan(fs); d.Mount("S:\\"); } }
public void Invoke() { int blockSize = 512; Options options = Options.None; if (doNotVerifyHashes) { options |= Options.DoNotVerifyClusterHashes; } if (doNotVerifySignatures) { options |= Options.DoNotVerifyClusterSignatures; } Configuration.Options = options; CngKey encryptionKey = CryptoSettingsOptions.GetEncryptionKey(); CngKey decryptionKey = CryptoSettingsOptions.GetDecryptionKey(); CngKey signingKey = CryptoSettingsOptions.GetSigningKey(); Configuration.CryptoSettings = new CryptoSettings(decryptionKey, signingKey, encryptionKey); long size = new FileInfo(FilePath).Length; using (MemoryIO io = new MemoryIO((int)size, blockSize)) using (FileStream fio = new FileStream(FilePath, FileMode.Open)) { fio.Read(io.Bytes, 0, (int)io.SizeBytes); using (var fs = FileSystem.Mount(io)) { SRFSDokan d = new SRFSDokan(fs); d.Mount("S:\\"); } fio.Position = 0; fio.Write(io.Bytes, 0, (int)io.SizeBytes); } }