From 7a01453f00aba9ed41228ac9c7064e69379be8cd Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 8 Jul 2015 22:08:05 +0200 Subject: 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. --- src/Mount/MainCom.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Mount/MainCom.cpp b/src/Mount/MainCom.cpp index b527d428..e6945781 100644 --- a/src/Mount/MainCom.cpp +++ b/src/Mount/MainCom.cpp @@ -302,6 +302,8 @@ extern "C" int UacChangePwd (char *lpszVolume, Password *oldPassword, int old_pk CComPtr 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; } -- cgit v1.2.3