VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-05 18:15:41 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-06 01:19:21 +0200
commit724043be0b9ed68382c49c54b4750ddeaebe81c4 (patch)
treef93ab6d2b1597b9fd2c3c354f0c730b805cc3c57 /src/Format
parentc3b77fba25539c433c882d980169f2c68329e996 (diff)
downloadVeraCrypt-724043be0b9ed68382c49c54b4750ddeaebe81c4.tar.gz
VeraCrypt-724043be0b9ed68382c49c54b4750ddeaebe81c4.zip
Windows: Display source location of errors in order to help diagnose issues reported by users
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
@@ -79,7 +79,7 @@ static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const char *devicePath, in
NULL))
{
if (!silent)
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
return -1;
}
@@ -90,7 +90,7 @@ static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const char *devicePath, in
{
SetLastError (ERROR_INTERNAL_ERROR);
if (!silent)
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
return -1;
}
@@ -189,7 +189,7 @@ BOOL CheckRequirementsForNonSysInPlaceEnc (HWND hwndDlg, const char *devicePath,
{
if (!silent)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
Error ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL", hwndDlg);
}
return FALSE;
@@ -458,7 +458,7 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
&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;
@@ -496,7 +496,7 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
&dwResult,
NULL))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "CANNOT_RESIZE_FILESYS", TRUE);
nStatus = ERR_DONT_REPORT;
goto closing_seq;
@@ -523,11 +523,11 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
continue;
}
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
}
}
else
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "CANNOT_RESIZE_FILESYS", TRUE);
nStatus = ERR_DONT_REPORT;
@@ -1237,7 +1237,7 @@ 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");
}
}
@@ -1797,7 +1797,7 @@ static HANDLE OpenPartitionVolume (HWND hwndDlg, const char *devName,
{
if (!bSilent)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
if (bShowAlternativeSteps)
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
@@ -1823,7 +1823,7 @@ static HANDLE OpenPartitionVolume (HWND hwndDlg, const char *devName,
{
if (!bSilent)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
if (bShowAlternativeSteps)
ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
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
@@ -308,7 +308,7 @@ void CALLBACK ResumeInPlaceEncWaitThreadProc(void* pArg, HWND hwndDlg)
}
else
{
- handleError(hwndDlg, status);
+ handleError(hwndDlg, status, SRC_POS);
}
break;
@@ -524,7 +524,7 @@ static BOOL SaveSysEncSettings (HWND hwndDlg)
if (f == NULL)
{
Error ("CANNOT_SAVE_SYS_ENCRYPTION_SETTINGS", hwndDlg);
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
return FALSE;
}
@@ -540,7 +540,7 @@ static BOOL SaveSysEncSettings (HWND hwndDlg)
|| XmlWriteFooter (f) < 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
fclose (f);
Error ("CANNOT_SAVE_SYS_ENCRYPTION_SETTINGS", hwndDlg);
return FALSE;
@@ -2662,7 +2662,7 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
wchar_t szMsg[8192];
- handleError (hwndDlg, nStatus);
+ handleError (hwndDlg, nStatus, SRC_POS);
if (bInPlaceEncNonSys)
{
@@ -3292,7 +3292,7 @@ BOOL QueryFreeSpace (HWND hwndDlg, HWND hwndTextBox, BOOL display)
if (!GetVolumePathName (szFileName, root, sizeof (root)))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
return FALSE;
}
@@ -5226,7 +5226,7 @@ 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;
}
@@ -5846,7 +5846,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (!ComServerFormat ())
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
exit (1);
}
exit (0);
@@ -6993,7 +6993,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (nVolumeSize == -1)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
return 1;
}
@@ -7353,7 +7353,7 @@ 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;
}
@@ -7380,7 +7380,7 @@ 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");
}
}
@@ -7413,7 +7413,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
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");
}
@@ -7435,7 +7435,7 @@ 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");
}
@@ -7449,7 +7449,7 @@ 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");
}
@@ -7460,7 +7460,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
nVolumeSize = GetDeviceSize (szDiskFile);
if (nVolumeSize == -1)
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
AbortProcessSilent ();
}
@@ -8745,7 +8745,7 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
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;
}
@@ -8783,7 +8783,7 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
if (SetFilePointerEx (hDevice, offset, &offsetNew, FILE_BEGIN) == 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
goto efs_error;
}
@@ -8791,7 +8791,7 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
if (result == 0)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
MessageBoxW (hwndDlg, GetString ("CANT_ACCESS_OUTER_VOL"), lpszTitle, ICON_HAND);
goto efs_error;
}
@@ -8842,7 +8842,7 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
&dwNumberOfFreeClusters,
&dwTotalNumberOfClusters))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
Error ("CANT_GET_OUTER_VOL_INFO", hwndDlg);
return -1;
};
@@ -8955,7 +8955,7 @@ int ScanVolClusterBitmap (HWND hwndDlg, int *driveNo, __int64 nbrClusters, __int
&lBytesReturned,
NULL))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
MessageBoxW (hwndDlg, GetString ("CANT_GET_CLUSTER_BITMAP"), lpszTitle, ICON_HAND);
goto vcm_error;
@@ -9649,9 +9649,9 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpszComm
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");
}
@@ -9677,7 +9677,7 @@ static int GetFormatSectorSize ()
if (!GetDriveGeometry (szDiskFile, &geometry))
{
- handleWin32Error (MainDlg);
+ handleWin32Error (MainDlg, SRC_POS);
AbortProcessSilent();
}