[Ttssh2-commit] [8700] getpassword の iniファイルアクセスを Unicode 化

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 4月 12日 (日) 00:55:35 JST


Revision: 8700
          https://osdn.net/projects/ttssh2/scm/svn/commits/8700
Author:   zmatsuo
Date:     2020-04-12 00:55:34 +0900 (Sun, 12 Apr 2020)
Log Message:
-----------
getpassword の iniファイルアクセスを Unicode 化

Modified Paths:
--------------
    trunk/teraterm/ttpmacro/ttl_gui.cpp

-------------- next part --------------
Modified: trunk/teraterm/ttpmacro/ttl_gui.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttl_gui.cpp	2020-04-11 15:55:27 UTC (rev 8699)
+++ trunk/teraterm/ttpmacro/ttl_gui.cpp	2020-04-11 15:55:34 UTC (rev 8700)
@@ -275,7 +275,7 @@
 WORD TTLGetPassword()
 {
 	TStrVal Str, Str2, Temp2;
-	TCHAR Temp[512];
+	wchar_t Temp[512];
 	WORD Err;
 	TVarId VarId;
 	int result = 0;  /* failure */
@@ -293,8 +293,8 @@
 
 	GetAbsPath(Str,sizeof(Str));
 
-	GetPrivateProfileString(_T("Password"),(tc)Str2,_T(""),
-							Temp,_countof(Temp), tc::fromUtf8(Str));
+	_GetPrivateProfileStringW(L"Password", (wc)Str2, L"",
+							  Temp, _countof(Temp), wc::fromUtf8(Str));
 	if (Temp[0]==0) // password not exist
 	{
 		wchar_t input_string[MaxStrLen];
@@ -304,7 +304,7 @@
 		if (Temp2[0]!=0) {
 			char TempA[512];
 			Encrypt(Temp2, TempA);
-			if (WritePrivateProfileString(_T("Password"), (tc)Str2, (tc)TempA, tc::fromUtf8(Str)) != 0) {
+			if (_WritePrivateProfileStringW(L"Password", (wc)Str2, (wc)TempA, wc::fromUtf8(Str)) != 0) {
 				result = 1;  /* success */
 			}
 		}


Ttssh2-commit メーリングリストの案内
Back to archive index