VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup
diff options
context:
space:
mode:
Diffstat (limited to 'src/Setup')
-rw-r--r--src/Setup/SelfExtract.c10
-rw-r--r--src/Setup/Setup.c24
2 files changed, 19 insertions, 15 deletions
diff --git a/src/Setup/SelfExtract.c b/src/Setup/SelfExtract.c
index a4acde26..3ebaf5e6 100644
--- a/src/Setup/SelfExtract.c
+++ b/src/Setup/SelfExtract.c
@@ -19,8 +19,12 @@
#include "Language.h"
#include "Resource.h"
#include <Strsafe.h>
+#ifndef SRC_POS
+#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
+#endif
+
#define OutputPackageFile "VeraCrypt Setup " VERSION_STRING ".exe"
#define MAG_START_MARKER "TCINSTRT"
#define MAG_END_MARKER_OBFUSCATED "T/C/I/N/S/C/R/C"
@@ -251,9 +255,9 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
// Clone 'VeraCrypt Setup.exe' to create the base of the new self-extracting archive
if (!TCCopyFile (inputFile, outputFile))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
PkgError ("Cannot copy 'VeraCrypt Setup.exe' to the package");
goto err;
}
@@ -434,9 +438,9 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, char *szDestDir)
tmpBuffer = LoadFile (outputFile, &tmpFileSize);
if (tmpBuffer == NULL)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
if (remove (outputFile))
PkgError ("Cannot load the package to compute CRC.\nFailed also to delete package file");
else
PkgError ("Cannot load the package to compute CRC");
@@ -719,9 +723,9 @@ void __cdecl ExtractAllFilesThread (void *hwndDlg)
if (mkfulldir (DestExtractPath, FALSE) != 0)
{
wchar_t szTmp[TC_MAX_PATH];
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("CANT_CREATE_FOLDER"), DestExtractPath);
MessageBoxW (hwndDlg, szTmp, lpszTitle, MB_ICONHAND);
bSuccess = FALSE;
goto eaf_end;
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index baf4faf7..a5a30189 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -725,9 +725,9 @@ BOOL DoFilesInstall (HWND hwndDlg, char *szDestDir)
{
// Dump filter driver cannot be installed to SysWOW64 directory
if (driver64 && !EnableWow64FsRedirection (FALSE))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
bResult = FALSE;
goto err;
}
@@ -741,9 +741,9 @@ BOOL DoFilesInstall (HWND hwndDlg, char *szDestDir)
if (driver64)
{
if (!EnableWow64FsRedirection (TRUE))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
bResult = FALSE;
goto err;
}
@@ -1001,9 +1001,9 @@ error:
RegCloseKey (hkey);
if (bOK == FALSE)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
Error ("REG_INSTALL_FAILED", hwndDlg);
}
// Register COM servers for UAC
@@ -1059,9 +1059,9 @@ BOOL DoApplicationDataUninstall (HWND hwndDlg)
StringCbCatA (path, sizeof(path), "\\VeraCrypt");
RemoveMessage (hwndDlg, path);
if (!StatRemoveDirectory (path))
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
bOK = FALSE;
}
return bOK;
@@ -1273,9 +1273,9 @@ try_delete:
error:
if (bOK == FALSE && GetLastError ()!= ERROR_SERVICE_DOES_NOT_EXIST)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
MessageBoxW (hwndDlg, GetString ("DRIVER_UINSTALL_FAILED"), lpszTitle, MB_ICONHAND);
}
else
bOK = TRUE;
@@ -1299,15 +1299,15 @@ BOOL DoDriverUnload (HWND hwndDlg)
if (status != 0)
{
if (status == ERR_OS_ERROR && GetLastError () != ERROR_FILE_NOT_FOUND)
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
AbortProcess ("NODRIVER");
}
if (status != ERR_OS_ERROR)
{
- handleError (NULL, status);
+ handleError (NULL, status, SRC_POS);
AbortProcess ("NODRIVER");
}
}
@@ -1400,9 +1400,9 @@ BOOL DoDriverUnload (HWND hwndDlg)
}
else
{
bOK = FALSE;
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
}
}
// Try to close all open TC windows
@@ -1543,9 +1543,9 @@ BOOL DoShortcutsUninstall (HWND hwndDlg, char *szDestDir)
// Start menu group
RemoveMessage ((HWND) hwndDlg, szLinkDir);
if (StatRemoveDirectory (szLinkDir) == FALSE)
- handleWin32Error ((HWND) hwndDlg);
+ handleWin32Error ((HWND) hwndDlg, SRC_POS);
// Desktop icon
if (allUsers)
@@ -1612,9 +1612,9 @@ BOOL DoShortcutsInstall (HWND hwndDlg, char *szDestDir, BOOL bProgGroup, BOOL bD
if (mkfulldir (szLinkDir, FALSE) != 0)
{
wchar_t szTmpW[TC_MAX_PATH];
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
StringCbPrintfW (szTmpW, sizeof(szTmpW), GetString ("CANT_CREATE_FOLDER"), szLinkDir);
MessageBoxW (hwndDlg, szTmpW, lpszTitle, MB_ICONHAND);
goto error;
}
@@ -1894,9 +1894,9 @@ void DoInstall (void *arg)
if (mkfulldir (InstallationPath, FALSE) != 0)
{
wchar_t szTmp[TC_MAX_PATH];
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("CANT_CREATE_FOLDER"), InstallationPath);
MessageBoxW (hwndDlg, szTmp, lpszTitle, MB_ICONHAND);
Error ("INSTALL_FAILED", hwndDlg);
PostMessage (MainDlg, TC_APPMSG_INSTALL_FAILURE, 0, 0);
@@ -1937,9 +1937,9 @@ void DoInstall (void *arg)
&& IsPagingFileActive (FALSE))
{
if (!DisablePagingFile())
{
- handleWin32Error (hwndDlg);
+ handleWin32Error (hwndDlg, SRC_POS);
Error ("FAILED_TO_DISABLE_PAGING_FILES", hwndDlg);
}
else
bRestartRequired = TRUE;