VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
Diffstat (limited to 'src/Format')
-rw-r--r--src/Format/InPlace.c20
-rw-r--r--src/Format/Tcformat.c44
2 files changed, 32 insertions, 32 deletions
diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c
index 24303036..80d6ab3e 100644
--- a/src/Format/InPlace.c
+++ b/src/Format/InPlace.c
@@ -78,9 +78,9 @@ static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const char *devicePath, in
&nBytesReturned,
NULL))
{
if (!silent)
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
return -1;
}
@@ -89,9 +89,9 @@ static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const char *devicePath, in
)
{
SetLastError (ERROR_INTERNAL_ERROR);
if (!silent)
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
return -1;
}
@@ -188,9 +188,9 @@ BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath,
if (FakeDosNameForDevice (devicePath, dosDev, sizeof(dosDev), devName, sizeof(devName),FALSE) != 0)
{
if (!silent)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
Error ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL", hwndDlg);
}
return FALSE;
}
@@ -457,9 +457,9 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
0,
&dwResult,
NULL))
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
nStatus = ERR_DONT_REPORT;
goto closing_seq;
}
@@ -495,9 +495,9 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
0,
&dwResult,
NULL))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "CANNOT_RESIZE_FILESYS", TRUE);
nStatus = ERR_DONT_REPORT;
goto closing_seq;
}
@@ -522,13 +522,13 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
clustersMovedBeforeVolumeEnd = TRUE;
continue;
}
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
}
}
else
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "CANNOT_RESIZE_FILESYS", TRUE);
nStatus = ERR_DONT_REPORT;
goto closing_seq;
@@ -1236,9 +1236,9 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
if (driveLetter == -1
|| !UnmountVolume (hwndDlg, driveLetter, TRUE))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
AbortProcess ("CANT_DISMOUNT_VOLUME");
}
}
@@ -1796,9 +1796,9 @@ static HANDLE OpenPartitionVolume (HWND hwndDlg, const char *devName,
if (bExclusiveRequired)
{
if (!bSilent)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
if (bShowAlternativeSteps)
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
else
@@ -1822,9 +1822,9 @@ static HANDLE OpenPartitionVolume (HWND hwndDlg, const char *devName,
else
{
if (!bSilent)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
if (bShowAlternativeSteps)
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
else
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index bee1e028..523c069b 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -307,9 +307,9 @@ void CALLBACK ResumeInPlaceEncWaitThreadProc(void* pArg, HWND hwndDlg)
CloseVolume (&volume);
}
else
{
- handleError(hwndDlg, status);
+ handleError(hwndDlg, status, SRC_POS);
}
break;
}
@@ -523,9 +523,9 @@ static BOOL SaveSysEncSettings (HWND hwndDlg)
f = fopen (GetConfigPath (TC_APPD_FILENAME_SYSTEM_ENCRYPTION), "w");
if (f == NULL)
{
Error ("CANNOT_SAVE_SYS_ENCRYPTION_SETTINGS", hwndDlg);
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
return FALSE;
}
if (XmlWriteHeader (f) < 0
@@ -539,9 +539,9 @@ static BOOL SaveSysEncSettings (HWND hwndDlg)
|| fputs ("\n\t</sysencryption>", f) < 0
|| XmlWriteFooter (f) < 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
fclose (f);
Error ("CANNOT_SAVE_SYS_ENCRYPTION_SETTINGS", hwndDlg);
return FALSE;
}
@@ -2661,9 +2661,9 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
/* An error occurred */
wchar_t szMsg[8192];
- handleError (hwndDlg, nStatus);
+ handleError (hwndDlg, nStatus, SRC_POS);
if (bInPlaceEncNonSys)
{
if (bInPlaceEncNonSysResumed)
@@ -3291,9 +3291,9 @@ BOOL QueryFreeSpace (HWND hwndDlg, HWND hwndTextBox, BOOL display)
ULARGE_INTEGER free;
if (!GetVolumePathName (szFileName, root, sizeof (root)))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
return FALSE;
}
if (!GetDiskFreeSpaceEx (root, &free, 0, 0))
@@ -5225,9 +5225,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
nVolumeSize = GetDeviceSize (szDiskFile);
if (nVolumeSize == -1)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
return 1;
}
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
@@ -5845,9 +5845,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
InitDialog (hwndDlg);
if (!ComServerFormat ())
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
exit (1);
}
exit (0);
}
@@ -6992,9 +6992,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
nVolumeSize = GetDeviceSize (szDiskFile);
if (nVolumeSize == -1)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
return 1;
}
if (AskWarnYesNo ("NONSYS_INPLACE_ENC_CONFIRM_BACKUP", hwndDlg) == IDNO)
@@ -7352,9 +7352,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
nVolumeSize = GetDeviceSize (szDiskFile);
if (nVolumeSize == -1)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
NormalCursor();
return 1;
}
@@ -7379,9 +7379,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (driveNo == -1
|| !UnmountVolume (hwndDlg, driveNo, TRUE))
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
AbortProcess ("CANT_DISMOUNT_VOLUME");
}
}
@@ -7412,9 +7412,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
memset (&volProp, 0, sizeof(volProp));
volProp.driveNo = driveNo;
if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &volProp, sizeof (volProp), &volProp, sizeof (volProp), &dwResult, NULL) || dwResult == 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
UnmountVolume (hwndDlg, driveNo, TRUE);
AbortProcess ("CANT_GET_VOL_INFO");
}
@@ -7434,9 +7434,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
// Remount the volume using the backup header to verify it is working
if (!UnmountVolume (hwndDlg, driveNo, TRUE))
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
AbortProcess ("CANT_DISMOUNT_VOLUME");
}
mountOptions.UseBackupHeader = TRUE; // This must be TRUE at this point (we won't be using the regular header, which will be lost soon after the decryption process starts)
@@ -7448,9 +7448,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (!UnmountVolume (hwndDlg, driveNo, TRUE))
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
AbortProcess ("CANT_DISMOUNT_VOLUME");
}
BOOL tmpbDevice;
@@ -7459,9 +7459,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
nVolumeSize = GetDeviceSize (szDiskFile);
if (nVolumeSize == -1)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
AbortProcessSilent ();
}
nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
@@ -8744,9 +8744,9 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
memset (&volProp, 0, sizeof(volProp));
volProp.driveNo = *driveNo;
if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &volProp, sizeof (volProp), &volProp, sizeof (volProp), &dwResult, NULL) || dwResult == 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
Error ("CANT_ACCESS_OUTER_VOL", hwndDlg);
goto efsf_error;
}
@@ -8782,17 +8782,17 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
offset.QuadPart = 0;
if (SetFilePointerEx (hDevice, offset, &offsetNew, FILE_BEGIN) == 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
goto efs_error;
}
result = ReadFile (hDevice, &readBuffer, TC_MAX_VOLUME_SECTOR_SIZE, &bytesReturned, NULL);
if (result == 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
MessageBoxW (hwndDlg, GetString ("CANT_ACCESS_OUTER_VOL"), lpszTitle, ICON_HAND);
goto efs_error;
}
@@ -8841,9 +8841,9 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
&dwBytesPerSector,
&dwNumberOfFreeClusters,
&dwTotalNumberOfClusters))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
Error ("CANT_GET_OUTER_VOL_INFO", hwndDlg);
return -1;
};
@@ -8954,9 +8954,9 @@ int ScanVolClusterBitmap (HWND hwndDlg, int *driveNo, __int64 nbrClusters, __int
bufLen,
&lBytesReturned,
NULL))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
MessageBoxW (hwndDlg, GetString ("CANT_GET_CLUSTER_BITMAP"), lpszTitle, ICON_HAND);
goto vcm_error;
}
@@ -9648,11 +9648,11 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpszComm
status = DriverAttach ();
if (status != 0)
{
if (status == ERR_OS_ERROR)
- handleWin32Error (NULL);
+ handleWin32Error (NULL, SRC_POS);
else
- handleError (NULL, status);
+ handleError (NULL, status, SRC_POS);
AbortProcess ("NODRIVER");
}
@@ -9676,9 +9676,9 @@ static int GetFormatSectorSize ()
DISK_GEOMETRY geometry;
if (!GetDriveGeometry (szDiskFile, &geometry))
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
AbortProcessSilent();
}
return geometry.BytesPerSector;