リビジョン | 7182 (tree) |
---|---|
日時 | 2018-08-18 14:38:58 |
作者 | (del#1144) |
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
@@ -100,6 +100,8 @@ | ||
100 | 100 | PProtoParse ProtoParse; |
101 | 101 | PProtoTimeOutProc ProtoTimeOutProc; |
102 | 102 | PProtoCancel ProtoCancel; |
103 | +PTTFILESetUILanguageFile TTFILESetUILanguageFile; | |
104 | +PTTFILESetFileSendFilter TTFILESetFileSendFilter; | |
103 | 105 | |
104 | 106 | #define IdGetSetupFname 1 |
105 | 107 | #define IdGetTransFname 2 |
@@ -113,6 +115,9 @@ | ||
113 | 115 | #define IdProtoTimeOutProc 9 |
114 | 116 | #define IdProtoCancel 10 |
115 | 117 | |
118 | +#define IdTTFILESetUILanguageFile 11 | |
119 | +#define IdTTFILESetFileSendFilter 12 | |
120 | + | |
116 | 121 | /* |
117 | 122 | Line Head flag for timestamping |
118 | 123 | 2007.05.24 Gentaro |
@@ -148,10 +153,8 @@ | ||
148 | 153 | if (HTTFILE == NULL) |
149 | 154 | return FALSE; |
150 | 155 | |
151 | - TTFILESetUILanguageFile(ts.UILanguageFile); | |
152 | - TTFILESetFileSendFilter(ts.FileSendFilter); | |
156 | + Err = FALSE; | |
153 | 157 | |
154 | - Err = FALSE; | |
155 | 158 | GetSetupFname = (PGetSetupFname)GetProcAddress(HTTFILE, |
156 | 159 | MAKEINTRESOURCE(IdGetSetupFname)); |
157 | 160 | if (GetSetupFname==NULL) |
@@ -202,6 +205,24 @@ | ||
202 | 205 | if (ProtoCancel==NULL) |
203 | 206 | Err = TRUE; |
204 | 207 | |
208 | + TTFILESetUILanguageFile = (PTTFILESetUILanguageFile)GetProcAddress(HTTFILE, | |
209 | + MAKEINTRESOURCE(IdTTFILESetUILanguageFile)); | |
210 | + if (TTFILESetUILanguageFile==NULL) { | |
211 | + Err = TRUE; | |
212 | + } | |
213 | + else { | |
214 | + TTFILESetUILanguageFile(ts.UILanguageFile); | |
215 | + } | |
216 | + | |
217 | + TTFILESetFileSendFilter = (PTTFILESetFileSendFilter)GetProcAddress(HTTFILE, | |
218 | + MAKEINTRESOURCE(IdTTFILESetFileSendFilter)); | |
219 | + if (TTFILESetFileSendFilter==NULL) { | |
220 | + Err = TRUE; | |
221 | + } | |
222 | + else { | |
223 | + TTFILESetFileSendFilter(ts.FileSendFilter); | |
224 | + } | |
225 | + | |
205 | 226 | if (Err) |
206 | 227 | { |
207 | 228 | FreeLibrary(HTTFILE); |
@@ -50,6 +50,10 @@ | ||
50 | 50 | (int Proto, PFileVar fv, PCHAR pv, PComVar cv); |
51 | 51 | typedef BOOL (PASCAL *PProtoCancel) |
52 | 52 | (int Proto, PFileVar fv, PCHAR pv, PComVar cv); |
53 | +typedef BOOL (PASCAL *PTTFILESetUILanguageFile) | |
54 | + (char *file); | |
55 | +typedef BOOL (PASCAL *PTTFILESetFileSendFilter) | |
56 | + (char *file); | |
53 | 57 | |
54 | 58 | extern PGetSetupFname GetSetupFname; |
55 | 59 | extern PGetTransFname GetTransFname; |
@@ -61,6 +65,8 @@ | ||
61 | 65 | extern PProtoParse ProtoParse; |
62 | 66 | extern PProtoTimeOutProc ProtoTimeOutProc; |
63 | 67 | extern PProtoCancel ProtoCancel; |
68 | +extern PTTFILESetUILanguageFile TTFILESetUILanguageFile; | |
69 | +extern PTTFILESetFileSendFilter TTFILESetFileSendFilter; | |
64 | 70 | |
65 | 71 | BOOL LoadTTFILE(); |
66 | 72 | BOOL FreeTTFILE(); |
@@ -49,6 +49,7 @@ | ||
49 | 49 | PChooseFontDlg ChooseFontDlg; |
50 | 50 | PSetupGeneral SetupGeneral; |
51 | 51 | PWindowWindow WindowWindow; |
52 | +PTTDLGSetUILanguageFile TTDLGSetUILanguageFile; | |
52 | 53 | |
53 | 54 | #define IdSetupTerminal 1 |
54 | 55 | #define IdSetupWin 2 |
@@ -60,7 +61,8 @@ | ||
60 | 61 | #define IdAboutDialog 8 |
61 | 62 | #define IdChooseFontDlg 9 |
62 | 63 | #define IdSetupGeneral 10 |
63 | -#define IdWindowWindow 11 | |
64 | +#define IdWindowWindow 11 | |
65 | +#define IdTTDLGSetUILanguageFile 12 | |
64 | 66 | |
65 | 67 | BOOL LoadTTDLG() |
66 | 68 | { |
@@ -72,9 +74,8 @@ | ||
72 | 74 | HTTDLG = LoadHomeDLL("TTPDLG.DLL"); |
73 | 75 | if (HTTDLG==NULL) return FALSE; |
74 | 76 | |
75 | - TTDLGSetUILanguageFile(ts.UILanguageFile); | |
77 | + Err = FALSE; | |
76 | 78 | |
77 | - Err = FALSE; | |
78 | 79 | SetupTerminal = (PSetupTerminal)GetProcAddress(HTTDLG, |
79 | 80 | MAKEINTRESOURCE(IdSetupTerminal)); |
80 | 81 | if (SetupTerminal==NULL) { |
@@ -141,6 +142,15 @@ | ||
141 | 142 | Err = TRUE; |
142 | 143 | } |
143 | 144 | |
145 | + TTDLGSetUILanguageFile = (PTTDLGSetUILanguageFile)GetProcAddress(HTTDLG, | |
146 | + MAKEINTRESOURCE(IdTTDLGSetUILanguageFile)); | |
147 | + if (TTDLGSetUILanguageFile==NULL) { | |
148 | + Err = TRUE; | |
149 | + } | |
150 | + else { | |
151 | + TTDLGSetUILanguageFile(ts.UILanguageFile); | |
152 | + } | |
153 | + | |
144 | 154 | if (Err) { |
145 | 155 | FreeLibrary(HTTDLG); |
146 | 156 | HTTDLG = NULL; |
@@ -54,6 +54,8 @@ | ||
54 | 54 | (HWND WndParent, PTTSet ts); |
55 | 55 | typedef BOOL (PASCAL *PWindowWindow) |
56 | 56 | (HWND WndParent, PBOOL Close); |
57 | +typedef BOOL (PASCAL *PTTDLGSetUILanguageFile) | |
58 | + (char *file); | |
57 | 59 | |
58 | 60 | extern PSetupTerminal SetupTerminal; |
59 | 61 | extern PSetupWin SetupWin; |
@@ -66,9 +68,8 @@ | ||
66 | 68 | extern PChooseFontDlg ChooseFontDlg; |
67 | 69 | extern PSetupGeneral SetupGeneral; |
68 | 70 | extern PWindowWindow WindowWindow; |
71 | +extern PTTDLGSetUILanguageFile TTDLGSetUILanguageFile; | |
69 | 72 | |
70 | -extern void PASCAL TTDLGSetUILanguageFile(char *file); | |
71 | - | |
72 | 73 | /* proto types */ |
73 | 74 | BOOL LoadTTDLG(); |
74 | 75 | BOOL FreeTTDLG(); |
@@ -1,29 +0,0 @@ | ||
1 | -/* | |
2 | - * Copyright (C) 2008-2017 TeraTerm Project | |
3 | - * All rights reserved. | |
4 | - * | |
5 | - * Redistribution and use in source and binary forms, with or without | |
6 | - * modification, are permitted provided that the following conditions | |
7 | - * are met: | |
8 | - * | |
9 | - * 1. Redistributions of source code must retain the above copyright | |
10 | - * notice, this list of conditions and the following disclaimer. | |
11 | - * 2. Redistributions in binary form must reproduce the above copyright | |
12 | - * notice, this list of conditions and the following disclaimer in the | |
13 | - * documentation and/or other materials provided with the distribution. | |
14 | - * 3. The name of the author may not be used to endorse or promote products | |
15 | - * derived from this software without specific prior written permission. | |
16 | - * | |
17 | - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR | |
18 | - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
19 | - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
20 | - * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
21 | - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
22 | - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
23 | - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
24 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
25 | - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
26 | - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | - */ | |
28 | - | |
29 | -void PASCAL TTDLGSetUILanguageFile(char *file); |
@@ -40,12 +40,3 @@ | ||
40 | 40 | void FTSetTimeOut(PFileVar fv, int T); |
41 | 41 | BOOL FTCreateFile(PFileVar fv); |
42 | 42 | void GetFileSendFilter(PCHAR dest, PCHAR src, int size); |
43 | - | |
44 | -#ifdef __cplusplus | |
45 | -extern "C" { | |
46 | -#endif | |
47 | -void PASCAL TTFILESetUILanguageFile(char *file); | |
48 | -void PASCAL TTFILESetFileSendFilter(char *file); | |
49 | -#ifdef __cplusplus | |
50 | -} | |
51 | -#endif |