From de2d244f8e4be716b577482eff1ee99cac53702a Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Sun, 29 Mar 2015 09:47:14 +0200 Subject: [PATCH] We can re-use the already existing EG(windows_version_info) here and save a little bit of memory too! --- ext/standard/info.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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) { -- 2.40.0