• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision6237 (tree)
Time2016-01-02 22:14:16
Author(del#1144)

Log Message

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

Change Summary

Incremental Difference

--- branches/vs2015_warn/ttpmenu/ttpmenu.cpp (revision 6236)
+++ branches/vs2015_warn/ttpmenu/ttpmenu.cpp (revision 6237)
@@ -2645,7 +2645,7 @@
26452645
26462646 g_hI = hI;
26472647
2648- if (is_NT4()){
2648+ if (IsWindowsNT4()){
26492649 fuLoad = LR_VGACOLOR;
26502650 }
26512651 g_hIcon = (HICON)::LoadImage(g_hI, MAKEINTRESOURCE(TTERM_ICON), IMAGE_ICON, 32, 32, fuLoad);
--- branches/vs2015_warn/TTXKanjiMenu/ttxkanjimenu.c (revision 6236)
+++ branches/vs2015_warn/TTXKanjiMenu/ttxkanjimenu.c (revision 6237)
@@ -283,15 +283,12 @@
283283 }
284284
285285 {
286- OSVERSIONINFO osvi;
287286 MENUITEMINFO mi;
288287
289288 pvar->hmEncode = CreateMenu();
290289
291290 // Windows 95 でメニューが表示されないのでバージョンチェックを入れる (2009.2.18 maya)
292- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
293- GetVersionEx(&osvi);
294- if (osvi.dwMajorVersion >= 5) {
291+ if (IsWindows2000OrLater()) {
295292 memset(&mi, 0, sizeof(MENUITEMINFO));
296293 mi.cbSize = sizeof(MENUITEMINFO);
297294 }
--- branches/vs2015_warn/teraterm/ttpdlg/ttdlg.c (revision 6236)
+++ branches/vs2015_warn/teraterm/ttpdlg/ttdlg.c (revision 6237)
@@ -1184,7 +1184,6 @@
11841184 char uimsg[MAX_UIMSG], uimsg2[MAX_UIMSG];
11851185 LOGFONT logfont;
11861186 HFONT font;
1187- OSVERSIONINFO osvi;
11881187
11891188 switch (Message) {
11901189 case WM_INITDIALOG:
@@ -1255,11 +1254,9 @@
12551254 SetRB(Dialog,ts->DisableAppKeypad,IDC_KEYBAPPKEY,IDC_KEYBAPPKEY);
12561255 SetRB(Dialog,ts->DisableAppCursor,IDC_KEYBAPPCUR,IDC_KEYBAPPCUR);
12571256
1258- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
1259- GetVersionEx(&osvi);
1260- if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
1257+ if (!IsWindowsNTKernel()) {
12611258 SetDropDownList(Dialog, IDC_KEYBMETA, MetaList2, ts->MetaKey + 1);
1262- }
1259+ }
12631260 else {
12641261 SetDropDownList(Dialog, IDC_KEYBMETA, MetaList, ts->MetaKey + 1);
12651262 }
@@ -2730,7 +2727,7 @@
27302727 int fuLoad = LR_DEFAULTCOLOR;
27312728 HICON hicon;
27322729
2733- if (is_NT4()) {
2730+ if (IsWindowsNT4()) {
27342731 fuLoad = LR_VGACOLOR;
27352732 }
27362733
--- branches/vs2015_warn/teraterm/ttpcmn/ttcmn.c (revision 6236)
+++ branches/vs2015_warn/teraterm/ttpcmn/ttcmn.c (revision 6237)
@@ -1059,20 +1059,9 @@
10591059 HMONITOR hMonitor;
10601060 MONITORINFO mi;
10611061 int stat = SW_RESTORE;
1062- OSVERSIONINFO osvi;
10631062 int multi_mon = 0;
10641063
1065- // Windowsのバージョンを取得する。
1066- // なお、Windows8.1では、GetVersionEx()はdeprecated APIであるため、Windows8(major=6,minor=2)
1067- // と返ってくる。Manifestファイルを修正するという回避方法があるようだが、Visual Studio 2005では
1068- // 使えないものと思われる。
1069- // cf. http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx
1070- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
1071- GetVersionEx(&osvi);
1072- if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
1073- (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10) ) {
1074- multi_mon = 0;
1075- } else {
1064+ if (!IsWindows95() && !IsWindowsNT4()) {
10761065 multi_mon = 1;
10771066 }
10781067
--- branches/vs2015_warn/teraterm/teraterm/commlib.c (revision 6236)
+++ branches/vs2015_warn/teraterm/teraterm/commlib.c (revision 6237)
@@ -1280,7 +1280,6 @@
12801280 DCB dcb;
12811281 DWORD DErr;
12821282 COMMTIMEOUTS ctmo;
1283- OSVERSIONINFO osvi;
12841283
12851284 strncpy_s(Temp, sizeof(Temp),DevName, _TRUNCATE);
12861285 c = Temp;
@@ -1291,9 +1290,7 @@
12911290 LPTFlag = (Temp[0]=='L') ||
12921291 (Temp[0]=='l');
12931292
1294- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
1295- GetVersionEx(&osvi);
1296- if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
1293+ if (IsWindowsNTKernel()) {
12971294 // ネットワーク共有にマップされたデバイスが相手の場合、こうしないといけないらしい (2011.01.25 maya)
12981295 // http://logmett.com/forum/viewtopic.php?f=2&t=1383
12991296 // http://msdn.microsoft.com/en-us/library/aa363858(v=vs.85).aspx#5
--- branches/vs2015_warn/teraterm/teraterm/vtdisp.c (revision 6236)
+++ branches/vs2015_warn/teraterm/teraterm/vtdisp.c (revision 6237)
@@ -187,16 +187,9 @@
187187 // (2014.4.20 yutaka)
188188 static BOOL IsLoadImageOnlyEnabled(void)
189189 {
190- OSVERSIONINFO osvi;
191-
192- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
193- GetVersionEx(&osvi);
194190 // Vista 未満の場合には、今まで通りの読み込みをするようにした
195191 // cf. SVN#4571(2011.8.4)
196- if (osvi.dwMajorVersion < 6) {
197- return TRUE;
198- }
199- return FALSE;
192+ return !IsWindowsVistaOrLater();
200193 }
201194
202195
@@ -1793,25 +1786,8 @@
17931786 /* background paintbrush */
17941787 Background = CreateSolidBrush(ts.VTColor[1]);
17951788 /* CRT width & height */
1796- {
1797- OSVERSIONINFO ver;
1798- ZeroMemory( &ver, sizeof(ver) );
1799- ver.dwOSVersionInfoSize = sizeof(ver);
1800- GetVersionEx( &ver );
1801- switch( ver.dwPlatformId ) {
1802- // Windows 9x か NT かの判定
1803- case VER_PLATFORM_WIN32_WINDOWS:
1804- if( ver.dwMajorVersion > 4 ||
1805- (ver.dwMajorVersion == 4 && ver.dwMinorVersion >= 10) ) // Windows 98 or later
1806- bMultiDisplaySupport = TRUE;
1807- break;
1808- case VER_PLATFORM_WIN32_NT:
1809- if( ver.dwMajorVersion >= 5 ) // Windows 2000 or later
1810- bMultiDisplaySupport = TRUE;
1811- break;
1812- default:
1813- break;
1814- }
1789+ if (!IsWindows95() && !IsWindowsNT4()) {
1790+ bMultiDisplaySupport = TRUE;
18151791 }
18161792 if( bMultiDisplaySupport ) {
18171793 VirtualScreen.left = GetSystemMetrics(SM_XVIRTUALSCREEN);
--- branches/vs2015_warn/teraterm/teraterm/winjump.c (revision 6236)
+++ branches/vs2015_warn/teraterm/teraterm/winjump.c (revision 6237)
@@ -369,17 +369,7 @@
369369
370370 BOOL isJumpListSupported(void)
371371 {
372- static OSVERSIONINFO osVersion;
373-
374- if (osVersion.dwOSVersionInfoSize != sizeof(OSVERSIONINFO)) {
375- osVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
376- GetVersionEx(&osVersion);
377- }
378- if ((osVersion.dwMajorVersion < 6) ||
379- (osVersion.dwMajorVersion == 6 && osVersion.dwMinorVersion < 1))
380- return FALSE;
381- else
382- return TRUE;
372+ return IsWindows7OrLater();
383373 }
384374
385375 /*
--- branches/vs2015_warn/teraterm/teraterm/clipboar.c (revision 6236)
+++ branches/vs2015_warn/teraterm/teraterm/clipboar.c (revision 6237)
@@ -576,7 +576,6 @@
576576 POINT p;
577577 RECT rc_dsk, rc_dlg;
578578 int dlg_height, dlg_width;
579- OSVERSIONINFO osvi;
580579 static int ok2right, edit2ok, edit2bottom;
581580 RECT rc_edit, rc_ok, rc_cancel;
582581 // for status bar
@@ -622,10 +621,7 @@
622621 // キャレットが画面からはみ出しているときに貼り付けをすると
623622 // 確認ウインドウが見えるところに表示されないことがある。
624623 // ウインドウからはみ出した場合に調節する (2008.4.24 maya)
625- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
626- GetVersionEx(&osvi);
627- if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
628- (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10) ) {
624+ if (IsWindows95() || IsWindowsNT4()) {
629625 // NT4.0, 95 はマルチモニタAPIに非対応
630626 SystemParametersInfo(SPI_GETWORKAREA, 0, &rc_dsk, 0);
631627 }
--- branches/vs2015_warn/teraterm/teraterm/ftdlg.cpp (revision 6236)
+++ branches/vs2015_warn/teraterm/teraterm/ftdlg.cpp (revision 6237)
@@ -177,7 +177,7 @@
177177 // ログファイルはフルパス表示にする(2004.8.6 yutaka)
178178 SetDlgItemText(IDC_EDIT_FULLPATH, &(fv->FullName[0]));
179179
180- if (is_NT4()) {
180+ if (IsWindowsNT4()) {
181181 fuLoad = LR_VGACOLOR;
182182 }
183183 ::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_SMALL,
--- branches/vs2015_warn/teraterm/teraterm/tekwin.cpp (revision 6236)
+++ branches/vs2015_warn/teraterm/teraterm/tekwin.cpp (revision 6237)
@@ -82,7 +82,7 @@
8282 // register this window to the window list
8383 RegWin(HVTWin,HTEKWin);
8484
85- if (is_NT4()) {
85+ if (IsWindowsNT4()) {
8686 fuLoad = LR_VGACOLOR;
8787 }
8888 ::PostMessage(HTEKWin,WM_SETICON,ICON_SMALL,
--- branches/vs2015_warn/teraterm/teraterm/vtwin.cpp (revision 6236)
+++ branches/vs2015_warn/teraterm/teraterm/vtwin.cpp (revision 6237)
@@ -568,7 +568,6 @@
568568 #endif
569569 BOOL ret = FALSE;
570570 int flag = 0;
571- OSVERSIONINFO osvi;
572571 HANDLE hToken;
573572 DWORD dwLength;
574573 TOKEN_ELEVATION tokenElevation;
@@ -579,10 +578,8 @@
579578 DWORD dwType;
580579 BYTE bValue;
581580
582- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
583- GetVersionEx(&osvi);
584581 // Windows Vista以前は無視する。
585- if (!(osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 6))
582+ if (!IsWindowsVistaOrLater())
586583 goto error;
587584
588585 // UACが有効かどうか。
@@ -826,7 +823,7 @@
826823 // USBデバイス変化通知登録
827824 RegDeviceNotify(HVTWin);
828825
829- if (is_NT4()) {
826+ if (IsWindowsNT4()) {
830827 fuLoad = LR_VGACOLOR;
831828 }
832829 ::PostMessage(HVTWin,WM_SETICON,ICON_SMALL,
--- branches/vs2015_warn/teraterm/ttpset/ttset.c (revision 6236)
+++ branches/vs2015_warn/teraterm/ttpset/ttset.c (revision 6237)
@@ -488,7 +488,6 @@
488488 int i;
489489 HDC TmpDC;
490490 char Temp[MAX_PATH], Temp2[MAX_PATH];
491- OSVERSIONINFO osvi;
492491
493492 ts->Minimize = 0;
494493 ts->HideWindow = 0;
@@ -505,9 +504,6 @@
505504
506505 ts->DisableTCPEchoCR = FALSE;
507506
508- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
509- GetVersionEx(&osvi);
510-
511507 /* Version number */
512508 /* GetPrivateProfileString(Section,"Version","",
513509 Temp,sizeof(Temp),FName); */
@@ -933,7 +929,7 @@
933929 ts->MetaKey = IdMetaOff;
934930
935931 // Windows95 系は左右の Alt の判別に非対応
936- if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && ts->MetaKey != IdMetaOff) {
932+ if (!IsWindowsNTKernel() && ts->MetaKey != IdMetaOff) {
937933 ts->MetaKey = IdMetaOn;
938934 }
939935
--- branches/vs2015_warn/teraterm/ttpmacro/ttl.c (revision 6236)
+++ branches/vs2015_warn/teraterm/ttpmacro/ttl.c (revision 6237)
@@ -2385,7 +2385,6 @@
23852385 IP_ADAPTER_ADDRESSES addr[256];/* XXX */
23862386 ULONG len = sizeof(addr);
23872387 char ipv6str[64];
2388- OSVERSIONINFO osvi;
23892388
23902389 Err = 0;
23912390 GetStrAryVar(&VarId,&Err);
@@ -2395,10 +2394,7 @@
23952394 if (Err!=0) return Err;
23962395
23972396 // IPv6 がサポートされていない OS はここで return
2398- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
2399- GetVersionEx(&osvi);
2400- if ( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ||
2401- (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ) {
2397+ if (!IsWindowsNTKernel() || IsWindowsNT4()) {
24022398 // 9x, NT4.0 は IPv6 非対応
24032399 SetResult(-1);
24042400 SetIntVal(VarId2, 0);
--- branches/vs2015_warn/teraterm/ttpmacro/ttmmain.cpp (revision 6236)
+++ branches/vs2015_warn/teraterm/ttpmacro/ttmmain.cpp (revision 6237)
@@ -252,7 +252,7 @@
252252 (CRTHeight-Rect.bottom+Rect.top) / 2,
253253 0,0,SWP_NOSIZE | SWP_NOZORDER);
254254
255- if (is_NT4()) {
255+ if (IsWindowsNT4()) {
256256 fuLoad = LR_VGACOLOR;
257257 }
258258 ::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_SMALL,
--- branches/vs2015_warn/teraterm/ttpmacro/ttmlib.c (revision 6236)
+++ branches/vs2015_warn/teraterm/ttpmacro/ttmlib.c (revision 6237)
@@ -101,14 +101,10 @@
101101
102102 int DoGetSpecialFolder(int CSIDL, PCHAR dest, int dest_len)
103103 {
104- OSVERSIONINFO osvi;
105104 char Path[MAX_PATH] = "";
106105 LPITEMIDLIST pidl;
107106
108- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
109- GetVersionEx(&osvi);
110- if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
111- (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) ) {
107+ if (!IsWindowsNTKernel() || IsWindowsNT4()) {
112108 switch (CSIDL) {
113109 case CSIDL_COMMON_DESKTOPDIRECTORY:
114110 case CSIDL_COMMON_STARTMENU:
@@ -190,12 +186,7 @@
190186
191187 int GetMonitorLeftmost(int PosX, int PosY)
192188 {
193- OSVERSIONINFO osvi;
194-
195- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
196- GetVersionEx(&osvi);
197- if ( (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
198- (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10) ) {
189+ if (IsWindows95() || IsWindowsNT4()) {
199190 // // NT4.0, 95 はマルチモニタAPIに非対応
200191 return 0;
201192 }
--- branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.c (revision 6236)
+++ branches/vs2015_warn/TTXSamples/TTXResizeMenu/TTXResizeMenu.c (revision 6237)
@@ -153,8 +153,6 @@
153153 }
154154
155155 static void PASCAL FAR TTXInit(PTTSet ts, PComVar cv) {
156- OSVERSIONINFO osvi;
157-
158156 pvar->ts = ts;
159157 pvar->cv = cv;
160158 pvar->ReplaceTermDlg = FALSE;
@@ -161,10 +159,7 @@
161159 pvar->ResizeMenu = NULL;
162160 pvar->MenuItems = 0;
163161
164- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
165- GetVersionEx(&osvi);
166- if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 4) ||
167- (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && osvi.dwMinorVersion < 10)) {
162+ if (IsWindows95() || IsWindowsNT4()) {
168163 pvar->useMultiMonitorAPI = FALSE;
169164 }
170165 else {
--- branches/vs2015_warn/ttssh2/ttxssh/ttxssh.c (revision 6236)
+++ branches/vs2015_warn/ttssh2/ttxssh/ttxssh.c (revision 6237)
@@ -826,7 +826,7 @@
826826 {
827827 int fuLoad = LR_DEFAULTCOLOR;
828828
829- if (is_NT4()) {
829+ if (IsWindowsNT4()) {
830830 fuLoad = LR_VGACOLOR;
831831 }
832832
@@ -2926,7 +2926,7 @@
29262926 int fuLoad = LR_DEFAULTCOLOR;
29272927 HICON hicon;
29282928
2929- if (is_NT4()) {
2929+ if (IsWindowsNT4()) {
29302930 fuLoad = LR_VGACOLOR;
29312931 }
29322932
--- branches/vs2015_warn/ttssh2/ttxssh/dns.c (revision 6236)
+++ branches/vs2015_warn/ttssh2/ttxssh/dns.c (revision 6237)
@@ -60,11 +60,8 @@
6060 digest_algorithm dgst_alg;
6161 BYTE *hostkey_digest = NULL;
6262 int found = DNS_VERIFY_NOTFOUND;
63- OSVERSIONINFO osvi;
6463
65- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
66- GetVersionEx(&osvi);
67- if (osvi.dwMajorVersion < 5) {
64+ if (!IsWindows2000OrLater()) {
6865 // DnsQuery は Windows 2000 以上でしか動作しないため
6966 return DNS_VERIFY_NONE;
7067 }
Show on old repository browser