mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-09 12:31:57 -04:00
[dev] add disk exclusion by GPT Disk GUID
* Similar to what we already do with IgnoreUSB##, except this time, users can add REG_SZ keys IgnoreDisk01 to IgnoreDisk08, with a string like "{F333EC2E-25C9-488D-A7FC-9147C2367623}" to ignore a GPT disk with this specific GUID. * This may be useful for people who mount fixed virtual drives, or people who have enabled Hot Swap on their SATA storage, and who want to make sure they won't be able to inadvertently select that disk in Rufus. * Also set rufus-next to 4.7.
This commit is contained in:
parent
7488e4464d
commit
37e383ade6
6 changed files with 63 additions and 17 deletions
20
configure
vendored
20
configure
vendored
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.71 for rufus 4.6.
|
||||
# Generated by GNU Autoconf 2.71 for rufus 4.7.
|
||||
#
|
||||
# Report bugs to <https://github.com/pbatard/rufus/issues>.
|
||||
#
|
||||
|
@ -611,8 +611,8 @@ MAKEFLAGS=
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='rufus'
|
||||
PACKAGE_TARNAME='rufus'
|
||||
PACKAGE_VERSION='4.6'
|
||||
PACKAGE_STRING='rufus 4.6'
|
||||
PACKAGE_VERSION='4.7'
|
||||
PACKAGE_STRING='rufus 4.7'
|
||||
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
|
||||
PACKAGE_URL='https://rufus.ie'
|
||||
|
||||
|
@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then
|
|||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures rufus 4.6 to adapt to many kinds of systems.
|
||||
\`configure' configures rufus 4.7 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
@ -1336,7 +1336,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of rufus 4.6:";;
|
||||
short | recursive ) echo "Configuration of rufus 4.7:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
@ -1428,7 +1428,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
rufus configure 4.6
|
||||
rufus configure 4.7
|
||||
generated by GNU Autoconf 2.71
|
||||
|
||||
Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
|
@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by rufus $as_me 4.6, which was
|
||||
It was created by rufus $as_me 4.7, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
$ $0$ac_configure_args_raw
|
||||
|
@ -2767,7 +2767,7 @@ fi
|
|||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='rufus'
|
||||
VERSION='4.6'
|
||||
VERSION='4.7'
|
||||
|
||||
|
||||
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
|
||||
|
@ -5309,7 +5309,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by rufus $as_me 4.6, which was
|
||||
This file was extended by rufus $as_me 4.7, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
@ -5365,7 +5365,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
|||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config='$ac_cs_config_escaped'
|
||||
ac_cs_version="\\
|
||||
rufus config.status 4.6
|
||||
rufus config.status 4.7
|
||||
configured by $0, generated by GNU Autoconf 2.71,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
AC_INIT([rufus], [4.6], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie])
|
||||
AC_INIT([rufus], [4.7], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie])
|
||||
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
|
||||
AC_CONFIG_SRCDIR([src/rufus.c])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
|
|
@ -943,6 +943,9 @@ BOOL GetDevices(DWORD devnum)
|
|||
uprintf("Device eliminated because it was detected as a Microsoft Dev Drive");
|
||||
safe_free(devint_detail_data);
|
||||
break;
|
||||
} else if (IsFilteredDrive(drive_index)) {
|
||||
safe_free(devint_detail_data);
|
||||
break;
|
||||
}
|
||||
// Windows 10 19H1 mounts a 'PortableBaseLayer' for its Windows Sandbox feature => unlist those
|
||||
if (safe_strcmp(label, windows_sandbox_vhd_label) == 0) {
|
||||
|
|
42
src/drive.c
42
src/drive.c
|
@ -2647,3 +2647,45 @@ out:
|
|||
safe_closehandle(hPhysical);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Detect filtered drives, that have been added by users through the registry
|
||||
* entries IgnoreDisk01 - IgnoreDisk08. These entries must contain *decorated*
|
||||
* string GUIDs that match the GPT Disk GUID of the drive to filter out, as
|
||||
* reported by Rufus, such as "{F333EC2E-25C9-488D-A7FC-9147C2367623}".
|
||||
*/
|
||||
BOOL IsFilteredDrive(DWORD DriveIndex)
|
||||
{
|
||||
char setting_name[32];
|
||||
DWORD i, size = 0;
|
||||
BOOL r, ret = FALSE;
|
||||
HANDLE hPhysical = INVALID_HANDLE_VALUE;
|
||||
BYTE layout[4096] = { 0 };
|
||||
PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;
|
||||
GUID* DiskGuid;
|
||||
|
||||
hPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE);
|
||||
if (hPhysical == INVALID_HANDLE_VALUE)
|
||||
goto out;
|
||||
|
||||
r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL);
|
||||
if (!r || size <= 0)
|
||||
goto out;
|
||||
|
||||
// Only works for GPT drives
|
||||
if (DriveLayout->PartitionStyle != PARTITION_STYLE_GPT)
|
||||
goto out;
|
||||
for (i = 1; i <= MAX_IGNORE_USB; i++) {
|
||||
static_sprintf(setting_name, "IgnoreDisk%02d", i);
|
||||
DiskGuid = StringToGuid(ReadSettingStr(setting_name));
|
||||
if (CompareGUID(&DriveLayout->Gpt.DiskId, DiskGuid)) {
|
||||
uprintf("Device eliminated because it matches Disk GUID %s", GuidToString(DiskGuid, TRUE));
|
||||
ret = TRUE;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
safe_closehandle(hPhysical);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -425,3 +425,4 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save);
|
|||
uint64_t GetEspOffset(DWORD DriveIndex);
|
||||
BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset);
|
||||
BOOL IsMsDevDrive(DWORD DriveIndex);
|
||||
BOOL IsFilteredDrive(DWORD DriveIndex);
|
||||
|
|
12
src/rufus.rc
12
src/rufus.rc
|
@ -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 4.6.2208"
|
||||
CAPTION "Rufus 4.7.2209"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||
|
@ -399,8 +399,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 4,6,2208,0
|
||||
PRODUCTVERSION 4,6,2208,0
|
||||
FILEVERSION 4,7,2209,0
|
||||
PRODUCTVERSION 4,7,2209,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -418,13 +418,13 @@ BEGIN
|
|||
VALUE "Comments", "https://rufus.ie"
|
||||
VALUE "CompanyName", "Akeo Consulting"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "4.6.2208"
|
||||
VALUE "FileVersion", "4.7.2209"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2024 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||
VALUE "OriginalFilename", "rufus-4.6.exe"
|
||||
VALUE "OriginalFilename", "rufus-4.7.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "4.6.2208"
|
||||
VALUE "ProductVersion", "4.7.2209"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue