diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-28 19:04:05 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-28 23:27:56 +0100 |
commit | 25c3d15ed7edcb8483dc3de7a55cf4579f6504c4 (patch) | |
tree | 6705c8c3be5ca44f6a7ab583c4cd802e9c6fc944 /src/Mount/MainCom.cpp | |
parent | ec9ff0fc1d96d9af399bf2aab25965734bd984e7 (diff) | |
download | VeraCrypt-25c3d15ed7edcb8483dc3de7a55cf4579f6504c4.tar.gz VeraCrypt-25c3d15ed7edcb8483dc3de7a55cf4579f6504c4.zip |
Windows: support loading TrueCrypt volumes. Implement converting TrueCrypt volumes to VeraCrypt using the change password functionality.
Diffstat (limited to 'src/Mount/MainCom.cpp')
-rw-r--r-- | src/Mount/MainCom.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Mount/MainCom.cpp b/src/Mount/MainCom.cpp index a75b1e52..b2dfe89c 100644 --- a/src/Mount/MainCom.cpp +++ b/src/Mount/MainCom.cpp @@ -106,7 +106,7 @@ public: CW2A volumePathA(volumePath);
MainDlg = (HWND) hWnd;
if (volumePathA.m_psz)
- return ::ChangePwd (volumePathA.m_psz, oldPassword, 0, newPassword, pkcs5, wipePassCount,(HWND) hWnd);
+ return ::ChangePwd (volumePathA.m_psz, oldPassword, 0, FALSE, newPassword, pkcs5, wipePassCount, (HWND) hWnd);
else
return ERR_OUTOFMEMORY;
}
@@ -157,7 +157,18 @@ public: CW2A volumePathA(volumePath);
MainDlg = (HWND) hWnd;
if (volumePathA.m_psz)
- return ::ChangePwd (volumePathA.m_psz, oldPassword, old_pkcs5, newPassword, pkcs5, wipePassCount,(HWND) hWnd);
+ return ::ChangePwd (volumePathA.m_psz, oldPassword, old_pkcs5, FALSE, newPassword, pkcs5, wipePassCount, (HWND) hWnd);
+ else
+ return ERR_OUTOFMEMORY;
+ }
+
+ virtual int STDMETHODCALLTYPE ChangePasswordEx2 (BSTR volumePath, Password *oldPassword, int old_pkcs5, BOOL truecryptMode, Password *newPassword, int pkcs5, int wipePassCount, LONG_PTR hWnd)
+ {
+ USES_CONVERSION;
+ CW2A volumePathA(volumePath);
+ MainDlg = (HWND) hWnd;
+ if (volumePathA.m_psz)
+ return ::ChangePwd (volumePathA.m_psz, oldPassword, old_pkcs5, truecryptMode, newPassword, pkcs5, wipePassCount, (HWND) hWnd);
else
return ERR_OUTOFMEMORY;
}
@@ -272,7 +283,7 @@ extern "C" int UacRestoreVolumeHeader (HWND hwndDlg, char *lpszVolume) }
-extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pkcs5, Password *newPassword, int pkcs5, int wipePassCount, HWND hwndDlg)
+extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pkcs5, BOOL truecryptMode, Password *newPassword, int pkcs5, int wipePassCount, HWND hwndDlg)
{
CComPtr<ITrueCryptMainCom> tc;
int r;
@@ -280,7 +291,7 @@ extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pk if (ComGetInstance (hwndDlg, &tc))
{
WaitCursor ();
- r = tc->ChangePasswordEx (CComBSTR (lpszVolume), oldPassword, old_pkcs5, newPassword, pkcs5, wipePassCount, (LONG_PTR) hwndDlg);
+ r = tc->ChangePasswordEx2 (CComBSTR (lpszVolume), oldPassword, old_pkcs5, truecryptMode, newPassword, pkcs5, wipePassCount, (LONG_PTR) hwndDlg);
NormalCursor ();
}
else
|