From 6ca3d39e5ff7785bfa30eccd73423eefd1a487d4 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 28 Jan 2020 21:25:26 -0800 Subject: [PATCH] Manual protect scan can handle SmartE weirdness --- DICUI/Windows/MainWindow.xaml.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DICUI/Windows/MainWindow.xaml.cs b/DICUI/Windows/MainWindow.xaml.cs index 7aa4b19e..e15f1236 100644 --- a/DICUI/Windows/MainWindow.xaml.cs +++ b/DICUI/Windows/MainWindow.xaml.cs @@ -666,6 +666,14 @@ namespace DICUI.Windows CopyProtectScanButton.IsEnabled = false; string protections = await Validators.RunProtectionScanOnPath(_env.Drive.Letter + ":\\"); + + // If SmartE is detected on the current disc, remove `/sf` from the flags + if (protections.Contains("SmartE")) + { + _env.DICParameters[DICFlag.ScanFileProtect] = false; + ViewModels.LoggerViewModel.VerboseLogLn($"SmartE detected, removing {DICFlagStrings.ScanFileProtect} from parameters"); + } + if (!ViewModels.LoggerViewModel.WindowVisible) MessageBox.Show(protections, "Detected Protection", MessageBoxButton.OK, MessageBoxImage.Information); ViewModels.LoggerViewModel.VerboseLog("Detected the following protections in {0}:\r\n\r\n{1}", _env.Drive.Letter, protections);