1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows: Display source location of errors in order to help diagnose issues reported by users

This commit is contained in:
Mounir IDRASSI
2015-07-05 18:15:41 +02:00
parent c3b77fba25
commit 724043be0b
23 changed files with 270 additions and 227 deletions

View File

@@ -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));

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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");
}