diff --git a/TCPasswordManagerHelper.pas b/TCPasswordManagerHelper.pas index 2537d8f4..f77ec2c0 100644 --- a/TCPasswordManagerHelper.pas +++ b/TCPasswordManagerHelper.pas @@ -3,7 +3,7 @@ {Обертка над обращениями к менеджеру паролей Total Commander} interface -Uses Plugin_Types, Settings, Windows, SysUtils, AskPassword, {AskEncryptionPasswords,}MRC_Helper, Controls, Cipher; +Uses Plugin_Types, Settings, Windows, SysUtils, AskPassword, {AskEncryptionPasswords,}MRC_Helper, Controls, Cipher, WideStrUtils; type @@ -233,15 +233,20 @@ function TTCPasswordManager.StoreFileCryptPassword(AccountName: WideString): Wid exit; end; end; + GetMem(buf, 1024); ZeroMemory(buf, 1024); - buf := Addr(CurrentPassword[1]); + WStrCopy(buf, PWideChar(CurrentPassword)); + if self.RequestHandleProc(RT_Password, PWideChar(Verb + ' encryption password'), 'New password:', buf, 1024) then begin CurrentPassword := buf; self.SetPassword(crypt_id, CurrentPassword); result := TFileCipher.CryptedGUID(CurrentPassword); end; + + FreeMem(buf); + end; end.