com php-src: Backported the patch from bug #67407 into 5.5+: ext/standard/info.c

From: Date: Tue, 08 Jul 2014 07:54:36 +0000
Subject: com php-src: Backported the patch from bug #67407 into 5.5+: ext/standard/info.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79323@lists.php.net to get a copy of this message
Commit: 51f79846bf5b8829a7fd70b03c278bdd88e5fbce Author: Anatol Belski <ab@php.net> Tue, 8 Jul 2014 09:54:36 +0200 Parents: e715038920301172fe3b0621375a9e3b5de0cf62 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=51f79846bf5b8829a7fd70b03c278bdd88e5fbce Log: Backported the patch from bug #67407 into 5.5+ Bugs: https://bugs.php.net/67407 Changed paths: M ext/standard/info.c Diff: diff --git a/ext/standard/info.c b/ext/standard/info.c index 2c44a82..b2ff32d 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -335,11 +335,37 @@ char* php_get_windows_name() major = "Windows Server 2008 R2"; } } else if ( osvi.dwMinorVersion == 2 ) { - if( osvi.wProductType == VER_NT_WORKSTATION ) { - major = "Windows 8"; + /* could be Windows 8/Windows Server 2012, could be Windows 8.1/Windows Server 2012 R2 */ + OSVERSIONINFOEX osvi81; + DWORDLONG dwlConditionMask = 0; + int op = VER_GREATER_EQUAL; + + ZeroMemory(&osvi81, sizeof(OSVERSIONINFOEX)); + osvi81.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + osvi81.dwMajorVersion = 6; + osvi81.dwMinorVersion = 3; + osvi81.wServicePackMajor = 0; + + VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, op); + VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, op); + VER_SET_CONDITION(dwlConditionMask, VER_SERVICEPACKMAJOR, op); + + if (VerifyVersionInfo(&osvi81, + VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, + dwlConditionMask)) { + osvi.dwMinorVersion = 3; /* Windows 8.1/Windows Server 2012 R2 */ + if( osvi.wProductType == VER_NT_WORKSTATION ) { + major = "Windows 8.1"; + } else { + major = "Windows Server 2012 R2"; + } } else { - major = "Windows Server 2012"; - } + if( osvi.wProductType == VER_NT_WORKSTATION ) { + major = "Windows 8"; + } else { + major = "Windows Server 2012"; + } + } } else { major = "Unknown Windows version"; }

« previous php.cvs (#79323) next »