1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[core] prevent the enumeration of Windows 10 19H1 sandbox VHDs

* The new 19H1 Windows Sandbox feature relies on VHDs labelled 'PortableBaseLayer' → Don't list those
This commit is contained in:
Pete Batard 2019-07-15 12:35:22 +01:00
parent 5b1ae09df4
commit f95aa94c57
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
5 changed files with 27 additions and 8 deletions

View file

@ -10,6 +10,7 @@ o Version 3.6 (2019.07.??)
Fix progress bar report for screen readers (Accessibility issue)
Fix a regression where Windows format prompts would not be suppressed
Improve(?) Windows To Go support by following Microsoft's recommended partition order
Don't enumerate Windows Sandbox VHDs
Disable ISO mode when Manjaro ISOHybrids are being used
Update embedded GRUB to version 2.04

View file

@ -11,17 +11,18 @@ Rufus: The Reliable USB Formatting Utility
Features
--------
* Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS
* Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3
* Create DOS bootable USB drives, using [FreeDOS](http://www.freedos.org) or MS-DOS (Windows 8.1 or earlier)
* Create BIOS or UEFI bootable drives, including [UEFI bootable NTFS](https://github.com/pbatard/uefi-ntfs)
* Create bootable drives from bootable ISOs (Windows, Linux, etc.)
* Create bootable drives from bootable disk images, including compressed ones
* Create [Windows To Go](https://en.wikipedia.org/wiki/Windows_To_Go) drives
* Create persistent Linux partitions
* Download official Microsoft Windows 8 or Windows 10 retail ISOs
* Compute MD5, SHA-1 and SHA-256 checksums of the selected image
* Twice as fast as Microsoft's USB/DVD tool or UNetbootin, on ISO -> USB creation <sup>(1)</sup>
* Perform bad blocks checks, including detection of "fake" flash drives
* Modern and familiar UI, with [39 languages natively supported](https://github.com/pbatard/rufus/wiki/FAQ#What_languages_are_natively_supported_by_Rufus)
* Modern and familiar UI, with [38 languages natively supported](https://github.com/pbatard/rufus/wiki/FAQ#What_languages_are_natively_supported_by_Rufus)
* Small footprint. No installation required.
* Portable
* 100% [Free Software](https://www.gnu.org/philosophy/free-sw) ([GPL v3](https://www.gnu.org/licenses/gpl-3.0))

View file

@ -453,6 +453,7 @@ BOOL GetDevices(DWORD devnum)
"_SD_", "_SDHC_", "_MMC_", "_MS_", "_MSPro_", "_xDPicture_", "_O2Media_"
};
const char* usb_speed_name[USB_SPEED_MAX] = { "USB", "USB 1.0", "USB 1.1", "USB 2.0", "USB 3.0" };
const char* windows_sandbox_vhd_label = "PortableBaseLayer";
// Hash table and String Array used to match a Device ID with the parent hub's Device Interface Path
htab_table htab_devid = HTAB_EMPTY;
StrArray dev_if_path;
@ -883,6 +884,13 @@ BOOL GetDevices(DWORD devnum)
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) {
uprintf("Device eliminated because it's a Windows Sandbox VHD");
safe_closehandle(hDrive);
safe_free(devint_detail_data);
break;
}
// The empty string is returned for drives that don't have any volumes assigned
if (drive_letters[0] == 0) {

View file

@ -954,14 +954,23 @@ BOOL GetDriveLabel(DWORD DriveIndex, char* letters, char** label)
{
HANDLE hPhysical;
DWORD size, error;
static char VolumeLabel[MAX_PATH + 1];
static char VolumeLabel[MAX_PATH + 1] = { 0 };
char DrivePath[] = "#:\\", AutorunPath[] = "#:\\autorun.inf", *AutorunLabel = NULL;
WCHAR VolumeName[MAX_PATH + 1] = { 0 }, FileSystemName[64];
DWORD VolumeSerialNumber, MaximumComponentLength, FileSystemFlags;
*label = STR_NO_LABEL;
if (!GetDriveLetters(DriveIndex, letters))
return FALSE;
if (letters[0] == 0) {
// Even if we don't have a letter, try to obtain the label of the first partition
HANDLE h = GetLogicalHandle(DriveIndex, 0, FALSE, FALSE, FALSE);
if (GetVolumeInformationByHandleW(h, VolumeName, 64, &VolumeSerialNumber,
&MaximumComponentLength, &FileSystemFlags, FileSystemName, 64)) {
wchar_to_utf8_no_alloc(VolumeName, VolumeLabel, sizeof(VolumeLabel));
*label = VolumeLabel;
}
// Drive without volume assigned - always enabled
return TRUE;
}

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.6.1549"
CAPTION "Rufus 3.6.1550"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -394,8 +394,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,6,1549,0
PRODUCTVERSION 3,6,1549,0
FILEVERSION 3,6,1550,0
PRODUCTVERSION 3,6,1550,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -413,13 +413,13 @@ BEGIN
VALUE "Comments", "https://akeo.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.6.1549"
VALUE "FileVersion", "3.6.1550"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus-3.6.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.6.1549"
VALUE "ProductVersion", "3.6.1550"
END
END
BLOCK "VarFileInfo"