mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: when overwriting an existing file container, add its current size to the available free space
This commit is contained in:
@@ -3462,6 +3462,13 @@ BOOL QueryFreeSpace (HWND hwndDlg, HWND hwndTextBox, BOOL display, LONGLONG *pFr
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LARGE_INTEGER lDiskFree;
|
LARGE_INTEGER lDiskFree;
|
||||||
|
// if the file pointed by szFileName already exists, we must add its size to the free space since it will be overwritten durig the volume creation
|
||||||
|
__int64 lFileSize = GetFileSize64(szFileName);
|
||||||
|
if (lFileSize != -1)
|
||||||
|
{
|
||||||
|
free.QuadPart += lFileSize;
|
||||||
|
}
|
||||||
|
|
||||||
lDiskFree.QuadPart = free.QuadPart;
|
lDiskFree.QuadPart = free.QuadPart;
|
||||||
|
|
||||||
if (pFreeSpaceValue)
|
if (pFreeSpaceValue)
|
||||||
|
|||||||
Reference in New Issue
Block a user