VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
Diffstat (limited to 'src/Format')
-rw-r--r--src/Format/Tcformat.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 80fc6d00..b32ce0ce 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -9000,7 +9000,15 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpszComm
nPbar = IDC_PROGRESS_BAR;
if (Randinit ())
- AbortProcess ("INIT_RAND");
+ {
+ DWORD dwLastError = GetLastError ();
+ wchar_t szTmp[4096];
+ if (CryptoAPILastError == ERROR_SUCCESS)
+ StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("INIT_RAND"), SRC_POS, dwLastError);
+ else
+ StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("CAPI_RAND"), SRC_POS, CryptoAPILastError);
+ AbortProcessDirect (szTmp);
+ }
RegisterRedTick(hInstance);