From 46c0f213867bbc687b83c7d28083adfe1dae4ec5 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sun, 30 May 2010 07:46:45 +0000 Subject: [PATCH] - Added recent Windows versions to php_uname and fix undefined windows version --- NEWS | 2 ++ ext/standard/info.c | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 769dd698bc..6f44506cde 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ PHP NEWS Made implicit use of NULL IV a warning. (Sara) - Added openssl_cipher_iv_length(). (Sara) - Added FastCGI Process Manager (FPM) SAPI. (Tony) +- Added recent Windows versions to php_uname and fix undefined windows + version support. (Pierre) - Changed namespaced classes so that the ctor can only be named __construct now. (Stas) diff --git a/ext/standard/info.c b/ext/standard/info.c index f9d3299896..18483a37da 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -281,11 +281,22 @@ char* php_get_windows_name() } if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion > 4 ) { - if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 ) { - if (osvi.wProductType == VER_NT_WORKSTATION) { - major = "Windows Vista"; + if (osvi.dwMajorVersion == 6) { + if( osvi.dwMinorVersion == 0 ) { + if( osvi.wProductType == VER_NT_WORKSTATION ) { + major = "Windows Vista"; + } else { + major = "Windows Server 2008"; + } + } else + if ( osvi.dwMinorVersion == 2 ) { + if( osvi.wProductType == VER_NT_WORKSTATION ) { + major = "Windows 7"; + } else { + major = "Windows Server 2008 R2"; + } } else { - major = "Windows Server 2008"; + major = "Unknow Windows version"; } pGPI = (PGPI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProductInfo"); -- 2.40.0