[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

@ -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) {