diff --git a/src/drive.c b/src/drive.c index d67b6924..9b550cd1 100644 --- a/src/drive.c +++ b/src/drive.c @@ -383,7 +383,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, geometry, sizeof(geometry), &size, NULL); if (!r || size <= 0) { - uprintf("Could not get geometry for drive #%d: %s\n", DriveIndex, WindowsErrorString()); + uprintf("Could not get geometry for drive 0x%02x: %s\n", DriveIndex, WindowsErrorString()); safe_closehandle(hPhysical); return FALSE; } @@ -396,7 +396,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL ); if (!r || size <= 0) { - uprintf("Could not get layout for drive #d: %s\n", DriveIndex, WindowsErrorString()); + uprintf("Could not get layout for drive 0x%02x: %s\n", DriveIndex, WindowsErrorString()); return FALSE; } diff --git a/src/format.c b/src/format.c index 2c59a530..6bad3e14 100644 --- a/src/format.c +++ b/src/format.c @@ -881,7 +881,7 @@ static BOOL WriteMBR(HANDLE hPhysicalDrive) r = write_syslinux_mbr(&fake_fd); } else { if ((IS_WINPE(iso_report.winpe) && !iso_report.uses_minint) || (IsChecked(IDC_RUFUS_MBR))) { - uprintf("Using Rufus bootable USB selection MBR\n"); + uprintf("Using " APPLICATION_NAME " bootable USB selection MBR\n"); r = WriteRufusMBR(&fake_fd); } else { uprintf("Using Windows 7 MBR\n"); @@ -1243,7 +1243,7 @@ DWORD WINAPI FormatThread(LPVOID param) if (log_fd == NULL) { uprintf("Could not create log file for bad blocks check\n"); } else { - fprintf(log_fd, "Rufus bad blocks check started on: %04d.%02d.%02d %02d:%02d:%02d\n", + fprintf(log_fd, APPLICATION_NAME " bad blocks check started on: %04d.%02d.%02d %02d:%02d:%02d\n", lt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond); fflush(log_fd); } @@ -1271,7 +1271,7 @@ DWORD WINAPI FormatThread(LPVOID param) report.num_corruption_errors); fprintf(log_fd, "%s", bb_msg); GetLocalTime(<); - fprintf(log_fd, "Rufus bad blocks check ended on: %04d.%02d.%02d %02d:%02d:%02d\n", + fprintf(log_fd, APPLICATION_NAME " bad blocks check ended on: %04d.%02d.%02d %02d:%02d:%02d\n", lt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond); fclose(log_fd); safe_sprintf(&bb_msg[strlen(bb_msg)], sizeof(bb_msg)-strlen(bb_msg)-1, diff --git a/src/net.c b/src/net.c index 1084a08b..e27c6b6f 100644 --- a/src/net.c +++ b/src/net.c @@ -314,7 +314,7 @@ BOOL DownloadFile(const char* url, const char* file, HWND hProgressDialog) HttpQueryInfoA(hRequest, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, (LPVOID)&dwStatus, &dwSize, NULL); if (dwStatus != 200) { error_code = ERROR_INTERNET_ITEM_NOT_FOUND; - uprintf("Unable to acess file. Server status %d\n", dwStatus); + uprintf("Unable to acess file: Server status %d\n", dwStatus); goto out; } dwSize = sizeof(dwTotalSize); @@ -326,7 +326,7 @@ BOOL DownloadFile(const char* url, const char* file, HWND hProgressDialog) fd = fopen(file, "wb"); if (fd == NULL) { - uprintf("Unable to create file %s: %s\n", file, WinInetErrorString()); + uprintf("Unable to create file '%s': %s\n", file, WinInetErrorString()); goto out; } @@ -342,7 +342,7 @@ BOOL DownloadFile(const char* url, const char* file, HWND hProgressDialog) SendMessage(hProgressBar, PBM_SETPOS, (WPARAM)(MAX_PROGRESS*((1.0f*dwSize)/(1.0f*dwTotalSize))), 0); PrintStatus(0, FALSE, "Downloading: %0.1f%%\n", (100.0f*dwSize)/(1.0f*dwTotalSize)); if (fwrite(buf, 1, dwDownloaded, fd) != dwDownloaded) { - uprintf("Error writing file %s: %s\n", file, WinInetErrorString()); + uprintf("Error writing file '%s': %s\n", file, WinInetErrorString()); goto out; } } @@ -353,7 +353,7 @@ BOOL DownloadFile(const char* url, const char* file, HWND hProgressDialog) goto out; } else { r = TRUE; - uprintf("Successfully downloaded %s\n", file); + uprintf("Successfully downloaded '%s'\n", file); } out: @@ -536,7 +536,7 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) goto out; continue; } - vuprintf("Found match for %s on server %s.", urlpath, server_url); + vuprintf("Found match for %s on server %s", urlpath, server_url); dwSize = sizeof(mime); HttpQueryInfoA(hRequest, HTTP_QUERY_CONTENT_TYPE, (LPVOID)&mime, &dwSize, NULL); @@ -557,11 +557,9 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) WriteRegistryKey64(REGKEY_HKCU, REGKEY_LAST_UPDATE, server_time); // Might as well let the user know if (!force_update_check) { - if (local_time > server_time + 600) { - uprintf("Your local clock appears more than 10 minutes early - You ought to fix that...\n"); - } - if (local_time < server_time - 600) { - uprintf("Your local clock appears more than 10 minutes late - you ought to fix that...\n"); + if ((local_time > server_time + 600) || (local_time < server_time - 600)) { + uprintf("IMPORTANT: Your local clock is more than 10 minutes in the %s. Unless you fix this, " APPLICATION_NAME " may not be able to check for updates...", + (local_time > server_time + 600)?"future":"past"); } } @@ -635,7 +633,7 @@ BOOL CheckForUpdates(BOOL force) if (update_check_in_progress) return FALSE; if (CreateThread(NULL, 0, CheckForUpdatesThread, NULL, 0, NULL) == NULL) { - uprintf("Unable to start check for updates thread"); + uprintf("Unable to start update check thread"); return FALSE; } return TRUE; diff --git a/src/rufus.c b/src/rufus.c index ece3438e..35a230bd 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -336,7 +336,7 @@ static BOOL GetDriveInfo(int ComboIndex) return FALSE; if (!DefineClusterSizes()) { - uprintf("no file system is selectable for this drive\n"); + uprintf("No file system is selectable for this drive\n"); return FALSE; } @@ -622,7 +622,7 @@ static BOOL GetUSBDevices(DWORD devnum) if(GetLastError() != ERROR_NO_MORE_ITEMS) { uprintf("SetupDiEnumDeviceInterfaces failed: %s\n", WindowsErrorString()); } else { - uprintf("Device was eliminated because it doesn't report itself as a disk\n"); + uprintf("Device was eliminated because it didn't report itself as a disk\n"); } break; } @@ -631,7 +631,7 @@ static BOOL GetUSBDevices(DWORD devnum) if(GetLastError() == ERROR_INSUFFICIENT_BUFFER) { devint_detail_data = (PSP_DEVICE_INTERFACE_DETAIL_DATA_A)calloc(1, size); if (devint_detail_data == NULL) { - uprintf("unable to allocate data for SP_DEVICE_INTERFACE_DETAIL_DATA\n"); + uprintf("Unable to allocate data for SP_DEVICE_INTERFACE_DETAIL_DATA\n"); return FALSE; } devint_detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A); @@ -651,7 +651,7 @@ static BOOL GetUSBDevices(DWORD devnum) hDrive = CreateFileA(devint_detail_data->DevicePath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if(hDrive == INVALID_HANDLE_VALUE) { - uprintf("could not open '%s': %s\n", devint_detail_data->DevicePath, WindowsErrorString()); + uprintf("Could not open '%s': %s\n", devint_detail_data->DevicePath, WindowsErrorString()); continue; } @@ -888,10 +888,8 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) log_buffer = (char*)malloc(log_size); if (log_buffer != NULL) { log_size = GetDlgItemTextU(hDlg, IDC_LOG_EDIT, log_buffer, log_size); - if (log_size == 0) { - uprintf("Nothing to save.\n"); - } else { - log_size--; // remove NULL terminator + if (log_size != 0) { + log_size--; // remove NUL terminator filepath = FileDialog(TRUE, app_dir, "rufus.log", "log", "Rufus log"); if (filepath != NULL) { FileIO(TRUE, filepath, &log_buffer, &log_size); @@ -1033,16 +1031,14 @@ DWORD WINAPI ISOScanThread(LPVOID param) } if ((!iso_report.has_bootmgr) && (!iso_report.has_isolinux) && (!IS_WINPE(iso_report.winpe)) && (!iso_report.has_efi)) { MessageBoxU(hMainDialog, "This version of Rufus only supports bootable ISOs\n" - "based on 'bootmgr/WinPE', 'isolinux' or EFI boot.\n" - "This ISO image doesn't appear to use either...", "Unsupported ISO", MB_OK|MB_ICONINFORMATION); + "based on bootmgr/WinPE, isolinux or EFI.\n" + "This ISO doesn't appear to use either...", "Unsupported ISO", MB_OK|MB_ICONINFORMATION); safe_free(iso_path); SetMBRProps(); } else if ((iso_report.has_efi || iso_report.has_win7_efi) && (iso_report.has_4GB_file)) { - // Who the heck decided that using FAT32 for UEFI booting, in late 200x, was a great idea?!? - MessageBoxU(hMainDialog, "Congratulations! You have just exposed the shortshightedness of the UEFI committee, by simply " - "trying to use an EFI based image with a file that is larger than 4 GB.\nPlease address your complaints to any of " - "the companies listed at http://www.uefi.org/about/, for sticking with FAT32 as the default EFI filesystem and thus " - "preventing easy booting of large VHDs with UEFI.", "Who the heck couldn't see that one coming?", MB_OK|MB_ICONINFORMATION); + // Who the heck decided that using FAT32 for UEFI boot was a great idea?!? + MessageBoxU(hMainDialog, "This ISO image contains a file larger than 4 GB and cannot be used to boot in EFI mode from USB.\r\n" + "This is a technical limitation from the UEFI/FAT32 process, not from " APPLICATION_NAME ".", "Non USB-UEFI compatible ISO", MB_OK|MB_ICONINFORMATION); safe_free(iso_path); } else { for(i=0; i