VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Cmdline.c
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/Common/Cmdline.c
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/Common/Cmdline.c')
-rw-r--r--src/Common/Cmdline.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Common/Cmdline.c b/src/Common/Cmdline.c
index 6e325fe3..929b777d 100644
--- a/src/Common/Cmdline.c
+++ b/src/Common/Cmdline.c
@@ -22,6 +22,10 @@
#include "Language.h"
#include <Strsafe.h>
+#ifndef SRC_POS
+#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
+#endif
+
/* Except in response to the WM_INITDIALOG message, the dialog box procedure
should return nonzero if it processes the message, and zero if it does
not. - see DialogProc */
@@ -92,7 +96,7 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs)
LPWSTR *arguments = CommandLineToArgvW (GetCommandLineW(), &argumentCount);
if (!arguments)
{
- handleWin32Error (NULL);
+ handleWin32Error (NULL, SRC_POS);
return 0;
}
@@ -120,7 +124,7 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs)
int len = WideCharToMultiByte (CP_ACP, 0, arguments[i + 1], -1, arg, (int) argLen + 1, NULL, NULL);
if (len == 0)
{
- handleWin32Error (NULL);
+ handleWin32Error (NULL, SRC_POS);
AbortProcessSilent();
}
}