[core] add HDD vs UFD detection

* Initial scoring to try to differentiate UFDs from HDDs (#219)
* Also improve GetDriveLetter() and add a global for fixed vs removable
* Also fix a bug with reporting of VID:PID with multiple devices
* Also fix a warning in localization
This commit is contained in:
Pete Batard 2013-11-14 01:21:50 +00:00
parent 803a4bff1c
commit aa0bf0ee2b
7 changed files with 165 additions and 38 deletions

View file

@ -1195,7 +1195,11 @@ DWORD WINAPI FormatThread(LPVOID param)
}
// At this stage with have both a handle and a lock to the physical drive...
drive_name[0] = GetDriveLetter(DriveIndex);
if (!GetDriveLetter(DriveIndex, &drive_name[0])) {
uprintf("Failed to get a drive letter\n");
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_ASSIGN_LETTER);
goto out;
}
if (drive_name[0] == ' ') {
uprintf("No drive letter was assigned...\n");
drive_name[0] = GetUnusedDriveLetter();