diff options
Diffstat (limited to 'win32/winutil.h')
-rw-r--r-- | win32/winutil.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/win32/winutil.h b/win32/winutil.h index bdb0f8702b..2edccaab4f 100644 --- a/win32/winutil.h +++ b/win32/winutil.h @@ -16,11 +16,17 @@ +----------------------------------------------------------------------+ */ -PHPAPI char *php_win32_error_to_msg(HRESULT error); +#ifdef PHP_EXPORTS +# define PHP_WINUTIL_API __declspec(dllexport) +#else +# define PHP_WINUTIL_API __declspec(dllimport) +#endif + +PHP_WINUTIL_API char *php_win32_error_to_msg(HRESULT error); #define php_win_err() php_win32_error_to_msg(GetLastError()) int php_win32_check_trailing_space(const char * path, const int path_len); -PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size); +PHP_WINUTIL_API int php_win32_get_random_bytes(unsigned char *buf, size_t size); #ifdef ZTS void php_win32_init_rng_lock(); @@ -29,3 +35,22 @@ void php_win32_free_rng_lock(); #define php_win32_init_rng_lock(); #define php_win32_free_rng_lock(); #endif + +#if !defined(ECURDIR) +# define ECURDIR EACCES +#endif /* !ECURDIR */ +#if !defined(ENOSYS) +# define ENOSYS EPERM +#endif /* !ENOSYS */ + +PHP_WINUTIL_API int php_win32_code_to_errno(unsigned long w32Err); + +#define SET_ERRNO_FROM_WIN32_CODE(err) \ + do { \ + int ern = php_win32_code_to_errno(err); \ + SetLastError(err); \ + _set_errno(ern); \ + } while (0) + +PHP_WINUTIL_API char *php_win32_get_username(void); + |