php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
winutil.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: |
14 +----------------------------------------------------------------------+
15 */
16
17#ifndef PHP_WIN32_WINUTIL_H
18#define PHP_WIN32_WINUTIL_H
19
20#ifdef PHP_EXPORTS
21# define PHP_WINUTIL_API __declspec(dllexport)
22#else
23# define PHP_WINUTIL_API __declspec(dllimport)
24#endif
25
28
29#define php_win_err() php_win32_error_to_msg(GetLastError())
30#define php_win_err_free(err) php_win32_error_msg_free(err)
31int php_win32_check_trailing_space(const char * path, const size_t path_len);
32PHP_WINUTIL_API int php_win32_get_random_bytes(unsigned char *buf, size_t size);
33#ifdef PHP_EXPORTS
34BOOL php_win32_init_random_bytes(void);
35BOOL php_win32_shutdown_random_bytes(void);
36#endif
37
38#if !defined(ECURDIR)
39# define ECURDIR EACCES
40#endif /* !ECURDIR */
41#if !defined(ENOSYS)
42# define ENOSYS EPERM
43#endif /* !ENOSYS */
44
45PHP_WINUTIL_API int php_win32_code_to_errno(unsigned long w32Err);
46
47#define SET_ERRNO_FROM_WIN32_CODE(err) \
48 do { \
49 int ern = php_win32_code_to_errno(err); \
50 SetLastError(err); \
51 _set_errno(ern); \
52 } while (0)
53
55
58
59#endif
#define PHP_WINUTIL_API
Definition console.h:24
error($message)
Definition ext_skel.php:22
DL_HANDLE handle
Definition ffi.c:3028
new_type size
Definition ffi.c:4365
char * err
Definition ffi.c:3029
zend_ffi_ctype_name_buf buf
Definition ffi.c:4685
int BOOL
char * msg
Definition phpdbg.h:289
PHP_WINUTIL_API char * php_win32_error_to_msg(HRESULT error)
Definition winutil.c:25
PHP_WINUTIL_API BOOL php_win32_crt_compatible(char **err)
Definition winutil.c:485
PHP_WINUTIL_API char * php_win32_get_username(void)
Definition winutil.c:421
PHP_WINUTIL_API int php_win32_get_random_bytes(unsigned char *buf, size_t size)
Definition winutil.c:103
PHP_WINUTIL_API int php_win32_code_to_errno(unsigned long w32Err)
Definition winutil.c:134
int php_win32_check_trailing_space(const char *path, const size_t path_len)
Definition winutil.c:57
PHP_WINUTIL_API BOOL php_win32_image_compatible(HMODULE handle, char **err)
Definition winutil.c:479
PHP_WINUTIL_API void php_win32_error_msg_free(char *msg)
Definition winutil.c:50