mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Windows: add /nosizecheck switch to VeraCrypt Format that allows disabling check on file container size against available free space on target disk. This enables to workaround a bug in Microsoft Distributed File System (DFS) that report wrong free disk space (https://support.microsoft.com/en-us/help/177127/incorrect-disk-free-space-information-for-a-dfs-client-share)
This commit is contained in:
@@ -178,6 +178,7 @@ int SysEncDetectHiddenSectors = -1; /* Whether the user wants us to detect and
|
|||||||
int SysEncDriveAnalysisStart;
|
int SysEncDriveAnalysisStart;
|
||||||
BOOL bDontVerifyRescueDisk = FALSE;
|
BOOL bDontVerifyRescueDisk = FALSE;
|
||||||
BOOL bFirstSysEncResumeDone = FALSE;
|
BOOL bFirstSysEncResumeDone = FALSE;
|
||||||
|
BOOL bDontCheckFileContainerSize = FALSE; /* If true, we don't check if the given size of file container is smaller than the available size on the hosting disk */
|
||||||
int nMultiBoot = 0; /* The number of operating systems installed on the computer, according to the user. 0: undetermined, 1: one, 2: two or more */
|
int nMultiBoot = 0; /* The number of operating systems installed on the computer, according to the user. 0: undetermined, 1: one, 2: two or more */
|
||||||
volatile BOOL bHiddenVol = FALSE; /* If true, we are (or will be) creating a hidden volume. */
|
volatile BOOL bHiddenVol = FALSE; /* If true, we are (or will be) creating a hidden volume. */
|
||||||
volatile BOOL bHiddenVolHost = FALSE; /* If true, we are (or will be) creating the host volume (called "outer") for a hidden volume. */
|
volatile BOOL bHiddenVolHost = FALSE; /* If true, we are (or will be) creating the host volume (called "outer") for a hidden volume. */
|
||||||
@@ -1541,7 +1542,7 @@ static void VerifySizeAndUpdate (HWND hwndDlg, BOOL bUpdate)
|
|||||||
{
|
{
|
||||||
if (lTmp * i > (bHiddenVolHost ? TC_MAX_HIDDEN_VOLUME_HOST_SIZE : TC_MAX_VOLUME_SIZE))
|
if (lTmp * i > (bHiddenVolHost ? TC_MAX_HIDDEN_VOLUME_HOST_SIZE : TC_MAX_VOLUME_SIZE))
|
||||||
bEnable = FALSE;
|
bEnable = FALSE;
|
||||||
else if (!bDevice && (lTmp * i > nAvailableFreeSpace) && (!bIsSparseFilesSupportedByHost || bHiddenVolHost))
|
else if (!bDevice && (lTmp * i > nAvailableFreeSpace) && !bDontCheckFileContainerSize && (!bIsSparseFilesSupportedByHost || bHiddenVolHost))
|
||||||
{
|
{
|
||||||
// we check container size against available free space only when creating dynamic volume is not possible
|
// we check container size against available free space only when creating dynamic volume is not possible
|
||||||
// which is the case if filesystem doesn't allow sparce file or if we are creating outer volume of a hidden volume
|
// which is the case if filesystem doesn't allow sparce file or if we are creating outer volume of a hidden volume
|
||||||
@@ -8945,6 +8946,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
|
|||||||
OptionSilent,
|
OptionSilent,
|
||||||
OptionDynamic,
|
OptionDynamic,
|
||||||
OptionForce,
|
OptionForce,
|
||||||
|
OptionNoSizeCheck,
|
||||||
};
|
};
|
||||||
|
|
||||||
argument args[]=
|
argument args[]=
|
||||||
@@ -8965,6 +8967,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
|
|||||||
{ OptionSilent, L"/silent", NULL, FALSE },
|
{ OptionSilent, L"/silent", NULL, FALSE },
|
||||||
{ OptionDynamic, L"/dynamic", NULL, FALSE },
|
{ OptionDynamic, L"/dynamic", NULL, FALSE },
|
||||||
{ OptionForce, L"/force", NULL, FALSE },
|
{ OptionForce, L"/force", NULL, FALSE },
|
||||||
|
{ OptionNoSizeCheck, L"/nosizecheck", NULL, FALSE },
|
||||||
|
|
||||||
// Internal
|
// Internal
|
||||||
{ CommandResumeSysEncLogOn, L"/acsysenc", L"/a", TRUE },
|
{ CommandResumeSysEncLogOn, L"/acsysenc", L"/a", TRUE },
|
||||||
@@ -9313,6 +9316,10 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
|
|||||||
bDontVerifyRescueDisk = TRUE;
|
bDontVerifyRescueDisk = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OptionNoSizeCheck:
|
||||||
|
bDontCheckFileContainerSize = TRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
case OptionHistory:
|
case OptionHistory:
|
||||||
{
|
{
|
||||||
wchar_t szTmp[8] = {0};
|
wchar_t szTmp[8] = {0};
|
||||||
|
|||||||
Reference in New Issue
Block a user