Windows: Support specifying volumes size using TB in GUI as it is the case in command line.

This commit is contained in:
Mounir IDRASSI 2015-09-22 01:12:32 +02:00
parent 307568f631
commit f41be7399b
8 changed files with 172 additions and 194 deletions

View File

@ -37,6 +37,7 @@
<control lang="en" key="IDC_DOWNLOAD_CD_BURN_SOFTWARE">Download CD/DVD recording software</control>
<control lang="en" key="IDC_FILE_CONTAINER">Create an encrypted file container</control>
<control lang="en" key="IDC_GB">&amp;GB</control>
<control lang="en" key="IDC_TB">&amp;TB</control>
<control lang="en" key="IDC_HIDDEN_SYSENC_INFO_LINK">More information</control>
<control lang="en" key="IDC_HIDDEN_VOL">Hi&amp;dden VeraCrypt volume </control>
<control lang="en" key="IDC_HIDDEN_VOL_HELP">More information about hidden volumes</control>
@ -562,6 +563,7 @@
<string lang="en" key="MAX_HIDVOL_SIZE_KB">Maximum possible hidden volume size for this volume is %.2f KB.</string>
<string lang="en" key="MAX_HIDVOL_SIZE_MB">Maximum possible hidden volume size for this volume is %.2f MB.</string>
<string lang="en" key="MAX_HIDVOL_SIZE_GB">Maximum possible hidden volume size for this volume is %.2f GB.</string>
<string lang="en" key="MAX_HIDVOL_SIZE_TB">Maximum possible hidden volume size for this volume is %.2f TB.</string>
<string lang="en" key="MOUNTED_NOPWCHANGE">Volume password/keyfiles cannot be changed while the volume is mounted. Please dismount the volume first.</string>
<string lang="en" key="MOUNTED_NO_PKCS5_PRF_CHANGE">The header key derivation algorithm cannot be changed while the volume is mounted. Please dismount the volume first.</string>
<string lang="en" key="MOUNT_BUTTON">&amp;Mount</string>

View File

@ -90,8 +90,8 @@ int GetSpaceString(char *dest, size_t maxlen, uint64 size, BOOL bDevice)
void SetCurrentVolSize(HWND hwndDlg, uint64 size)
{
const uint64 Muliplier[] = {BYTES_PER_KB, BYTES_PER_MB, BYTES_PER_GB};
const int IdRadioBtn[] = {IDC_KB, IDC_MB, IDC_GB};
const uint64 Muliplier[] = {BYTES_PER_KB, BYTES_PER_MB, BYTES_PER_GB, BYTES_PER_TB};
const int IdRadioBtn[] = {IDC_KB, IDC_MB, IDC_GB, IDC_TB};
const int nMaxSuffix = sizeof(Muliplier)/sizeof(uint64) - 1;
int i;
char szTemp[256];
@ -107,8 +107,8 @@ void SetCurrentVolSize(HWND hwndDlg, uint64 size)
uint64 GetSizeBoxMultiplier(HWND hwndDlg)
{
const uint64 Muliplier[] = {BYTES_PER_KB, BYTES_PER_MB, BYTES_PER_GB};
const int IdRadioBtn[] = {IDC_KB, IDC_MB, IDC_GB};
const uint64 Muliplier[] = {BYTES_PER_KB, BYTES_PER_MB, BYTES_PER_GB, BYTES_PER_TB};
const int IdRadioBtn[] = {IDC_KB, IDC_MB, IDC_GB, IDC_TB};
const int nMaxSuffix = sizeof(Muliplier)/sizeof(uint64) - 1;
int i;
@ -135,6 +135,7 @@ BOOL CALLBACK ExpandVolSizeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
EnableWindow (GetDlgItem (hwndDlg, IDC_KB), !pVolExpandParam->bIsDevice);
EnableWindow (GetDlgItem (hwndDlg, IDC_MB), !pVolExpandParam->bIsDevice);
EnableWindow (GetDlgItem (hwndDlg, IDC_GB), !pVolExpandParam->bIsDevice);
EnableWindow (GetDlgItem (hwndDlg, IDC_TB), !pVolExpandParam->bIsDevice);
EnableWindow (GetDlgItem (hwndDlg, IDC_INIT_NEWSPACE),
!(pVolExpandParam->bIsLegacy && pVolExpandParam->bIsDevice));

View File

@ -14,11 +14,11 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// German (Germany) resources
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
@ -35,7 +35,7 @@ BEGIN
EDITTEXT IDC_SIZEBOX,30,102,109,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "&KB",IDC_KB,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,169,105,38,10
CONTROL "&MB",IDC_MB,"Button",BS_AUTORADIOBUTTON,209,105,38,10
CONTROL "&GB",IDC_GB,"Button",BS_AUTORADIOBUTTON,247,105,38,10
CONTROL "&GB",IDC_GB,"Button",BS_AUTORADIOBUTTON,248,105,38,10
CONTROL "Fill new space with random data",IDC_INIT_NEWSPACE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,127,118,10
DEFPUSHBUTTON "Continue",IDOK,15,238,84,18
@ -51,46 +51,9 @@ BEGIN
CONTROL "",IDC_EXPAND_VOLUME_NAME,"Static",SS_SIMPLE | WS_GROUP,80,18,275,8,WS_EX_TRANSPARENT
RTEXT "File system: ",IDT_FILE_SYS,31,30,42,8
CONTROL "",IDC_EXPAND_FILE_SYSTEM,"Static",SS_SIMPLE | WS_GROUP,80,30,275,8,WS_EX_TRANSPARENT
CONTROL "&TB",IDC_TB,"Button",BS_AUTORADIOBUTTON,288,105,38,10
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_SIZE_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 15
RIGHTMARGIN, 361
VERTGUIDE, 30
TOPMARGIN, 14
BOTTOMMARGIN, 256
END
END
#endif // APSTUDIO_INVOKED
#endif // German (Germany) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_MOUNT_DLG DIALOGEX 0, 0, 376, 271
STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Expander"
@ -178,6 +141,15 @@ END
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_SIZE_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 15
RIGHTMARGIN, 361
VERTGUIDE, 30
TOPMARGIN, 14
BOTTOMMARGIN, 256
END
IDD_MOUNT_DLG, DIALOG
BEGIN
RIGHTMARGIN, 369

View File

@ -20,6 +20,7 @@
#define IDC_MB 1013
#define IDC_PROGRESS_BAR 1014
#define IDC_GB 1015
#define IDC_TB 1016
#define IDC_EXPAND_VOLUME_OLDSIZE 1017
#define IDC_EXPAND_VOLUME_NEWSIZE 1019
#define IDC_EXPAND_VOLUME_NAME 1020
@ -69,6 +70,7 @@
#define IDT_OLD_PIM 1142
#define IDC_OLD_PIM 1143
#define IDC_OLD_PIM_HELP 1144
#define ID_HOMEPAGE 1145
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
@ -131,7 +133,6 @@
#define IDM_SYSENC_SETTINGS 40060
#define IDM_RESUME_INTERRUPTED_PROC 40061
#define IDM_MANAGE_TOKEN_KEYFILES 40062
#define ID_HOMEPAGE 40063
// Next default values for new objects
//
@ -140,7 +141,7 @@
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 120
#define _APS_NEXT_COMMAND_VALUE 40064
#define _APS_NEXT_CONTROL_VALUE 1145
#define _APS_NEXT_CONTROL_VALUE 1146
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -130,11 +130,12 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_SIZEBOX,0,22,71,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "&KB",IDC_KB,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,80,25,38,10
CONTROL "&MB",IDC_MB,"Button",BS_AUTORADIOBUTTON,119,25,38,10
CONTROL "&GB",IDC_GB,"Button",BS_AUTORADIOBUTTON,158,25,38,10
CONTROL "&KB",IDC_KB,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,80,25,27,10
CONTROL "&MB",IDC_MB,"Button",BS_AUTORADIOBUTTON,115,25,27,10
CONTROL "&GB",IDC_GB,"Button",BS_AUTORADIOBUTTON,150,25,27,10
LTEXT "",IDC_BOX_HELP,0,75,214,64
LTEXT "",IDC_SPACE_LEFT,0,44,214,21
CONTROL "&TB",IDC_TB,"Button",BS_AUTORADIOBUTTON,185,25,27,10
END
IDD_VOLUME_LOCATION_PAGE_DLG DIALOGEX 0, 0, 226, 172

View File

@ -143,6 +143,7 @@
#define IDT_DRIVE_LETTER 1104
#define IDC_LINK_PIM_INFO 1105
#define IDC_SHOW_PIM 1106
#define IDC_TB 1107
// Next default values for new objects
//
@ -151,7 +152,7 @@
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1107
#define _APS_NEXT_CONTROL_VALUE 1108
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Binary file not shown.

View File

@ -39,7 +39,7 @@ static void VerifySizeAndUpdate ( HWND hwndDlg , BOOL bUpdate );
static void __cdecl sysEncDriveAnalysisThread (void *hwndDlgArg);
static void __cdecl volTransformThreadFunction ( void *hwndDlg );
static void LoadPage ( HWND hwndDlg , int nPageNo );
int PrintFreeSpace ( HWND hwndTextBox , char *lpszDrive , PLARGE_INTEGER lDiskFree );
__int64 PrintFreeSpace ( HWND hwndTextBox , char *lpszDrive , PLARGE_INTEGER lDiskFree );
void DisplaySizingErrorText ( HWND hwndTextBox );
void EnableDisableFileNext ( HWND hComboBox , HWND hMainButton );
BOOL QueryFreeSpace ( HWND hwndDlg , HWND hwndTextBox , BOOL display );