Revision: 10542 https://osdn.net/projects/ttssh2/scm/svn/commits/10542 Author: zmatsuo Date: 2023-01-29 00:26:23 +0900 (Sun, 29 Jan 2023) Log Message: ----------- Proxy で UILanguageFile を UILanguageFileW に置き換え Modified Paths: -------------- trunk/TTProxy/ProxyWSockHook.h trunk/TTProxy/TTProxy.h -------------- next part -------------- Modified: trunk/TTProxy/ProxyWSockHook.h =================================================================== --- trunk/TTProxy/ProxyWSockHook.h 2023-01-28 15:26:13 UTC (rev 10541) +++ trunk/TTProxy/ProxyWSockHook.h 2023-01-28 15:26:23 UTC (rev 10542) @@ -17,17 +17,24 @@ #include "ttlib.h" #include "i18n.h" -extern char UILanguageFile[MAX_PATH]; extern wchar_t *UILanguageFileW; void UTIL_get_lang_msg(const char *key, PCHAR buf, int buf_len, const char *def) { - GetI18nStr("TTProxy", key, buf, buf_len, def, UILanguageFile); + wchar_t *b; + wchar_t *defW = ToWcharA(def); + GetI18nStrWW("TTProxy", key, UILanguageFileW, defW, &b); + free(defW); + WideCharToACP_t(b, buf, buf_len); + free(b); } void UTIL_get_lang_msgW(const char *key, wchar_t *buf, int buf_len, const wchar_t *def) { - GetI18nStrW("TTProxy", key, buf, buf_len, def, UILanguageFile); + wchar_t *b; + GetI18nStrWW("TTProxy", key, UILanguageFileW, def, &b); + wcscpy_s(buf, buf_len, b); + free(b); } class ProxyWSockHook { Modified: trunk/TTProxy/TTProxy.h =================================================================== --- trunk/TTProxy/TTProxy.h 2023-01-28 15:26:13 UTC (rev 10541) +++ trunk/TTProxy/TTProxy.h 2023-01-28 15:26:23 UTC (rev 10542) @@ -10,7 +10,6 @@ extern "C" __declspec(dllexport) BOOL WINAPI TTXBind(WORD Version, TTXExports* exports); -char UILanguageFile[MAX_PATH]; wchar_t *UILanguageFileW; class TTProxy : public DynamicLinkLibrary<TTProxy> { @@ -199,8 +198,6 @@ } static void copy_UILanguageFile() { - strncpy_s(UILanguageFile, sizeof(UILanguageFile), - getInstance().ts->UILanguageFile, _TRUNCATE); UILanguageFileW = getInstance().ts->UILanguageFileW; } @@ -254,7 +251,7 @@ { ID_ABOUTMENU, "MENU_ABOUT" }, { ID_PROXYSETUPMENU, "MENU_SETUP" }, }; - SetI18nMenuStrs("TTProxy", menu, MenuTextInfo, _countof(MenuTextInfo), getInstance().ts->UILanguageFile); + SetI18nMenuStrsW(menu, "TTProxy", MenuTextInfo, _countof(MenuTextInfo), getInstance().ts->UILanguageFileW); } static int PASCAL TTXProcessCommand(HWND hWin, WORD cmd) {