[Ttssh2-commit] [7182] ttpdlg.dll, ttpfile.dll の関数の呼び出し方を修正(GetProcAddress を使うように統一)

scmno****@osdn***** scmno****@osdn*****
2018年 8月 18日 (土) 14:38:58 JST


Revision: 7182
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7182
Author:   maya
Date:     2018-08-18 14:38:58 +0900 (Sat, 18 Aug 2018)
Log Message:
-----------
ttpdlg.dll, ttpfile.dll の関数の呼び出し方を修正(GetProcAddress を使うように統一)

c.f. ttssh2-devel 3467

修正前の呼び出しをコミットした箇所:
https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/ttdlg/ttdlg.c?hideattic=0&r1=1.62&r2=1.63
https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/teraterm/ttdialog.c?hideattic=0&r1=1.2&r2=1.3
https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/teraterm/ttdialog.h?hideattic=0&r1=1.3&r2=1.4
https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/teraterm/filesys.cpp?hideattic=0&r1=1.23&r2=1.24
https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/ttfile/ftlib.h?hideattic=0&r1=1.7&r2=1.8

Revision Links:
--------------
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/1
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/2
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/1
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/2
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/1
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/2
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/1
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/2
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/1
    http://sourceforge.jp/projects/ttssh2/scm/svn/commits/2

Modified Paths:
--------------
    trunk/teraterm/teraterm/filesys.cpp
    trunk/teraterm/teraterm/filesys.h
    trunk/teraterm/teraterm/ttdialog.c
    trunk/teraterm/teraterm/ttdialog.h
    trunk/teraterm/ttpfile/ftlib.h

Removed Paths:
-------------
    trunk/teraterm/ttpdlg/ttdlg.h

-------------- next part --------------
Modified: trunk/teraterm/teraterm/filesys.cpp
===================================================================
--- trunk/teraterm/teraterm/filesys.cpp	2018-08-18 02:49:25 UTC (rev 7181)
+++ trunk/teraterm/teraterm/filesys.cpp	2018-08-18 05:38:58 UTC (rev 7182)
@@ -100,6 +100,8 @@
 PProtoParse ProtoParse;
 PProtoTimeOutProc ProtoTimeOutProc;
 PProtoCancel ProtoCancel;
+PTTFILESetUILanguageFile TTFILESetUILanguageFile;
+PTTFILESetFileSendFilter TTFILESetFileSendFilter;
 
 #define IdGetSetupFname  1
 #define IdGetTransFname  2
@@ -113,6 +115,9 @@
 #define IdProtoTimeOutProc 9
 #define IdProtoCancel	 10
 
+#define IdTTFILESetUILanguageFile 11
+#define IdTTFILESetFileSendFilter 12
+
 /*
    Line Head flag for timestamping
    2007.05.24 Gentaro
@@ -148,10 +153,8 @@
 	if (HTTFILE == NULL)
 		return FALSE;
 
-	TTFILESetUILanguageFile(ts.UILanguageFile);
-	TTFILESetFileSendFilter(ts.FileSendFilter);
+	Err = FALSE;
 
-	Err = FALSE;
 	GetSetupFname = (PGetSetupFname)GetProcAddress(HTTFILE,
 	                                               MAKEINTRESOURCE(IdGetSetupFname));
 	if (GetSetupFname==NULL)
@@ -202,6 +205,24 @@
 	if (ProtoCancel==NULL)
 		Err = TRUE;
 
+	TTFILESetUILanguageFile = (PTTFILESetUILanguageFile)GetProcAddress(HTTFILE,
+	                                                                   MAKEINTRESOURCE(IdTTFILESetUILanguageFile));
+	if (TTFILESetUILanguageFile==NULL) {
+		Err = TRUE;
+	}
+	else {
+		TTFILESetUILanguageFile(ts.UILanguageFile);
+	}
+
+	TTFILESetFileSendFilter = (PTTFILESetFileSendFilter)GetProcAddress(HTTFILE,
+	                                                                   MAKEINTRESOURCE(IdTTFILESetFileSendFilter));
+	if (TTFILESetFileSendFilter==NULL) {
+		Err = TRUE;
+	}
+	else {
+		TTFILESetFileSendFilter(ts.FileSendFilter);
+	}
+
 	if (Err)
 	{
 		FreeLibrary(HTTFILE);

Modified: trunk/teraterm/teraterm/filesys.h
===================================================================
--- trunk/teraterm/teraterm/filesys.h	2018-08-18 02:49:25 UTC (rev 7181)
+++ trunk/teraterm/teraterm/filesys.h	2018-08-18 05:38:58 UTC (rev 7182)
@@ -50,6 +50,10 @@
   (int Proto, PFileVar fv, PCHAR pv, PComVar cv);
 typedef BOOL (PASCAL *PProtoCancel)
   (int Proto, PFileVar fv, PCHAR pv, PComVar cv);
+typedef BOOL (PASCAL *PTTFILESetUILanguageFile)
+  (char *file);
+typedef BOOL (PASCAL *PTTFILESetFileSendFilter)
+  (char *file);
 
 extern PGetSetupFname GetSetupFname;
 extern PGetTransFname GetTransFname;
@@ -61,6 +65,8 @@
 extern PProtoParse ProtoParse;
 extern PProtoTimeOutProc ProtoTimeOutProc;
 extern PProtoCancel ProtoCancel;
+extern PTTFILESetUILanguageFile TTFILESetUILanguageFile;
+extern PTTFILESetFileSendFilter TTFILESetFileSendFilter;
 
 BOOL LoadTTFILE();
 BOOL FreeTTFILE();

Modified: trunk/teraterm/teraterm/ttdialog.c
===================================================================
--- trunk/teraterm/teraterm/ttdialog.c	2018-08-18 02:49:25 UTC (rev 7181)
+++ trunk/teraterm/teraterm/ttdialog.c	2018-08-18 05:38:58 UTC (rev 7182)
@@ -49,6 +49,7 @@
 PChooseFontDlg ChooseFontDlg;
 PSetupGeneral SetupGeneral;
 PWindowWindow WindowWindow;
+PTTDLGSetUILanguageFile TTDLGSetUILanguageFile;
 
 #define IdSetupTerminal   1
 #define IdSetupWin        2
@@ -60,7 +61,8 @@
 #define IdAboutDialog     8
 #define IdChooseFontDlg   9
 #define IdSetupGeneral    10
-#define IdWindowWindow	  11
+#define IdWindowWindow    11
+#define IdTTDLGSetUILanguageFile  12
 
 BOOL LoadTTDLG()
 {
@@ -72,9 +74,8 @@
 		HTTDLG = LoadHomeDLL("TTPDLG.DLL");
 		if (HTTDLG==NULL) return FALSE;
 
-		TTDLGSetUILanguageFile(ts.UILanguageFile);
+		Err = FALSE;
 
-		Err = FALSE;
 		SetupTerminal = (PSetupTerminal)GetProcAddress(HTTDLG,
 		  MAKEINTRESOURCE(IdSetupTerminal));
 		if (SetupTerminal==NULL) {
@@ -141,6 +142,15 @@
 			Err = TRUE;
 		}
 
+		TTDLGSetUILanguageFile = (PTTDLGSetUILanguageFile)GetProcAddress(HTTDLG,
+		  MAKEINTRESOURCE(IdTTDLGSetUILanguageFile));
+		if (TTDLGSetUILanguageFile==NULL) {
+			Err = TRUE;
+		}
+		else {
+			TTDLGSetUILanguageFile(ts.UILanguageFile);
+		}
+
 		if (Err) {
 			FreeLibrary(HTTDLG);
 			HTTDLG = NULL;

Modified: trunk/teraterm/teraterm/ttdialog.h
===================================================================
--- trunk/teraterm/teraterm/ttdialog.h	2018-08-18 02:49:25 UTC (rev 7181)
+++ trunk/teraterm/teraterm/ttdialog.h	2018-08-18 05:38:58 UTC (rev 7182)
@@ -54,6 +54,8 @@
   (HWND WndParent, PTTSet ts);
 typedef BOOL (PASCAL *PWindowWindow)
   (HWND WndParent, PBOOL Close);
+typedef BOOL (PASCAL *PTTDLGSetUILanguageFile)
+  (char *file);
 
 extern PSetupTerminal SetupTerminal;
 extern PSetupWin SetupWin;
@@ -66,9 +68,8 @@
 extern PChooseFontDlg ChooseFontDlg;
 extern PSetupGeneral SetupGeneral;
 extern PWindowWindow WindowWindow;
+extern PTTDLGSetUILanguageFile TTDLGSetUILanguageFile;
 
-extern void PASCAL TTDLGSetUILanguageFile(char *file);
-
 /* proto types */
 BOOL LoadTTDLG();
 BOOL FreeTTDLG();

Deleted: trunk/teraterm/ttpdlg/ttdlg.h
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.h	2018-08-18 02:49:25 UTC (rev 7181)
+++ trunk/teraterm/ttpdlg/ttdlg.h	2018-08-18 05:38:58 UTC (rev 7182)
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2008-2017 TeraTerm 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. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
- */
-
-void PASCAL TTDLGSetUILanguageFile(char *file);

Modified: trunk/teraterm/ttpfile/ftlib.h
===================================================================
--- trunk/teraterm/ttpfile/ftlib.h	2018-08-18 02:49:25 UTC (rev 7181)
+++ trunk/teraterm/ttpfile/ftlib.h	2018-08-18 05:38:58 UTC (rev 7182)
@@ -40,12 +40,3 @@
 void FTSetTimeOut(PFileVar fv, int T);
 BOOL FTCreateFile(PFileVar fv);
 void GetFileSendFilter(PCHAR dest, PCHAR src, int size);
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-void PASCAL TTFILESetUILanguageFile(char *file);
-void PASCAL TTFILESetFileSendFilter(char *file);
-#ifdef __cplusplus
-}
-#endif



Ttssh2-commit メーリングリストの案内