mirror of
https://github.com/php/php-src.git
synced 2026-04-26 01:18:19 +02:00
Backported the patch from bug #67407 into 5.4
This commit is contained in:
+33
-1
@@ -328,7 +328,7 @@ char* php_get_windows_name()
|
||||
}
|
||||
|
||||
if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion > 4 ) {
|
||||
if (osvi.dwMajorVersion == 6) {
|
||||
if (osvi.dwMajorVersion == 6) {
|
||||
if( osvi.dwMinorVersion == 0 ) {
|
||||
if( osvi.wProductType == VER_NT_WORKSTATION ) {
|
||||
major = "Windows Vista";
|
||||
@@ -342,6 +342,38 @@ char* php_get_windows_name()
|
||||
} else {
|
||||
major = "Windows Server 2008 R2";
|
||||
}
|
||||
} else if ( osvi.dwMinorVersion == 2 ) {
|
||||
/* 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 {
|
||||
if( osvi.wProductType == VER_NT_WORKSTATION ) {
|
||||
major = "Windows 8";
|
||||
} else {
|
||||
major = "Windows Server 2012";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
major = "Unknown Windows version";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user