mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[core] fix VHD detection for Windows 7
* Windows 8 or later uses "Microsoft Virtual Disk" whereas Windows 7 uses "Msft Virtual Disk SCSI Disk Device", so we just search for a "Virtual Disk" substring. * Closes #306
This commit is contained in:
parent
3f0d9d108f
commit
0def2bacef
3 changed files with 9 additions and 8 deletions
|
@ -633,7 +633,7 @@ static BOOL GetUSBDevices(DWORD devnum)
|
||||||
// The rest are the vendor UASP drivers I know of so far - list may be incomplete!
|
// The rest are the vendor UASP drivers I know of so far - list may be incomplete!
|
||||||
const char* storage_name[] = { "USBSTOR", "UASPSTOR", "VUSBSTOR", "ETRONSTOR" };
|
const char* storage_name[] = { "USBSTOR", "UASPSTOR", "VUSBSTOR", "ETRONSTOR" };
|
||||||
const char* scsi_name = "SCSI";
|
const char* scsi_name = "SCSI";
|
||||||
const char* vhd_name = "Microsoft Virtual Disk";
|
const char* vhd_name = "Virtual Disk";
|
||||||
char letter_name[] = " (?:)";
|
char letter_name[] = " (?:)";
|
||||||
BOOL found = FALSE, is_SCSI, is_UASP, is_VHD;
|
BOOL found = FALSE, is_SCSI, is_UASP, is_VHD;
|
||||||
HDEVINFO dev_info = NULL;
|
HDEVINFO dev_info = NULL;
|
||||||
|
@ -713,7 +713,7 @@ static BOOL GetUSBDevices(DWORD devnum)
|
||||||
uprintf("SetupDiGetDeviceRegistryProperty (Friendly Name) failed: %s\n", WindowsErrorString());
|
uprintf("SetupDiGetDeviceRegistryProperty (Friendly Name) failed: %s\n", WindowsErrorString());
|
||||||
// We can afford a failure on this call - just replace the name with "USB Storage Device (Generic)"
|
// We can afford a failure on this call - just replace the name with "USB Storage Device (Generic)"
|
||||||
safe_strcpy(buffer, sizeof(buffer), lmprintf(MSG_045));
|
safe_strcpy(buffer, sizeof(buffer), lmprintf(MSG_045));
|
||||||
} else if (safe_stricmp(buffer, vhd_name) == 0) {
|
} else if (safe_strstr(buffer, vhd_name) != NULL) {
|
||||||
is_VHD = TRUE;
|
is_VHD = TRUE;
|
||||||
} else {
|
} else {
|
||||||
// Get the VID:PID of the device. We could avoid doing this lookup every time by keeping
|
// Get the VID:PID of the device. We could avoid doing this lookup every time by keeping
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
#define safe_strncat(dst, dst_max, src, count) strncat(dst, src, safe_min(count, dst_max - safe_strlen(dst) - 1))
|
#define safe_strncat(dst, dst_max, src, count) strncat(dst, src, safe_min(count, dst_max - safe_strlen(dst) - 1))
|
||||||
#define safe_strcat(dst, dst_max, src) safe_strncat(dst, dst_max, src, safe_strlen(src)+1)
|
#define safe_strcat(dst, dst_max, src) safe_strncat(dst, dst_max, src, safe_strlen(src)+1)
|
||||||
#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
|
#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
|
||||||
|
#define safe_strstr(str1, str2) strstr(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
|
||||||
#define safe_stricmp(str1, str2) _stricmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
|
#define safe_stricmp(str1, str2) _stricmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
|
||||||
#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2), count)
|
#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2), count)
|
||||||
#define safe_strnicmp(str1, str2, count) _strnicmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2), count)
|
#define safe_strnicmp(str1, str2, count) _strnicmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2), count)
|
||||||
|
|
12
src/rufus.rc
12
src/rufus.rc
|
@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
|
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Rufus 1.4.7.446"
|
CAPTION "Rufus 1.4.7.447"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
||||||
|
@ -165,7 +165,7 @@ END
|
||||||
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
|
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
|
||||||
CAPTION "Rufus 1.4.7.446"
|
CAPTION "Rufus 1.4.7.447"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
||||||
|
@ -427,8 +427,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,4,7,446
|
FILEVERSION 1,4,7,447
|
||||||
PRODUCTVERSION 1,4,7,446
|
PRODUCTVERSION 1,4,7,447
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -445,13 +445,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "1.4.7.446"
|
VALUE "FileVersion", "1.4.7.447"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "1.4.7.446"
|
VALUE "ProductVersion", "1.4.7.447"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in a new issue