mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Windows: Fix old issue inherited from TrueCrypt by initializing COM library before instantiating UAC COM object used for changing password. This issue made it impossible to change the password of a volume requiring administrative privileges.
This commit is contained in:
@@ -302,6 +302,8 @@ extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pk
|
||||
CComPtr<ITrueCryptMainCom> tc;
|
||||
int r;
|
||||
|
||||
CoInitialize (NULL);
|
||||
|
||||
if (ComGetInstance (hwndDlg, &tc))
|
||||
{
|
||||
WaitCursor ();
|
||||
@@ -320,5 +322,7 @@ extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pk
|
||||
else
|
||||
r = -1;
|
||||
|
||||
CoUninitialize ();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user