[Ttssh2-commit] [6237] GetVersionEx() を使っている箇所を r6236 で作成した関数を使うように変更した

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2016年 1月 2日 (土) 22:14:17 JST


Revision: 6237
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6237
Author:   maya
Date:     2016-01-02 22:14:16 +0900 (Sat, 02 Jan 2016)
Log Message:
-----------
GetVersionEx() を使っている箇所を r6236 で作成した関数を使うように変更した

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

Modified Paths:
--------------
    branches/vs2015_warn/TTXKanjiMenu/ttxkanjimenu.c
    branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.c
    branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v10.vcxproj
    branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v11.vcxproj
    branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v12.vcxproj
    branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v14.vcxproj
    branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v9.vcproj
    branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.vcproj
    branches/vs2015_warn/teraterm/teraterm/clipboar.c
    branches/vs2015_warn/teraterm/teraterm/commlib.c
    branches/vs2015_warn/teraterm/teraterm/ftdlg.cpp
    branches/vs2015_warn/teraterm/teraterm/tekwin.cpp
    branches/vs2015_warn/teraterm/teraterm/vtdisp.c
    branches/vs2015_warn/teraterm/teraterm/vtwin.cpp
    branches/vs2015_warn/teraterm/teraterm/winjump.c
    branches/vs2015_warn/teraterm/ttpcmn/ttcmn.c
    branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def
    branches/vs2015_warn/teraterm/ttpdlg/ttdlg.c
    branches/vs2015_warn/teraterm/ttpmacro/ttl.c
    branches/vs2015_warn/teraterm/ttpmacro/ttmlib.c
    branches/vs2015_warn/teraterm/ttpmacro/ttmmain.cpp
    branches/vs2015_warn/teraterm/ttpset/ttset.c
    branches/vs2015_warn/ttpmenu/ttpmenu.cpp
    branches/vs2015_warn/ttssh2/ttxssh/dns.c
    branches/vs2015_warn/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: branches/vs2015_warn/TTXKanjiMenu/ttxkanjimenu.c
===================================================================
--- branches/vs2015_warn/TTXKanjiMenu/ttxkanjimenu.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXKanjiMenu/ttxkanjimenu.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -283,15 +283,12 @@
 	}
 
 	{
-		OSVERSIONINFO osvi;
 		MENUITEMINFO mi;
 
 		pvar->hmEncode = CreateMenu();
 
 		// Windows 95 \x82Ń\x81\x83j\x83\x85\x81[\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ȃ\xA2\x82̂Ńo\x81[\x83W\x83\x87\x83\x93\x83`\x83F\x83b\x83N\x82\xF0\x93\xFC\x82\xEA\x82\xE9 (2009.2.18 maya)
-		osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-		GetVersionEx(&osvi);
-		if (osvi.dwMajorVersion >= 5) {
+		if (IsWindows2000OrLater()) {
 			memset(&mi, 0, sizeof(MENUITEMINFO));
 			mi.cbSize = sizeof(MENUITEMINFO);
 		}

Modified: branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.c
===================================================================
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -153,18 +153,13 @@
 }
 
 static void PASCAL FAR TTXInit(PTTSet ts, PComVar cv) {
-  OSVERSIONINFO osvi;
-
   pvar->ts = ts;
   pvar->cv = cv;
   pvar->ReplaceTermDlg = FALSE;
   pvar->ResizeMenu = NULL;
   pvar->MenuItems = 0;
 
-  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-  GetVersionEx(&osvi);
-  if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
-      (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10)) {
+  if (IsWindows95() || IsWindowsNT4()) {
     pvar->useMultiMonitorAPI = FALSE;
   }
   else {

Modified: branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v10.vcxproj
===================================================================
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v10.vcxproj	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v10.vcxproj	2016-01-02 13:14:16 UTC (rev 6237)
@@ -59,6 +59,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -75,6 +76,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>

Modified: branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v11.vcxproj
===================================================================
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v11.vcxproj	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v11.vcxproj	2016-01-02 13:14:16 UTC (rev 6237)
@@ -64,6 +64,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -79,6 +80,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>

Modified: branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v12.vcxproj
===================================================================
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v12.vcxproj	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v12.vcxproj	2016-01-02 13:14:16 UTC (rev 6237)
@@ -64,6 +64,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -79,6 +80,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>

Modified: branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v14.vcxproj
===================================================================
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v14.vcxproj	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v14.vcxproj	2016-01-02 13:14:16 UTC (rev 6237)
@@ -64,6 +64,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX86</TargetMachine>
@@ -79,6 +80,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
+      <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>

Modified: branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v9.vcproj
===================================================================
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v9.vcproj	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.v9.vcproj	2016-01-02 13:14:16 UTC (rev 6237)
@@ -62,6 +62,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="&quot;$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib&quot;"
 				LinkIncremental="2"
 				GenerateDebugInformation="true"
 				SubSystem="2"
@@ -135,6 +136,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="&quot;$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib&quot;"
 				LinkIncremental="1"
 				GenerateDebugInformation="true"
 				SubSystem="2"

Modified: branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.vcproj
===================================================================
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.vcproj	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.vcproj	2016-01-02 13:14:16 UTC (rev 6237)
@@ -61,6 +61,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="&quot;$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib&quot;"
 				LinkIncremental="2"
 				GenerateDebugInformation="true"
 				SubSystem="2"
@@ -135,6 +136,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="&quot;$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib&quot;"
 				LinkIncremental="1"
 				GenerateDebugInformation="true"
 				SubSystem="2"

Modified: branches/vs2015_warn/teraterm/teraterm/clipboar.c
===================================================================
--- branches/vs2015_warn/teraterm/teraterm/clipboar.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/teraterm/clipboar.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -576,7 +576,6 @@
 	POINT p;
 	RECT rc_dsk, rc_dlg;
 	int dlg_height, dlg_width;
-	OSVERSIONINFO osvi;
 	static int ok2right, edit2ok, edit2bottom;
 	RECT rc_edit, rc_ok, rc_cancel;
 	// for status bar
@@ -622,10 +621,7 @@
 			// \x83L\x83\x83\x83\x8C\x83b\x83g\x82\xAA\x89\xE6\x96ʂ\xA9\x82\xE7\x82͂ݏo\x82\xB5\x82Ă\xA2\x82\xE9\x82Ƃ\xAB\x82ɓ\\x82\xE8\x95t\x82\xAF\x82\xF0\x82\xB7\x82\xE9\x82\xC6
 			// \x8Am\x94F\x83E\x83C\x83\x93\x83h\x83E\x82\xAA\x8C\xA9\x82\xA6\x82\xE9\x82Ƃ\xB1\x82\xEB\x82ɕ\\x8E\xA6\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x81B
 			// \x83E\x83C\x83\x93\x83h\x83E\x82\xA9\x82\xE7\x82͂ݏo\x82\xB5\x82\xBD\x8Fꍇ\x82ɒ\xB2\x90߂\xB7\x82\xE9 (2008.4.24 maya)
-			osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-			GetVersionEx(&osvi);
-			if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
-			     (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10) ) {
+			if (IsWindows95() || IsWindowsNT4()) {
 				// NT4.0, 95 \x82̓}\x83\x8B\x83`\x83\x82\x83j\x83^API\x82ɔ\xF1\x91Ή\x9E
 				SystemParametersInfo(SPI_GETWORKAREA, 0, &rc_dsk, 0);
 			}

Modified: branches/vs2015_warn/teraterm/teraterm/commlib.c
===================================================================
--- branches/vs2015_warn/teraterm/teraterm/commlib.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/teraterm/commlib.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -1280,7 +1280,6 @@
 	DCB dcb;
 	DWORD DErr;
 	COMMTIMEOUTS ctmo;
-	OSVERSIONINFO osvi;
 
 	strncpy_s(Temp, sizeof(Temp),DevName, _TRUNCATE);
 	c = Temp;
@@ -1291,9 +1290,7 @@
 	LPTFlag = (Temp[0]=='L') ||
 	          (Temp[0]=='l');
 
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
-	if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+	if (IsWindowsNTKernel()) {
 		// \x83l\x83b\x83g\x83\x8F\x81[\x83N\x8B\xA4\x97L\x82Ƀ}\x83b\x83v\x82\xB3\x82ꂽ\x83f\x83o\x83C\x83X\x82\xAA\x91\x8A\x8E\xE8\x82̏ꍇ\x81A\x82\xB1\x82\xA4\x82\xB5\x82Ȃ\xA2\x82Ƃ\xA2\x82\xAF\x82Ȃ\xA2\x82炵\x82\xA2 (2011.01.25 maya)
 		// http://logmett.com/forum/viewtopic.php?f=2&t=1383
 		// http://msdn.microsoft.com/en-us/library/aa363858(v=vs.85).aspx#5

Modified: branches/vs2015_warn/teraterm/teraterm/ftdlg.cpp
===================================================================
--- branches/vs2015_warn/teraterm/teraterm/ftdlg.cpp	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/teraterm/ftdlg.cpp	2016-01-02 13:14:16 UTC (rev 6237)
@@ -177,7 +177,7 @@
 	// \x83\x8D\x83O\x83t\x83@\x83C\x83\x8B\x82̓t\x83\x8B\x83p\x83X\x95\\x8E\xA6\x82ɂ\xB7\x82\xE9(2004.8.6 yutaka)
 	SetDlgItemText(IDC_EDIT_FULLPATH, &(fv->FullName[0]));
 
-	if (is_NT4()) {
+	if (IsWindowsNT4()) {
 		fuLoad = LR_VGACOLOR;
 	}
 	::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_SMALL,

Modified: branches/vs2015_warn/teraterm/teraterm/tekwin.cpp
===================================================================
--- branches/vs2015_warn/teraterm/teraterm/tekwin.cpp	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/teraterm/tekwin.cpp	2016-01-02 13:14:16 UTC (rev 6237)
@@ -82,7 +82,7 @@
 	// register this window to the window list
 	RegWin(HVTWin,HTEKWin);
 
-	if (is_NT4()) {
+	if (IsWindowsNT4()) {
 		fuLoad = LR_VGACOLOR;
 	}
 	::PostMessage(HTEKWin,WM_SETICON,ICON_SMALL,

Modified: branches/vs2015_warn/teraterm/teraterm/vtdisp.c
===================================================================
--- branches/vs2015_warn/teraterm/teraterm/vtdisp.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/teraterm/vtdisp.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -187,16 +187,9 @@
 // (2014.4.20 yutaka)
 static BOOL IsLoadImageOnlyEnabled(void)
 {
-	OSVERSIONINFO osvi;
-
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
 	// Vista \x96\xA2\x96\x9E\x82̏ꍇ\x82ɂ́A\x8D\xA1\x82܂Œʂ\xE8\x82̓ǂݍ\x9E\x82݂\xF0\x82\xB7\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD
 	// cf. SVN#4571(2011.8.4)
-	if (osvi.dwMajorVersion < 6) {
-		return TRUE;
-	}
-	return FALSE;
+	return !IsWindowsVistaOrLater();
 }
 
 
@@ -1793,25 +1786,8 @@
   /* background paintbrush */
   Background = CreateSolidBrush(ts.VTColor[1]);
   /* CRT width & height */
-  {
-	OSVERSIONINFO ver;
-	ZeroMemory( &ver, sizeof(ver) );
-	ver.dwOSVersionInfoSize = sizeof(ver);
-	GetVersionEx( &ver );
-	switch( ver.dwPlatformId ) {
-	// Windows 9x \x82\xA9 NT \x82\xA9\x82̔\xBB\x92\xE8
-	case VER_PLATFORM_WIN32_WINDOWS:
-		if( ver.dwMajorVersion > 4 ||
-			(ver.dwMajorVersion == 4 && ver.dwMinorVersion >= 10) ) // Windows 98 or later
-			bMultiDisplaySupport = TRUE;
-		break;
-	case VER_PLATFORM_WIN32_NT:
-		if( ver.dwMajorVersion >= 5 ) // Windows 2000 or later
-			bMultiDisplaySupport = TRUE;
-		break;
-	default:
-		break;
-	}
+  if (!IsWindows95() && !IsWindowsNT4()) {
+    bMultiDisplaySupport = TRUE;
   }
   if( bMultiDisplaySupport ) {
 	  VirtualScreen.left = GetSystemMetrics(SM_XVIRTUALSCREEN);

Modified: branches/vs2015_warn/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/vs2015_warn/teraterm/teraterm/vtwin.cpp	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/teraterm/vtwin.cpp	2016-01-02 13:14:16 UTC (rev 6237)
@@ -568,7 +568,6 @@
 #endif
 	BOOL ret = FALSE;
 	int flag = 0;
-	OSVERSIONINFO osvi;
 	HANDLE          hToken;
 	DWORD           dwLength;
 	TOKEN_ELEVATION tokenElevation;
@@ -579,10 +578,8 @@
 	DWORD dwType;
 	BYTE bValue;
 
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
 	// Windows Vista\x88ȑO\x82͖\xB3\x8E\x8B\x82\xB7\x82\xE9\x81B
-	if (!(osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 6))
+	if (!IsWindowsVistaOrLater())
 		goto error;
 
 	// UAC\x82\xAA\x97L\x8C\xF8\x82\xA9\x82ǂ\xA4\x82\xA9\x81B
@@ -826,7 +823,7 @@
 	// USB\x83f\x83o\x83C\x83X\x95ω\xBB\x92ʒm\x93o\x98^
 	RegDeviceNotify(HVTWin);
 
-	if (is_NT4()) {
+	if (IsWindowsNT4()) {
 		fuLoad = LR_VGACOLOR;
 	}
 	::PostMessage(HVTWin,WM_SETICON,ICON_SMALL,

Modified: branches/vs2015_warn/teraterm/teraterm/winjump.c
===================================================================
--- branches/vs2015_warn/teraterm/teraterm/winjump.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/teraterm/winjump.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -369,17 +369,7 @@
 
 BOOL isJumpListSupported(void)
 {
-	static OSVERSIONINFO osVersion;
-
-	if (osVersion.dwOSVersionInfoSize != sizeof(OSVERSIONINFO)) {
- 		osVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-		GetVersionEx(&osVersion);
-	}
-	if ((osVersion.dwMajorVersion < 6) ||
-	    (osVersion.dwMajorVersion == 6 && osVersion.dwMinorVersion < 1))
-		return FALSE;
-	else
-		return TRUE;
+	return IsWindows7OrLater();
 }
 
 /*

Modified: branches/vs2015_warn/teraterm/ttpcmn/ttcmn.c
===================================================================
--- branches/vs2015_warn/teraterm/ttpcmn/ttcmn.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/ttpcmn/ttcmn.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -1059,20 +1059,9 @@
 	HMONITOR hMonitor;
 	MONITORINFO mi;
 	int stat = SW_RESTORE;
-	OSVERSIONINFO osvi;
 	int multi_mon = 0;
 
-	// Windows\x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x8E擾\x82\xB7\x82\xE9\x81B
-	// \x82Ȃ\xA8\x81AWindows8.1\x82ł́AGetVersionEx()\x82\xCDdeprecated API\x82ł\xA0\x82邽\x82߁AWindows8(major=6,minor=2)
-	// \x82ƕԂ\xC1\x82Ă\xAD\x82\xE9\x81BManifest\x83t\x83@\x83C\x83\x8B\x82\xF0\x8FC\x90\xB3\x82\xB7\x82\xE9\x82Ƃ\xA2\x82\xA4\x89\xF1\x94\xF0\x95\xFB\x96@\x82\xAA\x82\xA0\x82\xE9\x82悤\x82\xBE\x82\xAA\x81AVisual Studio 2005\x82ł\xCD
-	// \x8Eg\x82\xA6\x82Ȃ\xA2\x82\xE0\x82̂Ǝv\x82\xED\x82\xEA\x82\xE9\x81B
-	// cf. http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
-	if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
-	     (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10) ) {
-		multi_mon = 0;
-	} else {
+	if (!IsWindows95() && !IsWindowsNT4()) {
 		multi_mon = 1;
 	}
 

Modified: branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def
===================================================================
--- branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/ttpcmn/ttpcmn.def	2016-01-02 13:14:16 UTC (rev 6237)
@@ -59,3 +59,10 @@
   DequoteParam @63
 
   CheckComPort @64
+
+  IsWindows95 @65
+  IsWindowsNT4 @66
+  IsWindowsNTKernel @67
+  IsWindows2000OrLater @68
+  IsWindowsVistaOrLater @69
+  IsWindows7OrLater @70

Modified: branches/vs2015_warn/teraterm/ttpdlg/ttdlg.c
===================================================================
--- branches/vs2015_warn/teraterm/ttpdlg/ttdlg.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/ttpdlg/ttdlg.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -1184,7 +1184,6 @@
 	char uimsg[MAX_UIMSG], uimsg2[MAX_UIMSG];
 	LOGFONT logfont;
 	HFONT font;
-	OSVERSIONINFO osvi;
 
 	switch (Message) {
 		case WM_INITDIALOG:
@@ -1255,11 +1254,9 @@
 			SetRB(Dialog,ts->DisableAppKeypad,IDC_KEYBAPPKEY,IDC_KEYBAPPKEY);
 			SetRB(Dialog,ts->DisableAppCursor,IDC_KEYBAPPCUR,IDC_KEYBAPPCUR);
 
-			osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-                        GetVersionEx(&osvi);
-                        if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
+			if (!IsWindowsNTKernel()) {
 				SetDropDownList(Dialog, IDC_KEYBMETA, MetaList2, ts->MetaKey + 1);
-                        }
+			}
 			else {
 				SetDropDownList(Dialog, IDC_KEYBMETA, MetaList, ts->MetaKey + 1);
 			}
@@ -2730,7 +2727,7 @@
 				int fuLoad = LR_DEFAULTCOLOR;
 				HICON hicon;
 
-				if (is_NT4()) {
+				if (IsWindowsNT4()) {
 					fuLoad = LR_VGACOLOR;
 				}
 

Modified: branches/vs2015_warn/teraterm/ttpmacro/ttl.c
===================================================================
--- branches/vs2015_warn/teraterm/ttpmacro/ttl.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/ttpmacro/ttl.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -2385,7 +2385,6 @@
 	IP_ADAPTER_ADDRESSES addr[256];/* XXX */
 	ULONG len = sizeof(addr);
 	char ipv6str[64];
-	OSVERSIONINFO osvi;
 
 	Err = 0;
 	GetStrAryVar(&VarId,&Err);
@@ -2395,10 +2394,7 @@
 	if (Err!=0) return Err;
 
 	// IPv6 \x82\xAA\x83T\x83|\x81[\x83g\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2 OS \x82͂\xB1\x82\xB1\x82\xC5 return
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
-	if ( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ||
-	     (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ) {
+	if (!IsWindowsNTKernel() || IsWindowsNT4()) {
 		// 9x, NT4.0 \x82\xCD IPv6 \x94\xF1\x91Ή\x9E
 		SetResult(-1);
 		SetIntVal(VarId2, 0);

Modified: branches/vs2015_warn/teraterm/ttpmacro/ttmlib.c
===================================================================
--- branches/vs2015_warn/teraterm/ttpmacro/ttmlib.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/ttpmacro/ttmlib.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -101,14 +101,10 @@
 
 int DoGetSpecialFolder(int CSIDL, PCHAR dest, int dest_len)
 {
-	OSVERSIONINFO osvi;
 	char Path[MAX_PATH] = "";
 	LPITEMIDLIST pidl;
 
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
-	if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
-	     (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) ) {
+	if (!IsWindowsNTKernel() || IsWindowsNT4()) {
 		switch (CSIDL) {
 			case CSIDL_COMMON_DESKTOPDIRECTORY:
 			case CSIDL_COMMON_STARTMENU:
@@ -190,12 +186,7 @@
 
 int GetMonitorLeftmost(int PosX, int PosY)
 {
-	OSVERSIONINFO osvi;
-
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
-	if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
-	     (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10) ) {
+	if (IsWindows95() || IsWindowsNT4()) {
 		// // NT4.0, 95 \x82̓}\x83\x8B\x83`\x83\x82\x83j\x83^API\x82ɔ\xF1\x91Ή\x9E
 		return 0;
 	}

Modified: branches/vs2015_warn/teraterm/ttpmacro/ttmmain.cpp
===================================================================
--- branches/vs2015_warn/teraterm/ttpmacro/ttmmain.cpp	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/ttpmacro/ttmmain.cpp	2016-01-02 13:14:16 UTC (rev 6237)
@@ -252,7 +252,7 @@
 	               (CRTHeight-Rect.bottom+Rect.top) / 2,
 	               0,0,SWP_NOSIZE | SWP_NOZORDER);
 
-	if (is_NT4()) {
+	if (IsWindowsNT4()) {
 		fuLoad = LR_VGACOLOR;
 	}
 	::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_SMALL,

Modified: branches/vs2015_warn/teraterm/ttpset/ttset.c
===================================================================
--- branches/vs2015_warn/teraterm/ttpset/ttset.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/teraterm/ttpset/ttset.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -488,7 +488,6 @@
 	int i;
 	HDC TmpDC;
 	char Temp[MAX_PATH], Temp2[MAX_PATH];
-	OSVERSIONINFO osvi;
 
 	ts->Minimize = 0;
 	ts->HideWindow = 0;
@@ -505,9 +504,6 @@
 
 	ts->DisableTCPEchoCR = FALSE;
 
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
-
 	/* Version number */
 /*  GetPrivateProfileString(Section,"Version","",
 			  Temp,sizeof(Temp),FName); */
@@ -933,7 +929,7 @@
 	  ts->MetaKey = IdMetaOff;
 
 	// Windows95 \x8Cn\x82͍\xB6\x89E\x82\xCC Alt \x82̔\xBB\x95ʂɔ\xF1\x91Ή\x9E
-	if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && ts->MetaKey != IdMetaOff) {
+	if (!IsWindowsNTKernel() && ts->MetaKey != IdMetaOff) {
 	  ts->MetaKey = IdMetaOn;
 	}
 

Modified: branches/vs2015_warn/ttpmenu/ttpmenu.cpp
===================================================================
--- branches/vs2015_warn/ttpmenu/ttpmenu.cpp	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/ttpmenu/ttpmenu.cpp	2016-01-02 13:14:16 UTC (rev 6237)
@@ -2645,7 +2645,7 @@
 
 	g_hI			= hI;
 
-	if (is_NT4()){
+	if (IsWindowsNT4()){
 		fuLoad = LR_VGACOLOR;
 	}
 	g_hIcon			= (HICON)::LoadImage(g_hI, MAKEINTRESOURCE(TTERM_ICON), IMAGE_ICON, 32, 32, fuLoad);

Modified: branches/vs2015_warn/ttssh2/ttxssh/dns.c
===================================================================
--- branches/vs2015_warn/ttssh2/ttxssh/dns.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/ttssh2/ttxssh/dns.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -60,11 +60,8 @@
 	digest_algorithm dgst_alg;
 	BYTE *hostkey_digest = NULL;
 	int found = DNS_VERIFY_NOTFOUND;
-	OSVERSIONINFO osvi;
 
-	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-	GetVersionEx(&osvi);
-	if (osvi.dwMajorVersion < 5) {
+	if (!IsWindows2000OrLater()) {
 		// DnsQuery \x82\xCD Windows 2000 \x88ȏ\xE3\x82ł\xB5\x82\xA9\x93\xAE\x8D삵\x82Ȃ\xA2\x82\xBD\x82\xDF
 		return DNS_VERIFY_NONE;
 	}

Modified: branches/vs2015_warn/ttssh2/ttxssh/ttxssh.c
===================================================================
--- branches/vs2015_warn/ttssh2/ttxssh/ttxssh.c	2016-01-02 05:03:56 UTC (rev 6236)
+++ branches/vs2015_warn/ttssh2/ttxssh/ttxssh.c	2016-01-02 13:14:16 UTC (rev 6237)
@@ -826,7 +826,7 @@
 {
 	int fuLoad = LR_DEFAULTCOLOR;
 
-	if (is_NT4()) {
+	if (IsWindowsNT4()) {
 		fuLoad = LR_VGACOLOR;
 	}
 
@@ -2926,7 +2926,7 @@
 			int fuLoad = LR_DEFAULTCOLOR;
 			HICON hicon;
 
-			if (is_NT4()) {
+			if (IsWindowsNT4()) {
 				fuLoad = LR_VGACOLOR;
 			}
 



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