mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-21 10:25:12 -04:00
[ui] fix regression in conditional expression and use %c always
* This fixes the regression introduced in c28f9bc491
.
* 'if ((a && !b) || (!a && b))' can not always be simplified as 'if (a != b)' when the types for 'a' and 'b' are not straight booleans.
* Closes #1862
* Also drop the use of '%C' in printf() expression, as it is intended to print wide characters and not turn a char to uppercase.
This commit is contained in:
parent
891eb45549
commit
036f6260c5
6 changed files with 40 additions and 38 deletions
|
@ -939,7 +939,7 @@ BOOL GetDevices(DWORD devnum)
|
||||||
}
|
}
|
||||||
// Make sure that we don't list any drive that should not be listed
|
// Make sure that we don't list any drive that should not be listed
|
||||||
if (remove_drive) {
|
if (remove_drive) {
|
||||||
uprintf("Removing %C: from the list: This is the %s!", drive_letters[--k],
|
uprintf("Removing %c: from the list: This is the %s!", toupper(drive_letters[--k]),
|
||||||
(remove_drive==1)?"disk from which " APPLICATION_NAME " is running":"system disk");
|
(remove_drive==1)?"disk from which " APPLICATION_NAME " is running":"system disk");
|
||||||
safe_free(devint_detail_data);
|
safe_free(devint_detail_data);
|
||||||
break;
|
break;
|
||||||
|
|
28
src/drive.c
28
src/drive.c
|
@ -1142,11 +1142,11 @@ static BOOL _GetDriveLettersAndType(DWORD DriveIndex, char* drive_letters, UINT*
|
||||||
if ((_drive_type != DRIVE_REMOVABLE) && (_drive_type != DRIVE_FIXED))
|
if ((_drive_type != DRIVE_REMOVABLE) && (_drive_type != DRIVE_FIXED))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
static_sprintf(logical_drive, "\\\\.\\%c:", drive[0]);
|
static_sprintf(logical_drive, "\\\\.\\%c:", toupper(drive[0]));
|
||||||
hDrive = CreateFileA(logical_drive, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
hDrive = CreateFileA(logical_drive, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (hDrive == INVALID_HANDLE_VALUE) {
|
if (hDrive == INVALID_HANDLE_VALUE) {
|
||||||
// uprintf("Warning: could not open drive %c: %s", drive[0], WindowsErrorString());
|
// uprintf("Warning: could not open drive %c: %s", toupper(drive[0]), WindowsErrorString());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1341,11 +1341,11 @@ BOOL GetDriveLabel(DWORD DriveIndex, char* letters, char** label)
|
||||||
if (DeviceIoControl(hPhysical, IOCTL_STORAGE_CHECK_VERIFY, NULL, 0, NULL, 0, &size, NULL))
|
if (DeviceIoControl(hPhysical, IOCTL_STORAGE_CHECK_VERIFY, NULL, 0, NULL, 0, &size, NULL))
|
||||||
AutorunLabel = get_token_data_file("label", AutorunPath);
|
AutorunLabel = get_token_data_file("label", AutorunPath);
|
||||||
else if (GetLastError() == ERROR_NOT_READY)
|
else if (GetLastError() == ERROR_NOT_READY)
|
||||||
uprintf("Ignoring autorun.inf label for drive %c: %s", letters[0],
|
uprintf("Ignoring 'autorun.inf' label for drive %c: %s", toupper(letters[0]),
|
||||||
(HRESULT_CODE(GetLastError()) == ERROR_NOT_READY)?"No media":WindowsErrorString());
|
(HRESULT_CODE(GetLastError()) == ERROR_NOT_READY)?"No media":WindowsErrorString());
|
||||||
safe_closehandle(hPhysical);
|
safe_closehandle(hPhysical);
|
||||||
if (AutorunLabel != NULL) {
|
if (AutorunLabel != NULL) {
|
||||||
uprintf("Using autorun.inf label for drive %c: '%s'", letters[0], AutorunLabel);
|
uprintf("Using 'autorun.inf' label for drive %c: '%s'", toupper(letters[0]), AutorunLabel);
|
||||||
static_strcpy(VolumeLabel, AutorunLabel);
|
static_strcpy(VolumeLabel, AutorunLabel);
|
||||||
safe_free(AutorunLabel);
|
safe_free(AutorunLabel);
|
||||||
*label = VolumeLabel;
|
*label = VolumeLabel;
|
||||||
|
@ -1832,12 +1832,12 @@ static BOOL FlushDrive(char drive_letter)
|
||||||
hDrive = CreateFileA(logical_drive, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
hDrive = CreateFileA(logical_drive, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (hDrive == INVALID_HANDLE_VALUE) {
|
if (hDrive == INVALID_HANDLE_VALUE) {
|
||||||
uprintf("Failed to open %c: for flushing: %s", drive_letter, WindowsErrorString());
|
uprintf("Failed to open %c: for flushing: %s", toupper(drive_letter), WindowsErrorString());
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
r = FlushFileBuffers(hDrive);
|
r = FlushFileBuffers(hDrive);
|
||||||
if (r == FALSE)
|
if (r == FALSE)
|
||||||
uprintf("Failed to flush %c: %s", drive_letter, WindowsErrorString());
|
uprintf("Failed to flush %c: %s", toupper(drive_letter), WindowsErrorString());
|
||||||
|
|
||||||
out:
|
out:
|
||||||
safe_closehandle(hDrive);
|
safe_closehandle(hDrive);
|
||||||
|
@ -1886,10 +1886,10 @@ BOOL MountVolume(char* drive_name, char *volume_name)
|
||||||
// about the level of thought and foresight that actually goes into the Windows APIs...
|
// about the level of thought and foresight that actually goes into the Windows APIs...
|
||||||
// [1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-definedosdevicew
|
// [1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-definedosdevicew
|
||||||
if (!DefineDosDeviceA(DDD_RAW_TARGET_PATH | DDD_NO_BROADCAST_SYSTEM, dos_name, &volume_name[14])) {
|
if (!DefineDosDeviceA(DDD_RAW_TARGET_PATH | DDD_NO_BROADCAST_SYSTEM, dos_name, &volume_name[14])) {
|
||||||
uprintf("Could not mount %s as %C:", volume_name, drive_name[0]);
|
uprintf("Could not mount %s as %c:", volume_name, toupper(drive_name[0]));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
uprintf("%s was successfully mounted as %C:", volume_name, drive_name[0]);
|
uprintf("%s was successfully mounted as %c:", volume_name, toupper(drive_name[0]));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1902,8 +1902,8 @@ BOOL MountVolume(char* drive_name, char *volume_name)
|
||||||
// If that is the case, update drive_name to that letter.
|
// If that is the case, update drive_name to that letter.
|
||||||
if ( (GetVolumePathNamesForVolumeNameA(volume_name, mounted_letter, sizeof(mounted_letter), &size))
|
if ( (GetVolumePathNamesForVolumeNameA(volume_name, mounted_letter, sizeof(mounted_letter), &size))
|
||||||
&& (size > 1) && (mounted_letter[0] != drive_name[0]) ) {
|
&& (size > 1) && (mounted_letter[0] != drive_name[0]) ) {
|
||||||
uprintf("%s is already mounted as %C: instead of %C: - Will now use this target instead...",
|
uprintf("%s is already mounted as %c: instead of %c: - Will now use this target instead...",
|
||||||
volume_name, mounted_letter[0], drive_name[0]);
|
volume_name, toupper(mounted_letter[0]), toupper(drive_name[0]));
|
||||||
drive_name[0] = mounted_letter[0];
|
drive_name[0] = mounted_letter[0];
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1918,7 +1918,7 @@ BOOL MountVolume(char* drive_name, char *volume_name)
|
||||||
uprintf("%s is mounted, but volume GUID doesn't match:\r\n expected %s, got %s",
|
uprintf("%s is mounted, but volume GUID doesn't match:\r\n expected %s, got %s",
|
||||||
drive_name, volume_name, mounted_guid);
|
drive_name, volume_name, mounted_guid);
|
||||||
} else {
|
} else {
|
||||||
duprintf("%s is already mounted as %C:", volume_name, drive_name[0]);
|
duprintf("%s is already mounted as %c:", volume_name, toupper(drive_name[0]));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
uprintf("Retrying after dismount...");
|
uprintf("Retrying after dismount...");
|
||||||
|
@ -1929,7 +1929,7 @@ BOOL MountVolume(char* drive_name, char *volume_name)
|
||||||
if ((GetLastError() == ERROR_DIR_NOT_EMPTY) &&
|
if ((GetLastError() == ERROR_DIR_NOT_EMPTY) &&
|
||||||
GetVolumeNameForVolumeMountPointA(drive_name, mounted_guid, sizeof(mounted_guid)) &&
|
GetVolumeNameForVolumeMountPointA(drive_name, mounted_guid, sizeof(mounted_guid)) &&
|
||||||
(safe_strcmp(volume_name, mounted_guid) == 0)) {
|
(safe_strcmp(volume_name, mounted_guid) == 0)) {
|
||||||
uprintf("%s was remounted as %C: (second time lucky!)", volume_name, drive_name[0]);
|
uprintf("%s was remounted as %c: (second time lucky!)", volume_name, toupper(drive_name[0]));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2002,9 +2002,9 @@ BOOL RemountVolume(char* drive_name, BOOL bSilent)
|
||||||
FlushDrive(drive_name[0]);
|
FlushDrive(drive_name[0]);
|
||||||
if (GetVolumeNameForVolumeMountPointA(drive_name, volume_name, sizeof(volume_name))) {
|
if (GetVolumeNameForVolumeMountPointA(drive_name, volume_name, sizeof(volume_name))) {
|
||||||
if (MountVolume(drive_name, volume_name)) {
|
if (MountVolume(drive_name, volume_name)) {
|
||||||
suprintf("Successfully remounted %s as %C:", volume_name, drive_name[0]);
|
suprintf("Successfully remounted %s as %c:", volume_name, toupper(drive_name[0]));
|
||||||
} else {
|
} else {
|
||||||
suprintf("Could not remount %s as %C: %s", volume_name, drive_name[0], WindowsErrorString());
|
suprintf("Could not remount %s as %c: %s", volume_name, toupper(drive_name[0]), WindowsErrorString());
|
||||||
// This will leave the drive inaccessible and must be flagged as an error
|
// This will leave the drive inaccessible and must be flagged as an error
|
||||||
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_REMOUNT_VOLUME);
|
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_REMOUNT_VOLUME);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
20
src/format.c
20
src/format.c
|
@ -1105,13 +1105,13 @@ static BOOL SetupWinPE(char drive_letter)
|
||||||
static_sprintf(setupsrcdev, "SetupSourceDevice = \"\\device\\harddisk%d\\partition1\"",
|
static_sprintf(setupsrcdev, "SetupSourceDevice = \"\\device\\harddisk%d\\partition1\"",
|
||||||
ComboBox_GetCurSel(hDiskID));
|
ComboBox_GetCurSel(hDiskID));
|
||||||
// Copy of ntdetect.com in root
|
// Copy of ntdetect.com in root
|
||||||
static_sprintf(src, "%c:\\%s\\ntdetect.com", drive_letter, basedir[2*(index/2)]);
|
static_sprintf(src, "%c:\\%s\\ntdetect.com", toupper(drive_letter), basedir[2*(index/2)]);
|
||||||
static_sprintf(dst, "%c:\\ntdetect.com", drive_letter);
|
static_sprintf(dst, "%c:\\ntdetect.com", toupper(drive_letter));
|
||||||
CopyFileA(src, dst, TRUE);
|
CopyFileA(src, dst, TRUE);
|
||||||
if (!img_report.uses_minint) {
|
if (!img_report.uses_minint) {
|
||||||
// Create a copy of txtsetup.sif, as we want to keep the i386/amd64 files unmodified
|
// Create a copy of txtsetup.sif, as we want to keep the i386/amd64 files unmodified
|
||||||
static_sprintf(src, "%c:\\%s\\txtsetup.sif", drive_letter, basedir[index]);
|
static_sprintf(src, "%c:\\%s\\txtsetup.sif", toupper(drive_letter), basedir[index]);
|
||||||
static_sprintf(dst, "%c:\\txtsetup.sif", drive_letter);
|
static_sprintf(dst, "%c:\\txtsetup.sif", toupper(drive_letter));
|
||||||
if (!CopyFileA(src, dst, TRUE)) {
|
if (!CopyFileA(src, dst, TRUE)) {
|
||||||
uprintf("Did not copy %s as %s: %s\n", src, dst, WindowsErrorString());
|
uprintf("Did not copy %s as %s: %s\n", src, dst, WindowsErrorString());
|
||||||
}
|
}
|
||||||
|
@ -1122,8 +1122,8 @@ static BOOL SetupWinPE(char drive_letter)
|
||||||
uprintf("Successfully added '%s' to %s\n", setupsrcdev, dst);
|
uprintf("Successfully added '%s' to %s\n", setupsrcdev, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static_sprintf(src, "%c:\\%s\\setupldr.bin", drive_letter, basedir[2*(index/2)]);
|
static_sprintf(src, "%c:\\%s\\setupldr.bin", toupper(drive_letter), basedir[2*(index/2)]);
|
||||||
static_sprintf(dst, "%c:\\BOOTMGR", drive_letter);
|
static_sprintf(dst, "%c:\\BOOTMGR", toupper(drive_letter));
|
||||||
if (!CopyFileA(src, dst, TRUE)) {
|
if (!CopyFileA(src, dst, TRUE)) {
|
||||||
uprintf("Did not copy %s as %s: %s\n", src, dst, WindowsErrorString());
|
uprintf("Did not copy %s as %s: %s\n", src, dst, WindowsErrorString());
|
||||||
}
|
}
|
||||||
|
@ -1922,7 +1922,7 @@ DWORD WINAPI FormatThread(void* param)
|
||||||
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | APPERR(ERROR_CANT_ASSIGN_LETTER);
|
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | APPERR(ERROR_CANT_ASSIGN_LETTER);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
uprintf("Will use '%C:' as volume mountpoint", drive_name[0]);
|
uprintf("Will use '%c:' as volume mountpoint", toupper(drive_name[0]));
|
||||||
|
|
||||||
// It kind of blows, but we have to relinquish access to the physical drive
|
// It kind of blows, but we have to relinquish access to the physical drive
|
||||||
// for VDS to be able to delete the partitions that reside on it...
|
// for VDS to be able to delete the partitions that reside on it...
|
||||||
|
@ -2074,7 +2074,7 @@ DWORD WINAPI FormatThread(void* param)
|
||||||
if (GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_name, sizeof(fs_name), TRUE)) {
|
if (GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_name, sizeof(fs_name), TRUE)) {
|
||||||
volume_name = GetLogicalName(DriveIndex, 0, TRUE, TRUE);
|
volume_name = GetLogicalName(DriveIndex, 0, TRUE, TRUE);
|
||||||
if ((volume_name != NULL) && (MountVolume(drive_name, volume_name)))
|
if ((volume_name != NULL) && (MountVolume(drive_name, volume_name)))
|
||||||
uprintf("Remounted %s as %C:", volume_name, drive_name[0]);
|
uprintf("Remounted %s as %c:", volume_name, toupper(drive_name[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -2218,7 +2218,7 @@ DWORD WINAPI FormatThread(void* param)
|
||||||
// we forcibly removed them, so add yet another explicit call to RemoveDriveLetters()
|
// we forcibly removed them, so add yet another explicit call to RemoveDriveLetters()
|
||||||
RemoveDriveLetters(DriveIndex, FALSE, TRUE);
|
RemoveDriveLetters(DriveIndex, FALSE, TRUE);
|
||||||
if (!MountVolume(drive_name, volume_name)) {
|
if (!MountVolume(drive_name, volume_name)) {
|
||||||
uprintf("Could not remount %s as %C: %s\n", volume_name, drive_name[0], WindowsErrorString());
|
uprintf("Could not remount %s as %c: %s\n", volume_name, toupper(drive_name[0]), WindowsErrorString());
|
||||||
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | APPERR(ERROR_CANT_MOUNT_VOLUME);
|
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | APPERR(ERROR_CANT_MOUNT_VOLUME);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -2398,7 +2398,7 @@ out:
|
||||||
volume_name = GetLogicalName(DriveIndex, partition_offset[PI_MAIN], TRUE, TRUE);
|
volume_name = GetLogicalName(DriveIndex, partition_offset[PI_MAIN], TRUE, TRUE);
|
||||||
if (volume_name != NULL) {
|
if (volume_name != NULL) {
|
||||||
if (MountVolume(drive_name, volume_name))
|
if (MountVolume(drive_name, volume_name))
|
||||||
uprintf("Re-mounted volume as %C: after error", drive_name[0]);
|
uprintf("Re-mounted volume as %c: after error", toupper(drive_name[0]));
|
||||||
free(volume_name);
|
free(volume_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 3.18.1865"
|
CAPTION "Rufus 3.18.1866"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -395,8 +395,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,18,1865,0
|
FILEVERSION 3,18,1866,0
|
||||||
PRODUCTVERSION 3,18,1865,0
|
PRODUCTVERSION 3,18,1866,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -414,13 +414,13 @@ BEGIN
|
||||||
VALUE "Comments", "https://rufus.ie"
|
VALUE "Comments", "https://rufus.ie"
|
||||||
VALUE "CompanyName", "Akeo Consulting"
|
VALUE "CompanyName", "Akeo Consulting"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.18.1865"
|
VALUE "FileVersion", "3.18.1866"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||||
VALUE "OriginalFilename", "rufus-3.18.exe"
|
VALUE "OriginalFilename", "rufus-3.18.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.18.1865"
|
VALUE "ProductVersion", "3.18.1866"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
|
@ -194,7 +194,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create ldlinux.sys file */
|
/* Create ldlinux.sys file */
|
||||||
static_sprintf(path, "%c:\\%s.%s", drive_letter, ldlinux, ldlinux_ext[0]);
|
static_sprintf(path, "%c:\\%s.%s", toupper(drive_letter), ldlinux, ldlinux_ext[0]);
|
||||||
f_handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
|
f_handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
NULL, CREATE_ALWAYS,
|
NULL, CREATE_ALWAYS,
|
||||||
|
@ -236,7 +236,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
|
||||||
|
|
||||||
switch (file_system) {
|
switch (file_system) {
|
||||||
case FS_NTFS:
|
case FS_NTFS:
|
||||||
static_sprintf(tmp, "%c:\\", drive_letter);
|
static_sprintf(tmp, "%c:\\", toupper(drive_letter));
|
||||||
vol_info.Handle = d_handle;
|
vol_info.Handle = d_handle;
|
||||||
err = NtfsSectGetVolumeInfo(tmp, &vol_info);
|
err = NtfsSectGetVolumeInfo(tmp, &vol_info);
|
||||||
if (err != ERROR_SUCCESS) {
|
if (err != ERROR_SUCCESS) {
|
||||||
|
@ -333,7 +333,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
|
||||||
IGNORE_RETVAL(_chdirU(app_data_dir));
|
IGNORE_RETVAL(_chdirU(app_data_dir));
|
||||||
static_sprintf(path, "%s\\%s-%s", FILES_DIR, syslinux, embedded_sl_version_str[1]);
|
static_sprintf(path, "%s\\%s-%s", FILES_DIR, syslinux, embedded_sl_version_str[1]);
|
||||||
IGNORE_RETVAL(_chdir(path));
|
IGNORE_RETVAL(_chdir(path));
|
||||||
static_sprintf(path, "%c:\\%s.%s", drive_letter, ldlinux, ldlinux_ext[2]);
|
static_sprintf(path, "%c:\\%s.%s", toupper(drive_letter), ldlinux, ldlinux_ext[2]);
|
||||||
fd = fopen(&path[3], "rb");
|
fd = fopen(&path[3], "rb");
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
uprintf("Caution: No '%s' was provided. The target will be missing a required Syslinux file!", &path[3]);
|
uprintf("Caution: No '%s' was provided. The target will be missing a required Syslinux file!", &path[3]);
|
||||||
|
@ -354,7 +354,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
/* Create mboot.c32 file */
|
/* Create mboot.c32 file */
|
||||||
static_sprintf(path, "%c:\\%s", drive_letter, mboot_c32);
|
static_sprintf(path, "%c:\\%s", toupper(drive_letter), mboot_c32);
|
||||||
f_handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
|
f_handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
@ -368,7 +368,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
safe_closehandle(f_handle);
|
safe_closehandle(f_handle);
|
||||||
static_sprintf(path, "%c:\\syslinux.cfg", drive_letter);
|
static_sprintf(path, "%c:\\syslinux.cfg", toupper(drive_letter));
|
||||||
fd = fopen(path, "w");
|
fd = fopen(path, "w");
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
uprintf("Could not create ReactOS 'syslinux.cfg'");
|
uprintf("Could not create ReactOS 'syslinux.cfg'");
|
||||||
|
|
8
src/ui.c
8
src/ui.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Rufus: The Reliable USB Formatting Utility
|
* Rufus: The Reliable USB Formatting Utility
|
||||||
* UI-related function calls
|
* UI-related function calls
|
||||||
* Copyright © 2018-2021 Pete Batard <pete@akeo.ie>
|
* Copyright © 2018-2022 Pete Batard <pete@akeo.ie>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -789,7 +789,8 @@ void ToggleImageOptions(void)
|
||||||
if (image_option_txt[0] == 0)
|
if (image_option_txt[0] == 0)
|
||||||
GetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), image_option_txt, sizeof(image_option_txt));
|
GetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), image_option_txt, sizeof(image_option_txt));
|
||||||
|
|
||||||
if ((has_wintogo) != (image_options & IMOP_WINTOGO)) {
|
if (((has_wintogo) && !(image_options & IMOP_WINTOGO)) ||
|
||||||
|
((!has_wintogo) && (image_options & IMOP_WINTOGO))) {
|
||||||
image_options ^= IMOP_WINTOGO;
|
image_options ^= IMOP_WINTOGO;
|
||||||
if (image_options & IMOP_WINTOGO) {
|
if (image_options & IMOP_WINTOGO) {
|
||||||
// Set the Windows To Go selection in the dropdown
|
// Set the Windows To Go selection in the dropdown
|
||||||
|
@ -797,7 +798,8 @@ void ToggleImageOptions(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((has_persistence) != (image_options & IMOP_PERSISTENCE)) {
|
if (((has_persistence) && !(image_options & IMOP_PERSISTENCE)) ||
|
||||||
|
((!has_persistence) && (image_options & IMOP_PERSISTENCE))) {
|
||||||
image_options ^= IMOP_PERSISTENCE;
|
image_options ^= IMOP_PERSISTENCE;
|
||||||
if (image_options & IMOP_PERSISTENCE) {
|
if (image_options & IMOP_PERSISTENCE) {
|
||||||
SetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), lmprintf(MSG_123));
|
SetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), lmprintf(MSG_123));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue