Revision: 9364 https://osdn.net/projects/ttssh2/scm/svn/commits/9364 Author: zmatsuo Date: 2021-08-15 22:13:34 +0900 (Sun, 15 Aug 2021) Log Message: ----------- telnet.c で win16api.c の関数を使用しないようにした - telnet.c に組み込んだ - TELNET.LOG の closeに失敗していたので修正 Modified Paths: -------------- trunk/teraterm/teraterm/CMakeLists.txt trunk/teraterm/teraterm/telnet.c trunk/teraterm/teraterm/ttermpro.v16.vcxproj trunk/teraterm/teraterm/ttermpro.v16.vcxproj.filters trunk/teraterm/teraterm/ttermpro.v8.vcproj -------------- next part -------------- Modified: trunk/teraterm/teraterm/CMakeLists.txt =================================================================== --- trunk/teraterm/teraterm/CMakeLists.txt 2021-08-14 14:43:50 UTC (rev 9363) +++ trunk/teraterm/teraterm/CMakeLists.txt 2021-08-15 13:13:34 UTC (rev 9364) @@ -132,7 +132,6 @@ ../common/ttlib.c ../common/ttlib.h ../common/dlglib.h - ../common/win16api.h ../common/codemap.h ../common/compat_win.h ../common/tmfc.h Modified: trunk/teraterm/teraterm/telnet.c =================================================================== --- trunk/teraterm/teraterm/telnet.c 2021-08-14 14:43:50 UTC (rev 9363) +++ trunk/teraterm/teraterm/telnet.c 2021-08-15 13:13:34 UTC (rev 9364) @@ -41,7 +41,6 @@ #include "telnet.h" #include "tt_res.h" -#include "win16api.h" int TelStatus; @@ -73,6 +72,19 @@ static HWND keepalive_dialog = NULL; int nop_interval = 0; +/** + * @retval \x8F\x91\x82\xAB\x8D\x9E\x82݃o\x83C\x83g\x90\x94 + */ +static UINT win16_lwrite(HANDLE hFile, const char*buf, UINT length) +{ + DWORD NumberOfBytesWritten; + BOOL result = WriteFile(hFile, buf, length, &NumberOfBytesWritten, NULL); + if (result == FALSE) { + return 0; + } + return NumberOfBytesWritten; +} + void DefaultTelRec() { int i; @@ -109,7 +121,8 @@ tr.WinSize.y = ts.TerminalHeight; if ((ts.LogFlag & LOG_TEL) != 0) - tr.LogFile = _lcreat("TELNET.LOG", 0); + tr.LogFile = CreateFileA("TELNET.LOG", GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); else tr.LogFile = 0; } @@ -117,8 +130,8 @@ void EndTelnet() { if (tr.LogFile) { + CloseHandle(tr.LogFile); tr.LogFile = 0; - _lclose(tr.LogFile); } TelStopKeepAliveThread(); @@ -143,7 +156,7 @@ else Ch = Ch + 0x37; Temp[2] = Ch; - _lwrite(tr.LogFile, Temp, 3); + win16_lwrite(tr.LogFile, Temp, 3); } void TelWriteLog(PCHAR Buf, int C) @@ -150,7 +163,7 @@ { int i; - _lwrite(tr.LogFile, "\015\012>", 3); + win16_lwrite(tr.LogFile, "\015\012>", 3); for (i = 0 ; i<= C-1 ; i++) TelWriteLog1(Buf[i]); } @@ -624,7 +637,7 @@ while ((c>0) && (cv.TelMode)) { if (tr.LogFile) { if (TelStatus==TelIAC) { - _lwrite(tr.LogFile, "\015\012<", 3); + win16_lwrite(tr.LogFile, "\015\012<", 3); TelWriteLog1(0xff); } TelWriteLog1(b); Modified: trunk/teraterm/teraterm/ttermpro.v16.vcxproj =================================================================== --- trunk/teraterm/teraterm/ttermpro.v16.vcxproj 2021-08-14 14:43:50 UTC (rev 9363) +++ trunk/teraterm/teraterm/ttermpro.v16.vcxproj 2021-08-15 13:13:34 UTC (rev 9364) @@ -250,7 +250,6 @@ <ClInclude Include="..\common\ttlib.h" /> <ClInclude Include="..\common\ttplugin.h" /> <ClInclude Include="..\common\tttypes.h" /> - <ClInclude Include="..\common\win16api.h" /> <ClInclude Include="addsetting.h" /> <ClInclude Include="buffer.h" /> <ClInclude Include="clipboar.h" /> Modified: trunk/teraterm/teraterm/ttermpro.v16.vcxproj.filters =================================================================== --- trunk/teraterm/teraterm/ttermpro.v16.vcxproj.filters 2021-08-14 14:43:50 UTC (rev 9363) +++ trunk/teraterm/teraterm/ttermpro.v16.vcxproj.filters 2021-08-15 13:13:34 UTC (rev 9364) @@ -354,9 +354,6 @@ <ClInclude Include="addsetting.h"> <Filter>dialog</Filter> </ClInclude> - <ClInclude Include="..\common\win16api.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="../ttpdlg/dlg_res.h"> <Filter>ttpdlg</Filter> </ClInclude> Modified: trunk/teraterm/teraterm/ttermpro.v8.vcproj =================================================================== --- trunk/teraterm/teraterm/ttermpro.v8.vcproj 2021-08-14 14:43:50 UTC (rev 9363) +++ trunk/teraterm/teraterm/ttermpro.v8.vcproj 2021-08-15 13:13:34 UTC (rev 9364) @@ -560,10 +560,6 @@ RelativePath=".\vtwin.h" > </File> - <File - RelativePath="..\common\win16api.h" - > - </File> </Filter> <Filter Name="ttpdlg"