[core] add cheat mode to disable VHD listing (Alt-G)

This commit is contained in:
Pete Batard 2020-04-27 10:28:00 +01:00
parent 44a8e08bc6
commit 077f143252
No known key found for this signature in database
GPG Key ID: 38E0CF5E69EDD671
5 changed files with 28 additions and 9 deletions

View File

@ -564,6 +564,7 @@ t MSG_305 "Use this option to indicate whether you want to use this device to in
# You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.
# It's the same as MSG_286 but with a process that *may* be faster, hence the name.
t MSG_306 "Fast-zeroing drive: %s"
t MSG_307 "VHD detection"
#########################################################################
l "ar-SA" "Arabic (العربية)" 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001

View File

@ -46,7 +46,8 @@
extern StrArray DriveId, DriveName, DriveLabel, DriveHub;
extern uint32_t DrivePort[MAX_DRIVES];
extern BOOL enable_HDDs, use_fake_units, enable_vmdk, usb_debug, list_non_usb_removable_drives, its_a_me_mario;
extern BOOL enable_HDDs, enable_VHDs, use_fake_units, enable_vmdk, usb_debug;
extern BOOL list_non_usb_removable_drives, its_a_me_mario;
/*
* Get the VID, PID and current device speed
@ -897,7 +898,13 @@ BOOL GetDevices(DWORD devnum)
}
// Windows 10 19H1 mounts a 'PortableBaseLayer' for its Windows Sandbox feature => unlist those
if (safe_strcmp(label, windows_sandbox_vhd_label) == 0) {
uprintf("Device eliminated because it's a Windows Sandbox VHD");
uprintf("Device eliminated because it is a Windows Sandbox VHD");
safe_closehandle(hDrive);
safe_free(devint_detail_data);
break;
}
if (props.is_VHD && (!enable_VHDs)) {
uprintf("Device eliminated because listing of VHDs is disabled (Alt-G)");
safe_closehandle(hDrive);
safe_free(devint_detail_data);
break;

View File

@ -111,7 +111,7 @@ HWND hLogDialog = NULL, hProgress = NULL, hDiskID;
HANDLE dialog_handle = NULL;
BOOL is_x86_32, use_own_c32[NB_OLD_C32] = { FALSE, FALSE }, mbr_selected_by_user = FALSE;
BOOL op_in_progress = TRUE, right_to_left_mode = FALSE, has_uefi_csm = FALSE, its_a_me_mario = FALSE;
BOOL enable_HDDs = FALSE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE, lock_drive = TRUE;
BOOL enable_HDDs = FALSE, enable_VHDs = TRUE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE, lock_drive = TRUE;
BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32, usb_debug;
BOOL use_fake_units, preserve_timestamps = FALSE, fast_zeroing = FALSE, app_changed_size = FALSE;
BOOL zero_drive = FALSE, list_non_usb_removable_drives = FALSE, enable_file_indexing, large_drive = FALSE;
@ -3110,6 +3110,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
force_large_fat32 = ReadSettingBool(SETTING_FORCE_LARGE_FAT32_FORMAT);
enable_vmdk = ReadSettingBool(SETTING_ENABLE_VMDK_DETECTION);
enable_file_indexing = ReadSettingBool(SETTING_ENABLE_FILE_INDEXING);
enable_VHDs = !ReadSettingBool(SETTING_DISABLE_VHDS);
// Initialize the global scaling, in case we need it before we initialize the dialog
hDC = GetDC(NULL);
@ -3278,7 +3279,7 @@ relaunch:
while(GetMessage(&msg, NULL, 0, 0)) {
static BOOL ctrl_without_focus = FALSE;
BOOL no_focus = (msg.message == WM_SYSKEYDOWN) && !(msg.lParam & 0x20000000);
// ** ***** **** ** **********
// ** ****** **** ** **********
// .,ABCDEFGHIJKLMNOPQRSTUVWXYZ
// Sigh... The things one need to do to detect standalone use of the 'Alt' key.
@ -3387,6 +3388,15 @@ relaunch:
CheckDlgButton(hMainDialog, IDC_LIST_USB_HDD, enable_HDDs ? BST_CHECKED : BST_UNCHECKED);
continue;
}
// Alt-G => Toggle detection of Virtual Disks
// By default Rufus list Virtual Disks but some people use them for backup.
if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'G')) {
enable_VHDs = !enable_VHDs;
WriteSettingBool(SETTING_DISABLE_VHDS, !enable_VHDs);
PrintStatusTimeout(lmprintf(MSG_307), enable_VHDs);
GetDevices(0);
continue;
}
// Alt-I => Toggle ISO support
// This is useful if you have an ISOHybrid image and you want to force Rufus to use
// DD-mode when writing the data.

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.10.1648"
CAPTION "Rufus 3.10.1649"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -395,8 +395,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,10,1648,0
PRODUCTVERSION 3,10,1648,0
FILEVERSION 3,10,1649,0
PRODUCTVERSION 3,10,1649,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.10.1648"
VALUE "FileVersion", "3.10.1649"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.10.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.10.1648"
VALUE "ProductVersion", "3.10.1649"
END
END
BLOCK "VarFileInfo"

View File

@ -34,6 +34,7 @@ extern char* ini_file;
#define SETTING_DISABLE_FAKE_DRIVES_CHECK "DisableFakeDrivesCheck"
#define SETTING_DISABLE_LGP "DisableLGP"
#define SETTING_DISABLE_SECURE_BOOT_NOTICE "DisableSecureBootNotice"
#define SETTING_DISABLE_VHDS "DisableVHDs"
#define SETTING_ENABLE_FILE_INDEXING "EnableFileIndexing"
#define SETTING_ENABLE_USB_DEBUG "EnableUsbDebug"
#define SETTING_ENABLE_VMDK_DETECTION "EnableVmdkDetection"