[core] fix wrong detection of Buffalo, Lacie, Samsung, Toshiba and Verbatim drives as HDDs

* Remove the ill-advised (and problematic) table lookup microoptimization
* Also display score when running in debug mode
This commit is contained in:
Pete Batard 2014-06-02 00:45:54 +01:00
parent c3eaaf86a3
commit d5bb6bfe6f
3 changed files with 11 additions and 11 deletions

View file

@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 1.4.8.495"
CAPTION "Rufus 1.4.8.496"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -165,7 +165,7 @@ END
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
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
CAPTION "Rufus 1.4.8.495"
CAPTION "Rufus 1.4.8.496"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -428,8 +428,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,8,495
PRODUCTVERSION 1,4,8,495
FILEVERSION 1,4,8,496
PRODUCTVERSION 1,4,8,496
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -446,13 +446,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.4.8.495"
VALUE "FileVersion", "1.4.8.496"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.4.8.495"
VALUE "ProductVersion", "1.4.8.496"
END
END
BLOCK "VarFileInfo"

View file

@ -474,8 +474,6 @@ int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid)
// Check against known VIDs
for (i=0; i<ARRAYSIZE(vid_score); i++) {
if (vid < vid_score[i].vid)
break;
if (vid == vid_score[i].vid) {
score += vid_score[i].score;
break;
@ -484,8 +482,6 @@ int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid)
// Check against known VID:PIDs
for (i=0; i<ARRAYSIZE(vidpid_score); i++) {
if (vid < vidpid_score[i].vid)
break;
if ((vid == vidpid_score[i].vid) && (pid == vidpid_score[i].pid)) {
score += vidpid_score[i].score;
break;
@ -493,5 +489,8 @@ int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid)
}
// TODO: try to perform inquiry if below a specific threshold (Verbatim, etc)?
#if defined(_DEBUG)
uprintf(" Score: %d\n", score);
#endif
return score;
}