mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-12-23 11:56:21 +00:00
Ventoy2Disk update:
1. Add UDF filesytem option. 2. Add Cluster Size option. 3. Support FAT32 for disk bigger than 32GB. 4. Fix the format fail issue. 5. Add a tip bubble with cluster size when mouse hover on the file system type string. 6. The secure boot lock character can not show in early Windows, change it to a yellow icon.
This commit is contained in:
@@ -256,25 +256,27 @@ BOOL PSHELL_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLette
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL PSHELL_FormatVolume(char DriveLetter, int fs)
|
||||
BOOL PSHELL_FormatVolume(char DriveLetter, int fs, DWORD ClusterSize)
|
||||
{
|
||||
BOOL ret;
|
||||
const char* fsname = NULL;
|
||||
CHAR CmdBuf[512];
|
||||
|
||||
if (fs == 1)
|
||||
fsname = GetVentoyFsFmtNameByTypeA(fs);
|
||||
|
||||
if (ClusterSize > 0)
|
||||
{
|
||||
fsname = "NTFS";
|
||||
sprintf_s(CmdBuf, sizeof(CmdBuf),
|
||||
"format-volume -DriveLetter %C -FileSystem %s -AllocationUnitSize %u -Force -NewFileSystemLabel Ventoy",
|
||||
DriveLetter, fsname, ClusterSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
fsname = "FAT32";
|
||||
sprintf_s(CmdBuf, sizeof(CmdBuf),
|
||||
"format-volume -DriveLetter %C -FileSystem %s -Force -NewFileSystemLabel Ventoy",
|
||||
DriveLetter, fsname);
|
||||
}
|
||||
|
||||
sprintf_s(CmdBuf, sizeof(CmdBuf),
|
||||
"format-volume -DriveLetter %C -FileSystem %s -Force -NewFileSystemLabel Ventoy",
|
||||
DriveLetter, fsname);
|
||||
|
||||
ret = PSHELL_CommProc(CmdBuf);
|
||||
Log("PSHELL_FormatVolume %C: ret:%d (%s)", DriveLetter, ret, ret ? "SUCCESS" : "FAIL");
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user