VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume
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/ExpandVolume
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/ExpandVolume')
-rw-r--r--src/ExpandVolume/DlgExpandVolume.cpp6
-rw-r--r--src/ExpandVolume/ExpandVolume.c6
-rw-r--r--src/ExpandVolume/InitDataArea.c8
-rw-r--r--src/ExpandVolume/WinMain.cpp4
4 files changed, 16 insertions, 8 deletions
diff --git a/src/ExpandVolume/DlgExpandVolume.cpp b/src/ExpandVolume/DlgExpandVolume.cpp
index 554f4f6f..15888f50 100644
--- a/src/ExpandVolume/DlgExpandVolume.cpp
+++ b/src/ExpandVolume/DlgExpandVolume.cpp
@@ -385,7 +385,7 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
pProgressDlgParam->hwndDlg = hwndDlg;
if ( _beginthread (volTransformThreadFunction, 0, pProgressDlgParam) == -1L )
{
- handleError (hwndDlg, ERR_OS_ERROR);
+ handleError (hwndDlg, ERR_OS_ERROR, SRC_POS);
EndDialog (hwndDlg, lw);
}
WaitCursor();
@@ -572,7 +572,7 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
NormalCursor();
- handleError (hwndDlg, nStatus);
+ handleError (hwndDlg, nStatus, SRC_POS);
}
WaitCursor();
@@ -722,7 +722,7 @@ ret:
error:
if (nStatus != 0)
- handleError (hwndDlg, nStatus);
+ handleError (hwndDlg, nStatus, SRC_POS);
burn (&VolumePassword, sizeof (VolumePassword));
diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c
index 5b9509be..9233340c 100644
--- a/src/ExpandVolume/ExpandVolume.c
+++ b/src/ExpandVolume/ExpandVolume.c
@@ -56,6 +56,10 @@ Original legal notice of the TrueCrypt source files:
#include "ExpandVolume.h"
#include "Resource.h"
+#ifndef SRC_POS
+#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
+#endif
+
#define DEBUG_EXPAND_VOLUME
#ifdef DEBUG_EXPAND_VOLUME
@@ -987,7 +991,7 @@ void __cdecl volTransformThreadFunction (void *pExpandDlgParam)
pParam->VolumePkcs5, pParam->VolumePin, pParam->newSize, pParam->bInitFreeSpace );
if (nStatus!=ERR_SUCCESS && nStatus!=ERR_USER_ABORT)
- handleError (hwndDlg, nStatus);
+ handleError (hwndDlg, nStatus, SRC_POS);
bVolTransformThreadCancel = FALSE;
diff --git a/src/ExpandVolume/InitDataArea.c b/src/ExpandVolume/InitDataArea.c
index a3793e86..c1eb6bd2 100644
--- a/src/ExpandVolume/InitDataArea.c
+++ b/src/ExpandVolume/InitDataArea.c
@@ -59,6 +59,10 @@ Original legal notice of the TrueCrypt source:
#include "InitDataArea.h"
+#ifndef SRC_POS
+#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
+#endif
+
int FormatWriteBufferSize = 1024 * 1024;
static uint32 FormatSectorSize = 0;
@@ -226,7 +230,7 @@ static void __cdecl FormatWriteThreadProc (void *arg)
{
if (WaitForSingleObject (WriteBufferFullEvent, INFINITE) == WAIT_FAILED)
{
- handleWin32Error (NULL);
+ handleWin32Error (NULL, SRC_POS);
break;
}
@@ -240,7 +244,7 @@ static void __cdecl FormatWriteThreadProc (void *arg)
if (!SetEvent (WriteBufferEmptyEvent))
{
- handleWin32Error (NULL);
+ handleWin32Error (NULL, SRC_POS);
break;
}
}
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp
index 81d782c1..020a6b22 100644
--- a/src/ExpandVolume/WinMain.cpp
+++ b/src/ExpandVolume/WinMain.cpp
@@ -983,9 +983,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");
}