Bug #67407 [Opn->Csd]: Windows 8.1/Server 2012 R2 reported as Windows 8/Server 2012

From: Date: Tue, 08 Jul 2014 08:01:09 +0000
Subject: Bug #67407 [Opn->Csd]: Windows 8.1/Server 2012 R2 reported as Windows 8/Server 2012
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186519@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67407&edit=1 ID: 67407 Updated by: ab@php.net Reported by: wenz@php.net Summary: Windows 8.1/Server 2012 R2 reported as Windows 8/Server 2012 -Status: Open +Status: Closed Type: Bug Package: PHP options/info functions Operating System: Windows 8.1 PHP Version: master-Git-2014-06-10 (Git) -Assigned To: +Assigned To: ab Block user comment: N Private report: N New Comment: Merged in 4883a60bb3412e5c776153703d7e0ff0a490482b , also backported into 5.4+ Previous Comments: ------------------------------------------------------------------------ [2014-06-10 08:40:11] wenz@php.net The following patch has been added/updated: Patch Name: detect-Win81-Server2012R2 Revision: 1402389611 URL: https://bugs.php.net/patch-display.php?bug=67407&patch=detect-Win81-Server2012R2&revision=1402389611 ------------------------------------------------------------------------ [2014-06-10 08:39:34] wenz@php.net Description: ------------ The phpinfo() output on Windows 8.1 and Windows Server 2012 R2 reports the OS as Windows 8 and Windows Server 2012. This is due to the deprecation of GetVersionEx (which we are using) on these platforms - http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074%28v=vs.85%29.aspx Once we compile the Windows builds with the Visual Studio 2013 compiler and the Windows 8.1 SDK, _NT_TARGET_VERSION=$(_NT_TARGET_VERSION_LATEST) seems to help. However until then we need a different approach. VerifyVersionInfo (http://msdn.microsoft.com/en-us/library/windows/desktop/ms725491%28v=vs.85%29.aspx) looks like the best solution to me. It is slower than GetVersionEx, so we should only run it if we detect Windows 8/Server 2012 and then need to decide whether it's 8.1/2012 R2 instead. The attached patch proposes an implementation. Test script: --------------- <?php phpinfo(INFO_GENERAL); Expected result: ---------------- Output contains "Windows 8.1" on a Windows 8.1 machine. Output contains "Windows Server 2012 R2" on a Windows Server 2012 R2 machine. Actual result: -------------- Output contains "Windows 8" (and not 8.1) on a Windows 8.1 machine. Output contains "Windows Server 2012" (and not R2) on a Windows Server 2012 R2 machine. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67407&edit=1

« previous php.bugs (#186519) next »