diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 479ce06ad5015..c3b5ef9b29e40 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3426,7 +3426,7 @@ function toolset_setup_common_ldlags() function toolset_setup_common_libs() { // urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib - DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib"); + DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib Pathcch.lib"); } function toolset_setup_build_mode() diff --git a/win32/dllmain.c b/win32/dllmain.c index 38d143acfedb2..6df644efa9195 100644 --- a/win32/dllmain.c +++ b/win32/dllmain.c @@ -17,7 +17,6 @@ #include #include -#include #ifdef HAVE_LIBXML #include @@ -34,16 +33,11 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID dummy) { BOOL ret = TRUE; +#if 0 /* prepared */ switch (reason) { case DLL_PROCESS_ATTACH: - ret = ret && php_win32_ioutil_init(); - if (!ret) { - fprintf(stderr, "ioutil initialization failed"); - return ret; - } break; -#if 0 /* prepared */ case DLL_PROCESS_DETACH: /* pass */ break; @@ -55,8 +49,8 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID dummy) case DLL_THREAD_DETACH: /* pass */ break; -#endif } +#endif #ifdef HAVE_LIBXML /* This imply that only LIBXML_STATIC_FOR_DLL is supported ATM. diff --git a/win32/ioutil.c b/win32/ioutil.c index a6f2fe2ae2fc1..acd4103c613b1 100644 --- a/win32/ioutil.c +++ b/win32/ioutil.c @@ -67,10 +67,6 @@ #include */ -typedef HRESULT (__stdcall *MyPathCchCanonicalizeEx)(wchar_t *pszPathOut, size_t cchPathOut, const wchar_t *pszPathIn, unsigned long dwFlags); - -static MyPathCchCanonicalizeEx canonicalize_path_w = NULL; - PW32IO BOOL php_win32_ioutil_posix_to_open_opts(int flags, mode_t mode, php_ioutil_open_opts *opts) {/*{{{*/ int current_umask; @@ -619,7 +615,7 @@ PW32IO php_win32_ioutil_normalization_result php_win32_ioutil_normalize_path_w(w } } - if (S_OK != canonicalize_path_w(canonicalw, MAXPATHLEN, _tmp, PATHCCH_ALLOW_LONG_PATHS)) { + if (S_OK != PathCchCanonicalizeEx(canonicalw, MAXPATHLEN, _tmp, PATHCCH_ALLOW_LONG_PATHS)) { /* Length unchanged. */ *new_len = len; return PHP_WIN32_IOUTIL_NORM_PARTIAL; @@ -643,27 +639,6 @@ PW32IO php_win32_ioutil_normalization_result php_win32_ioutil_normalize_path_w(w return PHP_WIN32_IOUTIL_NORM_OK; }/*}}}*/ -static HRESULT __stdcall MyPathCchCanonicalizeExFallback(wchar_t *pszPathOut, size_t cchPathOut, const wchar_t *pszPathIn, unsigned long dwFlags) -{/*{{{*/ - return -42; -}/*}}}*/ - -BOOL php_win32_ioutil_init(void) -{/*{{{*/ - HMODULE hMod = GetModuleHandle("api-ms-win-core-path-l1-1-0"); - - if (hMod) { - canonicalize_path_w = (MyPathCchCanonicalizeEx)GetProcAddress(hMod, "PathCchCanonicalizeEx"); - if (!canonicalize_path_w) { - canonicalize_path_w = (MyPathCchCanonicalizeEx)MyPathCchCanonicalizeExFallback; - } - } else { - canonicalize_path_w = (MyPathCchCanonicalizeEx)MyPathCchCanonicalizeExFallback; - } - - return TRUE; -}/*}}}*/ - PW32IO int php_win32_ioutil_access_w(const wchar_t *path, mode_t mode) {/*{{{*/ DWORD attr; diff --git a/win32/ioutil.h b/win32/ioutil.h index f6105a87f2468..6a7055fc71a77 100644 --- a/win32/ioutil.h +++ b/win32/ioutil.h @@ -169,11 +169,6 @@ typedef enum { } while (0); PW32IO php_win32_ioutil_normalization_result php_win32_ioutil_normalize_path_w(wchar_t **buf, size_t len, size_t *new_len); -#ifdef PHP_EXPORTS -/* This symbols are needed only for the DllMain, but should not be exported - or be available when used with PHP binaries. */ -BOOL php_win32_ioutil_init(void); -#endif /* Keep these functions aliased for case some additional handling is needed later. */