[Ttssh2-commit] [7927] マクロ filelock,fileunlock が常に失敗するのを修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 8月 9日 (金) 00:17:27 JST


Revision: 7927
          https://osdn.net/projects/ttssh2/scm/svn/commits/7927
Author:   zmatsuo
Date:     2019-08-09 00:17:27 +0900 (Fri, 09 Aug 2019)
Log Message:
-----------
マクロ filelock,fileunlock が常に失敗するのを修正

- int -> handle 変換を行っていなかった
- r7292 での変更漏れ
- 4.101 からの不具合

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/7292

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/ttpmacro/ttl.c

-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2019-08-08 15:17:15 UTC (rev 7926)
+++ trunk/doc/en/html/about/history.html	2019-08-08 15:17:27 UTC (rev 7927)
@@ -47,6 +47,7 @@
       <li>Displayed unspecified string font in IME changes, when you open the font setting dialog.</li>
       <!--li><a href="../macro/command/filecopy.html">filecopy</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82̌\x8B\x89ʂ\xAA result \x83V\x83X\x83e\x83\x80\x95ϐ\x94\x82Ɋi\x94[\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li-->
       <li><!-- [File]/[Send file..]\x82\xA9\x82\xE7\x91傫\x82ȃt\x83@\x83C\x83\x8B\x82\xF0\x82\xA4\x82܂\xAD\x91\x97\x90M\x82ł\xAB\x82Ȃ\xA2\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.103\x82ł̃G\x83\x93\x83o\x83O\x81B --></li>
+	  <!--li><a href="../macro/command/filelock.html">filelock</a>, <a href="../macro/command/fileunlock.html">fileunlock</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82\xAA\x8F\xED\x82Ɏ\xB8\x94s\x82\xB5\x82Ă\xA2\x82\xBD\x81B4.101\x82ł̃G\x83\x93\x83o\x83O\x81B</li-->
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2019-08-08 15:17:15 UTC (rev 7926)
+++ trunk/doc/ja/html/about/history.html	2019-08-08 15:17:27 UTC (rev 7927)
@@ -47,6 +47,7 @@
       <li>IME\x82̖\xA2\x8Am\x92蕶\x8E\x9A\x82\xF0\x95\\x8E\xA6\x82\xB5\x82Ă\xA2\x82\xE9\x8F\xF3\x91ԂŃt\x83H\x83\x93\x83g\x91I\x91\xF0\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9\x82\xC6IME\x82̃t\x83H\x83\x93\x83g\x82\xAA\x95ω\xBB\x82\xB7\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
       <li><a href="../macro/command/filecopy.html">filecopy</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82̌\x8B\x89ʂ\xAA result \x83V\x83X\x83e\x83\x80\x95ϐ\x94\x82Ɋi\x94[\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
       <li>[File]/[Send file..]\x82\xA9\x82\xE7\x91傫\x82ȃt\x83@\x83C\x83\x8B\x82\xF0\x82\xA4\x82܂\xAD\x91\x97\x90M\x82ł\xAB\x82Ȃ\xA2\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.103\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
+	  <li><a href="../macro/command/filelock.html">filelock</a>, <a href="../macro/command/fileunlock.html">fileunlock</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82\xAA\x8F\xED\x82Ɏ\xB8\x94s\x82\xB5\x82Ă\xA2\x82\xBD\x81B4.101\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
     </ul>
   </li>
 

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2019-08-08 15:17:15 UTC (rev 7926)
+++ trunk/teraterm/ttpmacro/ttl.c	2019-08-08 15:17:27 UTC (rev 7927)
@@ -1651,7 +1651,8 @@
 WORD TTLFileLock()
 {
 	WORD Err;
-	int FH;
+	HANDLE FH;
+	int fhi;
 	DWORD timeout;
 	int result;
 	BOOL ret;
@@ -1658,7 +1659,8 @@
 	DWORD dwStart;
 
 	Err = 0;
-	GetIntVal(&FH,&Err);
+	GetIntVal(&fhi,&Err);
+	FH = HandleGet(fhi);
 	if (Err!=0) return Err;
 
 	timeout = -1;  // \x96\xB3\x8C\xC0\x91\xE5
@@ -1670,7 +1672,7 @@
 	result = 1;  // error
 	dwStart = GetTickCount();
 	do {
-		ret = LockFile((HANDLE)FH, 0, 0, (DWORD)-1, (DWORD)-1);
+		ret = LockFile(FH, 0, 0, (DWORD)-1, (DWORD)-1);
 		if (ret != 0) { // \x83\x8D\x83b\x83N\x90\xAC\x8C\xF7
 			result = 0;  // success
 			break;
@@ -1687,16 +1689,18 @@
 WORD TTLFileUnLock()
 {
 	WORD Err;
-	int FH;
+	HANDLE FH;
+	int fhi;
 	BOOL ret;
 
 	Err = 0;
-	GetIntVal(&FH,&Err);
+	GetIntVal(&fhi,&Err);
+	FH = HandleGet(fhi);
 	if ((Err==0) && (GetFirstChar()!=0))
 		Err = ErrSyntax;
 	if (Err!=0) return Err;
 
-	ret = UnlockFile((HANDLE)FH, 0, 0, (DWORD)-1, (DWORD)-1);
+	ret = UnlockFile(FH, 0, 0, (DWORD)-1, (DWORD)-1);
 	if (ret != 0) { // \x83A\x83\x93\x83\x8D\x83b\x83N\x90\xAC\x8C\xF7
 		SetResult(0);
 	} else {


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