@@ -255,7 +255,7 @@ static char* php_get_windows_name()
255
255
OSVERSIONINFOEX osvi = EG (windows_version_info );
256
256
SYSTEM_INFO si ;
257
257
DWORD dwType ;
258
- char * major = NULL , * sub = NULL , * retval ;
258
+ const char * major = NULL , * sub = NULL ;
259
259
260
260
ZeroMemory (& si , sizeof (SYSTEM_INFO ));
261
261
@@ -296,19 +296,19 @@ static char* php_get_windows_name()
296
296
}
297
297
} else if (VER_PLATFORM_WIN32_NT == osvi .dwPlatformId && osvi .dwMajorVersion >= 6 ) {
298
298
if (osvi .dwMajorVersion == 6 ) {
299
- if ( osvi .dwMinorVersion == 0 ) {
300
- if ( osvi .wProductType == VER_NT_WORKSTATION ) {
299
+ if ( osvi .dwMinorVersion == 0 ) {
300
+ if ( osvi .wProductType == VER_NT_WORKSTATION ) {
301
301
major = "Windows Vista" ;
302
302
} else {
303
303
major = "Windows Server 2008" ;
304
304
}
305
- } else if ( osvi .dwMinorVersion == 1 ) {
306
- if ( osvi .wProductType == VER_NT_WORKSTATION ) {
305
+ } else if (osvi .dwMinorVersion == 1 ) {
306
+ if ( osvi .wProductType == VER_NT_WORKSTATION ) {
307
307
major = "Windows 7" ;
308
308
} else {
309
309
major = "Windows Server 2008 R2" ;
310
310
}
311
- } else if ( osvi .dwMinorVersion == 2 ) {
311
+ } else if (osvi .dwMinorVersion == 2 ) {
312
312
/* could be Windows 8/Windows Server 2012, could be Windows 8.1/Windows Server 2012 R2 */
313
313
/* XXX and one more X - the above comment is true if no manifest is used for two cases:
314
314
- if the PHP build doesn't use the correct manifest
@@ -333,20 +333,20 @@ static char* php_get_windows_name()
333
333
VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR ,
334
334
dwlConditionMask )) {
335
335
osvi .dwMinorVersion = 3 ; /* Windows 8.1/Windows Server 2012 R2 */
336
- if ( osvi .wProductType == VER_NT_WORKSTATION ) {
336
+ if ( osvi .wProductType == VER_NT_WORKSTATION ) {
337
337
major = "Windows 8.1" ;
338
338
} else {
339
339
major = "Windows Server 2012 R2" ;
340
340
}
341
341
} else {
342
- if ( osvi .wProductType == VER_NT_WORKSTATION ) {
342
+ if ( osvi .wProductType == VER_NT_WORKSTATION ) {
343
343
major = "Windows 8" ;
344
344
} else {
345
345
major = "Windows Server 2012" ;
346
346
}
347
347
}
348
348
} else if (osvi .dwMinorVersion == 3 ) {
349
- if ( osvi .wProductType == VER_NT_WORKSTATION ) {
349
+ if ( osvi .wProductType == VER_NT_WORKSTATION ) {
350
350
major = "Windows 8.1" ;
351
351
} else {
352
352
major = "Windows Server 2012 R2" ;
@@ -602,9 +602,10 @@ static char* php_get_windows_name()
602
602
}
603
603
}
604
604
} else {
605
- return NULL ;
605
+ ZEND_UNREACHABLE () ;
606
606
}
607
607
608
+ char * retval ;
608
609
spprintf (& retval , 0 , "%s%s%s%s%s" , major , sub ?" " :"" , sub ?sub :"" , osvi .szCSDVersion [0 ] != '\0' ?" " :"" , osvi .szCSDVersion );
609
610
return retval ;
610
611
}
0 commit comments