summaryrefslogtreecommitdiff
path: root/ext/standard/info.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-05-28 03:11:51 +0200
committerAnatol Belski <ab@php.net>2015-05-28 23:23:27 +0200
commite4ca770f95d0eb2893f1db90a0b4a2577e5973c6 (patch)
tree6dc078117b701142db3271af366ac5f64c9fde92 /ext/standard/info.c
parent4bbfa2469ef4d807ad1499c912d690fd3fe8b629 (diff)
downloadphp-git-e4ca770f95d0eb2893f1db90a0b4a2577e5973c6.tar.gz
using correct manifest, GetVersionEx can recognise versions
Diffstat (limited to 'ext/standard/info.c')
-rw-r--r--ext/standard/info.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 9490aae7d6..c5651b43eb 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -307,7 +307,17 @@ char* php_get_windows_name()
GetSystemInfo(&si);
}
- if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 6 ) {
+ if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 10) {
+ if (osvi.dwMajorVersion == 10) {
+ if( osvi.dwMinorVersion == 0 ) {
+ if( osvi.wProductType == VER_NT_WORKSTATION ) {
+ major = "Windows 10";
+ } else {
+ major = "Windows Server 2016";
+ }
+ }
+ }
+ } else if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 6) {
if (osvi.dwMajorVersion == 6) {
if( osvi.dwMinorVersion == 0 ) {
if( osvi.wProductType == VER_NT_WORKSTATION ) {
@@ -323,6 +333,11 @@ char* php_get_windows_name()
}
} else if ( osvi.dwMinorVersion == 2 ) {
/* could be Windows 8/Windows Server 2012, could be Windows 8.1/Windows Server 2012 R2 */
+ /* XXX and one more X - the above comment is true if no manifest is used for two cases:
+ - if the PHP build doesn't use the correct manifest
+ - if PHP DLL loaded under some binary that doesn't use the correct manifest
+
+ So keep the handling here as is for now, even if we know 6.2 is win8 and nothing else, and think about an improvement. */
OSVERSIONINFOEX osvi81;
DWORDLONG dwlConditionMask = 0;
int op = VER_GREATER_EQUAL;
@@ -353,6 +368,12 @@ char* php_get_windows_name()
major = "Windows Server 2012";
}
}
+ } else if (osvi.dwMinorVersion == 3) {
+ if( osvi.wProductType == VER_NT_WORKSTATION ) {
+ major = "Windows 8.1";
+ } else {
+ major = "Windows Server 2012 R2";
+ }
} else {
major = "Unknown Windows version";
}