VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume
diff options
context:
space:
mode:
Diffstat (limited to 'src/ExpandVolume')
-rw-r--r--src/ExpandVolume/DlgExpandVolume.cpp5
-rw-r--r--src/ExpandVolume/ExpandVolume.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ExpandVolume/DlgExpandVolume.cpp b/src/ExpandVolume/DlgExpandVolume.cpp
index 966650bb..db2aa9fd 100644
--- a/src/ExpandVolume/DlgExpandVolume.cpp
+++ b/src/ExpandVolume/DlgExpandVolume.cpp
@@ -476,7 +476,10 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
}
if (Randinit() != ERR_SUCCESS) {
- nStatus = ERR_PARAMETER_INCORRECT;
+ if (CryptoAPILastError == ERROR_SUCCESS)
+ nStatus = ERR_RAND_INIT_FAILED;
+ else
+ nStatus = ERR_CAPI_INIT_FAILED;
goto error;
}
diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c
index 65a3740a..1d777a11 100644
--- a/src/ExpandVolume/ExpandVolume.c
+++ b/src/ExpandVolume/ExpandVolume.c
@@ -602,7 +602,13 @@ static int ExpandVolume (HWND hwndDlg, char *lpszVolume, Password *pVolumePasswo
}
if (Randinit ())
- goto error; // note: nStatus == ERR_OS_ERROR
+ {
+ if (CryptoAPILastError == ERROR_SUCCESS)
+ nStatus = ERR_RAND_INIT_FAILED;
+ else
+ nStatus = ERR_CAPI_INIT_FAILED;
+ goto error;
+ }
if (!bDevice && bPreserveTimestamp)
{