Bug #69642 [Fbk]: Windows 10 reported as Windows 8 in phpinfo()

From: Date: Wed, 27 May 2015 23:18:07 +0000
Subject: Bug #69642 [Fbk]: Windows 10 reported as Windows 8 in phpinfo()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192945@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69642&edit=1 ID: 69642 Updated by: ab@php.net Reported by: wenz@php.net Summary: Windows 10 reported as Windows 8 in phpinfo() Status: Feedback Type: Bug Package: PHP options/info functions Operating System: Windows 10 PHP Version: master-Git-2015-05-15 (Git) Assigned To: ab Block user comment: N Private report: N New Comment: Pah, I've managed a simple snippet now to work with manifest. Look: ================= getversionex.c ================= #include <windows.h> #include <stdio.h> void main() { OSVERSIONINFO osvi; BOOL bIsWindowsXPorLater; ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&osvi); bIsWindowsXPorLater = ( (osvi.dwMajorVersion > 5) || ( (osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion >= 1) )); printf("major=%d minor=%d\n", osvi.dwMajorVersion, osvi.dwMinorVersion); } ================= getversionex.c ================= ==================== my.manifest ======================== <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" > <asmv3:application> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> <dpiAware>True/PM</dpiAware> </asmv3:windowsSettings> </asmv3:application> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!-- Windows Vista --> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- Windows 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- Windows 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- Windows 10 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> </application> </compatibility> </assembly> ==================== my.manifest ======================== Then the following commands: cl getversionex.c mt -manifest my.manifest -outputresource:getversionex.exe;1 And, we already have a mechanism in the makefile to run the latter command. So what i do think now - we should dig into this, probably use the default manifest if an extension/sapi doesn't supply one. I also haven't checked how it behaves when say it's a dll which is loaded in the exe without embedded manifest, should be checked yet. But if it works, we should use GetVersionEx - it's available in all the Windows versions including win10. If it's disappeared somewhen - well, then it needs to be changed. It should be also better from the performance side. If GetVersionEx did disappear somewhen, so maybe also dont use a CRT which doesn't fully support the version helper stuff. What do you think? Thanks. Previous Comments: ------------------------------------------------------------------------ [2015-05-27 20:14:03] ab@php.net Thanks for checking anyway. I'm going to continue investigating on the manifest stuff, if that didn't worked - will probably go your way integrating the file version reading. Thanks. ------------------------------------------------------------------------ [2015-05-27 19:01:56] wenz@php.net yeah, standalone it works, but (as far as I understand it) the GetVersionInfoSize and GetVersionInfo functions are only available if I pull them out of version.dll using GetProcAddress(), and that's what somehow doesn't work in my patch. Or I am missing something trivial, which might very well be possible with my rusty C. ------------------------------------------------------------------------ [2015-05-27 18:41:47] ab@php.net Please check this https://gist.github.com/weltling/bc99faed4f09d615b7a7 . This works with vc9 to vc14. But I'm completely not sure we should use it, it adds one more dll dependency. Heh ... i'd still prefer to dig further for manifests. Thanks. ------------------------------------------------------------------------ [2015-05-27 18:30:31] wenz@php.net took a closer look at it. Actually my non-working patch uses a very similar approach. I fail at using the GetFileVersionInfoSize and GetFileVersionInfo functions from version.dll - getting NULL back (see the patch). Is there something obvious I am missing? ------------------------------------------------------------------------ [2015-05-27 12:47:17] wenz@php.net Sorry for the late reply. I did try the manifest approach, but did not get any change in behavior. Maybe there is a way to embed the manifest in the executable, but I did not succeed in doing so. The file version approach sounds good. I am trying a similar approach in my (non-functional) patch, but the link you posted looks very promising. Will probably try that tomorrow. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=69642 -- Edit this bug report at https://bugs.php.net/bug.php?id=69642&edit=1

« previous php.bugs (#192945) next »