diff options
| author | Pierre Joye <pajoye@php.net> | 2011-01-20 06:23:35 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2011-01-20 06:23:35 +0000 |
| commit | af0c734f4f01eb7025f09c9c563f63a5a5741e8e (patch) | |
| tree | c4e91409293fe6265e524960e05cfd53fa66782d /main | |
| parent | 2e3e65c5b77388b064fd5e0087ebf57dfdb70eb0 (diff) | |
| download | php-git-af0c734f4f01eb7025f09c9c563f63a5a5741e8e.tar.gz | |
- check if strdup succeeds
Diffstat (limited to 'main')
| -rw-r--r-- | main/main.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/main/main.c b/main/main.c index 085bd08ad7..75daefc6ae 100644 --- a/main/main.c +++ b/main/main.c @@ -180,7 +180,9 @@ static void php_disable_functions(TSRMLS_D) } e = PG(disable_functions) = strdup(INI_STR("disable_functions")); - + if (e == NULL) { + return; + } while (*e) { switch (*e) { case ' ': @@ -1715,8 +1717,9 @@ PHPAPI void php_com_initialize(TSRMLS_D) { #ifdef PHP_WIN32 if (!PG(com_initialized)) { - CoInitialize(NULL); - PG(com_initialized) = 1; + if (CoInitialize(NULL) == S_OK) { + PG(com_initialized) = 1; + } } #endif } @@ -1820,6 +1823,7 @@ void dummy_invalid_parameter_handler( } } #endif +EXTERN_C IMAGE_DOS_HEADER __ImageBase; /* {{{ php_module_startup */ @@ -1835,6 +1839,10 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod void ***tsrm_ls; php_core_globals *core_globals; #endif +#ifdef PHP_WIN32 + char module_path[MAX_PATH]; +#endif + #if defined(PHP_WIN32) || (defined(NETWARE) && defined(USE_WINSOCK)) WORD wVersionRequested = MAKEWORD(2, 0); WSADATA wsaData; @@ -1854,7 +1862,15 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod #else php_os=PHP_OS; #endif - + GetModuleFileName((HINSTANCE)&__ImageBase, module_path, MAX_PATH); + php_dirname(module_path, strlen(module_path)); + { + char dll_dir[MAX_PATH]; + sprintf(dll_dir, "%s\\%s", module_path, "..\\..\\deps\\bin"); + SetDllDirectory(dll_dir); + } +// GetModuleFileName (NULL, module_path, MAX_PATH); +//__debugbreak(); #ifdef ZTS tsrm_ls = ts_resource(0); #endif |
