VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumeSizeWizardPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/VolumeSizeWizardPage.cpp')
-rw-r--r--src/Main/Forms/VolumeSizeWizardPage.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Main/Forms/VolumeSizeWizardPage.cpp b/src/Main/Forms/VolumeSizeWizardPage.cpp
index 61427ea5..08aa7052 100644
--- a/src/Main/Forms/VolumeSizeWizardPage.cpp
+++ b/src/Main/Forms/VolumeSizeWizardPage.cpp
@@ -39,6 +39,12 @@ namespace VeraCrypt
}
else
{
+ if (!volumePath.IsDevice())
+ {
+ wxULongLong containerSizeUnsigned = wxFileName (wstring (volumePath)).GetSize();
+ if (containerSizeUnsigned != wxInvalidSize)
+ diskSpace += static_cast<wxLongLong_t>(containerSizeUnsigned.GetValue());
+ }
AvailableDiskSpace = (uint64) diskSpace.GetValue ();
}
@@ -67,9 +73,7 @@ namespace VeraCrypt
VolumeSizeTextCtrl->SetMinSize (wxSize (Gui->GetCharWidth (VolumeSizeTextCtrl) * 20, -1));
- wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
- const wxChar *valArr[] = { L"0", L"1", L"2", L"3", L"4", L"5", L"6", L"7", L"8", L"9" };
- validator.SetIncludes (wxArrayString (array_capacity (valArr), (const wxChar **) &valArr));
+ wxTextValidator validator (wxFILTER_DIGITS);
VolumeSizeTextCtrl->SetValidator (validator);
}
@@ -79,7 +83,7 @@ namespace VeraCrypt
uint64 val;
if (UseAllFreeSpaceCheckBox->IsChecked ())
{
- val = AvailableDiskSpace;
+ val = MaxVolumeSizeValid ? MaxVolumeSize : AvailableDiskSpace;
}
else
{