From: Kalle Sommer Nielsen Date: Sun, 29 Mar 2015 07:47:14 +0000 (+0200) Subject: We can re-use the already existing EG(windows_version_info) here and save a little... X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~461 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de2d244f8e4be716b577482eff1ee99cac53702a;p=php We can re-use the already existing EG(windows_version_info) here and save a little bit of memory too! --- diff --git a/ext/standard/info.c b/ext/standard/info.c index e4447bec17..9490aae7d6 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -291,21 +291,14 @@ PHPAPI zend_string *php_info_html_esc(char *string) char* php_get_windows_name() { - OSVERSIONINFOEX osvi; + OSVERSIONINFOEX osvi = EG(windows_version_info); SYSTEM_INFO si; PGNSI pGNSI; PGPI pGPI; - BOOL bOsVersionInfoEx; DWORD dwType; char *major = NULL, *sub = NULL, *retval; ZeroMemory(&si, sizeof(SYSTEM_INFO)); - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - - if (!(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi))) { - return NULL; - } pGNSI = (PGNSI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); if(NULL != pGNSI) {