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:
longpanda
2022-11-30 21:12:43 +08:00
parent 118bedd546
commit ee04af5243
23 changed files with 549 additions and 97 deletions

View File

@@ -23,7 +23,20 @@
#include <stdio.h>
typedef enum VTOY_FS
{
VTOY_FS_EXFAT = 0,
VTOY_FS_NTFS,
VTOY_FS_FAT32,
VTOY_FS_UDF,
VTOY_FS_BUTT
}VTOY_FS;
#define FAT32_MAX_LIMIT (32 * 1073741824ULL)
#define SIZE_1KB (1024)
#define SIZE_1GB (1024 * 1024 * 1024)
#define SIZE_1TB (1024ULL * 1024ULL * 1024ULL * 1024ULL)
#define SIZE_1MB (1024 * 1024)
#define SIZE_2MB (2048 * 1024)
#define VENTOY_EFI_PART_SIZE (32 * SIZE_1MB)
@@ -160,6 +173,7 @@ typedef struct PHY_DRIVE_INFO
CHAR DriveLetters[64];
int VentoyFsClusterSize;
CHAR VentoyFsType[16];
CHAR VentoyVersion[32];
@@ -251,6 +265,7 @@ int INIT unxz(unsigned char *in, int in_size,
unsigned char *out, int *in_used,
void(*error)(char *x));
void disk_io_set_param(HANDLE Handle, UINT64 SectorCount);
int GetVolumeClusterSize(char Drive);
extern BOOL g_InputYes;
INT_PTR CALLBACK YesDialogProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
@@ -259,7 +274,14 @@ int GetReservedSpaceInMB(void);
int IsPartNeed4KBAlign(void);
int GetVentoyFsType(void);
void SetVentoyFsType(int fs);
int GetClusterSize(void);
void SetClusterSize(int ClusterSize);
WCHAR* GetClusterSizeTip(void);
void FormatClusterSizeTip(int Size, WCHAR* pBuf, size_t len);
const char* GetVentoyFsName(void);
const char* GetVentoyFsNameByType(int fs);
CHAR* GetVentoyFsFmtNameByTypeA(int fs);
WCHAR* GetVentoyFsFmtNameByTypeW(int fs);
int FindProcessOccupyDisk(HANDLE hDrive, PHY_DRIVE_INFO *pPhyDrive);
int VentoyFillMBRLocation(UINT64 DiskSizeInBytes, UINT32 StartSectorId, UINT32 SectorCount, PART_TABLE *Table);
int ClearVentoyFromPhyDrive(HWND hWnd, PHY_DRIVE_INFO *pPhyDrive, char *pDrvLetter);
@@ -270,8 +292,6 @@ BOOL PartResizePreCheck(PHY_DRIVE_INFO** ppPhyDrive);
liCurrentPosition.QuadPart = pos; \
SetFilePointerEx(hDrive, liCurrentPosition, &liCurrentPosition, FILE_BEGIN)\
#define SECURE_ICON_STRING _UICON(UNICODE_LOCK)
extern int g_WriteImage;
#define VTSI_IMG_MAGIC 0x0000594F544E4556ULL // "VENTOY\0\0"