| 718 | |
| 719 | |
| 720 | void CMountPropertyPage::OnClickedMount() |
| 721 | { |
| 722 | // TODO: Add your control notification handler code here |
| 723 | |
| 724 | bool save_passwords_enabled = false; |
| 725 | CryptSettings::getInstance().GetSettingCurrent(ENABLE_SAVING_PASSWORDS, save_passwords_enabled); |
| 726 | |
| 727 | CSecureEdit *pEd = (CSecureEdit*)GetDlgItem(IDC_PASSWORD); |
| 728 | if (pEd && save_passwords_enabled) { |
| 729 | if (IsDlgButtonChecked(IDC_SAVE_PASSWORD)) { |
| 730 | if (pEd->m_strRealText == NULL || wcslen(pEd->m_strRealText) < 1) { |
| 731 | CWnd *pPath = GetDlgItem(IDC_PATH); |
| 732 | if (pPath) { |
| 733 | LockZeroBuffer<WCHAR> password(MAX_PASSWORD_LEN + 1, true); |
| 734 | CString cpath; |
| 735 | pPath->GetWindowTextW(cpath); |
| 736 | if (cpath.GetLength() > 0 && SavedPasswords::RetrievePassword(cpath, password.m_buf, password.m_len)) { |
| 737 | pEd->SetRealText(password.m_buf); |
| 738 | } |
| 739 | } |
| 740 | } |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | CString mes = Mount(); |
| 745 | if (mes.GetLength() > 0) |
| 746 | MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); |
| 747 | } |
| 748 | |
| 749 | |
| 750 | void CMountPropertyPage::OnClickedDismount() |
nothing calls this directly
no test coverage detected