From 28c1bd668824c70c2850d988a52f8dc63a85fc7d Mon Sep 17 00:00:00 2001 From: Muhammad Aman Date: Fri, 28 Mar 2014 23:47:44 +0000 Subject: [PATCH 1/5] [loc] update Malay translation to v1.0.10 * Also fix a small typo in the Polish translation --- res/localization/rufus.loc | 42 +++++++++++++++++++++++++++----------- src/rufus.rc | 12 +++++------ 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/res/localization/rufus.loc b/res/localization/rufus.loc index ed0736a0..c2b7c280 100644 --- a/res/localization/rufus.loc +++ b/res/localization/rufus.loc @@ -5539,7 +5539,7 @@ t MSG_261 "Rašomas atvaizdas: %0.1f%% baigta" ################################################################################ l "ms-MY" "Malay (Bahasa Malaysia)" 0x043e, 0x083e -v 1.0.7 +v 1.0.10 b "en-US" # Main dialog @@ -5711,7 +5711,7 @@ t MSG_043 "Error: %s" t MSG_044 "Muat turun fail" t MSG_045 "Peranti storan USB (Generik)" t MSG_046 "%s (Disk %d) [%s]" -# t MSG_047 "Multiple Partitions" +t MSG_047 "Beberapa Partition" t MSG_048 "Rufus - Mengeflush buffer" t MSG_049 "Rufus - Dibatalkan" @@ -5766,17 +5766,22 @@ t MSG_084 "Imej ISO ini menggunakan versi '%s' yang telah usang.\n" "Perhatian: Fail yang dimuat turun akan disimpan di dalam direktori bersamaan dengan Rufus dan apabila terdapat " "'%s' , ia akan digunakan secara automatik." t MSG_085 "Muat turun %s" -t MSG_086 "Imej ISO tidak dapat dikesan" +t MSG_086 "Tiada imej yang dipilih" # The content between the quotes below (\"Create a bootable disk\") should match # the beginning of the IDC_BOOT text -t MSG_087 "Sila kilik pada butang disk untuk memilih ISO boleh boot, " - "atau nyahtandakan kotak semak \"Cipta disk boleh boot...\"." -t MSG_088 "ISO terlalu besar" -t MSG_089 "Imej ISO ini terlalu besar untuk sasaran yang dipilih." +t MSG_087 "Sila kilik pada butang disk untuk memilih imej yang boleh boot, " + "atau nyahtandakan kotak semak \"Cipta disk boleh boot menggunakan\"." +t MSG_088 "Imej terlalu besar" +t MSG_089 "Imej ini terlalu besar untuk sasaran yang dipilih." t MSG_090 "ISO tidak disokong" t MSG_091 "Apabila menggunakan jenis sasaran UEFI , hanya imej boleh boot jenis EFI sahaja disokong. " "Tolong pilih ISO boleh boot jenis EFI atau tukarkan jenis sasaran kepada BIOS." t MSG_092 "Sistem fail tidak disokong" +t MSG_093 "PENTING: PERANTI INI MEMPUNYAI BEBERAPA PARTITION!!\n\n" + "Ini mungkin termasuk partition/jilid yang tidak disenaraikan atau tidak boleh dilihat dari Windows. " + "Jika anda mahu meneruskannya, anda bertanggungjawab ke atas kehilangan data dalam partition tersebut." +t MSG_094 "Beberapa partition dikesan" +t MSG_095 "DD Imej" t MSG_096 "Hanya FAT/FAT32 diskong untuk ISO ini. Tolong pilih FAT/FAT32 sebagai fail sistem." t MSG_097 "Hanya imej ISO yang berdasarkan 'bootmgr' atau 'WinPE' boleh digunakan dengan NTFS." t MSG_098 "FAT/FAT32 hanya boleh digunakan untuk imej ISO yang berdasarkan isolinux atau apabila jenis sasaran adalah UEFI." @@ -5797,7 +5802,7 @@ t MSG_104 "Syslinux v5.0 atau kemudian memerlukan fail '%s' di komputer anda.\n" "'%s' ada di sana, ia akan digunakan semula secara automatik.\n" t MSG_105 "Pembatalan boleh menyebabkan peranti ini TIDAK BOLEH DIGUNAKAN SEMULA.\n" "Jika anda pasti anda mahu membatalkannya, klik Ya. Sebaliknya, klik Tidak." -t MSG_106 "Silih pilih folder" +t MSG_106 "Sila pilih folder" t MSG_107 "Semua fail" t MSG_108 "Log Rufus" t MSG_109 "0x%02X (Disk %d)" @@ -5810,7 +5815,16 @@ t MSG_111 "Incompatible Cluster size" t MSG_112 "Pemformattan jilid UDF yang besar mengambil masa yang amat lama. Pada kelajuan USB 2.0 anggaran masa pemformatan " "adalah %d:%02d, di mana bar kemajuan akan lihat seperti ia tidak bergerak. Tolong bersabar" t MSG_113 "Jilid UDF besar" - +t MSG_114 "Imej ini menggunakan Syslinux %s tetapi aplikasi ini hanya mempunyai fail pemasangan untuk" + "Syslinux %s.\n\nOleh kerana versi-versi baharu Syslinux tidak serasi dengan satu sama lain, maka tidak" + "wajarlah Rufus menyediakan semuanya, dua fail tambahan perlu dimuat turun dari" + "Internet ('ldlinux.sys' dan 'ldlinux.bss'):\n" + "- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun fail tersebut\n" + "- Pilih 'Tidak' untuk membatalkan operasi\n\n" + "NOTA:Fail akan dimuat turun ke dalam direktori aplikasi ini dan akan digunakan semula" + "secara automatik sekiranya sedia ada.\n" +t MSG_115 "Muat turun diperlukan" + # Tootips # Partition Scheme and Target Type t MSG_150 "Selalunya pilihan ini paling selamat. Namun, jika anda ada komputer UEFI dan mahu " @@ -5860,11 +5874,13 @@ t MSG_184 "Untuk tujuan menjana statistik penggunaan peribadi , kami mungkin men t MSG_185 "Proses mengemas kini:" t MSG_186 "Rufus tidak memasang atau menjalankan servis di latar belakang. Oleh itu, semakan kemas kini hanya dijalankan apabila aplikasi utama berjalan.\\line\n" "Akses internet diperlukan untuk menymeak untuk versi baru." +t MSG_187 "Imej tidak sah untuk pilihan boot yang dipilih" +t MSG_188 "Imej tidak serasi dengan pilihan boot yang dipilih. Tolong gunakan imej lain atau pilih pilihan boot lain." # Status messages - these messages will appear on the status bar t MSG_201 "Sedang membatalkan - Sila tunggu..." -t MSG_202 "Mengimbas imej ISO..." -t MSG_203 "Imbasan imej ISO gagal" +t MSG_202 "Mengimbas imej..." +t MSG_203 "Imbasan imej gagal" # Parameter: the name of an obsolete Syslinux .c32 module. eg: "Obsolete vesamenu.c32 detected" t MSG_204 "%s usang dikesan" # Display the name of the ISO selected. eg: "Using ISO: en_win7_x64_sp1.iso" @@ -5938,6 +5954,8 @@ t MSG_256 "Pengesanan cakera palsu" t MSG_257 "Sokongan Joliet" t MSG_258 "Sokongan Rock Ridge" t MSG_259 "Paksa kemas kini" +t MSG_260 "Mampatan NTFS" +t MSG_261 "Menulis imej: %0.1f%% selesai" ################################################################################ l "pl-PL" "Polish (Polski)" 0x0415 @@ -6266,7 +6284,7 @@ t MSG_178 "Dodatkowe Prawa Autorskie:" t MSG_179 "Polityka Aktualizacji:" t MSG_180 "Jeśli pozwolisz temu programowi szukać aktualizacji aplikacji, " "Zgadzasz się na to, że następujące informacje mogą być zbierane na naszy, serwerze (serwerach):" -t MSG_181 "Architektura i wersja twojego systemy operacyjnego" +t MSG_181 "Architektura i wersja twojego systemu operacyjnego" t MSG_182 "Wersja aplikacji z której korzystasz" t MSG_183 "Twój adres IP" t MSG_184 "W celu generowania poufnych statystyk używania , możemy trzymać zebrane informacje, " diff --git a/src/rufus.rc b/src/rufus.rc index 58f7505d..15e5d67d 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.6.441" +CAPTION "Rufus 1.4.6.442" 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.6.441" +CAPTION "Rufus 1.4.6.442" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -427,8 +427,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,6,441 - PRODUCTVERSION 1,4,6,441 + FILEVERSION 1,4,6,442 + PRODUCTVERSION 1,4,6,442 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -445,13 +445,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.6.441" + VALUE "FileVersion", "1.4.6.442" 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.6.441" + VALUE "ProductVersion", "1.4.6.442" END END BLOCK "VarFileInfo" From 5519212dd31c09faa3ceb92eea417acf5c790d3a Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 29 Mar 2014 00:17:41 +0000 Subject: [PATCH 2/5] [core] improve drive geometry detection * Try IOCTL_DISK_GET_DRIVE_GEOMETRY_EX if IOCTL_DISK_GET_DRIVE_GEOMETRY fails in Large Fat32 code * Report actual IOCTL errors * Use a larger buffer for geometry * Also add (guessed) FCC_DEVICE_NOT_READY handling to FormatEx --- src/drive.c | 13 +++++-------- src/format.c | 41 ++++++++++++++++++++++++++--------------- src/format.h | 2 +- src/rufus.rc | 12 ++++++------ 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/drive.c b/src/drive.c index 703fb06f..7116a126 100644 --- a/src/drive.c +++ b/src/drive.c @@ -473,9 +473,8 @@ uint64_t GetDriveSize(DWORD DriveIndex) BOOL r; HANDLE hPhysical; DWORD size; - BYTE geometry[128]; - void* disk_geometry = (void*)geometry; - PDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)disk_geometry; + BYTE geometry[256]; + PDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)(void*)geometry; hPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE); if (hPhysical == INVALID_HANDLE_VALUE) @@ -588,11 +587,9 @@ int GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSyst BOOL r, hasRufusExtra = FALSE; HANDLE hPhysical; DWORD size; - BYTE geometry[128], layout[4096], part_type; - void* disk_geometry = (void*)geometry; - void* drive_layout = (void*)layout; - PDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)disk_geometry; - PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)drive_layout; + BYTE geometry[256], layout[4096], part_type; + PDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)(void*)geometry; + PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout; char* volume_name; char tmp[256]; DWORD i, nb_partitions = 0; diff --git a/src/format.c b/src/format.c index 1b74bd8e..4af1f248 100644 --- a/src/format.c +++ b/src/format.c @@ -116,7 +116,7 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, PrintStatus(0, TRUE, MSG_218, nb_steps[fs_index], nb_steps[fs_index]); UpdateProgress(OP_CREATE_FS, 100.0f); if(*(BOOLEAN*)pData == FALSE) { - uprintf("Error while formatting.\n"); + uprintf("Error while formatting"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_GEN_FAILURE; } break; @@ -128,27 +128,29 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, // uprintf("Volume size: %s MB\n", (char*)(LONG_PTR)(*(ULONG32*)pData)); break; case FCC_INCOMPATIBLE_FILE_SYSTEM: - uprintf("Incompatible File System\n"); + uprintf("Incompatible File System"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_INCOMPATIBLE_FS); break; case FCC_ACCESS_DENIED: - uprintf("Access denied\n"); + uprintf("Access denied"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_ACCESS_DENIED; break; case FCC_MEDIA_WRITE_PROTECTED: - uprintf("Media is write protected\n"); + uprintf("Media is write protected"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_WRITE_PROTECT; break; case FCC_VOLUME_IN_USE: - uprintf("Volume is in use\n"); + uprintf("Volume is in use"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_DEVICE_IN_USE; break; + case FCC_DEVICE_NOT_READY: + uprintf("The device is not ready"); case FCC_CANT_QUICK_FORMAT: - uprintf("Cannot quick format this volume\n"); + uprintf("Cannot quick format this volume"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_QUICK_FORMAT); break; case FCC_BAD_LABEL: - uprintf("Bad label\n"); + uprintf("Bad label"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_LABEL_TOO_LONG; break; case FCC_OUTPUT: @@ -156,19 +158,19 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, break; case FCC_CLUSTER_SIZE_TOO_BIG: case FCC_CLUSTER_SIZE_TOO_SMALL: - uprintf("Unsupported cluster size\n"); + uprintf("Unsupported cluster size"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_INVALID_CLUSTER_SIZE); break; case FCC_VOLUME_TOO_BIG: case FCC_VOLUME_TOO_SMALL: - uprintf("Volume is too %s\n", FCC_VOLUME_TOO_BIG?"big":"small"); + uprintf("Volume is too %s", FCC_VOLUME_TOO_BIG?"big":"small"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_INVALID_VOLUME_SIZE); case FCC_NO_MEDIA_IN_DRIVE: - uprintf("No media in drive\n"); + uprintf("No media in drive"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_NO_MEDIA_IN_DRIVE; break; default: - uprintf("FormatExCallback: received unhandled command %X\n", Command); + uprintf("FormatExCallback: Received unhandled command 0x02%X - aborting", Command); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_NOT_SUPPORTED; break; } @@ -371,6 +373,8 @@ static BOOL FormatFAT32(DWORD DriveIndex) HANDLE hLogicalVolume; DWORD cbRet; DISK_GEOMETRY dgDrive; + BYTE geometry_ex[256]; // DISK_GEOMETRY_EX is variable size + PDISK_GEOMETRY_EX xdgDrive = (PDISK_GEOMETRY_EX)(void*)geometry_ex; PARTITION_INFORMATION piDrive; PARTITION_INFORMATION_EX xpiDrive; // Recommended values @@ -417,21 +421,28 @@ static BOOL FormatFAT32(DWORD DriveIndex) // Work out drive params if (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &dgDrive, sizeof(dgDrive), &cbRet, NULL)) { - die("Failed to get device geometry\n", ERROR_NOT_SUPPORTED); + if (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, xdgDrive, + sizeof(geometry_ex), &cbRet, NULL)) { + uprintf("IOCTL_DISK_GET_DRIVE_GEOMETRY error: %s\n", WindowsErrorString()); + die("Failed to get device geometry (both regular and _ex)\n", ERROR_NOT_SUPPORTED); + } + memcpy(&dgDrive, &xdgDrive->Geometry, sizeof(dgDrive)); } if (IS_ERROR(FormatStatus)) goto out; if (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_PARTITION_INFO, NULL, 0, &piDrive, sizeof(piDrive), &cbRet, NULL)) { if (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, &xpiDrive, sizeof(xpiDrive), &cbRet, NULL)) { - die("Failed to get partition info (both regular and _ex)", ERROR_NOT_SUPPORTED); + uprintf("IOCTL_DISK_GET_PARTITION_INFO error: %s\n", WindowsErrorString()); + die("Failed to get partition info (both regular and _ex)\n", ERROR_NOT_SUPPORTED); } - memset (&piDrive, 0, sizeof(piDrive)); + memset(&piDrive, 0, sizeof(piDrive)); piDrive.StartingOffset.QuadPart = xpiDrive.StartingOffset.QuadPart; piDrive.PartitionLength.QuadPart = xpiDrive.PartitionLength.QuadPart; piDrive.HiddenSectors = (DWORD) (xpiDrive.StartingOffset.QuadPart / dgDrive.BytesPerSector); } + if (IS_ERROR(FormatStatus)) goto out; BytesPerSect = dgDrive.BytesPerSector; @@ -450,7 +461,7 @@ static BOOL FormatFAT32(DWORD DriveIndex) // There would need to be an extra field in the FSInfo sector, and the old sector count could // be set to 0xffffffff. This is non standard though, the Windows FAT driver FASTFAT.SYS won't // understand this. Perhaps a future version of FAT32 and FASTFAT will handle this. - die ("This drive is too big for FAT32 - max 2TB supported\n", APPERR(ERROR_INVALID_VOLUME_SIZE)); + die("This drive is too big for FAT32 - max 2TB supported\n", APPERR(ERROR_INVALID_VOLUME_SIZE)); } pFAT32BootSect = (FAT_BOOTSECTOR32*) calloc(BytesPerSect, 1); diff --git a/src/format.h b/src/format.h index 78b14904..bfedab96 100644 --- a/src/format.h +++ b/src/format.h @@ -49,7 +49,7 @@ typedef enum { FCC_UNKNOWN15, FCC_UNKNOWN16, FCC_UNKNOWN17, - FCC_UNKNOWN18, + FCC_DEVICE_NOT_READY, FCC_CHECKDISK_PROGRESS, FCC_UNKNOWN1A, FCC_UNKNOWN1B, diff --git a/src/rufus.rc b/src/rufus.rc index 15e5d67d..10e54cde 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.6.442" +CAPTION "Rufus 1.4.6.443" 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.6.442" +CAPTION "Rufus 1.4.6.443" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -427,8 +427,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,6,442 - PRODUCTVERSION 1,4,6,442 + FILEVERSION 1,4,6,443 + PRODUCTVERSION 1,4,6,443 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -445,13 +445,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.6.442" + VALUE "FileVersion", "1.4.6.443" 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.6.442" + VALUE "ProductVersion", "1.4.6.443" END END BLOCK "VarFileInfo" From 027d0d7c3a005b60672b56be96e2fdacefa661fa Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 29 Mar 2014 00:22:54 +0000 Subject: [PATCH 3/5] [core] add ReFS formatting support * Windows 8.1 or later and fixed disks ONLY --- src/drive.c | 6 ++++-- src/rufus.c | 14 ++++++++++---- src/rufus.h | 1 + src/rufus.rc | 12 ++++++------ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/drive.c b/src/drive.c index 7116a126..4d5132bf 100644 --- a/src/drive.c +++ b/src/drive.c @@ -615,7 +615,8 @@ int GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSyst } SelectedDrive.DiskSize = DiskGeometry->DiskSize.QuadPart; memcpy(&SelectedDrive.Geometry, &DiskGeometry->Geometry, sizeof(DISK_GEOMETRY)); - uprintf("Sector Size: %d bytes\n", DiskGeometry->Geometry.BytesPerSector); + uprintf("Disk type: %s, Sector Size: %d bytes\n", (DiskGeometry->Geometry.MediaType == FixedMedia)?"Fixed":"Removable", + DiskGeometry->Geometry.BytesPerSector); uprintf("Cylinders: %lld, TracksPerCylinder: %d, SectorsPerTrack: %d\n", DiskGeometry->Geometry.Cylinders, DiskGeometry->Geometry.TracksPerCylinder, DiskGeometry->Geometry.SectorsPerTrack); @@ -900,7 +901,8 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m case FS_NTFS: case FS_EXFAT: case FS_UDF: - DriveLayoutEx.PartitionEntry[0].Mbr.PartitionType = 0x07; // NTFS + case FS_REFS: + DriveLayoutEx.PartitionEntry[0].Mbr.PartitionType = 0x07; break; case FS_FAT32: DriveLayoutEx.PartitionEntry[0].Mbr.PartitionType = 0x0c; // FAT32 LBA diff --git a/src/rufus.c b/src/rufus.c index 1393bec9..5ca8a3c3 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -107,7 +107,7 @@ typedef ULONG (WINAPI *SHChangeNotifyRegister_t)( const MY_SHChangeNotifyEntry *pshcne ); -const char* FileSystemLabel[FS_MAX] = { "FAT", "FAT32", "NTFS", "UDF", "exFAT" }; +const char* FileSystemLabel[FS_MAX] = { "FAT", "FAT32", "NTFS", "UDF", "exFAT", "ReFS" }; // Number of steps for each FS for FCC_STRUCTURE_PROGRESS const int nb_steps[FS_MAX] = { 5, 5, 12, 1, 10 }; static const char* PartitionTypeLabel[2] = { "MBR", "GPT" }; @@ -310,6 +310,12 @@ static BOOL DefineClusterSizes(void) SelectedDrive.ClusterSize[FS_UDF].Allowed = 0x00000100; SelectedDrive.ClusterSize[FS_UDF].Default = 1; } + + // ReFS (only supported for Windows 8.1 and later and for fixed disks) + if ((nWindowsVersion >= WINDOWS_8_1_OR_LATER) && (SelectedDrive.Geometry.MediaType == FixedMedia)) { + SelectedDrive.ClusterSize[FS_REFS].Allowed = 0x00000100; + SelectedDrive.ClusterSize[FS_REFS].Default = 1; + } } out: @@ -2012,8 +2018,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA break; } SetClusterSizes(fs); - // Disable/restore the quick format control depending on large FAT32 - if ((fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32))) { + // Disable/restore the quick format control depending on large FAT32 or ReFS + if ( ((fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32))) || (fs == FS_REFS) ) { if (IsWindowEnabled(GetDlgItem(hMainDialog, IDC_QUICKFORMAT))) { uQFChecked = IsChecked(IDC_QUICKFORMAT); CheckDlgButton(hMainDialog, IDC_QUICKFORMAT, BST_CHECKED); @@ -2036,7 +2042,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA } break; } - if ((fs == FS_EXFAT) || (fs == FS_UDF)) { + if ((fs == FS_EXFAT) || (fs == FS_UDF) || (fs == FS_REFS)) { if (IsWindowEnabled(hBoot)) { // unlikely to be supported by BIOSes => don't bother IGNORE_RETVAL(ComboBox_SetCurSel(hBootType, 0)); diff --git a/src/rufus.h b/src/rufus.h index f471c80d..61d75111 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -171,6 +171,7 @@ enum { FS_NTFS, FS_UDF, FS_EXFAT, + FS_REFS, FS_MAX }; diff --git a/src/rufus.rc b/src/rufus.rc index 10e54cde..f665d968 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.6.443" +CAPTION "Rufus 1.4.6.444" 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.6.443" +CAPTION "Rufus 1.4.6.444" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -427,8 +427,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,6,443 - PRODUCTVERSION 1,4,6,443 + FILEVERSION 1,4,6,444 + PRODUCTVERSION 1,4,6,444 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -445,13 +445,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.6.443" + VALUE "FileVersion", "1.4.6.444" 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.6.443" + VALUE "ProductVersion", "1.4.6.444" END END BLOCK "VarFileInfo" From b343d9b86d11a9db1604b743b8825c312389ef18 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 29 Mar 2014 00:42:49 +0000 Subject: [PATCH 4/5] [misc] fix issues with unpartitioned drives and bad blocks reports * Listing an unpartitioned could result in all controls besides drive selection dropdown being blank * The bad blocks report was not displaying the right values * Also update version to Rufus next --- configure | 20 ++++----- configure.ac | 2 +- res/localization/ChangeLog.txt | 7 ++++ res/localization/rufus.loc | 74 +++++++++++++++++----------------- src/format.c | 4 +- src/rufus.c | 2 - src/rufus.rc | 12 +++--- src/stdio.c | 1 + 8 files changed, 64 insertions(+), 58 deletions(-) diff --git a/configure b/configure index 867b78d4..76e2f77c 100644 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for rufus 1.4.6. +# Generated by GNU Autoconf 2.68 for rufus 1.4.7. # # Report bugs to . # @@ -560,8 +560,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='1.4.6' -PACKAGE_STRING='rufus 1.4.6' +PACKAGE_VERSION='1.4.7' +PACKAGE_STRING='rufus 1.4.7' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='http://rufus.akeo.ie' @@ -1203,7 +1203,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 1.4.6 to adapt to many kinds of systems. +\`configure' configures rufus 1.4.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1269,7 +1269,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 1.4.6:";; + short | recursive ) echo "Configuration of rufus 1.4.7:";; esac cat <<\_ACEOF @@ -1357,7 +1357,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 1.4.6 +rufus configure 1.4.7 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1412,7 +1412,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 1.4.6, which was +It was created by rufus $as_me 1.4.7, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2227,7 +2227,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='1.4.6' + VERSION='1.4.7' cat >>confdefs.h <<_ACEOF @@ -4140,7 +4140,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 1.4.6, which was +This file was extended by rufus $as_me 1.4.7, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4194,7 +4194,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rufus config.status 1.4.6 +rufus config.status 1.4.7 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 418b26e0..99f55361 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [1.4.6], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie]) +AC_INIT([rufus], [1.4.7], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/res/localization/ChangeLog.txt b/res/localization/ChangeLog.txt index 25c10e6f..98ef5852 100644 --- a/res/localization/ChangeLog.txt +++ b/res/localization/ChangeLog.txt @@ -3,6 +3,9 @@ rufus.loc since its original version. Translators are expected to keep their translations up to date by monitoring this file on regular basis and applying the same changes. +When editing an existing translation, make sure you always follow: +https://github.com/pbatard/rufus/wiki/Localization#Editing_a_translation + Remember to also update the version number for your translation ('v x.y.z') once you have matched all the changes that occurred for the en-US translation. @@ -12,6 +15,10 @@ content. PLEASE, do not just look at this Changelog when updating your translation, but always use the English section of rufus.loc as your base. For instance, MSG_114, that was introduced in v1.0.8 is MORE than one line! +o Version 1.0.11 (2014.03.29) + - Changed MSG_011 "%u bad block(s) found" -> "%d bad block(s) found" + Note: since this doesn't require translator involvement, I have applied the change to existing translations. + o Version 1.0.10 (2014.02.09) - *NEW* MSG_095 "DD Image" - *NEW* MSG_261 "Writing image: %0.1f%% completed" diff --git a/res/localization/rufus.loc b/res/localization/rufus.loc index c2b7c280..e7ea0cb3 100644 --- a/res/localization/rufus.loc +++ b/res/localization/rufus.loc @@ -53,7 +53,7 @@ # http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-LCID%5D.pdf # for the LCID (0x####) codes you should use l "en-US" "English (English)" 0x0409, 0x0809, 0x0c09, 0x1009, 0x1409, 0x1809, 0x1c09, 0x2009, 0x2409, 0x2809, 0x2c09, 0x3009, 0x3409, 0x3809, 0x3c09, 0x4009, 0x4409, 0x4809 -v 1.0.10 +v 1.0.11 # Main dialog g IDD_DIALOG @@ -145,7 +145,7 @@ t MSG_007 "Cancel" t MSG_008 "Yes" t MSG_009 "No" t MSG_010 "Bad blocks found" -t MSG_011 "Check completed: %u bad block(s) found\n" +t MSG_011 "Check completed: %d bad block(s) found\n" " %d read error(s)\n %d write error(s)\n %d corruption error(s)\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nA more detailed report can be found in:\n%s" @@ -498,7 +498,7 @@ t MSG_212 "فشل" ###################################################################### l "bg-BG" "Bulgarian (Български)" 0x0402 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -635,7 +635,7 @@ t MSG_007 "Прекрати" t MSG_008 "Да" t MSG_009 "Не" t MSG_010 "Намерени са лоши блокове" -t MSG_011 "Проверката завършена: намерени са %u лоши блокове\n" +t MSG_011 "Проверката завършена: намерени са %d лоши блокове\n" " %d грешки при четене\n %d грешки при запис\n %d повредени\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nA По подробен доклад може да намерите в:\n%s" @@ -926,7 +926,7 @@ t MSG_261 "Писане на образ: %0.1f%% завършено" ################################################################################ l "zh-CN" "Chinese Simplified (简体中文)" 0x0804, 0x1004 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -1014,7 +1014,7 @@ t MSG_007 "取消" t MSG_008 "是" t MSG_009 "否" t MSG_010 "检测到坏快" -t MSG_011 "扫描结果:检测到 %u 个坏快\n" +t MSG_011 "扫描结果:检测到 %d 个坏快\n" " %d 读取错误\n %d 写入错误\n %d 损坏错误\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\n详细报告位于:\n%s" @@ -1282,7 +1282,7 @@ t MSG_261 "写入镜像:已完成 %0.1f%%" ################################################################################ l "zh-TW" "Chinese Traditional (正體中文)" 0x0404, 0x0c04, 0x1404, 0x7c04 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -1386,7 +1386,7 @@ t MSG_007 "取消" t MSG_008 "是" t MSG_009 "否" t MSG_010 "偵測到損毀磁區" -t MSG_011 "掃描結果: %u 個異常\n" +t MSG_011 "掃描結果: %d 個異常\n" " %d 讀取錯誤\n %d 寫入錯誤\n %d 損毀錯誤\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\n詳細報告位於:\n%s" @@ -1771,7 +1771,7 @@ t MSG_007 "Annuleren" t MSG_008 "Ja" t MSG_009 "Nee" t MSG_010 "Slechte blokken gevonden" -t MSG_011 "Controle voltooid: %u slechte blok(ken) gevonden\n" +t MSG_011 "Controle voltooid: %d slechte blok(ken) gevonden\n" " %d leesfout(en)\n %d schrijffout(en)\n %d corruptiefout(en)\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nEen meer gedetailleerder rapport kan worden gevonden in:\n%s" @@ -2031,7 +2031,7 @@ t MSG_259 "Forceer update" ################################################################################ l "fi-FI" "Finnish (Suomi)" 0x040B -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -2139,7 +2139,7 @@ t MSG_007 "Peruuta" t MSG_008 "Kyllä" t MSG_009 "Ei" t MSG_010 "Viallisia lohkoja löydetty" -t MSG_011 "Tarkistus valmis: %u viallista lohkoa löydetty\n" +t MSG_011 "Tarkistus valmis: %d viallista lohkoa löydetty\n" " %d lukuvirhe(ttä)\n %d kirjoitusvirhe(ttä)\n %d korruptiovirhe(ttä)\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nA voit tarkastella tarkempaa raporttia kohteessa:\n%s" @@ -2429,7 +2429,7 @@ t MSG_261 "Kirjoitetaan levykuvaa: %0.1f%% valmiina" ################################################################################ l "fr-FR" "French (Français)" 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c -v 1.0.10 +v 1.0.11 b "en-US" g IDD_DIALOG @@ -2525,7 +2525,7 @@ t MSG_007 "Annuler" t MSG_008 "Oui" t MSG_009 "Non" t MSG_010 "Blocs défectueux détectés" -t MSG_011 "Vérification complète : %u bloc(s) défectueux détecté(s)\n" +t MSG_011 "Vérification complète : %d bloc(s) défectueux détecté(s)\n" " %d erreur(s) de lecture\n %d erreur(s) d'écriture\n %d erreur(s) de corruption\n" t MSG_012 "%s\nUn rapport plus détaillé peut être obtenu à :\n%s" t MSG_013 "Jamais" @@ -2788,7 +2788,7 @@ t MSG_261 "Ecriture d'image : %0.1f%% complété" ################################################################################ l "de-DE" "German (Deutsch)" 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407 -v 1.0.10 +v 1.0.11 b "en-US" g IDD_DIALOG @@ -2901,7 +2901,7 @@ t MSG_007 "Abbruch" t MSG_008 "Ja" t MSG_009 "Nein" t MSG_010 "Fehlerhafte Blöcke gefunden" -t MSG_011 "Prüfung abgeschlossen: %u fehlerhafte Blöcke gefunden\n" +t MSG_011 "Prüfung abgeschlossen: %d fehlerhafte Blöcke gefunden\n" " %d Lesefehler\n %d Schreibfehler\n %d Defekt(e)\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nEin detaillierter Bericht ist hier zu finden:\n%s" @@ -3175,7 +3175,7 @@ t MSG_261 "Schreibe Abbild-Datei: %0.1f%% fertiggestellt" ################################################################################ l "el-GR" "Greek (Ελληνικά)" 0x0408 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -3319,7 +3319,7 @@ t MSG_007 "Άκυρο" t MSG_008 "Ναι" t MSG_009 "Όχι" t MSG_010 "Βρέθηκαν κατεστραμμένοι τομείς" -t MSG_011 "Ο έλεγχος ολοκληρώθηκε: βρέθηκαν %u κατεστραμμένοι τομείς \n" +t MSG_011 "Ο έλεγχος ολοκληρώθηκε: βρέθηκαν %d κατεστραμμένοι τομείς \n" " %d σφάλματα ανάγνωσης\n %d σφάλματα εγγραφής\n %d σφάλματα διαστρέβλωσης\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nΜια πιο λεπτομερής αναφορά μπορεί να βρεθεί στο:\n%s" @@ -3687,7 +3687,7 @@ t MSG_007 "Mégse" t MSG_008 "Igen" t MSG_009 "Nem" t MSG_010 "Hibás blokkokat találtam" -t MSG_011 "Ellenörzés befejezve: %u hibás blokk találva\n" +t MSG_011 "Ellenörzés befejezve: %d hibás blokk találva\n" " %d olvasási hiba,\n %d írási hiba\n %d összeomlásra hajlamos hiba\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nEgy részletesebb jelentés itt található:\n%s" @@ -4083,7 +4083,7 @@ t MSG_007 "Batal" t MSG_008 "Ya" t MSG_009 "Tidak" t MSG_010 "Blok buruk ditemukan" -t MSG_011 "Pemeriksaan selesai: %u blok buruk ditemukan\n" +t MSG_011 "Pemeriksaan selesai: %d blok buruk ditemukan\n" " %d read error(s)\n %d write error(s)\n %d corruption error(s)\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nLaporan yang lebih rinci dapat ditemukan di:\n%s" @@ -4355,7 +4355,7 @@ t MSG_259 "Pembaruan Paksa" ################################################################################ l "it-IT" "Italian (Italiano)" 0x0410, 0x0810 -v 1.0.10 +v 1.0.11 b "en-US" g IDD_DIALOG @@ -4465,7 +4465,7 @@ t MSG_007 "Annulla" t MSG_008 "Sì" t MSG_009 "No" t MSG_010 "Rilevato blocco difettoso" -t MSG_011 "Controllo completato: trovati %u blocchi difettosi\n" +t MSG_011 "Controllo completato: trovati %d blocchi difettosi\n" " %d errori lettura\n %d errori scrittura\n %d errori corruzione\n" t MSG_012 "%s\nUn report più dettagliato è disponibile in:\n%s" t MSG_013 "Disabilitato" @@ -4731,7 +4731,7 @@ t MSG_261 "Scrittura immagine: %0.1f%% completata" ################################################################################ l "ko-KR" "Korean (한국어)" 0x0412 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -4835,7 +4835,7 @@ t MSG_007 "취소" t MSG_008 "예" t MSG_009 "아니오" t MSG_010 "배드 섹터 발견 됨." -t MSG_011 "검사 완료: %u 개의 배트섹터가 발견되었습니다.\n" +t MSG_011 "검사 완료: %d 개의 배트섹터가 발견되었습니다.\n" " %d 읽기 오류\n %d 쓰기 오류\n %d 손상 섹터\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\n보고에 대한 상세 정보:\n%s" @@ -5123,7 +5123,7 @@ t MSG_261 "이미지 만들기: %0.1f%% 완료" ################################################################################ l "lt-LT" "Lithuanian (Lietuvių)" 0x0427 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -5249,7 +5249,7 @@ t MSG_007 "Atšaukti" t MSG_008 "Taip" t MSG_009 "Ne" t MSG_010 "Rasta blogų blokų" -t MSG_011 "Tikrinimas baigtas: rasta %u blogų blokų\n" +t MSG_011 "Tikrinimas baigtas: rasta %d blogų blokų\n" " %d skaitymo klaidų\n %d rašymo klaidų\n %d iškraipymo klaidų\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nIšsamesnę ataskaitą rasite:\n%s" @@ -5539,7 +5539,7 @@ t MSG_261 "Rašomas atvaizdas: %0.1f%% baigta" ################################################################################ l "ms-MY" "Malay (Bahasa Malaysia)" 0x043e, 0x083e -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -5668,7 +5668,7 @@ t MSG_007 "batal" t MSG_008 "Ya" t MSG_009 "Tidak" t MSG_010 "Blok rosak dijumpai" -t MSG_011 "Semak selsesai: %u blok rosak dijumpai\n" +t MSG_011 "Semak selsesai: %d blok rosak dijumpai\n" " %d error membaca\n %d error menulis\n %d error korupsi\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nA more detailed report can be found in:\n%s" @@ -5959,7 +5959,7 @@ t MSG_261 "Menulis imej: %0.1f%% selesai" ################################################################################ l "pl-PL" "Polish (Polski)" 0x0415 -v 1.0.10 +v 1.0.11 b "en-US" # my info: 15.02.2014,16:14 @@ -6087,7 +6087,7 @@ t MSG_007 "Anuluj" t MSG_008 "Tak" t MSG_009 "Nie" t MSG_010 "Znaleziono uskodzone sektory" -t MSG_011 "Sprawdzanie zakończone: znaleziono %u uskodzone sektory(ów)\n" +t MSG_011 "Sprawdzanie zakończone: znaleziono %d uskodzone sektory(ów)\n" " %d błędów odczytu\n %d błędów zapisu\n %d błędy(ów) uszkodzeń\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nRaport szczegółowy jest dostępny w:\n%s" @@ -6508,7 +6508,7 @@ t MSG_007 "Cancelar" t MSG_008 "Sim" t MSG_009 "Não" t MSG_010 "Foram encontrados erros no disco" -t MSG_011 "Verificação completa: %u erros encontrados\n" +t MSG_011 "Verificação completa: %d erros encontrados\n" " %d erros de leitura\n %d erros de escrita\n %d erros de corrupção\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nMais informações disponíveis em:\n%s" @@ -6898,7 +6898,7 @@ t MSG_007 "Anulează" t MSG_008 "Da" t MSG_009 "Nu" t MSG_010 "Bloc defect Detectat" -t MSG_011 "Verificare completă: s-au găsit %u blocuri defecte\n" +t MSG_011 "Verificare completă: s-au găsit %d blocuri defecte\n" " %d erori de citire\n %d erori de scriere\n %d erori de corupţie\n" t MSG_012 "%s\n Un raport mai detaliat este disponibil în:\n%s" t MSG_013 "Invalid" @@ -7152,7 +7152,7 @@ t MSG_260 "Compresie NTFS" ################################################################################ l "ru-RU" "Russian (Русский)" 0x0419, 0x0819 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -7289,7 +7289,7 @@ t MSG_007 "Отмена" t MSG_008 "Да" t MSG_009 "Нет" t MSG_010 "Найдены плохие блоки" -t MSG_011 "Проверка закончена: %u плохих блоков найдено\n" +t MSG_011 "Проверка закончена: %d плохих блоков найдено\n" " %d ошибок чтения\n %d ошибок записи\n %d поврежденных блоков\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nБолее подробный отчет можно найти в:\n%s" @@ -7558,7 +7558,7 @@ t MSG_261 "Запись образа: %0.1f%% выполнено" ################################################################################ l "sl-SI" "Slovene (Slovenščina)" 0x0424 -v 1.0.10 +v 1.0.11 b "en-US" # Main dialog @@ -7673,7 +7673,7 @@ t MSG_007 "Prekliči" t MSG_008 "Da" t MSG_009 "Ne" t MSG_010 "Slabi bloki najdeni" -t MSG_011 "Preizkus končan: %u slabih blokov najdenih\n" +t MSG_011 "Preizkus končan: %d slabih blokov najdenih\n" " Napak pri branju: %d\n Napak pri pisanju: %d\n %d corruption error(s)\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nPodrobnejše poročilo lahko najdete v datoteki\n%s" @@ -8086,7 +8086,7 @@ t MSG_007 "Cancelar" t MSG_008 "Sí" t MSG_009 "No" t MSG_010 "Se encontraron bloques defectuosos" -t MSG_011 "Verificación completa: se encontraron %u bloques dañados\n" +t MSG_011 "Verificación completa: se encontraron %d bloques dañados\n" " %d errores de lectura\n %d errores de escritura\n %d errores de corrupción\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nEl informe detallado se puede encontrar en:\n%s" @@ -8487,7 +8487,7 @@ t MSG_007 "Vazgeç" t MSG_008 "Evet" t MSG_009 "Hayır" t MSG_010 "Hatalı bloklar bulundu" -t MSG_011 "Denetim Tamamlandı: %u hatalı blok bulundu\n" +t MSG_011 "Denetim Tamamlandı: %d hatalı blok bulundu\n" " %d okuma hatası\n %d yazma hatası\n %d hata oluşumu\n" # The following will contain the formatted message above as well as the name of the bad blocks logfile t MSG_012 "%s\nDaha ayrıntılı rapor burada:\n%s" diff --git a/src/format.c b/src/format.c index 4af1f248..b9b09df1 100644 --- a/src/format.c +++ b/src/format.c @@ -1315,12 +1315,12 @@ DWORD WINAPI FormatThread(void* param) _unlink(logfile); goto out; } - uprintf("Bad Blocks: Check completed, %u bad block%s found. (%d/%d/%d errors)\n", + uprintf("Bad Blocks: Check completed, %d bad block%s found. (%d/%d/%d errors)\n", report.bb_count, (report.bb_count==1)?"":"s", report.num_read_errors, report.num_write_errors, report.num_corruption_errors); r = IDOK; if (report.bb_count) { - bb_msg = lmprintf(MSG_011, report.num_read_errors, report.num_write_errors, + bb_msg = lmprintf(MSG_011, report.bb_count, report.num_read_errors, report.num_write_errors, report.num_corruption_errors); fprintf(log_fd, bb_msg); GetLocalTime(<); diff --git a/src/rufus.c b/src/rufus.c index 5ca8a3c3..608b4fb1 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -397,8 +397,6 @@ static BOOL SetDriveInfo(int ComboIndex) SelectedDrive.DeviceNumber = (DWORD)ComboBox_GetItemData(hDeviceList, ComboIndex); SelectedDrive.nPartitions = GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_type, sizeof(fs_type)); - if (SelectedDrive.nPartitions == 0) - return FALSE; if (!DefineClusterSizes()) { uprintf("No file system is selectable for this drive\n"); diff --git a/src/rufus.rc b/src/rufus.rc index f665d968..7d7f12d5 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.6.444" +CAPTION "Rufus 1.4.7.445" 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.6.444" +CAPTION "Rufus 1.4.7.445" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -427,8 +427,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,6,444 - PRODUCTVERSION 1,4,6,444 + FILEVERSION 1,4,7,445 + PRODUCTVERSION 1,4,7,445 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -445,13 +445,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.6.444" + VALUE "FileVersion", "1.4.7.445" 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.6.444" + VALUE "ProductVersion", "1.4.7.445" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 6f6e5b2f..9077ffef 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -196,6 +196,7 @@ char* SizeToHumanReadable(uint64_t size, BOOL log, BOOL fake_units) const char* _StrError(DWORD error_code) { if ( (!IS_ERROR(error_code)) || (SCODE_CODE(error_code) == ERROR_SUCCESS)) { + // TODO: this message is wrong! return lmprintf(MSG_044); } if (SCODE_FACILITY(error_code) != FACILITY_STORAGE) { From 3f0d9d108f299e178102db57fe0a78fa83747a47 Mon Sep 17 00:00:00 2001 From: Scott Date: Fri, 28 Mar 2014 23:32:30 +1100 Subject: [PATCH 5/5] [core] add VHD target support * Adds Microsoft VHD/VHDX mounted image support * Also fix an issue where some devices would not be detected due to CM_Get_Device_ID_List_Size() returning a list size larger than actually required * Closes #305 * Closes #139 --- src/rufus.c | 50 ++++++++++++++++++++++++++++++-------------------- src/rufus.rc | 12 ++++++------ 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 608b4fb1..a156810a 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -631,17 +631,18 @@ static BOOL GetUSBDevices(DWORD devnum) { // The first two are standard Microsoft drivers (including the Windows 8 UASP one). // The rest are the vendor UASP drivers I know of so far - list may be incomplete! - const char* usbstor_name[] = { "USBSTOR", "UASPSTOR", "VUSBSTOR", "EtronSTOR" }; + const char* storage_name[] = { "USBSTOR", "UASPSTOR", "VUSBSTOR", "ETRONSTOR" }; const char* scsi_name = "SCSI"; + const char* vhd_name = "Microsoft Virtual Disk"; char letter_name[] = " (?:)"; - BOOL found = FALSE, is_SCSI, is_UASP; + BOOL found = FALSE, is_SCSI, is_UASP, is_VHD; HDEVINFO dev_info = NULL; SP_DEVINFO_DATA dev_info_data; SP_DEVICE_INTERFACE_DATA devint_data; PSP_DEVICE_INTERFACE_DETAIL_DATA_A devint_detail_data; DEVINST parent_inst, device_inst; DWORD size, i, j, k, datatype, drive_index; - ULONG list_size[ARRAYSIZE(usbstor_name)], full_list_size; + ULONG list_size[ARRAYSIZE(storage_name)], full_list_size; HANDLE hDrive; LONG maxwidth = 0; RECT rect; @@ -664,10 +665,10 @@ static BOOL GetUSBDevices(DWORD devnum) } full_list_size = 0; - for (s=0; s 1) { - CM_Get_Device_ID_ListA(usbstor_name[s], &devid_list[i], list_size[s], CM_GETIDLIST_FILTER_SERVICE); - i += list_size[s]-1; + CM_Get_Device_ID_ListA(storage_name[s], &devid_list[i], list_size[s], CM_GETIDLIST_FILTER_SERVICE); + // list_size is sometimes larger than required thus we need to find the real end + for (i += list_size[s]; i > 2; i--) { + if ((devid_list[i-2] != '\0') && (devid_list[i-1] == '\0') && (devid_list[i] == '\0')) + break; + } } } @@ -698,16 +703,18 @@ static BOOL GetUSBDevices(DWORD devnum) } // UASP drives are listed under SCSI (along with regular SYSTEM drives => "DANGER, WILL ROBINSON!!!") is_SCSI = (safe_stricmp(buffer, scsi_name) == 0); - if ((safe_stricmp(buffer, usbstor_name[0]) != 0) && (!is_SCSI)) + if ((safe_stricmp(buffer, storage_name[0]) != 0) && (!is_SCSI)) continue; memset(buffer, 0, sizeof(buffer)); vid = 0; pid = 0; - is_UASP = FALSE; + is_UASP = FALSE, is_VHD = FALSE; if (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_FRIENDLYNAME, &datatype, (LPBYTE)buffer, sizeof(buffer), &size)) { 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)" safe_strcpy(buffer, sizeof(buffer), lmprintf(MSG_045)); + } else if (safe_stricmp(buffer, vhd_name) == 0) { + is_VHD = TRUE; } else { // Get the VID:PID of the device. We could avoid doing this lookup every time by keeping // a lookup table, but there shouldn't be that many USB storage devices connected... @@ -733,18 +740,21 @@ static BOOL GetUSBDevices(DWORD devnum) } } } - if ((vid == 0) && (pid == 0)) { - if (is_SCSI) { - // If we have an SCSI drive and couldn't get a VID:PID, we are most likely - // dealing with a system drive => eliminate it! - continue; - } - safe_strcpy(str, sizeof(str), "????:????"); // Couldn't figure VID:PID + if (is_VHD) { + uprintf("Found VHD device '%s'\n", buffer); } else { - safe_sprintf(str, sizeof(str), "%04X:%04X", vid, pid); + if ((vid == 0) && (pid == 0)) { + if (is_SCSI) { + // If we have an SCSI drive and couldn't get a VID:PID, we are most likely + // dealing with a system drive => eliminate it! + continue; + } + safe_strcpy(str, sizeof(str), "????:????"); // Couldn't figure VID:PID + } else { + safe_sprintf(str, sizeof(str), "%04X:%04X", vid, pid); + } + uprintf("Found %s device '%s' (%s)\n", is_UASP?"UAS":"USB", buffer, str); } - uprintf("Found %s device '%s' (%s)\n", is_UASP?"UAS":"USB", buffer, str); - devint_data.cbSize = sizeof(devint_data); hDrive = INVALID_HANDLE_VALUE; devint_detail_data = NULL; diff --git a/src/rufus.rc b/src/rufus.rc index 7d7f12d5..aef702e9 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.7.445" +CAPTION "Rufus 1.4.7.446" 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.7.445" +CAPTION "Rufus 1.4.7.446" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -427,8 +427,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,7,445 - PRODUCTVERSION 1,4,7,445 + FILEVERSION 1,4,7,446 + PRODUCTVERSION 1,4,7,446 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -445,13 +445,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.7.445" + VALUE "FileVersion", "1.4.7.446" 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.7.445" + VALUE "ProductVersion", "1.4.7.446" END END BLOCK "VarFileInfo"