VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Format.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-28 00:47:58 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-28 00:47:58 +0200
commit579ce2fd31f01b0befba947ed863ed1d5e4be3f0 (patch)
tree61ccfe4d3a3f21ea24ffc1a34c87b68053eb080e /src/Common/Format.h
parentdb12703e9b78192cc5dfc8c79b8d129290aa33f2 (diff)
downloadVeraCrypt-579ce2fd31f01b0befba947ed863ed1d5e4be3f0.tar.gz
VeraCrypt-579ce2fd31f01b0befba947ed863ed1d5e4be3f0.zip
Windows: Better handling of quick format for file container
We write a zeroed sector every 128 MiB, leaving other sectors untouched This helps users visualize the progress of actual file creation while forcing Windows to allocate the disk space of each 128 MiB chunk immediately, otherwise, Windows would delay the allocation until we write the backup header at the end of the volume which would make the user think that the format process has stalled after progress bar reaches 100%.
Diffstat (limited to 'src/Common/Format.h')
-rw-r--r--src/Common/Format.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Common/Format.h b/src/Common/Format.h
index 139607e5..f5d65f14 100644
--- a/src/Common/Format.h
+++ b/src/Common/Format.h
@@ -78,11 +78,12 @@ BOOL FormatNtfs (int driveNo, int clusterSize);
BOOL FormatFs (int driveNo, int clusterSize, int fsType);
BOOL ExternalFormatFs (int driveNo, int clusterSize, int fsType);
uint64 GetVolumeDataAreaSize (BOOL hiddenVolume, uint64 volumeSize);
-int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors, void *dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat);
-BOOL WriteSector ( void *dev , char *sector , char *write_buf , int *write_buf_cnt , __int64 *nSecNo , PCRYPTO_INFO cryptoInfo );
+int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, unsigned __int64 num_sectors, void *dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat, BOOL bDevice);
+BOOL WriteSector ( void *dev , char *sector , char *write_buf , int *write_buf_cnt , unsigned __int64 *nSecNo , unsigned __int64 startSector, PCRYPTO_INFO cryptoInfo );
BOOL FlushFormatWriteBuffer (void *dev, char *write_buf, int *write_buf_cnt, __int64 *nSecNo, PCRYPTO_INFO cryptoInfo);
static BOOL StartFormatWriteThread ();
static void StopFormatWriteThread ();
+BOOL MoveFilePointer (HANDLE dev, LARGE_INTEGER offset);
#define FILESYS_NONE 0
#define FILESYS_FAT 1