1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[core] remove the call to IOCTL_DISK_DELETE_DRIVE_LAYOUT

* As per issue #122, this creates problems when formatting a drive in FAT16
* Also remove an unnecessary backslash in icon.c
This commit is contained in:
Pete Batard 2013-07-04 22:51:15 +01:00
parent 9925cc945d
commit 967ad1da33
4 changed files with 7 additions and 43 deletions

View file

@ -676,34 +676,6 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m
return TRUE; return TRUE;
} }
/* Delete the disk partition table */
BOOL DeletePartitions(HANDLE hDrive)
{
BOOL r;
DWORD size;
PrintStatus(0, TRUE, "Erasing Partitions...");
r = DeviceIoControl(hDrive, IOCTL_DISK_DELETE_DRIVE_LAYOUT, NULL, 0, NULL, 0, &size, NULL );
if (!r) {
// Ignore GEN_FAILURE as this is what XP returns for unpartitioned
if (GetLastError() != ERROR_GEN_FAILURE) {
uprintf("Could not delete drive layout: %s\n", WindowsErrorString());
safe_closehandle(hDrive);
return FALSE;
}
}
r = DeviceIoControl(hDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, &size, NULL );
if (!r) {
uprintf("Could not refresh drive layout: %s\n", WindowsErrorString());
safe_closehandle(hDrive);
return FALSE;
}
return TRUE;
}
/* /*
* Convert a partition type to its human readable form using * Convert a partition type to its human readable form using
* (slightly modified) entries from GNU fdisk * (slightly modified) entries from GNU fdisk

View file

@ -1265,14 +1265,6 @@ DWORD WINAPI FormatThread(LPVOID param)
} }
UpdateProgress(OP_ANALYZE_MBR, -1.0f); UpdateProgress(OP_ANALYZE_MBR, -1.0f);
// Zap any existing partitions. This should help to prevent access errors
// TODO: With this, we should be able to avoid having to deal with the logical volume above
if (!DeletePartitions(hPhysicalDrive)) {
uprintf("Could not reset partitions\n");
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_PARTITION_FAILURE;
goto out;
}
if (IsChecked(IDC_BADBLOCKS)) { if (IsChecked(IDC_BADBLOCKS)) {
do { do {
// create a log file for bad blocks report. Since %USERPROFILE% may // create a log file for bad blocks report. Since %USERPROFILE% may
@ -1346,7 +1338,7 @@ DWORD WINAPI FormatThread(LPVOID param)
// TODO: (v1.4) Our start button should become cancel instead of close // TODO: (v1.4) Our start button should become cancel instead of close
// Especially after destructive badblocks test, you must zero the MBR/GPT completely // Especially after destructive badblocks test, you must zero the MBR/GPT completely
// before repartitioning. Else, all kind of bad things can happen. // before repartitioning. Else, all kind of bad things happen.
if (!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.Geometry.BytesPerSector)) { if (!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.Geometry.BytesPerSector)) {
uprintf("unable to zero MBR/GPT\n"); uprintf("unable to zero MBR/GPT\n");
if (!IS_ERROR(FormatStatus)) if (!IS_ERROR(FormatStatus))

View file

@ -160,7 +160,7 @@ BOOL SetAutorun(const char* path)
char filename[64]; char filename[64];
wchar_t wlabel[128], wRufusVersion[32]; wchar_t wlabel[128], wRufusVersion[32];
safe_sprintf(filename, sizeof(filename), "%s\\autorun.inf", path); safe_sprintf(filename, sizeof(filename), "%sautorun.inf", path);
fd = fopen(filename, "r"); // If there's an existing autorun, don't overwrite fd = fopen(filename, "r"); // If there's an existing autorun, don't overwrite
if (fd != NULL) { if (fd != NULL) {
uprintf("%s already exists - keeping it\n", filename); uprintf("%s already exists - keeping it\n", filename);

View file

@ -30,7 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329 IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.3.4.263" CAPTION "Rufus v1.3.4.264"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -278,8 +278,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,4,263 FILEVERSION 1,3,4,264
PRODUCTVERSION 1,3,4,263 PRODUCTVERSION 1,3,4,264
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -296,13 +296,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.3.4.263" VALUE "FileVersion", "1.3.4.264"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.3.4.263" VALUE "ProductVersion", "1.3.4.264"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"