diff --git a/win32/ioutil.c b/win32/ioutil.c index 3231b92ffc5b0..c9464c9474481 100644 --- a/win32/ioutil.c +++ b/win32/ioutil.c @@ -281,7 +281,8 @@ PW32IO int php_win32_ioutil_close(int fd) PW32IO int php_win32_ioutil_mkdir_w(const wchar_t *path, mode_t mode) {/*{{{*/ - size_t path_len, dir_len = 0; + size_t path_len; + DWORD dir_len = 0; const wchar_t *my_path; if (!path) { @@ -336,7 +337,7 @@ PW32IO int php_win32_ioutil_mkdir_w(const wchar_t *path, mode_t mode) dst = _tmp + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW; #ifndef ZTS if (dir_len > 0) { - size_t len = GetCurrentDirectoryW(dir_len, dst); + DWORD len = GetCurrentDirectoryW(dir_len, dst); if (len == 0 || len + 1 != dir_len) { free(tmp); free(_tmp); diff --git a/win32/ioutil.h b/win32/ioutil.h index 8b9ed491ffd99..affe7607455b1 100644 --- a/win32/ioutil.h +++ b/win32/ioutil.h @@ -175,7 +175,8 @@ PW32IO php_win32_ioutil_normalization_result php_win32_ioutil_normalize_path_w(w zend_always_inline static wchar_t *php_win32_ioutil_conv_any_to_w(const char* in, size_t in_len, size_t *out_len) {/*{{{*/ wchar_t *mb, *ret; - size_t mb_len, dir_len = 0; + size_t mb_len; + DWORD dir_len = 0; mb = php_win32_cp_conv_any_to_w(in, in_len, &mb_len); if (!mb) { @@ -227,8 +228,8 @@ zend_always_inline static wchar_t *php_win32_ioutil_conv_any_to_w(const char* in memcpy(ret, PHP_WIN32_IOUTIL_LONG_PATH_PREFIXW, PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW * sizeof(wchar_t)); #ifndef ZTS if (dir_len > 0) { - size_t len = GetCurrentDirectoryW(dir_len, dst); - if (len == 0 || len + 1 != dir_len) { + DWORD len = GetCurrentDirectoryW(dir_len, dst); + if (len == 0 || len != dir_len - 1) { free(ret); free(mb); return NULL;