[Ttssh2-commit] [6835] バージョン番号を ttxssh-version.h で定義しているマクロから取得するように変更

svnno****@sourc***** svnno****@sourc*****
2017年 7月 5日 (水) 00:01:42 JST


Revision: 6835
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6835
Author:   doda
Date:     2017-07-05 00:01:42 +0900 (Wed, 05 Jul 2017)
Log Message:
-----------
バージョン番号を ttxssh-version.h で定義しているマクロから取得するように変更

get_file_version() は少なくとも ttxssh では使わないと思うので廃止。

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ttxssh.c
    trunk/ttssh2/ttxssh/ttxssh.h
    trunk/ttssh2/ttxssh/ttxssh.v10.vcxproj
    trunk/ttssh2/ttxssh/ttxssh.v11.vcxproj
    trunk/ttssh2/ttxssh/ttxssh.v12.vcxproj
    trunk/ttssh2/ttxssh/ttxssh.v14.vcxproj
    trunk/ttssh2/ttxssh/ttxssh.v15.vcxproj
    trunk/ttssh2/ttxssh/ttxssh.v9.vcproj
    trunk/ttssh2/ttxssh/ttxssh.vcproj

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ssh.c	2017-07-04 15:01:42 UTC (rev 6835)
@@ -1806,7 +1806,6 @@
 			else {
 				char TTSSH_ID[1024];
 				int TTSSH_ID_len;
-				int a, b, c, d;
 
 				// SSH \x83o\x81[\x83W\x83\x87\x83\x93\x82\xF0 teraterm \x91\xA4\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9
 				// SCP \x83R\x83}\x83\x93\x83h\x82̂\xBD\x82\xDF (2008.2.3 maya)
@@ -1813,11 +1812,10 @@
 				pvar->cv->isSSH = pvar->protocol_major;
 
 				// \x8E\xA9\x95\xAA\x8E\xA9\x90g\x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x8E擾\x82\xB7\x82\xE9 (2005.3.3 yutaka)
-				get_file_version("ttxssh.dll", &a, &b, &c, &d);
-
 				_snprintf_s(TTSSH_ID, sizeof(TTSSH_ID), _TRUNCATE,
 				            "SSH-%d.%d-TTSSH/%d.%d Win32\r\n",
-				            pvar->protocol_major, pvar->protocol_minor, a, b);
+				            pvar->protocol_major, pvar->protocol_minor,
+				            TTSSH_VERSION_MAJOR, TTSSH_VERSION_MINOR);
 				TTSSH_ID_len = strlen(TTSSH_ID);
 
 				// for SSH2(yutaka)

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2017-07-04 15:01:42 UTC (rev 6835)
@@ -2185,66 +2185,6 @@
 	}
 }
 
-// \x8E\xC0\x8Ds\x83t\x83@\x83C\x83\x8B\x82\xA9\x82\xE7\x83o\x81[\x83W\x83\x87\x83\x93\x8F\xEE\x95\xF1\x82𓾂\xE9 (2005.2.28 yutaka)
-void get_file_version(char *exefile, int *major, int *minor, int *release, int *build)
-{
-	typedef struct {
-		WORD wLanguage;
-		WORD wCodePage;
-	} LANGANDCODEPAGE, *LPLANGANDCODEPAGE;
-	LPLANGANDCODEPAGE lplgcode;
-	UINT unLen;
-	DWORD size;
-	char *buf = NULL;
-	BOOL ret;
-	int i;
-	char fmt[80];
-	char *pbuf;
-
-	size = GetFileVersionInfoSize(exefile, NULL);
-	if (size == 0) {
-		goto error;
-	}
-	buf = malloc(size);
-	ZeroMemory(buf, size);
-
-	if (GetFileVersionInfo(exefile, 0, size, buf) == FALSE) {
-		goto error;
-	}
-
-	ret = VerQueryValue(buf,
-			"\\VarFileInfo\\Translation",
-			(LPVOID *)&lplgcode, &unLen);
-	if (ret == FALSE)
-		goto error;
-
-	for (i = 0 ; i < (int)(unLen / sizeof(LANGANDCODEPAGE)) ; i++) {
-		_snprintf_s(fmt, sizeof(fmt), _TRUNCATE,
-		            "\\StringFileInfo\\%04x%04x\\FileVersion",
-		            lplgcode[i].wLanguage, lplgcode[i].wCodePage);
-		VerQueryValue(buf, fmt, &pbuf, &unLen);
-		if (unLen > 0) { // get success
-			int n, a, b, c, d;
-
-			n = sscanf(pbuf, "%d, %d, %d, %d", &a, &b, &c, &d);
-			if (n == 4) { // convert success
-				*major = a;
-				*minor = b;
-				*release = c;
-				*build = d;
-				break;
-			}
-		}
-	}
-
-	free(buf);
-	return;
-
-error:
-	free(buf);
-	*major = *minor = *release = *build = 0;
-}
-
 static void about_dlg_set_abouttext(PTInstVar pvar, HWND dlg, digest_algorithm dgst_alg)
 {
 	char buf[1024], buf2[2048];
@@ -2406,7 +2346,6 @@
 static void init_about_dlg(PTInstVar pvar, HWND dlg)
 {
 	char buf[1024];
-	int a, b, c, d;
 	char uimsg[MAX_UIMSG];
 
 	GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -2420,9 +2359,8 @@
 	SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
 
 	// TTSSH\x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x90ݒ肷\x82\xE9 (2005.2.28 yutaka)
-	get_file_version("ttxssh.dll", &a, &b, &c, &d);
 	_snprintf_s(buf, sizeof(buf), _TRUNCATE,
-	            "TTSSH\r\nTera Term Secure Shell extension, %d.%d", a, b);
+	            "TTSSH\r\nTera Term Secure Shell extension, %d.%d", TTSSH_VERSION_MAJOR, TTSSH_VERSION_MINOR);
 	SendMessage(GetDlgItem(dlg, IDC_TTSSH_VERSION), WM_SETTEXT, 0, (LPARAM)buf);
 
 	// OpenSSL\x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x90ݒ肷\x82\xE9 (2005.1.24 yutaka)

Modified: trunk/ttssh2/ttxssh/ttxssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.h	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.h	2017-07-04 15:01:42 UTC (rev 6835)
@@ -354,7 +354,6 @@
 
 void get_teraterm_dir_relative_name(char *buf, int bufsize, char *basename);
 int copy_teraterm_dir_relative_path(char *dest, int destsize, char *basename);
-void get_file_version(char *exefile, int *major, int *minor, int *release, int *build);
 int uuencode(unsigned char *src, int srclen, unsigned char *target, int targsize);
 
 #endif

Modified: trunk/ttssh2/ttxssh/ttxssh.v10.vcxproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v10.vcxproj	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.v10.vcxproj	2017-07-04 15:01:42 UTC (rev 6835)
@@ -76,9 +76,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
-
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlibd.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32.dbg;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -125,8 +122,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlib.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

Modified: trunk/ttssh2/ttxssh/ttxssh.v11.vcxproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v11.vcxproj	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.v11.vcxproj	2017-07-04 15:01:42 UTC (rev 6835)
@@ -81,9 +81,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
-
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlibd.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32.dbg;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -130,8 +127,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlib.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

Modified: trunk/ttssh2/ttxssh/ttxssh.v12.vcxproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v12.vcxproj	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.v12.vcxproj	2017-07-04 15:01:42 UTC (rev 6835)
@@ -81,9 +81,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
-
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlibd.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32.dbg;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -130,8 +127,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlib.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

Modified: trunk/ttssh2/ttxssh/ttxssh.v14.vcxproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v14.vcxproj	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.v14.vcxproj	2017-07-04 15:01:42 UTC (rev 6835)
@@ -81,9 +81,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
-
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlibd.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32.dbg;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -130,8 +127,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlib.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

Modified: trunk/ttssh2/ttxssh/ttxssh.v15.vcxproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v15.vcxproj	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.v15.vcxproj	2017-07-04 15:01:42 UTC (rev 6835)
@@ -81,9 +81,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
-
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlibd.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32.dbg;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -130,8 +127,6 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalOptions>Version.lib 
- %(AdditionalOptions)</AdditionalOptions>
       <AdditionalDependencies>odbc32.lib;odbccp32.lib;ws2_32.lib;libeay32.lib;zlib.lib;ttpcmn.lib;dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>$(SolutionDir)..\libs\openssl\out32;$(SolutionDir)..\libs\zlib;$(SolutionDir)..\teraterm\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

Modified: trunk/ttssh2/ttxssh/ttxssh.v9.vcproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v9.vcproj	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.v9.vcproj	2017-07-04 15:01:42 UTC (rev 6835)
@@ -73,7 +73,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions="Version.lib &#x0D;&#x0A;&#x0D;&#x0A;"
 				AdditionalDependencies="odbc32.lib odbccp32.lib ws2_32.lib libeay32.lib zlibd.lib ttpcmn.lib dnsapi.lib"
 				LinkIncremental="2"
 				SuppressStartupBanner="true"
@@ -169,7 +168,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions="Version.lib &#x0D;&#x0A;"
 				AdditionalDependencies="odbc32.lib odbccp32.lib ws2_32.lib libeay32.lib zlib.lib ttpcmn.lib dnsapi.lib"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"

Modified: trunk/ttssh2/ttxssh/ttxssh.vcproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.vcproj	2017-07-04 15:01:38 UTC (rev 6834)
+++ trunk/ttssh2/ttxssh/ttxssh.vcproj	2017-07-04 15:01:42 UTC (rev 6835)
@@ -72,7 +72,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions="Version.lib &#x0D;&#x0A;&#x0D;&#x0A;"
 				AdditionalDependencies="odbc32.lib odbccp32.lib ws2_32.lib libeay32.lib zlibd.lib ttpcmn.lib dnsapi.lib"
 				LinkIncremental="2"
 				SuppressStartupBanner="true"
@@ -169,7 +168,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions="Version.lib &#x0D;&#x0A;"
 				AdditionalDependencies="odbc32.lib odbccp32.lib ws2_32.lib libeay32.lib zlib.lib ttpcmn.lib dnsapi.lib"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"



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