diff --git a/src/drive.c b/src/drive.c index 3c596eca..5c26cd80 100644 --- a/src/drive.c +++ b/src/drive.c @@ -602,7 +602,7 @@ int GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSyst FileSystemName[0] = 0; volume_name = GetLogicalName(DriveIndex, TRUE, FALSE); if ((volume_name == NULL) || (!GetVolumeInformationA(volume_name, NULL, 0, NULL, NULL, NULL, FileSystemName, FileSystemNameSize))) { - uprintf("No volume information for disk 0x%02x\n", DriveIndex); + uprintf("No volume information for drive 0x%02x\n", DriveIndex); } safe_free(volume_name); @@ -617,6 +617,11 @@ int GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSyst safe_closehandle(hPhysical); return 0; } + if (DiskGeometry->Geometry.BytesPerSector < 512) { + uprintf("WARNING: Drive 0x%02x reports a sector size of %d - Correcting to 512 bytes.\n", + DriveIndex, DiskGeometry->Geometry.BytesPerSector); + DiskGeometry->Geometry.BytesPerSector = 512; + } SelectedDrive.DiskSize = DiskGeometry->DiskSize.QuadPart; memcpy(&SelectedDrive.Geometry, &DiskGeometry->Geometry, sizeof(DISK_GEOMETRY)); uprintf("Disk type: %s, Sector Size: %d bytes\n", (DiskGeometry->Geometry.MediaType == FixedMedia)?"Fixed":"Removable", diff --git a/src/format.c b/src/format.c index 69d5d64b..dfb81a3e 100644 --- a/src/format.c +++ b/src/format.c @@ -431,6 +431,8 @@ static BOOL FormatFAT32(DWORD DriveIndex) } memcpy(&dgDrive, &xdgDrive->Geometry, sizeof(dgDrive)); } + if (dgDrive.BytesPerSector < 512) + dgDrive.BytesPerSector = 512; if (IS_ERROR(FormatStatus)) goto out; if (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_PARTITION_INFO, NULL, 0, &piDrive, sizeof(piDrive), &cbRet, NULL)) { diff --git a/src/rufus.rc b/src/rufus.rc index ff224c99..eb6cf7e0 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -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.10.507" +CAPTION "Rufus 1.4.10.508" 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.10.507" +CAPTION "Rufus 1.4.10.508" 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,10,507 - PRODUCTVERSION 1,4,10,507 + FILEVERSION 1,4,10,508 + PRODUCTVERSION 1,4,10,508 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.10.507" + VALUE "FileVersion", "1.4.10.508" 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.10.507" + VALUE "ProductVersion", "1.4.10.508" END END BLOCK "VarFileInfo"