From f7193f873c1eb2a1c5003abe7daf2349080b88a4 Mon Sep 17 00:00:00 2001 From: nbb1967 <81534939+nbb1967@users.noreply.github.com> Date: Thu, 22 Jan 2026 20:17:35 +0300 Subject: [PATCH 01/22] CreateProperties. CreateProperties. Move hardcoded strings to Resources (w/o listbox (!)). --- cppcryptfs/cppcryptfs.rc | Bin 38514 -> 40124 bytes cppcryptfs/resource.h | Bin 12678 -> 13668 bytes cppcryptfs/ui/CreatePropertyPage.cpp | 71 +++++++++++++++++++-------- 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index b2039b072cb49e329fd75782eb865a049e1f5aed..80c3e365ed50902fcdfced3cb9fc512177468f42 100644 GIT binary patch delta 1495 zcmbu9&1w@-6vq!;6seRhs)+4oh&z#jPf*gyq!p8zCXL!vi0Kpu)32o3W;L7AF0;5G z_zo@l(r$h7e-i$dLF3o!4 zo@Y{$hWYhq{%%VGsY*>YWy?H${BXG|p|qvX>@oJ_h`Gmmn{iL}IS z=g&4CJpAoj&RxshfjP$$m^F*JmgB`UpMnSRxSzb-)YVPc>LZXw#!Dct$+dy6q;ei8 zPJM`@k%O3*P);Ob=}4CB=8`oyV1Cc{F$T4m8m}7fP(T;BMjf%be4{)cc}=MhcN(^D zOC4*S1Az1?h;K=|WSk~EPMDvB19MnPQiiZDugJb`Ny{XW=HQsDjTrr*rPJt@YCuCJ zYdiSUcI&gM`Gm3yOvFxwm}p^$FALFje#xjKAh5#5g~aMP4OD&W*9S%q%H%BlzpxVB zpkjRT)@-(1DW2HIzc|R5kO~ABSuq`)>#-e}ubcC+W}pcTu1sLE))gpyc@E_YeNg7n zM6N4(7sigfW6!0lLmT!Djk&|)GRiMRlT%%Uu3}@qPCz1~Nm<)qYr&IdpOoPzSJ>@j zRFU8=wGEuR5|qrw+~TSpMvp6Jg;`5}h$)wM?)3=D>Qz{a4om+}V432b`{wug!nZ%e HkJJAE;so*j delta 26 icmdn9lj+kMrVTCqlO5bxCQsUuvufO(6Xh&tF8c zwj#cp=_`7mOWc%(#aTAjJ12{*2&^HcNcO{vOh?>}n)`)Y;@7M(Cjq~pd*m&QMgqS^ zN_#nrCw7Nj0IiHlllAF($DA@odPYV_!Y-pm#`;O>Da%ayyPoN8Sx+exBD#jcIr>eo z*nKulYfW+vF}o0m)TH{GBYyY;2b?nlLw-RY+LAf0ryvf2_HB9Di~q3t-R(}!T33hP Dv7Kb! delta 16 XcmaEo)t0=$f_?G password2(MAX_PASSWORD_LEN + 1, false); if (!password.IsLocked() || !password2.IsLocked()) { - MessageBox(L"could not lock password buffers", L"cppcryptefs", MB_OK | MB_ICONERROR); - return; + CString strMessage; + if (strMessage.LoadString(IDS_COULD_NOT_LOCK_BUFFER)) { + MessageBox(strMessage, L"cppcryptefs", MB_OK | MB_ICONERROR); + return; + } } CSecureEdit *pPass = &m_password; @@ -120,8 +123,11 @@ void CCreatePropertyPage::CreateCryptfs() return; if (wcslen(password.m_buf) < 1) { - MessageBox(L"please enter a password", L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; + CString strMessage; + if (strMessage.LoadString(IDS_PASSWORD_EMPTY)) { + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; + } } CSecureEdit *pPass2 = &m_password2; @@ -130,13 +136,19 @@ void CCreatePropertyPage::CreateCryptfs() return; if (wcslen(password2.m_buf) < 1) { - MessageBox(L"please repeat the password", L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; + CString strMessage; + if (strMessage.LoadString(IDS_PASSWORD_REPEAT_EMPTY)) { + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; + } } if (wcscmp(password.m_buf, password2.m_buf)) { - MessageBox(L"passwords do not match", L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; + CString strMessage; + if (strMessage.LoadString(IDS_PASSWORD_DO_NOT_MATCH)) { + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; + } } pPass->SetRealText(L""); @@ -147,17 +159,23 @@ void CCreatePropertyPage::CreateCryptfs() pWnd->GetWindowTextW(cpath); if (cpath.GetLength() < 1) { - MessageBox(L"please enter a path", L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; + CString strMessage; + if (strMessage.LoadString(IDS_PATH_EMPTY)) { + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; + } } if (!PathFileExists(cpath)) { - CString mes; + CString mes, strMessage; mes += cpath; - mes += L" does not exist. Do you want to create it?"; + strMessage.LoadString(IDS_PATH_DOES_NOT_EXIST); + mes += strMessage; + if (MessageBox(mes, L"cppcryptfs", MB_YESNO | MB_ICONINFORMATION) == IDYES) { if (!CreateDirectory(cpath, NULL)) { - mes = L"Could not create "; + strMessage.LoadString(IDS_PATH_COULD_NOT_CREATE); + mes = strMessage; mes += cpath; MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; @@ -255,9 +273,11 @@ void CCreatePropertyPage::CreateCryptfs() return; } - CString mes; + CString mes, strMsgReverse, strMsgForward; + strMsgReverse.LoadString(IDS_CREATED_REVERSE_FS); + strMsgForward.LoadString(IDS_CREATED_FORWARD_FS); - mes = reverse ? L"Created reverse encrypted filesystem in " : L"Created encrypted filesystem in "; + mes = reverse ? strMsgReverse : strMsgForward; mes.Append(cpath); @@ -345,8 +365,11 @@ void CCreatePropertyPage::OnClickedSelect() return; if (!IsDlgButtonChecked(IDC_REVERSE) && !can_delete_directory(cpath, TRUE)) { - MessageBox(L"directory must be empty", L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; + CString strMessage; + if (strMessage.LoadString(IDS_DIRECTORY_NOT_EMPTY)) { + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; + } } CWnd *pWnd = GetDlgItem(IDC_PATH); @@ -452,7 +475,10 @@ BOOL CCreatePropertyPage::OnInitDialog() pLbox->EnableWindow(IsDlgButtonChecked(IDC_LONG_FILE_NAMES)); if (!m_password.ArePasswordBuffersLocked() || !m_password2.ArePasswordBuffersLocked()) { - MessageBox(L"unable to lock password buffers", L"cppcryptfs", MB_OK | MB_ICONERROR); + CString strMessage; + if (strMessage.LoadString(IDS_UNABLE_LOCK_BUFFER)) { + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONERROR); + } } const auto scryptN = theApp.GetProfileIntW(L"CreateOptions", L"ScryptN", DEFAULT_SCRYPTN); @@ -580,16 +606,19 @@ void CCreatePropertyPage::OnSelchangeScryptn() int scryptN = stoi((LPCTSTR)sel); int mem = (1<= 1024) { - suffix = L" GB required"; + suffix = strMsgGB; mem /= 1024; } auto pScryptMemReq = (CStatic*)GetDlgItem(IDC_SCRYPTMEMREQ); if (pScryptMemReq) { - pScryptMemReq->SetWindowText((std::to_wstring(mem) + suffix).c_str()); + pScryptMemReq->SetWindowText((std::to_wstring(mem) + (LPCTSTR)suffix).c_str()); } } From 9bca4229de58976903d497848a320c17f77cf95d Mon Sep 17 00:00:00 2001 From: nbb1967 <81534939+nbb1967@users.noreply.github.com> Date: Fri, 23 Jan 2026 13:10:48 +0300 Subject: [PATCH 02/22] FsInfoDialog FsInfoDialog. Hardcoded strings move to rc. --- cppcryptfs/cppcryptfs.rc | Bin 40124 -> 41040 bytes cppcryptfs/resource.h | Bin 13668 -> 14280 bytes cppcryptfs/ui/FsInfoDialog.cpp | 39 ++++++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 80c3e365ed50902fcdfced3cb9fc512177468f42..d6476d8ae18f71752034b17f5fd7ff492a5cea2c 100644 GIT binary patch delta 518 zcmZutO-lk%6up>DlOtM`MT9ZA$rcs;1Sr zw1nNzoVe18s3%-_(|%wdYWgOYr$lu0J0$%sC`Jw!`%XL?)$i&;1vPBzBIKeSAMDj_ z2uS-yD2+>`lMcK$da~!{fhGH5%D6ShCPEaaFhwXtQOZz?f)vM&dtoR=d90c<t^Dnl5Ks2W+7 zq6&6Zjwq@=s)AK%qM8*1v@;BdgMc=>!qpowm@pVmc4U?W*{+VN1LW2qhHwT)AnAgv zW3nTsJeo_r8JyrMI2nv4_iKXPponTB$Yy6`bqpqx9~w%7>_&4fB& 0) { txt = to_wstring(m_info.cacheTTL); - txt += L" sec"; + txt += strMsgSec; } else { - txt = L"infinite"; + txt = strMsgInfinite; } SetDlgItemText(IDC_CACHE_TTL, txt.c_str()); WCHAR buf[32]; @@ -138,7 +157,7 @@ BOOL CFsInfoDialog::OnInitDialog() SetDlgItemText(IDC_CASE_CACHE_HR, txt.c_str()); r = m_info.lfnCacheHitRatio; if (r < 0.0f) { - txt = L"n/a"; + txt = strMsgNA; } else { _snwprintf_s(buf, _TRUNCATE, L"%.2f", r*100.0f); txt = buf; @@ -147,7 +166,7 @@ BOOL CFsInfoDialog::OnInitDialog() SetDlgItemText(IDC_LFN_CACHE_HR, txt.c_str()); r = m_info.dirIvCacheHitRatio; if (r < 0.0f) { - txt = L"n/a"; + txt = strMsgNA; } else { _snwprintf_s(buf, _TRUNCATE, L"%.2f", r*100.0f); txt = buf; From 0e7e60a5967d0248b5c0a542eededa31445a28d5 Mon Sep 17 00:00:00 2001 From: nbb1967 <81534939+nbb1967@users.noreply.github.com> Date: Sun, 25 Jan 2026 00:46:22 +0300 Subject: [PATCH 03/22] MountPropertyPage MountPropertyPage. Hardcoded strings moved to resources. --- cppcryptfs/cppcryptfs.rc | Bin 41040 -> 45902 bytes cppcryptfs/resource.h | Bin 14280 -> 16480 bytes cppcryptfs/ui/CreatePropertyPage.cpp | 2 +- cppcryptfs/ui/MountPropertyPage.cpp | 146 +++++++++++++++++++-------- 4 files changed, 107 insertions(+), 41 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index d6476d8ae18f71752034b17f5fd7ff492a5cea2c..9d0d9451932350c2c5747561d6c003b7185f1529 100644 GIT binary patch delta 2854 zcmd5;-%s0B6hB#5$N1F&h1zwDFRg%E1&1zClVSL}7KZ`aw1rJGSCJNI##&Yii^gR9 z0Y<*`&{C2;EXGHjof@AsPUGWT{14QZMPE#O^Tou^x!>=%KM;Lh8o1wk@44rk&pDrS z?)~Y(kw=e@R7%@Cakhoa+nX5M*x1qdE8{#b8AImW*uvPwCwFqzzKkv0RQQ;;-fH7d z3K=z?<`2|(kMF4c>D~9${Ne5<7fPpizWAY9e_UKqW2CggmC`l!ePS=F#^hd{D|<`o z`>FC(HEx#UYJ6CpSL4(B*Z7Z8^D!S~C`%b0+xPJ4;!A4pO7Q}JZ}ei`(f%5RC{78A zkWMk)DGkDd-lNNuqC9_QjCCjIB6eo+3oE%-Da1DoFFz=^c_Xwy>-gP*g&ZYGqeZM_ z#3HA51AIQw%U`;BIWp19e_d{CU4vX2yLr<1JHzePX_}(2uTzlTfDdyN!z{?ZIs=0m zB-f#FfmWeAg)vF*VlL-3+Q43lMxn*ak9Hi#-o&{mg>mu>uU%;Ni)VRSf#fRWGPG>X zOr7sxEytaE9?wA!W`J@ISmXRnF%UT1gBw7xp-`k0W<=M-Bk}aw@f0L6{HCCB7TBhM zYwWCtuM}MaD!TAZFi8B;k|BjHNuwAw{{8jg+s`2?;=7<0$sBD$a#5WzSMoq5@mPk$ zEqtxwr(vFz2wPdXjxWiHWaoy8o9w*W)!8{HzT=Tc^?~oiKlQ!4%iNO~x9>91QCY#CU zp1j=hE4t%&sIL0`s``Z!oBXK}XpbY~VN_`x{EhI4?rxCo?)PCQi(Cp%Z60Z0kq_)J zb+`jQdKMCS6)9o4$#szlHJpM~KCbsc-mY?~VBu*D|7%mb#CsFa01PM7%4?E${GbBaHAKErQ2PqqfZ*fgpRK8U4G z>46E@v3dkL;opTmUdy}CYO+xl%gX8|(=H-qJgy(K*cqQ$3^7g%j>MTsJ|a zNqkFyUOM4gp=n${-Z>xa*OMu)2)2Rtkwk#=7J`g5=HRF3mn%X;__OeR!@{|$NRq$Bfv}Qq+gdzyqG3X)J)5N61uS2_Fo>BPCh84lLd0ma7bQRg^bcBH+#6LR&a^ai_ z!#^nkB}rG|XHsc0Tk8nox(Z#3bX`30)I2epDl{R7C^FtI4RdA4!5__c9j#h**W~{l z>${;Y{(8VAv;tufMf@SIHo8K(Z9uyFkQKT^0g6-pNrYtz#}jZxR75eG$CofZ0Qu;m=ozR3FA#5H-+F5~b+d|KHZ^m&gF0d%o$#|F^RSKN?>k zH5=+>;J1q+hQv<+l~7GW)QGB^N24vbMVt9*FmHal0MG*QPns1f* zy4OI78iC|aja&UpPD_c&onCh_r`aY^hcpeknfkh@-ln5=BWlBZ8VK9FKGipaq&-zMZFkUZ|?cx?taDb E55&fXPXGV_ delta 191 zcmX^2jOoGwrVZ2jCvQ+=nY^gKWU@mr%j6vs6(&Dhs5JS*1fj`g6V$+BD<(8dHkeog zl`ooHwM1;P$D|39A51EmJRycBGS4)N$@`|UO%9rt0;IDh8%z(I+&4XB@+%;HK#py)-;9XK21YECH_eEe jEHX1}a?#9)$(Lp(a4Iq6G2{br>SRX_(arPLY+wTb7P3^o diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index 8394c565f10b99747988f1b6dd84987820cf91e5..03287077fdc1fa7b775cc9a4c11ad8924c3fb4ec 100755 GIT binary patch delta 1298 zcmZ`&TW-@(6g(kLTL+RN@lq637Lck6C~6y&w*2AN33Z`K6g!pR$14ET4Io&(2l z>ITRk%YdCQb04-78u`Pr@60)KXU_Tk<jwJ!s; zxEJ8N*?22MNhOo1gp#PgwHa23k*6|L?=}r?(Id`N&pMB{ zeQ^)!%WD-@TRhth<-N?%C6q`$pwnCud_^VnksMfb^U+6~&Cto!@})0F>hO;4(_O7~ z3FI8g($$LU$AM9XJ3e=JWZwi&4AvM*Vyl83uDdz@(BY?A$(dzkTKE5avO_=U-c~)6 z)%y_r-FV+l;K>!LTlZ1l+?p8VGf1Ix0{2oVodPw4>QGMchn(BkWSZ=}Rs{92u3va* z+_b6fG0{wxJ(FSMvadl0gwC-+4qIrqCNhW18o1 z%w%7#=jg4;{bClParam = lParam; } - +CString strMsgPassEmpty, strMsg; CMountPropertyPage::CMountPropertyPage() : CCryptPropertyPage(IDD_MOUNT) @@ -169,14 +169,23 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST LockZeroBuffer password(MAX_PASSWORD_LEN + 1, false); if (!password.IsLocked()) { - return CString(L"unable to lock password buffer"); + CString strMessage; + strMessage.LoadString(IDS_UNABLE_LOCK_BUFFER); + return strMessage; } - if (wcscpy_s(password.m_buf, MAX_PASSWORD_LEN + 1, argPassword ? argPassword : pPass->m_strRealText)) - return CString(L"unable to get password"); + if (wcscpy_s(password.m_buf, MAX_PASSWORD_LEN + 1, argPassword ? argPassword : pPass->m_strRealText)) { + CString strMessage; + strMessage.LoadString(IDS_UNABLE_GET_PASS); + return strMessage; + } - if (wcslen(password.m_buf) < 1) - return CString(L"password cannot be empty"); + if (wcslen(password.m_buf) < 1) { + CString strMessage; + strMessage.LoadString(IDS_PASS_CANNOT_BE_EMPTY); + return strMessage; + + } CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); @@ -199,7 +208,10 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST nItem = pList->FindItem(&fi); if (nItem < 0) { if (is_mountpoint_a_drive(str)) { - return CString(L"Mount point ") + str + CString(L" is already in use."); + CString strMsgMountPoint, strMsgAlreadyUsed; + strMsgMountPoint.LoadString(IDS_MOUNT_POINT); + strMsgAlreadyUsed.LoadString(IDS_ALREADY_USED); + return strMsgMountPoint + str + strMsgAlreadyUsed; } else { int i = pList->GetItemCount(); nItem = pList->InsertItem(LVIF_TEXT | (m_imageIndex >= 0 ? LVIF_IMAGE : 0) | LVIF_STATE, i, str, @@ -225,7 +237,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST : pList->GetItemText(nItem, DL_INDEX); if (cmp.GetLength() < 1) - return CString(L"unable to get drive letter");; + return CString(L"unable to get drive letter"); BOOL dlInUse = is_mountpoint_a_drive(cmp) && !IsDriveLetterAvailable(*(LPCWSTR)cmp); @@ -235,9 +247,12 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST dlInUse = true; if (dlInUse) { - CString mes = L"Mount point "; + CString mes, strMsgMountPoint, strMsgAlreadyUsed; + strMsgMountPoint.LoadString(IDS_MOUNT_POINT); + strMsgAlreadyUsed.LoadString(IDS_ALREADY_USED); + mes = strMsgMountPoint; mes += cmp; - mes += L" is already being used."; + mes += strMsgAlreadyUsed; return mes; } @@ -253,8 +268,11 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST else pWnd->GetWindowTextW(cpath); - if (cpath.GetLength() < 1) - return CString(L"path length is zero"); + if (cpath.GetLength() < 1) { + CString strMessage; + strMessage.LoadString(IDS_PATH_ZERO); + return strMessage; + } CString config_path; @@ -292,9 +310,11 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST } if (pathInUse) { + CString strMessage; + strMessage.LoadString(IDS_ALREADY_MOUNTED); CString mes = L""; mes += cpath; - mes += L" is already mounted on "; + mes += strMessage; mes += mdl; return mes; } @@ -323,14 +343,20 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST CryptSettings::getInstance().GetSettings(opts); if (opts.denyothersessions || opts.denyservices) { - if (!CanGetSessionIdOk()) { - return CString(L"Unable to get session id. Deny other sessions/Deny services setting will not work and must be disabled."); + if (!CanGetSessionIdOk()) { + CString strMessage; + strMessage.LoadString(IDS_UNABLE_GET_SESSION_ID); + return strMessage; } if (!have_sessionid()) { - return CString(L"Unable to get current process session id. Deny other sessions/Deny services setting will not work and must be disabled."); + CString strMessage; + strMessage.LoadString(IDS_UNABLE_GET_PROCESS_SESSION_ID); + return strMessage; } if (get_sessionid() == 0) { - return CString(L"Current session id is 0. Deny other sessions/Deny services setting will not work and must be disabled."); + CString strMessage; + strMessage.LoadString(IDS_SESSION_ID_ZERO); + return strMessage; } } @@ -358,7 +384,9 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (IsDlgButtonChecked(IDC_SAVE_PASSWORD)) { if (!SavedPasswords::SavePassword(cpath, password.m_buf)) { - MessageBox(L"unable to save password", L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); + CString strMessage; + strMessage.LoadString(IDS_UNABLE_SAVE_PASS); + MessageBox(strMessage, L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); } } @@ -492,7 +520,9 @@ BOOL CMountPropertyPage::OnInitDialog() // or using the string table resource CWnd *pWnd = GetDlgItem(IDC_SAVE_PASSWORD); if (pWnd) { - m_ToolTip.AddTool(pWnd, _T("To enable \"Save password\", turn on \"Enable saved passwords\" in the Settings tab.")); + CString strMessage; + strMessage.LoadString(IDS_TOOLTIP_ENABLE_SAVE_PASS); + m_ToolTip.AddTool(pWnd, strMessage); } } @@ -531,9 +561,13 @@ BOOL CMountPropertyPage::OnInitDialog() mountPointColumnWidth = 79; } - pList->InsertColumn(DL_INDEX, L"Mount Point", LVCFMT_LEFT, mountPointColumnWidth); + CString strMsgColHdrMountPoint, strMsgColHdrPath; + strMsgColHdrMountPoint.LoadString(IDS_COLUMN_HEADER_MOUNT_POINT); + strMsgColHdrPath.LoadString(IDS_COLUMN_HEADER_PATH); + + pList->InsertColumn(DL_INDEX, strMsgColHdrMountPoint, LVCFMT_LEFT, mountPointColumnWidth); - pList->InsertColumn(PATH_INDEX, L"Path", LVCFMT_LEFT, 454-mountPointColumnWidth); + pList->InsertColumn(PATH_INDEX, strMsgColHdrPath, LVCFMT_LEFT, 454-mountPointColumnWidth); CString lastMountPoint = theApp.GetProfileString(L"MountPoints", L"LastMountPoint", L""); @@ -619,8 +653,11 @@ BOOL CMountPropertyPage::OnInitDialog() if (pCombo) pCombo->LimitText(MAX_PATH); - if (!m_password.ArePasswordBuffersLocked()) - MessageBox(L"unable to lock password buffer", L"cppcryptfs", MB_OK | MB_ICONERROR); + if (!m_password.ArePasswordBuffersLocked()) { + CString strMessage; + strMessage.LoadString(IDS_UNABLE_LOCK_BUFFER); + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONERROR); + } ProcessCommandLine(GetCommandLine(), TRUE); @@ -767,6 +804,9 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo int nItem; if (argMountPoint && wcslen(argMountPoint) > 0) { + CString strMsgDrive, strMsgNoMountedFS; + strMsgDrive.LoadString(IDS_DRIVE); + strMsgNoMountedFS.LoadString(IDS_NO_MOUNTED_FS); LVFINDINFO fi; memset(&fi, 0, sizeof(fi)); fi.flags = LVFI_STRING; @@ -774,7 +814,7 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo fi.psz = str; nItem = pList->FindItem(&fi); if (nItem < 0) - return CString(L"Drive ") + str + CString(L" does not have a mounted cppcryptfs filesystem."); + return strMsgDrive + str + strMsgNoMountedFS; } else { nItem = pList->GetNextSelectedItem(pos); } @@ -789,8 +829,12 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo CString cpath = pList->GetItemText(nItem, PATH_INDEX); - if (cpath.GetLength() < 1) - return CString(L"Drive ") + cmp + CString(L" does not have a mounted cppcryptfs filesystem."); + if (cpath.GetLength() < 1) { + CString strMsgDrive, strMsgNoMountedFS; + strMsgDrive.LoadString(IDS_DRIVE); + strMsgNoMountedFS.LoadString(IDS_NO_MOUNTED_FS); + return strMsgDrive + cmp + strMsgNoMountedFS; + } CString mes; @@ -811,9 +855,11 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo theApp.DoWaitCursor(-1); if (!bresult) { + CString strMessage; + strMessage.LoadString(IDS_CANNOT_UNMOUNT); if (mes.GetLength() > 0) mes += L". "; - mes += L"cannot unmount "; + mes += strMessage; mes.Append(cmp); if (wmes.length() > 0) { mes += L" "; @@ -902,16 +948,22 @@ CString CMountPropertyPage::DismountAll(bool interactive, bool forceDismount) if (hadFailure) { if (hadSuccess) { - mes = L"Some of the drives could not be dismounted"; + CString strMessage; + strMessage.LoadString(IDS_SOME_DRV_NOT_DISMOUNTED); + mes = strMessage; } else { - mes = L"Unable to dismount"; + CString strMessage; + strMessage.LoadString(IDS_UNABLE_DISMOUNT); + mes = strMessage; } } if (volnameFailure) { + CString strMessage; + strMessage.LoadString(IDS_UNABLE_UPDATE_LABELS); if (mes.GetLength() > 0) mes += L". "; - mes += L"unable to update one or more volume labels"; + mes += strMessage; } return mes; @@ -961,14 +1013,18 @@ BOOL CMountPropertyPage::OnSetActive() if (flags & AUTO_MOUNT_FLAG) { CString mountPoint = theApp.GetProfileString(L"MountPoints", path_hash, NULL); if (mountPoint.GetLength() == 0) { - MessageBox(L"Fail to retrive MountPoint for " + m_lastDirs[i], L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + CString strMessage; + strMessage.LoadString(IDS_FAIL_RETRIVE_MPOINT); + MessageBox(strMessage + m_lastDirs[i], L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); continue; } LockZeroBuffer password(MAX_PASSWORD_LEN + 1, true); if (!SavedPasswords::RetrievePassword(m_lastDirs[i], password.m_buf, password.m_len)) { - MessageBox(L"Fail to retrive password for " + m_lastDirs[i], L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + CString strMessage; + strMessage.LoadString(IDS_FAIL_RETRIVE_PASS); + MessageBox(strMessage + m_lastDirs[i], L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); continue; } @@ -1723,7 +1779,14 @@ void CMountPropertyPage::OnContextMenu(CWnd* pWnd, CPoint point) if (!menu.CreatePopupMenu()) return; - menu.AppendMenu(MF_ENABLED, AddMountPointV, L"&Add Mount Point..."); + CString strMsgMenuAdd, strMsgMenuOpen, strMsgMenuProperties, strMsgMenuDismount, strMsgMenuDeleteMountPoint; + strMsgMenuAdd.LoadString(IDS_MENU_ADD_MOUNT_POINT); + strMsgMenuOpen.LoadString(IDS_MENU_OPEN); + strMsgMenuProperties.LoadString(IDS_MENU_PROPERTIES); + strMsgMenuDismount.LoadString(IDS_MENU_DISMOUNT); + strMsgMenuDeleteMountPoint.LoadString(IDS_DELETE_MOUNT_POINT); + + menu.AppendMenu(MF_ENABLED, AddMountPointV, strMsgMenuAdd); int item = -1; @@ -1740,12 +1803,12 @@ void CMountPropertyPage::OnContextMenu(CWnd* pWnd, CPoint point) wstring mpstr; bool mounted = MountPointManager::getInstance().find(cmp, mpstr); if (mounted) { - menu.AppendMenu(MF_ENABLED, OpenV, L"Open...\tdouble-click"); - menu.AppendMenu(MF_ENABLED, PropertiesV, L"&Properties..."); - menu.AppendMenu(MF_ENABLED, DismountV, L"&Dismount"); + menu.AppendMenu(MF_ENABLED, OpenV, strMsgMenuOpen); + menu.AppendMenu(MF_ENABLED, PropertiesV, strMsgMenuProperties); + menu.AppendMenu(MF_ENABLED, DismountV, strMsgMenuDismount); } if (is_mountpoint_a_dir(cmp)) { - menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, L"Dele&te Mount Point"); + menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, strMsgMenuDeleteMountPoint); } } @@ -1806,8 +1869,9 @@ void CMountPropertyPage::AddMountPoint(const CString & path) return; if (!is_suitable_mountpoint(path)) { - MessageBox(L"The path is not suitable for use as a mount point. The folder must be empty, and it must reside on an NTFS filesystem", - L"cppcyrptfs", MB_OK | MB_ICONEXCLAMATION); + CString strMessage; + strMessage.LoadString(IDS_PATH_NOT_SUITABLE_MPOINT); + MessageBox(strMessage, L"cppcyrptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -1816,7 +1880,9 @@ void CMountPropertyPage::AddMountPoint(const CString & path) int i = 0; for (CString mp = mountPointsStr.Tokenize(L"|", i); i >= 0; mp = mountPointsStr.Tokenize(L"|", i)) { if (!lstrcmpi(path, mp)) { - MessageBox(L"Mount point has already been added.", L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + CString strMessage; + strMessage.LoadString(IDS_MPOINT_ALREADY_ADDED); + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } } From 6b69a26f27a71631ff13a121564e0425cfa4f025 Mon Sep 17 00:00:00 2001 From: nbb1967 <81534939+nbb1967@users.noreply.github.com> Date: Sun, 25 Jan 2026 00:50:18 +0300 Subject: [PATCH 04/22] CryptPropertySheet CryptPropertySheet. Hardcoded strings moved to resources. --- cppcryptfs/cppcryptfs.rc | Bin 45902 -> 46154 bytes cppcryptfs/resource.h | Bin 16480 -> 16558 bytes cppcryptfs/ui/CryptPropertySheet.cpp | 5 ++++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 9d0d9451932350c2c5747561d6c003b7185f1529..e4df5e7bf9cc2441a537b901b99252dff9e9a68d 100644 GIT binary patch delta 146 zcmX^2jOo-1rVSI;O!iqIpz6Zl$q>xo%izxt%HYQk!Vu5k$lwEn@jwwjAnD2w!QeT0 zqlo0>1PvBeM}{1RoXNA7*fJJR&JB{B{B9|qr5=L?b>Nh;E*@W&;}lC>|uj delta 18 acmX^0g6Z5drVSI;O!na5+dOOS1~vd)0SNd2 diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index 03287077fdc1fa7b775cc9a4c11ad8924c3fb4ec..1a7b3ba1e49a0d69b76712e2f27e41150646b5c9 100755 GIT binary patch delta 66 zcmaFRz__lFaf5(}z6*mVLokCcgFizkgC9c(Lp*~cgAWkK14aCRq$@)NP(=s>ClDGj Pm`_gRmESBN5}*SB+Efg~ delta 14 VcmZ42$oQavaf5)!<~Wf69RMpk1qT2C diff --git a/cppcryptfs/ui/CryptPropertySheet.cpp b/cppcryptfs/ui/CryptPropertySheet.cpp index f1ad8a3..5b9e197 100755 --- a/cppcryptfs/ui/CryptPropertySheet.cpp +++ b/cppcryptfs/ui/CryptPropertySheet.cpp @@ -80,8 +80,11 @@ CCryptPropertySheet::~CCryptPropertySheet() BOOL CCryptPropertySheet::CanClose() { if (!MountPointManager::getInstance().empty()) { + + CString strMessage; + strMessage.LoadString(IDS_DISMOUNT_ALL_ON_EXIT); - if (MessageBox(L"All mounted cppcryptfs filesystems will be dismounted. Do you really wish to exit?", L"cppcryptfs", + if (MessageBox(strMessage, L"cppcryptfs", MB_YESNO | MB_ICONEXCLAMATION) == IDYES) { CString open_handles_mes = CheckOpenHandles(m_hWnd, nullptr, true, false).c_str(); From 1756a5121c403ff5d314198e2322c13258489fb0 Mon Sep 17 00:00:00 2001 From: nbb1967 <81534939+nbb1967@users.noreply.github.com> Date: Tue, 27 Jan 2026 10:40:58 +0300 Subject: [PATCH 05/22] Refactoring Refactoring. FolderDialog. locutils. --- cppcryptfs/cppcryptfs.rc | Bin 46154 -> 48388 bytes cppcryptfs/resource.h | Bin 16558 -> 17234 bytes cppcryptfs/ui/CreatePropertyPage.cpp | 90 +++++--------- cppcryptfs/ui/CryptAboutPropertyPage.cpp | 30 +++-- cppcryptfs/ui/CryptPropertySheet.cpp | 6 +- cppcryptfs/ui/FolderDialog.cpp | 7 +- cppcryptfs/ui/FsInfoDialog.cpp | 28 ++--- cppcryptfs/ui/MountPropertyPage.cpp | 146 ++++++++--------------- cppcryptfs/ui/locutils.cpp | 10 ++ cppcryptfs/ui/locutils.h | 7 ++ 10 files changed, 135 insertions(+), 189 deletions(-) create mode 100644 cppcryptfs/ui/locutils.cpp create mode 100644 cppcryptfs/ui/locutils.h diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index e4df5e7bf9cc2441a537b901b99252dff9e9a68d..73f0c171fe1ea511f0782882647f3f7441beb278 100644 GIT binary patch delta 1892 zcmdT_OHWf#5FQE`#04Z!2*kjJ+Nj}G9tHtXN zB{Gc^6O9RjxRTh)Fp7$oC8AV3*k9#~_xromtt|E0<8K*I@d?}fO`g?v^Fz9$ut5s- zQ>Xa8U=$sTO~;aw82QP|GIe$Fs!n8W9T&69m7;aIRJz?<{-w<&;_b5{&FPn=BB5Kk zuKHF&I^kP+qdr=*>+;-mnfk~@y=0>ya*6i!lZnwRQM#ThP0X#oF1L_}B6y+{2bx=0 zg|X(D_cAth?D<57Fg-0)KfP$k)EriC+|yR8iCpnvV?_;ap3sRO3;B&!8ivQ$SjbJV0O_(a*EwTL$*RSq=?aeQSk*YoyM-7TJW5Ow1G@=rvOY48VW$CYT9WU ztW0obC@!+++5o3M9UKRl0jQ6<=n??fXi&T=E6{sjdYpWFvVB+v?-{H)R}9q*P%W6P zI2*=@!?lm9A@Rsl9F|uG$7%8cTo`sal{4C@2+k`s0NoJ2D&TsYrZnjObkMs1w;vz| zq2`8>J|s&y^i(3KC{1b(6*?tBPD_@iCA&$kE9#hA$-HE_0X!=xgeaZ>fcYiZJ{e3c zwaNS#+L;LGAIggv!Av6n4qE|rwNh^Y{_jE>hFn2G?OCX(F;R1h4ffiLlbpp#%uH|$ z+8n_h@pYjj@NbM*!AK{p96WzB5`v!_@aVyq`5!sCpN$i}c()9VX7fF1*+7!2M%fZTl;GT%8fg6@~@lFfxfWzy>~oDz5tZ~kZT-y(#n zMr|{_b(4dph)q_Q+ytcsCZCzyv^i)B7ZanxdY0GY&1t{vcLp^ z$whPiOfH(MH~G^noyiyGCQL4yziIP>d3zW^jL8q?@lCdKWZRsu(2HsE9)7vW3H(yr zE(}EsnG9tNsSFB}1E+{H`!V=W-nm$PvcOCUpkuc&CQn|uM0T>!0*TF!mSiw8mTvZ5 i=E^+T2q?Q|Wfj-e^m*^wLsOA#Nn1ALwXDlK#z@}AS(kZBmU&*0Q1Vih8t#>cb9(|y_7i-!=WxXM z%JFe)C%sObGODJFJEwv@N5>)-m4iO>eO1Gta&fIH|8!U*6?{$M`^GZM<3;77N1KcT|b{vA2YP1%K<{^a0p_hiW$>eNJ9qFVD~l+ zSR;0w90~TUFs3`#)9}m0ydg)I6KG4@oFielFa8fhhYU*(42`_^BCUT&7n@vYz!=4g z)JskjeDY%jFVi?yiQ9-h)X$>FEcna8$B=nkO7*`%hLG5h>NnZ_!2#t>YJDAkO}$sT Xto=z&y32N4%W8b9KfT&5toeTcDiWnk delta 258 zcmXAiu}Z^G7=>@DhzaE8-kTszEmsk>n5mQ+oTW-#6dc4=-@q-Sc5p1h*9Q9=%qnBu=hSIM`O$6eO})Nj)@Jm=blHzBg=z6=3={XO fIOoghSXxH0;jU?!#$C=sJ53r5%Fe=bkPfqd#}Y@A diff --git a/cppcryptfs/ui/CreatePropertyPage.cpp b/cppcryptfs/ui/CreatePropertyPage.cpp index caf746f..7154736 100755 --- a/cppcryptfs/ui/CreatePropertyPage.cpp +++ b/cppcryptfs/ui/CreatePropertyPage.cpp @@ -41,6 +41,7 @@ THE SOFTWARE. #include "crypt/cryptdefs.h" #include "util/LockZeroBuffer.h" #include "util/util.h" +#include "locutils.h" static const WCHAR *filename_encryption_types[] = { L"AES256-EME", @@ -110,11 +111,8 @@ void CCreatePropertyPage::CreateCryptfs() LockZeroBuffer password2(MAX_PASSWORD_LEN + 1, false); if (!password.IsLocked() || !password2.IsLocked()) { - CString strMessage; - if (strMessage.LoadString(IDS_COULD_NOT_LOCK_BUFFER)) { - MessageBox(strMessage, L"cppcryptefs", MB_OK | MB_ICONERROR); - return; - } + MessageBox(LocUtils::GetStringFromResources(IDS_COULD_NOT_LOCK_BUFFER), L"cppcryptefs", MB_OK | MB_ICONERROR); + return; } CSecureEdit *pPass = &m_password; @@ -123,11 +121,8 @@ void CCreatePropertyPage::CreateCryptfs() return; if (wcslen(password.m_buf) < 1) { - CString strMessage; - if (strMessage.LoadString(IDS_PASSWORD_EMPTY)) { - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; - } + MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; } CSecureEdit *pPass2 = &m_password2; @@ -136,19 +131,13 @@ void CCreatePropertyPage::CreateCryptfs() return; if (wcslen(password2.m_buf) < 1) { - CString strMessage; - if (strMessage.LoadString(IDS_PASSWORD_REPEAT_EMPTY)) { - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; - } + MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_REPEAT_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; } if (wcscmp(password.m_buf, password2.m_buf)) { - CString strMessage; - if (strMessage.LoadString(IDS_PASSWORD_DO_NOT_MATCH)) { - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; - } + MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_DO_NOT_MATCH), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; } pPass->SetRealText(L""); @@ -159,27 +148,20 @@ void CCreatePropertyPage::CreateCryptfs() pWnd->GetWindowTextW(cpath); if (cpath.GetLength() < 1) { - CString strMessage; - if (strMessage.LoadString(IDS_PATH_EMPTY)) { - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; - } + MessageBox(LocUtils::GetStringFromResources(IDS_PATH_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; } if (!PathFileExists(cpath)) { - CString mes, strMessage; - mes += cpath; - strMessage.LoadString(IDS_PATH_DOES_NOT_EXIST); - mes += strMessage; + CString mes; + mes.Format(LocUtils::GetStringFromResources(IDS_PATH_DOES_NOT_EXIST), cpath); if (MessageBox(mes, L"cppcryptfs", MB_YESNO | MB_ICONINFORMATION) == IDYES) { - if (!CreateDirectory(cpath, NULL)) { - strMessage.LoadString(IDS_PATH_COULD_NOT_CREATE); - mes = strMessage; - mes += cpath; - MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; - } + if (!CreateDirectory(cpath, NULL)) { + mes.Format(LocUtils::GetStringFromResources(IDS_PATH_COULD_NOT_CREATE), cpath); + MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; + } } else { return; } @@ -273,13 +255,9 @@ void CCreatePropertyPage::CreateCryptfs() return; } - CString mes, strMsgReverse, strMsgForward; - strMsgReverse.LoadString(IDS_CREATED_REVERSE_FS); - strMsgForward.LoadString(IDS_CREATED_FORWARD_FS); - - mes = reverse ? strMsgReverse : strMsgForward; + CString mes; - mes.Append(cpath); + reverse ? mes.Format(LocUtils::GetStringFromResources(IDS_CREATED_REVERSE_FS), cpath) : mes.Format(LocUtils::GetStringFromResources(IDS_CREATED_FORWARD_FS), cpath); MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONINFORMATION); @@ -365,11 +343,8 @@ void CCreatePropertyPage::OnClickedSelect() return; if (!IsDlgButtonChecked(IDC_REVERSE) && !can_delete_directory(cpath, TRUE)) { - CString strMessage; - if (strMessage.LoadString(IDS_DIRECTORY_NOT_EMPTY)) { - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); - return; - } + MessageBox(LocUtils::GetStringFromResources(IDS_DIRECTORY_NOT_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + return; } CWnd *pWnd = GetDlgItem(IDC_PATH); @@ -475,10 +450,7 @@ BOOL CCreatePropertyPage::OnInitDialog() pLbox->EnableWindow(IsDlgButtonChecked(IDC_LONG_FILE_NAMES)); if (!m_password.ArePasswordBuffersLocked() || !m_password2.ArePasswordBuffersLocked()) { - CString strMessage; - if (strMessage.LoadString(IDS_UNABLE_LOCK_BUFFERS)) { - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONERROR); - } + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFERS), L"cppcryptfs", MB_OK | MB_ICONERROR); } const auto scryptN = theApp.GetProfileIntW(L"CreateOptions", L"ScryptN", DEFAULT_SCRYPTN); @@ -606,19 +578,17 @@ void CCreatePropertyPage::OnSelchangeScryptn() int scryptN = stoi((LPCTSTR)sel); int mem = (1<= 1024) - { - suffix = strMsgGB; + + CString suffix; + suffix.Format(LocUtils::GetStringFromResources(IDS_MB_REQUIRED), mem); + + if (mem >= 1024) { mem /= 1024; + suffix.Format(LocUtils::GetStringFromResources(IDS_GB_REQUIRED), mem); } auto pScryptMemReq = (CStatic*)GetDlgItem(IDC_SCRYPTMEMREQ); if (pScryptMemReq) { - pScryptMemReq->SetWindowText((std::to_wstring(mem) + (LPCTSTR)suffix).c_str()); + pScryptMemReq->SetWindowText(suffix); } } diff --git a/cppcryptfs/ui/CryptAboutPropertyPage.cpp b/cppcryptfs/ui/CryptAboutPropertyPage.cpp index 40c6c64..28766ea 100755 --- a/cppcryptfs/ui/CryptAboutPropertyPage.cpp +++ b/cppcryptfs/ui/CryptAboutPropertyPage.cpp @@ -40,6 +40,7 @@ THE SOFTWARE. #include "crypt/aes.h" #include "openssl/crypto.h" #include "../libcommonutil/commonutil.h" +#include "locutils.h" // CCryptAboutPropertyPage dialog @@ -68,17 +69,24 @@ BEGIN_MESSAGE_MAP(CCryptAboutPropertyPage, CCryptPropertyPage) ON_NOTIFY(LVN_ITEMCHANGED, IDC_COMPONENTS_LIST, &CCryptAboutPropertyPage::OnItemchangedComponentsList) END_MESSAGE_MAP() - - -static const WCHAR * components[] = { - L"cppcryptfs - Copyright (C) 2016-2025 Bailey Brown. All Rights Reserved.", - L"OpenSSL - Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved.", - L"RapidJSON - Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.", - L"Dokany (mirror) - Copyright (C) 2020 - 2021 Google, Inc.; Copyright (C) 2015 - 2019 Adrien J., Maxime C.; Copyright (C) 2007 - 2011 Hiroki Asakawa", - L"Dokany (library) - Copyright (C) 2020 - 2021 Google, Inc.; Copyright (C) 2015 - 2019 Adrien J., Maxime C.; Copyright (C) 2007 - 2011 Hiroki Asakawa", - L"100% free Secure Edit control MFC class - Copyright (c) 2003 Dominik Reichl", - L"getopt_port - Copyright (c) 2012-2017, Kim Grasman . All rights reserved.", - L"aes-siv - Copyright (c) 2015 ARKconcepts / Sasha Kotlyar", +CString strMsgCppcryptfs = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_CPPCRYPTFS); +CString strMsgOpenSSL = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_OPENSSL); +CString strMsgRapidJSON = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_RAPIDJSON); +CString strMsgDokanyMir = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_MIR); +CString strMsgDokanyLib = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_LIB); +CString strMsgSecuryEdit = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_SECURE_EDIT); +CString strMsgGetOpt = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_GETOPT_PORT); +CString strMsgAESSIV = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_AES_SIV); + +static const WCHAR* components[] = { + strMsgCppcryptfs, + strMsgOpenSSL, + strMsgRapidJSON, + strMsgDokanyMir, + strMsgDokanyLib, + strMsgSecuryEdit, + strMsgGetOpt, + strMsgAESSIV, NULL }; diff --git a/cppcryptfs/ui/CryptPropertySheet.cpp b/cppcryptfs/ui/CryptPropertySheet.cpp index 5b9e197..c16f26a 100755 --- a/cppcryptfs/ui/CryptPropertySheet.cpp +++ b/cppcryptfs/ui/CryptPropertySheet.cpp @@ -46,6 +46,7 @@ THE SOFTWARE. #include "../libcppcryptfs/util/KeyCache.h" #include "crypt/crypt.h" #include "cryptdefaults.h" +#include "locutils.h" // CryptPropertySheet @@ -81,10 +82,7 @@ BOOL CCryptPropertySheet::CanClose() { if (!MountPointManager::getInstance().empty()) { - CString strMessage; - strMessage.LoadString(IDS_DISMOUNT_ALL_ON_EXIT); - - if (MessageBox(strMessage, L"cppcryptfs", + if (MessageBox(LocUtils::GetStringFromResources(IDS_DISMOUNT_ALL_ON_EXIT), L"cppcryptfs", MB_YESNO | MB_ICONEXCLAMATION) == IDYES) { CString open_handles_mes = CheckOpenHandles(m_hWnd, nullptr, true, false).c_str(); diff --git a/cppcryptfs/ui/FolderDialog.cpp b/cppcryptfs/ui/FolderDialog.cpp index 8758ddf..1579f82 100755 --- a/cppcryptfs/ui/FolderDialog.cpp +++ b/cppcryptfs/ui/FolderDialog.cpp @@ -5,7 +5,9 @@ // from http://www.codeguru.com/cpp/w-d/dislog/dialogforselectingfolders/article.php/c1941/MFC-Wrapper-for-SHBrowseForFolder.htm #include "stdafx.h" +#include "cppcryptfs.h" #include "FolderDialog.h" +#include "locutils.h" #ifdef _DEBUG #undef THIS_FILE @@ -44,10 +46,13 @@ CFolderDialog::CFolderDialog(LPCTSTR lpszFolderName, DWORD dwFlags, CWnd* pParen else m_bi.hwndOwner = pParentWnd->GetSafeHwnd(); + static CString strMessageSelDir; + strMessageSelDir = LocUtils::GetStringFromResources(IDS_SELECT_DIRECTORY); + // Fill in the rest of the structure m_bi.pidlRoot = NULL; m_bi.pszDisplayName = m_szDisplayName; - m_bi.lpszTitle = _T("Select a directory"); + m_bi.lpszTitle = (LPCTSTR)strMessageSelDir; m_bi.ulFlags = dwFlags | BIF_NEWDIALOGSTYLE; m_bi.lpfn = BrowseDirectoryCallback; m_bi.lParam = (LPARAM)this; diff --git a/cppcryptfs/ui/FsInfoDialog.cpp b/cppcryptfs/ui/FsInfoDialog.cpp index 0912c28..ecfdcea 100644 --- a/cppcryptfs/ui/FsInfoDialog.cpp +++ b/cppcryptfs/ui/FsInfoDialog.cpp @@ -34,6 +34,7 @@ THE SOFTWARE. #include "cppcryptfs.h" #include "FsInfoDialog.h" #include "afxdialogex.h" +#include "locutils.h" #ifdef _DEBUG @@ -88,15 +89,13 @@ BOOL CFsInfoDialog::OnInitDialog() CDialog::OnInitDialog(); CString strMsgYes, strMsgNo, strMsgNA, strMsgReverse, strMsgForward, strMsgKB, strMsgSec, strMsgInfinite, strMsgNone; - strMsgYes.LoadString(IDS_FSINFO_YES); - strMsgNo.LoadString(IDS_FSINFO_NO); - strMsgNA.LoadString(IDS_FSINFO_NA); - strMsgReverse.LoadString(IDS_FSINFO_REVERSE); - strMsgForward.LoadString(IDS_FSINFO_FORWARD); - strMsgKB.LoadString(IDS_FSINFO_KB); - strMsgSec.LoadString(IDS_FSINFO_SEC); - strMsgInfinite.LoadString(IDS_FSINFO_INFINITE); - strMsgNone.LoadString(IDS_FSINFO_NAME_ENCRYPTION_NO); + strMsgYes = LocUtils::GetStringFromResources(IDS_FSINFO_YES); + strMsgNo = LocUtils::GetStringFromResources(IDS_FSINFO_NO); + strMsgNA = LocUtils::GetStringFromResources(IDS_FSINFO_NA); + strMsgReverse = LocUtils::GetStringFromResources(IDS_FSINFO_REVERSE); + strMsgForward = LocUtils::GetStringFromResources(IDS_FSINFO_FORWARD); + strMsgInfinite = LocUtils::GetStringFromResources(IDS_FSINFO_INFINITE); + strMsgNone = LocUtils::GetStringFromResources(IDS_FSINFO_NAME_ENCRYPTION_NO); LPCWSTR yes = strMsgYes; LPCWSTR no = strMsgNo; @@ -132,17 +131,18 @@ BOOL CFsInfoDialog::OnInitDialog() wstring txt; txt = to_wstring(m_info.ioBufferSize); - txt += strMsgKB; - SetDlgItemText(IDC_IO_BUF_SIZE, txt.c_str()); + strMsgKB.Format(LocUtils::GetStringFromResources(IDS_FSINFO_KB), txt); + SetDlgItemText(IDC_IO_BUF_SIZE, strMsgKB); txt = m_info.multhreaded ? yes : no; SetDlgItemText(IDC_THREADS, txt.c_str()); if (m_info.cacheTTL > 0) { txt = to_wstring(m_info.cacheTTL); - txt += strMsgSec; + strMsgSec.Format(LocUtils::GetStringFromResources(IDS_FSINFO_SEC), txt); + SetDlgItemText(IDC_CACHE_TTL, strMsgSec); } else { - txt = strMsgInfinite; + SetDlgItemText(IDC_CACHE_TTL, strMsgInfinite); } - SetDlgItemText(IDC_CACHE_TTL, txt.c_str()); + WCHAR buf[32]; *buf = '\0'; float r; diff --git a/cppcryptfs/ui/MountPropertyPage.cpp b/cppcryptfs/ui/MountPropertyPage.cpp index 22c3591..4764a5e 100644 --- a/cppcryptfs/ui/MountPropertyPage.cpp +++ b/cppcryptfs/ui/MountPropertyPage.cpp @@ -52,7 +52,7 @@ THE SOFTWARE. #include "dokan/MountPointManager.h" #include "../libipc/server.h" #include "../libcommonutil/commonutil.h" - +#include "locutils.h" #include // CMountPropertyPage dialog @@ -134,7 +134,7 @@ void CMountPropertyPage::HandleTooltipsActivation(MSG * pMsg, CWnd * This, CWnd pMsg->lParam = lParam; } -CString strMsgPassEmpty, strMsg; + CMountPropertyPage::CMountPropertyPage() : CCryptPropertyPage(IDD_MOUNT) @@ -169,22 +169,15 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST LockZeroBuffer password(MAX_PASSWORD_LEN + 1, false); if (!password.IsLocked()) { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_LOCK_BUFFER); - return strMessage; + return LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFER); } if (wcscpy_s(password.m_buf, MAX_PASSWORD_LEN + 1, argPassword ? argPassword : pPass->m_strRealText)) { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_GET_PASS); - return strMessage; + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_PASS); } if (wcslen(password.m_buf) < 1) { - CString strMessage; - strMessage.LoadString(IDS_PASS_CANNOT_BE_EMPTY); - return strMessage; - + return LocUtils::GetStringFromResources(IDS_PASS_CANNOT_BE_EMPTY); } CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); @@ -208,10 +201,9 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST nItem = pList->FindItem(&fi); if (nItem < 0) { if (is_mountpoint_a_drive(str)) { - CString strMsgMountPoint, strMsgAlreadyUsed; - strMsgMountPoint.LoadString(IDS_MOUNT_POINT); - strMsgAlreadyUsed.LoadString(IDS_ALREADY_USED); - return strMsgMountPoint + str + strMsgAlreadyUsed; + CString strMsg; + strMsg.Format(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_USED), str); + return strMsg; } else { int i = pList->GetItemCount(); nItem = pList->InsertItem(LVIF_TEXT | (m_imageIndex >= 0 ? LVIF_IMAGE : 0) | LVIF_STATE, i, str, @@ -247,12 +239,8 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST dlInUse = true; if (dlInUse) { - CString mes, strMsgMountPoint, strMsgAlreadyUsed; - strMsgMountPoint.LoadString(IDS_MOUNT_POINT); - strMsgAlreadyUsed.LoadString(IDS_ALREADY_USED); - mes = strMsgMountPoint; - mes += cmp; - mes += strMsgAlreadyUsed; + CString mes; + mes.Format(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_USED), cmp); return mes; } @@ -269,9 +257,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST pWnd->GetWindowTextW(cpath); if (cpath.GetLength() < 1) { - CString strMessage; - strMessage.LoadString(IDS_PATH_ZERO); - return strMessage; + return LocUtils::GetStringFromResources(IDS_PATH_ZERO); } CString config_path; @@ -310,12 +296,8 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST } if (pathInUse) { - CString strMessage; - strMessage.LoadString(IDS_ALREADY_MOUNTED); - CString mes = L""; - mes += cpath; - mes += strMessage; - mes += mdl; + CString mes; + mes.Format(LocUtils::GetStringFromResources(IDS_ALREADY_MOUNTED), cpath, mdl); return mes; } @@ -344,19 +326,13 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (opts.denyothersessions || opts.denyservices) { if (!CanGetSessionIdOk()) { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_GET_SESSION_ID); - return strMessage; + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SESSION_ID); } if (!have_sessionid()) { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_GET_PROCESS_SESSION_ID); - return strMessage; + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_PROCESS_SESSION_ID); } if (get_sessionid() == 0) { - CString strMessage; - strMessage.LoadString(IDS_SESSION_ID_ZERO); - return strMessage; + return LocUtils::GetStringFromResources(IDS_SESSION_ID_ZERO); } } @@ -384,9 +360,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (IsDlgButtonChecked(IDC_SAVE_PASSWORD)) { if (!SavedPasswords::SavePassword(cpath, password.m_buf)) { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_SAVE_PASS); - MessageBox(strMessage, L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_SAVE_PASS), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); } } @@ -520,9 +494,7 @@ BOOL CMountPropertyPage::OnInitDialog() // or using the string table resource CWnd *pWnd = GetDlgItem(IDC_SAVE_PASSWORD); if (pWnd) { - CString strMessage; - strMessage.LoadString(IDS_TOOLTIP_ENABLE_SAVE_PASS); - m_ToolTip.AddTool(pWnd, strMessage); + m_ToolTip.AddTool(pWnd, LocUtils::GetStringFromResources(IDS_TOOLTIP_ENABLE_SAVE_PASS)); } } @@ -561,13 +533,9 @@ BOOL CMountPropertyPage::OnInitDialog() mountPointColumnWidth = 79; } - CString strMsgColHdrMountPoint, strMsgColHdrPath; - strMsgColHdrMountPoint.LoadString(IDS_COLUMN_HEADER_MOUNT_POINT); - strMsgColHdrPath.LoadString(IDS_COLUMN_HEADER_PATH); + pList->InsertColumn(DL_INDEX, LocUtils::GetStringFromResources(IDS_COLUMN_HEADER_MOUNT_POINT), LVCFMT_LEFT, mountPointColumnWidth); - pList->InsertColumn(DL_INDEX, strMsgColHdrMountPoint, LVCFMT_LEFT, mountPointColumnWidth); - - pList->InsertColumn(PATH_INDEX, strMsgColHdrPath, LVCFMT_LEFT, 454-mountPointColumnWidth); + pList->InsertColumn(PATH_INDEX, LocUtils::GetStringFromResources(IDS_COLUMN_HEADER_PATH), LVCFMT_LEFT, 454-mountPointColumnWidth); CString lastMountPoint = theApp.GetProfileString(L"MountPoints", L"LastMountPoint", L""); @@ -654,9 +622,7 @@ BOOL CMountPropertyPage::OnInitDialog() pCombo->LimitText(MAX_PATH); if (!m_password.ArePasswordBuffersLocked()) { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_LOCK_BUFFER); - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONERROR); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFER), L"cppcryptfs", MB_OK | MB_ICONERROR); } ProcessCommandLine(GetCommandLine(), TRUE); @@ -804,17 +770,17 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo int nItem; if (argMountPoint && wcslen(argMountPoint) > 0) { - CString strMsgDrive, strMsgNoMountedFS; - strMsgDrive.LoadString(IDS_DRIVE); - strMsgNoMountedFS.LoadString(IDS_NO_MOUNTED_FS); LVFINDINFO fi; memset(&fi, 0, sizeof(fi)); fi.flags = LVFI_STRING; CString str = wcslen(argMountPoint) == 1 ? CString(*argMountPoint) + L":" : argMountPoint; fi.psz = str; nItem = pList->FindItem(&fi); - if (nItem < 0) - return strMsgDrive + str + strMsgNoMountedFS; + if (nItem < 0) { + CString msg; + msg.Format(LocUtils::GetStringFromResources(IDS_DRIVE_WITHOUT_MOUNTED_FS), str); + return msg; + } } else { nItem = pList->GetNextSelectedItem(pos); } @@ -830,10 +796,9 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo CString cpath = pList->GetItemText(nItem, PATH_INDEX); if (cpath.GetLength() < 1) { - CString strMsgDrive, strMsgNoMountedFS; - strMsgDrive.LoadString(IDS_DRIVE); - strMsgNoMountedFS.LoadString(IDS_NO_MOUNTED_FS); - return strMsgDrive + cmp + strMsgNoMountedFS; + CString msg; + msg.Format(LocUtils::GetStringFromResources(IDS_DRIVE_WITHOUT_MOUNTED_FS), cmp); + return msg; } CString mes; @@ -855,12 +820,12 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo theApp.DoWaitCursor(-1); if (!bresult) { - CString strMessage; - strMessage.LoadString(IDS_CANNOT_UNMOUNT); - if (mes.GetLength() > 0) + if (mes.GetLength() > 0) { mes += L". "; + } + CString strMessage; + strMessage.Format(LocUtils::GetStringFromResources(IDS_CANNOT_UNMOUNT), cmp); mes += strMessage; - mes.Append(cmp); if (wmes.length() > 0) { mes += L" "; mes += wmes.c_str(); @@ -948,22 +913,16 @@ CString CMountPropertyPage::DismountAll(bool interactive, bool forceDismount) if (hadFailure) { if (hadSuccess) { - CString strMessage; - strMessage.LoadString(IDS_SOME_DRV_NOT_DISMOUNTED); - mes = strMessage; + mes = LocUtils::GetStringFromResources(IDS_SOME_DRV_NOT_DISMOUNTED); } else { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_DISMOUNT); - mes = strMessage; + mes = LocUtils::GetStringFromResources(IDS_UNABLE_DISMOUNT); } } if (volnameFailure) { - CString strMessage; - strMessage.LoadString(IDS_UNABLE_UPDATE_LABELS); if (mes.GetLength() > 0) mes += L". "; - mes += strMessage; + mes += LocUtils::GetStringFromResources(IDS_UNABLE_UPDATE_LABELS); } return mes; @@ -1014,8 +973,8 @@ BOOL CMountPropertyPage::OnSetActive() CString mountPoint = theApp.GetProfileString(L"MountPoints", path_hash, NULL); if (mountPoint.GetLength() == 0) { CString strMessage; - strMessage.LoadString(IDS_FAIL_RETRIVE_MPOINT); - MessageBox(strMessage + m_lastDirs[i], L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + strMessage.Format(LocUtils::GetStringFromResources(IDS_FAIL_RETRIVE_MPOINT), m_lastDirs[i]); + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); continue; } @@ -1023,8 +982,8 @@ BOOL CMountPropertyPage::OnSetActive() if (!SavedPasswords::RetrievePassword(m_lastDirs[i], password.m_buf, password.m_len)) { CString strMessage; - strMessage.LoadString(IDS_FAIL_RETRIVE_PASS); - MessageBox(strMessage + m_lastDirs[i], L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + strMessage.Format(LocUtils::GetStringFromResources(IDS_FAIL_RETRIVE_PASS), m_lastDirs[i]); + MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); continue; } @@ -1779,14 +1738,7 @@ void CMountPropertyPage::OnContextMenu(CWnd* pWnd, CPoint point) if (!menu.CreatePopupMenu()) return; - CString strMsgMenuAdd, strMsgMenuOpen, strMsgMenuProperties, strMsgMenuDismount, strMsgMenuDeleteMountPoint; - strMsgMenuAdd.LoadString(IDS_MENU_ADD_MOUNT_POINT); - strMsgMenuOpen.LoadString(IDS_MENU_OPEN); - strMsgMenuProperties.LoadString(IDS_MENU_PROPERTIES); - strMsgMenuDismount.LoadString(IDS_MENU_DISMOUNT); - strMsgMenuDeleteMountPoint.LoadString(IDS_DELETE_MOUNT_POINT); - - menu.AppendMenu(MF_ENABLED, AddMountPointV, strMsgMenuAdd); + menu.AppendMenu(MF_ENABLED, AddMountPointV, LocUtils::GetStringFromResources(IDS_MENU_ADD_MOUNT_POINT)); int item = -1; @@ -1803,12 +1755,12 @@ void CMountPropertyPage::OnContextMenu(CWnd* pWnd, CPoint point) wstring mpstr; bool mounted = MountPointManager::getInstance().find(cmp, mpstr); if (mounted) { - menu.AppendMenu(MF_ENABLED, OpenV, strMsgMenuOpen); - menu.AppendMenu(MF_ENABLED, PropertiesV, strMsgMenuProperties); - menu.AppendMenu(MF_ENABLED, DismountV, strMsgMenuDismount); + menu.AppendMenu(MF_ENABLED, OpenV, LocUtils::GetStringFromResources(IDS_MENU_OPEN)); + menu.AppendMenu(MF_ENABLED, PropertiesV, LocUtils::GetStringFromResources(IDS_MENU_PROPERTIES)); + menu.AppendMenu(MF_ENABLED, DismountV, LocUtils::GetStringFromResources(IDS_MENU_DISMOUNT)); } if (is_mountpoint_a_dir(cmp)) { - menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, strMsgMenuDeleteMountPoint); + menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, LocUtils::GetStringFromResources(IDS_DELETE_MOUNT_POINT)); } } @@ -1869,9 +1821,7 @@ void CMountPropertyPage::AddMountPoint(const CString & path) return; if (!is_suitable_mountpoint(path)) { - CString strMessage; - strMessage.LoadString(IDS_PATH_NOT_SUITABLE_MPOINT); - MessageBox(strMessage, L"cppcyrptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_PATH_NOT_SUITABLE_MPOINT), L"cppcyrptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -1880,9 +1830,7 @@ void CMountPropertyPage::AddMountPoint(const CString & path) int i = 0; for (CString mp = mountPointsStr.Tokenize(L"|", i); i >= 0; mp = mountPointsStr.Tokenize(L"|", i)) { if (!lstrcmpi(path, mp)) { - CString strMessage; - strMessage.LoadString(IDS_MPOINT_ALREADY_ADDED); - MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_ADDED), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } } diff --git a/cppcryptfs/ui/locutils.cpp b/cppcryptfs/ui/locutils.cpp new file mode 100644 index 0000000..a3f45d5 --- /dev/null +++ b/cppcryptfs/ui/locutils.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "locutils.h" + +CString LocUtils::GetStringFromResources(UINT nID) { + CString str; + if (!str.LoadString(AfxGetResourceHandle(), nID)) { + return _T("Error: String not found"); + } + return str; +} \ No newline at end of file diff --git a/cppcryptfs/ui/locutils.h b/cppcryptfs/ui/locutils.h new file mode 100644 index 0000000..4a26311 --- /dev/null +++ b/cppcryptfs/ui/locutils.h @@ -0,0 +1,7 @@ +#pragma once +#include + +class LocUtils { +public: + static CString GetStringFromResources(UINT nID); +}; From 98eea70c06a8295d3b179087180f579e78532b30 Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Fri, 30 Jan 2026 20:48:42 +0300 Subject: [PATCH 06/22] Licenses to RCDATA. Folder lic for licenses.txt. CryptAboutPropertyPage --- cppcryptfs/cppcryptfs.rc | Bin 48388 -> 50428 bytes cppcryptfs/cppcryptfs.vcxproj | 12 + cppcryptfs/res/lic/en_aessiv.txt | Bin 0 -> 2284 bytes cppcryptfs/res/lic/en_cppcryptfs.txt | Bin 0 -> 3390 bytes cppcryptfs/res/lic/en_dokany_lib.txt | Bin 0 -> 15434 bytes cppcryptfs/res/lic/en_dokany_mir.txt | Bin 0 -> 2904 bytes cppcryptfs/res/lic/en_getopt.txt | Bin 0 -> 3322 bytes cppcryptfs/res/lic/en_openssl.txt | Bin 0 -> 11388 bytes cppcryptfs/res/lic/en_rapidjson.txt | Bin 0 -> 10124 bytes cppcryptfs/res/lic/en_secuty_edit.txt | Bin 0 -> 878 bytes cppcryptfs/resource.h | Bin 17234 -> 18472 bytes cppcryptfs/ui/CryptAboutPropertyPage.cpp | 546 ++--------------------- 12 files changed, 57 insertions(+), 501 deletions(-) create mode 100644 cppcryptfs/res/lic/en_aessiv.txt create mode 100644 cppcryptfs/res/lic/en_cppcryptfs.txt create mode 100644 cppcryptfs/res/lic/en_dokany_lib.txt create mode 100644 cppcryptfs/res/lic/en_dokany_mir.txt create mode 100644 cppcryptfs/res/lic/en_getopt.txt create mode 100644 cppcryptfs/res/lic/en_openssl.txt create mode 100644 cppcryptfs/res/lic/en_rapidjson.txt create mode 100644 cppcryptfs/res/lic/en_secuty_edit.txt diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 73f0c171fe1ea511f0782882647f3f7441beb278..7a7dff4082bc21b0ef590b43756c0d32e7e2cb54 100644 GIT binary patch delta 1188 zcmbW1T}u>E9L67W%UoSHZHK`X+Fb{+4JzLdy3)zrY|z|wokUSsS9cNLR@vP|yYa>w z?}EQ|6$C|j5vC#tQ6Hg;K7xLY=%VLLNRmMZISg~o;W^Lm|8i!weq8yvU48KASjKm5 zNZ&hOT^bX}z`+0>%VDTVrh{Q=f9aDCM~yPQUoR)mJLTJ6Pjd=sBr%Lpjv-_*##M%M z2Pv_4TV=}(%UcOIC6K}(Y$_)%sM@MptK6-g|U zcaPrx^AGG>S$+Q!E3wKv@>n2Yg(Mxu{R1nf&&bnvk(?qnSPfP6k{0FTp|yEgit5db z4uui1)9mq6_DbFOB)jIY+fg+(y_bFvWj1RT&)6oFYJp|tRn-h*fM}PWNcs#;wtNlM q&*|gmh^%;bMi=_~`&55{F&POOz51*iS?X5KW9?6ZM}x + @@ -260,6 +261,7 @@ + @@ -316,6 +318,16 @@ + + + + + + + + + + diff --git a/cppcryptfs/res/lic/en_aessiv.txt b/cppcryptfs/res/lic/en_aessiv.txt new file mode 100644 index 0000000000000000000000000000000000000000..f97934ec262b5f52af54af52299594f5bec7c99b GIT binary patch literal 2284 zcmai!-)|CY5QgX4#Q$OAl_qM{#2fEcN|lJ9fHvonR;;T~2vnQ?^Xl__!-kf_$q89@ zcYeI{&O7t%pWmxk$1=XhEY9O9s`$zKJYMm15e=4aSkB@p-eoM}D5m&-U^nZMi1T8b z#U`F`HSsI%$33hoe&^`q+GR0VwtcIM1 z+%H(B@bKPn7jsQT|EHj3gq|yG);z@PVad(v@;MY`=eN78sM$~@b+g`0JVGbCpU{Ok zb823r%bd4gT=RI0HG5o>{{%Mbc|~p&b#!CQy`jfd$ytyib319kx-4G1oTH`M+4nU* zF;(I&!&Wm{iZ~_n-#HbyGf@7ovNdFqbF@+wLvZCd=GWhLzt6&%tmtqJ&kHa_XlFLZ zCZ|i#+=^Dc!#j}HyE!WGlYG@!^DIlXAHt}I!c%JJE;#|Cdw4qB`v+=UzjJ`^Ls&i{ z=S4h==kb!KI!5sht5dN9w_HVzxW-i76tya1mU!m$@1(`|`cT*|V6frW&Ng?{Q!*=? z(kkcH?Dqbq_)@_m(Cyk?+)zi2&(OooZ#PX=8{)oVbtBvc&s=7Ty)=0limPKXaL{x?&}h!#cet)-&5H)%xY_WUHYptUIQIF1(EC zms4V&s??#1duaWATh5^a)&PWVd_HasrvrR^9iWmR=@c4T-l$=PZjc z$bFc!+Mi$@f^1)YuiTnc_!H0FZ3i_Ob@7Ok`?O2Yzfk$6rW}2i*4*otCsfHdS_dBDJ5I!DeX`F&L#P^eI=i0e$vj& zeLicwwx1-wl>MEMJlj;VGfDknAM~C5p4*SwITjO^kL?$-36_bT=Nip>+1(1yqxLd0 zTlp^~_ap=>?H5A5(#}qL6OV4|ae#K>94vGWAC*>>@hU#*uPHK1#8} z@5G};w$hpm&V(K|6R!*Hkv}9JYu*xzPud~!eck=KsOoA-m315eEHKX{_osK$HG1Cbo__fl7TWSfo+IcgzL=4zNLhKv|Nq9!~3%=n^yr zl5f^S^lSLS7HmyDuQ53`-W7BE#!+w@^+PAmY?U& zmM$6H#l%JeoAhX)L35$?i~GQ9>RhG`r!z@L*U~d{-+5Lhi9c0pc+XRf`v4!U@`QlNW);y15iflblQ^+*XgA%F3t=zCJ&}=hDkW@C zFEMGs5HaQ(JYYq>c%m*o-QR4#-Tz z?2cOA*CMKz#f7}VaI?Z9-l*Orb(o#V9kmeio!+6Z*0L2hV~(%crN^?Fr{c(N?OGP@ z?appArylhG)X;Z2+AB1NhC2DEd+bWPSK2v|1Sg!Ics)M&Eq5!qvEO!KV<@@4*1t*? z+x(~2_tnpm@5>hXytZH5$F;0s^-lh<-Sg?)ai7ScajAJemLA`2?OoLV`qJW-?YbT} zZXg|LztAco+((7w@CUMVsjVV4hW~5E#Cz(WmN+T1<6@*YHPfn^;m+ gXRcrONLWb~Hg+7Z5f;umnG0OeJ$O!ts%K!iX literal 0 HcmV?d00001 diff --git a/cppcryptfs/res/lic/en_dokany_lib.txt b/cppcryptfs/res/lic/en_dokany_lib.txt new file mode 100644 index 0000000000000000000000000000000000000000..0a98ec4d6492d52649a2b342b7b92d09143ef09f GIT binary patch literal 15434 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 Rx}6JLau*yF&(+AA=|AxS){p=I literal 0 HcmV?d00001 diff --git a/cppcryptfs/res/lic/en_getopt.txt b/cppcryptfs/res/lic/en_getopt.txt new file mode 100644 index 0000000000000000000000000000000000000000..2afb3d4b2aea160c060f31e89591da0dd8538ac1 GIT binary patch literal 3322 zcmd6pTTfF_5QXR2#Q$)@6B@vYZ>HPLhR5=2CwCIJcQi?W=vUp)IVi3!P8xwcd_xEXj!^16$MW)XwageUtP|cQd^o z%W5I{xt^c(oJzW|hxS0)=lUD!eC4-CHh151>$_F>&(`=abT_e)N4|b@BFT|F5x;Om zWA}C&`K8dz^eLn_m7lS!#yaCMc^)eQnaq}G`|=kW+>lFAiG9tps?HY+IJlD6v9ddn zpB(X2vY}#3g!zkjg`IkZ{;ISd$?l~+w-x|A=wM?~p=do*&oXS(iN@d^;d^7v5=SVi-lGa;uY>?@@JO6=usY`XIO>_%N*oF`6VnXP>@Eiz;S(Q~xU5Z!52TaTr;ndNQ z|7_VK_sKuHqPqUK^N)&+#7T5dLeW40nv!Z}eKFsAPO(}tnDKzQ3O_jPpD zbqrW=PgczOz~jV@U>nDtg&){LH*gRqvS!}lBb}ok7Ved)fv4D1)xQmFpd)#>6oS|e ziMzB>=Dsh6^24vha2bhN2gRjFh&{qA=G`(EhS&&sM|N%7cC3_MX>HrIt{qrSTcIII z$oF(=+rCa4l5R-8ZijkeiB?^=dy;gdu_akovTezluHSLrHPsSJbX(Fucinn=YwMlp zD~ifDF<11REchl`!#*hrxJuW<4((k@oB9r9fxY9_U6+==S9av3F1?;m@V@2JKtP|h z9W{P-_319XfsU<|GQCfBP{OgLj|Ze*qZv|HyR6mqv5X9 zJNT$H5#R;(<=wY@YR#N;aQRc+`vrO2a4#Cunsw$TY83R9$+059sTvh9>|zA{x4%1 z4|GTEnVPy{L{w%nbt2kv%F|6WPJuM_LGELa9>{+~@p#5e;wMjf?RRIu7n4t?E?#m1`qXSw&6c)ndQK8pnJH51A2*5On;h+v|ZR6ktelG`KGxKuC7b* oba!LIMw&1pum@`D2X-eoU^|#ho@0tZb#pu9E@Ok-?Cv%D1u2CW3IG5A literal 0 HcmV?d00001 diff --git a/cppcryptfs/res/lic/en_openssl.txt b/cppcryptfs/res/lic/en_openssl.txt new file mode 100644 index 0000000000000000000000000000000000000000..8698358e3b84322b45fc013df192606eef9853c5 GIT binary patch literal 11388 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 GnEnP+B5Fhc literal 0 HcmV?d00001 diff --git a/cppcryptfs/res/lic/en_secuty_edit.txt b/cppcryptfs/res/lic/en_secuty_edit.txt new file mode 100644 index 0000000000000000000000000000000000000000..914b704e3777029100ba0d20d1c432a06a906fbd GIT binary patch literal 878 zcmZvb-Acni5QXPj@Ez6*p#@v~xf2ngDtO_I`T{Xcn_!Y^5|zHZ`kmRvXepulH)qc| zvornvO6`>|wZ_)Woh_`jVDF5HEiJQic9pGcZUwP|lQ}1e)jk)@Dba?z8WR{ILXnQM zKzx_N2&|MI!Kdgo%r~ym*>rPf(Aka3Z47qb_WrSiUmj_%P+!AdkWG%GfwSZ+MYYC9 z%u`G!cFcDOZsDG?Esxvm%CbSF1b1(@He*iNDZAFa&31Sgff<85b+t2A*PtpK)%;%A zKj2CJa=7H{4nKiRR=icLkDPVH3xCH!Gk^{D>B!Qn^bA+5qFy=PQUwFI6R*yiwdy-4 zR3MdG0gsRs+JRNVN*t~G&Cto&M_#$_85&lRJHE3zBXUiNJh^gBrmY=#e#*bU8-0Da zj(ke_jl46^J&Srr9j8o%QDtMlsRK)|M|7$;lKQ}&Z2YRr<#|ag<~O|J5oeiAI8VT+ hx?Abk2Cm`~&uVn;8HA literal 0 HcmV?d00001 diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index 1a0a0781d8caf2789c5dd4826242287ed7b1b108..d51a14b95b9cbb3f9bf7a2723bb7d58917661a25 100755 GIT binary patch delta 644 zcmZ{i&q~8U5XPr%kme8?i6(?nLj?^A;-A=hH8w%2wG|sHo=P9YgBQ=nd4k?N3ci3o zf#4f>@gASRZ?`mUL&K7=nfZO+&dlcfsqp$-cvEcF)fF}^T~legJZkbtbKD+XQ%GIv zV|8dq1AN_J-=-d-Db1g&bvHoll6=JP^GQ14kyGW5vf}#i>Vs~B4zQ2#wB$ROIfFke zN`7yi@8YZ|SLZ?HZ%UQjq+>e68Byvfsuo02acqx{a9rp~3q_;iD~p{AI55?}jOz&;)?`0wBAd zpEN4uv1Um@QW1iTrs;|3PV$pQ9kn;*z}XaN93F9xar diff --git a/cppcryptfs/ui/CryptAboutPropertyPage.cpp b/cppcryptfs/ui/CryptAboutPropertyPage.cpp index 28766ea..bec7851 100755 --- a/cppcryptfs/ui/CryptAboutPropertyPage.cpp +++ b/cppcryptfs/ui/CryptAboutPropertyPage.cpp @@ -42,6 +42,41 @@ THE SOFTWARE. #include "../libcommonutil/commonutil.h" #include "locutils.h" +const int LICENSES_COUNT = 8; // Adjust when the number of licenses is changed +static const WCHAR* licenses[LICENSES_COUNT + 1] = { 0 }; +static CStringW storage[LICENSES_COUNT]; + +void LoadLicensesFromResource() { + static bool loaded = false; + if (loaded) return; + + UINT startId = IDR_LICENSE_CPPCRYPTFS; + + for (int i = 0; i < LICENSES_COUNT; i++) { + UINT currentId = startId + i; + licenses[i] = L""; + + HRSRC hRes = FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(currentId), RT_RCDATA); + if (!hRes) continue; + + HGLOBAL hData = LoadResource(AfxGetResourceHandle(), hRes); + DWORD size = SizeofResource(AfxGetResourceHandle(), hRes); + const void* pData = LockResource(hData); + + if (pData && size > 0) { + int charCount = size / sizeof(WCHAR); + + LPWSTR pBuf = storage[i].GetBufferSetLength(charCount); + memcpy(pBuf, pData, size); + storage[i].ReleaseBuffer(charCount); + + licenses[i] = (const WCHAR*)storage[i]; + } + } + + licenses[LICENSES_COUNT] = NULL; + loaded = true; +} // CCryptAboutPropertyPage dialog @@ -50,7 +85,7 @@ IMPLEMENT_DYNAMIC(CCryptAboutPropertyPage, CCryptPropertyPage) CCryptAboutPropertyPage::CCryptAboutPropertyPage() : CCryptPropertyPage(IDD_ABOUTBOX) { - + LoadLicensesFromResource(); } CCryptAboutPropertyPage::~CCryptAboutPropertyPage() @@ -90,499 +125,6 @@ static const WCHAR* components[] = { NULL }; -static const WCHAR *licenses[] = { - - // cppcryptfs - L"cppcryptfs - Copyright (C) 2016-2025 Bailey Brown. All rights reserved.\r\n\r\n" - L"project url: github.com/bailey27/cppcryptfs\r\n\r\n" - L"cppcryptfs is a user-mode cryptographic virtual overlay filesystem\r\n\r\n" - L"cppcryptfs is based on the design of gocryptfs (github.com/rfjakob/gocryptfs)\r\n\r\n" - L"cppcryptfs links with and incorporates source code from several open source projects.\r\n\r\n" - L"All incorporated sources use the MIT license or other permissive open source licenses.\r\n\r\n" - L"All statically linked libraries use a permissive open source license.\r\n" - L"\r\n" - L"Some libraries which are linked with dynamically use the GNU LGPL.\r\n" - L"\r\n" - L"cppcryptfs itself uses an MIT license which is as follows:\r\n" - L"\r\n" - L"The MIT License (MIT)\r\n" - L"\r\n" - L"Permission is hereby granted, free of charge, to any person obtaining a copy\r\n" - L"of this software and associated documentation files (the \"Software\"), to deal\r\n" - L"in the Software without restriction, including without limitation the rights\r\n" - L"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n" - L"copies of the Software, and to permit persons to whom the Software is\r\n" - L"furnished to do so, subject to the following conditions:\r\n" - L"\r\n" - L"The above copyright notice and this permission notice shall be included in\r\n" - L"all copies or substantial portions of the Software.\r\n" - L"\r\n" - L"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n" - L"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n" - L"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n" - L"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n" - L"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n" - L"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n" - L"THE SOFTWARE.\r\n" - L"\r\n", - - // openssl - - L"poject url: github.com/openssl/openssl\r\n\r\n" - L"cppcryptfs usage: statically linked library\r\n\r\n" - L"OpenSSL copyright and license:\r\n\r\n" - LR"(LICENSE ISSUES - ============== - - The OpenSSL toolkit stays under a double license, i.e.both the conditions of - the OpenSSL License and the original SSLeay license apply to the toolkit. - See below for the actual license texts. - - OpenSSL License - -------------- - - - /* ==================================================================== - * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/) " - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/) " - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - - Original SSLeay License - ---------------------- - - - /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com) " - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com) " - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */)", - - // rapidjson - L"project url: github.com/miloyip/rapidjson\r\n\r\n" - L"cppcryptfs usage: included header files\r\n\r\n" - L"RapidJSON copyright and license:\r\n\r\n" - L"Tencent is pleased to support the open source community by making RapidJSON available. \r\n" - L" \r\n" - L"Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.\r\n" - L"\r\n" - L"If you have downloaded a copy of the RapidJSON binary from Tencent, please note that the RapidJSON binary is licensed under the MIT License.\r\n" - L"If you have downloaded a copy of the RapidJSON source code from Tencent, please note that RapidJSON source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms. Your integration of RapidJSON into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within RapidJSON. To avoid the problematic JSON license in your own projects, it's sufficient to exclude the bin/jsonchecker/ directory, as it's the only code under the JSON license.\r\n" - L"A copy of the MIT License is included in this file.\r\n" - L"\r\n" - L"Other dependencies and licenses:\r\n" - L"\r\n" - L"Open Source Software Licensed Under the BSD License:\r\n" - L"--------------------------------------------------------------------\r\n" - L"\r\n" - L"The msinttypes r29 \r\n" - L"Copyright (c) 2006-2013 Alexander Chemeris \r\n" - L"All rights reserved.\r\n" - L"\r\n" - L"Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r\n" - L"\r\n" - L"* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \r\n" - L"* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r\n" - L"* Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r\n" - L"\r\n" - L"THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n" - L"\r\n" - L"Open Source Software Licensed Under the JSON License:\r\n" - L"--------------------------------------------------------------------\r\n" - L"\r\n" - L"json.org \r\n" - L"Copyright (c) 2002 JSON.org\r\n" - L"All Rights Reserved.\r\n" - L"\r\n" - L"JSON_checker\r\n" - L"Copyright (c) 2002 JSON.org\r\n" - L"All Rights Reserved.\r\n" - L"\r\n" - L"\r\n" - L"Terms of the JSON License:\r\n" - L"---------------------------------------------------\r\n" - L"\r\n" - L"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n" - L"\r\n" - L"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n" - L"\r\n" - L"The Software shall be used for Good, not Evil.\r\n" - L"\r\n" - L"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n" - L"\r\n" - L"\r\n" - L"Terms of the MIT License:\r\n" - L"--------------------------------------------------------------------\r\n" - L"\r\n" - L"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n" - L"\r\n" - L"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n" - L"\r\n" - L"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n", - - // Dokany (mirror) - - L"project url: github.com/dokan-dev/dokany\r\n\r\n" - L"cppcryptfs usage: code from the mirror.c sample program from Dokany was used in modifed form in cppcryptfs (in cryptdokan.cpp).\r\n\r\n" - L"Dokany mirror.c copyright and license (MIT license):\r\n\r\n" - L"Copyright (C) 2020 - 2021 Google, Inc.\r\n" - L"Copyright (C) 2015 - 2019 Adrien J. and Maxime C. \r\n" - L"Copyright (C) 2007 - 2011 Hiroki Asakawa \r\n" - L"\r\n" - L"Permission is hereby granted, free of charge, to any person obtaining a copy\r\n" - L"of this software and associated documentation files (the \"Software\"), to deal\r\n" - L"in the Software without restriction, including without limitation the rights\r\n" - L"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n" - L"copies of the Software, and to permit persons to whom the Software is\r\n" - L"furnished to do so, subject to the following conditions:\r\n" - L"\r\n" - L"The above copyright notice and this permission notice shall be included in\r\n" - L"all copies or substantial portions of the Software.\r\n" - L"\r\n" - L"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n" - L"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n" - L"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n" - L"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n" - L"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n" - L"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n" - L"THE SOFTWARE.\r\n", - - // dokany (library) - - L"project url: github.com/dokan-dev/dokany\r\n\r\n" - L"cppcryptfs usage: dynamically linked library\r\n\r\n" - L"Dokany library copyright and license (GNU LGPL):\r\n\r\n" - L"Copyright (C) 2020 - 2021 Google, Inc.\r\n" - L"Copyright (C) 2015 - 2019 Adrien J. and Maxime C. \r\n" - L"Copyright (C) 2007 - 2011 Hiroki Asakawa \r\n\r\n" - L" GNU LESSER GENERAL PUBLIC LICENSE\r\n" - L" Version 3, 29 June 2007\r\n" - L"\r\n" - L" Copyright (C) 2007 Free Software Foundation, Inc. \r\n" - L" Everyone is permitted to copy and distribute verbatim copies\r\n" - L" of this license document, but changing it is not allowed.\r\n" - L"\r\n" - L"\r\n" - L" This version of the GNU Lesser General Public License incorporates\r\n" - L"the terms and conditions of version 3 of the GNU General Public\r\n" - L"License, supplemented by the additional permissions listed below.\r\n" - L"\r\n" - L" 0. Additional Definitions. \r\n" - L"\r\n" - L" As used herein, \"this License\" refers to version 3 of the GNU Lesser\r\n" - L"General Public License, and the \"GNU GPL\" refers to version 3 of the GNU\r\n" - L"General Public License.\r\n" - L"\r\n" - L" \"The Library\" refers to a covered work governed by this License,\r\n" - L"other than an Application or a Combined Work as defined below.\r\n" - L"\r\n" - L" An \"Application\" is any work that makes use of an interface provided\r\n" - L"by the Library, but which is not otherwise based on the Library.\r\n" - L"Defining a subclass of a class defined by the Library is deemed a mode\r\n" - L"of using an interface provided by the Library.\r\n" - L"\r\n" - L" A \"Combined Work\" is a work produced by combining or linking an\r\n" - L"Application with the Library. The particular version of the Library\r\n" - L"with which the Combined Work was made is also called the \"Linked\r\n" - L"Version\".\r\n" - L"\r\n" - L" The \"Minimal Corresponding Source\" for a Combined Work means the\r\n" - L"Corresponding Source for the Combined Work, excluding any source code\r\n" - L"for portions of the Combined Work that, considered in isolation, are\r\n" - L"based on the Application, and not on the Linked Version.\r\n" - L"\r\n" - L" The \"Corresponding Application Code\" for a Combined Work means the\r\n" - L"object code and/or source code for the Application, including any data\r\n" - L"and utility programs needed for reproducing the Combined Work from the\r\n" - L"Application, but excluding the System Libraries of the Combined Work.\r\n" - L"\r\n" - L" 1. Exception to Section 3 of the GNU GPL.\r\n" - L"\r\n" - L" You may convey a covered work under sections 3 and 4 of this License\r\n" - L"without being bound by section 3 of the GNU GPL.\r\n" - L"\r\n" - L" 2. Conveying Modified Versions.\r\n" - L"\r\n" - L" If you modify a copy of the Library, and, in your modifications, a\r\n" - L"facility refers to a function or data to be supplied by an Application\r\n" - L"that uses the facility (other than as an argument passed when the\r\n" - L"facility is invoked), then you may convey a copy of the modified\r\n" - L"version:\r\n" - L"\r\n" - L" a) under this License, provided that you make a good faith effort to\r\n" - L" ensure that, in the event an Application does not supply the\r\n" - L" function or data, the facility still operates, and performs\r\n" - L" whatever part of its purpose remains meaningful, or\r\n" - L"\r\n" - L" b) under the GNU GPL, with none of the additional permissions of\r\n" - L" this License applicable to that copy.\r\n" - L"\r\n" - L" 3. Object Code Incorporating Material from Library Header Files.\r\n" - L"\r\n" - L" The object code form of an Application may incorporate material from\r\n" - L"a header file that is part of the Library. You may convey such object\r\n" - L"code under terms of your choice, provided that, if the incorporated\r\n" - L"material is not limited to numerical parameters, data structure\r\n" - L"layouts and accessors, or small macros, inline functions and templates\r\n" - L"(ten or fewer lines in length), you do both of the following:\r\n" - L"\r\n" - L" a) Give prominent notice with each copy of the object code that the\r\n" - L" Library is used in it and that the Library and its use are\r\n" - L" covered by this License.\r\n" - L"\r\n" - L" b) Accompany the object code with a copy of the GNU GPL and this license\r\n" - L" document.\r\n" - L"\r\n" - L" 4. Combined Works.\r\n" - L"\r\n" - L" You may convey a Combined Work under terms of your choice that,\r\n" - L"taken together, effectively do not restrict modification of the\r\n" - L"portions of the Library contained in the Combined Work and reverse\r\n" - L"engineering for debugging such modifications, if you also do each of\r\n" - L"the following:\r\n" - L"\r\n" - L" a) Give prominent notice with each copy of the Combined Work that\r\n" - L" the Library is used in it and that the Library and its use are\r\n" - L" covered by this License.\r\n" - L"\r\n" - L" b) Accompany the Combined Work with a copy of the GNU GPL and this license\r\n" - L" document.\r\n" - L"\r\n" - L" c) For a Combined Work that displays copyright notices during\r\n" - L" execution, include the copyright notice for the Library among\r\n" - L" these notices, as well as a reference directing the user to the\r\n" - L" copies of the GNU GPL and this license document.\r\n" - L"\r\n" - L" d) Do one of the following:\r\n" - L"\r\n" - L" 0) Convey the Minimal Corresponding Source under the terms of this\r\n" - L" License, and the Corresponding Application Code in a form\r\n" - L" suitable for, and under terms that permit, the user to\r\n" - L" recombine or relink the Application with a modified version of\r\n" - L" the Linked Version to produce a modified Combined Work, in the\r\n" - L" manner specified by section 6 of the GNU GPL for conveying\r\n" - L" Corresponding Source.\r\n" - L"\r\n" - L" 1) Use a suitable shared library mechanism for linking with the\r\n" - L" Library. A suitable mechanism is one that (a) uses at run time\r\n" - L" a copy of the Library already present on the user's computer\r\n" - L" system, and (b) will operate properly with a modified version\r\n" - L" of the Library that is interface-compatible with the Linked\r\n" - L" Version. \r\n" - L"\r\n" - L" e) Provide Installation Information, but only if you would otherwise\r\n" - L" be required to provide such information under section 6 of the\r\n" - L" GNU GPL, and only to the extent that such information is\r\n" - L" necessary to install and execute a modified version of the\r\n" - L" Combined Work produced by recombining or relinking the\r\n" - L" Application with a modified version of the Linked Version. (If\r\n" - L" you use option 4d0, the Installation Information must accompany\r\n" - L" the Minimal Corresponding Source and Corresponding Application\r\n" - L" Code. If you use option 4d1, you must provide the Installation\r\n" - L" Information in the manner specified by section 6 of the GNU GPL\r\n" - L" for conveying Corresponding Source.)\r\n" - L"\r\n" - L" 5. Combined Libraries.\r\n" - L"\r\n" - L" You may place library facilities that are a work based on the\r\n" - L"Library side by side in a single library together with other library\r\n" - L"facilities that are not Applications and are not covered by this\r\n" - L"License, and convey such a combined library under terms of your\r\n" - L"choice, if you do both of the following:\r\n" - L"\r\n" - L" a) Accompany the combined library with a copy of the same work based\r\n" - L" on the Library, uncombined with any other library facilities,\r\n" - L" conveyed under the terms of this License.\r\n" - L"\r\n" - L" b) Give prominent notice with the combined library that part of it\r\n" - L" is a work based on the Library, and explaining where to find the\r\n" - L" accompanying uncombined form of the same work.\r\n" - L"\r\n" - L" 6. Revised Versions of the GNU Lesser General Public License.\r\n" - L"\r\n" - L" The Free Software Foundation may publish revised and/or new versions\r\n" - L"of the GNU Lesser General Public License from time to time. Such new\r\n" - L"versions will be similar in spirit to the present version, but may\r\n" - L"differ in detail to address new problems or concerns.\r\n" - L"\r\n" - L" Each version is given a distinguishing version number. If the\r\n" - L"Library as you received it specifies that a certain numbered version\r\n" - L"of the GNU Lesser General Public License \"or any later version\"\r\n" - L"applies to it, you have the option of following the terms and\r\n" - L"conditions either of that published version or of any later version\r\n" - L"published by the Free Software Foundation. If the Library as you\r\n" - L"received it does not specify a version number of the GNU Lesser\r\n" - L"General Public License, you may choose any version of the GNU Lesser\r\n" - L"General Public License ever published by the Free Software Foundation.\r\n" - L"\r\n" - L" If the Library as you received it specifies that a proxy can decide\r\n" - L"whether future versions of the GNU Lesser General Public License shall\r\n" - L"apply, that proxy's public statement of acceptance of any version is\r\n" - L"permanent authorization for you to choose that version for the\r\n" - L"Library.\r\n", - - // Secure Edit - L"cppcryptfs usage: modified and incorporated into cppcryptfs (as SecureEdit.cpp and SecureEdit.h).\r\n\r\n" - L"Secure Edit copyright and license:\r\n\r\n" - L"100% free Secure Edit control MFC class\r\n" - L"Copyright (c) 2003 Dominik Reichl\r\n" - L"If you use this class I would be more than happy if you mention\r\n" - L"my name somewhere in your application. Thanks!\r\n" - L"Do you have any questions or want to tell me that you are using\r\n" - L"my class, e-mail me: .\r\n", - - // getopt - - L"project url: github.com/kimgr/getopt_port\r\n\r\n" - L"cppcryptfs usage: getopt.c and getopt.h from this project were modified and incorporated into cppcryptfs.\r\n\r\n" - L"getopt_port copyright and license:\r\n\r\n" - L"Copyright (c) 2012-2017, Kim Grasman \r\n" - L"All rights reserved.\r\n" - L"\r\n" - L"Redistribution and use in source and binary forms, with or without\r\n" - L"modification, are permitted provided that the following conditions are met:\r\n" - L" * Redistributions of source code must retain the above copyright\r\n" - L" notice, this list of conditions and the following disclaimer.\r\n" - L" * Redistributions in binary form must reproduce the above copyright\r\n" - L" notice, this list of conditions and the following disclaimer in the\r\n" - L" documentation and/or other materials provided with the distribution.\r\n" - L" * Neither the name of Kim Grasman nor the\r\n" - L" names of contributors may be used to endorse or promote products\r\n" - L" derived from this software without specific prior written permission.\r\n" - L"\r\n" - L"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n" - L"ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n" - L"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n" - L"DISCLAIMED. IN NO EVENT SHALL KIM GRASMAN BE LIABLE FOR ANY\r\n" - L"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n" - L"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n" - L"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n" - L"ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n" - L"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n" - L"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n", - - // aes-siv - - L"project url: github.com/arktronic/aes-siv\r\n\r\n" - L"cppcryptfs usage: code from this project was modified and incorporated into cppcryptfs (in the cppcryptfs/aes-siv directory). " - L"The low-level, third-party AES implementation included with aes-siv was replaced with a new implementation that uses OpenSSL.\r\n\r\n" - L"aes-siv copyright and license:\r\n\r\n" - L"This project is licensed under the OSI-approved ISC License:\r\n" - L"\r\n" - L"Copyright (c) 2015 ARKconcepts / Sasha Kotlyar\r\n" - L"\r\n" - L"Permission to use, copy, modify, and/or distribute this software for any\r\n" - L"purpose with or without fee is hereby granted, provided that the above\r\n" - L"copyright notice and this permission notice appear in all copies.\r\n" - L"\r\n" - L"THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n" - L"REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\r\n" - L"FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n" - L"INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n" - L"LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n" - L"OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n" - L"PERFORMANCE OF THIS SOFTWARE.\r\n", - - NULL -}; - static CString lf_to_crlf(const wchar_t* txt) { CString fixed; @@ -616,7 +158,7 @@ BOOL CCryptAboutPropertyPage::OnInitDialog() wstring prod = L"cppryptfs"; wstring ver = L"1.0"; - wstring copyright = L"Copyright (C) 2016-2025 Bailey Brown. All Rights Reserved."; + wstring copyright = LocUtils::GetStringFromResources(IDS_COPYRIGHT); GetProductVersionInfo(prod, ver, copyright); @@ -647,25 +189,27 @@ BOOL CCryptAboutPropertyPage::OnInitDialog() std::wstring dok_ver; CString dokany_version; if (get_dokany_version(dok_ver, dv)) { - dokany_version = CString(L"; using Dokany ") + dok_ver.c_str(); + dokany_version.Format(LocUtils::GetStringFromResources(IDS_DOKANY_VERSION), dok_ver.c_str()); } wstring aes_ni; if (AES::use_aes_ni()) { - aes_ni = L"; AES-NI detected"; + aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_DETECTED); } else { - aes_ni = L"; AES-NI not detected"; + aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_NOT_DETECTED); } - SetDlgItemText(IDC_LINKAGES, L"linked with " + openssl_ver + dokany_version); + CString strMsgOpenSSLVersion; + strMsgOpenSSLVersion.Format(LocUtils::GetStringFromResources(IDS_OPENSSL_VERSION), openssl_ver); + SetDlgItemText(IDC_LINKAGES, strMsgOpenSSLVersion + dokany_version); bool is_admin = theApp.IsRunningAsAdministrator(); CString prod_ver = prod.c_str(); prod_ver += L" "; prod_ver += ver.c_str(); - prod_ver += sizeof(void*) == 8 ? L" 64-bit" : L" 32-bit"; - prod_ver += (is_admin ? L" (admin)" : L""); + prod_ver += sizeof(void*) == 8 ? LocUtils::GetStringFromResources(IDS_64BIT) : LocUtils::GetStringFromResources(IDS_32BIT); + prod_ver += (is_admin ? LocUtils::GetStringFromResources(IDS_ADMIN) : L""); SetDlgItemText(IDC_PROD_VERSION, prod_ver + CString(aes_ni.c_str())); SetDlgItemText(IDC_COPYRIGHT, copyright.c_str()); From aa29978f2d913001193e7a69ddb071d3140979ed Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Sat, 31 Jan 2026 12:35:34 +0300 Subject: [PATCH 07/22] SettingsPropertyPage --- cppcryptfs/cppcryptfs.rc | Bin 50428 -> 53426 bytes cppcryptfs/res/lic/en_openssl.txt | Bin 11388 -> 11384 bytes cppcryptfs/resource.h | Bin 18472 -> 19982 bytes cppcryptfs/ui/CryptAboutPropertyPage.cpp | 16 +++++----- cppcryptfs/ui/SettingsPropertyPage.cpp | 39 ++++++++++++++++------- 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 7a7dff4082bc21b0ef590b43756c0d32e7e2cb54..75eb24c5c9d432a3f8bd1e8eb795b4653cfa524c 100644 GIT binary patch delta 1326 zcma)6(MwZd6hCX4*Nkdzvxbaq*Q^)uZq|yPV$)#7($Hl=#h7kO(QVCb#a;$UL_$#O z)W9AV8wfoVMMJCzqI`?!fAAj&eT^Raeb=krIl^(d-}&zM{l4Eh=XcI`|1KCmRE+Pl z9jyu}Bp1_We$?^Ch!6gHz{bDYB!0NsS&JY1@s_VYKhhea5CwT<(aYW#L0Av3eNqm~uZHzDV$BT^keky_ z6qASCO`*LSx*6_M8aHec+^1=i8@37b8I2pZ3G_J)4cmy`*7`DCq+wJ=uXTc^DM>lX zQmjtvEv#PaUD$1{x3JJyr}f@wz1Dl7>$UzLIzS_Il}6RhL)F_w-%X+Ca{O)C#_LZd zN0_cbg&>|Vv=~7Lhslp_6+P>taeh^@vAfvC56Ye06X;mcw-LIFSrqeWier>XW|#k@ zT~=2z7_(4t4mxh4(Bst48!vmUgK9j(suz_Xo`yJ5vGe0fSG%|kIbgG#sP^#wlEpEE z{UF|u8j(+nQ-9L+>{g2@Mze5*lEHNZ^H~tM4CjT*qxBT}quu;-=~$a~mS?KH!X=OT zj~l}j;CHWWJu;*b3Fg(ncG7Z+Ym0R)aidIq!XwX@EqrrHvhTzbr9R*$)P{1Zg52Y^ z7iL3-@0YF0ZbAEjbt2gm#wfDUXO*P9@L>{sLZnF)Qv5(>_(t`tL6z5BpKAcokMYK` zL*(hzvrVCJ8R(Tlk@Db+!=@;K*&H};YrEKEpJe4L3oU%B delta 64 zcmdnAkoiw1^M(@c$p^SZCiif!0n!qa&#`lCj^VkpcCrTt-{c2YESo%LokB^gC~$wXHcK4&!@P#OqGcp0JKvGc>n+a diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index d51a14b95b9cbb3f9bf7a2723bb7d58917661a25..0c37078cb55239152c5cb0fb4a433b383d7f43a5 100755 GIT binary patch delta 888 zcmZ{i!AiqG5QZn3swt@rR6z)73@RQ(>9$euq_Gt$#8zxnJO$sReE|{X>ZLc2idPTf z8~6x5fMB0MXO|{scaFz3ZqrI`cpW89#tqOMm_WN^DHt-?vNpyk#o&B zHM6JSZ&x)lhQ$eFYD#K&UGRJm3lYjJKsx_wIKdP;wr9uB>w=ek?o F{sH7@jQ0Ql delta 14 VcmeC1!? 0) { - int result = MessageBox(L"Delete all saved passwords?", L"cppcryptfs", MB_ICONWARNING | MB_YESNO); + int result = MessageBox(LocUtils::GetStringFromResources(IDS_DELETE_ALL_SAVED_PASS), L"cppcryptfs", MB_ICONWARNING | MB_YESNO); if (result == IDYES) { if (SavedPasswords::ClearSavedPasswords(TRUE) != numSavedPasswords) { - MessageBox(L"unable to delete saved passwords", L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_DELETE_SAVED_PASS), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); } } } @@ -329,8 +347,7 @@ void CSettingsPropertyPage::OnClickedNeverSaveHistory() CryptSettings::getInstance().GetSettingCurrent(ENABLE_SAVING_PASSWORDS, enablesavingpasswords); if (enablesavingpasswords) { - MessageBox(L"If you turn on \"Never save history\", saved passwords will not be deleted, but new passwords will not " - L"be saved. To delete any saved passwords, uncheck \"Enable saved passwords\".", + MessageBox(LocUtils::GetStringFromResources(IDS_NEVER_SAVE_HISTORY_HINT), L"cppcryptfs", MB_OK | MB_ICONINFORMATION); } @@ -354,7 +371,7 @@ void CSettingsPropertyPage::OnClickedNeverSaveHistory() DeleteAllRegisteryValues(CPPCRYPTFS_REG_PATH L"CreateOptions", mes); error += mes; if (!error.empty()) { - MessageBox(L"unable to delete history from registry", L"cppcryptfs", + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_DELETE_HISTORY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); } } From 359ccf94379a68ba8e4af1acbd4e9b1c12faa69e Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Sat, 31 Jan 2026 12:55:13 +0300 Subject: [PATCH 08/22] rename en_secure.txt --- cppcryptfs/cppcryptfs.rc | Bin 53426 -> 53426 bytes cppcryptfs/cppcryptfs.vcxproj | 2 +- ...{en_secuty_edit.txt => en_secure_edit.txt} | Bin 3 files changed, 1 insertion(+), 1 deletion(-) rename cppcryptfs/res/lic/{en_secuty_edit.txt => en_secure_edit.txt} (100%) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 75eb24c5c9d432a3f8bd1e8eb795b4653cfa524c..9c0e8937bd85f5f1065f7f410e767156dd2eb8de 100644 GIT binary patch delta 32 ncmdnAka^QW<_(Wd@D?$oGQhXi>YK$*&S3`t&%X=? delta 32 ocmdnAka^QW<_(Wd@Rl%CGQ=~aGNdqMGL%eCJf^-`?BpDF0MUC48~^|S diff --git a/cppcryptfs/cppcryptfs.vcxproj b/cppcryptfs/cppcryptfs.vcxproj index 28d5eab..bbcd4b9 100755 --- a/cppcryptfs/cppcryptfs.vcxproj +++ b/cppcryptfs/cppcryptfs.vcxproj @@ -326,7 +326,7 @@ - + diff --git a/cppcryptfs/res/lic/en_secuty_edit.txt b/cppcryptfs/res/lic/en_secure_edit.txt similarity index 100% rename from cppcryptfs/res/lic/en_secuty_edit.txt rename to cppcryptfs/res/lic/en_secure_edit.txt From 70bd032e3ff22db8ffebb42ede35160070f3bf50 Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Thu, 5 Feb 2026 10:56:08 +0300 Subject: [PATCH 09/22] cryptdokan. GetStringFromResources() ALT edition --- cppcryptfs/cppcryptfs.rc | Bin 53426 -> 60260 bytes cppcryptfs/cppcryptfs.vcxproj | 5 ++ cppcryptfs/dokan/cryptdokan.cpp | 144 ++++++++++++++++++++++---------- cppcryptfs/resource.h | Bin 19982 -> 23398 bytes cppcryptfs/ui/locutils.cpp | 2 +- cppcryptfs/ui/locutilsalt.cpp | 11 +++ cppcryptfs/ui/locutilsalt.h | 9 ++ cppcryptfs/ui/uiutil.cpp | 9 +- 8 files changed, 130 insertions(+), 50 deletions(-) create mode 100644 cppcryptfs/ui/locutilsalt.cpp create mode 100644 cppcryptfs/ui/locutilsalt.h diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 9c0e8937bd85f5f1065f7f410e767156dd2eb8de..86718da2a13231b31c22e8fe2f38a7b36d9644c2 100644 GIT binary patch delta 3576 zcmb_fTTfJ17~NJFhKmfhfsW%iGm^g!zL!}i?uIJ`ld-A`p~rU18Ta~-gB7YV$-C}$+>Xm?C-L^ z^{xGJXJ+%SKX1M@lqpLY1@dv`4cuRrM``wjcd{Urs=1XMhdX_hgIM2abFCy-MzeEQ8$fZXv&bejVWOiyLRy9gytW@?l7RtMmS-H%Z zF`h)WQ9KRH!I)P*oGaw_PW?U5tx|QW0hk}db3_h*lP{NMGURznHf?O`kcIKmeayB` zd#AlY9SL)f;;j!+H>+x(=R=%P#CaAmcFNOlUFlW$r5PR?#Wfj}YvXzH`)r1z7dD1) zbRwoQby`{{i{$d;Ho2UhCr_pdb8A&SP^d&a6?lrMYFTy^OU`!%&R*DW({Y^CzE2^N zE*VMBmuI6nxrQ%X(}<%=RmjNwpzM8+mv0!tH3JqRdR5MRj=xHKBI@*80nd!M71v7r z9FowyKiH|g5=UY|)1$h)O z6{>?()8!3#GFa6iW@gd_ZqB4R!5Djf9V&iA^S2cYP9QN|ksW(GOZGSCZCObcp>@Qm zW_Kqqq+Hb@VGo^> zi^|u)u4zieuh#@)LEb?0O&TS$hm4%amp@{8TZjfrZPBL4N&WPxc8x#t(>si8n)l`# z`WwAI3R{iPtG3xd@eY(*Yek$G$r-cT2hb3|jQPFs?!!v95eZp^le%(@yAy2rgB#mo zgq=8v!m#Q$_S~!Ot+n-{xYpX)m6}ArF`rDe*c@a^68oh5YrmrzXx1Zc?jX8pt4d_D z#a?86%dEL`ur{1JfSAWZEQA$Y71nzX_x|HxQroP%bmM%v>#*|NMfl9Q0Qyf9*Gv%0 zF1OsdzBL%ex5*R43$%7sCQa&1MAfKw(1urRGToB0E}KEsjW`ClPp$FXHX9UZDBdP{ zW`r^~n*~fE1QPnZOm2;*a3V;HGg+cv1&UY1N8`zr4+d|W|QpLZq8GziyVq=*K<(LM4{Zhoh>&Ow_&H+?(RT7?`eF8 zVZ-o~(+<#0NKFP5lMA|)Po8EJmHU7&)BN|zl|Kv? z#b>5?Pu8d!REV8<`_u9umEMHJe(b`*H(hIil)qxT{OstJ)v(4+H+^0Mdr*Dou~(j# z*&GQwOekvY8_s&fPyJcDO3y~AQ53UN4v%}+C}3h$(hR(BBQ4byG>jYXBjvMh7iMVq zw|KkqKZa@*|IH$HD(61w-)Spb=^Y?$sh73SBx}f9=u4=UgzQdv@@mS$vxisg^3iaC TOg*}w?-yROFTD2SxlMlqDe^xe delta 65 zcmaEIjd{~T<_#s>tojW43`!FVg(r7#uVDsqChzBxoP3U*V{-^k)6UH^9<1O1i(Y&w QJ2~cM8Hm04;>*d500J`@nE(I) diff --git a/cppcryptfs/cppcryptfs.vcxproj b/cppcryptfs/cppcryptfs.vcxproj index bbcd4b9..bbca838 100755 --- a/cppcryptfs/cppcryptfs.vcxproj +++ b/cppcryptfs/cppcryptfs.vcxproj @@ -228,6 +228,7 @@ + @@ -262,6 +263,10 @@ + + false + NotUsing + diff --git a/cppcryptfs/dokan/cryptdokan.cpp b/cppcryptfs/dokan/cryptdokan.cpp index 6f1a30e..82be6b8 100755 --- a/cppcryptfs/dokan/cryptdokan.cpp +++ b/cppcryptfs/dokan/cryptdokan.cpp @@ -98,6 +98,8 @@ THE SOFTWARE. #include "MountPointManager.h" #include "../libcommonutil/commonutil.h" +#include "resource.h" +#include "ui/locutilsalt.h" static DWORD g_SessionId; static BOOL g_GotSessionId = FALSE; @@ -2022,7 +2024,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, config_path = NULL; if (mountpoint == NULL) { - mes = L"invalid mountpoint"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_INVALID_MPOINT); + mes = strMsg; return -1; } @@ -2030,9 +2033,11 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (mount_point_is_a_dir && !is_suitable_mountpoint(mountpoint)) { if (!PathFileExists(mountpoint)) { - mes = L"the mount point directory does not exist"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_NOT_EXIST); + mes = strMsg; } else { - mes = L"mount point directory must be empty and reside on NTFS volume"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_EMPTY_NTFS); + mes = strMsg; } return -1; } @@ -2041,7 +2046,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, bool already_mounted = MountPointManager::getInstance().find(mountpoint, dummy); if (already_mounted) { - mes = L"drive letter/mount point already in use\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_LETTER_MPOINT_ALREADY_USE); + mes = strMsg; return -1; } @@ -2059,7 +2065,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, } if (!tdata) { - mes = L"Failed to allocate tdata\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ALLOCATE_TDATA); + mes = strMsg; throw(-1); } @@ -2155,8 +2162,10 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, dokanOptions->MountPoint = tdata->mountpoint.c_str(); if (!config->read(mes, config_path, reverse)) { - if (mes.length() < 1) - mes = L"unable to load config\n"; + if (mes.length() < 1) { + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_LOAD_CONF); + mes = strMsg; + } throw(-1); } @@ -2183,7 +2192,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, #endif if (!config->decrypt_key(password)) { - mes = L"password incorrect\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PASS_INCORRECT); + mes = strMsg; throw(-1); } @@ -2193,7 +2203,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, throw(-1); } } catch (...) { - mes = L"unable to initialize eme context"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_EME); + mes = strMsg; throw(-1); } } @@ -2202,7 +2213,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, try { con->m_siv.SetKey(config->GetMasterKey(), 32, config->m_HKDF, config); } catch (...) { - mes = L"unable to intialize AESSIV context"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_AESSIV); + mes = strMsg; throw(-1); } } @@ -2284,7 +2296,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, && !con->GetConfig()->m_reverse; if (!con->FinalInitBeforeMounting(opts.cachekeysinmemory)) { - mes = L"context final init failed"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FINAL_INIT_FAILED); + mes = strMsg; throw(-1); } @@ -2294,7 +2307,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, hThread = CreateThread(NULL, 0, CryptThreadProc, tdata, 0, NULL); if (!hThread) { - mes = L"unable to create thread for drive letter/mount point\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_CREATE_TREAD); + mes = strMsg; throw(-1); } @@ -2303,7 +2317,8 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, // MountPointManager owns tdata from this point on, even if it fails to add (will delete it) if (!MountPointManager::getInstance().add(mountpoint, tdata)) { - mes = L"unable to add mount point to MountPointManager\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_ADD_MPOINT); + mes = strMsg; throw(-1); } @@ -2345,12 +2360,15 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (wait_result != WAIT_OBJECT_0) { if (wait_result == (WAIT_OBJECT_0 + 1)) { // thread exited without mounting - mes = L"mount operation failed\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_FAILED); + mes = strMsg; } else if (wait_result == WAIT_TIMEOUT) { - mes = L"mount operation timed out\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_TIMED_OUT); + mes = strMsg; tdata = NULL; // deleting it would probably cause crash } else { - mes = L"error waiting for mount operation\n"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_ERROR_WAITING); + mes = strMsg; tdata = NULL; // deleting it would probably cause crash } throw(-1); @@ -2372,8 +2390,9 @@ BOOL unmount_crypt_fs(const WCHAR* mountpoint, bool wait, wstring& mes) { wstring mpstr; if (!MountPointManager::getInstance().find(mountpoint, mpstr)) { - mes += L"unable to find mount point"; - return FALSE; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_FIND_MPOINT); + mes += strMsg; + return FALSE; } if (!DokanRemoveMountPoint(mpstr.c_str())) { mes += GetWindowsErrorString(GetLastError()); @@ -2383,7 +2402,9 @@ BOOL unmount_crypt_fs(const WCHAR* mountpoint, bool wait, wstring& mes) { if (wait) { bool res = MountPointManager::getInstance().wait_and_destroy(mpstr.c_str()); if (!res) { - mes += L"wait on umount returned an error " + GetWindowsErrorString(GetLastError()); + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_WAIT_UNMOUNT_ERROR), GetWindowsErrorString(GetLastError())); + mes += strMsg; } return res; } else { @@ -2421,7 +2442,8 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { CryptThreadData *tdata = MountPointManager::getInstance().get(fs_root.c_str()); if (!tdata) { - mes += L"mount point not found"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NOT_FOUND); + mes += strMsg; return FALSE; } @@ -2430,7 +2452,8 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { CryptContext *con = &tdata->con; if (!con) { - mes += L"mount point has null context"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NULL); + mes += strMsg; return FALSE; } @@ -2443,7 +2466,9 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { NULL, NULL, 0)) { DWORD error = GetLastError(); DbgPrint(L"update volume name error = %u\n", error); - mes += L"Unable to get volume information, " + GetWindowsErrorString(error); + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_UNABLE_GET_VOLUME_INFO), GetWindowsErrorString(error)); + mes += strMsg; return FALSE; } @@ -2451,7 +2476,8 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { con->GetConfig()->m_VolumeName = volbuf; bool res = con->GetConfig()->write_updated_config_file(nullptr, nullptr, 0); if (!res) { - mes += L"unable to write new volume name to config file"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_WRITE_NEW_VOL_NAME); + mes += strMsg; return FALSE; } } @@ -2504,7 +2530,8 @@ wstring transform_path(const wchar_t* path, wstring& mes) _locale_t locale = _create_locale(LC_ALL, ""); if (locale == NULL) { - mes = L"cannot create locale"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); + mes = strMsg; return nullptr; } @@ -2527,7 +2554,8 @@ wstring transform_path(const wchar_t* path, wstring& mes) _free_locale(locale); if (!tdata) { - mes = L"could not found mount point or base dir"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_NOT_FOUND_MPOINT_BASE_DIR); + mes = strMsg; return L""; } @@ -2537,12 +2565,14 @@ wstring transform_path(const wchar_t* path, wstring& mes) if (tdata->con.GetConfig()->m_reverse) { if (!encrypt_path(&tdata->con, p, storage)) { - mes = L"failed to convert path"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CONVERT_PATH); + mes = strMsg; return L""; } } else { if (!unencrypt_path(&tdata->con, p, storage)) { - mes = L"failed to unencrypt path"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_UNENCRYPT_PATH); + mes = strMsg; return L""; } } @@ -2556,7 +2586,8 @@ wstring transform_path(const wchar_t* path, wstring& mes) FileNameEnc enc(&dfi, p, nullptr, false); auto pconv = static_cast(enc); if (!pconv) { - mes = L"failed to encrypt path"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ENCRYPT_PATH); + mes = strMsg; return L""; } return pconv + std::size(L"\\\\?\\") - 1; @@ -2569,19 +2600,22 @@ BOOL list_files(const WCHAR *path, list &findDatas, err_mes = L""; if (!path) { - err_mes = L"path is null"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_NULL); + err_mes = strMsg; return FALSE; } if (wcslen(path) > MAX_PATH - 1) { - err_mes = L"path is too long"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_LONG); + err_mes = strMsg; return FALSE; } WCHAR newpath[MAX_PATH + 1]; if (!PathCanonicalize(newpath, path)) { - err_mes = L"failed to canonicalize path"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CANONICALIZE_PATH); + err_mes = strMsg; return FALSE; } @@ -2590,17 +2624,20 @@ BOOL list_files(const WCHAR *path, list &findDatas, int dl = *path; if (dl < 'A' || dl > 'Z') { - err_mes = L"invalid drive letter"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_INVALID_DRIVE_LETTER); + err_mes = strMsg; return FALSE; } if (wcslen(path) < 3) { - err_mes = L"path is too short"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_SHORT); + err_mes = strMsg; return FALSE; } if (path[1] != ':' || path[2] != '\\') { - err_mes = L"invalid path"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_INVALID_PATH); + err_mes = strMsg; return FALSE; } @@ -2614,7 +2651,8 @@ BOOL list_files(const WCHAR *path, list &findDatas, _locale_t locale = _create_locale(LC_ALL, ""); if (locale == NULL) { - err_mes = L"cannot create locale"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); + err_mes = strMsg; return FALSE; } @@ -2640,7 +2678,8 @@ BOOL list_files(const WCHAR *path, list &findDatas, _free_locale(locale); if (!tdata) { - err_mes = L"drive not mounted"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_DRIVE_NOT_MOUNTED); + err_mes = strMsg; return FALSE; } @@ -2670,7 +2709,8 @@ BOOL list_files(const WCHAR *path, list &findDatas, if (find_files(con, filePath.CorrectCasePath(), filePath, crypt_fill_find_data_list, NULL, &findDatas) != 0) { - err_mes = L"error listing files"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_ERROR_LISTING_FILES); + err_mes = strMsg; return FALSE; } } else if (PathFileExists(filePath)) { @@ -2697,7 +2737,8 @@ BOOL list_files(const WCHAR *path, list &findDatas, } else { - err_mes = L"path does not exist"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_NOT_EXIST); + err_mes = strMsg; return FALSE; } @@ -2759,7 +2800,8 @@ bool check_dokany_version(wstring& mes) vector v; if (!get_dokany_version(ver, v)) { - mes = L"unable to get dokany version"; + CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_GET_DOKANY_VERSION); + mes = strMsg; return false; } @@ -2775,17 +2817,23 @@ bool check_dokany_version(wstring& mes) } if (major != required_major) { - mes = L"The installed Dokany version " + ver + L" is not compatible. Please install Dokany " + required_ver; + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_DOKANY_VER_NOT_COMPATIBLE), ver, required_ver); + mes = strMsg; return false; // error } if (major == required_major && middle < required_middle) { - mes = L"The installed Dokany version " + ver + L" is not compatible. Please install Dokany " + required_ver; + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_DOKANY_VER_NOT_COMPATIBLE), ver, required_ver); + mes = strMsg; return false; // error } if (major == required_major && middle > required_middle) { - mes = L"The installed Dokany version is " + ver + L", and it has not been tested with cppcryptfs. Please install Dokany " + required_ver; + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_DOKANY_VER_NOT_TESTED), ver, required_ver); + mes = strMsg; return true; // warning } @@ -2826,7 +2874,9 @@ static void InitLogging() const WCHAR* logdir = L"C:\\cppcryptfslogs"; if (!PathFileExists(logdir)) { - ::MessageBox(NULL, (wstring(L"Unable to init logging. Please create ") + logdir).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_LOGGING), logdir); + ::MessageBox(NULL, strMsg, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -2862,9 +2912,13 @@ static void InitLogging() const int result = _wfopen_s(&g_DebugLogFile, logname.c_str(), L"at+"); if (result == 0) { - ::MessageBox(NULL, (wstring(L"Logging to ") + logname).c_str(), L"cppcryptfs", MB_OK | MB_ICONINFORMATION); + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_LOGGING_TO_LOGNAME), logname); + ::MessageBox(NULL, strMsg, L"cppcryptfs", MB_OK | MB_ICONINFORMATION); } else { - ::MessageBox(NULL, (wstring(L"Unable to open ") + logname.c_str()).c_str(), L"cppcryptfs", MB_OK | MB_ICONERROR); + CString strMsg; + strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_UNABLE_OPEN_LOGNAME), logname); + ::MessageBox(NULL, strMsg, L"cppcryptfs", MB_OK | MB_ICONERROR); } } diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index 0c37078cb55239152c5cb0fb4a433b383d7f43a5..6e001bd25a7f8d7791c1b6b71f22807a21962081 100755 GIT binary patch delta 1959 zcma)6O-~b16n%wKsL&5OZIn#vbf^g+Ar;yZFfJTvftu1{sUR*Kx_9B)mHYwxcv~0x z4@^vqOS<827&dN&f8aUqb$C;7VJ0)}ygB#d+$8#(xh`2r`*hp`oM#Fj@^rWhdWVn^)a`=PSx3T72xBlm1ZoovES7gt?$ zWY2OZ12*(`nR1plkrDaUMGan?u&WO;7USJGx}8u&)mJGiws&HC#dg>ekV17Z(X1NAg< zdkJS@6K5^OLPypYgOWHGh*O zdNHPKY3_tb&`m+PwZ4P3GYrq}=lWQScDnwiJNrt_|l6;ez$nV3l2?V+6 z`qNi{>Mz*xOCd9NfE>tym=>M~_|=wt_Xhp1%98EM?dha5+@V07R4hFMH=^dNd^3L^ zzIKrTt3_=+fp^ZbkIHk_;_{d4$fK#)Qg{ZmqW6L8D63sqb;Y)dhIrz^KjwxSsN-g? zhiWE$JdGW#(4)zaMr8k?H66xi-+Fqctm}2IiWStElXc7Pf>RqTSPP>A+OJ4f8H~!q zj6C3oZK%oS270OLVB%LrnM%L5rTRsCTveH0q4?8@WIl+#hni58M!obg*gGz3ezon8 ztBFK^?AzsNUS6crPS7`_c}~Uv1&^p($>^4>^;Xm~;A8jb{iSywt56>7piFLfhXzar zTZfvJCo^{=Re9_&mzex8lX1-krV^+i_OSu=Xw3mV<-#s&8zj}tO&w%jm3?5iUznxd zLhRNSE}eJ4ZaDon&x+gk{{jqXQpx}T delta 116 zcmaF1jj?YIqRn~G8jz$Xd(?1RhnF(F9qTA ogZMUJwj(EqEizfoKm*Kg6oBw63_#{BG=P|pXePf|#?VU(0Quk~RsaA1 diff --git a/cppcryptfs/ui/locutils.cpp b/cppcryptfs/ui/locutils.cpp index a3f45d5..16bdb05 100644 --- a/cppcryptfs/ui/locutils.cpp +++ b/cppcryptfs/ui/locutils.cpp @@ -7,4 +7,4 @@ CString LocUtils::GetStringFromResources(UINT nID) { return _T("Error: String not found"); } return str; -} \ No newline at end of file +} diff --git a/cppcryptfs/ui/locutilsalt.cpp b/cppcryptfs/ui/locutilsalt.cpp new file mode 100644 index 0000000..5416e13 --- /dev/null +++ b/cppcryptfs/ui/locutilsalt.cpp @@ -0,0 +1,11 @@ +#include "locutilsalt.h" + +CString LocUtilsAlt::GetStringFromResources(UINT nID) { + CString str; + static HINSTANCE hExe = GetModuleHandle(NULL); + if (hExe == NULL || !str.LoadString(hExe, nID)) { + return _T("Error: String not found"); + } + return str; +} + diff --git a/cppcryptfs/ui/locutilsalt.h b/cppcryptfs/ui/locutilsalt.h new file mode 100644 index 0000000..05deeaf --- /dev/null +++ b/cppcryptfs/ui/locutilsalt.h @@ -0,0 +1,9 @@ +#pragma once +#include +#include + +class LocUtilsAlt { +public: + static CString GetStringFromResources(UINT nID); +}; + diff --git a/cppcryptfs/ui/uiutil.cpp b/cppcryptfs/ui/uiutil.cpp index df26be2..8ca2015 100644 --- a/cppcryptfs/ui/uiutil.cpp +++ b/cppcryptfs/ui/uiutil.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "stdafx.h" #include "uiutil.h" - +#include #include #include "ui/MountMangerDialog.h" @@ -36,6 +36,7 @@ THE SOFTWARE. #include "ui/certutil.h" #include "ui/CryptSettings.h" #include "dokan/cryptdokan.h" +#include "locutils.h" using namespace std; @@ -118,9 +119,9 @@ wstring CheckOpenHandles(HWND hWnd, const wchar_t* mp, bool interactive, bool fo } else if (open_handle_count > 0) { if (interactive) { - auto res = ::MessageBox(hWnd, mp ? (wstring(mp) + L" is still in use. Do you wish to continue dismounting?").c_str() : - L"Filesystem(s) are still in use. Do you wish to continue dismounting?", - L"cppcryptfs", MB_YESNO | MB_ICONHAND); + CString strMsg; + strMsg.Format(LocUtils::GetStringFromResources(IDS_IS_STILL_IN_USE), mp); + auto res = ::MessageBox(hWnd, mp ? strMsg : LocUtils::GetStringFromResources(IDS_FS_IS_STILL_IN_USE), L"cppcryptfs", MB_YESNO | MB_ICONHAND); if (res == IDYES) return L""; else From d69ccc51c6b8992e39abe68efa053c8ee89791b3 Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Thu, 5 Feb 2026 11:21:15 +0300 Subject: [PATCH 10/22] simplification --- cppcryptfs/dokan/cryptdokan.cpp | 99 +++++++++++---------------------- 1 file changed, 33 insertions(+), 66 deletions(-) diff --git a/cppcryptfs/dokan/cryptdokan.cpp b/cppcryptfs/dokan/cryptdokan.cpp index 82be6b8..00d7777 100755 --- a/cppcryptfs/dokan/cryptdokan.cpp +++ b/cppcryptfs/dokan/cryptdokan.cpp @@ -2024,8 +2024,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, config_path = NULL; if (mountpoint == NULL) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_INVALID_MPOINT); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_INVALID_MPOINT); return -1; } @@ -2033,11 +2032,9 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (mount_point_is_a_dir && !is_suitable_mountpoint(mountpoint)) { if (!PathFileExists(mountpoint)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_NOT_EXIST); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_NOT_EXIST); } else { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_EMPTY_NTFS); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_EMPTY_NTFS); } return -1; } @@ -2046,8 +2043,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, bool already_mounted = MountPointManager::getInstance().find(mountpoint, dummy); if (already_mounted) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_LETTER_MPOINT_ALREADY_USE); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_LETTER_MPOINT_ALREADY_USE); return -1; } @@ -2065,8 +2061,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, } if (!tdata) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ALLOCATE_TDATA); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ALLOCATE_TDATA); throw(-1); } @@ -2163,8 +2158,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (!config->read(mes, config_path, reverse)) { if (mes.length() < 1) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_LOAD_CONF); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_LOAD_CONF); } throw(-1); } @@ -2192,8 +2186,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, #endif if (!config->decrypt_key(password)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PASS_INCORRECT); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_PASS_INCORRECT); throw(-1); } @@ -2203,8 +2196,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, throw(-1); } } catch (...) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_EME); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_EME); throw(-1); } } @@ -2213,8 +2205,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, try { con->m_siv.SetKey(config->GetMasterKey(), 32, config->m_HKDF, config); } catch (...) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_AESSIV); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_AESSIV); throw(-1); } } @@ -2296,8 +2287,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, && !con->GetConfig()->m_reverse; if (!con->FinalInitBeforeMounting(opts.cachekeysinmemory)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FINAL_INIT_FAILED); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_FINAL_INIT_FAILED); throw(-1); } @@ -2307,8 +2297,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, hThread = CreateThread(NULL, 0, CryptThreadProc, tdata, 0, NULL); if (!hThread) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_CREATE_TREAD); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_CREATE_TREAD); throw(-1); } @@ -2317,8 +2306,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, // MountPointManager owns tdata from this point on, even if it fails to add (will delete it) if (!MountPointManager::getInstance().add(mountpoint, tdata)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_ADD_MPOINT); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_ADD_MPOINT); throw(-1); } @@ -2360,15 +2348,12 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (wait_result != WAIT_OBJECT_0) { if (wait_result == (WAIT_OBJECT_0 + 1)) { // thread exited without mounting - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_FAILED); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_FAILED); } else if (wait_result == WAIT_TIMEOUT) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_TIMED_OUT); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_TIMED_OUT); tdata = NULL; // deleting it would probably cause crash } else { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_ERROR_WAITING); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_ERROR_WAITING); tdata = NULL; // deleting it would probably cause crash } throw(-1); @@ -2390,8 +2375,7 @@ BOOL unmount_crypt_fs(const WCHAR* mountpoint, bool wait, wstring& mes) { wstring mpstr; if (!MountPointManager::getInstance().find(mountpoint, mpstr)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_FIND_MPOINT); - mes += strMsg; + mes += LocUtilsAlt::GetStringFromResources(IDS_UNABLE_FIND_MPOINT); return FALSE; } if (!DokanRemoveMountPoint(mpstr.c_str())) { @@ -2442,8 +2426,7 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { CryptThreadData *tdata = MountPointManager::getInstance().get(fs_root.c_str()); if (!tdata) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NOT_FOUND); - mes += strMsg; + mes += LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NOT_FOUND); return FALSE; } @@ -2452,8 +2435,7 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { CryptContext *con = &tdata->con; if (!con) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NULL); - mes += strMsg; + mes += LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NULL); return FALSE; } @@ -2476,8 +2458,7 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { con->GetConfig()->m_VolumeName = volbuf; bool res = con->GetConfig()->write_updated_config_file(nullptr, nullptr, 0); if (!res) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_WRITE_NEW_VOL_NAME); - mes += strMsg; + mes += LocUtilsAlt::GetStringFromResources(IDS_UNABLE_WRITE_NEW_VOL_NAME); return FALSE; } } @@ -2530,8 +2511,7 @@ wstring transform_path(const wchar_t* path, wstring& mes) _locale_t locale = _create_locale(LC_ALL, ""); if (locale == NULL) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); return nullptr; } @@ -2554,8 +2534,7 @@ wstring transform_path(const wchar_t* path, wstring& mes) _free_locale(locale); if (!tdata) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_NOT_FOUND_MPOINT_BASE_DIR); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_NOT_FOUND_MPOINT_BASE_DIR); return L""; } @@ -2565,14 +2544,12 @@ wstring transform_path(const wchar_t* path, wstring& mes) if (tdata->con.GetConfig()->m_reverse) { if (!encrypt_path(&tdata->con, p, storage)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CONVERT_PATH); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CONVERT_PATH); return L""; } } else { if (!unencrypt_path(&tdata->con, p, storage)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_UNENCRYPT_PATH); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_UNENCRYPT_PATH); return L""; } } @@ -2600,22 +2577,19 @@ BOOL list_files(const WCHAR *path, list &findDatas, err_mes = L""; if (!path) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_NULL); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_NULL); return FALSE; } if (wcslen(path) > MAX_PATH - 1) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_LONG); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_LONG); return FALSE; } WCHAR newpath[MAX_PATH + 1]; if (!PathCanonicalize(newpath, path)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CANONICALIZE_PATH); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CANONICALIZE_PATH); return FALSE; } @@ -2624,20 +2598,17 @@ BOOL list_files(const WCHAR *path, list &findDatas, int dl = *path; if (dl < 'A' || dl > 'Z') { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_INVALID_DRIVE_LETTER); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_INVALID_DRIVE_LETTER); return FALSE; } if (wcslen(path) < 3) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_SHORT); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_SHORT); return FALSE; } if (path[1] != ':' || path[2] != '\\') { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_INVALID_PATH); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_INVALID_PATH); return FALSE; } @@ -2678,8 +2649,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, _free_locale(locale); if (!tdata) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_DRIVE_NOT_MOUNTED); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_DRIVE_NOT_MOUNTED); return FALSE; } @@ -2709,8 +2679,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, if (find_files(con, filePath.CorrectCasePath(), filePath, crypt_fill_find_data_list, NULL, &findDatas) != 0) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_ERROR_LISTING_FILES); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_ERROR_LISTING_FILES); return FALSE; } } else if (PathFileExists(filePath)) { @@ -2737,8 +2706,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, } else { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_PATH_NOT_EXIST); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_NOT_EXIST); return FALSE; } @@ -2800,8 +2768,7 @@ bool check_dokany_version(wstring& mes) vector v; if (!get_dokany_version(ver, v)) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_GET_DOKANY_VERSION); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_GET_DOKANY_VERSION); return false; } From 5431c4f02babf1d74b8ecbdda6bfa5125f26598b Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Fri, 6 Feb 2026 13:09:42 +0300 Subject: [PATCH 11/22] correct, additions --- cppcryptfs/cppcryptfs.rc | Bin 60260 -> 61752 bytes cppcryptfs/cppcryptfs.vcxproj | 1 + cppcryptfs/dokan/cryptdokan.cpp | 5 ++--- cppcryptfs/resource.h | Bin 23398 -> 24186 bytes cppcryptfs/ui/CreatePropertyPage.cpp | 6 ++++-- cppcryptfs/ui/CryptAboutPropertyPage.cpp | 23 ++++++++++---------- cppcryptfs/ui/MountPropertyPage.cpp | 26 +++++++++++------------ cppcryptfs/ui/locutilsalt.cpp | 1 - cppcryptfs/ui/locutilsalt.h | 4 ++-- cppcryptfs/ui/uiutil.cpp | 15 +++++++------ 10 files changed, 42 insertions(+), 39 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 86718da2a13231b31c22e8fe2f38a7b36d9644c2..3b31b26d592569abb05d6009bb2e814fc2f024a2 100644 GIT binary patch delta 874 zcmZ`%Ur1A79Q_St>J*vToT+mgZWxpj1lpr6O@yU3rxN{{|K<{w6TK-Cgos2>%{b8pM?!qO+hG9nJV+_57wcOaID&YHN$#loFw?5-5XW)@8bE=mku6wN!) zuvQ84O0FeL-neMukO7HML6b3w;8X07!XmMpO}sPio_|q7c!4!6K>{^C2T2L;6Q=NO z(T&FmQ%WFrz9YMu+v8r)A<{dZilEa z_N&n$s)mrf<%}I&){JO)ZKPPUczHKb&Ld~}?2=AIQ#MRrFd5pBd{t~4VA3OuAShv8 zdolFO6lJf-IFhOI*y`PxVw;z}c*Ms+`E;Rf%KD^}yY!1j*s*Rg;<~jo%T3xNE5AQv zMOViU0u|h;fxii9Q;}XXG_tmk6 z&9!`(KbGR+whQZvW!9e%hg>2}of{SD6wWMIRf(biv)jwiuMe{Y=eDcSdpNtknK+&- zeE^d>TczhyVg=_MMsVb9uW`CLdU{=RugByI4FRT}sd}LnD* zd(0*aiKXt44#u0UQnMrVYdjk0s}}ymm!HEbF$$C pNp@ofBQ$xC2wZ-0)?Oz@g~_Y;s!qOlfMavkzIoi6cb%?N1pt#$R{sD1 diff --git a/cppcryptfs/cppcryptfs.vcxproj b/cppcryptfs/cppcryptfs.vcxproj index bbca838..4cce077 100755 --- a/cppcryptfs/cppcryptfs.vcxproj +++ b/cppcryptfs/cppcryptfs.vcxproj @@ -266,6 +266,7 @@ false NotUsing + NotUsing diff --git a/cppcryptfs/dokan/cryptdokan.cpp b/cppcryptfs/dokan/cryptdokan.cpp index 00d7777..e555c5b 100755 --- a/cppcryptfs/dokan/cryptdokan.cpp +++ b/cppcryptfs/dokan/cryptdokan.cpp @@ -2272,7 +2272,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (opts.mountmanagerwarn && !have_security_name_privilege()) { if (!mountmanager_continue_mounting()) { - mes = L"operation cancelled by user"; + mes = LocUtilsAlt::GetStringFromResources(IDS_CANCELED_BY_USER); throw(-1); } } @@ -2622,8 +2622,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, _locale_t locale = _create_locale(LC_ALL, ""); if (locale == NULL) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); - err_mes = strMsg; + err_mes = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); return FALSE; } diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index 6e001bd25a7f8d7791c1b6b71f22807a21962081..e911b57c12505fe8aabbe94bd5fc6f446498e398 100755 GIT binary patch delta 880 zcmZWnOH30{6n!Wf3!2Vb` zRb&%vmd&vWE3*Pyrd9kmhS?CVM^jLZAjZQZ*vMKKk|TH&b`TS~$tL4R*v7KpU|eX& zF6~tzgYQC;-bgs0`=mICZZU~Xnrn3aMEjmNgvag4Ei;JUWV$OQQH^%vmK5PB){IbX zTRJ?|%p1gI*>3Tx8phY9GuW|p*j+)aN;;-OCUm(IYHtknXa?&tW$uj`MdGw@g3Bj^<&EX?lBP$lwNGggQzREpP_Y$ ztCnXawuJL)ALn~0$FQOD3fgkynPXF=>xoFh`Jnc|Qu=-Vyy`nj0^c$&-jVICMmE)f zqz~eiYQobq*il{V>Nbv4H*g6JC50I+gS=s5Q**IJyI*@-eJUT;A7$49n;bjNn2%MVyk_1k2MX(BvvJ@|=pJu7)s`m9d`{@ZN|~e8Y`H z6+>7yEhNnQeL3o#InuGfe68}tb&{>nx=7j=7^&988|9hmrc~QAw}avYg_S6%46W_7 z__y7%c%!B1V`jv9HHcw8!n`fFGP$ICEW+g5v(Xr_%2)Boc5vHEU@anGJng_+OrUOuVE4L6Mi9Ho@vm{B^E(xH=x z?FULJ9io#sNG0G<9P&3fIb|$Gf`~Xd`6ewdFW>L;;eqG*{`*$A_*yu-r_)Vl80r>p z^*VoZ$)IQ`o$@Y>CVOVoF^rg(jTv^0Tf8t*21dfMnzos8VMuzW!=@?em>Fkk?x{aA zbG}Q-s?}oMQ=XDdVEcTwX8BN*{U6rl)HTc|#$L&1$4+=`k4vN+>kd6TCa>9?)_iQo z;-?+4yKM2s@mVcNM7hphsZF;Wuu&U__zV<_U3oY^&8(=h;Y2(YX`#b`yv>Pd@kf!7 zXe;u}3%TzmYI|P{*>}h6APgt9F5Q5ZXpnm`+d|Uya@Ox8y!HgIgcwKA%LH?km@PND zuIaE{aX44{Qzc`{i+JJ(c>X^5O{+ihPp0`D#JZ`O+KP4+w$}7;nijw2&&`h3)*fh& wwC8*Yn&lO(b)}Sh@+dAW@iCa=P$vDgh2ag1YRbb!bz!x^(PGp;tq$-02VXdlSO5S3 diff --git a/cppcryptfs/ui/CreatePropertyPage.cpp b/cppcryptfs/ui/CreatePropertyPage.cpp index 7154736..6a1ef6d 100755 --- a/cppcryptfs/ui/CreatePropertyPage.cpp +++ b/cppcryptfs/ui/CreatePropertyPage.cpp @@ -43,9 +43,11 @@ THE SOFTWARE. #include "util/util.h" #include "locutils.h" +static const CString strMsgPlainText = LocUtils::GetStringFromResources(IDS_PLAIN_TEXT); + static const WCHAR *filename_encryption_types[] = { L"AES256-EME", - L"Plain text" + strMsgPlainText }; #define NUM_FN_ENC_TYPES (sizeof(filename_encryption_types)/sizeof(filename_encryption_types[0])) @@ -203,7 +205,7 @@ void CCreatePropertyPage::CreateCryptfs() if (cfenc == L"AES256-EME") eme = true; - else if (cfenc == "Plain text") + else if (cfenc == strMsgPlainText) plaintext = true; if (!plaintext) { diff --git a/cppcryptfs/ui/CryptAboutPropertyPage.cpp b/cppcryptfs/ui/CryptAboutPropertyPage.cpp index 0f2588c..28a149a 100755 --- a/cppcryptfs/ui/CryptAboutPropertyPage.cpp +++ b/cppcryptfs/ui/CryptAboutPropertyPage.cpp @@ -181,7 +181,7 @@ BOOL CCryptAboutPropertyPage::OnInitDialog() wstring openssl_ver_w; if (!utf8_to_unicode(openssl_ver_s.c_str(), openssl_ver_w)) - openssl_ver_w = L"error getting openssl version"; + openssl_ver_w = LocUtils::GetStringFromResources(IDS_ERR_GET_OPENSSL_VERSION); CString openssl_ver = openssl_ver_w.c_str(); @@ -189,29 +189,28 @@ BOOL CCryptAboutPropertyPage::OnInitDialog() std::wstring dok_ver; CString dokany_version; if (get_dokany_version(dok_ver, dv)) { - dokany_version.Format(LocUtils::GetStringFromResources(IDS_DOKANY_VERSION), dok_ver.c_str()); + dokany_version = dok_ver.c_str(); } - wstring aes_ni; + CString aes_ni; if (AES::use_aes_ni()) { aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_DETECTED); } else { aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_NOT_DETECTED); } - CString strMsgOpenSSLVersion; - strMsgOpenSSLVersion.Format(LocUtils::GetStringFromResources(IDS_OPENSSL_VERSION), openssl_ver); - SetDlgItemText(IDC_LINKAGES, strMsgOpenSSLVersion + dokany_version); + CString strMsgLibraryVersions; + strMsgLibraryVersions.Format(LocUtils::GetStringFromResources(IDS_LIBRARY_VERSIONS), openssl_ver, dokany_version); + SetDlgItemText(IDC_LINKAGES, strMsgLibraryVersions); bool is_admin = theApp.IsRunningAsAdministrator(); - CString prod_ver = prod.c_str(); - prod_ver += L" "; - prod_ver += ver.c_str(); - prod_ver += sizeof(void*) == 8 ? LocUtils::GetStringFromResources(IDS_64BIT) : LocUtils::GetStringFromResources(IDS_32BIT); - prod_ver += (is_admin ? LocUtils::GetStringFromResources(IDS_ADMIN) : L""); + int prod_bit_depth = sizeof(void*) == 8 ? 64 : 32; + CString prod_admin = (is_admin ? L" " + LocUtils::GetStringFromResources(IDS_ADMIN) : L""); + CString strMsgCopyright; + strMsgCopyright.Format(LocUtils::GetStringFromResources(IDS_ABOUT_COPYRIGHT), ver.c_str(), prod_bit_depth, prod_admin, aes_ni); - SetDlgItemText(IDC_PROD_VERSION, prod_ver + CString(aes_ni.c_str())); + SetDlgItemText(IDC_PROD_VERSION, strMsgCopyright); SetDlgItemText(IDC_COPYRIGHT, copyright.c_str()); CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_COMPONENTS_LIST); diff --git a/cppcryptfs/ui/MountPropertyPage.cpp b/cppcryptfs/ui/MountPropertyPage.cpp index 4764a5e..48ef1f8 100644 --- a/cppcryptfs/ui/MountPropertyPage.cpp +++ b/cppcryptfs/ui/MountPropertyPage.cpp @@ -154,7 +154,7 @@ void CMountPropertyPage::DefaultAction() { CString mes = Mount(); - if (mes.GetLength() > 0 && mes != L"password cannot be empty") + if (mes.GetLength() > 0 && mes != LocUtils::GetStringFromResources(IDS_PASS_CANNOT_BE_EMPTY)) MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); } @@ -183,12 +183,12 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); if (!pList) - return CString(L"unable to get list control"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST); pos = pList->GetFirstSelectedItemPosition(); if (!pos) - return CString(L"unable to get selected entry"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SELECTED); int nItem = -1; @@ -222,14 +222,14 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST } if (nItem < 0) - return CString(L"unable to find item"); + return LocUtils::GetStringFromResources(IDS_UNABLE_FIND_ITEM); CString cmp = argMountPoint && wcslen(argMountPoint) > 0 ? (wcslen(argMountPoint) == 1 ? CString(*argMountPoint) + L":" : argMountPoint) : pList->GetItemText(nItem, DL_INDEX); if (cmp.GetLength() < 1) - return CString(L"unable to get drive letter"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LETTER); BOOL dlInUse = is_mountpoint_a_drive(cmp) && !IsDriveLetterAvailable(*(LPCWSTR)cmp); @@ -247,7 +247,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST CWnd *pWnd = GetDlgItem(IDC_PATH); if (!pWnd) - return CString(L"unable to get window"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_WINDOW); CString cpath; @@ -267,7 +267,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST } else { pWnd = GetDlgItem(IDC_CONFIG_PATH); if (!pWnd) - return CString(L"unable to get window for config path"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_CONF_WINDOW); pWnd->GetWindowTextW(config_path); } @@ -750,7 +750,7 @@ void CMountPropertyPage::OnClickedMount() void CMountPropertyPage::OnClickedDismount() { CString mes = Dismount(nullptr, true, false); - if (mes.GetLength() > 0 && mes != L"operation cancelled by user") + if (mes.GetLength() > 0 && mes != LocUtils::GetStringFromResources(IDS_CANCELED_BY_USER)) MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); } @@ -760,12 +760,12 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); if (!pList) - return CString(L"unable to get list"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST); POSITION pos = pList->GetFirstSelectedItemPosition(); if (!pos) - return CString(L"unable to get selection"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SELECTED); int nItem; @@ -786,12 +786,12 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo } if (nItem < 0) - return CString(L"unable to find item"); + return LocUtils::GetStringFromResources(IDS_UNABLE_FIND_ITEM); CString cmp = pList->GetItemText(nItem, DL_INDEX); if (cmp.GetLength() < 1) - return CString(L"unable to get drive letter"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LETTER); CString cpath = pList->GetItemText(nItem, PATH_INDEX); @@ -856,7 +856,7 @@ CString CMountPropertyPage::DismountAll(bool interactive, bool forceDismount) CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); if (!pList) - return CString(L"unable to get list"); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST); int count = pList->GetItemCount(); diff --git a/cppcryptfs/ui/locutilsalt.cpp b/cppcryptfs/ui/locutilsalt.cpp index 5416e13..72a30ad 100644 --- a/cppcryptfs/ui/locutilsalt.cpp +++ b/cppcryptfs/ui/locutilsalt.cpp @@ -8,4 +8,3 @@ CString LocUtilsAlt::GetStringFromResources(UINT nID) { } return str; } - diff --git a/cppcryptfs/ui/locutilsalt.h b/cppcryptfs/ui/locutilsalt.h index 05deeaf..5a9f5ff 100644 --- a/cppcryptfs/ui/locutilsalt.h +++ b/cppcryptfs/ui/locutilsalt.h @@ -4,6 +4,6 @@ class LocUtilsAlt { public: - static CString GetStringFromResources(UINT nID); + // Èñïîëüçóåì ÿâíîå óêàçàíèå ïðîñòðàíñòâà èìåí + static ATL::CString GetStringFromResources(UINT nID); }; - diff --git a/cppcryptfs/ui/uiutil.cpp b/cppcryptfs/ui/uiutil.cpp index 8ca2015..8221329 100644 --- a/cppcryptfs/ui/uiutil.cpp +++ b/cppcryptfs/ui/uiutil.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "stdafx.h" #include "uiutil.h" -#include + #include #include "ui/MountMangerDialog.h" @@ -36,6 +36,7 @@ THE SOFTWARE. #include "ui/certutil.h" #include "ui/CryptSettings.h" #include "dokan/cryptdokan.h" +#include "resource.h" #include "locutils.h" using namespace std; @@ -57,7 +58,7 @@ bool DeleteAllRegisteryValues(LPCWSTR regPath, wstring& mes) LSTATUS status = ::RegOpenKeyEx(HKEY_CURRENT_USER, regPath, 0, KEY_ALL_ACCESS, &hkey); if (status != ERROR_SUCCESS) { if (status != ERROR_FILE_NOT_FOUND) { - mes = L"unable to open history"; + mes = LocUtils::GetStringFromResources(IDS_UNABLE_OPEN_HISTORY); } return false; } @@ -74,7 +75,7 @@ bool DeleteAllRegisteryValues(LPCWSTR regPath, wstring& mes) if (status != ERROR_NO_MORE_ITEMS) { ::RegCloseKey(hkey); - mes = L"error while deleting history"; + mes = LocUtils::GetStringFromResources(IDS_ERR_DELETING_HISTORY); return false; } @@ -82,7 +83,7 @@ bool DeleteAllRegisteryValues(LPCWSTR regPath, wstring& mes) status = RegDeleteValue(hkey, it.c_str()); if (status != ERROR_SUCCESS) { ::RegCloseKey(hkey); - mes = L"error while deleting registry value"; + mes = LocUtils::GetStringFromResources(IDS_ERR_DELETING_REG_VALUE); return false; } } @@ -124,8 +125,10 @@ wstring CheckOpenHandles(HWND hWnd, const wchar_t* mp, bool interactive, bool fo auto res = ::MessageBox(hWnd, mp ? strMsg : LocUtils::GetStringFromResources(IDS_FS_IS_STILL_IN_USE), L"cppcryptfs", MB_YESNO | MB_ICONHAND); if (res == IDYES) return L""; - else - return L"operation cancelled by user"; + else { + CString strMsgCanceledByUser = LocUtils::GetStringFromResources(IDS_CANCELED_BY_USER); + return strMsgCanceledByUser.GetString(); + } } else { return mp ? wstring(mp) + L" is still in use. Use --force to force dismounting." : From 31a6dc503965f9c73042c8bd3ee978fdc40d9ef3 Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Fri, 6 Feb 2026 17:23:59 +0300 Subject: [PATCH 12/22] minor edits --- cppcryptfs/cppcryptfs.rc | Bin 61752 -> 61768 bytes cppcryptfs/dokan/cryptdokan.cpp | 3 +-- cppcryptfs/ui/FolderDialog.cpp | 2 +- cppcryptfs/ui/FolderDialog.h | 1 + cppcryptfs/ui/locutilsalt.h | 1 - 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 3b31b26d592569abb05d6009bb2e814fc2f024a2..1d6167be8ad86a2ba19397a1a606f1d137e77f67 100644 GIT binary patch delta 74 zcmdn-i21}L<_#s>tojW43`!FVg(r7#uVDsqChzBxoP3U*V{-`4fkz;LiG`w*>zMc^ Uo4qeUa5*N2@Ca?b@;-$T0I_fx6#xJL delta 63 zcmX@{hlMir-Ozz=c1EeJ;pJV6P9K&(enc); if (!pconv) { - CString strMsg = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ENCRYPT_PATH); - mes = strMsg; + mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ENCRYPT_PATH); return L""; } return pconv + std::size(L"\\\\?\\") - 1; diff --git a/cppcryptfs/ui/FolderDialog.cpp b/cppcryptfs/ui/FolderDialog.cpp index 1579f82..f8521de 100755 --- a/cppcryptfs/ui/FolderDialog.cpp +++ b/cppcryptfs/ui/FolderDialog.cpp @@ -5,9 +5,9 @@ // from http://www.codeguru.com/cpp/w-d/dislog/dialogforselectingfolders/article.php/c1941/MFC-Wrapper-for-SHBrowseForFolder.htm #include "stdafx.h" -#include "cppcryptfs.h" #include "FolderDialog.h" #include "locutils.h" +#include "resource.h" #ifdef _DEBUG #undef THIS_FILE diff --git a/cppcryptfs/ui/FolderDialog.h b/cppcryptfs/ui/FolderDialog.h index c895dc0..2daff61 100755 --- a/cppcryptfs/ui/FolderDialog.h +++ b/cppcryptfs/ui/FolderDialog.h @@ -9,6 +9,7 @@ #define _CFolderDialog_ #include +#include class CFolderDialog { diff --git a/cppcryptfs/ui/locutilsalt.h b/cppcryptfs/ui/locutilsalt.h index 5a9f5ff..8e4f07f 100644 --- a/cppcryptfs/ui/locutilsalt.h +++ b/cppcryptfs/ui/locutilsalt.h @@ -4,6 +4,5 @@ class LocUtilsAlt { public: - // Èñïîëüçóåì ÿâíîå óêàçàíèå ïðîñòðàíñòâà èìåí static ATL::CString GetStringFromResources(UINT nID); }; From 58f73871371dd8937e82f9ac47bc268c203df36a Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Fri, 6 Feb 2026 21:23:14 +0300 Subject: [PATCH 13/22] debugging --- cppcryptfs/cppcryptfs.rc | Bin 61768 -> 61752 bytes cppcryptfs/ui/locutils.cpp | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 1d6167be8ad86a2ba19397a1a606f1d137e77f67..3b31b26d592569abb05d6009bb2e814fc2f024a2 100644 GIT binary patch delta 63 zcmX@{hlMir-Ozz=c1EeJ;pJV6P9K&tojW43`!FVg(r7#uVDsqChzBxoP3U*V{-`4fkz;LiG`w*>zMc^ Uo4qeUa5*N2@Ca?b@;-$T0I_fx6#xJL diff --git a/cppcryptfs/ui/locutils.cpp b/cppcryptfs/ui/locutils.cpp index 16bdb05..5f5a9dd 100644 --- a/cppcryptfs/ui/locutils.cpp +++ b/cppcryptfs/ui/locutils.cpp @@ -3,7 +3,8 @@ CString LocUtils::GetStringFromResources(UINT nID) { CString str; - if (!str.LoadString(AfxGetResourceHandle(), nID)) { + static HINSTANCE hExe = GetModuleHandle(NULL); + if (hExe == NULL || !str.LoadString(hExe, nID)) { return _T("Error: String not found"); } return str; From 49664bd708f8854ab8423518c1779baefe2d7bec Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Sun, 8 Feb 2026 10:10:43 +0300 Subject: [PATCH 14/22] renaming --- cppcryptfs/cppcryptfs.cpp | 5 +++-- cppcryptfs/cppcryptfs.rc | Bin 61752 -> 61816 bytes cppcryptfs/cppcryptfs.vcxproj | 16 ++++++++-------- .../res/lic/{en_aessiv.txt => en/aessiv.txt} | Bin .../{en_cppcryptfs.txt => en/cppcryptfs.txt} | Bin .../{en_dokany_lib.txt => en/dokany_lib.txt} | Bin .../{en_dokany_mir.txt => en/dokany_mir.txt} | Bin .../res/lic/{en_getopt.txt => en/getopt.txt} | Bin .../lic/{en_openssl.txt => en/openssl.txt} | Bin .../{en_rapidjson.txt => en/rapidjson.txt} | Bin .../secure_edit.txt} | Bin cppcryptfs/resource.h | Bin 24186 -> 24196 bytes cppcryptfs/ui/uiutil.cpp | 2 +- 13 files changed, 12 insertions(+), 11 deletions(-) rename cppcryptfs/res/lic/{en_aessiv.txt => en/aessiv.txt} (100%) rename cppcryptfs/res/lic/{en_cppcryptfs.txt => en/cppcryptfs.txt} (100%) rename cppcryptfs/res/lic/{en_dokany_lib.txt => en/dokany_lib.txt} (100%) rename cppcryptfs/res/lic/{en_dokany_mir.txt => en/dokany_mir.txt} (100%) rename cppcryptfs/res/lic/{en_getopt.txt => en/getopt.txt} (100%) rename cppcryptfs/res/lic/{en_openssl.txt => en/openssl.txt} (100%) rename cppcryptfs/res/lic/{en_rapidjson.txt => en/rapidjson.txt} (100%) rename cppcryptfs/res/lic/{en_secure_edit.txt => en/secure_edit.txt} (100%) diff --git a/cppcryptfs/cppcryptfs.cpp b/cppcryptfs/cppcryptfs.cpp index b5cd4f2..3abed4e 100755 --- a/cppcryptfs/cppcryptfs.cpp +++ b/cppcryptfs/cppcryptfs.cpp @@ -53,6 +53,7 @@ THE SOFTWARE. #include "ui/uiutil.h" #include "../libipc/server.h" #include "../libipc/client.h" +#include "ui/locutils.h" #ifdef _DEBUG @@ -186,7 +187,7 @@ BOOL CcppcryptfsApp::InitInstance() ShowWindow(hWnd, SW_SHOWNORMAL); } } else { - ::MessageBox(NULL, L"cppcryptfs is already running, but window not found!", L"cppcryptfs", MB_OK | MB_ICONERROR); + ::MessageBox(NULL, LocUtils::GetStringFromResources(IDS_RUN_WINDOW_NOT_FOUND), L"cppcryptfs", MB_OK | MB_ICONERROR); } return FALSE; @@ -194,7 +195,7 @@ BOOL CcppcryptfsApp::InitInstance() wstring mes; bool dokVerCheck = check_dokany_version(mes); if (!dokVerCheck && mes.length() < 1) { - mes = L"problem with Dokany version"; + mes = LocUtils::GetStringFromResources(IDS_PROBLEM_DOKANY_VERSION); } if (mes.length()) { ::MessageBox(NULL, mes.c_str(), L"cppcryptfs", MB_OK | (dokVerCheck ? MB_ICONEXCLAMATION : MB_ICONERROR)); diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 3b31b26d592569abb05d6009bb2e814fc2f024a2..fd782a448da59301b9a3e16913de9b5b42f832fc 100644 GIT binary patch delta 230 zcmdn-i227O<_&RAg@YJE8T=UH8NwMnfwT*QKSTKBiMK>2pSvzGc|i!*%(g6%bK$S@hISi=`xlr9D3>iR{%jEipijzG!_$CK*vP`af7Bjhl vUuyEFXF1F<3^9}ApVxxvyU!aT{1?q&`Z1JFf7uG=zkOK^qBm#0I?o0G{TECi delta 199 zcmezIh3kQJ!>1WU|#$uE{TM z>PdqIfzp0J=@1|t#^A`{!{Eu_!Vo|C;&buI2PO+l-Vw>8oyL&Kki(G5pa7(cfn**- zK0^tRE@Mapif1yU0NGv)!5~W}J93Cl4(Mc=yzW^HWBlZYT;h{ep638rlb_cDN#Pfb eKyvzvW*{m15=1V3*$O1JUsW^4Z(jN8JR1N8(Lsm+ diff --git a/cppcryptfs/cppcryptfs.vcxproj b/cppcryptfs/cppcryptfs.vcxproj index 4cce077..27be5fa 100755 --- a/cppcryptfs/cppcryptfs.vcxproj +++ b/cppcryptfs/cppcryptfs.vcxproj @@ -325,14 +325,14 @@ - - - - - - - - + + + + + + + + diff --git a/cppcryptfs/res/lic/en_aessiv.txt b/cppcryptfs/res/lic/en/aessiv.txt similarity index 100% rename from cppcryptfs/res/lic/en_aessiv.txt rename to cppcryptfs/res/lic/en/aessiv.txt diff --git a/cppcryptfs/res/lic/en_cppcryptfs.txt b/cppcryptfs/res/lic/en/cppcryptfs.txt similarity index 100% rename from cppcryptfs/res/lic/en_cppcryptfs.txt rename to cppcryptfs/res/lic/en/cppcryptfs.txt diff --git a/cppcryptfs/res/lic/en_dokany_lib.txt b/cppcryptfs/res/lic/en/dokany_lib.txt similarity index 100% rename from cppcryptfs/res/lic/en_dokany_lib.txt rename to cppcryptfs/res/lic/en/dokany_lib.txt diff --git a/cppcryptfs/res/lic/en_dokany_mir.txt b/cppcryptfs/res/lic/en/dokany_mir.txt similarity index 100% rename from cppcryptfs/res/lic/en_dokany_mir.txt rename to cppcryptfs/res/lic/en/dokany_mir.txt diff --git a/cppcryptfs/res/lic/en_getopt.txt b/cppcryptfs/res/lic/en/getopt.txt similarity index 100% rename from cppcryptfs/res/lic/en_getopt.txt rename to cppcryptfs/res/lic/en/getopt.txt diff --git a/cppcryptfs/res/lic/en_openssl.txt b/cppcryptfs/res/lic/en/openssl.txt similarity index 100% rename from cppcryptfs/res/lic/en_openssl.txt rename to cppcryptfs/res/lic/en/openssl.txt diff --git a/cppcryptfs/res/lic/en_rapidjson.txt b/cppcryptfs/res/lic/en/rapidjson.txt similarity index 100% rename from cppcryptfs/res/lic/en_rapidjson.txt rename to cppcryptfs/res/lic/en/rapidjson.txt diff --git a/cppcryptfs/res/lic/en_secure_edit.txt b/cppcryptfs/res/lic/en/secure_edit.txt similarity index 100% rename from cppcryptfs/res/lic/en_secure_edit.txt rename to cppcryptfs/res/lic/en/secure_edit.txt diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index e911b57c12505fe8aabbe94bd5fc6f446498e398..5358e7705a3cd2feed624381716e02c48b18e3be 100755 GIT binary patch delta 100 zcmeyhhp}ZZfoz7+e|r7~&b68T^5?8v`d8noV{zlbsyE$)*hvjR(s4 nGlT%ug)ulX_%L`fxB%H+48dSsFg^Y9vXc)Oifpbj #include "ui/MountMangerDialog.h" From 305b75d5976e010710c33e2e0696b10a0a8749c0 Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Tue, 10 Feb 2026 11:24:51 +0300 Subject: [PATCH 15/22] lic --- cppcryptfs/res/lic/en/cppcryptfs.txt | Bin 3390 -> 3388 bytes cppcryptfs/res/lic/en/dokany_mir.txt | Bin 2904 -> 2898 bytes cppcryptfs/res/lic/en/openssl.txt | Bin 11384 -> 11360 bytes cppcryptfs/res/lic/en/rapidjson.txt | Bin 10124 -> 10104 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/cppcryptfs/res/lic/en/cppcryptfs.txt b/cppcryptfs/res/lic/en/cppcryptfs.txt index fd6c77c6c1cb8e906ab28765324112bdc7abd15f..eb73b9191c34f83b9aa06e19b275a969fdfe5e30 100644 GIT binary patch delta 14 WcmdldwMS~hJPt;M%?ml^vH$=ofCVD} delta 16 YcmdlZwNGlpJPu}F2CmKXIp(qe05En18UO$Q diff --git a/cppcryptfs/res/lic/en/dokany_mir.txt b/cppcryptfs/res/lic/en/dokany_mir.txt index e9de6fcc446dfb9681f0a7955af6cf1ed2a679bd..926ceb2a4d884bcd96ec0508633fa1fc89228431 100644 GIT binary patch delta 14 Wcmca1c1di*7B)tO&AZv=vH$=rtOa)f delta 20 acmca4c0+8#7B+TX1}+95-n^AIlpMv$6_K0kixI FWFR!278L*h diff --git a/cppcryptfs/res/lic/en/rapidjson.txt b/cppcryptfs/res/lic/en/rapidjson.txt index 4da1cc289c9a4d6be4906894c0038749cb446b1b..0e3b8e5d8360275270fe1579d1a7f167305b21d8 100644 GIT binary patch delta 40 tcmeD2|KYd6jC-;TkILpa?mK*p3Y#6J7#TOaNiSjtv)LIpuaTa{3;+|a3{U_7 delta 64 zcmez2*WYHw!-}F9R0?2!~9b$Zb4XK=~45#$-cL@ySc1gf^#0m$9QN*esx& G!2$pfoexC- From 94ad2fa34fddfd81b42cb912b892e00ec4174b4c Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Wed, 11 Feb 2026 20:40:37 +0300 Subject: [PATCH 16/22] refactoring2 --- cppcryptfs/cppcryptfs.cpp | 2 +- cppcryptfs/cppcryptfs.rc | Bin 61816 -> 69782 bytes cppcryptfs/cppcryptfs.vcxproj | 5 +- cppcryptfs/dokan/cryptdokan.cpp | 94 ++++++++-------- cppcryptfs/resource.h | Bin 24196 -> 25874 bytes cppcryptfs/ui/CreatePropertyPage.cpp | 26 ++--- cppcryptfs/ui/CryptAboutPropertyPage.cpp | 26 ++--- cppcryptfs/ui/CryptPropertySheet.cpp | 2 +- cppcryptfs/ui/FolderDialog.cpp | 5 +- cppcryptfs/ui/FolderDialog.h | 2 + cppcryptfs/ui/FsInfoDialog.cpp | 18 ++-- cppcryptfs/ui/MountPropertyPage.cpp | 86 +++++++-------- cppcryptfs/ui/SettingsPropertyPage.cpp | 44 ++++---- cppcryptfs/ui/locutils.cpp | 14 +-- cppcryptfs/ui/locutils.h | 4 +- cppcryptfs/ui/locutilsalt.cpp | 10 -- cppcryptfs/ui/locutilsalt.h | 8 -- cppcryptfs/ui/uiutil.cpp | 8 +- libcppcryptfs/config/cryptconfig.cpp | 114 +++++++++++--------- libcppcryptfs/libcppcryptfs.vcxproj | 5 + libcppcryptfs/libcppcryptfs.vcxproj.filters | 2 + 21 files changed, 237 insertions(+), 238 deletions(-) delete mode 100644 cppcryptfs/ui/locutilsalt.cpp delete mode 100644 cppcryptfs/ui/locutilsalt.h diff --git a/cppcryptfs/cppcryptfs.cpp b/cppcryptfs/cppcryptfs.cpp index 3abed4e..7085367 100755 --- a/cppcryptfs/cppcryptfs.cpp +++ b/cppcryptfs/cppcryptfs.cpp @@ -187,7 +187,7 @@ BOOL CcppcryptfsApp::InitInstance() ShowWindow(hWnd, SW_SHOWNORMAL); } } else { - ::MessageBox(NULL, LocUtils::GetStringFromResources(IDS_RUN_WINDOW_NOT_FOUND), L"cppcryptfs", MB_OK | MB_ICONERROR); + ::MessageBox(NULL, LocUtils::GetStringFromResources(IDS_RUN_WINDOW_NOT_FOUND).c_str(), L"cppcryptfs", MB_OK | MB_ICONERROR); } return FALSE; diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index fd782a448da59301b9a3e16913de9b5b42f832fc..e465518b1f598b24114f2a7235b108910e087adb 100644 GIT binary patch delta 4417 zcmb_gTWp(W8U9M#&UhiQYdgkxk?jP_wOB~qF$xtEO_xJMPHs+Jq>7|zoUU8yoRd|8 zHMxVkq;C>U+BBsgrcAVus30LO#<+lsB2~0(&@N@|5FHZ&(Ow`SBqW~a`~201xD^-Z zm;L8Ie9wD&-sgLrfBmU!?V@9I=E>dls$SJBPkQA$PhKj+h5W)5lxt5ouk@B5{Xo_~ za#wb$F4e0B)$=%as%BZf=9ho3d`^b;?UBE3l*gu2TAfrQDxyxQag|Y{>Wn&#t6|(f zg(tIWTBXIa?cE*0lW94)S}Uo`PH|t~Kjxpyn+)y`s7FWm0J`G{(jV}DG*?FxB! zz)?*%$FNE}l|>=WFx?l=N^rLc_wOrlnV9iON*wa@0oP{=*6Cp2W9SINXi=^3v{Qe# zHu!c9tIq;u8i&m&&WzR4Eqnx?^#JwD>PtXq#9t&e z&w~oq2`U17+$ezd^ZB$Nak^Uj(~N>UKam+4{*BSYf7{22%;b|o93~; z1J@ii@ahzDeNIgvBVFL&OWGc@Qz9nZEoe3Q=dG}fvG#E>_UOv=%Hri9V?6k{81p@f zz(3ZA{@9!z{?P3&8MiE62+6{Sd&7kY;{{RWp*&&g+%D&TnBY2(sb)JeK)%^Gvyvg1 z)hh2GvfYGO@>OASJN#AC3Dg8zp~7w;i*48M=mQz3u$ zxy!6ySQT%^3U(*^wNLxjs5#pJ)oI854$ZqZnYnfE0fRLMi&L5>v#?O;%l~5AsySDm zF&!rte-o0g-Kp?W6R7~5u-RdtHcA4Ht1uS_Ge2 z*qXq7){2%EKkb#siW7S+Gix*4BmY@Tiu)ah*W5LEB?33{>ucVo2#{zm4NTroX@-$q z#C-+dHiy|&+Ims0to3*cRFjI?uafZgD~QkTDLp`@rnZ9Zt&;pzsIur?d2r3^*--_H z9HU;?{IT*K$dl3i?@n&h2Oe@$GO+&irVPRZr>&!y%!7Dpf2-3u?l9}`P;)CSHIoYT5ghb%WmlP$1K_D`W3Ihle6J2~vTGP?j$b7*##p1pYL>H+wJOK<`8m?c(zdUf zi1WHbIG30ill?qOtCm-oJWM6YrEbk!?g6dHLZ@ushTuWt~n{PpC9r>8dig{@Wx(Gr}n~5 zjp!rcth})PSx-h|*%^^uu;YhbuaZMIT)TBI$=3CT=OSSEDP1X}=VTCjImaPewK;e( zhF+l3lJn38*?Nb5RAuoluEk;dDgRDH=)yz$y|>*Z`5aw~VFJy-8#@=VD|fKk;uOtx z)Uchi-Tt+zXyMFbEZAPxePR)dCaFS1J4w;Y$01s7XZ1CfQ*)yk2h_8eFge@yg8^AB zlI7Pz{u*=uRmHqfXWpU8MRWQy4?fL+7ZGqT{ZQ}II)ccGtCH5pFESk(M~#r5+E((sCt_c>d8S^u6RTG&mcGxqQ6gjuo@KL}x*<4TCg_pT9QDw8_0JTLIncpKMgrvSZBL#~PNL@rZWeYQ%e7 zi0m_ej^Qx<^XE8Gb|_lGZf4Jfow;iQB7dV7gKct tRBmwkCG}m$l^=clma`212U(u<%d4NNkhyou delta 67 zcmbQXkmbiC<_#s>lMir-Ozz=c1EeJ;pJV6P9K+*rYqAFi-}VEnjH@^%w^fQvu4Cex SK7o(10LtOmuE5V&#s~nDBp6)) diff --git a/cppcryptfs/cppcryptfs.vcxproj b/cppcryptfs/cppcryptfs.vcxproj index 27be5fa..96bcf5a 100755 --- a/cppcryptfs/cppcryptfs.vcxproj +++ b/cppcryptfs/cppcryptfs.vcxproj @@ -228,7 +228,6 @@ - @@ -262,9 +261,7 @@ - - - false + NotUsing NotUsing diff --git a/cppcryptfs/dokan/cryptdokan.cpp b/cppcryptfs/dokan/cryptdokan.cpp index 28a31f4..7c0653e 100755 --- a/cppcryptfs/dokan/cryptdokan.cpp +++ b/cppcryptfs/dokan/cryptdokan.cpp @@ -99,7 +99,8 @@ THE SOFTWARE. #include "../libcommonutil/commonutil.h" #include "resource.h" -#include "ui/locutilsalt.h" +#include "ui/locutils.h" +#include static DWORD g_SessionId; static BOOL g_GotSessionId = FALSE; @@ -2024,7 +2025,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, config_path = NULL; if (mountpoint == NULL) { - mes = LocUtilsAlt::GetStringFromResources(IDS_INVALID_MPOINT); + mes = LocUtils::GetStringFromResources(IDS_INVALID_MPOINT); return -1; } @@ -2032,9 +2033,9 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (mount_point_is_a_dir && !is_suitable_mountpoint(mountpoint)) { if (!PathFileExists(mountpoint)) { - mes = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_NOT_EXIST); + mes = LocUtils::GetStringFromResources(IDS_MPOINT_DIR_NOT_EXIST); } else { - mes = LocUtilsAlt::GetStringFromResources(IDS_MPOINT_DIR_EMPTY_NTFS); + mes = LocUtils::GetStringFromResources(IDS_MPOINT_DIR_EMPTY_NTFS); } return -1; } @@ -2043,7 +2044,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, bool already_mounted = MountPointManager::getInstance().find(mountpoint, dummy); if (already_mounted) { - mes = LocUtilsAlt::GetStringFromResources(IDS_LETTER_MPOINT_ALREADY_USE); + mes = LocUtils::GetStringFromResources(IDS_LETTER_MPOINT_ALREADY_USE); return -1; } @@ -2061,7 +2062,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, } if (!tdata) { - mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ALLOCATE_TDATA); + mes = LocUtils::GetStringFromResources(IDS_FAILED_ALLOCATE_TDATA); throw(-1); } @@ -2158,7 +2159,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (!config->read(mes, config_path, reverse)) { if (mes.length() < 1) { - mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_LOAD_CONF); + mes = LocUtils::GetStringFromResources(IDS_UNABLE_LOAD_CONF); } throw(-1); } @@ -2186,7 +2187,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, #endif if (!config->decrypt_key(password)) { - mes = LocUtilsAlt::GetStringFromResources(IDS_PASS_INCORRECT); + mes = LocUtils::GetStringFromResources(IDS_PASS_INCORRECT); throw(-1); } @@ -2196,7 +2197,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, throw(-1); } } catch (...) { - mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_EME); + mes = LocUtils::GetStringFromResources(IDS_UNABLE_INIT_EME); throw(-1); } } @@ -2205,7 +2206,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, try { con->m_siv.SetKey(config->GetMasterKey(), 32, config->m_HKDF, config); } catch (...) { - mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_AESSIV); + mes = LocUtils::GetStringFromResources(IDS_UNABLE_INIT_AESSIV); throw(-1); } } @@ -2272,7 +2273,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (opts.mountmanagerwarn && !have_security_name_privilege()) { if (!mountmanager_continue_mounting()) { - mes = LocUtilsAlt::GetStringFromResources(IDS_CANCELED_BY_USER); + mes = LocUtils::GetStringFromResources(IDS_CANCELED_BY_USER); throw(-1); } } @@ -2287,7 +2288,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, && !con->GetConfig()->m_reverse; if (!con->FinalInitBeforeMounting(opts.cachekeysinmemory)) { - mes = LocUtilsAlt::GetStringFromResources(IDS_FINAL_INIT_FAILED); + mes = LocUtils::GetStringFromResources(IDS_FINAL_INIT_FAILED); throw(-1); } @@ -2297,7 +2298,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, hThread = CreateThread(NULL, 0, CryptThreadProc, tdata, 0, NULL); if (!hThread) { - mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_CREATE_TREAD); + mes = LocUtils::GetStringFromResources(IDS_UNABLE_CREATE_TREAD); throw(-1); } @@ -2306,7 +2307,7 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, // MountPointManager owns tdata from this point on, even if it fails to add (will delete it) if (!MountPointManager::getInstance().add(mountpoint, tdata)) { - mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_ADD_MPOINT); + mes = LocUtils::GetStringFromResources(IDS_UNABLE_ADD_MPOINT); throw(-1); } @@ -2348,12 +2349,12 @@ int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path, if (wait_result != WAIT_OBJECT_0) { if (wait_result == (WAIT_OBJECT_0 + 1)) { // thread exited without mounting - mes = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_FAILED); + mes = LocUtils::GetStringFromResources(IDS_MOUNT_FAILED); } else if (wait_result == WAIT_TIMEOUT) { - mes = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_TIMED_OUT); + mes = LocUtils::GetStringFromResources(IDS_MOUNT_TIMED_OUT); tdata = NULL; // deleting it would probably cause crash } else { - mes = LocUtilsAlt::GetStringFromResources(IDS_MOUNT_ERROR_WAITING); + mes = LocUtils::GetStringFromResources(IDS_MOUNT_ERROR_WAITING); tdata = NULL; // deleting it would probably cause crash } throw(-1); @@ -2375,7 +2376,7 @@ BOOL unmount_crypt_fs(const WCHAR* mountpoint, bool wait, wstring& mes) { wstring mpstr; if (!MountPointManager::getInstance().find(mountpoint, mpstr)) { - mes += LocUtilsAlt::GetStringFromResources(IDS_UNABLE_FIND_MPOINT); + mes += LocUtils::GetStringFromResources(IDS_UNABLE_FIND_MPOINT); return FALSE; } if (!DokanRemoveMountPoint(mpstr.c_str())) { @@ -2387,7 +2388,10 @@ BOOL unmount_crypt_fs(const WCHAR* mountpoint, bool wait, wstring& mes) { bool res = MountPointManager::getInstance().wait_and_destroy(mpstr.c_str()); if (!res) { CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_WAIT_UNMOUNT_ERROR), GetWindowsErrorString(GetLastError())); + strMsg.Format( + LocUtils::GetStringFromResources(IDS_WAIT_UNMOUNT_ERROR) + .c_str(), + GetWindowsErrorString(GetLastError())); mes += strMsg; } return res; @@ -2426,7 +2430,7 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { CryptThreadData *tdata = MountPointManager::getInstance().get(fs_root.c_str()); if (!tdata) { - mes += LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NOT_FOUND); + mes += LocUtils::GetStringFromResources(IDS_MPOINT_NOT_FOUND); return FALSE; } @@ -2435,7 +2439,7 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { CryptContext *con = &tdata->con; if (!con) { - mes += LocUtilsAlt::GetStringFromResources(IDS_MPOINT_NULL); + mes += LocUtils::GetStringFromResources(IDS_MPOINT_NULL); return FALSE; } @@ -2449,7 +2453,7 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { DWORD error = GetLastError(); DbgPrint(L"update volume name error = %u\n", error); CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_UNABLE_GET_VOLUME_INFO), GetWindowsErrorString(error)); + strMsg.Format(LocUtils::GetStringFromResources(IDS_UNABLE_GET_VOLUME_INFO).c_str(), GetWindowsErrorString(error)); mes += strMsg; return FALSE; } @@ -2458,7 +2462,7 @@ BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes) { con->GetConfig()->m_VolumeName = volbuf; bool res = con->GetConfig()->write_updated_config_file(nullptr, nullptr, 0); if (!res) { - mes += LocUtilsAlt::GetStringFromResources(IDS_UNABLE_WRITE_NEW_VOL_NAME); + mes += LocUtils::GetStringFromResources(IDS_UNABLE_WRITE_NEW_VOL_NAME); return FALSE; } } @@ -2511,7 +2515,7 @@ wstring transform_path(const wchar_t* path, wstring& mes) _locale_t locale = _create_locale(LC_ALL, ""); if (locale == NULL) { - mes = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); + mes = LocUtils::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); return nullptr; } @@ -2534,7 +2538,7 @@ wstring transform_path(const wchar_t* path, wstring& mes) _free_locale(locale); if (!tdata) { - mes = LocUtilsAlt::GetStringFromResources(IDS_NOT_FOUND_MPOINT_BASE_DIR); + mes = LocUtils::GetStringFromResources(IDS_NOT_FOUND_MPOINT_BASE_DIR); return L""; } @@ -2544,12 +2548,12 @@ wstring transform_path(const wchar_t* path, wstring& mes) if (tdata->con.GetConfig()->m_reverse) { if (!encrypt_path(&tdata->con, p, storage)) { - mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CONVERT_PATH); + mes = LocUtils::GetStringFromResources(IDS_FAILED_CONVERT_PATH); return L""; } } else { if (!unencrypt_path(&tdata->con, p, storage)) { - mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_UNENCRYPT_PATH); + mes = LocUtils::GetStringFromResources(IDS_FAILED_UNENCRYPT_PATH); return L""; } } @@ -2563,7 +2567,7 @@ wstring transform_path(const wchar_t* path, wstring& mes) FileNameEnc enc(&dfi, p, nullptr, false); auto pconv = static_cast(enc); if (!pconv) { - mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_ENCRYPT_PATH); + mes = LocUtils::GetStringFromResources(IDS_FAILED_ENCRYPT_PATH); return L""; } return pconv + std::size(L"\\\\?\\") - 1; @@ -2576,19 +2580,19 @@ BOOL list_files(const WCHAR *path, list &findDatas, err_mes = L""; if (!path) { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_NULL); + err_mes = LocUtils::GetStringFromResources(IDS_PATH_NULL); return FALSE; } if (wcslen(path) > MAX_PATH - 1) { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_LONG); + err_mes = LocUtils::GetStringFromResources(IDS_PATH_TOO_LONG); return FALSE; } WCHAR newpath[MAX_PATH + 1]; if (!PathCanonicalize(newpath, path)) { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_FAILED_CANONICALIZE_PATH); + err_mes = LocUtils::GetStringFromResources(IDS_FAILED_CANONICALIZE_PATH); return FALSE; } @@ -2597,17 +2601,17 @@ BOOL list_files(const WCHAR *path, list &findDatas, int dl = *path; if (dl < 'A' || dl > 'Z') { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_INVALID_DRIVE_LETTER); + err_mes = LocUtils::GetStringFromResources(IDS_INVALID_DRIVE_LETTER); return FALSE; } if (wcslen(path) < 3) { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_TOO_SHORT); + err_mes = LocUtils::GetStringFromResources(IDS_PATH_TOO_SHORT); return FALSE; } if (path[1] != ':' || path[2] != '\\') { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_INVALID_PATH); + err_mes = LocUtils::GetStringFromResources(IDS_INVALID_PATH); return FALSE; } @@ -2621,7 +2625,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, _locale_t locale = _create_locale(LC_ALL, ""); if (locale == NULL) { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); + err_mes = LocUtils::GetStringFromResources(IDS_CANNOT_CREATE_LOCALE); return FALSE; } @@ -2647,7 +2651,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, _free_locale(locale); if (!tdata) { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_DRIVE_NOT_MOUNTED); + err_mes = LocUtils::GetStringFromResources(IDS_DRIVE_NOT_MOUNTED); return FALSE; } @@ -2677,7 +2681,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, if (find_files(con, filePath.CorrectCasePath(), filePath, crypt_fill_find_data_list, NULL, &findDatas) != 0) { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_ERROR_LISTING_FILES); + err_mes = LocUtils::GetStringFromResources(IDS_ERROR_LISTING_FILES); return FALSE; } } else if (PathFileExists(filePath)) { @@ -2704,7 +2708,7 @@ BOOL list_files(const WCHAR *path, list &findDatas, } else { - err_mes = LocUtilsAlt::GetStringFromResources(IDS_PATH_NOT_EXIST); + err_mes = LocUtils::GetStringFromResources(IDS_PATH_NOT_EXIST); return FALSE; } @@ -2766,7 +2770,7 @@ bool check_dokany_version(wstring& mes) vector v; if (!get_dokany_version(ver, v)) { - mes = LocUtilsAlt::GetStringFromResources(IDS_UNABLE_GET_DOKANY_VERSION); + mes = LocUtils::GetStringFromResources(IDS_UNABLE_GET_DOKANY_VERSION); return false; } @@ -2783,21 +2787,21 @@ bool check_dokany_version(wstring& mes) if (major != required_major) { CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_DOKANY_VER_NOT_COMPATIBLE), ver, required_ver); + strMsg.Format(LocUtils::GetStringFromResources(IDS_DOKANY_VER_NOT_COMPATIBLE).c_str(), ver, required_ver); mes = strMsg; return false; // error } if (major == required_major && middle < required_middle) { CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_DOKANY_VER_NOT_COMPATIBLE), ver, required_ver); + strMsg.Format(LocUtils::GetStringFromResources(IDS_DOKANY_VER_NOT_COMPATIBLE).c_str(), ver, required_ver); mes = strMsg; return false; // error } if (major == required_major && middle > required_middle) { CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_DOKANY_VER_NOT_TESTED), ver, required_ver); + strMsg.Format(LocUtils::GetStringFromResources(IDS_DOKANY_VER_NOT_TESTED).c_str(), ver, required_ver); mes = strMsg; return true; // warning } @@ -2840,7 +2844,7 @@ static void InitLogging() if (!PathFileExists(logdir)) { CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_UNABLE_INIT_LOGGING), logdir); + strMsg.Format(LocUtils::GetStringFromResources(IDS_UNABLE_INIT_LOGGING).c_str(), logdir); ::MessageBox(NULL, strMsg, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -2878,11 +2882,11 @@ static void InitLogging() if (result == 0) { CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_LOGGING_TO_LOGNAME), logname); + strMsg.Format(LocUtils::GetStringFromResources(IDS_LOGGING_TO_LOGNAME).c_str(), logname); ::MessageBox(NULL, strMsg, L"cppcryptfs", MB_OK | MB_ICONINFORMATION); } else { CString strMsg; - strMsg.Format(LocUtilsAlt::GetStringFromResources(IDS_UNABLE_OPEN_LOGNAME), logname); + strMsg.Format(LocUtils::GetStringFromResources(IDS_UNABLE_OPEN_LOGNAME).c_str(), logname); ::MessageBox(NULL, strMsg, L"cppcryptfs", MB_OK | MB_ICONERROR); } diff --git a/cppcryptfs/resource.h b/cppcryptfs/resource.h index 5358e7705a3cd2feed624381716e02c48b18e3be..61dbda4741c44f41c8962adb4af3f8ffda69d256 100755 GIT binary patch literal 25874 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 delta 3698 zcmaJ@T}&I<752|yj2VnE4iIB(57>qnF#kVETgMm!gE50K#sP=FWO=BfDx2_7<)syg zqSdNeMZhPm_Mz$~t17Bi)i&AYp;{$Xf}$wOMiE5Ss;X95vWiw!AF8kqRUWFS=Z#O;^|3x&KA zuda(Y({2xbr?+Xf6wao*9)H&d@bEnw`7jxo^pLS0UL%JVgI%Gk{!RKWOt&`3+@Bkq ziaiTbtuB0SuoX!&Esiu^4&*fcWw2-?Ag%?Rv8{+^g2Cv1>^GMl5@_553;IFoB{Af!PcK}^h50b~N zxKvexjjA+$s1ng>m#|K2$Ih$|pvvh%xVjr_)e^R8*&P|84?;L0;F_Zae{qN~9FdSZ z62{gM(bz*c-9Om`Lya4aH3?j(nIl>^^c@0{b#Cyrc6e(uGVNuB2U49EU)9#&dF>pb zXm_FkuWNlcUsp$8(`ACpe^OV6S9NKk+~^mua5R9cN5gn{RD{(@XLXL^x-)@)I|tEH z&!jf11YEE8V!J*JgDZ?Ett+kw9?~*3L?F`o4XvlNtnM%*TG!kW?9j4%B1qHv*po8$ z>UzLp+~KWodVPp^li2d6W%_=z2Nt0lVIhePK|*IEhgU+J{!_TxC=$XM!futB@%zRA zY4pjKF7(oFg1%vHcPnPOy_S-klb;~zJQe$A3kV_;z>&i?qeBaA613Tn)@eRxO2>g zN5?X72PNDOa##x{=s&l2w4Ok+HHME{)1*Tc=u8H2tIlLI&3~HOEO-iGJz<74Y}d$e@=Rwj?8G>13>VK}UQaj2X%B3}9Cn7)NM!4I z%Pb1Ux5d<)Fg}m98W&kDn4Ec?Dkn|eSbiGnz4%k?q!Jg8{t+)+BkJVIpM|8lM!Gc7 zGmZ%tMns}HaDSw`h{tV>cD`e^dXrJ#n1)4p_(8Kz8B^`C1inIw^6F%@0p|ZS1 zFe!e*h4l%R0Xs>AG`4ePem5(S{L(D&>e5C7;ag?KO5S&BFf-{ic z-J~DqlG?V()$DoFhtHE<=3kaNXpL`(8lEo5@bqytSNWQ+O#29JmXfqCtxKrqWL)K8 zH{@-=%7htwsvshzJ$rC**aIYdQdYjR-4%~>~Pr?{U!on;+*xSu|qojlZI`?FK|%FAcNK54(rsHe8#4fVQv!GyaR zbw*h6!znk(s6)?$y;DAjr%o`;p7PVKm!6PpKcuNAU5#^e>8E*Q=hS-8V`(l+S{LX1 zIG?pZn&)AimvdJ@WuELd%hJ VUm?0T=FZAD6lnkFKb$>h_#fIo{sjO4 diff --git a/cppcryptfs/ui/CreatePropertyPage.cpp b/cppcryptfs/ui/CreatePropertyPage.cpp index 6a1ef6d..8a8c2d2 100755 --- a/cppcryptfs/ui/CreatePropertyPage.cpp +++ b/cppcryptfs/ui/CreatePropertyPage.cpp @@ -43,7 +43,7 @@ THE SOFTWARE. #include "util/util.h" #include "locutils.h" -static const CString strMsgPlainText = LocUtils::GetStringFromResources(IDS_PLAIN_TEXT); +static CString strMsgPlainText = LocUtils::GetStringFromResources(IDS_PLAIN_TEXT).c_str(); static const WCHAR *filename_encryption_types[] = { L"AES256-EME", @@ -113,7 +113,7 @@ void CCreatePropertyPage::CreateCryptfs() LockZeroBuffer password2(MAX_PASSWORD_LEN + 1, false); if (!password.IsLocked() || !password2.IsLocked()) { - MessageBox(LocUtils::GetStringFromResources(IDS_COULD_NOT_LOCK_BUFFER), L"cppcryptefs", MB_OK | MB_ICONERROR); + MessageBox(LocUtils::GetStringFromResources(IDS_COULD_NOT_LOCK_BUFFER).c_str(), L"cppcryptefs", MB_OK | MB_ICONERROR); return; } @@ -123,7 +123,7 @@ void CCreatePropertyPage::CreateCryptfs() return; if (wcslen(password.m_buf) < 1) { - MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_EMPTY).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -133,12 +133,12 @@ void CCreatePropertyPage::CreateCryptfs() return; if (wcslen(password2.m_buf) < 1) { - MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_REPEAT_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_REPEAT_EMPTY).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } if (wcscmp(password.m_buf, password2.m_buf)) { - MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_DO_NOT_MATCH), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_PASSWORD_DO_NOT_MATCH).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -150,17 +150,17 @@ void CCreatePropertyPage::CreateCryptfs() pWnd->GetWindowTextW(cpath); if (cpath.GetLength() < 1) { - MessageBox(LocUtils::GetStringFromResources(IDS_PATH_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_PATH_EMPTY).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } if (!PathFileExists(cpath)) { CString mes; - mes.Format(LocUtils::GetStringFromResources(IDS_PATH_DOES_NOT_EXIST), cpath); + mes.Format(LocUtils::GetStringFromResources(IDS_PATH_DOES_NOT_EXIST).c_str(), cpath); if (MessageBox(mes, L"cppcryptfs", MB_YESNO | MB_ICONINFORMATION) == IDYES) { if (!CreateDirectory(cpath, NULL)) { - mes.Format(LocUtils::GetStringFromResources(IDS_PATH_COULD_NOT_CREATE), cpath); + mes.Format(LocUtils::GetStringFromResources(IDS_PATH_COULD_NOT_CREATE).c_str(), cpath); MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -259,7 +259,7 @@ void CCreatePropertyPage::CreateCryptfs() CString mes; - reverse ? mes.Format(LocUtils::GetStringFromResources(IDS_CREATED_REVERSE_FS), cpath) : mes.Format(LocUtils::GetStringFromResources(IDS_CREATED_FORWARD_FS), cpath); + reverse ? mes.Format(LocUtils::GetStringFromResources(IDS_CREATED_REVERSE_FS).c_str(), cpath) : mes.Format(LocUtils::GetStringFromResources(IDS_CREATED_FORWARD_FS).c_str(), cpath); MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONINFORMATION); @@ -345,7 +345,7 @@ void CCreatePropertyPage::OnClickedSelect() return; if (!IsDlgButtonChecked(IDC_REVERSE) && !can_delete_directory(cpath, TRUE)) { - MessageBox(LocUtils::GetStringFromResources(IDS_DIRECTORY_NOT_EMPTY), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_DIRECTORY_NOT_EMPTY).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -452,7 +452,7 @@ BOOL CCreatePropertyPage::OnInitDialog() pLbox->EnableWindow(IsDlgButtonChecked(IDC_LONG_FILE_NAMES)); if (!m_password.ArePasswordBuffersLocked() || !m_password2.ArePasswordBuffersLocked()) { - MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFERS), L"cppcryptfs", MB_OK | MB_ICONERROR); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFERS).c_str(), L"cppcryptfs", MB_OK | MB_ICONERROR); } const auto scryptN = theApp.GetProfileIntW(L"CreateOptions", L"ScryptN", DEFAULT_SCRYPTN); @@ -582,11 +582,11 @@ void CCreatePropertyPage::OnSelchangeScryptn() int mem = (1<= 1024) { mem /= 1024; - suffix.Format(LocUtils::GetStringFromResources(IDS_GB_REQUIRED), mem); + suffix.Format(LocUtils::GetStringFromResources(IDS_GB_REQUIRED).c_str(), mem); } auto pScryptMemReq = (CStatic*)GetDlgItem(IDC_SCRYPTMEMREQ); diff --git a/cppcryptfs/ui/CryptAboutPropertyPage.cpp b/cppcryptfs/ui/CryptAboutPropertyPage.cpp index 28a149a..e642a3a 100755 --- a/cppcryptfs/ui/CryptAboutPropertyPage.cpp +++ b/cppcryptfs/ui/CryptAboutPropertyPage.cpp @@ -104,14 +104,14 @@ BEGIN_MESSAGE_MAP(CCryptAboutPropertyPage, CCryptPropertyPage) ON_NOTIFY(LVN_ITEMCHANGED, IDC_COMPONENTS_LIST, &CCryptAboutPropertyPage::OnItemchangedComponentsList) END_MESSAGE_MAP() -static const CString strMsgCppcryptfs = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_CPPCRYPTFS); -static const CString strMsgOpenSSL = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_OPENSSL); -static const CString strMsgRapidJSON = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_RAPIDJSON); -static const CString strMsgDokanyMir = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_MIR); -static const CString strMsgDokanyLib = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_LIB); -static const CString strMsgSecuryEdit = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_SECURE_EDIT); -static const CString strMsgGetOpt = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_GETOPT_PORT); -static const CString strMsgAESSIV = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_AES_SIV); +static CString strMsgCppcryptfs = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_CPPCRYPTFS).c_str(); +static CString strMsgOpenSSL = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_OPENSSL).c_str(); +static CString strMsgRapidJSON = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_RAPIDJSON).c_str(); +static CString strMsgDokanyMir = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_MIR).c_str(); +static CString strMsgDokanyLib = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_LIB).c_str(); +static CString strMsgSecuryEdit = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_SECURE_EDIT).c_str(); +static CString strMsgGetOpt = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_GETOPT_PORT).c_str(); +static CString strMsgAESSIV = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_AES_SIV).c_str(); static const WCHAR* components[] = { strMsgCppcryptfs, @@ -194,21 +194,21 @@ BOOL CCryptAboutPropertyPage::OnInitDialog() CString aes_ni; if (AES::use_aes_ni()) { - aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_DETECTED); + aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_DETECTED).c_str(); } else { - aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_NOT_DETECTED); + aes_ni = LocUtils::GetStringFromResources(IDS_AESNI_NOT_DETECTED).c_str(); } CString strMsgLibraryVersions; - strMsgLibraryVersions.Format(LocUtils::GetStringFromResources(IDS_LIBRARY_VERSIONS), openssl_ver, dokany_version); + strMsgLibraryVersions.Format(LocUtils::GetStringFromResources(IDS_LIBRARY_VERSIONS).c_str(), openssl_ver, dokany_version); SetDlgItemText(IDC_LINKAGES, strMsgLibraryVersions); bool is_admin = theApp.IsRunningAsAdministrator(); int prod_bit_depth = sizeof(void*) == 8 ? 64 : 32; - CString prod_admin = (is_admin ? L" " + LocUtils::GetStringFromResources(IDS_ADMIN) : L""); + CString prod_admin = (is_admin ? CString(L" ") + LocUtils::GetStringFromResources(IDS_ADMIN).c_str() : CString(L"")); CString strMsgCopyright; - strMsgCopyright.Format(LocUtils::GetStringFromResources(IDS_ABOUT_COPYRIGHT), ver.c_str(), prod_bit_depth, prod_admin, aes_ni); + strMsgCopyright.Format(LocUtils::GetStringFromResources(IDS_ABOUT_COPYRIGHT).c_str(), ver.c_str(), prod_bit_depth, prod_admin, aes_ni); SetDlgItemText(IDC_PROD_VERSION, strMsgCopyright); SetDlgItemText(IDC_COPYRIGHT, copyright.c_str()); diff --git a/cppcryptfs/ui/CryptPropertySheet.cpp b/cppcryptfs/ui/CryptPropertySheet.cpp index c16f26a..43748f6 100755 --- a/cppcryptfs/ui/CryptPropertySheet.cpp +++ b/cppcryptfs/ui/CryptPropertySheet.cpp @@ -82,7 +82,7 @@ BOOL CCryptPropertySheet::CanClose() { if (!MountPointManager::getInstance().empty()) { - if (MessageBox(LocUtils::GetStringFromResources(IDS_DISMOUNT_ALL_ON_EXIT), L"cppcryptfs", + if (MessageBox(LocUtils::GetStringFromResources(IDS_DISMOUNT_ALL_ON_EXIT).c_str(), L"cppcryptfs", MB_YESNO | MB_ICONEXCLAMATION) == IDYES) { CString open_handles_mes = CheckOpenHandles(m_hWnd, nullptr, true, false).c_str(); diff --git a/cppcryptfs/ui/FolderDialog.cpp b/cppcryptfs/ui/FolderDialog.cpp index f8521de..0e061a3 100755 --- a/cppcryptfs/ui/FolderDialog.cpp +++ b/cppcryptfs/ui/FolderDialog.cpp @@ -46,13 +46,12 @@ CFolderDialog::CFolderDialog(LPCTSTR lpszFolderName, DWORD dwFlags, CWnd* pParen else m_bi.hwndOwner = pParentWnd->GetSafeHwnd(); - static CString strMessageSelDir; - strMessageSelDir = LocUtils::GetStringFromResources(IDS_SELECT_DIRECTORY); + m_strTitleHolder = LocUtils::GetStringFromResources(IDS_SELECT_DIRECTORY).c_str(); // Fill in the rest of the structure m_bi.pidlRoot = NULL; m_bi.pszDisplayName = m_szDisplayName; - m_bi.lpszTitle = (LPCTSTR)strMessageSelDir; + m_bi.lpszTitle = m_strTitleHolder; m_bi.ulFlags = dwFlags | BIF_NEWDIALOGSTYLE; m_bi.lpfn = BrowseDirectoryCallback; m_bi.lParam = (LPARAM)this; diff --git a/cppcryptfs/ui/FolderDialog.h b/cppcryptfs/ui/FolderDialog.h index 2daff61..d270b64 100755 --- a/cppcryptfs/ui/FolderDialog.h +++ b/cppcryptfs/ui/FolderDialog.h @@ -51,6 +51,8 @@ friend static int CALLBACK BrowseDirectoryCallback( HWND m_hDialogBox; + CString m_strTitleHolder; + }; diff --git a/cppcryptfs/ui/FsInfoDialog.cpp b/cppcryptfs/ui/FsInfoDialog.cpp index ecfdcea..06298e9 100644 --- a/cppcryptfs/ui/FsInfoDialog.cpp +++ b/cppcryptfs/ui/FsInfoDialog.cpp @@ -89,13 +89,13 @@ BOOL CFsInfoDialog::OnInitDialog() CDialog::OnInitDialog(); CString strMsgYes, strMsgNo, strMsgNA, strMsgReverse, strMsgForward, strMsgKB, strMsgSec, strMsgInfinite, strMsgNone; - strMsgYes = LocUtils::GetStringFromResources(IDS_FSINFO_YES); - strMsgNo = LocUtils::GetStringFromResources(IDS_FSINFO_NO); - strMsgNA = LocUtils::GetStringFromResources(IDS_FSINFO_NA); - strMsgReverse = LocUtils::GetStringFromResources(IDS_FSINFO_REVERSE); - strMsgForward = LocUtils::GetStringFromResources(IDS_FSINFO_FORWARD); - strMsgInfinite = LocUtils::GetStringFromResources(IDS_FSINFO_INFINITE); - strMsgNone = LocUtils::GetStringFromResources(IDS_FSINFO_NAME_ENCRYPTION_NO); + strMsgYes = LocUtils::GetStringFromResources(IDS_FSINFO_YES).c_str(); + strMsgNo = LocUtils::GetStringFromResources(IDS_FSINFO_NO).c_str(); + strMsgNA = LocUtils::GetStringFromResources(IDS_FSINFO_NA).c_str(); + strMsgReverse = LocUtils::GetStringFromResources(IDS_FSINFO_REVERSE).c_str(); + strMsgForward = LocUtils::GetStringFromResources(IDS_FSINFO_FORWARD).c_str(); + strMsgInfinite = LocUtils::GetStringFromResources(IDS_FSINFO_INFINITE).c_str(); + strMsgNone = LocUtils::GetStringFromResources(IDS_FSINFO_NAME_ENCRYPTION_NO).c_str(); LPCWSTR yes = strMsgYes; LPCWSTR no = strMsgNo; @@ -131,13 +131,13 @@ BOOL CFsInfoDialog::OnInitDialog() wstring txt; txt = to_wstring(m_info.ioBufferSize); - strMsgKB.Format(LocUtils::GetStringFromResources(IDS_FSINFO_KB), txt); + strMsgKB.Format(LocUtils::GetStringFromResources(IDS_FSINFO_KB).c_str(), txt); SetDlgItemText(IDC_IO_BUF_SIZE, strMsgKB); txt = m_info.multhreaded ? yes : no; SetDlgItemText(IDC_THREADS, txt.c_str()); if (m_info.cacheTTL > 0) { txt = to_wstring(m_info.cacheTTL); - strMsgSec.Format(LocUtils::GetStringFromResources(IDS_FSINFO_SEC), txt); + strMsgSec.Format(LocUtils::GetStringFromResources(IDS_FSINFO_SEC).c_str(), txt); SetDlgItemText(IDC_CACHE_TTL, strMsgSec); } else { SetDlgItemText(IDC_CACHE_TTL, strMsgInfinite); diff --git a/cppcryptfs/ui/MountPropertyPage.cpp b/cppcryptfs/ui/MountPropertyPage.cpp index 48ef1f8..47f2853 100644 --- a/cppcryptfs/ui/MountPropertyPage.cpp +++ b/cppcryptfs/ui/MountPropertyPage.cpp @@ -154,7 +154,7 @@ void CMountPropertyPage::DefaultAction() { CString mes = Mount(); - if (mes.GetLength() > 0 && mes != LocUtils::GetStringFromResources(IDS_PASS_CANNOT_BE_EMPTY)) + if (mes.GetLength() > 0 && mes != LocUtils::GetStringFromResources(IDS_PASS_CANNOT_BE_EMPTY).c_str()) MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); } @@ -169,26 +169,26 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST LockZeroBuffer password(MAX_PASSWORD_LEN + 1, false); if (!password.IsLocked()) { - return LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFER); + return LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFER).c_str(); } if (wcscpy_s(password.m_buf, MAX_PASSWORD_LEN + 1, argPassword ? argPassword : pPass->m_strRealText)) { - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_PASS); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_PASS).c_str(); } if (wcslen(password.m_buf) < 1) { - return LocUtils::GetStringFromResources(IDS_PASS_CANNOT_BE_EMPTY); + return LocUtils::GetStringFromResources(IDS_PASS_CANNOT_BE_EMPTY).c_str(); } CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); if (!pList) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST).c_str(); pos = pList->GetFirstSelectedItemPosition(); if (!pos) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SELECTED); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SELECTED).c_str(); int nItem = -1; @@ -202,7 +202,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (nItem < 0) { if (is_mountpoint_a_drive(str)) { CString strMsg; - strMsg.Format(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_USED), str); + strMsg.Format(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_USED).c_str(), str); return strMsg; } else { int i = pList->GetItemCount(); @@ -222,14 +222,14 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST } if (nItem < 0) - return LocUtils::GetStringFromResources(IDS_UNABLE_FIND_ITEM); + return LocUtils::GetStringFromResources(IDS_UNABLE_FIND_ITEM).c_str(); CString cmp = argMountPoint && wcslen(argMountPoint) > 0 ? (wcslen(argMountPoint) == 1 ? CString(*argMountPoint) + L":" : argMountPoint) : pList->GetItemText(nItem, DL_INDEX); if (cmp.GetLength() < 1) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LETTER); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LETTER).c_str(); BOOL dlInUse = is_mountpoint_a_drive(cmp) && !IsDriveLetterAvailable(*(LPCWSTR)cmp); @@ -240,14 +240,14 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (dlInUse) { CString mes; - mes.Format(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_USED), cmp); + mes.Format(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_USED).c_str(), cmp); return mes; } CWnd *pWnd = GetDlgItem(IDC_PATH); if (!pWnd) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_WINDOW); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_WINDOW).c_str(); CString cpath; @@ -257,7 +257,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST pWnd->GetWindowTextW(cpath); if (cpath.GetLength() < 1) { - return LocUtils::GetStringFromResources(IDS_PATH_ZERO); + return LocUtils::GetStringFromResources(IDS_PATH_ZERO).c_str(); } CString config_path; @@ -267,7 +267,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST } else { pWnd = GetDlgItem(IDC_CONFIG_PATH); if (!pWnd) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_CONF_WINDOW); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_CONF_WINDOW).c_str(); pWnd->GetWindowTextW(config_path); } @@ -297,7 +297,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (pathInUse) { CString mes; - mes.Format(LocUtils::GetStringFromResources(IDS_ALREADY_MOUNTED), cpath, mdl); + mes.Format(LocUtils::GetStringFromResources(IDS_ALREADY_MOUNTED).c_str(), cpath, mdl); return mes; } @@ -326,13 +326,13 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (opts.denyothersessions || opts.denyservices) { if (!CanGetSessionIdOk()) { - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SESSION_ID); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SESSION_ID).c_str(); } if (!have_sessionid()) { - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_PROCESS_SESSION_ID); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_PROCESS_SESSION_ID).c_str(); } if (get_sessionid() == 0) { - return LocUtils::GetStringFromResources(IDS_SESSION_ID_ZERO); + return LocUtils::GetStringFromResources(IDS_SESSION_ID_ZERO).c_str(); } } @@ -360,7 +360,7 @@ CString CMountPropertyPage::Mount(LPCWSTR argPath, LPCWSTR argMountPoint, LPCWST if (IsDlgButtonChecked(IDC_SAVE_PASSWORD)) { if (!SavedPasswords::SavePassword(cpath, password.m_buf)) { - MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_SAVE_PASS), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_SAVE_PASS).c_str(), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); } } @@ -494,7 +494,7 @@ BOOL CMountPropertyPage::OnInitDialog() // or using the string table resource CWnd *pWnd = GetDlgItem(IDC_SAVE_PASSWORD); if (pWnd) { - m_ToolTip.AddTool(pWnd, LocUtils::GetStringFromResources(IDS_TOOLTIP_ENABLE_SAVE_PASS)); + m_ToolTip.AddTool(pWnd, LocUtils::GetStringFromResources(IDS_TOOLTIP_ENABLE_SAVE_PASS).c_str()); } } @@ -533,9 +533,9 @@ BOOL CMountPropertyPage::OnInitDialog() mountPointColumnWidth = 79; } - pList->InsertColumn(DL_INDEX, LocUtils::GetStringFromResources(IDS_COLUMN_HEADER_MOUNT_POINT), LVCFMT_LEFT, mountPointColumnWidth); + pList->InsertColumn(DL_INDEX, LocUtils::GetStringFromResources(IDS_COLUMN_HEADER_MOUNT_POINT).c_str(), LVCFMT_LEFT, mountPointColumnWidth); - pList->InsertColumn(PATH_INDEX, LocUtils::GetStringFromResources(IDS_COLUMN_HEADER_PATH), LVCFMT_LEFT, 454-mountPointColumnWidth); + pList->InsertColumn(PATH_INDEX, LocUtils::GetStringFromResources(IDS_COLUMN_HEADER_PATH).c_str(), LVCFMT_LEFT, 454-mountPointColumnWidth); CString lastMountPoint = theApp.GetProfileString(L"MountPoints", L"LastMountPoint", L""); @@ -622,7 +622,7 @@ BOOL CMountPropertyPage::OnInitDialog() pCombo->LimitText(MAX_PATH); if (!m_password.ArePasswordBuffersLocked()) { - MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFER), L"cppcryptfs", MB_OK | MB_ICONERROR); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_LOCK_BUFFER).c_str(), L"cppcryptfs", MB_OK | MB_ICONERROR); } ProcessCommandLine(GetCommandLine(), TRUE); @@ -750,7 +750,7 @@ void CMountPropertyPage::OnClickedMount() void CMountPropertyPage::OnClickedDismount() { CString mes = Dismount(nullptr, true, false); - if (mes.GetLength() > 0 && mes != LocUtils::GetStringFromResources(IDS_CANCELED_BY_USER)) + if (mes.GetLength() > 0 && mes != LocUtils::GetStringFromResources(IDS_CANCELED_BY_USER).c_str()) MessageBox(mes, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); } @@ -760,12 +760,12 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); if (!pList) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST).c_str(); POSITION pos = pList->GetFirstSelectedItemPosition(); if (!pos) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SELECTED); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_SELECTED).c_str(); int nItem; @@ -778,7 +778,7 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo nItem = pList->FindItem(&fi); if (nItem < 0) { CString msg; - msg.Format(LocUtils::GetStringFromResources(IDS_DRIVE_WITHOUT_MOUNTED_FS), str); + msg.Format(LocUtils::GetStringFromResources(IDS_DRIVE_WITHOUT_MOUNTED_FS).c_str(), str); return msg; } } else { @@ -786,18 +786,18 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo } if (nItem < 0) - return LocUtils::GetStringFromResources(IDS_UNABLE_FIND_ITEM); + return LocUtils::GetStringFromResources(IDS_UNABLE_FIND_ITEM).c_str(); CString cmp = pList->GetItemText(nItem, DL_INDEX); if (cmp.GetLength() < 1) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LETTER); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LETTER).c_str(); CString cpath = pList->GetItemText(nItem, PATH_INDEX); if (cpath.GetLength() < 1) { CString msg; - msg.Format(LocUtils::GetStringFromResources(IDS_DRIVE_WITHOUT_MOUNTED_FS), cmp); + msg.Format(LocUtils::GetStringFromResources(IDS_DRIVE_WITHOUT_MOUNTED_FS).c_str(), cmp); return msg; } @@ -824,7 +824,7 @@ CString CMountPropertyPage::Dismount(LPCWSTR argMountPoint, bool interactive, bo mes += L". "; } CString strMessage; - strMessage.Format(LocUtils::GetStringFromResources(IDS_CANNOT_UNMOUNT), cmp); + strMessage.Format(LocUtils::GetStringFromResources(IDS_CANNOT_UNMOUNT).c_str(), cmp); mes += strMessage; if (wmes.length() > 0) { mes += L" "; @@ -856,7 +856,7 @@ CString CMountPropertyPage::DismountAll(bool interactive, bool forceDismount) CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS); if (!pList) - return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST); + return LocUtils::GetStringFromResources(IDS_UNABLE_GET_LIST).c_str(); int count = pList->GetItemCount(); @@ -913,16 +913,16 @@ CString CMountPropertyPage::DismountAll(bool interactive, bool forceDismount) if (hadFailure) { if (hadSuccess) { - mes = LocUtils::GetStringFromResources(IDS_SOME_DRV_NOT_DISMOUNTED); + mes = LocUtils::GetStringFromResources(IDS_SOME_DRV_NOT_DISMOUNTED).c_str(); } else { - mes = LocUtils::GetStringFromResources(IDS_UNABLE_DISMOUNT); + mes = LocUtils::GetStringFromResources(IDS_UNABLE_DISMOUNT).c_str(); } } if (volnameFailure) { if (mes.GetLength() > 0) mes += L". "; - mes += LocUtils::GetStringFromResources(IDS_UNABLE_UPDATE_LABELS); + mes += LocUtils::GetStringFromResources(IDS_UNABLE_UPDATE_LABELS).c_str(); } return mes; @@ -973,7 +973,7 @@ BOOL CMountPropertyPage::OnSetActive() CString mountPoint = theApp.GetProfileString(L"MountPoints", path_hash, NULL); if (mountPoint.GetLength() == 0) { CString strMessage; - strMessage.Format(LocUtils::GetStringFromResources(IDS_FAIL_RETRIVE_MPOINT), m_lastDirs[i]); + strMessage.Format(LocUtils::GetStringFromResources(IDS_FAIL_RETRIVE_MPOINT).c_str(), m_lastDirs[i]); MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); continue; } @@ -982,7 +982,7 @@ BOOL CMountPropertyPage::OnSetActive() if (!SavedPasswords::RetrievePassword(m_lastDirs[i], password.m_buf, password.m_len)) { CString strMessage; - strMessage.Format(LocUtils::GetStringFromResources(IDS_FAIL_RETRIVE_PASS), m_lastDirs[i]); + strMessage.Format(LocUtils::GetStringFromResources(IDS_FAIL_RETRIVE_PASS).c_str(), m_lastDirs[i]); MessageBox(strMessage, L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); continue; } @@ -1738,7 +1738,7 @@ void CMountPropertyPage::OnContextMenu(CWnd* pWnd, CPoint point) if (!menu.CreatePopupMenu()) return; - menu.AppendMenu(MF_ENABLED, AddMountPointV, LocUtils::GetStringFromResources(IDS_MENU_ADD_MOUNT_POINT)); + menu.AppendMenu(MF_ENABLED, AddMountPointV, LocUtils::GetStringFromResources(IDS_MENU_ADD_MOUNT_POINT).c_str()); int item = -1; @@ -1755,12 +1755,12 @@ void CMountPropertyPage::OnContextMenu(CWnd* pWnd, CPoint point) wstring mpstr; bool mounted = MountPointManager::getInstance().find(cmp, mpstr); if (mounted) { - menu.AppendMenu(MF_ENABLED, OpenV, LocUtils::GetStringFromResources(IDS_MENU_OPEN)); - menu.AppendMenu(MF_ENABLED, PropertiesV, LocUtils::GetStringFromResources(IDS_MENU_PROPERTIES)); - menu.AppendMenu(MF_ENABLED, DismountV, LocUtils::GetStringFromResources(IDS_MENU_DISMOUNT)); + menu.AppendMenu(MF_ENABLED, OpenV, LocUtils::GetStringFromResources(IDS_MENU_OPEN).c_str()); + menu.AppendMenu(MF_ENABLED, PropertiesV, LocUtils::GetStringFromResources(IDS_MENU_PROPERTIES).c_str()); + menu.AppendMenu(MF_ENABLED, DismountV, LocUtils::GetStringFromResources(IDS_MENU_DISMOUNT).c_str()); } if (is_mountpoint_a_dir(cmp)) { - menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, LocUtils::GetStringFromResources(IDS_DELETE_MOUNT_POINT)); + menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, LocUtils::GetStringFromResources(IDS_DELETE_MOUNT_POINT).c_str()); } } @@ -1821,7 +1821,7 @@ void CMountPropertyPage::AddMountPoint(const CString & path) return; if (!is_suitable_mountpoint(path)) { - MessageBox(LocUtils::GetStringFromResources(IDS_PATH_NOT_SUITABLE_MPOINT), L"cppcyrptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_PATH_NOT_SUITABLE_MPOINT).c_str(), L"cppcyrptfs", MB_OK | MB_ICONEXCLAMATION); return; } @@ -1830,7 +1830,7 @@ void CMountPropertyPage::AddMountPoint(const CString & path) int i = 0; for (CString mp = mountPointsStr.Tokenize(L"|", i); i >= 0; mp = mountPointsStr.Tokenize(L"|", i)) { if (!lstrcmpi(path, mp)) { - MessageBox(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_ADDED), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); + MessageBox(LocUtils::GetStringFromResources(IDS_MPOINT_ALREADY_ADDED).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); return; } } diff --git a/cppcryptfs/ui/SettingsPropertyPage.cpp b/cppcryptfs/ui/SettingsPropertyPage.cpp index 3733b7d..69fc145 100644 --- a/cppcryptfs/ui/SettingsPropertyPage.cpp +++ b/cppcryptfs/ui/SettingsPropertyPage.cpp @@ -96,22 +96,22 @@ static buffer_size_t buffer_sizes[] = { 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2 static int ttls[] = { 0, 1, 2, 5, 10, 15, 30, 45, 60, 90, 120, 300, 600, 900, 1800, 3600}; -static const CString ttl_0 = LocUtils::GetStringFromResources(IDS_TTL_INFINITE); -static const CString ttl_1 = LocUtils::GetStringFromResources(IDS_TTL_SEC_1); -static const CString ttl_2 = LocUtils::GetStringFromResources(IDS_TTL_SEC_2); -static const CString ttl_5 = LocUtils::GetStringFromResources(IDS_TTL_SEC_5); -static const CString ttl_10 = LocUtils::GetStringFromResources(IDS_TTL_SEC_10); -static const CString ttl_15 = LocUtils::GetStringFromResources(IDS_TTL_SEC_15); -static const CString ttl_30 = LocUtils::GetStringFromResources(IDS_TTL_SEC_30); -static const CString ttl_45 = LocUtils::GetStringFromResources(IDS_TTL_SEC_45); -static const CString ttl_60 = LocUtils::GetStringFromResources(IDS_TTL_SEC_60); -static const CString ttl_90 = LocUtils::GetStringFromResources(IDS_TTL_SEC_90); -static const CString ttl_120 = LocUtils::GetStringFromResources(IDS_TTL_MIN_2); -static const CString ttl_300 = LocUtils::GetStringFromResources(IDS_TTL_MIN_5); -static const CString ttl_600 = LocUtils::GetStringFromResources(IDS_TTL_MIN_10); -static const CString ttl_900 = LocUtils::GetStringFromResources(IDS_TTL_MIN_15); -static const CString ttl_1800 = LocUtils::GetStringFromResources(IDS_TTL_MIN_30); -static const CString ttl_3600 = LocUtils::GetStringFromResources(IDS_TTL_HOUR_1); +static CString ttl_0 = LocUtils::GetStringFromResources(IDS_TTL_INFINITE).c_str(); +static CString ttl_1 = LocUtils::GetStringFromResources(IDS_TTL_SEC_1).c_str(); +static CString ttl_2 = LocUtils::GetStringFromResources(IDS_TTL_SEC_2).c_str(); +static CString ttl_5 = LocUtils::GetStringFromResources(IDS_TTL_SEC_5).c_str(); +static CString ttl_10 = LocUtils::GetStringFromResources(IDS_TTL_SEC_10).c_str(); +static CString ttl_15 = LocUtils::GetStringFromResources(IDS_TTL_SEC_15).c_str(); +static CString ttl_30 = LocUtils::GetStringFromResources(IDS_TTL_SEC_30).c_str(); +static CString ttl_45 = LocUtils::GetStringFromResources(IDS_TTL_SEC_45).c_str(); +static CString ttl_60 = LocUtils::GetStringFromResources(IDS_TTL_SEC_60).c_str(); +static CString ttl_90 = LocUtils::GetStringFromResources(IDS_TTL_SEC_90).c_str(); +static CString ttl_120 = LocUtils::GetStringFromResources(IDS_TTL_MIN_2).c_str(); +static CString ttl_300 = LocUtils::GetStringFromResources(IDS_TTL_MIN_5).c_str(); +static CString ttl_600 = LocUtils::GetStringFromResources(IDS_TTL_MIN_10).c_str(); +static CString ttl_900 = LocUtils::GetStringFromResources(IDS_TTL_MIN_15).c_str(); +static CString ttl_1800 = LocUtils::GetStringFromResources(IDS_TTL_MIN_30).c_str(); +static CString ttl_3600 = LocUtils::GetStringFromResources(IDS_TTL_HOUR_1).c_str(); static const WCHAR* ttl_strings[] = { ttl_0, ttl_1, ttl_2, ttl_5, ttl_10, ttl_15, ttl_30, ttl_45, @@ -313,18 +313,18 @@ void CSettingsPropertyPage::OnClickedEnableSavingPasswords() bool neversavehistory = false; CryptSettings::getInstance().GetSettingCurrent(NEVER_SAVE_HISTORY, neversavehistory); if (neversavehistory) { - MessageBox(LocUtils::GetStringFromResources(IDS_PASS_WILL_NOT_BE_SAVED), + MessageBox(LocUtils::GetStringFromResources(IDS_PASS_WILL_NOT_BE_SAVED).c_str(), L"cppcryptfs", MB_OK | MB_ICONINFORMATION); } } else { int numSavedPasswords = SavedPasswords::ClearSavedPasswords(FALSE); if (numSavedPasswords < 0) { - MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_COUNT_SAVED_PASS), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_COUNT_SAVED_PASS).c_str(), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); } else if (numSavedPasswords > 0) { - int result = MessageBox(LocUtils::GetStringFromResources(IDS_DELETE_ALL_SAVED_PASS), L"cppcryptfs", MB_ICONWARNING | MB_YESNO); + int result = MessageBox(LocUtils::GetStringFromResources(IDS_DELETE_ALL_SAVED_PASS).c_str(), L"cppcryptfs", MB_ICONWARNING | MB_YESNO); if (result == IDYES) { if (SavedPasswords::ClearSavedPasswords(TRUE) != numSavedPasswords) { - MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_DELETE_SAVED_PASS), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_DELETE_SAVED_PASS).c_str(), L"cppcryptfs", MB_ICONEXCLAMATION | MB_OK); } } } @@ -347,7 +347,7 @@ void CSettingsPropertyPage::OnClickedNeverSaveHistory() CryptSettings::getInstance().GetSettingCurrent(ENABLE_SAVING_PASSWORDS, enablesavingpasswords); if (enablesavingpasswords) { - MessageBox(LocUtils::GetStringFromResources(IDS_NEVER_SAVE_HISTORY_HINT), + MessageBox(LocUtils::GetStringFromResources(IDS_NEVER_SAVE_HISTORY_HINT).c_str(), L"cppcryptfs", MB_OK | MB_ICONINFORMATION); } @@ -371,7 +371,7 @@ void CSettingsPropertyPage::OnClickedNeverSaveHistory() DeleteAllRegisteryValues(CPPCRYPTFS_REG_PATH L"CreateOptions", mes); error += mes; if (!error.empty()) { - MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_DELETE_HISTORY), L"cppcryptfs", + MessageBox(LocUtils::GetStringFromResources(IDS_UNABLE_DELETE_HISTORY).c_str(), L"cppcryptfs", MB_OK | MB_ICONEXCLAMATION); } } diff --git a/cppcryptfs/ui/locutils.cpp b/cppcryptfs/ui/locutils.cpp index 5f5a9dd..b272447 100644 --- a/cppcryptfs/ui/locutils.cpp +++ b/cppcryptfs/ui/locutils.cpp @@ -1,11 +1,11 @@ -#include "stdafx.h" #include "locutils.h" +#define VC_EXTRALEAN +#include -CString LocUtils::GetStringFromResources(UINT nID) { - CString str; - static HINSTANCE hExe = GetModuleHandle(NULL); - if (hExe == NULL || !str.LoadString(hExe, nID)) { - return _T("Error: String not found"); +std::wstring LocUtils::GetStringFromResources(unsigned int nID) { + ATL::CStringW str; + if (str.LoadString(nID)) { + return std::wstring((LPCWSTR)str); } - return str; + return L""; } diff --git a/cppcryptfs/ui/locutils.h b/cppcryptfs/ui/locutils.h index 4a26311..9b6dda7 100644 --- a/cppcryptfs/ui/locutils.h +++ b/cppcryptfs/ui/locutils.h @@ -1,7 +1,7 @@ #pragma once -#include +#include class LocUtils { public: - static CString GetStringFromResources(UINT nID); + static std::wstring GetStringFromResources(unsigned int nID); }; diff --git a/cppcryptfs/ui/locutilsalt.cpp b/cppcryptfs/ui/locutilsalt.cpp deleted file mode 100644 index 72a30ad..0000000 --- a/cppcryptfs/ui/locutilsalt.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "locutilsalt.h" - -CString LocUtilsAlt::GetStringFromResources(UINT nID) { - CString str; - static HINSTANCE hExe = GetModuleHandle(NULL); - if (hExe == NULL || !str.LoadString(hExe, nID)) { - return _T("Error: String not found"); - } - return str; -} diff --git a/cppcryptfs/ui/locutilsalt.h b/cppcryptfs/ui/locutilsalt.h deleted file mode 100644 index 8e4f07f..0000000 --- a/cppcryptfs/ui/locutilsalt.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include -#include - -class LocUtilsAlt { -public: - static ATL::CString GetStringFromResources(UINT nID); -}; diff --git a/cppcryptfs/ui/uiutil.cpp b/cppcryptfs/ui/uiutil.cpp index 8c5ea35..1ada228 100644 --- a/cppcryptfs/ui/uiutil.cpp +++ b/cppcryptfs/ui/uiutil.cpp @@ -121,13 +121,13 @@ wstring CheckOpenHandles(HWND hWnd, const wchar_t* mp, bool interactive, bool fo else if (open_handle_count > 0) { if (interactive) { CString strMsg; - strMsg.Format(LocUtils::GetStringFromResources(IDS_IS_STILL_IN_USE), mp); - auto res = ::MessageBox(hWnd, mp ? strMsg : LocUtils::GetStringFromResources(IDS_FS_IS_STILL_IN_USE), L"cppcryptfs", MB_YESNO | MB_ICONHAND); + strMsg.Format(LocUtils::GetStringFromResources(IDS_IS_STILL_IN_USE).c_str(), mp); + auto res = ::MessageBox(hWnd, mp ? strMsg : LocUtils::GetStringFromResources(IDS_FS_IS_STILL_IN_USE).c_str(), L"cppcryptfs", MB_YESNO | MB_ICONHAND); if (res == IDYES) return L""; else { - CString strMsgCanceledByUser = LocUtils::GetStringFromResources(IDS_CANCELED_BY_USER); - return strMsgCanceledByUser.GetString(); + std::wstring strMsgCanceledByUser = LocUtils::GetStringFromResources(IDS_CANCELED_BY_USER); + return strMsgCanceledByUser; } } else { diff --git a/libcppcryptfs/config/cryptconfig.cpp b/libcppcryptfs/config/cryptconfig.cpp index 05526df..2cbb274 100644 --- a/libcppcryptfs/config/cryptconfig.cpp +++ b/libcppcryptfs/config/cryptconfig.cpp @@ -64,6 +64,9 @@ THE SOFTWARE. #include "util/LockZeroBuffer.h" #include "filename/cryptfilename.h" #include "../libcommonutil/commonutil.h" +#include "../cppcryptfs/resource.h" +#include "../cppcryptfs/ui/locutils.h" +#include CryptConfig::CryptConfig() { @@ -114,7 +117,7 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) if (config_file_path) { if (_wfopen_s(&fl, config_file_path, L"rb")) { - mes = L"failed to open config file"; + mes = LocUtils::GetStringFromResources(IDS_FAILED_OPEN_CONF); return false; } m_configPath = config_file_path; @@ -124,7 +127,7 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) wstring config_path; if (m_basedir.size() < 1) { - mes = L"cannot read config because base dir is empty"; + mes = LocUtils::GetStringFromResources(IDS_NOT_CONF_DIR_EMPTY); return false; } @@ -138,7 +141,7 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) if (_wfopen_s(&fl, &config_file[0], L"rb")) { config_file = config_path + CONFIG_NAME; if (_wfopen_s(&fl, &config_file[0], L"rb")) { - mes = L"failed to open config file"; + mes = LocUtils::GetStringFromResources(IDS_FAILED_OPEN_CONF); return false; } m_reverse = false; @@ -152,24 +155,24 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) File.reset(fl); if (fseek(fl, 0, SEEK_END)) { - mes = L"unable to seek to end of config file"; + mes = LocUtils::GetStringFromResources(IDS_NOT_FOUND_END_CONF); return false; } long filesize = ftell(fl); if (filesize > MAX_CONFIG_FILE_SIZE) { - mes = L"config file is too big"; + mes = LocUtils::GetStringFromResources(IDS_CONF_TOO_BIG); return false; } if (filesize < 1) { - mes = L"config file is empty"; + mes = LocUtils::GetStringFromResources(IDS_CONF_EMPTY); return false; } if (fseek(fl, 0, SEEK_SET)) { - mes = L"unable to seek to beginning of config file"; + mes = LocUtils::GetStringFromResources(IDS_NOT_FOUND_BEGINNING_CONF); return false; } @@ -178,14 +181,14 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) char* buf = buf_rsc.get(); if (!buf) { - mes = L"cannot allocate buffer for reading config file"; + mes = LocUtils::GetStringFromResources(IDS_CANNOT_ALLOCATE_BUFFER_CONF); return false; } size_t len = fread(buf, 1, filesize, fl); if (len < 0) { - mes = L"read error when reading config file"; + mes = LocUtils::GetStringFromResources(IDS_RAED_ERR_CONF); return false; } @@ -196,7 +199,7 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) d.Parse(buf); if (!d.IsObject()) { - mes = L"config file is not valid JSON"; + mes = LocUtils::GetStringFromResources(IDS_CONF_NOT_VALID_JSON); return false; } @@ -205,19 +208,19 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) try { if (!d.HasMember("EncryptedKey") || !d["EncryptedKey"].IsString()) { - mes = L"key missing in config file"; + mes = LocUtils::GetStringFromResources(IDS_KEY_MISSING_IN_CONF); throw (-1); } rapidjson::Value& v = d["EncryptedKey"]; if (!base64_decode(v.GetString(), m_encrypted_key, false, true)) { - mes = L"failed to base64 decode key in config file"; + mes = LocUtils::GetStringFromResources(IDS_FAILED_BASE64_DECODE_KEY); throw (-1); } if (!d.HasMember("ScryptObject") || !d["ScryptObject"].IsObject()) { - mes = L"ScryptObject missing in config file"; + mes = LocUtils::GetStringFromResources(IDS_SCRYPTOBJECT_MISSING_IN_CONF); throw (-1); } @@ -225,7 +228,7 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) if (!base64_decode(scryptobject["Salt"].GetString(), m_encrypted_key_salt, false, true)) { - mes = L"failed to base64 decode Scrypt Salt in config file"; + mes = LocUtils::GetStringFromResources(IDS_FAILED_BASE64_DECODE_SALT); throw (-1); } @@ -235,7 +238,7 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) for (i = 0; i < sizeof(sstuff) / sizeof(sstuff[0]); i++) { if (scryptobject[sstuff[i]].IsNull() || !scryptobject[sstuff[i]].IsInt()) { - mes = L"invalid Scrypt object in config file"; + mes = LocUtils::GetStringFromResources(IDS_INVALID_SCRYPTOBJECT); throw (-1); } } @@ -246,21 +249,21 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) int keyLen = scryptobject["KeyLen"].GetInt(); if (keyLen != 32) { - mes = L"invalid KeyLen in config file"; + mes = LocUtils::GetStringFromResources(IDS_INVALID_KEYLEN); throw(-1); } m_pKeyBuf = new LockZeroBuffer(keyLen, false); if (!m_pKeyBuf->IsLocked()) { - mes = L"failed to lock key buffer while reading config file"; + mes = LocUtils::GetStringFromResources(IDS_FAILED_LOCK_BUFFER_READ_CONF); throw(-1); } m_keybuf_manager.RegisterBuf(m_pKeyBuf); if (d["Version"].IsNull() || !d["Version"].IsInt()) { - mes = L"invalid Version in config file"; + mes = LocUtils::GetStringFromResources(IDS_INVALID_VERSION_IN_CONF); throw (-1); } @@ -284,7 +287,7 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) try { m_fs_feature_disable_mask = stoul(fs_str, nullptr, 16); } catch (std::invalid_argument&) { - mes = L"invalid FsFeatureDisableMask in config file"; + mes = LocUtils::GetStringFromResources(IDS_INVALID_FSFEATUREDISABLEMASK); throw(-1); } } @@ -318,10 +321,11 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) } else { wstring wflag; if (utf8_to_unicode(itr->GetString(), wflag)) { - mes = L"unkown feature flag in config file: "; - mes += wflag; + CString strMsg; + strMsg.Format(LocUtils::GetStringFromResources(IDS_UNKNOWN_FEATURE_FLAG).c_str(), wflag); + mes = strMsg; } else { - mes = L"unable to convert unkown flag in config file to unicode"; + mes = LocUtils::GetStringFromResources(IDS_UNABLE_CONVERT_UNKNOWN_FLAG); } throw(-1); } @@ -338,11 +342,11 @@ CryptConfig::read(wstring& mes, const WCHAR *config_file_path, bool reverse) } m_LongNameMax = lnm; } catch (std::invalid_argument&) { - mes = L"invalid LongNameMax in config file"; + mes = LocUtils::GetStringFromResources(IDS_INVALID_LONGNAMEMAX); throw(-1); } } else { - mes = L"LongNameMax feature flag specified but no LongNameMax value provided"; + mes = LocUtils::GetStringFromResources(IDS_NO_VALUE_LONGNAMEMAX); throw(-1); } } @@ -601,16 +605,16 @@ bool CryptConfig::check_config(wstring& mes) mes = L""; if (m_Version != 2) - mes += L"Only version 2 is supported\n"; + mes += LocUtils::GetStringFromResources(IDS_ONLY_VERSION_2_SUPPORT); if (!m_EMENames && !m_PlaintextNames) - mes += L"EMENames is required unless PlaintextNames is specified\n"; + mes += LocUtils::GetStringFromResources(IDS_EMENAMES_REQUIRED); if (!m_GCMIV128) - mes += L"GCMIV128 must be specified\n"; + mes += LocUtils::GetStringFromResources(IDS_GCMIV128_NOT_SPECIFIED); if (m_reverse && !m_AESSIV) - mes += L"reverse mode is being used but AESSIV not specfied\n"; + mes += LocUtils::GetStringFromResources(IDS_REVERSE_MODE_WITHOUT_AESSIV); return mes.size() == 0; } @@ -726,7 +730,7 @@ bool CryptConfig::encrypt_key(const wchar_t* password, const BYTE* masterkey, st LockZeroBuffer pwkeyHKDF(MASTER_KEY_LEN, false); if (!pwkey.IsLocked() || !pwkeyHKDF.IsLocked()) { - error_mes = L"pw key not locked"; + error_mes = LocUtils::GetStringFromResources(IDS_PWKEY_NOT_LOCKED); return false; } @@ -734,14 +738,14 @@ bool CryptConfig::encrypt_key(const wchar_t* password, const BYTE* masterkey, st if (masterkey) { if (m_pKeyBuf) { - error_mes = L"master key is already set"; + error_mes = LocUtils::GetStringFromResources(IDS_MASTER_KEY_ALREADY_SET); return false; } m_pKeyBuf = new LockZeroBuffer(DEFAULT_KEY_LEN, false); if (!m_pKeyBuf->IsLocked()) { - error_mes = L"cannot lock key buffer\n"; + error_mes = LocUtils::GetStringFromResources(IDS_CANNOT_LOCK_KEY_BUFFER); throw(-1); } @@ -753,18 +757,18 @@ bool CryptConfig::encrypt_key(const wchar_t* password, const BYTE* masterkey, st m_encrypted_key_salt.resize(SALT_LEN); if (!get_sys_random_bytes(&m_encrypted_key_salt[0], SALT_LEN)) { - error_mes = L"get random bytes for salt failed\n"; + error_mes = LocUtils::GetStringFromResources(IDS_FAILED_GET_RANDOM); throw(-1); } LockZeroBuffer utf8pass(256, false); if (!utf8pass.IsLocked()) { - error_mes = L"utf8 pass is not locked"; + error_mes = LocUtils::GetStringFromResources(IDS_UTF8PASS_NOT_LOCKED); return false; } if (!unicode_to_utf8(password, utf8pass.m_buf, utf8pass.m_len - 1)) { - error_mes = L"cannot convert password to utf-8\n"; + error_mes = LocUtils::GetStringFromResources(IDS_CANNOT_CONVERT_PASS_UTF8); throw(-1); } @@ -774,13 +778,13 @@ bool CryptConfig::encrypt_key(const wchar_t* password, const BYTE* masterkey, st GetMasterKeyLength()); if (result != 1) { - error_mes = L"key derivation failed\n"; + error_mes = LocUtils::GetStringFromResources(IDS_KEY_DERIVATION_FAILED); throw(-1); } if (m_HKDF) { if (!hkdfDerive(pwkey.m_buf, pwkey.m_len, pwkeyHKDF.m_buf, pwkeyHKDF.m_len, hkdfInfoGCMContent)) { - error_mes = L"unable to perform hkdf on pw key"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_HKDF_ON_PWKEY); throw(-1); } } @@ -790,7 +794,7 @@ bool CryptConfig::encrypt_key(const wchar_t* password, const BYTE* masterkey, st int iv_len = m_HKDF ? HKDF_MASTER_IV_LEN : ORIG_MASTER_IV_LEN; if (!get_sys_random_bytes(iv, iv_len)) { - error_mes = L"unable to generate iv\n"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_GENERATE_IV); throw(-1); } @@ -801,14 +805,14 @@ bool CryptConfig::encrypt_key(const wchar_t* password, const BYTE* masterkey, st memset(adata, 0, adata_len); if (!InitGCMContentKey(GetMasterKey())) { - error_mes = L"unable to init gcm content key for volume name"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_INIT_GCM); throw(-1); } context = get_crypt_context(iv_len, AES_MODE_GCM); if (!context) { - error_mes = L"unable to get gcm context\n"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_GET_GCM); throw(-1); } @@ -820,19 +824,19 @@ bool CryptConfig::encrypt_key(const wchar_t* password, const BYTE* masterkey, st iv, (encrypted_key + iv_len), encrypted_key + iv_len + GetMasterKeyLength(), context.get()); if (ctlen < 1) { - error_mes = L"unable to encrypt master key\n"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_ENCRYPT_MASTER_KEY); throw(-1); } const char* base64_key = base64_encode(encrypted_key, GetMasterKeyLength() + iv_len + BLOCK_TAG_LEN, base64encryptedmasterkey, false, true); if (!base64_key) { - error_mes = L"unable to base64 encode key\n"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_BASE64_ENCODE_KEY); throw(-1); } if (!base64_encode(&m_encrypted_key_salt[0], (DWORD)m_encrypted_key_salt.size(), scryptSalt, false, true)) { - error_mes = L"unable to base64 encode salt\n"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_BASE64_ENCODE_SALT); throw(-1); } } @@ -899,22 +903,26 @@ bool CryptConfig::create(const WCHAR *path, const WCHAR *specified_config_file_p } if (m_reverse && !m_AESSIV) { - error_mes = L"AES256-SIV must be used with Reverse\n"; + error_mes = LocUtils::GetStringFromResources(IDS_ONLY_AES256SIV_WITH_REVERSE); throw(-1); } if (m_reverse) { if (PathFileExists(&config_path[0])) { if (specified_config_file_path) { - error_mes = config_path + L" already exists. Please remove it and try again."; + CString strMsg; + strMsg.Format(LocUtils::GetStringFromResources(IDS_CONF_PATH_ALREADY_EXIST).c_str(), config_path); + error_mes = strMsg; } else { - error_mes = config_path + L" (normally a hidden file) already exists. Please remove it and try again."; + CString strMsg; + strMsg.Format(LocUtils::GetStringFromResources(IDS_CONF_PATH_HIDDEN_EXIST).c_str(), config_path); + error_mes = strMsg; } throw(-1); } } else { if (!can_delete_directory(&m_basedir[0], TRUE)) { - error_mes = L"the directory is not empty\n"; + error_mes = LocUtils::GetStringFromResources(IDS_DIR_NOT_EMPTY); throw(-1); } } @@ -926,12 +934,12 @@ bool CryptConfig::create(const WCHAR *path, const WCHAR *specified_config_file_p m_pKeyBuf = new LockZeroBuffer(DEFAULT_KEY_LEN, false); if (!m_pKeyBuf->IsLocked()) { - error_mes = L"cannot lock key buffer\n"; + error_mes = LocUtils::GetStringFromResources(IDS_CANNOT_LOCK_KEY_BUFFER); throw(-1); } if (!get_sys_random_bytes(m_pKeyBuf->m_buf, GetMasterKeyLength())) { - error_mes = L"unable to generate master key\n"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_GENERATE_MASTER_KEY); throw(-1); } @@ -960,7 +968,7 @@ bool CryptConfig::create(const WCHAR *path, const WCHAR *specified_config_file_p if (vol.size() > MAX_VOLUME_NAME_LENGTH) vol.erase(MAX_VOLUME_NAME_LENGTH, wstring::npos); if (!encrypt_string_gcm(vol, GetGcmContentKey(), volume_name_utf8)) { - error_mes = L"cannot encrypt volume name\n"; + error_mes = LocUtils::GetStringFromResources(IDS_CANNOT_ENCRYPT_VOLUME_NAME); throw(-1); } } @@ -969,12 +977,12 @@ bool CryptConfig::create(const WCHAR *path, const WCHAR *specified_config_file_p auto fl = File.get(); if (!fl) { - error_mes = L"cannot create config file\n"; + error_mes = LocUtils::GetStringFromResources(IDS_CANNOT_CREATE_CONF); throw(-1); } if (!fl) { - error_mes = L"unable to open config file for writing\n"; + error_mes = LocUtils::GetStringFromResources(IDS_UNABLE_OPEN_WRITE_CONF); throw(-1); } @@ -1037,7 +1045,7 @@ bool CryptConfig::create(const WCHAR *path, const WCHAR *specified_config_file_p if (m_DirIV && !m_reverse) { if (!create_dir_iv(NULL, &m_basedir[0])) { - error_mes = L"cannot create diriv file\n"; + error_mes = LocUtils::GetStringFromResources(IDS_CANNOT_CREATE_DIRIV); throw(-1); } } @@ -1045,7 +1053,7 @@ bool CryptConfig::create(const WCHAR *path, const WCHAR *specified_config_file_p } catch (...) { if (error_mes.size() < 1) - error_mes = L"memory allocation failure\n"; + error_mes = LocUtils::GetStringFromResources(IDS_MEMORY_ALLOCATION_FAILURE); bret = false; } diff --git a/libcppcryptfs/libcppcryptfs.vcxproj b/libcppcryptfs/libcppcryptfs.vcxproj index 5e1647f..d7ca69f 100644 --- a/libcppcryptfs/libcppcryptfs.vcxproj +++ b/libcppcryptfs/libcppcryptfs.vcxproj @@ -169,6 +169,7 @@ + @@ -202,6 +203,10 @@ + + NotUsing + NotUsing + diff --git a/libcppcryptfs/libcppcryptfs.vcxproj.filters b/libcppcryptfs/libcppcryptfs.vcxproj.filters index a334313..b916f8d 100644 --- a/libcppcryptfs/libcppcryptfs.vcxproj.filters +++ b/libcppcryptfs/libcppcryptfs.vcxproj.filters @@ -28,6 +28,7 @@ + @@ -61,5 +62,6 @@ + \ No newline at end of file From 2a47678b65641ebf4dbccc9a0cf5b242c036f1ea Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Wed, 11 Feb 2026 21:29:19 +0300 Subject: [PATCH 17/22] format --- cppcryptfs/dokan/cryptdokan.cpp | 5 +---- libcppcryptfs/libcppcryptfs.vcxproj.filters | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cppcryptfs/dokan/cryptdokan.cpp b/cppcryptfs/dokan/cryptdokan.cpp index 7c0653e..fec317c 100755 --- a/cppcryptfs/dokan/cryptdokan.cpp +++ b/cppcryptfs/dokan/cryptdokan.cpp @@ -2388,10 +2388,7 @@ BOOL unmount_crypt_fs(const WCHAR* mountpoint, bool wait, wstring& mes) { bool res = MountPointManager::getInstance().wait_and_destroy(mpstr.c_str()); if (!res) { CString strMsg; - strMsg.Format( - LocUtils::GetStringFromResources(IDS_WAIT_UNMOUNT_ERROR) - .c_str(), - GetWindowsErrorString(GetLastError())); + strMsg.Format(LocUtils::GetStringFromResources(IDS_WAIT_UNMOUNT_ERROR).c_str(), GetWindowsErrorString(GetLastError())); mes += strMsg; } return res; diff --git a/libcppcryptfs/libcppcryptfs.vcxproj.filters b/libcppcryptfs/libcppcryptfs.vcxproj.filters index b916f8d..f703660 100644 --- a/libcppcryptfs/libcppcryptfs.vcxproj.filters +++ b/libcppcryptfs/libcppcryptfs.vcxproj.filters @@ -64,4 +64,4 @@ - \ No newline at end of file + From f8446dd67daf0ce3d81e2a3448809196a98a5a28 Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Sat, 14 Feb 2026 21:52:25 +0300 Subject: [PATCH 18/22] localization-independent text in registry --- cppcryptfs/cppcryptfs.rc | Bin 69782 -> 69766 bytes cppcryptfs/ui/CreatePropertyPage.cpp | 19 +++++++++++++++++-- cppcryptfs/ui/FsInfoDialog.cpp | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index e465518b1f598b24114f2a7235b108910e087adb..3ed2fd7c0eace92db850c9bf96019cd27f739a05 100644 GIT binary patch delta 61 zcmbQXkfm)Q%Z3u}$p^SZCiif!0n!qa&#`kf$M9^A;bG)sn%q_?GP#b4Z~6p2#sVmZ LW4i)BV;Lg=vqThW delta 67 zcmZo$$TDpq%Z3teR(%G22BnFG!jn6=*DwP)llOB;PCm!Z(Hz3FJ%opmj|n6=J&})b OGK?X+U4Wmlj1d5coe?1b diff --git a/cppcryptfs/ui/CreatePropertyPage.cpp b/cppcryptfs/ui/CreatePropertyPage.cpp index 8a8c2d2..2b1c381 100755 --- a/cppcryptfs/ui/CreatePropertyPage.cpp +++ b/cppcryptfs/ui/CreatePropertyPage.cpp @@ -294,7 +294,15 @@ void CCreatePropertyPage::CreateCryptfs() if (nenc < 0 || nenc >= NUM_FN_ENC_TYPES) return; - theApp.WriteProfileStringW(L"CreateOptions", L"FilenameEncryption", filename_encryption_types[nenc]); + //To save localization-independent text in the registry + CString filename_encryption_type_for_registry; + if (filename_encryption_types[nenc] == strMsgPlainText) { + filename_encryption_type_for_registry = L"Plain text"; + } else { + filename_encryption_type_for_registry = filename_encryption_types[nenc]; + } + + theApp.WriteProfileStringW(L"CreateOptions", L"FilenameEncryption", filename_encryption_type_for_registry); pLbox = (CComboBox*)GetDlgItem(IDC_DATA_ENCRYPTION); if (!pLbox) @@ -380,7 +388,14 @@ BOOL CCreatePropertyPage::OnInitDialog() CString creverse = theApp.GetProfileStringW(L"CreateOptions", L"Reverse", L"0"); - CString cfnenc = theApp.GetProfileStringW(L"CreateOptions", L"FilenameEncryption", L"AES256-EME"); + //To extract localization-independent text from the registry + CString cfnenc; + CString cfnenc_tmp = theApp.GetProfileStringW(L"CreateOptions", L"FilenameEncryption", L"AES256-EME"); + if (cfnenc_tmp == L"Plain text") { + cfnenc = strMsgPlainText; + } else { + cfnenc = cfnenc_tmp; + } CString cdataenc = theApp.GetProfileStringW(L"CreateOptions", L"DataEncryption", L"AES256-GCM"); diff --git a/cppcryptfs/ui/FsInfoDialog.cpp b/cppcryptfs/ui/FsInfoDialog.cpp index 06298e9..845d611 100644 --- a/cppcryptfs/ui/FsInfoDialog.cpp +++ b/cppcryptfs/ui/FsInfoDialog.cpp @@ -108,6 +108,7 @@ BOOL CFsInfoDialog::OnInitDialog() SetDlgItemText(IDC_MOUNT_POINT, m_mountPoint); SetDlgItemText(IDC_CONFIG_PATH, m_info.configPath.c_str()); + //To display localized text in the GUI LPCWSTR none = strMsgNone; if (m_info.fileNameEncryption == L"none") { SetDlgItemText(IDC_FILE_NAME_ENCRYPTION, none); From 698544484dc6acae88ada028f45531cc27b6e274 Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Wed, 18 Feb 2026 12:00:33 +0300 Subject: [PATCH 19/22] spelling --- cppcryptfs/cppcryptfs.rc | Bin 69766 -> 69766 bytes cppcryptfs/dokan/cryptdokan.cpp | 2 +- cppcryptfs/resource.h | Bin 25874 -> 25874 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index 3ed2fd7c0eace92db850c9bf96019cd27f739a05..ec7200144e769119c1fb432f249bc7252aa9e6a3 100644 GIT binary patch delta 24 gcmZo$$kMiuWkbPbMvuw)mlY=)OcUF@;_^Kk0EIIPKmY&$ delta 18 acmZo$$kMiuWkbQ`$wikHHcz Date: Wed, 18 Feb 2026 12:37:24 +0300 Subject: [PATCH 20/22] formatting --- cppcryptfs/ui/CreatePropertyPage.cpp | 10 ++++---- cppcryptfs/ui/CryptAboutPropertyPage.cpp | 32 ++++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cppcryptfs/ui/CreatePropertyPage.cpp b/cppcryptfs/ui/CreatePropertyPage.cpp index 2b1c381..46f6f97 100755 --- a/cppcryptfs/ui/CreatePropertyPage.cpp +++ b/cppcryptfs/ui/CreatePropertyPage.cpp @@ -43,11 +43,11 @@ THE SOFTWARE. #include "util/util.h" #include "locutils.h" -static CString strMsgPlainText = LocUtils::GetStringFromResources(IDS_PLAIN_TEXT).c_str(); +static CString listBoxStringPlainText = LocUtils::GetStringFromResources(IDS_PLAIN_TEXT).c_str(); static const WCHAR *filename_encryption_types[] = { L"AES256-EME", - strMsgPlainText + listBoxStringPlainText }; #define NUM_FN_ENC_TYPES (sizeof(filename_encryption_types)/sizeof(filename_encryption_types[0])) @@ -205,7 +205,7 @@ void CCreatePropertyPage::CreateCryptfs() if (cfenc == L"AES256-EME") eme = true; - else if (cfenc == strMsgPlainText) + else if (cfenc == listBoxStringPlainText) plaintext = true; if (!plaintext) { @@ -296,7 +296,7 @@ void CCreatePropertyPage::CreateCryptfs() //To save localization-independent text in the registry CString filename_encryption_type_for_registry; - if (filename_encryption_types[nenc] == strMsgPlainText) { + if (filename_encryption_types[nenc] == listBoxStringPlainText) { filename_encryption_type_for_registry = L"Plain text"; } else { filename_encryption_type_for_registry = filename_encryption_types[nenc]; @@ -392,7 +392,7 @@ BOOL CCreatePropertyPage::OnInitDialog() CString cfnenc; CString cfnenc_tmp = theApp.GetProfileStringW(L"CreateOptions", L"FilenameEncryption", L"AES256-EME"); if (cfnenc_tmp == L"Plain text") { - cfnenc = strMsgPlainText; + cfnenc = listBoxStringPlainText; } else { cfnenc = cfnenc_tmp; } diff --git a/cppcryptfs/ui/CryptAboutPropertyPage.cpp b/cppcryptfs/ui/CryptAboutPropertyPage.cpp index e642a3a..749d63f 100755 --- a/cppcryptfs/ui/CryptAboutPropertyPage.cpp +++ b/cppcryptfs/ui/CryptAboutPropertyPage.cpp @@ -104,24 +104,24 @@ BEGIN_MESSAGE_MAP(CCryptAboutPropertyPage, CCryptPropertyPage) ON_NOTIFY(LVN_ITEMCHANGED, IDC_COMPONENTS_LIST, &CCryptAboutPropertyPage::OnItemchangedComponentsList) END_MESSAGE_MAP() -static CString strMsgCppcryptfs = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_CPPCRYPTFS).c_str(); -static CString strMsgOpenSSL = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_OPENSSL).c_str(); -static CString strMsgRapidJSON = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_RAPIDJSON).c_str(); -static CString strMsgDokanyMir = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_MIR).c_str(); -static CString strMsgDokanyLib = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_LIB).c_str(); -static CString strMsgSecuryEdit = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_SECURE_EDIT).c_str(); -static CString strMsgGetOpt = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_GETOPT_PORT).c_str(); -static CString strMsgAESSIV = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_AES_SIV).c_str(); +static CString listBoxStringCppcryptfs = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_CPPCRYPTFS).c_str(); +static CString listBoxStringOpenSSL = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_OPENSSL).c_str(); +static CString listBoxStringRapidJSON = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_RAPIDJSON).c_str(); +static CString listBoxStringDokanyMir = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_MIR).c_str(); +static CString listBoxStringDokanyLib = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_LIB).c_str(); +static CString listBoxStringSecuryEdit = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_SECURE_EDIT).c_str(); +static CString listBoxStringGetOpt = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_GETOPT_PORT).c_str(); +static CString listBoxStringAESSIV = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_AES_SIV).c_str(); static const WCHAR* components[] = { - strMsgCppcryptfs, - strMsgOpenSSL, - strMsgRapidJSON, - strMsgDokanyMir, - strMsgDokanyLib, - strMsgSecuryEdit, - strMsgGetOpt, - strMsgAESSIV, + listBoxStringCppcryptfs, + listBoxStringOpenSSL, + listBoxStringRapidJSON, + listBoxStringDokanyMir, + listBoxStringDokanyLib, + listBoxStringSecuryEdit, + listBoxStringGetOpt, + listBoxStringAESSIV, NULL }; From 87e820603aa8187c9510abd727f92024f4bb575c Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Wed, 18 Feb 2026 13:11:14 +0300 Subject: [PATCH 21/22] frm --- cppcryptfs/ui/CryptAboutPropertyPage.cpp | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/cppcryptfs/ui/CryptAboutPropertyPage.cpp b/cppcryptfs/ui/CryptAboutPropertyPage.cpp index 749d63f..c6f61fe 100755 --- a/cppcryptfs/ui/CryptAboutPropertyPage.cpp +++ b/cppcryptfs/ui/CryptAboutPropertyPage.cpp @@ -104,24 +104,24 @@ BEGIN_MESSAGE_MAP(CCryptAboutPropertyPage, CCryptPropertyPage) ON_NOTIFY(LVN_ITEMCHANGED, IDC_COMPONENTS_LIST, &CCryptAboutPropertyPage::OnItemchangedComponentsList) END_MESSAGE_MAP() -static CString listBoxStringCppcryptfs = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_CPPCRYPTFS).c_str(); -static CString listBoxStringOpenSSL = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_OPENSSL).c_str(); -static CString listBoxStringRapidJSON = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_RAPIDJSON).c_str(); -static CString listBoxStringDokanyMir = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_MIR).c_str(); -static CString listBoxStringDokanyLib = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_LIB).c_str(); -static CString listBoxStringSecuryEdit = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_SECURE_EDIT).c_str(); -static CString listBoxStringGetOpt = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_GETOPT_PORT).c_str(); -static CString listBoxStringAESSIV = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_AES_SIV).c_str(); +static CString listViewStringCppcryptfs = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_CPPCRYPTFS).c_str(); +static CString listViewStringOpenSSL = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_OPENSSL).c_str(); +static CString listViewStringRapidJSON = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_RAPIDJSON).c_str(); +static CString listViewStringDokanyMir = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_MIR).c_str(); +static CString listViewStringDokanyLib = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_DOKANY_LIB).c_str(); +static CString listViewStringSecuryEdit = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_SECURE_EDIT).c_str(); +static CString listViewStringGetOpt = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_GETOPT_PORT).c_str(); +static CString listViewStringAESSIV = LocUtils::GetStringFromResources(IDS_LVIEW_COPYRIGHT_AES_SIV).c_str(); static const WCHAR* components[] = { - listBoxStringCppcryptfs, - listBoxStringOpenSSL, - listBoxStringRapidJSON, - listBoxStringDokanyMir, - listBoxStringDokanyLib, - listBoxStringSecuryEdit, - listBoxStringGetOpt, - listBoxStringAESSIV, + listViewStringCppcryptfs, + listViewStringOpenSSL, + listViewStringRapidJSON, + listViewStringDokanyMir, + listViewStringDokanyLib, + listViewStringSecuryEdit, + listViewStringGetOpt, + listViewStringAESSIV, NULL }; From 07b2de8e532ab230ac27b768ca5168a4f392e90b Mon Sep 17 00:00:00 2001 From: nbb1967 Date: Wed, 18 Feb 2026 13:45:41 +0300 Subject: [PATCH 22/22] frm2 --- cppcryptfs/cppcryptfs.rc | Bin 69766 -> 69766 bytes cppcryptfs/resource.h | Bin 25874 -> 25874 bytes cppcryptfs/ui/MountPropertyPage.cpp | 2 +- cppcryptfs/ui/SettingsPropertyPage.cpp | 42 ++++++++++++------------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cppcryptfs/cppcryptfs.rc b/cppcryptfs/cppcryptfs.rc index ec7200144e769119c1fb432f249bc7252aa9e6a3..e5ecd89f16b435fab24ca65e15c34222f943b77a 100644 GIT binary patch delta 38 wcmV+>0NMYBp#+AZ1hCSqlW43A2Sor(07U>)lb^03lYl`ElfcFZvmC8zVZ;lh&;s*eFu?Tno delta 30 kcmbPqigD5@#tklF+%62R3_d^{!r(gDHbilAf!HEH0FW#Q@c;k- diff --git a/cppcryptfs/ui/MountPropertyPage.cpp b/cppcryptfs/ui/MountPropertyPage.cpp index 47f2853..13c6aa5 100644 --- a/cppcryptfs/ui/MountPropertyPage.cpp +++ b/cppcryptfs/ui/MountPropertyPage.cpp @@ -1760,7 +1760,7 @@ void CMountPropertyPage::OnContextMenu(CWnd* pWnd, CPoint point) menu.AppendMenu(MF_ENABLED, DismountV, LocUtils::GetStringFromResources(IDS_MENU_DISMOUNT).c_str()); } if (is_mountpoint_a_dir(cmp)) { - menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, LocUtils::GetStringFromResources(IDS_DELETE_MOUNT_POINT).c_str()); + menu.AppendMenu(mounted ? MF_DISABLED : MF_ENABLED, DeleteMountPointV, LocUtils::GetStringFromResources(IDS_MENU_DELETE_MPOINT).c_str()); } } diff --git a/cppcryptfs/ui/SettingsPropertyPage.cpp b/cppcryptfs/ui/SettingsPropertyPage.cpp index 69fc145..37c0e51 100644 --- a/cppcryptfs/ui/SettingsPropertyPage.cpp +++ b/cppcryptfs/ui/SettingsPropertyPage.cpp @@ -96,27 +96,27 @@ static buffer_size_t buffer_sizes[] = { 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2 static int ttls[] = { 0, 1, 2, 5, 10, 15, 30, 45, 60, 90, 120, 300, 600, 900, 1800, 3600}; -static CString ttl_0 = LocUtils::GetStringFromResources(IDS_TTL_INFINITE).c_str(); -static CString ttl_1 = LocUtils::GetStringFromResources(IDS_TTL_SEC_1).c_str(); -static CString ttl_2 = LocUtils::GetStringFromResources(IDS_TTL_SEC_2).c_str(); -static CString ttl_5 = LocUtils::GetStringFromResources(IDS_TTL_SEC_5).c_str(); -static CString ttl_10 = LocUtils::GetStringFromResources(IDS_TTL_SEC_10).c_str(); -static CString ttl_15 = LocUtils::GetStringFromResources(IDS_TTL_SEC_15).c_str(); -static CString ttl_30 = LocUtils::GetStringFromResources(IDS_TTL_SEC_30).c_str(); -static CString ttl_45 = LocUtils::GetStringFromResources(IDS_TTL_SEC_45).c_str(); -static CString ttl_60 = LocUtils::GetStringFromResources(IDS_TTL_SEC_60).c_str(); -static CString ttl_90 = LocUtils::GetStringFromResources(IDS_TTL_SEC_90).c_str(); -static CString ttl_120 = LocUtils::GetStringFromResources(IDS_TTL_MIN_2).c_str(); -static CString ttl_300 = LocUtils::GetStringFromResources(IDS_TTL_MIN_5).c_str(); -static CString ttl_600 = LocUtils::GetStringFromResources(IDS_TTL_MIN_10).c_str(); -static CString ttl_900 = LocUtils::GetStringFromResources(IDS_TTL_MIN_15).c_str(); -static CString ttl_1800 = LocUtils::GetStringFromResources(IDS_TTL_MIN_30).c_str(); -static CString ttl_3600 = LocUtils::GetStringFromResources(IDS_TTL_HOUR_1).c_str(); - -static const WCHAR* ttl_strings[] = { ttl_0, ttl_1, ttl_2, ttl_5, - ttl_10, ttl_15, ttl_30, ttl_45, - ttl_60, ttl_90, ttl_120, ttl_300, - ttl_600, ttl_900, ttl_1800, ttl_3600 }; +static CString listBoxStringInfinite = LocUtils::GetStringFromResources(IDS_TTL_INFINITE).c_str(); +static CString listBoxStringSec1 = LocUtils::GetStringFromResources(IDS_TTL_SEC_1).c_str(); +static CString listBoxStringSec2 = LocUtils::GetStringFromResources(IDS_TTL_SEC_2).c_str(); +static CString listBoxStringSec5 = LocUtils::GetStringFromResources(IDS_TTL_SEC_5).c_str(); +static CString listBoxStringSec10 = LocUtils::GetStringFromResources(IDS_TTL_SEC_10).c_str(); +static CString listBoxStringSec15 = LocUtils::GetStringFromResources(IDS_TTL_SEC_15).c_str(); +static CString listBoxStringSec30 = LocUtils::GetStringFromResources(IDS_TTL_SEC_30).c_str(); +static CString listBoxStringSec45 = LocUtils::GetStringFromResources(IDS_TTL_SEC_45).c_str(); +static CString listBoxStringSec60 = LocUtils::GetStringFromResources(IDS_TTL_SEC_60).c_str(); +static CString listBoxStringSec90 = LocUtils::GetStringFromResources(IDS_TTL_SEC_90).c_str(); +static CString listBoxStringMin2 = LocUtils::GetStringFromResources(IDS_TTL_MIN_2).c_str(); +static CString listBoxStringMin5 = LocUtils::GetStringFromResources(IDS_TTL_MIN_5).c_str(); +static CString listBoxStringMin10 = LocUtils::GetStringFromResources(IDS_TTL_MIN_10).c_str(); +static CString listBoxStringMin15 = LocUtils::GetStringFromResources(IDS_TTL_MIN_15).c_str(); +static CString listBoxStringMin30 = LocUtils::GetStringFromResources(IDS_TTL_MIN_30).c_str(); +static CString listBoxStringHour1 = LocUtils::GetStringFromResources(IDS_TTL_HOUR_1).c_str(); + +static const WCHAR* ttl_strings[] = { listBoxStringInfinite, listBoxStringSec1, listBoxStringSec2, listBoxStringSec5, + listBoxStringSec10, listBoxStringSec15, listBoxStringSec30, listBoxStringSec45, + listBoxStringSec60, listBoxStringSec90, listBoxStringMin2, listBoxStringMin5, + listBoxStringMin10, listBoxStringMin15, listBoxStringMin30, listBoxStringHour1 }; BOOL CSettingsPropertyPage::OnInitDialog() {