mirror of
https://github.com/pbatard/rufus.git
synced 2025-06-07 09:54:59 -04:00
[extfs] add standalone ext2/ext3 formatting
* Only enabled when Advanced format options are shown * Also enable reading of extfs volume label * Also improve GRUB lookup fallback * Also fix possible truncation when sanitizing labels * Also write a zeroed MBR when non-bootable is selected
This commit is contained in:
parent
a696e041e1
commit
2ff6da49f0
12 changed files with 691 additions and 54 deletions
12
src/drive.c
12
src/drive.c
|
@ -844,7 +844,7 @@ out:
|
|||
BOOL GetDriveLabel(DWORD DriveIndex, char* letters, char** label)
|
||||
{
|
||||
HANDLE hPhysical;
|
||||
DWORD size;
|
||||
DWORD size, error;
|
||||
static char VolumeLabel[MAX_PATH + 1];
|
||||
char DrivePath[] = "#:\\", AutorunPath[] = "#:\\autorun.inf", *AutorunLabel = NULL;
|
||||
|
||||
|
@ -879,9 +879,15 @@ BOOL GetDriveLabel(DWORD DriveIndex, char* letters, char** label)
|
|||
NULL, NULL, NULL, NULL, 0) && (VolumeLabel[0] != 0)) {
|
||||
*label = VolumeLabel;
|
||||
} else {
|
||||
duprintf("Failed to read label: %s", WindowsErrorString());
|
||||
// Might be an extfs label
|
||||
error = GetLastError();
|
||||
*label = (char*)GetExtFsLabel(DriveIndex, 0);
|
||||
if (*label == NULL) {
|
||||
SetLastError(error);
|
||||
duprintf("Failed to read label: %s", WindowsErrorString());
|
||||
*label = STR_NO_LABEL;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue