[ttssh2-commit] [9430] plugin ReadKeyboardCnf() のファイル名を Unicode化

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 9月 20日 (月) 00:14:06 JST


Revision: 9430
          https://osdn.net/projects/ttssh2/scm/svn/commits/9430
Author:   zmatsuo
Date:     2021-09-20 00:14:05 +0900 (Mon, 20 Sep 2021)
Log Message:
-----------
plugin ReadKeyboardCnf() のファイル名を Unicode化

Modified Paths:
--------------
    trunk/teraterm/teraterm/keyboard.c
    trunk/teraterm/teraterm/ttsetup.h
    trunk/teraterm/ttpset/ttset_keyboard.c
    trunk/teraterm/ttpset/ttset_keyboard_entry.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/keyboard.c
===================================================================
--- trunk/teraterm/teraterm/keyboard.c	2021-09-19 15:13:51 UTC (rev 9429)
+++ trunk/teraterm/teraterm/keyboard.c	2021-09-19 15:14:05 UTC (rev 9430)
@@ -131,7 +131,7 @@
 	}
 
 	if (LoadTTSET())
-		(*ReadKeyboardCnf)(ts.KeyCnfFN, KeyMap, TRUE);
+		(*ReadKeyboardCnf)(ts.KeyCnfFNW, KeyMap, TRUE);
 	FreeTTSET();
 }
 

Modified: trunk/teraterm/teraterm/ttsetup.h
===================================================================
--- trunk/teraterm/teraterm/ttsetup.h	2021-09-19 15:13:51 UTC (rev 9429)
+++ trunk/teraterm/teraterm/ttsetup.h	2021-09-19 15:14:05 UTC (rev 9430)
@@ -44,8 +44,8 @@
 typedef void (PASCAL *PReadIniFile)(const wchar_t *FName, PTTSet ts);
 //typedef void (PASCAL *PWriteIniFile)(PCHAR FName, PTTSet ts);
 typedef void (PASCAL *PWriteIniFile)(const wchar_t *FName, PTTSet ts);
-typedef void (PASCAL *PReadKeyboardCnf)
-  (PCHAR FName, PKeyMap KeyMap, BOOL ShowWarning);
+//typedef void (PASCAL *PReadKeyboardCnf)(PCHAR FName, PKeyMap KeyMap, BOOL ShowWarning);
+typedef void (PASCAL *PReadKeyboardCnf)(const wchar_t *FName, PKeyMap KeyMap, BOOL ShowWarning);
 typedef void (PASCAL *PCopyHostList)
   (PCHAR IniSrc, PCHAR IniDest);
 typedef void (PASCAL *PAddHostToList)

Modified: trunk/teraterm/ttpset/ttset_keyboard.c
===================================================================
--- trunk/teraterm/ttpset/ttset_keyboard.c	2021-09-19 15:13:51 UTC (rev 9429)
+++ trunk/teraterm/ttpset/ttset_keyboard.c	2021-09-19 15:14:05 UTC (rev 9430)
@@ -239,10 +239,9 @@
  *		ttpset.dll ttste_keyboard_entry.c \x82\xCC ReadKeyboardCnf() \x82\xA9\x82炱\x82\xB1\x82\xAA\x83R\x81[\x83\x8B\x82\xB3\x82\xEA\x82\xE9
  *		KeyMap \x82͏\x89\x8A\xFA\x89\xBB\x8Dς\xDD
  */
-__declspec(dllexport) void ReadKeyboardCnfExe(PCHAR FNameA, PKeyMap KeyMap, BOOL ShowWarning)
+__declspec(dllexport) void ReadKeyboardCnfExe(const wchar_t *FName, PKeyMap KeyMap, BOOL ShowWarning)
 {
 	int i, j;
-	const wchar_t *FName = ToWcharA(FNameA);
 
 	ReadKeyboardMap(KeyMap, FName);
 	ReadUserkeysSection(FName, KeyMap);
@@ -263,6 +262,4 @@
 					}
 					KeyMap->Map[i] = 0xFFFF;
 				}
-
-	free((void *)FName);
 }

Modified: trunk/teraterm/ttpset/ttset_keyboard_entry.c
===================================================================
--- trunk/teraterm/ttpset/ttset_keyboard_entry.c	2021-09-19 15:13:51 UTC (rev 9429)
+++ trunk/teraterm/ttpset/ttset_keyboard_entry.c	2021-09-19 15:14:05 UTC (rev 9430)
@@ -32,13 +32,13 @@
 #include "dllutil.h"
 #include "../teraterm/keyboard_i.h"
 
-void PASCAL ReadKeyboardCnf(PCHAR FNameA, PKeyMap KeyMap, BOOL ShowWarning)
+void PASCAL ReadKeyboardCnf(const wchar_t *FName, PKeyMap KeyMap, BOOL ShowWarning)
 {
-	void (*ReadKeyboardCnfExe)(PCHAR FNameA, PKeyMap KeyMap, BOOL ShowWarning);
+	void (*ReadKeyboardCnfExe)(const wchar_t *FName, PKeyMap KeyMap, BOOL ShowWarning);
 	DWORD r = DLLGetApiAddress(L"ttermpro.exe", DLL_LOAD_LIBRARY_CURRENT, "ReadKeyboardCnfExe", (void **)&ReadKeyboardCnfExe);
 	if (r != NO_ERROR) {
 		return;
 	}
 
-	ReadKeyboardCnfExe(FNameA, KeyMap, ShowWarning);
+	ReadKeyboardCnfExe(FName, KeyMap, ShowWarning);
 }


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