summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-04-05 19:45:04 +0200
committerAnatol Belski <ab@php.net>2015-04-05 19:46:38 +0200
commit92324b2719386c8a70bef0eb243f853f6df9a93b (patch)
tree66282da7277a6ef876fc11b9197c97ff8774249e /Zend/zend.c
parentb6aeab1b9177f4f6b89e7c1553fd946ea164002c (diff)
downloadphp-git-92324b2719386c8a70bef0eb243f853f6df9a93b.tar.gz
fix nts windows_version_info and reorganize
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 77be1cd5a9..abaa0d22e0 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -399,6 +399,16 @@ static void zend_set_default_compile_time_values(void) /* {{{ */
}
/* }}} */
+static void zend_get_windows_version_info(OSVERSIONINFOEX *osvi) /* {{{ */
+{
+ ZeroMemory(osvi, sizeof(OSVERSIONINFOEX));
+ osvi->dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ if(!GetVersionEx((OSVERSIONINFO *) osvi)) {
+ ZEND_ASSERT(0); /* Should not happen as sizeof is used. */
+ }
+}
+/* }}} */
+
static void zend_init_exception_op(void) /* {{{ */
{
memset(EG(exception_op), 0, sizeof(EG(exception_op)));
@@ -517,11 +527,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
executor_globals->exception = NULL;
executor_globals->objects_store.object_buckets = NULL;
#ifdef ZEND_WIN32
- ZeroMemory(&executor_globals->windows_version_info, sizeof(OSVERSIONINFOEX));
- executor_globals->windows_version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- if (!GetVersionEx((OSVERSIONINFO *) &executor_globals->windows_version_info)) {
- ZEND_ASSERT(0); /* Should not happen as sizeof is used. */
- }
+ zend_get_windows_version_info(&executor_globals->windows_version_info);
#endif
}
/* }}} */
@@ -773,6 +779,9 @@ void zend_post_startup(void) /* {{{ */
global_persistent_list = &EG(persistent_list);
zend_copy_ini_directives();
#else
+#ifdef ZEND_WIN32
+ zend_get_windows_version_info(&EG(windows_version_info));
+#endif
virtual_cwd_deactivate();
#endif
}