diff --git a/INSTALL/Ventoy2Disk.exe b/INSTALL/Ventoy2Disk.exe index bce9fe7f..107df62d 100644 Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ diff --git a/INSTALL/Ventoy2Disk_ARM.exe b/INSTALL/Ventoy2Disk_ARM.exe index b8930d77..b8ba5335 100644 Binary files a/INSTALL/Ventoy2Disk_ARM.exe and b/INSTALL/Ventoy2Disk_ARM.exe differ diff --git a/INSTALL/Ventoy2Disk_ARM64.exe b/INSTALL/Ventoy2Disk_ARM64.exe index 96a5790b..11236e34 100644 Binary files a/INSTALL/Ventoy2Disk_ARM64.exe and b/INSTALL/Ventoy2Disk_ARM64.exe differ diff --git a/INSTALL/Ventoy2Disk_X64.exe b/INSTALL/Ventoy2Disk_X64.exe index 04610f01..f41db223 100644 Binary files a/INSTALL/Ventoy2Disk_X64.exe and b/INSTALL/Ventoy2Disk_X64.exe differ diff --git a/Ventoy2Disk/Ventoy2Disk/PhyDrive.c b/Ventoy2Disk/Ventoy2Disk/PhyDrive.c index af68bec3..ff69536f 100644 --- a/Ventoy2Disk/Ventoy2Disk/PhyDrive.c +++ b/Ventoy2Disk/Ventoy2Disk/PhyDrive.c @@ -1587,7 +1587,7 @@ int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle) memset(pData, 0, 512); pMBR = (MBR_HEAD *)pData; - VentoyFillMBR(pPhyDrive->SizeInBytes, pMBR, PartStyle); + VentoyFillMBR(pPhyDrive->SizeInBytes, pMBR, PartStyle, 0x07); Part1StartSector = pMBR->PartTbl[0].StartSectorId; Part1SectorCount = pMBR->PartTbl[0].SectorCount; Part2StartSector = pMBR->PartTbl[1].StartSectorId; @@ -1751,6 +1751,7 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId) UINT64 Part2StartSector = 0; BOOL LargeFAT32 = FALSE; BOOL DefaultExFAT = FALSE; + UINT8 FsFlag = 0x07; Log("#####################################################"); Log("InstallVentoy2PhyDrive try%d %s PhyDrive%d <<%s %s %dGB>>", TryId, @@ -1775,7 +1776,12 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId) } else { - VentoyFillMBR(pPhyDrive->SizeInBytes, &MBR, PartStyle); + if (GetVentoyFsType() == VTOY_FS_FAT32) + { + FsFlag = 0x0C; + } + + VentoyFillMBR(pPhyDrive->SizeInBytes, &MBR, PartStyle, FsFlag); Part1StartSector = MBR.PartTbl[0].StartSectorId; Part1SectorCount = MBR.PartTbl[0].SectorCount; Part2StartSector = MBR.PartTbl[1].StartSectorId; diff --git a/Ventoy2Disk/Ventoy2Disk/Utility.c b/Ventoy2Disk/Ventoy2Disk/Utility.c index 32939bef..80cd6baa 100644 --- a/Ventoy2Disk/Ventoy2Disk/Utility.c +++ b/Ventoy2Disk/Ventoy2Disk/Utility.c @@ -669,7 +669,7 @@ int VentoyFillMBRLocation(UINT64 DiskSizeInBytes, UINT32 StartSectorId, UINT32 S return 0; } -int VentoyFillMBR(UINT64 DiskSizeBytes, MBR_HEAD *pMBR, int PartStyle) +int VentoyFillMBR(UINT64 DiskSizeBytes, MBR_HEAD *pMBR, int PartStyle, UINT8 FsFlag) { GUID Guid; int ReservedValue; @@ -733,7 +733,7 @@ int VentoyFillMBR(UINT64 DiskSizeBytes, MBR_HEAD *pMBR, int PartStyle) VentoyFillMBRLocation(DiskSizeBytes, PartStartSector, PartSectorCount, pMBR->PartTbl); pMBR->PartTbl[0].Active = 0x80; // bootable - pMBR->PartTbl[0].FsFlag = 0x07; // exFAT/NTFS/HPFS + pMBR->PartTbl[0].FsFlag = FsFlag; // File system flag 07:exFAT/NTFS/HPFS 0C:FAT32 //Part2 PartStartSector += PartSectorCount; diff --git a/Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.h b/Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.h index 21287279..84d98b59 100644 --- a/Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.h +++ b/Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.h @@ -238,7 +238,7 @@ const CHAR * GetBusTypeString(STORAGE_BUS_TYPE Type); int VentoyGetLocalBootImg(MBR_HEAD *pMBR); int GetHumanReadableGBSize(UINT64 SizeBytes); void TrimString(CHAR *String); -int VentoyFillMBR(UINT64 DiskSizeBytes, MBR_HEAD *pMBR, int PartStyle); +int VentoyFillMBR(UINT64 DiskSizeBytes, MBR_HEAD *pMBR, int PartStyle, UINT8 FsFlag); int VentoyFillGpt(UINT64 DiskSizeBytes, VTOY_GPT_INFO *pInfo); BOOL IsVentoyLogicalDrive(CHAR DriveLetter); int GetRegDwordValue(HKEY Key, LPCSTR SubKey, LPCSTR ValueName, DWORD *pValue);